From f854944dc1005bbc455670ac8870fe826bbec2f6 Mon Sep 17 00:00:00 2001 From: orfelorfel23 Date: Sat, 12 Sep 2026 19:30:57 +0200 Subject: [PATCH] feat: complete rework with postgresql local-first, system audio capture, live search, and real harmonic suggestions --- .gitignore | Bin 88 -> 67 bytes db/schema.sql | 105 +- docker-compose.yml | 40 + dummy.webm | Bin 16 -> 0 bytes public/app.js | 404 +- public/index.html | 125 +- public/search.js | 463 +- public/styles.css | 219 +- server/db.js | 222 + server/index.js | 15 +- server/node_modules/.bin/mime | 16 - server/node_modules/.bin/mime.cmd | 17 - server/node_modules/.bin/mime.ps1 | 28 - server/node_modules/.package-lock.json | 1235 --- server/node_modules/accepts/HISTORY.md | 243 - server/node_modules/accepts/LICENSE | 23 - server/node_modules/accepts/README.md | 140 - server/node_modules/accepts/index.js | 238 - server/node_modules/accepts/package.json | 47 - server/node_modules/agent-base/README.md | 145 - .../agent-base/dist/src/index.d.ts | 78 - .../node_modules/agent-base/dist/src/index.js | 203 - .../agent-base/dist/src/index.js.map | 1 - .../agent-base/dist/src/promisify.d.ts | 4 - .../agent-base/dist/src/promisify.js | 18 - .../agent-base/dist/src/promisify.js.map | 1 - .../agent-base/node_modules/debug/LICENSE | 20 - .../agent-base/node_modules/debug/README.md | 481 - .../node_modules/debug/package.json | 64 - .../node_modules/debug/src/browser.js | 272 - .../node_modules/debug/src/common.js | 292 - .../node_modules/debug/src/index.js | 10 - .../agent-base/node_modules/debug/src/node.js | 263 - .../agent-base/node_modules/ms/index.js | 162 - .../agent-base/node_modules/ms/license.md | 21 - .../agent-base/node_modules/ms/package.json | 38 - .../agent-base/node_modules/ms/readme.md | 59 - server/node_modules/agent-base/package.json | 64 - server/node_modules/agent-base/src/index.ts | 345 - .../node_modules/agent-base/src/promisify.ts | 33 - server/node_modules/append-field/.npmignore | 1 - server/node_modules/append-field/LICENSE | 21 - server/node_modules/append-field/README.md | 44 - server/node_modules/append-field/index.js | 12 - .../append-field/lib/parse-path.js | 53 - .../append-field/lib/set-value.js | 64 - server/node_modules/append-field/package.json | 19 - .../node_modules/append-field/test/forms.js | 19 - server/node_modules/array-flatten/LICENSE | 21 - server/node_modules/array-flatten/README.md | 43 - .../array-flatten/array-flatten.js | 64 - .../node_modules/array-flatten/package.json | 39 - server/node_modules/asynckit/LICENSE | 21 - server/node_modules/asynckit/README.md | 233 - server/node_modules/asynckit/bench.js | 76 - server/node_modules/asynckit/index.js | 6 - server/node_modules/asynckit/lib/abort.js | 29 - server/node_modules/asynckit/lib/async.js | 34 - server/node_modules/asynckit/lib/defer.js | 26 - server/node_modules/asynckit/lib/iterate.js | 75 - .../asynckit/lib/readable_asynckit.js | 91 - .../asynckit/lib/readable_parallel.js | 25 - .../asynckit/lib/readable_serial.js | 25 - .../asynckit/lib/readable_serial_ordered.js | 29 - server/node_modules/asynckit/lib/state.js | 37 - server/node_modules/asynckit/lib/streamify.js | 141 - .../node_modules/asynckit/lib/terminator.js | 29 - server/node_modules/asynckit/package.json | 63 - server/node_modules/asynckit/parallel.js | 43 - server/node_modules/asynckit/serial.js | 17 - server/node_modules/asynckit/serialOrdered.js | 75 - server/node_modules/asynckit/stream.js | 21 - server/node_modules/axios/CHANGELOG.md | 1872 ---- server/node_modules/axios/LICENSE | 7 - server/node_modules/axios/MIGRATION_GUIDE.md | 877 -- server/node_modules/axios/README.md | 2623 ----- server/node_modules/axios/dist/axios.js | 5509 ----------- server/node_modules/axios/dist/axios.min.js | 5 - .../node_modules/axios/dist/axios.min.js.map | 1 - .../node_modules/axios/dist/browser/axios.cjs | 5469 ----------- server/node_modules/axios/dist/esm/axios.js | 5490 ----------- .../node_modules/axios/dist/esm/axios.min.js | 3 - .../axios/dist/esm/axios.min.js.map | 1 - server/node_modules/axios/dist/node/axios.cjs | 6356 ------------ server/node_modules/axios/index.d.cts | 762 -- server/node_modules/axios/index.d.ts | 783 -- server/node_modules/axios/index.js | 45 - .../node_modules/axios/lib/adapters/README.md | 36 - .../axios/lib/adapters/adapters.js | 132 - .../node_modules/axios/lib/adapters/fetch.js | 643 -- .../node_modules/axios/lib/adapters/http.js | 1406 --- server/node_modules/axios/lib/adapters/xhr.js | 228 - server/node_modules/axios/lib/axios.js | 89 - .../axios/lib/cancel/CancelToken.js | 135 - .../axios/lib/cancel/CanceledError.js | 22 - .../node_modules/axios/lib/cancel/isCancel.js | 5 - server/node_modules/axios/lib/core/Axios.js | 301 - .../node_modules/axios/lib/core/AxiosError.js | 219 - .../axios/lib/core/AxiosHeaders.js | 474 - .../axios/lib/core/InterceptorManager.js | 72 - server/node_modules/axios/lib/core/README.md | 8 - .../axios/lib/core/buildFullPath.js | 88 - .../axios/lib/core/dispatchRequest.js | 89 - .../axios/lib/core/mergeConfig.js | 174 - .../axios/lib/core/setFormDataHeaders.js | 27 - server/node_modules/axios/lib/core/settle.js | 27 - .../axios/lib/core/transformData.js | 28 - .../node_modules/axios/lib/defaults/index.js | 177 - .../axios/lib/defaults/transitional.js | 10 - server/node_modules/axios/lib/env/README.md | 3 - .../axios/lib/env/classes/FormData.js | 2 - server/node_modules/axios/lib/env/data.js | 1 - .../axios/lib/helpers/AxiosTransformStream.js | 156 - .../axios/lib/helpers/AxiosURLSearchParams.js | 59 - .../axios/lib/helpers/Http2Sessions.js | 119 - .../axios/lib/helpers/HttpStatusCode.js | 78 - .../node_modules/axios/lib/helpers/README.md | 7 - .../lib/helpers/ZlibHeaderTransformStream.js | 29 - server/node_modules/axios/lib/helpers/bind.js | 14 - .../axios/lib/helpers/buildURL.js | 69 - .../axios/lib/helpers/callbackify.js | 18 - .../axios/lib/helpers/combineURLs.js | 23 - .../axios/lib/helpers/composeSignals.js | 68 - .../node_modules/axios/lib/helpers/cookies.js | 64 - .../axios/lib/helpers/deprecatedMethod.js | 31 - .../helpers/estimateDataURLDecodedBytes.js | 166 - .../axios/lib/helpers/formDataToJSON.js | 125 - .../axios/lib/helpers/formDataToStream.js | 119 - .../axios/lib/helpers/fromDataURI.js | 68 - .../axios/lib/helpers/isAbsoluteURL.js | 19 - .../axios/lib/helpers/isAxiosError.js | 14 - .../axios/lib/helpers/isURLSameOrigin.js | 16 - server/node_modules/axios/lib/helpers/null.js | 2 - .../axios/lib/helpers/parseHeaders.js | 71 - .../axios/lib/helpers/parseProtocol.js | 6 - .../axios/lib/helpers/progressEventReducer.js | 54 - .../axios/lib/helpers/readBlob.js | 15 - .../axios/lib/helpers/resolveConfig.js | 105 - .../axios/lib/helpers/sanitizeHeaderValue.js | 60 - .../axios/lib/helpers/shouldBypassProxy.js | 329 - .../axios/lib/helpers/speedometer.js | 55 - .../node_modules/axios/lib/helpers/spread.js | 28 - .../axios/lib/helpers/throttle.js | 44 - .../axios/lib/helpers/toFormData.js | 286 - .../axios/lib/helpers/toURLEncodedForm.js | 19 - .../axios/lib/helpers/trackStream.js | 89 - .../axios/lib/helpers/validator.js | 112 - .../lib/platform/browser/classes/Blob.js | 3 - .../lib/platform/browser/classes/FormData.js | 3 - .../browser/classes/URLSearchParams.js | 4 - .../axios/lib/platform/browser/index.js | 13 - .../axios/lib/platform/common/utils.js | 52 - .../node_modules/axios/lib/platform/index.js | 7 - .../axios/lib/platform/node/classes/Buffer.js | 11 - .../lib/platform/node/classes/FormData.js | 3 - .../platform/node/classes/URLSearchParams.js | 4 - .../axios/lib/platform/node/index.js | 37 - server/node_modules/axios/lib/utils.js | 1029 -- server/node_modules/axios/package.json | 203 - server/node_modules/body-parser/HISTORY.md | 692 -- server/node_modules/body-parser/LICENSE | 23 - server/node_modules/body-parser/README.md | 476 - server/node_modules/body-parser/index.js | 156 - server/node_modules/body-parser/lib/read.js | 205 - .../body-parser/lib/types/json.js | 247 - .../node_modules/body-parser/lib/types/raw.js | 105 - .../body-parser/lib/types/text.js | 125 - .../body-parser/lib/types/urlencoded.js | 303 - server/node_modules/body-parser/package.json | 55 - server/node_modules/buffer-from/LICENSE | 21 - server/node_modules/buffer-from/index.js | 72 - server/node_modules/buffer-from/package.json | 19 - server/node_modules/buffer-from/readme.md | 69 - server/node_modules/busboy/.eslintrc.js | 5 - .../busboy/.github/workflows/ci.yml | 24 - .../busboy/.github/workflows/lint.yml | 23 - server/node_modules/busboy/LICENSE | 19 - server/node_modules/busboy/README.md | 191 - .../bench/bench-multipart-fields-100mb-big.js | 149 - .../bench-multipart-fields-100mb-small.js | 143 - .../bench/bench-multipart-files-100mb-big.js | 154 - .../bench-multipart-files-100mb-small.js | 148 - .../bench-urlencoded-fields-100pairs-small.js | 101 - ...ch-urlencoded-fields-900pairs-small-alt.js | 84 - server/node_modules/busboy/lib/index.js | 57 - .../busboy/lib/types/multipart.js | 653 -- .../busboy/lib/types/urlencoded.js | 350 - server/node_modules/busboy/lib/utils.js | 596 -- server/node_modules/busboy/package.json | 22 - server/node_modules/busboy/test/common.js | 109 - .../test/test-types-multipart-charsets.js | 94 - .../test/test-types-multipart-stream-pause.js | 102 - .../busboy/test/test-types-multipart.js | 1053 -- .../busboy/test/test-types-urlencoded.js | 488 - server/node_modules/busboy/test/test.js | 20 - server/node_modules/bytes/History.md | 97 - server/node_modules/bytes/LICENSE | 23 - server/node_modules/bytes/Readme.md | 152 - server/node_modules/bytes/index.js | 170 - server/node_modules/bytes/package.json | 42 - .../call-bind-apply-helpers/.eslintrc | 17 - .../.github/FUNDING.yml | 12 - .../call-bind-apply-helpers/.nycrc | 9 - .../call-bind-apply-helpers/CHANGELOG.md | 30 - .../call-bind-apply-helpers/LICENSE | 21 - .../call-bind-apply-helpers/README.md | 62 - .../call-bind-apply-helpers/actualApply.d.ts | 1 - .../call-bind-apply-helpers/actualApply.js | 10 - .../call-bind-apply-helpers/applyBind.d.ts | 19 - .../call-bind-apply-helpers/applyBind.js | 10 - .../functionApply.d.ts | 1 - .../call-bind-apply-helpers/functionApply.js | 4 - .../call-bind-apply-helpers/functionCall.d.ts | 1 - .../call-bind-apply-helpers/functionCall.js | 4 - .../call-bind-apply-helpers/index.d.ts | 64 - .../call-bind-apply-helpers/index.js | 15 - .../call-bind-apply-helpers/package.json | 85 - .../call-bind-apply-helpers/reflectApply.d.ts | 3 - .../call-bind-apply-helpers/reflectApply.js | 4 - .../call-bind-apply-helpers/test/index.js | 63 - .../call-bind-apply-helpers/tsconfig.json | 9 - server/node_modules/call-bound/.eslintrc | 13 - .../call-bound/.github/FUNDING.yml | 12 - server/node_modules/call-bound/.nycrc | 9 - server/node_modules/call-bound/CHANGELOG.md | 42 - server/node_modules/call-bound/LICENSE | 21 - server/node_modules/call-bound/README.md | 53 - server/node_modules/call-bound/index.d.ts | 94 - server/node_modules/call-bound/index.js | 19 - server/node_modules/call-bound/package.json | 99 - server/node_modules/call-bound/test/index.js | 61 - server/node_modules/call-bound/tsconfig.json | 10 - server/node_modules/combined-stream/License | 19 - server/node_modules/combined-stream/Readme.md | 138 - .../combined-stream/lib/combined_stream.js | 208 - .../node_modules/combined-stream/package.json | 25 - server/node_modules/combined-stream/yarn.lock | 17 - server/node_modules/concat-stream/LICENSE | 24 - server/node_modules/concat-stream/index.js | 144 - .../node_modules/concat-stream/package.json | 55 - server/node_modules/concat-stream/readme.md | 102 - .../content-disposition/HISTORY.md | 60 - .../node_modules/content-disposition/LICENSE | 22 - .../content-disposition/README.md | 142 - .../node_modules/content-disposition/index.js | 458 - .../content-disposition/package.json | 44 - server/node_modules/content-type/HISTORY.md | 29 - server/node_modules/content-type/LICENSE | 22 - server/node_modules/content-type/README.md | 94 - server/node_modules/content-type/index.js | 225 - server/node_modules/content-type/package.json | 42 - .../node_modules/cookie-signature/History.md | 42 - .../node_modules/cookie-signature/Readme.md | 42 - server/node_modules/cookie-signature/index.js | 51 - .../cookie-signature/package.json | 18 - server/node_modules/cookie/LICENSE | 24 - server/node_modules/cookie/README.md | 317 - server/node_modules/cookie/SECURITY.md | 25 - server/node_modules/cookie/index.js | 335 - server/node_modules/cookie/package.json | 44 - server/node_modules/cors/LICENSE | 22 - server/node_modules/cors/README.md | 277 - server/node_modules/cors/lib/index.js | 238 - server/node_modules/cors/package.json | 42 - .../node_modules/data-uri-to-buffer/README.md | 88 - .../data-uri-to-buffer/dist/index.d.ts | 15 - .../data-uri-to-buffer/dist/index.js | 53 - .../data-uri-to-buffer/dist/index.js.map | 1 - .../data-uri-to-buffer/package.json | 62 - .../data-uri-to-buffer/src/index.ts | 68 - server/node_modules/debug/.coveralls.yml | 1 - server/node_modules/debug/.eslintrc | 11 - server/node_modules/debug/.npmignore | 9 - server/node_modules/debug/.travis.yml | 14 - server/node_modules/debug/CHANGELOG.md | 362 - server/node_modules/debug/LICENSE | 19 - server/node_modules/debug/Makefile | 50 - server/node_modules/debug/README.md | 312 - server/node_modules/debug/component.json | 19 - server/node_modules/debug/karma.conf.js | 70 - server/node_modules/debug/node.js | 1 - server/node_modules/debug/package.json | 49 - server/node_modules/debug/src/browser.js | 185 - server/node_modules/debug/src/debug.js | 202 - server/node_modules/debug/src/index.js | 10 - .../node_modules/debug/src/inspector-log.js | 15 - server/node_modules/debug/src/node.js | 248 - server/node_modules/delayed-stream/.npmignore | 1 - server/node_modules/delayed-stream/License | 19 - server/node_modules/delayed-stream/Makefile | 7 - server/node_modules/delayed-stream/Readme.md | 141 - .../delayed-stream/lib/delayed_stream.js | 107 - .../node_modules/delayed-stream/package.json | 27 - server/node_modules/depd/History.md | 103 - server/node_modules/depd/LICENSE | 22 - server/node_modules/depd/Readme.md | 280 - server/node_modules/depd/index.js | 538 -- server/node_modules/depd/lib/browser/index.js | 77 - server/node_modules/depd/package.json | 45 - server/node_modules/destroy/LICENSE | 23 - server/node_modules/destroy/README.md | 63 - server/node_modules/destroy/index.js | 209 - server/node_modules/destroy/package.json | 48 - server/node_modules/dotenv/CHANGELOG.md | 520 - server/node_modules/dotenv/LICENSE | 23 - server/node_modules/dotenv/README-es.md | 411 - server/node_modules/dotenv/README.md | 645 -- server/node_modules/dotenv/SECURITY.md | 1 - server/node_modules/dotenv/config.d.ts | 1 - server/node_modules/dotenv/config.js | 9 - server/node_modules/dotenv/lib/cli-options.js | 17 - server/node_modules/dotenv/lib/env-options.js | 28 - server/node_modules/dotenv/lib/main.d.ts | 162 - server/node_modules/dotenv/lib/main.js | 386 - server/node_modules/dotenv/package.json | 62 - server/node_modules/dunder-proto/.eslintrc | 5 - .../dunder-proto/.github/FUNDING.yml | 12 - server/node_modules/dunder-proto/.nycrc | 13 - server/node_modules/dunder-proto/CHANGELOG.md | 24 - server/node_modules/dunder-proto/LICENSE | 21 - server/node_modules/dunder-proto/README.md | 54 - server/node_modules/dunder-proto/get.d.ts | 5 - server/node_modules/dunder-proto/get.js | 30 - server/node_modules/dunder-proto/package.json | 76 - server/node_modules/dunder-proto/set.d.ts | 5 - server/node_modules/dunder-proto/set.js | 35 - server/node_modules/dunder-proto/test/get.js | 34 - .../node_modules/dunder-proto/test/index.js | 4 - server/node_modules/dunder-proto/test/set.js | 50 - .../node_modules/dunder-proto/tsconfig.json | 9 - server/node_modules/ee-first/LICENSE | 22 - server/node_modules/ee-first/README.md | 80 - server/node_modules/ee-first/index.js | 95 - server/node_modules/ee-first/package.json | 29 - server/node_modules/encodeurl/LICENSE | 22 - server/node_modules/encodeurl/README.md | 109 - server/node_modules/encodeurl/index.js | 60 - server/node_modules/encodeurl/package.json | 40 - .../node_modules/es-define-property/.eslintrc | 13 - .../es-define-property/.github/FUNDING.yml | 12 - server/node_modules/es-define-property/.nycrc | 9 - .../es-define-property/CHANGELOG.md | 29 - .../node_modules/es-define-property/LICENSE | 21 - .../node_modules/es-define-property/README.md | 49 - .../es-define-property/index.d.ts | 3 - .../node_modules/es-define-property/index.js | 14 - .../es-define-property/package.json | 81 - .../es-define-property/test/index.js | 56 - .../es-define-property/tsconfig.json | 10 - server/node_modules/es-errors/.eslintrc | 5 - .../es-errors/.github/FUNDING.yml | 12 - server/node_modules/es-errors/CHANGELOG.md | 40 - server/node_modules/es-errors/LICENSE | 21 - server/node_modules/es-errors/README.md | 55 - server/node_modules/es-errors/eval.d.ts | 3 - server/node_modules/es-errors/eval.js | 4 - server/node_modules/es-errors/index.d.ts | 3 - server/node_modules/es-errors/index.js | 4 - server/node_modules/es-errors/package.json | 80 - server/node_modules/es-errors/range.d.ts | 3 - server/node_modules/es-errors/range.js | 4 - server/node_modules/es-errors/ref.d.ts | 3 - server/node_modules/es-errors/ref.js | 4 - server/node_modules/es-errors/syntax.d.ts | 3 - server/node_modules/es-errors/syntax.js | 4 - server/node_modules/es-errors/test/index.js | 19 - server/node_modules/es-errors/tsconfig.json | 49 - server/node_modules/es-errors/type.d.ts | 3 - server/node_modules/es-errors/type.js | 4 - server/node_modules/es-errors/uri.d.ts | 3 - server/node_modules/es-errors/uri.js | 4 - server/node_modules/es-object-atoms/.eslintrc | 16 - .../es-object-atoms/.github/FUNDING.yml | 12 - .../node_modules/es-object-atoms/CHANGELOG.md | 44 - server/node_modules/es-object-atoms/LICENSE | 21 - server/node_modules/es-object-atoms/README.md | 63 - .../RequireObjectCoercible.d.ts | 3 - .../es-object-atoms/RequireObjectCoercible.js | 11 - .../es-object-atoms/ToObject.d.ts | 7 - .../node_modules/es-object-atoms/ToObject.js | 10 - .../node_modules/es-object-atoms/index.d.ts | 3 - server/node_modules/es-object-atoms/index.js | 4 - .../es-object-atoms/isObject.d.ts | 3 - .../node_modules/es-object-atoms/isObject.js | 6 - .../node_modules/es-object-atoms/package.json | 79 - .../es-object-atoms/test/index.js | 38 - .../es-object-atoms/tsconfig.json | 7 - .../node_modules/es-set-tostringtag/.eslintrc | 13 - server/node_modules/es-set-tostringtag/.nycrc | 9 - .../es-set-tostringtag/CHANGELOG.md | 67 - .../node_modules/es-set-tostringtag/LICENSE | 21 - .../node_modules/es-set-tostringtag/README.md | 53 - .../es-set-tostringtag/index.d.ts | 10 - .../node_modules/es-set-tostringtag/index.js | 35 - .../es-set-tostringtag/package.json | 78 - .../es-set-tostringtag/test/index.js | 85 - .../es-set-tostringtag/tsconfig.json | 9 - server/node_modules/escape-html/LICENSE | 24 - server/node_modules/escape-html/Readme.md | 43 - server/node_modules/escape-html/index.js | 78 - server/node_modules/escape-html/package.json | 24 - server/node_modules/etag/HISTORY.md | 83 - server/node_modules/etag/LICENSE | 22 - server/node_modules/etag/README.md | 159 - server/node_modules/etag/index.js | 131 - server/node_modules/etag/package.json | 47 - server/node_modules/express/History.md | 3676 ------- server/node_modules/express/LICENSE | 24 - server/node_modules/express/Readme.md | 260 - server/node_modules/express/index.js | 11 - .../node_modules/express/lib/application.js | 661 -- server/node_modules/express/lib/express.js | 116 - .../express/lib/middleware/init.js | 43 - .../express/lib/middleware/query.js | 47 - server/node_modules/express/lib/request.js | 525 - server/node_modules/express/lib/response.js | 1179 --- .../node_modules/express/lib/router/index.js | 673 -- .../node_modules/express/lib/router/layer.js | 181 - .../node_modules/express/lib/router/route.js | 230 - server/node_modules/express/lib/utils.js | 304 - server/node_modules/express/lib/view.js | 182 - server/node_modules/express/package.json | 102 - server/node_modules/fetch-blob/LICENSE | 21 - server/node_modules/fetch-blob/README.md | 106 - server/node_modules/fetch-blob/file.d.ts | 2 - server/node_modules/fetch-blob/file.js | 49 - server/node_modules/fetch-blob/from.d.ts | 26 - server/node_modules/fetch-blob/from.js | 100 - server/node_modules/fetch-blob/index.d.ts | 3 - server/node_modules/fetch-blob/index.js | 250 - server/node_modules/fetch-blob/package.json | 56 - server/node_modules/fetch-blob/streams.cjs | 51 - server/node_modules/finalhandler/HISTORY.md | 216 - server/node_modules/finalhandler/LICENSE | 22 - server/node_modules/finalhandler/README.md | 147 - server/node_modules/finalhandler/SECURITY.md | 25 - server/node_modules/finalhandler/index.js | 341 - server/node_modules/finalhandler/package.json | 47 - server/node_modules/follow-redirects/LICENSE | 18 - .../node_modules/follow-redirects/README.md | 157 - server/node_modules/follow-redirects/debug.js | 15 - server/node_modules/follow-redirects/http.js | 1 - server/node_modules/follow-redirects/https.js | 1 - server/node_modules/follow-redirects/index.js | 709 -- .../follow-redirects/package.json | 58 - server/node_modules/form-data/CHANGELOG.md | 686 -- server/node_modules/form-data/License | 19 - server/node_modules/form-data/README.md | 355 - server/node_modules/form-data/index.d.ts | 62 - server/node_modules/form-data/lib/browser.js | 4 - .../node_modules/form-data/lib/form_data.js | 506 - server/node_modules/form-data/lib/populate.js | 10 - server/node_modules/form-data/package.json | 82 - .../formdata-polyfill/FormData.js | 441 - server/node_modules/formdata-polyfill/LICENSE | 21 - .../node_modules/formdata-polyfill/README.md | 145 - .../formdata-polyfill/esm.min.d.ts | 5 - .../node_modules/formdata-polyfill/esm.min.js | 40 - .../formdata-polyfill/formdata-to-blob.js | 39 - .../formdata-polyfill/formdata.min.js | 21 - .../formdata-polyfill/package.json | 50 - server/node_modules/forwarded/HISTORY.md | 21 - server/node_modules/forwarded/LICENSE | 22 - server/node_modules/forwarded/README.md | 57 - server/node_modules/forwarded/index.js | 90 - server/node_modules/forwarded/package.json | 45 - server/node_modules/fresh/HISTORY.md | 70 - server/node_modules/fresh/LICENSE | 23 - server/node_modules/fresh/README.md | 119 - server/node_modules/fresh/index.js | 137 - server/node_modules/fresh/package.json | 46 - server/node_modules/function-bind/.eslintrc | 21 - .../function-bind/.github/FUNDING.yml | 12 - .../function-bind/.github/SECURITY.md | 3 - server/node_modules/function-bind/.nycrc | 13 - .../node_modules/function-bind/CHANGELOG.md | 136 - server/node_modules/function-bind/LICENSE | 20 - server/node_modules/function-bind/README.md | 46 - .../function-bind/implementation.js | 84 - server/node_modules/function-bind/index.js | 5 - .../node_modules/function-bind/package.json | 87 - .../node_modules/function-bind/test/.eslintrc | 9 - .../node_modules/function-bind/test/index.js | 252 - server/node_modules/get-intrinsic/.eslintrc | 42 - .../get-intrinsic/.github/FUNDING.yml | 12 - server/node_modules/get-intrinsic/.nycrc | 9 - .../node_modules/get-intrinsic/CHANGELOG.md | 186 - server/node_modules/get-intrinsic/LICENSE | 21 - server/node_modules/get-intrinsic/README.md | 71 - server/node_modules/get-intrinsic/index.js | 378 - .../node_modules/get-intrinsic/package.json | 97 - .../get-intrinsic/test/GetIntrinsic.js | 274 - server/node_modules/get-proto/.eslintrc | 10 - .../get-proto/.github/FUNDING.yml | 12 - server/node_modules/get-proto/.nycrc | 9 - server/node_modules/get-proto/CHANGELOG.md | 21 - server/node_modules/get-proto/LICENSE | 21 - .../get-proto/Object.getPrototypeOf.d.ts | 5 - .../get-proto/Object.getPrototypeOf.js | 6 - server/node_modules/get-proto/README.md | 50 - .../get-proto/Reflect.getPrototypeOf.d.ts | 3 - .../get-proto/Reflect.getPrototypeOf.js | 4 - server/node_modules/get-proto/index.d.ts | 5 - server/node_modules/get-proto/index.js | 27 - server/node_modules/get-proto/package.json | 81 - server/node_modules/get-proto/test/index.js | 68 - server/node_modules/get-proto/tsconfig.json | 9 - server/node_modules/gopd/.eslintrc | 16 - server/node_modules/gopd/.github/FUNDING.yml | 12 - server/node_modules/gopd/CHANGELOG.md | 45 - server/node_modules/gopd/LICENSE | 21 - server/node_modules/gopd/README.md | 40 - server/node_modules/gopd/gOPD.d.ts | 1 - server/node_modules/gopd/gOPD.js | 4 - server/node_modules/gopd/index.d.ts | 5 - server/node_modules/gopd/index.js | 15 - server/node_modules/gopd/package.json | 77 - server/node_modules/gopd/test/index.js | 36 - server/node_modules/gopd/tsconfig.json | 9 - server/node_modules/has-symbols/.eslintrc | 11 - .../has-symbols/.github/FUNDING.yml | 12 - server/node_modules/has-symbols/.nycrc | 9 - server/node_modules/has-symbols/CHANGELOG.md | 91 - server/node_modules/has-symbols/LICENSE | 21 - server/node_modules/has-symbols/README.md | 46 - server/node_modules/has-symbols/index.d.ts | 3 - server/node_modules/has-symbols/index.js | 14 - server/node_modules/has-symbols/package.json | 111 - server/node_modules/has-symbols/shams.d.ts | 3 - server/node_modules/has-symbols/shams.js | 45 - server/node_modules/has-symbols/test/index.js | 22 - .../has-symbols/test/shams/core-js.js | 29 - .../test/shams/get-own-property-symbols.js | 29 - server/node_modules/has-symbols/test/tests.js | 58 - server/node_modules/has-symbols/tsconfig.json | 10 - server/node_modules/has-tostringtag/.eslintrc | 5 - .../has-tostringtag/.github/FUNDING.yml | 12 - server/node_modules/has-tostringtag/.nycrc | 13 - .../node_modules/has-tostringtag/CHANGELOG.md | 42 - server/node_modules/has-tostringtag/LICENSE | 21 - server/node_modules/has-tostringtag/README.md | 46 - .../node_modules/has-tostringtag/index.d.ts | 3 - server/node_modules/has-tostringtag/index.js | 8 - .../node_modules/has-tostringtag/package.json | 108 - .../node_modules/has-tostringtag/shams.d.ts | 3 - server/node_modules/has-tostringtag/shams.js | 8 - .../has-tostringtag/test/index.js | 21 - .../has-tostringtag/test/shams/core-js.js | 31 - .../test/shams/get-own-property-symbols.js | 30 - .../has-tostringtag/test/tests.js | 15 - .../has-tostringtag/tsconfig.json | 49 - .../node_modules/hasown/.github/FUNDING.yml | 12 - server/node_modules/hasown/.nycrc | 13 - server/node_modules/hasown/CHANGELOG.md | 58 - server/node_modules/hasown/LICENSE | 21 - server/node_modules/hasown/README.md | 40 - server/node_modules/hasown/eslint.config.mjs | 6 - server/node_modules/hasown/index.d.ts | 3 - server/node_modules/hasown/index.js | 8 - server/node_modules/hasown/package.json | 91 - server/node_modules/hasown/tsconfig.json | 6 - server/node_modules/http-errors/HISTORY.md | 186 - server/node_modules/http-errors/LICENSE | 23 - server/node_modules/http-errors/README.md | 169 - server/node_modules/http-errors/index.js | 290 - server/node_modules/http-errors/package.json | 54 - .../node_modules/https-proxy-agent/README.md | 137 - .../https-proxy-agent/dist/agent.d.ts | 30 - .../https-proxy-agent/dist/agent.js | 177 - .../https-proxy-agent/dist/agent.js.map | 1 - .../https-proxy-agent/dist/index.d.ts | 23 - .../https-proxy-agent/dist/index.js | 14 - .../https-proxy-agent/dist/index.js.map | 1 - .../dist/parse-proxy-response.d.ts | 7 - .../dist/parse-proxy-response.js | 66 - .../dist/parse-proxy-response.js.map | 1 - .../node_modules/debug/LICENSE | 20 - .../node_modules/debug/README.md | 481 - .../node_modules/debug/package.json | 64 - .../node_modules/debug/src/browser.js | 272 - .../node_modules/debug/src/common.js | 292 - .../node_modules/debug/src/index.js | 10 - .../node_modules/debug/src/node.js | 263 - .../node_modules/ms/index.js | 162 - .../node_modules/ms/license.md | 21 - .../node_modules/ms/package.json | 38 - .../node_modules/ms/readme.md | 59 - .../https-proxy-agent/package.json | 56 - server/node_modules/iconv-lite/Changelog.md | 162 - server/node_modules/iconv-lite/LICENSE | 21 - server/node_modules/iconv-lite/README.md | 156 - .../iconv-lite/encodings/dbcs-codec.js | 555 -- .../iconv-lite/encodings/dbcs-data.js | 176 - .../iconv-lite/encodings/index.js | 22 - .../iconv-lite/encodings/internal.js | 188 - .../iconv-lite/encodings/sbcs-codec.js | 72 - .../encodings/sbcs-data-generated.js | 451 - .../iconv-lite/encodings/sbcs-data.js | 174 - .../encodings/tables/big5-added.json | 122 - .../iconv-lite/encodings/tables/cp936.json | 264 - .../iconv-lite/encodings/tables/cp949.json | 273 - .../iconv-lite/encodings/tables/cp950.json | 177 - .../iconv-lite/encodings/tables/eucjp.json | 182 - .../encodings/tables/gb18030-ranges.json | 1 - .../encodings/tables/gbk-added.json | 55 - .../iconv-lite/encodings/tables/shiftjis.json | 125 - .../iconv-lite/encodings/utf16.js | 177 - .../node_modules/iconv-lite/encodings/utf7.js | 290 - .../iconv-lite/lib/bom-handling.js | 52 - .../iconv-lite/lib/extend-node.js | 217 - server/node_modules/iconv-lite/lib/index.d.ts | 24 - server/node_modules/iconv-lite/lib/index.js | 153 - server/node_modules/iconv-lite/lib/streams.js | 121 - server/node_modules/iconv-lite/package.json | 46 - server/node_modules/inherits/LICENSE | 16 - server/node_modules/inherits/README.md | 42 - server/node_modules/inherits/inherits.js | 9 - .../node_modules/inherits/inherits_browser.js | 27 - server/node_modules/inherits/package.json | 29 - server/node_modules/ipaddr.js/LICENSE | 19 - server/node_modules/ipaddr.js/README.md | 233 - server/node_modules/ipaddr.js/ipaddr.min.js | 1 - server/node_modules/ipaddr.js/lib/ipaddr.js | 673 -- .../node_modules/ipaddr.js/lib/ipaddr.js.d.ts | 68 - server/node_modules/ipaddr.js/package.json | 35 - server/node_modules/math-intrinsics/.eslintrc | 16 - .../math-intrinsics/.github/FUNDING.yml | 12 - .../node_modules/math-intrinsics/CHANGELOG.md | 24 - server/node_modules/math-intrinsics/LICENSE | 21 - server/node_modules/math-intrinsics/README.md | 50 - server/node_modules/math-intrinsics/abs.d.ts | 1 - server/node_modules/math-intrinsics/abs.js | 4 - .../constants/maxArrayLength.d.ts | 3 - .../constants/maxArrayLength.js | 4 - .../constants/maxSafeInteger.d.ts | 3 - .../constants/maxSafeInteger.js | 5 - .../math-intrinsics/constants/maxValue.d.ts | 3 - .../math-intrinsics/constants/maxValue.js | 5 - .../node_modules/math-intrinsics/floor.d.ts | 1 - server/node_modules/math-intrinsics/floor.js | 4 - .../math-intrinsics/isFinite.d.ts | 3 - .../node_modules/math-intrinsics/isFinite.js | 12 - .../math-intrinsics/isInteger.d.ts | 3 - .../node_modules/math-intrinsics/isInteger.js | 16 - .../node_modules/math-intrinsics/isNaN.d.ts | 1 - server/node_modules/math-intrinsics/isNaN.js | 6 - .../math-intrinsics/isNegativeZero.d.ts | 3 - .../math-intrinsics/isNegativeZero.js | 6 - server/node_modules/math-intrinsics/max.d.ts | 1 - server/node_modules/math-intrinsics/max.js | 4 - server/node_modules/math-intrinsics/min.d.ts | 1 - server/node_modules/math-intrinsics/min.js | 4 - server/node_modules/math-intrinsics/mod.d.ts | 3 - server/node_modules/math-intrinsics/mod.js | 9 - .../node_modules/math-intrinsics/package.json | 86 - server/node_modules/math-intrinsics/pow.d.ts | 1 - server/node_modules/math-intrinsics/pow.js | 4 - .../node_modules/math-intrinsics/round.d.ts | 1 - server/node_modules/math-intrinsics/round.js | 4 - server/node_modules/math-intrinsics/sign.d.ts | 3 - server/node_modules/math-intrinsics/sign.js | 11 - .../math-intrinsics/test/index.js | 192 - .../math-intrinsics/tsconfig.json | 3 - server/node_modules/media-typer/HISTORY.md | 22 - server/node_modules/media-typer/LICENSE | 22 - server/node_modules/media-typer/README.md | 81 - server/node_modules/media-typer/index.js | 270 - server/node_modules/media-typer/package.json | 26 - .../node_modules/merge-descriptors/HISTORY.md | 21 - server/node_modules/merge-descriptors/LICENSE | 23 - .../node_modules/merge-descriptors/README.md | 49 - .../node_modules/merge-descriptors/index.js | 60 - .../merge-descriptors/package.json | 39 - server/node_modules/methods/HISTORY.md | 29 - server/node_modules/methods/LICENSE | 24 - server/node_modules/methods/README.md | 51 - server/node_modules/methods/index.js | 69 - server/node_modules/methods/package.json | 36 - server/node_modules/mime-db/HISTORY.md | 507 - server/node_modules/mime-db/LICENSE | 23 - server/node_modules/mime-db/README.md | 100 - server/node_modules/mime-db/db.json | 8519 ----------------- server/node_modules/mime-db/index.js | 12 - server/node_modules/mime-db/package.json | 60 - server/node_modules/mime-types/HISTORY.md | 397 - server/node_modules/mime-types/LICENSE | 23 - server/node_modules/mime-types/README.md | 113 - server/node_modules/mime-types/index.js | 188 - server/node_modules/mime-types/package.json | 44 - server/node_modules/mime/.npmignore | 0 server/node_modules/mime/CHANGELOG.md | 164 - server/node_modules/mime/LICENSE | 21 - server/node_modules/mime/README.md | 90 - server/node_modules/mime/cli.js | 8 - server/node_modules/mime/mime.js | 108 - server/node_modules/mime/package.json | 44 - server/node_modules/mime/src/build.js | 53 - server/node_modules/mime/src/test.js | 60 - server/node_modules/mime/types.json | 1 - server/node_modules/ms/index.js | 152 - server/node_modules/ms/license.md | 21 - server/node_modules/ms/package.json | 37 - server/node_modules/ms/readme.md | 51 - server/node_modules/multer/LICENSE | 17 - server/node_modules/multer/README.md | 361 - server/node_modules/multer/index.js | 107 - server/node_modules/multer/lib/counter.js | 28 - .../node_modules/multer/lib/file-appender.js | 65 - .../multer/lib/make-middleware.js | 265 - .../node_modules/multer/lib/multer-error.js | 25 - .../multer/lib/remove-uploaded-files.js | 28 - server/node_modules/multer/package.json | 58 - server/node_modules/multer/storage/disk.js | 70 - server/node_modules/multer/storage/memory.js | 21 - server/node_modules/negotiator/HISTORY.md | 108 - server/node_modules/negotiator/LICENSE | 24 - server/node_modules/negotiator/README.md | 203 - server/node_modules/negotiator/index.js | 82 - server/node_modules/negotiator/lib/charset.js | 169 - .../node_modules/negotiator/lib/encoding.js | 184 - .../node_modules/negotiator/lib/language.js | 179 - .../node_modules/negotiator/lib/mediaType.js | 294 - server/node_modules/negotiator/package.json | 42 - .../.history/README_20210527203617.md | 2 - .../.history/README_20210527212714.md | 41 - .../.history/README_20210527213345.md | 36 - .../.history/README_20210527213411.md | 36 - .../.history/README_20210527213803.md | 36 - .../.history/README_20210527214323.md | 38 - .../.history/README_20210527214408.md | 38 - .../.history/index_20210527203842.js | 0 .../.history/index_20210527203947.js | 8 - .../.history/index_20210527204259.js | 9 - .../.history/index_20210527204418.js | 9 - .../.history/index_20210527204756.js | 11 - .../.history/index_20210527204833.js | 11 - .../.history/index_20210527211208.js | 15 - .../.history/index_20210527211248.js | 15 - .../.history/index_20210527212722.js | 23 - .../.history/index_20210527212731.js | 23 - .../.history/index_20210527212746.js | 15 - .../.history/index_20210527212900.js | 16 - .../.history/index_20210527213022.js | 16 - .../.history/index_20210527213822.js | 16 - .../.history/index_20210527213843.js | 17 - .../.history/index_20210527213852.js | 17 - .../.history/index_20210527213910.js | 16 - .../.history/index_20210527214034.js | 16 - .../.history/index_20210527214643.js | 41 - .../.history/index_20210527214654.js | 41 - .../.history/index_20210527214700.js | 16 - .../.history/package_20210527203733.json | 19 - .../.history/package_20210527203825.json | 16 - .../.history/package_20210527204621.json | 19 - .../.history/package_20210527204913.json | 25 - .../.history/package_20210527204925.json | 25 - .../.history/package_20210527205145.json | 29 - .../.history/package_20210527205156.json | 29 - .../.history/test_20210527205603.js | 0 .../.history/test_20210527205957.js | 3 - .../.history/test_20210527210021.js | 3 - server/node_modules/node-domexception/LICENSE | 21 - .../node_modules/node-domexception/README.md | 46 - .../node_modules/node-domexception/index.js | 16 - .../node-domexception/package.json | 29 - .../node_modules/node-fetch/@types/index.d.ts | 219 - server/node_modules/node-fetch/LICENSE.md | 22 - server/node_modules/node-fetch/README.md | 872 -- server/node_modules/node-fetch/package.json | 131 - server/node_modules/node-fetch/src/body.js | 397 - .../node-fetch/src/errors/abort-error.js | 10 - .../node-fetch/src/errors/base.js | 17 - .../node-fetch/src/errors/fetch-error.js | 26 - server/node_modules/node-fetch/src/headers.js | 267 - server/node_modules/node-fetch/src/index.js | 417 - server/node_modules/node-fetch/src/request.js | 313 - .../node_modules/node-fetch/src/response.js | 160 - .../node-fetch/src/utils/get-search.js | 9 - .../node-fetch/src/utils/is-redirect.js | 11 - .../node_modules/node-fetch/src/utils/is.js | 87 - .../node-fetch/src/utils/multipart-parser.js | 432 - .../node-fetch/src/utils/referrer.js | 340 - server/node_modules/object-assign/index.js | 90 - server/node_modules/object-assign/license | 21 - .../node_modules/object-assign/package.json | 42 - server/node_modules/object-assign/readme.md | 61 - server/node_modules/object-inspect/.eslintrc | 53 - .../object-inspect/.github/FUNDING.yml | 12 - server/node_modules/object-inspect/.nycrc | 13 - .../node_modules/object-inspect/CHANGELOG.md | 424 - server/node_modules/object-inspect/LICENSE | 21 - .../object-inspect/example/all.js | 23 - .../object-inspect/example/circular.js | 6 - .../node_modules/object-inspect/example/fn.js | 5 - .../object-inspect/example/inspect.js | 10 - server/node_modules/object-inspect/index.js | 544 -- .../object-inspect/package-support.json | 20 - .../node_modules/object-inspect/package.json | 105 - .../object-inspect/readme.markdown | 84 - .../object-inspect/test-core-js.js | 26 - .../object-inspect/test/bigint.js | 58 - .../object-inspect/test/browser/dom.js | 15 - .../object-inspect/test/circular.js | 16 - .../node_modules/object-inspect/test/deep.js | 12 - .../object-inspect/test/element.js | 53 - .../node_modules/object-inspect/test/err.js | 48 - .../node_modules/object-inspect/test/fakes.js | 29 - server/node_modules/object-inspect/test/fn.js | 76 - .../object-inspect/test/global.js | 17 - .../node_modules/object-inspect/test/has.js | 15 - .../node_modules/object-inspect/test/holes.js | 15 - .../object-inspect/test/indent-option.js | 271 - .../object-inspect/test/inspect.js | 139 - .../object-inspect/test/lowbyte.js | 12 - .../object-inspect/test/number.js | 58 - .../object-inspect/test/quoteStyle.js | 26 - .../object-inspect/test/toStringTag.js | 40 - .../node_modules/object-inspect/test/undef.js | 12 - .../object-inspect/test/values.js | 261 - .../object-inspect/util.inspect.js | 1 - server/node_modules/on-finished/HISTORY.md | 98 - server/node_modules/on-finished/LICENSE | 23 - server/node_modules/on-finished/README.md | 162 - server/node_modules/on-finished/index.js | 234 - server/node_modules/on-finished/package.json | 39 - server/node_modules/parseurl/HISTORY.md | 58 - server/node_modules/parseurl/LICENSE | 24 - server/node_modules/parseurl/README.md | 133 - server/node_modules/parseurl/index.js | 158 - server/node_modules/parseurl/package.json | 40 - server/node_modules/path-to-regexp/LICENSE | 21 - server/node_modules/path-to-regexp/Readme.md | 35 - server/node_modules/path-to-regexp/index.js | 158 - .../node_modules/path-to-regexp/package.json | 30 - server/node_modules/proxy-addr/HISTORY.md | 161 - server/node_modules/proxy-addr/LICENSE | 22 - server/node_modules/proxy-addr/README.md | 139 - server/node_modules/proxy-addr/index.js | 327 - server/node_modules/proxy-addr/package.json | 47 - server/node_modules/proxy-from-env/LICENSE | 20 - server/node_modules/proxy-from-env/README.md | 163 - server/node_modules/proxy-from-env/index.cjs | 105 - server/node_modules/proxy-from-env/index.js | 103 - .../node_modules/proxy-from-env/package.json | 43 - server/node_modules/qs/.editorconfig | 46 - server/node_modules/qs/.github/FUNDING.yml | 12 - server/node_modules/qs/.github/SECURITY.md | 11 - .../node_modules/qs/.github/THREAT_MODEL.md | 78 - server/node_modules/qs/.nycrc | 13 - server/node_modules/qs/CHANGELOG.md | 833 -- server/node_modules/qs/LICENSE.md | 29 - server/node_modules/qs/README.md | 758 -- server/node_modules/qs/dist/qs.js | 141 - server/node_modules/qs/eslint.config.mjs | 57 - server/node_modules/qs/lib/formats.js | 23 - server/node_modules/qs/lib/index.js | 11 - server/node_modules/qs/lib/parse.js | 414 - server/node_modules/qs/lib/stringify.js | 363 - server/node_modules/qs/lib/utils.js | 381 - server/node_modules/qs/package.json | 95 - .../node_modules/qs/test/empty-keys-cases.js | 267 - server/node_modules/qs/test/parse.js | 1933 ---- server/node_modules/qs/test/stringify.js | 1448 --- server/node_modules/qs/test/utils.js | 626 -- server/node_modules/range-parser/HISTORY.md | 56 - server/node_modules/range-parser/LICENSE | 23 - server/node_modules/range-parser/README.md | 84 - server/node_modules/range-parser/index.js | 162 - server/node_modules/range-parser/package.json | 44 - server/node_modules/raw-body/LICENSE | 22 - server/node_modules/raw-body/README.md | 223 - server/node_modules/raw-body/index.d.ts | 87 - server/node_modules/raw-body/index.js | 336 - server/node_modules/raw-body/package.json | 47 - .../readable-stream/CONTRIBUTING.md | 38 - .../readable-stream/GOVERNANCE.md | 136 - server/node_modules/readable-stream/LICENSE | 47 - server/node_modules/readable-stream/README.md | 106 - .../readable-stream/errors-browser.js | 127 - server/node_modules/readable-stream/errors.js | 116 - .../readable-stream/experimentalWarning.js | 17 - .../readable-stream/lib/_stream_duplex.js | 126 - .../lib/_stream_passthrough.js | 37 - .../readable-stream/lib/_stream_readable.js | 1027 -- .../readable-stream/lib/_stream_transform.js | 190 - .../readable-stream/lib/_stream_writable.js | 641 -- .../lib/internal/streams/async_iterator.js | 180 - .../lib/internal/streams/buffer_list.js | 183 - .../lib/internal/streams/destroy.js | 96 - .../lib/internal/streams/end-of-stream.js | 86 - .../lib/internal/streams/from-browser.js | 3 - .../lib/internal/streams/from.js | 52 - .../lib/internal/streams/pipeline.js | 86 - .../lib/internal/streams/state.js | 22 - .../lib/internal/streams/stream-browser.js | 1 - .../lib/internal/streams/stream.js | 1 - .../node_modules/readable-stream/package.json | 68 - .../readable-stream/readable-browser.js | 9 - .../node_modules/readable-stream/readable.js | 16 - server/node_modules/safe-buffer/LICENSE | 21 - server/node_modules/safe-buffer/README.md | 584 -- server/node_modules/safe-buffer/index.d.ts | 187 - server/node_modules/safe-buffer/index.js | 65 - server/node_modules/safe-buffer/package.json | 51 - server/node_modules/safer-buffer/LICENSE | 21 - .../safer-buffer/Porting-Buffer.md | 268 - server/node_modules/safer-buffer/Readme.md | 156 - server/node_modules/safer-buffer/dangerous.js | 58 - server/node_modules/safer-buffer/package.json | 34 - server/node_modules/safer-buffer/safer.js | 77 - server/node_modules/safer-buffer/tests.js | 406 - server/node_modules/send/HISTORY.md | 538 -- server/node_modules/send/LICENSE | 23 - server/node_modules/send/README.md | 327 - server/node_modules/send/SECURITY.md | 24 - server/node_modules/send/index.js | 1142 --- .../send/node_modules/ms/index.js | 162 - .../send/node_modules/ms/license.md | 21 - .../send/node_modules/ms/package.json | 38 - .../send/node_modules/ms/readme.md | 59 - server/node_modules/send/package.json | 62 - server/node_modules/serve-static/HISTORY.md | 493 - server/node_modules/serve-static/LICENSE | 25 - server/node_modules/serve-static/README.md | 257 - server/node_modules/serve-static/index.js | 209 - server/node_modules/serve-static/package.json | 42 - server/node_modules/setprototypeof/LICENSE | 13 - server/node_modules/setprototypeof/README.md | 31 - server/node_modules/setprototypeof/index.d.ts | 2 - server/node_modules/setprototypeof/index.js | 17 - .../node_modules/setprototypeof/package.json | 38 - .../node_modules/setprototypeof/test/index.js | 24 - .../side-channel-list/.editorconfig | 9 - .../node_modules/side-channel-list/.eslintrc | 11 - .../side-channel-list/.github/FUNDING.yml | 12 - server/node_modules/side-channel-list/.nycrc | 13 - .../side-channel-list/CHANGELOG.md | 36 - server/node_modules/side-channel-list/LICENSE | 21 - .../node_modules/side-channel-list/README.md | 62 - .../node_modules/side-channel-list/index.d.ts | 13 - .../node_modules/side-channel-list/index.js | 111 - .../node_modules/side-channel-list/list.d.ts | 14 - .../side-channel-list/package.json | 77 - .../side-channel-list/test/index.js | 154 - .../side-channel-list/tsconfig.json | 9 - .../side-channel-map/.editorconfig | 9 - .../node_modules/side-channel-map/.eslintrc | 11 - .../side-channel-map/.github/FUNDING.yml | 12 - server/node_modules/side-channel-map/.nycrc | 13 - .../side-channel-map/CHANGELOG.md | 22 - server/node_modules/side-channel-map/LICENSE | 21 - .../node_modules/side-channel-map/README.md | 62 - .../node_modules/side-channel-map/index.d.ts | 15 - server/node_modules/side-channel-map/index.js | 68 - .../side-channel-map/package.json | 80 - .../side-channel-map/test/index.js | 114 - .../side-channel-map/tsconfig.json | 9 - .../side-channel-weakmap/.editorconfig | 9 - .../side-channel-weakmap/.eslintrc | 12 - .../side-channel-weakmap/.github/FUNDING.yml | 12 - .../node_modules/side-channel-weakmap/.nycrc | 13 - .../side-channel-weakmap/CHANGELOG.md | 28 - .../node_modules/side-channel-weakmap/LICENSE | 21 - .../side-channel-weakmap/README.md | 62 - .../side-channel-weakmap/index.d.ts | 15 - .../side-channel-weakmap/index.js | 84 - .../side-channel-weakmap/package.json | 87 - .../side-channel-weakmap/test/index.js | 114 - .../side-channel-weakmap/tsconfig.json | 9 - .../node_modules/side-channel/.editorconfig | 9 - server/node_modules/side-channel/.eslintrc | 12 - .../side-channel/.github/FUNDING.yml | 12 - server/node_modules/side-channel/.nycrc | 13 - server/node_modules/side-channel/CHANGELOG.md | 120 - server/node_modules/side-channel/LICENSE | 21 - server/node_modules/side-channel/README.md | 61 - server/node_modules/side-channel/index.d.ts | 14 - server/node_modules/side-channel/index.js | 46 - server/node_modules/side-channel/package.json | 85 - .../node_modules/side-channel/test/index.js | 120 - .../node_modules/side-channel/tsconfig.json | 9 - server/node_modules/statuses/HISTORY.md | 87 - server/node_modules/statuses/LICENSE | 23 - server/node_modules/statuses/README.md | 139 - server/node_modules/statuses/codes.json | 65 - server/node_modules/statuses/index.js | 146 - server/node_modules/statuses/package.json | 49 - server/node_modules/streamsearch/.eslintrc.js | 5 - .../streamsearch/.github/workflows/ci.yml | 24 - .../streamsearch/.github/workflows/lint.yml | 23 - server/node_modules/streamsearch/LICENSE | 19 - server/node_modules/streamsearch/README.md | 95 - server/node_modules/streamsearch/lib/sbmh.js | 267 - server/node_modules/streamsearch/package.json | 34 - server/node_modules/streamsearch/test/test.js | 70 - server/node_modules/string_decoder/LICENSE | 48 - server/node_modules/string_decoder/README.md | 47 - .../string_decoder/lib/string_decoder.js | 296 - .../node_modules/string_decoder/package.json | 34 - server/node_modules/toidentifier/HISTORY.md | 9 - server/node_modules/toidentifier/LICENSE | 21 - server/node_modules/toidentifier/README.md | 61 - server/node_modules/toidentifier/index.js | 32 - server/node_modules/toidentifier/package.json | 38 - server/node_modules/type-is/HISTORY.md | 259 - server/node_modules/type-is/LICENSE | 23 - server/node_modules/type-is/README.md | 170 - server/node_modules/type-is/index.js | 266 - server/node_modules/type-is/package.json | 45 - server/node_modules/typedarray/.travis.yml | 4 - server/node_modules/typedarray/LICENSE | 35 - .../node_modules/typedarray/example/tarray.js | 4 - server/node_modules/typedarray/index.js | 630 -- server/node_modules/typedarray/package.json | 55 - .../node_modules/typedarray/readme.markdown | 61 - .../typedarray/test/server/undef_globals.js | 19 - server/node_modules/typedarray/test/tarray.js | 10 - server/node_modules/unpipe/HISTORY.md | 4 - server/node_modules/unpipe/LICENSE | 22 - server/node_modules/unpipe/README.md | 43 - server/node_modules/unpipe/index.js | 69 - server/node_modules/unpipe/package.json | 27 - server/node_modules/util-deprecate/History.md | 16 - server/node_modules/util-deprecate/LICENSE | 24 - server/node_modules/util-deprecate/README.md | 53 - server/node_modules/util-deprecate/browser.js | 67 - server/node_modules/util-deprecate/node.js | 6 - .../node_modules/util-deprecate/package.json | 27 - server/node_modules/utils-merge/.npmignore | 9 - server/node_modules/utils-merge/LICENSE | 20 - server/node_modules/utils-merge/README.md | 34 - server/node_modules/utils-merge/index.js | 23 - server/node_modules/utils-merge/package.json | 40 - server/node_modules/vary/HISTORY.md | 39 - server/node_modules/vary/LICENSE | 22 - server/node_modules/vary/README.md | 101 - server/node_modules/vary/index.js | 149 - server/node_modules/vary/package.json | 43 - .../node_modules/web-streams-polyfill/LICENSE | 22 - .../web-streams-polyfill/README.md | 110 - .../dist/polyfill.es2018.js | 4765 --------- .../dist/polyfill.es2018.js.map | 1 - .../dist/polyfill.es2018.min.js | 9 - .../dist/polyfill.es2018.min.js.map | 1 - .../dist/polyfill.es2018.mjs | 4745 --------- .../dist/polyfill.es2018.mjs.map | 1 - .../web-streams-polyfill/dist/polyfill.es6.js | 4838 ---------- .../dist/polyfill.es6.js.map | 1 - .../dist/polyfill.es6.min.js | 9 - .../dist/polyfill.es6.min.js.map | 1 - .../dist/polyfill.es6.mjs | 4818 ---------- .../dist/polyfill.es6.mjs.map | 1 - .../web-streams-polyfill/dist/polyfill.js | 5011 ---------- .../web-streams-polyfill/dist/polyfill.js.map | 1 - .../web-streams-polyfill/dist/polyfill.min.js | 9 - .../dist/polyfill.min.js.map | 1 - .../web-streams-polyfill/dist/polyfill.mjs | 4991 ---------- .../dist/polyfill.mjs.map | 1 - .../dist/ponyfill.es2018.js | 4737 --------- .../dist/ponyfill.es2018.js.map | 1 - .../dist/ponyfill.es2018.mjs | 4717 --------- .../dist/ponyfill.es2018.mjs.map | 1 - .../web-streams-polyfill/dist/ponyfill.es6.js | 4810 ---------- .../dist/ponyfill.es6.js.map | 1 - .../dist/ponyfill.es6.mjs | 4790 --------- .../dist/ponyfill.es6.mjs.map | 1 - .../web-streams-polyfill/dist/ponyfill.js | 4983 ---------- .../web-streams-polyfill/dist/ponyfill.js.map | 1 - .../web-streams-polyfill/dist/ponyfill.mjs | 4963 ---------- .../dist/ponyfill.mjs.map | 1 - .../dist/types/polyfill.d.ts | 24 - .../dist/types/ponyfill.d.ts | 780 -- .../dist/types/ts3.6/polyfill.d.ts | 28 - .../dist/types/ts3.6/ponyfill.d.ts | 821 -- .../dist/types/tsdoc-metadata.json | 11 - .../web-streams-polyfill/es2018/package.json | 14 - .../web-streams-polyfill/es6/package.json | 14 - .../web-streams-polyfill/package.json | 83 - .../ponyfill/es2018/package.json | 13 - .../ponyfill/es6/package.json | 13 - .../ponyfill/package.json | 13 - server/package-lock.json | 362 +- server/package.json | 5 +- server/routes/metadata.js | 159 +- server/routes/recognize.js | 199 +- server/routes/search.js | 98 + server/routes/suggestions.js | 82 +- server/routes/tracks.js | 35 + 1088 files changed, 2119 insertions(+), 198536 deletions(-) create mode 100644 docker-compose.yml delete mode 100644 dummy.webm create mode 100644 server/db.js delete mode 100644 server/node_modules/.bin/mime delete mode 100644 server/node_modules/.bin/mime.cmd delete mode 100644 server/node_modules/.bin/mime.ps1 delete mode 100644 server/node_modules/.package-lock.json delete mode 100644 server/node_modules/accepts/HISTORY.md delete mode 100644 server/node_modules/accepts/LICENSE delete mode 100644 server/node_modules/accepts/README.md delete mode 100644 server/node_modules/accepts/index.js delete mode 100644 server/node_modules/accepts/package.json delete mode 100644 server/node_modules/agent-base/README.md delete mode 100644 server/node_modules/agent-base/dist/src/index.d.ts delete mode 100644 server/node_modules/agent-base/dist/src/index.js delete mode 100644 server/node_modules/agent-base/dist/src/index.js.map delete mode 100644 server/node_modules/agent-base/dist/src/promisify.d.ts delete mode 100644 server/node_modules/agent-base/dist/src/promisify.js delete mode 100644 server/node_modules/agent-base/dist/src/promisify.js.map delete mode 100644 server/node_modules/agent-base/node_modules/debug/LICENSE delete mode 100644 server/node_modules/agent-base/node_modules/debug/README.md delete mode 100644 server/node_modules/agent-base/node_modules/debug/package.json delete mode 100644 server/node_modules/agent-base/node_modules/debug/src/browser.js delete mode 100644 server/node_modules/agent-base/node_modules/debug/src/common.js delete mode 100644 server/node_modules/agent-base/node_modules/debug/src/index.js delete mode 100644 server/node_modules/agent-base/node_modules/debug/src/node.js delete mode 100644 server/node_modules/agent-base/node_modules/ms/index.js delete mode 100644 server/node_modules/agent-base/node_modules/ms/license.md delete mode 100644 server/node_modules/agent-base/node_modules/ms/package.json delete mode 100644 server/node_modules/agent-base/node_modules/ms/readme.md delete mode 100644 server/node_modules/agent-base/package.json delete mode 100644 server/node_modules/agent-base/src/index.ts delete mode 100644 server/node_modules/agent-base/src/promisify.ts delete mode 100644 server/node_modules/append-field/.npmignore delete mode 100644 server/node_modules/append-field/LICENSE delete mode 100644 server/node_modules/append-field/README.md delete mode 100644 server/node_modules/append-field/index.js delete mode 100644 server/node_modules/append-field/lib/parse-path.js delete mode 100644 server/node_modules/append-field/lib/set-value.js delete mode 100644 server/node_modules/append-field/package.json delete mode 100644 server/node_modules/append-field/test/forms.js delete mode 100644 server/node_modules/array-flatten/LICENSE delete mode 100644 server/node_modules/array-flatten/README.md delete mode 100644 server/node_modules/array-flatten/array-flatten.js delete mode 100644 server/node_modules/array-flatten/package.json delete mode 100644 server/node_modules/asynckit/LICENSE delete mode 100644 server/node_modules/asynckit/README.md delete mode 100644 server/node_modules/asynckit/bench.js delete mode 100644 server/node_modules/asynckit/index.js delete mode 100644 server/node_modules/asynckit/lib/abort.js delete mode 100644 server/node_modules/asynckit/lib/async.js delete mode 100644 server/node_modules/asynckit/lib/defer.js delete mode 100644 server/node_modules/asynckit/lib/iterate.js delete mode 100644 server/node_modules/asynckit/lib/readable_asynckit.js delete mode 100644 server/node_modules/asynckit/lib/readable_parallel.js delete mode 100644 server/node_modules/asynckit/lib/readable_serial.js delete mode 100644 server/node_modules/asynckit/lib/readable_serial_ordered.js delete mode 100644 server/node_modules/asynckit/lib/state.js delete mode 100644 server/node_modules/asynckit/lib/streamify.js delete mode 100644 server/node_modules/asynckit/lib/terminator.js delete mode 100644 server/node_modules/asynckit/package.json delete mode 100644 server/node_modules/asynckit/parallel.js delete mode 100644 server/node_modules/asynckit/serial.js delete mode 100644 server/node_modules/asynckit/serialOrdered.js delete mode 100644 server/node_modules/asynckit/stream.js delete mode 100644 server/node_modules/axios/CHANGELOG.md delete mode 100644 server/node_modules/axios/LICENSE delete mode 100644 server/node_modules/axios/MIGRATION_GUIDE.md delete mode 100644 server/node_modules/axios/README.md delete mode 100644 server/node_modules/axios/dist/axios.js delete mode 100644 server/node_modules/axios/dist/axios.min.js delete mode 100644 server/node_modules/axios/dist/axios.min.js.map delete mode 100644 server/node_modules/axios/dist/browser/axios.cjs delete mode 100644 server/node_modules/axios/dist/esm/axios.js delete mode 100644 server/node_modules/axios/dist/esm/axios.min.js delete mode 100644 server/node_modules/axios/dist/esm/axios.min.js.map delete mode 100644 server/node_modules/axios/dist/node/axios.cjs delete mode 100644 server/node_modules/axios/index.d.cts delete mode 100644 server/node_modules/axios/index.d.ts delete mode 100644 server/node_modules/axios/index.js delete mode 100644 server/node_modules/axios/lib/adapters/README.md delete mode 100644 server/node_modules/axios/lib/adapters/adapters.js delete mode 100644 server/node_modules/axios/lib/adapters/fetch.js delete mode 100644 server/node_modules/axios/lib/adapters/http.js delete mode 100644 server/node_modules/axios/lib/adapters/xhr.js delete mode 100644 server/node_modules/axios/lib/axios.js delete mode 100644 server/node_modules/axios/lib/cancel/CancelToken.js delete mode 100644 server/node_modules/axios/lib/cancel/CanceledError.js delete mode 100644 server/node_modules/axios/lib/cancel/isCancel.js delete mode 100644 server/node_modules/axios/lib/core/Axios.js delete mode 100644 server/node_modules/axios/lib/core/AxiosError.js delete mode 100644 server/node_modules/axios/lib/core/AxiosHeaders.js delete mode 100644 server/node_modules/axios/lib/core/InterceptorManager.js delete mode 100644 server/node_modules/axios/lib/core/README.md delete mode 100644 server/node_modules/axios/lib/core/buildFullPath.js delete mode 100644 server/node_modules/axios/lib/core/dispatchRequest.js delete mode 100644 server/node_modules/axios/lib/core/mergeConfig.js delete mode 100644 server/node_modules/axios/lib/core/setFormDataHeaders.js delete mode 100644 server/node_modules/axios/lib/core/settle.js delete mode 100644 server/node_modules/axios/lib/core/transformData.js delete mode 100644 server/node_modules/axios/lib/defaults/index.js delete mode 100644 server/node_modules/axios/lib/defaults/transitional.js delete mode 100644 server/node_modules/axios/lib/env/README.md delete mode 100644 server/node_modules/axios/lib/env/classes/FormData.js delete mode 100644 server/node_modules/axios/lib/env/data.js delete mode 100644 server/node_modules/axios/lib/helpers/AxiosTransformStream.js delete mode 100644 server/node_modules/axios/lib/helpers/AxiosURLSearchParams.js delete mode 100644 server/node_modules/axios/lib/helpers/Http2Sessions.js delete mode 100644 server/node_modules/axios/lib/helpers/HttpStatusCode.js delete mode 100644 server/node_modules/axios/lib/helpers/README.md delete mode 100644 server/node_modules/axios/lib/helpers/ZlibHeaderTransformStream.js delete mode 100644 server/node_modules/axios/lib/helpers/bind.js delete mode 100644 server/node_modules/axios/lib/helpers/buildURL.js delete mode 100644 server/node_modules/axios/lib/helpers/callbackify.js delete mode 100644 server/node_modules/axios/lib/helpers/combineURLs.js delete mode 100644 server/node_modules/axios/lib/helpers/composeSignals.js delete mode 100644 server/node_modules/axios/lib/helpers/cookies.js delete mode 100644 server/node_modules/axios/lib/helpers/deprecatedMethod.js delete mode 100644 server/node_modules/axios/lib/helpers/estimateDataURLDecodedBytes.js delete mode 100644 server/node_modules/axios/lib/helpers/formDataToJSON.js delete mode 100644 server/node_modules/axios/lib/helpers/formDataToStream.js delete mode 100644 server/node_modules/axios/lib/helpers/fromDataURI.js delete mode 100644 server/node_modules/axios/lib/helpers/isAbsoluteURL.js delete mode 100644 server/node_modules/axios/lib/helpers/isAxiosError.js delete mode 100644 server/node_modules/axios/lib/helpers/isURLSameOrigin.js delete mode 100644 server/node_modules/axios/lib/helpers/null.js delete mode 100644 server/node_modules/axios/lib/helpers/parseHeaders.js delete mode 100644 server/node_modules/axios/lib/helpers/parseProtocol.js delete mode 100644 server/node_modules/axios/lib/helpers/progressEventReducer.js delete mode 100644 server/node_modules/axios/lib/helpers/readBlob.js delete mode 100644 server/node_modules/axios/lib/helpers/resolveConfig.js delete mode 100644 server/node_modules/axios/lib/helpers/sanitizeHeaderValue.js delete mode 100644 server/node_modules/axios/lib/helpers/shouldBypassProxy.js delete mode 100644 server/node_modules/axios/lib/helpers/speedometer.js delete mode 100644 server/node_modules/axios/lib/helpers/spread.js delete mode 100644 server/node_modules/axios/lib/helpers/throttle.js delete mode 100644 server/node_modules/axios/lib/helpers/toFormData.js delete mode 100644 server/node_modules/axios/lib/helpers/toURLEncodedForm.js delete mode 100644 server/node_modules/axios/lib/helpers/trackStream.js delete mode 100644 server/node_modules/axios/lib/helpers/validator.js delete mode 100644 server/node_modules/axios/lib/platform/browser/classes/Blob.js delete mode 100644 server/node_modules/axios/lib/platform/browser/classes/FormData.js delete mode 100644 server/node_modules/axios/lib/platform/browser/classes/URLSearchParams.js delete mode 100644 server/node_modules/axios/lib/platform/browser/index.js delete mode 100644 server/node_modules/axios/lib/platform/common/utils.js delete mode 100644 server/node_modules/axios/lib/platform/index.js delete mode 100644 server/node_modules/axios/lib/platform/node/classes/Buffer.js delete mode 100644 server/node_modules/axios/lib/platform/node/classes/FormData.js delete mode 100644 server/node_modules/axios/lib/platform/node/classes/URLSearchParams.js delete mode 100644 server/node_modules/axios/lib/platform/node/index.js delete mode 100644 server/node_modules/axios/lib/utils.js delete mode 100644 server/node_modules/axios/package.json delete mode 100644 server/node_modules/body-parser/HISTORY.md delete mode 100644 server/node_modules/body-parser/LICENSE delete mode 100644 server/node_modules/body-parser/README.md delete mode 100644 server/node_modules/body-parser/index.js delete mode 100644 server/node_modules/body-parser/lib/read.js delete mode 100644 server/node_modules/body-parser/lib/types/json.js delete mode 100644 server/node_modules/body-parser/lib/types/raw.js delete mode 100644 server/node_modules/body-parser/lib/types/text.js delete mode 100644 server/node_modules/body-parser/lib/types/urlencoded.js delete mode 100644 server/node_modules/body-parser/package.json delete mode 100644 server/node_modules/buffer-from/LICENSE delete mode 100644 server/node_modules/buffer-from/index.js delete mode 100644 server/node_modules/buffer-from/package.json delete mode 100644 server/node_modules/buffer-from/readme.md delete mode 100644 server/node_modules/busboy/.eslintrc.js delete mode 100644 server/node_modules/busboy/.github/workflows/ci.yml delete mode 100644 server/node_modules/busboy/.github/workflows/lint.yml delete mode 100644 server/node_modules/busboy/LICENSE delete mode 100644 server/node_modules/busboy/README.md delete mode 100644 server/node_modules/busboy/bench/bench-multipart-fields-100mb-big.js delete mode 100644 server/node_modules/busboy/bench/bench-multipart-fields-100mb-small.js delete mode 100644 server/node_modules/busboy/bench/bench-multipart-files-100mb-big.js delete mode 100644 server/node_modules/busboy/bench/bench-multipart-files-100mb-small.js delete mode 100644 server/node_modules/busboy/bench/bench-urlencoded-fields-100pairs-small.js delete mode 100644 server/node_modules/busboy/bench/bench-urlencoded-fields-900pairs-small-alt.js delete mode 100644 server/node_modules/busboy/lib/index.js delete mode 100644 server/node_modules/busboy/lib/types/multipart.js delete mode 100644 server/node_modules/busboy/lib/types/urlencoded.js delete mode 100644 server/node_modules/busboy/lib/utils.js delete mode 100644 server/node_modules/busboy/package.json delete mode 100644 server/node_modules/busboy/test/common.js delete mode 100644 server/node_modules/busboy/test/test-types-multipart-charsets.js delete mode 100644 server/node_modules/busboy/test/test-types-multipart-stream-pause.js delete mode 100644 server/node_modules/busboy/test/test-types-multipart.js delete mode 100644 server/node_modules/busboy/test/test-types-urlencoded.js delete mode 100644 server/node_modules/busboy/test/test.js delete mode 100644 server/node_modules/bytes/History.md delete mode 100644 server/node_modules/bytes/LICENSE delete mode 100644 server/node_modules/bytes/Readme.md delete mode 100644 server/node_modules/bytes/index.js delete mode 100644 server/node_modules/bytes/package.json delete mode 100644 server/node_modules/call-bind-apply-helpers/.eslintrc delete mode 100644 server/node_modules/call-bind-apply-helpers/.github/FUNDING.yml delete mode 100644 server/node_modules/call-bind-apply-helpers/.nycrc delete mode 100644 server/node_modules/call-bind-apply-helpers/CHANGELOG.md delete mode 100644 server/node_modules/call-bind-apply-helpers/LICENSE delete mode 100644 server/node_modules/call-bind-apply-helpers/README.md delete mode 100644 server/node_modules/call-bind-apply-helpers/actualApply.d.ts delete mode 100644 server/node_modules/call-bind-apply-helpers/actualApply.js delete mode 100644 server/node_modules/call-bind-apply-helpers/applyBind.d.ts delete mode 100644 server/node_modules/call-bind-apply-helpers/applyBind.js delete mode 100644 server/node_modules/call-bind-apply-helpers/functionApply.d.ts delete mode 100644 server/node_modules/call-bind-apply-helpers/functionApply.js delete mode 100644 server/node_modules/call-bind-apply-helpers/functionCall.d.ts delete mode 100644 server/node_modules/call-bind-apply-helpers/functionCall.js delete mode 100644 server/node_modules/call-bind-apply-helpers/index.d.ts delete mode 100644 server/node_modules/call-bind-apply-helpers/index.js delete mode 100644 server/node_modules/call-bind-apply-helpers/package.json delete mode 100644 server/node_modules/call-bind-apply-helpers/reflectApply.d.ts delete mode 100644 server/node_modules/call-bind-apply-helpers/reflectApply.js delete mode 100644 server/node_modules/call-bind-apply-helpers/test/index.js delete mode 100644 server/node_modules/call-bind-apply-helpers/tsconfig.json delete mode 100644 server/node_modules/call-bound/.eslintrc delete mode 100644 server/node_modules/call-bound/.github/FUNDING.yml delete mode 100644 server/node_modules/call-bound/.nycrc delete mode 100644 server/node_modules/call-bound/CHANGELOG.md delete mode 100644 server/node_modules/call-bound/LICENSE delete mode 100644 server/node_modules/call-bound/README.md delete mode 100644 server/node_modules/call-bound/index.d.ts delete mode 100644 server/node_modules/call-bound/index.js delete mode 100644 server/node_modules/call-bound/package.json delete mode 100644 server/node_modules/call-bound/test/index.js delete mode 100644 server/node_modules/call-bound/tsconfig.json delete mode 100644 server/node_modules/combined-stream/License delete mode 100644 server/node_modules/combined-stream/Readme.md delete mode 100644 server/node_modules/combined-stream/lib/combined_stream.js delete mode 100644 server/node_modules/combined-stream/package.json delete mode 100644 server/node_modules/combined-stream/yarn.lock delete mode 100644 server/node_modules/concat-stream/LICENSE delete mode 100644 server/node_modules/concat-stream/index.js delete mode 100644 server/node_modules/concat-stream/package.json delete mode 100644 server/node_modules/concat-stream/readme.md delete mode 100644 server/node_modules/content-disposition/HISTORY.md delete mode 100644 server/node_modules/content-disposition/LICENSE delete mode 100644 server/node_modules/content-disposition/README.md delete mode 100644 server/node_modules/content-disposition/index.js delete mode 100644 server/node_modules/content-disposition/package.json delete mode 100644 server/node_modules/content-type/HISTORY.md delete mode 100644 server/node_modules/content-type/LICENSE delete mode 100644 server/node_modules/content-type/README.md delete mode 100644 server/node_modules/content-type/index.js delete mode 100644 server/node_modules/content-type/package.json delete mode 100644 server/node_modules/cookie-signature/History.md delete mode 100644 server/node_modules/cookie-signature/Readme.md delete mode 100644 server/node_modules/cookie-signature/index.js delete mode 100644 server/node_modules/cookie-signature/package.json delete mode 100644 server/node_modules/cookie/LICENSE delete mode 100644 server/node_modules/cookie/README.md delete mode 100644 server/node_modules/cookie/SECURITY.md delete mode 100644 server/node_modules/cookie/index.js delete mode 100644 server/node_modules/cookie/package.json delete mode 100644 server/node_modules/cors/LICENSE delete mode 100644 server/node_modules/cors/README.md delete mode 100644 server/node_modules/cors/lib/index.js delete mode 100644 server/node_modules/cors/package.json delete mode 100644 server/node_modules/data-uri-to-buffer/README.md delete mode 100644 server/node_modules/data-uri-to-buffer/dist/index.d.ts delete mode 100644 server/node_modules/data-uri-to-buffer/dist/index.js delete mode 100644 server/node_modules/data-uri-to-buffer/dist/index.js.map delete mode 100644 server/node_modules/data-uri-to-buffer/package.json delete mode 100644 server/node_modules/data-uri-to-buffer/src/index.ts delete mode 100644 server/node_modules/debug/.coveralls.yml delete mode 100644 server/node_modules/debug/.eslintrc delete mode 100644 server/node_modules/debug/.npmignore delete mode 100644 server/node_modules/debug/.travis.yml delete mode 100644 server/node_modules/debug/CHANGELOG.md delete mode 100644 server/node_modules/debug/LICENSE delete mode 100644 server/node_modules/debug/Makefile delete mode 100644 server/node_modules/debug/README.md delete mode 100644 server/node_modules/debug/component.json delete mode 100644 server/node_modules/debug/karma.conf.js delete mode 100644 server/node_modules/debug/node.js delete mode 100644 server/node_modules/debug/package.json delete mode 100644 server/node_modules/debug/src/browser.js delete mode 100644 server/node_modules/debug/src/debug.js delete mode 100644 server/node_modules/debug/src/index.js delete mode 100644 server/node_modules/debug/src/inspector-log.js delete mode 100644 server/node_modules/debug/src/node.js delete mode 100644 server/node_modules/delayed-stream/.npmignore delete mode 100644 server/node_modules/delayed-stream/License delete mode 100644 server/node_modules/delayed-stream/Makefile delete mode 100644 server/node_modules/delayed-stream/Readme.md delete mode 100644 server/node_modules/delayed-stream/lib/delayed_stream.js delete mode 100644 server/node_modules/delayed-stream/package.json delete mode 100644 server/node_modules/depd/History.md delete mode 100644 server/node_modules/depd/LICENSE delete mode 100644 server/node_modules/depd/Readme.md delete mode 100644 server/node_modules/depd/index.js delete mode 100644 server/node_modules/depd/lib/browser/index.js delete mode 100644 server/node_modules/depd/package.json delete mode 100644 server/node_modules/destroy/LICENSE delete mode 100644 server/node_modules/destroy/README.md delete mode 100644 server/node_modules/destroy/index.js delete mode 100644 server/node_modules/destroy/package.json delete mode 100644 server/node_modules/dotenv/CHANGELOG.md delete mode 100644 server/node_modules/dotenv/LICENSE delete mode 100644 server/node_modules/dotenv/README-es.md delete mode 100644 server/node_modules/dotenv/README.md delete mode 100644 server/node_modules/dotenv/SECURITY.md delete mode 100644 server/node_modules/dotenv/config.d.ts delete mode 100644 server/node_modules/dotenv/config.js delete mode 100644 server/node_modules/dotenv/lib/cli-options.js delete mode 100644 server/node_modules/dotenv/lib/env-options.js delete mode 100644 server/node_modules/dotenv/lib/main.d.ts delete mode 100644 server/node_modules/dotenv/lib/main.js delete mode 100644 server/node_modules/dotenv/package.json delete mode 100644 server/node_modules/dunder-proto/.eslintrc delete mode 100644 server/node_modules/dunder-proto/.github/FUNDING.yml delete mode 100644 server/node_modules/dunder-proto/.nycrc delete mode 100644 server/node_modules/dunder-proto/CHANGELOG.md delete mode 100644 server/node_modules/dunder-proto/LICENSE delete mode 100644 server/node_modules/dunder-proto/README.md delete mode 100644 server/node_modules/dunder-proto/get.d.ts delete mode 100644 server/node_modules/dunder-proto/get.js delete mode 100644 server/node_modules/dunder-proto/package.json delete mode 100644 server/node_modules/dunder-proto/set.d.ts delete mode 100644 server/node_modules/dunder-proto/set.js delete mode 100644 server/node_modules/dunder-proto/test/get.js delete mode 100644 server/node_modules/dunder-proto/test/index.js delete mode 100644 server/node_modules/dunder-proto/test/set.js delete mode 100644 server/node_modules/dunder-proto/tsconfig.json delete mode 100644 server/node_modules/ee-first/LICENSE delete mode 100644 server/node_modules/ee-first/README.md delete mode 100644 server/node_modules/ee-first/index.js delete mode 100644 server/node_modules/ee-first/package.json delete mode 100644 server/node_modules/encodeurl/LICENSE delete mode 100644 server/node_modules/encodeurl/README.md delete mode 100644 server/node_modules/encodeurl/index.js delete mode 100644 server/node_modules/encodeurl/package.json delete mode 100644 server/node_modules/es-define-property/.eslintrc delete mode 100644 server/node_modules/es-define-property/.github/FUNDING.yml delete mode 100644 server/node_modules/es-define-property/.nycrc delete mode 100644 server/node_modules/es-define-property/CHANGELOG.md delete mode 100644 server/node_modules/es-define-property/LICENSE delete mode 100644 server/node_modules/es-define-property/README.md delete mode 100644 server/node_modules/es-define-property/index.d.ts delete mode 100644 server/node_modules/es-define-property/index.js delete mode 100644 server/node_modules/es-define-property/package.json delete mode 100644 server/node_modules/es-define-property/test/index.js delete mode 100644 server/node_modules/es-define-property/tsconfig.json delete mode 100644 server/node_modules/es-errors/.eslintrc delete mode 100644 server/node_modules/es-errors/.github/FUNDING.yml delete mode 100644 server/node_modules/es-errors/CHANGELOG.md delete mode 100644 server/node_modules/es-errors/LICENSE delete mode 100644 server/node_modules/es-errors/README.md delete mode 100644 server/node_modules/es-errors/eval.d.ts delete mode 100644 server/node_modules/es-errors/eval.js delete mode 100644 server/node_modules/es-errors/index.d.ts delete mode 100644 server/node_modules/es-errors/index.js delete mode 100644 server/node_modules/es-errors/package.json delete mode 100644 server/node_modules/es-errors/range.d.ts delete mode 100644 server/node_modules/es-errors/range.js delete mode 100644 server/node_modules/es-errors/ref.d.ts delete mode 100644 server/node_modules/es-errors/ref.js delete mode 100644 server/node_modules/es-errors/syntax.d.ts delete mode 100644 server/node_modules/es-errors/syntax.js delete mode 100644 server/node_modules/es-errors/test/index.js delete mode 100644 server/node_modules/es-errors/tsconfig.json delete mode 100644 server/node_modules/es-errors/type.d.ts delete mode 100644 server/node_modules/es-errors/type.js delete mode 100644 server/node_modules/es-errors/uri.d.ts delete mode 100644 server/node_modules/es-errors/uri.js delete mode 100644 server/node_modules/es-object-atoms/.eslintrc delete mode 100644 server/node_modules/es-object-atoms/.github/FUNDING.yml delete mode 100644 server/node_modules/es-object-atoms/CHANGELOG.md delete mode 100644 server/node_modules/es-object-atoms/LICENSE delete mode 100644 server/node_modules/es-object-atoms/README.md delete mode 100644 server/node_modules/es-object-atoms/RequireObjectCoercible.d.ts delete mode 100644 server/node_modules/es-object-atoms/RequireObjectCoercible.js delete mode 100644 server/node_modules/es-object-atoms/ToObject.d.ts delete mode 100644 server/node_modules/es-object-atoms/ToObject.js delete mode 100644 server/node_modules/es-object-atoms/index.d.ts delete mode 100644 server/node_modules/es-object-atoms/index.js delete mode 100644 server/node_modules/es-object-atoms/isObject.d.ts delete mode 100644 server/node_modules/es-object-atoms/isObject.js delete mode 100644 server/node_modules/es-object-atoms/package.json delete mode 100644 server/node_modules/es-object-atoms/test/index.js delete mode 100644 server/node_modules/es-object-atoms/tsconfig.json delete mode 100644 server/node_modules/es-set-tostringtag/.eslintrc delete mode 100644 server/node_modules/es-set-tostringtag/.nycrc delete mode 100644 server/node_modules/es-set-tostringtag/CHANGELOG.md delete mode 100644 server/node_modules/es-set-tostringtag/LICENSE delete mode 100644 server/node_modules/es-set-tostringtag/README.md delete mode 100644 server/node_modules/es-set-tostringtag/index.d.ts delete mode 100644 server/node_modules/es-set-tostringtag/index.js delete mode 100644 server/node_modules/es-set-tostringtag/package.json delete mode 100644 server/node_modules/es-set-tostringtag/test/index.js delete mode 100644 server/node_modules/es-set-tostringtag/tsconfig.json delete mode 100644 server/node_modules/escape-html/LICENSE delete mode 100644 server/node_modules/escape-html/Readme.md delete mode 100644 server/node_modules/escape-html/index.js delete mode 100644 server/node_modules/escape-html/package.json delete mode 100644 server/node_modules/etag/HISTORY.md delete mode 100644 server/node_modules/etag/LICENSE delete mode 100644 server/node_modules/etag/README.md delete mode 100644 server/node_modules/etag/index.js delete mode 100644 server/node_modules/etag/package.json delete mode 100644 server/node_modules/express/History.md delete mode 100644 server/node_modules/express/LICENSE delete mode 100644 server/node_modules/express/Readme.md delete mode 100644 server/node_modules/express/index.js delete mode 100644 server/node_modules/express/lib/application.js delete mode 100644 server/node_modules/express/lib/express.js delete mode 100644 server/node_modules/express/lib/middleware/init.js delete mode 100644 server/node_modules/express/lib/middleware/query.js delete mode 100644 server/node_modules/express/lib/request.js delete mode 100644 server/node_modules/express/lib/response.js delete mode 100644 server/node_modules/express/lib/router/index.js delete mode 100644 server/node_modules/express/lib/router/layer.js delete mode 100644 server/node_modules/express/lib/router/route.js delete mode 100644 server/node_modules/express/lib/utils.js delete mode 100644 server/node_modules/express/lib/view.js delete mode 100644 server/node_modules/express/package.json delete mode 100644 server/node_modules/fetch-blob/LICENSE delete mode 100644 server/node_modules/fetch-blob/README.md delete mode 100644 server/node_modules/fetch-blob/file.d.ts delete mode 100644 server/node_modules/fetch-blob/file.js delete mode 100644 server/node_modules/fetch-blob/from.d.ts delete mode 100644 server/node_modules/fetch-blob/from.js delete mode 100644 server/node_modules/fetch-blob/index.d.ts delete mode 100644 server/node_modules/fetch-blob/index.js delete mode 100644 server/node_modules/fetch-blob/package.json delete mode 100644 server/node_modules/fetch-blob/streams.cjs delete mode 100644 server/node_modules/finalhandler/HISTORY.md delete mode 100644 server/node_modules/finalhandler/LICENSE delete mode 100644 server/node_modules/finalhandler/README.md delete mode 100644 server/node_modules/finalhandler/SECURITY.md delete mode 100644 server/node_modules/finalhandler/index.js delete mode 100644 server/node_modules/finalhandler/package.json delete mode 100644 server/node_modules/follow-redirects/LICENSE delete mode 100644 server/node_modules/follow-redirects/README.md delete mode 100644 server/node_modules/follow-redirects/debug.js delete mode 100644 server/node_modules/follow-redirects/http.js delete mode 100644 server/node_modules/follow-redirects/https.js delete mode 100644 server/node_modules/follow-redirects/index.js delete mode 100644 server/node_modules/follow-redirects/package.json delete mode 100644 server/node_modules/form-data/CHANGELOG.md delete mode 100644 server/node_modules/form-data/License delete mode 100644 server/node_modules/form-data/README.md delete mode 100644 server/node_modules/form-data/index.d.ts delete mode 100644 server/node_modules/form-data/lib/browser.js delete mode 100644 server/node_modules/form-data/lib/form_data.js delete mode 100644 server/node_modules/form-data/lib/populate.js delete mode 100644 server/node_modules/form-data/package.json delete mode 100644 server/node_modules/formdata-polyfill/FormData.js delete mode 100644 server/node_modules/formdata-polyfill/LICENSE delete mode 100644 server/node_modules/formdata-polyfill/README.md delete mode 100644 server/node_modules/formdata-polyfill/esm.min.d.ts delete mode 100644 server/node_modules/formdata-polyfill/esm.min.js delete mode 100644 server/node_modules/formdata-polyfill/formdata-to-blob.js delete mode 100644 server/node_modules/formdata-polyfill/formdata.min.js delete mode 100644 server/node_modules/formdata-polyfill/package.json delete mode 100644 server/node_modules/forwarded/HISTORY.md delete mode 100644 server/node_modules/forwarded/LICENSE delete mode 100644 server/node_modules/forwarded/README.md delete mode 100644 server/node_modules/forwarded/index.js delete mode 100644 server/node_modules/forwarded/package.json delete mode 100644 server/node_modules/fresh/HISTORY.md delete mode 100644 server/node_modules/fresh/LICENSE delete mode 100644 server/node_modules/fresh/README.md delete mode 100644 server/node_modules/fresh/index.js delete mode 100644 server/node_modules/fresh/package.json delete mode 100644 server/node_modules/function-bind/.eslintrc delete mode 100644 server/node_modules/function-bind/.github/FUNDING.yml delete mode 100644 server/node_modules/function-bind/.github/SECURITY.md delete mode 100644 server/node_modules/function-bind/.nycrc delete mode 100644 server/node_modules/function-bind/CHANGELOG.md delete mode 100644 server/node_modules/function-bind/LICENSE delete mode 100644 server/node_modules/function-bind/README.md delete mode 100644 server/node_modules/function-bind/implementation.js delete mode 100644 server/node_modules/function-bind/index.js delete mode 100644 server/node_modules/function-bind/package.json delete mode 100644 server/node_modules/function-bind/test/.eslintrc delete mode 100644 server/node_modules/function-bind/test/index.js delete mode 100644 server/node_modules/get-intrinsic/.eslintrc delete mode 100644 server/node_modules/get-intrinsic/.github/FUNDING.yml delete mode 100644 server/node_modules/get-intrinsic/.nycrc delete mode 100644 server/node_modules/get-intrinsic/CHANGELOG.md delete mode 100644 server/node_modules/get-intrinsic/LICENSE delete mode 100644 server/node_modules/get-intrinsic/README.md delete mode 100644 server/node_modules/get-intrinsic/index.js delete mode 100644 server/node_modules/get-intrinsic/package.json delete mode 100644 server/node_modules/get-intrinsic/test/GetIntrinsic.js delete mode 100644 server/node_modules/get-proto/.eslintrc delete mode 100644 server/node_modules/get-proto/.github/FUNDING.yml delete mode 100644 server/node_modules/get-proto/.nycrc delete mode 100644 server/node_modules/get-proto/CHANGELOG.md delete mode 100644 server/node_modules/get-proto/LICENSE delete mode 100644 server/node_modules/get-proto/Object.getPrototypeOf.d.ts delete mode 100644 server/node_modules/get-proto/Object.getPrototypeOf.js delete mode 100644 server/node_modules/get-proto/README.md delete mode 100644 server/node_modules/get-proto/Reflect.getPrototypeOf.d.ts delete mode 100644 server/node_modules/get-proto/Reflect.getPrototypeOf.js delete mode 100644 server/node_modules/get-proto/index.d.ts delete mode 100644 server/node_modules/get-proto/index.js delete mode 100644 server/node_modules/get-proto/package.json delete mode 100644 server/node_modules/get-proto/test/index.js delete mode 100644 server/node_modules/get-proto/tsconfig.json delete mode 100644 server/node_modules/gopd/.eslintrc delete mode 100644 server/node_modules/gopd/.github/FUNDING.yml delete mode 100644 server/node_modules/gopd/CHANGELOG.md delete mode 100644 server/node_modules/gopd/LICENSE delete mode 100644 server/node_modules/gopd/README.md delete mode 100644 server/node_modules/gopd/gOPD.d.ts delete mode 100644 server/node_modules/gopd/gOPD.js delete mode 100644 server/node_modules/gopd/index.d.ts delete mode 100644 server/node_modules/gopd/index.js delete mode 100644 server/node_modules/gopd/package.json delete mode 100644 server/node_modules/gopd/test/index.js delete mode 100644 server/node_modules/gopd/tsconfig.json delete mode 100644 server/node_modules/has-symbols/.eslintrc delete mode 100644 server/node_modules/has-symbols/.github/FUNDING.yml delete mode 100644 server/node_modules/has-symbols/.nycrc delete mode 100644 server/node_modules/has-symbols/CHANGELOG.md delete mode 100644 server/node_modules/has-symbols/LICENSE delete mode 100644 server/node_modules/has-symbols/README.md delete mode 100644 server/node_modules/has-symbols/index.d.ts delete mode 100644 server/node_modules/has-symbols/index.js delete mode 100644 server/node_modules/has-symbols/package.json delete mode 100644 server/node_modules/has-symbols/shams.d.ts delete mode 100644 server/node_modules/has-symbols/shams.js delete mode 100644 server/node_modules/has-symbols/test/index.js delete mode 100644 server/node_modules/has-symbols/test/shams/core-js.js delete mode 100644 server/node_modules/has-symbols/test/shams/get-own-property-symbols.js delete mode 100644 server/node_modules/has-symbols/test/tests.js delete mode 100644 server/node_modules/has-symbols/tsconfig.json delete mode 100644 server/node_modules/has-tostringtag/.eslintrc delete mode 100644 server/node_modules/has-tostringtag/.github/FUNDING.yml delete mode 100644 server/node_modules/has-tostringtag/.nycrc delete mode 100644 server/node_modules/has-tostringtag/CHANGELOG.md delete mode 100644 server/node_modules/has-tostringtag/LICENSE delete mode 100644 server/node_modules/has-tostringtag/README.md delete mode 100644 server/node_modules/has-tostringtag/index.d.ts delete mode 100644 server/node_modules/has-tostringtag/index.js delete mode 100644 server/node_modules/has-tostringtag/package.json delete mode 100644 server/node_modules/has-tostringtag/shams.d.ts delete mode 100644 server/node_modules/has-tostringtag/shams.js delete mode 100644 server/node_modules/has-tostringtag/test/index.js delete mode 100644 server/node_modules/has-tostringtag/test/shams/core-js.js delete mode 100644 server/node_modules/has-tostringtag/test/shams/get-own-property-symbols.js delete mode 100644 server/node_modules/has-tostringtag/test/tests.js delete mode 100644 server/node_modules/has-tostringtag/tsconfig.json delete mode 100644 server/node_modules/hasown/.github/FUNDING.yml delete mode 100644 server/node_modules/hasown/.nycrc delete mode 100644 server/node_modules/hasown/CHANGELOG.md delete mode 100644 server/node_modules/hasown/LICENSE delete mode 100644 server/node_modules/hasown/README.md delete mode 100644 server/node_modules/hasown/eslint.config.mjs delete mode 100644 server/node_modules/hasown/index.d.ts delete mode 100644 server/node_modules/hasown/index.js delete mode 100644 server/node_modules/hasown/package.json delete mode 100644 server/node_modules/hasown/tsconfig.json delete mode 100644 server/node_modules/http-errors/HISTORY.md delete mode 100644 server/node_modules/http-errors/LICENSE delete mode 100644 server/node_modules/http-errors/README.md delete mode 100644 server/node_modules/http-errors/index.js delete mode 100644 server/node_modules/http-errors/package.json delete mode 100644 server/node_modules/https-proxy-agent/README.md delete mode 100644 server/node_modules/https-proxy-agent/dist/agent.d.ts delete mode 100644 server/node_modules/https-proxy-agent/dist/agent.js delete mode 100644 server/node_modules/https-proxy-agent/dist/agent.js.map delete mode 100644 server/node_modules/https-proxy-agent/dist/index.d.ts delete mode 100644 server/node_modules/https-proxy-agent/dist/index.js delete mode 100644 server/node_modules/https-proxy-agent/dist/index.js.map delete mode 100644 server/node_modules/https-proxy-agent/dist/parse-proxy-response.d.ts delete mode 100644 server/node_modules/https-proxy-agent/dist/parse-proxy-response.js delete mode 100644 server/node_modules/https-proxy-agent/dist/parse-proxy-response.js.map delete mode 100644 server/node_modules/https-proxy-agent/node_modules/debug/LICENSE delete mode 100644 server/node_modules/https-proxy-agent/node_modules/debug/README.md delete mode 100644 server/node_modules/https-proxy-agent/node_modules/debug/package.json delete mode 100644 server/node_modules/https-proxy-agent/node_modules/debug/src/browser.js delete mode 100644 server/node_modules/https-proxy-agent/node_modules/debug/src/common.js delete mode 100644 server/node_modules/https-proxy-agent/node_modules/debug/src/index.js delete mode 100644 server/node_modules/https-proxy-agent/node_modules/debug/src/node.js delete mode 100644 server/node_modules/https-proxy-agent/node_modules/ms/index.js delete mode 100644 server/node_modules/https-proxy-agent/node_modules/ms/license.md delete mode 100644 server/node_modules/https-proxy-agent/node_modules/ms/package.json delete mode 100644 server/node_modules/https-proxy-agent/node_modules/ms/readme.md delete mode 100644 server/node_modules/https-proxy-agent/package.json delete mode 100644 server/node_modules/iconv-lite/Changelog.md delete mode 100644 server/node_modules/iconv-lite/LICENSE delete mode 100644 server/node_modules/iconv-lite/README.md delete mode 100644 server/node_modules/iconv-lite/encodings/dbcs-codec.js delete mode 100644 server/node_modules/iconv-lite/encodings/dbcs-data.js delete mode 100644 server/node_modules/iconv-lite/encodings/index.js delete mode 100644 server/node_modules/iconv-lite/encodings/internal.js delete mode 100644 server/node_modules/iconv-lite/encodings/sbcs-codec.js delete mode 100644 server/node_modules/iconv-lite/encodings/sbcs-data-generated.js delete mode 100644 server/node_modules/iconv-lite/encodings/sbcs-data.js delete mode 100644 server/node_modules/iconv-lite/encodings/tables/big5-added.json delete mode 100644 server/node_modules/iconv-lite/encodings/tables/cp936.json delete mode 100644 server/node_modules/iconv-lite/encodings/tables/cp949.json delete mode 100644 server/node_modules/iconv-lite/encodings/tables/cp950.json delete mode 100644 server/node_modules/iconv-lite/encodings/tables/eucjp.json delete mode 100644 server/node_modules/iconv-lite/encodings/tables/gb18030-ranges.json delete mode 100644 server/node_modules/iconv-lite/encodings/tables/gbk-added.json delete mode 100644 server/node_modules/iconv-lite/encodings/tables/shiftjis.json delete mode 100644 server/node_modules/iconv-lite/encodings/utf16.js delete mode 100644 server/node_modules/iconv-lite/encodings/utf7.js delete mode 100644 server/node_modules/iconv-lite/lib/bom-handling.js delete mode 100644 server/node_modules/iconv-lite/lib/extend-node.js delete mode 100644 server/node_modules/iconv-lite/lib/index.d.ts delete mode 100644 server/node_modules/iconv-lite/lib/index.js delete mode 100644 server/node_modules/iconv-lite/lib/streams.js delete mode 100644 server/node_modules/iconv-lite/package.json delete mode 100644 server/node_modules/inherits/LICENSE delete mode 100644 server/node_modules/inherits/README.md delete mode 100644 server/node_modules/inherits/inherits.js delete mode 100644 server/node_modules/inherits/inherits_browser.js delete mode 100644 server/node_modules/inherits/package.json delete mode 100644 server/node_modules/ipaddr.js/LICENSE delete mode 100644 server/node_modules/ipaddr.js/README.md delete mode 100644 server/node_modules/ipaddr.js/ipaddr.min.js delete mode 100644 server/node_modules/ipaddr.js/lib/ipaddr.js delete mode 100644 server/node_modules/ipaddr.js/lib/ipaddr.js.d.ts delete mode 100644 server/node_modules/ipaddr.js/package.json delete mode 100644 server/node_modules/math-intrinsics/.eslintrc delete mode 100644 server/node_modules/math-intrinsics/.github/FUNDING.yml delete mode 100644 server/node_modules/math-intrinsics/CHANGELOG.md delete mode 100644 server/node_modules/math-intrinsics/LICENSE delete mode 100644 server/node_modules/math-intrinsics/README.md delete mode 100644 server/node_modules/math-intrinsics/abs.d.ts delete mode 100644 server/node_modules/math-intrinsics/abs.js delete mode 100644 server/node_modules/math-intrinsics/constants/maxArrayLength.d.ts delete mode 100644 server/node_modules/math-intrinsics/constants/maxArrayLength.js delete mode 100644 server/node_modules/math-intrinsics/constants/maxSafeInteger.d.ts delete mode 100644 server/node_modules/math-intrinsics/constants/maxSafeInteger.js delete mode 100644 server/node_modules/math-intrinsics/constants/maxValue.d.ts delete mode 100644 server/node_modules/math-intrinsics/constants/maxValue.js delete mode 100644 server/node_modules/math-intrinsics/floor.d.ts delete mode 100644 server/node_modules/math-intrinsics/floor.js delete mode 100644 server/node_modules/math-intrinsics/isFinite.d.ts delete mode 100644 server/node_modules/math-intrinsics/isFinite.js delete mode 100644 server/node_modules/math-intrinsics/isInteger.d.ts delete mode 100644 server/node_modules/math-intrinsics/isInteger.js delete mode 100644 server/node_modules/math-intrinsics/isNaN.d.ts delete mode 100644 server/node_modules/math-intrinsics/isNaN.js delete mode 100644 server/node_modules/math-intrinsics/isNegativeZero.d.ts delete mode 100644 server/node_modules/math-intrinsics/isNegativeZero.js delete mode 100644 server/node_modules/math-intrinsics/max.d.ts delete mode 100644 server/node_modules/math-intrinsics/max.js delete mode 100644 server/node_modules/math-intrinsics/min.d.ts delete mode 100644 server/node_modules/math-intrinsics/min.js delete mode 100644 server/node_modules/math-intrinsics/mod.d.ts delete mode 100644 server/node_modules/math-intrinsics/mod.js delete mode 100644 server/node_modules/math-intrinsics/package.json delete mode 100644 server/node_modules/math-intrinsics/pow.d.ts delete mode 100644 server/node_modules/math-intrinsics/pow.js delete mode 100644 server/node_modules/math-intrinsics/round.d.ts delete mode 100644 server/node_modules/math-intrinsics/round.js delete mode 100644 server/node_modules/math-intrinsics/sign.d.ts delete mode 100644 server/node_modules/math-intrinsics/sign.js delete mode 100644 server/node_modules/math-intrinsics/test/index.js delete mode 100644 server/node_modules/math-intrinsics/tsconfig.json delete mode 100644 server/node_modules/media-typer/HISTORY.md delete mode 100644 server/node_modules/media-typer/LICENSE delete mode 100644 server/node_modules/media-typer/README.md delete mode 100644 server/node_modules/media-typer/index.js delete mode 100644 server/node_modules/media-typer/package.json delete mode 100644 server/node_modules/merge-descriptors/HISTORY.md delete mode 100644 server/node_modules/merge-descriptors/LICENSE delete mode 100644 server/node_modules/merge-descriptors/README.md delete mode 100644 server/node_modules/merge-descriptors/index.js delete mode 100644 server/node_modules/merge-descriptors/package.json delete mode 100644 server/node_modules/methods/HISTORY.md delete mode 100644 server/node_modules/methods/LICENSE delete mode 100644 server/node_modules/methods/README.md delete mode 100644 server/node_modules/methods/index.js delete mode 100644 server/node_modules/methods/package.json delete mode 100644 server/node_modules/mime-db/HISTORY.md delete mode 100644 server/node_modules/mime-db/LICENSE delete mode 100644 server/node_modules/mime-db/README.md delete mode 100644 server/node_modules/mime-db/db.json delete mode 100644 server/node_modules/mime-db/index.js delete mode 100644 server/node_modules/mime-db/package.json delete mode 100644 server/node_modules/mime-types/HISTORY.md delete mode 100644 server/node_modules/mime-types/LICENSE delete mode 100644 server/node_modules/mime-types/README.md delete mode 100644 server/node_modules/mime-types/index.js delete mode 100644 server/node_modules/mime-types/package.json delete mode 100644 server/node_modules/mime/.npmignore delete mode 100644 server/node_modules/mime/CHANGELOG.md delete mode 100644 server/node_modules/mime/LICENSE delete mode 100644 server/node_modules/mime/README.md delete mode 100644 server/node_modules/mime/cli.js delete mode 100644 server/node_modules/mime/mime.js delete mode 100644 server/node_modules/mime/package.json delete mode 100644 server/node_modules/mime/src/build.js delete mode 100644 server/node_modules/mime/src/test.js delete mode 100644 server/node_modules/mime/types.json delete mode 100644 server/node_modules/ms/index.js delete mode 100644 server/node_modules/ms/license.md delete mode 100644 server/node_modules/ms/package.json delete mode 100644 server/node_modules/ms/readme.md delete mode 100644 server/node_modules/multer/LICENSE delete mode 100644 server/node_modules/multer/README.md delete mode 100644 server/node_modules/multer/index.js delete mode 100644 server/node_modules/multer/lib/counter.js delete mode 100644 server/node_modules/multer/lib/file-appender.js delete mode 100644 server/node_modules/multer/lib/make-middleware.js delete mode 100644 server/node_modules/multer/lib/multer-error.js delete mode 100644 server/node_modules/multer/lib/remove-uploaded-files.js delete mode 100644 server/node_modules/multer/package.json delete mode 100644 server/node_modules/multer/storage/disk.js delete mode 100644 server/node_modules/multer/storage/memory.js delete mode 100644 server/node_modules/negotiator/HISTORY.md delete mode 100644 server/node_modules/negotiator/LICENSE delete mode 100644 server/node_modules/negotiator/README.md delete mode 100644 server/node_modules/negotiator/index.js delete mode 100644 server/node_modules/negotiator/lib/charset.js delete mode 100644 server/node_modules/negotiator/lib/encoding.js delete mode 100644 server/node_modules/negotiator/lib/language.js delete mode 100644 server/node_modules/negotiator/lib/mediaType.js delete mode 100644 server/node_modules/negotiator/package.json delete mode 100644 server/node_modules/node-domexception/.history/README_20210527203617.md delete mode 100644 server/node_modules/node-domexception/.history/README_20210527212714.md delete mode 100644 server/node_modules/node-domexception/.history/README_20210527213345.md delete mode 100644 server/node_modules/node-domexception/.history/README_20210527213411.md delete mode 100644 server/node_modules/node-domexception/.history/README_20210527213803.md delete mode 100644 server/node_modules/node-domexception/.history/README_20210527214323.md delete mode 100644 server/node_modules/node-domexception/.history/README_20210527214408.md delete mode 100644 server/node_modules/node-domexception/.history/index_20210527203842.js delete mode 100644 server/node_modules/node-domexception/.history/index_20210527203947.js delete mode 100644 server/node_modules/node-domexception/.history/index_20210527204259.js delete mode 100644 server/node_modules/node-domexception/.history/index_20210527204418.js delete mode 100644 server/node_modules/node-domexception/.history/index_20210527204756.js delete mode 100644 server/node_modules/node-domexception/.history/index_20210527204833.js delete mode 100644 server/node_modules/node-domexception/.history/index_20210527211208.js delete mode 100644 server/node_modules/node-domexception/.history/index_20210527211248.js delete mode 100644 server/node_modules/node-domexception/.history/index_20210527212722.js delete mode 100644 server/node_modules/node-domexception/.history/index_20210527212731.js delete mode 100644 server/node_modules/node-domexception/.history/index_20210527212746.js delete mode 100644 server/node_modules/node-domexception/.history/index_20210527212900.js delete mode 100644 server/node_modules/node-domexception/.history/index_20210527213022.js delete mode 100644 server/node_modules/node-domexception/.history/index_20210527213822.js delete mode 100644 server/node_modules/node-domexception/.history/index_20210527213843.js delete mode 100644 server/node_modules/node-domexception/.history/index_20210527213852.js delete mode 100644 server/node_modules/node-domexception/.history/index_20210527213910.js delete mode 100644 server/node_modules/node-domexception/.history/index_20210527214034.js delete mode 100644 server/node_modules/node-domexception/.history/index_20210527214643.js delete mode 100644 server/node_modules/node-domexception/.history/index_20210527214654.js delete mode 100644 server/node_modules/node-domexception/.history/index_20210527214700.js delete mode 100644 server/node_modules/node-domexception/.history/package_20210527203733.json delete mode 100644 server/node_modules/node-domexception/.history/package_20210527203825.json delete mode 100644 server/node_modules/node-domexception/.history/package_20210527204621.json delete mode 100644 server/node_modules/node-domexception/.history/package_20210527204913.json delete mode 100644 server/node_modules/node-domexception/.history/package_20210527204925.json delete mode 100644 server/node_modules/node-domexception/.history/package_20210527205145.json delete mode 100644 server/node_modules/node-domexception/.history/package_20210527205156.json delete mode 100644 server/node_modules/node-domexception/.history/test_20210527205603.js delete mode 100644 server/node_modules/node-domexception/.history/test_20210527205957.js delete mode 100644 server/node_modules/node-domexception/.history/test_20210527210021.js delete mode 100644 server/node_modules/node-domexception/LICENSE delete mode 100644 server/node_modules/node-domexception/README.md delete mode 100644 server/node_modules/node-domexception/index.js delete mode 100644 server/node_modules/node-domexception/package.json delete mode 100644 server/node_modules/node-fetch/@types/index.d.ts delete mode 100644 server/node_modules/node-fetch/LICENSE.md delete mode 100644 server/node_modules/node-fetch/README.md delete mode 100644 server/node_modules/node-fetch/package.json delete mode 100644 server/node_modules/node-fetch/src/body.js delete mode 100644 server/node_modules/node-fetch/src/errors/abort-error.js delete mode 100644 server/node_modules/node-fetch/src/errors/base.js delete mode 100644 server/node_modules/node-fetch/src/errors/fetch-error.js delete mode 100644 server/node_modules/node-fetch/src/headers.js delete mode 100644 server/node_modules/node-fetch/src/index.js delete mode 100644 server/node_modules/node-fetch/src/request.js delete mode 100644 server/node_modules/node-fetch/src/response.js delete mode 100644 server/node_modules/node-fetch/src/utils/get-search.js delete mode 100644 server/node_modules/node-fetch/src/utils/is-redirect.js delete mode 100644 server/node_modules/node-fetch/src/utils/is.js delete mode 100644 server/node_modules/node-fetch/src/utils/multipart-parser.js delete mode 100644 server/node_modules/node-fetch/src/utils/referrer.js delete mode 100644 server/node_modules/object-assign/index.js delete mode 100644 server/node_modules/object-assign/license delete mode 100644 server/node_modules/object-assign/package.json delete mode 100644 server/node_modules/object-assign/readme.md delete mode 100644 server/node_modules/object-inspect/.eslintrc delete mode 100644 server/node_modules/object-inspect/.github/FUNDING.yml delete mode 100644 server/node_modules/object-inspect/.nycrc delete mode 100644 server/node_modules/object-inspect/CHANGELOG.md delete mode 100644 server/node_modules/object-inspect/LICENSE delete mode 100644 server/node_modules/object-inspect/example/all.js delete mode 100644 server/node_modules/object-inspect/example/circular.js delete mode 100644 server/node_modules/object-inspect/example/fn.js delete mode 100644 server/node_modules/object-inspect/example/inspect.js delete mode 100644 server/node_modules/object-inspect/index.js delete mode 100644 server/node_modules/object-inspect/package-support.json delete mode 100644 server/node_modules/object-inspect/package.json delete mode 100644 server/node_modules/object-inspect/readme.markdown delete mode 100644 server/node_modules/object-inspect/test-core-js.js delete mode 100644 server/node_modules/object-inspect/test/bigint.js delete mode 100644 server/node_modules/object-inspect/test/browser/dom.js delete mode 100644 server/node_modules/object-inspect/test/circular.js delete mode 100644 server/node_modules/object-inspect/test/deep.js delete mode 100644 server/node_modules/object-inspect/test/element.js delete mode 100644 server/node_modules/object-inspect/test/err.js delete mode 100644 server/node_modules/object-inspect/test/fakes.js delete mode 100644 server/node_modules/object-inspect/test/fn.js delete mode 100644 server/node_modules/object-inspect/test/global.js delete mode 100644 server/node_modules/object-inspect/test/has.js delete mode 100644 server/node_modules/object-inspect/test/holes.js delete mode 100644 server/node_modules/object-inspect/test/indent-option.js delete mode 100644 server/node_modules/object-inspect/test/inspect.js delete mode 100644 server/node_modules/object-inspect/test/lowbyte.js delete mode 100644 server/node_modules/object-inspect/test/number.js delete mode 100644 server/node_modules/object-inspect/test/quoteStyle.js delete mode 100644 server/node_modules/object-inspect/test/toStringTag.js delete mode 100644 server/node_modules/object-inspect/test/undef.js delete mode 100644 server/node_modules/object-inspect/test/values.js delete mode 100644 server/node_modules/object-inspect/util.inspect.js delete mode 100644 server/node_modules/on-finished/HISTORY.md delete mode 100644 server/node_modules/on-finished/LICENSE delete mode 100644 server/node_modules/on-finished/README.md delete mode 100644 server/node_modules/on-finished/index.js delete mode 100644 server/node_modules/on-finished/package.json delete mode 100644 server/node_modules/parseurl/HISTORY.md delete mode 100644 server/node_modules/parseurl/LICENSE delete mode 100644 server/node_modules/parseurl/README.md delete mode 100644 server/node_modules/parseurl/index.js delete mode 100644 server/node_modules/parseurl/package.json delete mode 100644 server/node_modules/path-to-regexp/LICENSE delete mode 100644 server/node_modules/path-to-regexp/Readme.md delete mode 100644 server/node_modules/path-to-regexp/index.js delete mode 100644 server/node_modules/path-to-regexp/package.json delete mode 100644 server/node_modules/proxy-addr/HISTORY.md delete mode 100644 server/node_modules/proxy-addr/LICENSE delete mode 100644 server/node_modules/proxy-addr/README.md delete mode 100644 server/node_modules/proxy-addr/index.js delete mode 100644 server/node_modules/proxy-addr/package.json delete mode 100644 server/node_modules/proxy-from-env/LICENSE delete mode 100644 server/node_modules/proxy-from-env/README.md delete mode 100644 server/node_modules/proxy-from-env/index.cjs delete mode 100644 server/node_modules/proxy-from-env/index.js delete mode 100644 server/node_modules/proxy-from-env/package.json delete mode 100644 server/node_modules/qs/.editorconfig delete mode 100644 server/node_modules/qs/.github/FUNDING.yml delete mode 100644 server/node_modules/qs/.github/SECURITY.md delete mode 100644 server/node_modules/qs/.github/THREAT_MODEL.md delete mode 100644 server/node_modules/qs/.nycrc delete mode 100644 server/node_modules/qs/CHANGELOG.md delete mode 100644 server/node_modules/qs/LICENSE.md delete mode 100644 server/node_modules/qs/README.md delete mode 100644 server/node_modules/qs/dist/qs.js delete mode 100644 server/node_modules/qs/eslint.config.mjs delete mode 100644 server/node_modules/qs/lib/formats.js delete mode 100644 server/node_modules/qs/lib/index.js delete mode 100644 server/node_modules/qs/lib/parse.js delete mode 100644 server/node_modules/qs/lib/stringify.js delete mode 100644 server/node_modules/qs/lib/utils.js delete mode 100644 server/node_modules/qs/package.json delete mode 100644 server/node_modules/qs/test/empty-keys-cases.js delete mode 100644 server/node_modules/qs/test/parse.js delete mode 100644 server/node_modules/qs/test/stringify.js delete mode 100644 server/node_modules/qs/test/utils.js delete mode 100644 server/node_modules/range-parser/HISTORY.md delete mode 100644 server/node_modules/range-parser/LICENSE delete mode 100644 server/node_modules/range-parser/README.md delete mode 100644 server/node_modules/range-parser/index.js delete mode 100644 server/node_modules/range-parser/package.json delete mode 100644 server/node_modules/raw-body/LICENSE delete mode 100644 server/node_modules/raw-body/README.md delete mode 100644 server/node_modules/raw-body/index.d.ts delete mode 100644 server/node_modules/raw-body/index.js delete mode 100644 server/node_modules/raw-body/package.json delete mode 100644 server/node_modules/readable-stream/CONTRIBUTING.md delete mode 100644 server/node_modules/readable-stream/GOVERNANCE.md delete mode 100644 server/node_modules/readable-stream/LICENSE delete mode 100644 server/node_modules/readable-stream/README.md delete mode 100644 server/node_modules/readable-stream/errors-browser.js delete mode 100644 server/node_modules/readable-stream/errors.js delete mode 100644 server/node_modules/readable-stream/experimentalWarning.js delete mode 100644 server/node_modules/readable-stream/lib/_stream_duplex.js delete mode 100644 server/node_modules/readable-stream/lib/_stream_passthrough.js delete mode 100644 server/node_modules/readable-stream/lib/_stream_readable.js delete mode 100644 server/node_modules/readable-stream/lib/_stream_transform.js delete mode 100644 server/node_modules/readable-stream/lib/_stream_writable.js delete mode 100644 server/node_modules/readable-stream/lib/internal/streams/async_iterator.js delete mode 100644 server/node_modules/readable-stream/lib/internal/streams/buffer_list.js delete mode 100644 server/node_modules/readable-stream/lib/internal/streams/destroy.js delete mode 100644 server/node_modules/readable-stream/lib/internal/streams/end-of-stream.js delete mode 100644 server/node_modules/readable-stream/lib/internal/streams/from-browser.js delete mode 100644 server/node_modules/readable-stream/lib/internal/streams/from.js delete mode 100644 server/node_modules/readable-stream/lib/internal/streams/pipeline.js delete mode 100644 server/node_modules/readable-stream/lib/internal/streams/state.js delete mode 100644 server/node_modules/readable-stream/lib/internal/streams/stream-browser.js delete mode 100644 server/node_modules/readable-stream/lib/internal/streams/stream.js delete mode 100644 server/node_modules/readable-stream/package.json delete mode 100644 server/node_modules/readable-stream/readable-browser.js delete mode 100644 server/node_modules/readable-stream/readable.js delete mode 100644 server/node_modules/safe-buffer/LICENSE delete mode 100644 server/node_modules/safe-buffer/README.md delete mode 100644 server/node_modules/safe-buffer/index.d.ts delete mode 100644 server/node_modules/safe-buffer/index.js delete mode 100644 server/node_modules/safe-buffer/package.json delete mode 100644 server/node_modules/safer-buffer/LICENSE delete mode 100644 server/node_modules/safer-buffer/Porting-Buffer.md delete mode 100644 server/node_modules/safer-buffer/Readme.md delete mode 100644 server/node_modules/safer-buffer/dangerous.js delete mode 100644 server/node_modules/safer-buffer/package.json delete mode 100644 server/node_modules/safer-buffer/safer.js delete mode 100644 server/node_modules/safer-buffer/tests.js delete mode 100644 server/node_modules/send/HISTORY.md delete mode 100644 server/node_modules/send/LICENSE delete mode 100644 server/node_modules/send/README.md delete mode 100644 server/node_modules/send/SECURITY.md delete mode 100644 server/node_modules/send/index.js delete mode 100644 server/node_modules/send/node_modules/ms/index.js delete mode 100644 server/node_modules/send/node_modules/ms/license.md delete mode 100644 server/node_modules/send/node_modules/ms/package.json delete mode 100644 server/node_modules/send/node_modules/ms/readme.md delete mode 100644 server/node_modules/send/package.json delete mode 100644 server/node_modules/serve-static/HISTORY.md delete mode 100644 server/node_modules/serve-static/LICENSE delete mode 100644 server/node_modules/serve-static/README.md delete mode 100644 server/node_modules/serve-static/index.js delete mode 100644 server/node_modules/serve-static/package.json delete mode 100644 server/node_modules/setprototypeof/LICENSE delete mode 100644 server/node_modules/setprototypeof/README.md delete mode 100644 server/node_modules/setprototypeof/index.d.ts delete mode 100644 server/node_modules/setprototypeof/index.js delete mode 100644 server/node_modules/setprototypeof/package.json delete mode 100644 server/node_modules/setprototypeof/test/index.js delete mode 100644 server/node_modules/side-channel-list/.editorconfig delete mode 100644 server/node_modules/side-channel-list/.eslintrc delete mode 100644 server/node_modules/side-channel-list/.github/FUNDING.yml delete mode 100644 server/node_modules/side-channel-list/.nycrc delete mode 100644 server/node_modules/side-channel-list/CHANGELOG.md delete mode 100644 server/node_modules/side-channel-list/LICENSE delete mode 100644 server/node_modules/side-channel-list/README.md delete mode 100644 server/node_modules/side-channel-list/index.d.ts delete mode 100644 server/node_modules/side-channel-list/index.js delete mode 100644 server/node_modules/side-channel-list/list.d.ts delete mode 100644 server/node_modules/side-channel-list/package.json delete mode 100644 server/node_modules/side-channel-list/test/index.js delete mode 100644 server/node_modules/side-channel-list/tsconfig.json delete mode 100644 server/node_modules/side-channel-map/.editorconfig delete mode 100644 server/node_modules/side-channel-map/.eslintrc delete mode 100644 server/node_modules/side-channel-map/.github/FUNDING.yml delete mode 100644 server/node_modules/side-channel-map/.nycrc delete mode 100644 server/node_modules/side-channel-map/CHANGELOG.md delete mode 100644 server/node_modules/side-channel-map/LICENSE delete mode 100644 server/node_modules/side-channel-map/README.md delete mode 100644 server/node_modules/side-channel-map/index.d.ts delete mode 100644 server/node_modules/side-channel-map/index.js delete mode 100644 server/node_modules/side-channel-map/package.json delete mode 100644 server/node_modules/side-channel-map/test/index.js delete mode 100644 server/node_modules/side-channel-map/tsconfig.json delete mode 100644 server/node_modules/side-channel-weakmap/.editorconfig delete mode 100644 server/node_modules/side-channel-weakmap/.eslintrc delete mode 100644 server/node_modules/side-channel-weakmap/.github/FUNDING.yml delete mode 100644 server/node_modules/side-channel-weakmap/.nycrc delete mode 100644 server/node_modules/side-channel-weakmap/CHANGELOG.md delete mode 100644 server/node_modules/side-channel-weakmap/LICENSE delete mode 100644 server/node_modules/side-channel-weakmap/README.md delete mode 100644 server/node_modules/side-channel-weakmap/index.d.ts delete mode 100644 server/node_modules/side-channel-weakmap/index.js delete mode 100644 server/node_modules/side-channel-weakmap/package.json delete mode 100644 server/node_modules/side-channel-weakmap/test/index.js delete mode 100644 server/node_modules/side-channel-weakmap/tsconfig.json delete mode 100644 server/node_modules/side-channel/.editorconfig delete mode 100644 server/node_modules/side-channel/.eslintrc delete mode 100644 server/node_modules/side-channel/.github/FUNDING.yml delete mode 100644 server/node_modules/side-channel/.nycrc delete mode 100644 server/node_modules/side-channel/CHANGELOG.md delete mode 100644 server/node_modules/side-channel/LICENSE delete mode 100644 server/node_modules/side-channel/README.md delete mode 100644 server/node_modules/side-channel/index.d.ts delete mode 100644 server/node_modules/side-channel/index.js delete mode 100644 server/node_modules/side-channel/package.json delete mode 100644 server/node_modules/side-channel/test/index.js delete mode 100644 server/node_modules/side-channel/tsconfig.json delete mode 100644 server/node_modules/statuses/HISTORY.md delete mode 100644 server/node_modules/statuses/LICENSE delete mode 100644 server/node_modules/statuses/README.md delete mode 100644 server/node_modules/statuses/codes.json delete mode 100644 server/node_modules/statuses/index.js delete mode 100644 server/node_modules/statuses/package.json delete mode 100644 server/node_modules/streamsearch/.eslintrc.js delete mode 100644 server/node_modules/streamsearch/.github/workflows/ci.yml delete mode 100644 server/node_modules/streamsearch/.github/workflows/lint.yml delete mode 100644 server/node_modules/streamsearch/LICENSE delete mode 100644 server/node_modules/streamsearch/README.md delete mode 100644 server/node_modules/streamsearch/lib/sbmh.js delete mode 100644 server/node_modules/streamsearch/package.json delete mode 100644 server/node_modules/streamsearch/test/test.js delete mode 100644 server/node_modules/string_decoder/LICENSE delete mode 100644 server/node_modules/string_decoder/README.md delete mode 100644 server/node_modules/string_decoder/lib/string_decoder.js delete mode 100644 server/node_modules/string_decoder/package.json delete mode 100644 server/node_modules/toidentifier/HISTORY.md delete mode 100644 server/node_modules/toidentifier/LICENSE delete mode 100644 server/node_modules/toidentifier/README.md delete mode 100644 server/node_modules/toidentifier/index.js delete mode 100644 server/node_modules/toidentifier/package.json delete mode 100644 server/node_modules/type-is/HISTORY.md delete mode 100644 server/node_modules/type-is/LICENSE delete mode 100644 server/node_modules/type-is/README.md delete mode 100644 server/node_modules/type-is/index.js delete mode 100644 server/node_modules/type-is/package.json delete mode 100644 server/node_modules/typedarray/.travis.yml delete mode 100644 server/node_modules/typedarray/LICENSE delete mode 100644 server/node_modules/typedarray/example/tarray.js delete mode 100644 server/node_modules/typedarray/index.js delete mode 100644 server/node_modules/typedarray/package.json delete mode 100644 server/node_modules/typedarray/readme.markdown delete mode 100644 server/node_modules/typedarray/test/server/undef_globals.js delete mode 100644 server/node_modules/typedarray/test/tarray.js delete mode 100644 server/node_modules/unpipe/HISTORY.md delete mode 100644 server/node_modules/unpipe/LICENSE delete mode 100644 server/node_modules/unpipe/README.md delete mode 100644 server/node_modules/unpipe/index.js delete mode 100644 server/node_modules/unpipe/package.json delete mode 100644 server/node_modules/util-deprecate/History.md delete mode 100644 server/node_modules/util-deprecate/LICENSE delete mode 100644 server/node_modules/util-deprecate/README.md delete mode 100644 server/node_modules/util-deprecate/browser.js delete mode 100644 server/node_modules/util-deprecate/node.js delete mode 100644 server/node_modules/util-deprecate/package.json delete mode 100644 server/node_modules/utils-merge/.npmignore delete mode 100644 server/node_modules/utils-merge/LICENSE delete mode 100644 server/node_modules/utils-merge/README.md delete mode 100644 server/node_modules/utils-merge/index.js delete mode 100644 server/node_modules/utils-merge/package.json delete mode 100644 server/node_modules/vary/HISTORY.md delete mode 100644 server/node_modules/vary/LICENSE delete mode 100644 server/node_modules/vary/README.md delete mode 100644 server/node_modules/vary/index.js delete mode 100644 server/node_modules/vary/package.json delete mode 100644 server/node_modules/web-streams-polyfill/LICENSE delete mode 100644 server/node_modules/web-streams-polyfill/README.md delete mode 100644 server/node_modules/web-streams-polyfill/dist/polyfill.es2018.js delete mode 100644 server/node_modules/web-streams-polyfill/dist/polyfill.es2018.js.map delete mode 100644 server/node_modules/web-streams-polyfill/dist/polyfill.es2018.min.js delete mode 100644 server/node_modules/web-streams-polyfill/dist/polyfill.es2018.min.js.map delete mode 100644 server/node_modules/web-streams-polyfill/dist/polyfill.es2018.mjs delete mode 100644 server/node_modules/web-streams-polyfill/dist/polyfill.es2018.mjs.map delete mode 100644 server/node_modules/web-streams-polyfill/dist/polyfill.es6.js delete mode 100644 server/node_modules/web-streams-polyfill/dist/polyfill.es6.js.map delete mode 100644 server/node_modules/web-streams-polyfill/dist/polyfill.es6.min.js delete mode 100644 server/node_modules/web-streams-polyfill/dist/polyfill.es6.min.js.map delete mode 100644 server/node_modules/web-streams-polyfill/dist/polyfill.es6.mjs delete mode 100644 server/node_modules/web-streams-polyfill/dist/polyfill.es6.mjs.map delete mode 100644 server/node_modules/web-streams-polyfill/dist/polyfill.js delete mode 100644 server/node_modules/web-streams-polyfill/dist/polyfill.js.map delete mode 100644 server/node_modules/web-streams-polyfill/dist/polyfill.min.js delete mode 100644 server/node_modules/web-streams-polyfill/dist/polyfill.min.js.map delete mode 100644 server/node_modules/web-streams-polyfill/dist/polyfill.mjs delete mode 100644 server/node_modules/web-streams-polyfill/dist/polyfill.mjs.map delete mode 100644 server/node_modules/web-streams-polyfill/dist/ponyfill.es2018.js delete mode 100644 server/node_modules/web-streams-polyfill/dist/ponyfill.es2018.js.map delete mode 100644 server/node_modules/web-streams-polyfill/dist/ponyfill.es2018.mjs delete mode 100644 server/node_modules/web-streams-polyfill/dist/ponyfill.es2018.mjs.map delete mode 100644 server/node_modules/web-streams-polyfill/dist/ponyfill.es6.js delete mode 100644 server/node_modules/web-streams-polyfill/dist/ponyfill.es6.js.map delete mode 100644 server/node_modules/web-streams-polyfill/dist/ponyfill.es6.mjs delete mode 100644 server/node_modules/web-streams-polyfill/dist/ponyfill.es6.mjs.map delete mode 100644 server/node_modules/web-streams-polyfill/dist/ponyfill.js delete mode 100644 server/node_modules/web-streams-polyfill/dist/ponyfill.js.map delete mode 100644 server/node_modules/web-streams-polyfill/dist/ponyfill.mjs delete mode 100644 server/node_modules/web-streams-polyfill/dist/ponyfill.mjs.map delete mode 100644 server/node_modules/web-streams-polyfill/dist/types/polyfill.d.ts delete mode 100644 server/node_modules/web-streams-polyfill/dist/types/ponyfill.d.ts delete mode 100644 server/node_modules/web-streams-polyfill/dist/types/ts3.6/polyfill.d.ts delete mode 100644 server/node_modules/web-streams-polyfill/dist/types/ts3.6/ponyfill.d.ts delete mode 100644 server/node_modules/web-streams-polyfill/dist/types/tsdoc-metadata.json delete mode 100644 server/node_modules/web-streams-polyfill/es2018/package.json delete mode 100644 server/node_modules/web-streams-polyfill/es6/package.json delete mode 100644 server/node_modules/web-streams-polyfill/package.json delete mode 100644 server/node_modules/web-streams-polyfill/ponyfill/es2018/package.json delete mode 100644 server/node_modules/web-streams-polyfill/ponyfill/es6/package.json delete mode 100644 server/node_modules/web-streams-polyfill/ponyfill/package.json create mode 100644 server/routes/search.js create mode 100644 server/routes/tracks.js diff --git a/.gitignore b/.gitignore index 53553c2af3b68e3305028138ff8d6ed1b84e86f2..f0de61b5d0a8655ec1d14712dbe5e7b9085e8afd 100644 GIT binary patch literal 67 zcmd1HPf3l>%}*)KNiEjrDo!mbOD)pRLlM+V%`4*q5qer&ieNgmA~ClhCzVS}FDE~p F3jjOE7ViK6 literal 88 zcmezWFOMOgA%!88A)X-@%qnHb0rH9&^ci>=xPWvjLlHw6nAB&$uT~GJDi5d@qz?dW C+Ys6S diff --git a/db/schema.sql b/db/schema.sql index 83c15f0..8c8ab84 100644 --- a/db/schema.sql +++ b/db/schema.sql @@ -1,20 +1,97 @@ --- Schema for KeySelector and AcousticBrainz data +-- Schema for KeySelector with PostgreSQL CREATE TABLE IF NOT EXISTS tracks ( id SERIAL PRIMARY KEY, - mbid VARCHAR(36) UNIQUE NOT NULL, -- MusicBrainz ID - title VARCHAR(255), - artist VARCHAR(255), - camelot_key VARCHAR(3), - bpm INTEGER, - created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP + title VARCHAR(255) NOT NULL, + artist VARCHAR(255) NOT NULL, + camelot_key VARCHAR(5) NOT NULL, + bpm INTEGER NOT NULL, + music_key VARCHAR(10), + cover_url TEXT, + preview_url TEXT, + tags TEXT[] DEFAULT '{}', + is_corrected BOOLEAN DEFAULT FALSE, + source VARCHAR(50) DEFAULT 'manual', + play_count INTEGER DEFAULT 1, + created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP, + updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP, + CONSTRAINT unique_track UNIQUE (artist, title) ); -CREATE TABLE IF NOT EXISTS track_tags ( - track_id INTEGER REFERENCES tracks(id), - tag VARCHAR(100), - PRIMARY KEY (track_id, tag) -); +CREATE INDEX IF NOT EXISTS idx_tracks_camelot ON tracks(camelot_key); +CREATE INDEX IF NOT EXISTS idx_tracks_bpm ON tracks(bpm); +CREATE INDEX IF NOT EXISTS idx_tracks_artist ON tracks(artist); +CREATE INDEX IF NOT EXISTS idx_tracks_title ON tracks(title); -CREATE INDEX IF NOT EXISTS idx_camelot_key ON tracks(camelot_key); -CREATE INDEX IF NOT EXISTS idx_bpm ON tracks(bpm); +-- Initial curated seed data across all 24 Camelot keys +INSERT INTO tracks (artist, title, camelot_key, bpm, music_key, tags, source) VALUES +-- 1B & 1A (C-Dur / A-Moll) +('Axwell /\\ Ingrosso', 'More Than You Know', '1B', 123, 'C', ARRAY['house', 'edm'], 'seed'), +('Avicii', 'The Nights', '1B', 126, 'C', ARRAY['dance', 'melodic'], 'seed'), +('Tiësto', 'The Business', '1A', 120, 'Am', ARRAY['deep house', 'bass'], 'seed'), +('Meduza', 'Piece Of Your Heart', '1A', 124, 'Am', ARRAY['house', 'electronic'], 'seed'), + +-- 2B & 2A (G-Dur / E-Moll) +('Calvin Harris', 'Summer', '2B', 128, 'G', ARRAY['dance', 'summer'], 'seed'), +('David Guetta ft. Sia', 'Titanium', '2B', 126, 'G', ARRAY['edm', 'pop'], 'seed'), +('Martin Garrix', 'Animals', '2A', 128, 'Em', ARRAY['big room', 'electro'], 'seed'), +('Fisher', 'Losing It', '2A', 125, 'Em', ARRAY['tech house', 'club'], 'seed'), + +-- 3B & 3A (D-Dur / H-Moll) +('Swedish House Mafia', 'Don''t You Worry Child', '3B', 129, 'D', ARRAY['progressive', 'anthem'], 'seed'), +('Alesso', 'Heroes (we could be)', '3B', 126, 'D', ARRAY['edm', 'euphoric'], 'seed'), +('ACRAZE', 'Do It To It', '3A', 125, 'Bm', ARRAY['house', 'viral'], 'seed'), +('Faithless', 'Insomnia', '3A', 127, 'Bm', ARRAY['classic', 'trance'], 'seed'), + +-- 4B & 4A (A-Dur / F#-Moll) +('Daft Punk', 'One More Time', '4B', 123, 'A', ARRAY['french house', 'disco'], 'seed'), +('Alphaville', 'Big in Japan', '4B', 118, 'A', ARRAY['80s', 'synth-pop'], 'seed'), +('Dua Lipa', 'Don''t Start Now', '4A', 124, 'F#m', ARRAY['nu-disco', 'dance'], 'seed'), +('The Weeknd', 'Blinding Lights', '4A', 171, 'F#m', ARRAY['synthwave', '80s'], 'seed'), + +-- 5B & 5A (E-Dur / C#-Moll) +('Avicii', 'Wake Me Up', '5B', 124, 'E', ARRAY['folk-dance', 'anthem'], 'seed'), +('Otto Knows', 'Million Voices', '5B', 126, 'E', ARRAY['progressive house'], 'seed'), +('Fred again..', 'Delilah (pull me out of this)', '5A', 134, 'C#m', ARRAY['electronic', 'club'], 'seed'), +('Robin Schulz', 'Sugar', '5A', 123, 'C#m', ARRAY['deep house', 'pop'], 'seed'), + +-- 6B & 6A (H-Dur / G#-Moll) +('Galantis', 'Runaway (U & I)', '6B', 126, 'B', ARRAY['electro pop', 'edm'], 'seed'), +('Kygo', 'Firestone', '6B', 114, 'B', ARRAY['tropical house'], 'seed'), +('CamelPhat & Elderbrook', 'Cola', '6A', 122, 'G#m', ARRAY['tech house', 'deep house'], 'seed'), +('Peggy Gou', '(It Goes Like) Nanana', '6A', 130, 'G#m', ARRAY['house', 'summer'], 'seed'), + +-- 7B & 7A (F#-Dur / D#-Moll) +('Disclosure ft. Sam Smith', 'Latch', '7B', 122, 'F#', ARRAY['garage', 'house'], 'seed'), +('Major Lazer', 'Lean On', '7B', 98, 'F#', ARRAY['dancehall', 'moombahton'], 'seed'), +('Eric Prydz', 'Opus', '7A', 126, 'D#m', ARRAY['progressive house', 'masterpiece'], 'seed'), +('Darude', 'Sandstorm', '7A', 136, 'D#m', ARRAY['trance', 'classic'], 'seed'), + +-- 8B & 8A (Db-Dur / B-Moll) +('Calvin Harris', 'Feel So Close', '8B', 128, 'Db', ARRAY['dance', 'pop'], 'seed'), +('Gigi D''Agostino', 'L''Amour Toujours', '8A', 138, 'Bbm', ARRAY['italo dance', 'classic'], 'seed'), +('Paul Kalkbrenner', 'Sky and Sand', '8A', 122, 'Bbm', ARRAY['minimal', 'berlin techno'], 'seed'), + +-- 9B & 9A (Ab-Dur / F-Moll) +('Clean Bandit', 'Rather Be', '9B', 121, 'Ab', ARRAY['deep house', 'classical crossover'], 'seed'), +('Swedish House Mafia', 'One', '9A', 125, 'Fm', ARRAY['electro house', 'classic'], 'seed'), +('Alan Walker', 'Faded', '9A', 90, 'Fm', ARRAY['electro', 'melodic'], 'seed'), + +-- 10B & 10A (Eb-Dur / C-Moll) +('deadmau5', 'Strobe', '10B', 128, 'Eb', ARRAY['progressive house'], 'seed'), +('Bicep', 'Glue', '10B', 130, 'Eb', ARRAY['breakbeat', 'ambient'], 'seed'), +('Benny Benassi', 'Satisfaction', '10A', 130, 'Cm', ARRAY['electro house', 'legend'], 'seed'), +('Kungs vs Cookin'' on 3 Burners', 'This Girl', '10A', 122, 'Cm', ARRAY['funk house', 'brass'], 'seed'), + +-- 11B & 11A (Bb-Dur / G-Moll) +('Modjo', 'Lady (Hear Me Tonight)', '11B', 126, 'Bb', ARRAY['french touch', 'filter house'], 'seed'), +('Fatboy Slim', 'Praise You', '11B', 110, 'Bb', ARRAY['big beat', 'breakbeat'], 'seed'), +('Robin S', 'Show Me Love', '11A', 120, 'Gm', ARRAY['90s house', 'anthem'], 'seed'), +('Robert Miles', 'Children', '11A', 138, 'Gm', ARRAY['dream trance', '90s'], 'seed'), + +-- 12B & 12A (F-Dur / D-Moll) +('Shouse', 'Love Tonight', '12B', 123, 'F', ARRAY['indie dance', 'choir'], 'seed'), +('Stardust', 'Music Sounds Better With You', '12B', 124, 'F', ARRAY['french house', 'disco'], 'seed'), +('Faithless', 'God Is a DJ', '12A', 131, 'Dm', ARRAY['dance anthem', 'classic'], 'seed'), +('Paul van Dyk', 'For an Angel', '12A', 138, 'Dm', ARRAY['trance', 'berlin'], 'seed') +ON CONFLICT (artist, title) DO NOTHING; diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..159d909 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,40 @@ +services: + keyselector: + build: . + restart: unless-stopped + ports: + - "3000:3000" + environment: + - PORT=3000 + - DB_USER=${DB_USER:-postgres} + - DB_HOST=postgres + - DB_NAME=${DB_NAME:-keyselector} + - DB_PASSWORD=${DB_PASSWORD:-postgres} + - ACRCLOUD_HOST=${ACRCLOUD_HOST} + - ACRCLOUD_ACCESS_KEY=${ACRCLOUD_ACCESS_KEY} + - ACRCLOUD_ACCESS_SECRET=${ACRCLOUD_ACCESS_SECRET} + - GETSONGBPM_API_KEY=${GETSONGBPM_API_KEY} + - MINIMAX_API_KEY=${MINIMAX_API_KEY} + depends_on: + postgres: + condition: service_healthy + + postgres: + image: postgres:15-alpine + restart: unless-stopped + ports: + - "5432:5432" + environment: + POSTGRES_USER: ${DB_USER:-postgres} + POSTGRES_PASSWORD: ${DB_PASSWORD:-postgres} + POSTGRES_DB: ${DB_NAME:-keyselector} + healthcheck: + test: ["CMD-SHELL", "pg_isready -U ${DB_USER:-postgres}"] + interval: 5s + timeout: 5s + retries: 5 + volumes: + - pgdata:/var/lib/postgresql/data + +volumes: + pgdata: diff --git a/dummy.webm b/dummy.webm deleted file mode 100644 index 11fc3189671fa9c538c1b7be7b129b12a341c3ee..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 16 VcmezWFNL9$Ar}ZM8F(4E7yvY$1VI1* diff --git a/public/app.js b/public/app.js index a6e82a5..cc88e89 100644 --- a/public/app.js +++ b/public/app.js @@ -1,12 +1,20 @@ -let isListening = true; +let isListening = false; let currentTrack = null; +let currentSource = 'system'; // 'system', 'mic', 'device' +let currentStream = null; +let mediaRecorder = null; +let audioChunks = []; +let audioContext = null; +let analyser = null; +let animFrameId = null; +let isProcessingAudio = false; function toggleTheme() { const html = document.documentElement; const isLight = html.getAttribute('data-theme') === 'light'; const next = isLight ? 'dark' : 'light'; html.setAttribute('data-theme', next); - document.getElementById('theme-btn').textContent = isLight ? 'Light' : 'Dark'; + document.getElementById('theme-btn').textContent = isLight ? 'Dark' : 'Light'; if (currentTrack && currentTrack.key) { window.updateWheel(currentTrack.key); } else { @@ -14,135 +22,313 @@ function toggleTheme() { } } -let mediaRecorder; -let audioChunks = []; -let stream = null; +// Audio Source Management +async function changeAudioSource(source) { + currentSource = source; + const deviceSelect = document.getElementById('audio-device-select'); + + if (source === 'device') { + deviceSelect.style.display = 'inline-block'; + await populateAudioDevices(); + } else { + deviceSelect.style.display = 'none'; + } + + // If already listening, restart stream with new source + if (isListening) { + stopAudioStream(); + await initAudioStream(); + } +} + +async function populateAudioDevices() { + const deviceSelect = document.getElementById('audio-device-select'); + deviceSelect.innerHTML = ''; -async function startRecordingLoop() { - if (!isListening) return; - try { - if (!stream) { - stream = await navigator.mediaDevices.getUserMedia({ audio: true }); + // Request permission once to get labels + await navigator.mediaDevices.getUserMedia({ audio: true }).then(s => s.getTracks().forEach(t => t.stop())).catch(() => {}); + const devices = await navigator.mediaDevices.enumerateDevices(); + const audioInputs = devices.filter(d => d.kind === 'audioinput'); + + audioInputs.forEach((d, i) => { + const opt = document.createElement('option'); + opt.value = d.deviceId; + opt.textContent = d.label || `Audioeingang ${i + 1}`; + deviceSelect.appendChild(opt); + }); + } catch (err) { + console.warn('[Audio] Could not enumerate devices:', err); + } +} + +async function selectSpecificDevice(deviceId) { + if (!deviceId) return; + currentSource = 'device'; + if (isListening) { + stopAudioStream(); + await initAudioStream(deviceId); + } +} + +// Stream Initialization +async function initAudioStream(specificDeviceId = null) { + try { + stopAudioStream(); + + if (currentSource === 'system') { + updateStatus('Wähle Tab/Bildschirm mit Audio...', 'waiting'); + // System audio capture (YouTube, VLC, DJ software, browser tabs) + const displayStream = await navigator.mediaDevices.getDisplayMedia({ + video: true, + audio: { + echoCancellation: false, + noiseSuppression: false, + autoGainControl: false, + systemAudio: 'include' + } + }); + + const audioTracks = displayStream.getAudioTracks(); + if (audioTracks.length === 0) { + alert('Kein Audiotrack geteilt! Bitte setze im Teilen-Dialog das Häkchen bei "Audio teilen" (Systemaudio teilen).'); + displayStream.getTracks().forEach(t => t.stop()); + toggleListening(false); + return false; + } + + // Stop video track to save CPU and battery + displayStream.getVideoTracks().forEach(t => t.stop()); + currentStream = new MediaStream(audioTracks); + + } else if (currentSource === 'device' && specificDeviceId) { + currentStream = await navigator.mediaDevices.getUserMedia({ + audio: { deviceId: { exact: specificDeviceId } } + }); + } else { + // Microphone + currentStream = await navigator.mediaDevices.getUserMedia({ + audio: { + echoCancellation: false, + noiseSuppression: false + } + }); } - - mediaRecorder = new MediaRecorder(stream); - - mediaRecorder.ondataavailable = event => { - if (event.data.size > 0) { - audioChunks.push(event.data); + + // When the user stops sharing via the browser bar + currentStream.getAudioTracks()[0].onended = () => { + console.log('[Audio] Stream ended by user.'); + toggleListening(false); + }; + + // Setup Visualizer + setupVisualizer(currentStream); + return true; + + } catch (err) { + console.error('[Audio] Stream init failed:', err); + if (err.name !== 'NotAllowedError') { + alert('Audio-Zugriff fehlgeschlagen: ' + err.message); + } + toggleListening(false); + return false; + } +} + +function stopAudioStream() { + if (mediaRecorder && mediaRecorder.state !== 'inactive') { + try { mediaRecorder.stop(); } catch (e) {} + } + if (currentStream) { + currentStream.getTracks().forEach(t => t.stop()); + currentStream = null; + } + if (animFrameId) { + cancelAnimationFrame(animFrameId); + animFrameId = null; + } + const meter = document.getElementById('audio-meter-fill'); + if (meter) meter.style.width = '0%'; +} + +// Live Visualizer (Level Meter) +function setupVisualizer(stream) { + try { + if (!audioContext || audioContext.state === 'closed') { + audioContext = new (window.AudioContext || window.webkitAudioContext)(); + } + if (audioContext.state === 'suspended') { + audioContext.resume(); + } + + const source = audioContext.createMediaStreamSource(stream); + analyser = audioContext.createAnalyser(); + analyser.fftSize = 256; + source.connect(analyser); + + const dataArray = new Uint8Array(analyser.frequencyBinCount); + const meter = document.getElementById('audio-meter-fill'); + + function updateMeter() { + if (!isListening) { + meter.style.width = '0%'; + return; + } + + analyser.getByteFrequencyData(dataArray); + let sum = 0; + for (let i = 0; i < dataArray.length; i++) { + sum += dataArray[i]; + } + const avg = sum / dataArray.length; + const pct = Math.min(100, Math.round((avg / 128) * 100)); + meter.style.width = `${pct}%`; + + animFrameId = requestAnimationFrame(updateMeter); + } + + updateMeter(); + } catch (err) { + console.warn('[Visualizer] Error:', err); + } +} + +// Listening Loop & Recognition +async function toggleListening(forceState = null) { + isListening = forceState !== null ? forceState : !isListening; + + const statusEl = document.getElementById('listening-status'); + const icon = statusEl.querySelector('i'); + const text = document.getElementById('listening-text'); + + if (isListening) { + statusEl.classList.remove('paused'); + statusEl.classList.add('active'); + icon.className = 'fa-solid fa-microphone-lines'; + + const sourceLabel = currentSource === 'system' ? 'PC-Audio' : 'Mikrofon'; + text.textContent = `Höre ${sourceLabel}...`; + + const success = await initAudioStream(); + if (success) { + startRecordingChunk(); + } + } else { + statusEl.classList.remove('active'); + statusEl.classList.add('paused'); + icon.className = 'fa-solid fa-pause'; + text.textContent = 'Pausiert'; + stopAudioStream(); + } +} + +function startRecordingChunk() { + if (!isListening || !currentStream) return; + + audioChunks = []; + try { + mediaRecorder = new MediaRecorder(currentStream, { + mimeType: MediaRecorder.isTypeSupported('audio/webm;codecs=opus') ? 'audio/webm;codecs=opus' : undefined + }); + + mediaRecorder.ondataavailable = (e) => { + if (e.data && e.data.size > 0) { + audioChunks.push(e.data); } }; - + mediaRecorder.onstop = async () => { if (!isListening) return; - const audioBlob = new Blob(audioChunks); + + const blob = new Blob(audioChunks, { type: 'audio/webm' }); audioChunks = []; - await processAudio(audioBlob); - - // Start next chunk immediately if still listening + + // Check if sound was loud enough before querying recognition + if (!isProcessingAudio && blob.size > 1000) { + await processAudio(blob); + } + if (isListening) { - startRecordingLoop(); + setTimeout(startRecordingChunk, 1500); // 1.5s pause between checks } }; - - // Record for 12 seconds + + // Record for 7 seconds (optimal for ACRCloud / AudD) mediaRecorder.start(); setTimeout(() => { - if (mediaRecorder.state === 'recording') { + if (mediaRecorder && mediaRecorder.state === 'recording') { mediaRecorder.stop(); } - }, 12000); - - } catch (err) { - console.error("Microphone access denied or error:", err); - alert("Microphone access is required to detect songs."); - if (isListening) toggleListening(); + }, 7000); + + } catch (e) { + console.error('[Recorder] Error:', e); } } async function processAudio(blob) { + isProcessingAudio = true; + updateStatus('Analysiere Track...', 'analyzing'); + const formData = new FormData(); - formData.append('audio', blob, 'recording.webm'); - + formData.append('audio', blob, 'sample.webm'); + try { - const recRes = await fetch('/api/recognize', { method: 'POST', body: formData }); - const recData = await recRes.json(); - - if (recData.status === 'success') { - const { title, artist, matchScore } = recData.data; - - // Don't update if it's the exact same track to avoid flicker - if (currentTrack && currentTrack.title === title && currentTrack.artist === artist) { + const res = await fetch('/api/recognize', { + method: 'POST', + body: formData + }); + + const json = await res.json(); + + if (json.status === 'success' && json.data) { + const { title, artist, matchScore, key, bpm, cover_url, isCorrected } = json.data; + + // Avoid refetching if same track is still playing + if (currentTrack && currentTrack.title.toLowerCase() === title.toLowerCase() && currentTrack.artist.toLowerCase() === artist.toLowerCase()) { + updateStatus(`Laufend: ${title}`, 'active'); + isProcessingAudio = false; return; } - - document.getElementById('track-title').textContent = title; - document.getElementById('track-artist').textContent = artist; - document.getElementById('stat-match').textContent = matchScore; - - // Fetch metadata - const metaRes = await fetch(`/api/metadata?track=${encodeURIComponent(title)}&artist=${encodeURIComponent(artist)}`); - const metaData = await metaRes.json(); - - if (metaData.status === 'success') { - const { key, bpm, tags } = metaData.data; - - currentTrack = { title, artist, key, bpm }; - - document.getElementById('stat-key').textContent = key; - document.getElementById('stat-key-sub').textContent = window.camelotToMusicKey ? window.camelotToMusicKey[key] : ''; - document.getElementById('stat-bpm').textContent = bpm; - - const tagsContainer = document.getElementById('tags-row'); - tagsContainer.innerHTML = ''; - - const keyTag = document.createElement('span'); - keyTag.className = 'tag tag-key'; - keyTag.textContent = key; - keyTag.style.backgroundColor = window.colorMatrix ? window.colorMatrix[key] : 'var(--key-current)'; - tagsContainer.appendChild(keyTag); - - tags.forEach(t => { - const el = document.createElement('span'); - el.className = 'tag tag-genre'; - el.textContent = t; - tagsContainer.appendChild(el); - }); - - window.updateWheel(key); - document.documentElement.style.setProperty('--key-current', window.colorMatrix ? window.colorMatrix[key] : '#4F9D69'); - } + + updateStatus(`Erkannt: ${title}`, 'active'); + + // Select track in UI and load details/suggestions + window.selectTrack({ + title, + artist, + cover_url, + camelot_key: key, + bpm: bpm, + is_corrected: isCorrected, + is_local: !!key + }); + + } else if (json.status === 'not_configured') { + updateStatus(json.message, 'warning'); + } else { + const sourceLabel = currentSource === 'system' ? 'PC-Audio' : 'Mikrofon'; + updateStatus(`Höre ${sourceLabel}...`, 'active'); } - } catch (e) { - console.error("Error processing audio", e); + + } catch (err) { + console.error('[Audio] Recognition network error:', err); + updateStatus('Erkennungsfehler', 'warning'); + } finally { + isProcessingAudio = false; } } -function toggleListening() { - isListening = !isListening; +function updateStatus(text, type = 'normal') { const statusEl = document.getElementById('listening-status'); - const icon = statusEl.querySelector('i'); - const text = document.getElementById('listening-text'); - - if (isListening) { - statusEl.classList.remove('paused'); - icon.className = 'fa-solid fa-microphone'; - text.textContent = 'Listening'; - startRecordingLoop(); - } else { - statusEl.classList.add('paused'); - icon.className = 'fa-solid fa-pause'; - text.textContent = 'Paused'; - if (mediaRecorder && mediaRecorder.state === 'recording') { - mediaRecorder.stop(); - } - } + const textEl = document.getElementById('listening-text'); + if (!textEl) return; + + textEl.textContent = text; + statusEl.className = 'status ' + type; } -// Initial state -window.updateWheel(null); -startRecordingLoop(); +// Hero View Toggles function toggleWheel() { const hero = document.getElementById('hero'); if (hero.classList.contains('wheel-mode')) { @@ -165,4 +351,18 @@ function toggleCover() { function resetHero() { document.getElementById('hero').classList.remove('wheel-mode', 'cover-mode'); -} \ No newline at end of file +} + +// Expose globals +window.toggleTheme = toggleTheme; +window.changeAudioSource = changeAudioSource; +window.selectSpecificDevice = selectSpecificDevice; +window.toggleListening = toggleListening; +window.toggleWheel = toggleWheel; +window.toggleCover = toggleCover; +window.resetHero = resetHero; + +// Initial state +document.addEventListener('DOMContentLoaded', () => { + window.updateWheel(null); +}); \ No newline at end of file diff --git a/public/index.html b/public/index.html index b10db94..d26147c 100644 --- a/public/index.html +++ b/public/index.html @@ -3,7 +3,7 @@ - KeySelector + KeySelector — Harmonic DJ Assistant @@ -13,68 +13,141 @@
+
-
KeySelector
-
-
- - Listening +
+
KEYSELECTOR
+
+ +
+
+ +
+ +
+
+
+ +
+ + Bereit +
+
+ +
+
+ + + +
+ +
+ +
-
+
♪ No Cover
+
- -
Waiting...
-
for audio input
+
Warte auf Audio...
+
Starte PC-Audio oder Mikrofon oben rechts
+
-
-
Key
+
+
+ Key + +
-
-
-
-
BPM
+ +
+
+ BPM + +
-
-
-
+
± 0
+
-
Match
+
+ Status +
-
-
acoustid
+
Lokal / DB
-
- -
+ +
+
-
+
- + +
-
Up Next
-
+ +
Harmonisch passende Folge-Tracks (Up Next)
+
+
Wähle oder spiele einen Track ab, um harmonische Übergänge zu berechnen.
+
- BPM & Key data provided by GetSongBPM + KeySelector — Local-First PostgreSQL DJ Suite
- v1.0.2 + v2.0.0 +
+
+ + + diff --git a/public/search.js b/public/search.js index ecc7a02..ba40692 100644 --- a/public/search.js +++ b/public/search.js @@ -1,115 +1,366 @@ -function promptManualSearch() { - const query = prompt("Enter track name and artist manually (e.g. 'Alphaville Big in Japan'):"); - if (query && query.trim()) { - simulateRecognition(query.trim()); +// Live Search & PostgreSQL Correction Management + +let searchTimeout = null; + +document.addEventListener('DOMContentLoaded', () => { + const searchInput = document.getElementById('search-input'); + const searchDropdown = document.getElementById('search-results-dropdown'); + const clearBtn = document.getElementById('search-clear-btn'); + + if (searchInput) { + searchInput.addEventListener('input', (e) => { + const val = e.target.value.trim(); + clearBtn.style.display = val ? 'block' : 'none'; + + clearTimeout(searchTimeout); + if (!val) { + searchDropdown.style.display = 'none'; + searchDropdown.innerHTML = ''; + return; + } + + searchTimeout = setTimeout(() => { + executeSearch(val); + }, 250); + }); + + // Close dropdown when clicking outside + document.addEventListener('click', (e) => { + if (!e.target.closest('.search-box-container')) { + searchDropdown.style.display = 'none'; + } + }); + } + + // Populate Key options in edit modal + initEditKeyOptions(); +}); + +function clearSearch() { + const searchInput = document.getElementById('search-input'); + const searchDropdown = document.getElementById('search-results-dropdown'); + const clearBtn = document.getElementById('search-clear-btn'); + searchInput.value = ''; + clearBtn.style.display = 'none'; + searchDropdown.style.display = 'none'; + searchDropdown.innerHTML = ''; +} + +async function executeSearch(query) { + const searchDropdown = document.getElementById('search-results-dropdown'); + searchDropdown.innerHTML = '
Suche in PostgreSQL & Online...
'; + searchDropdown.style.display = 'block'; + + try { + const res = await fetch(`/api/search?q=${encodeURIComponent(query)}`); + const json = await res.json(); + + if (json.status !== 'success' || !json.data || json.data.length === 0) { + searchDropdown.innerHTML = '
Keine Tracks gefunden.
'; + return; + } + + searchDropdown.innerHTML = ''; + json.data.forEach(track => { + const item = document.createElement('div'); + item.className = 'search-result-item'; + + const coverHtml = track.cover_url + ? `cover` + : `
♪
`; + + let badgesHtml = ''; + if (track.is_local && track.camelot_key) { + const color = window.colorMatrix ? window.colorMatrix[track.camelot_key] : '#4F9D69'; + badgesHtml += `${track.camelot_key}`; + if (track.bpm) { + badgesHtml += `${track.bpm} BPM`; + } + badgesHtml += `${track.is_corrected ? 'KORRIGIERT' : 'LOKAL'}`; + } else { + badgesHtml += `NEU`; + } + + item.innerHTML = ` +
${coverHtml}
+
+
${escapeHtml(track.title)}
+
${escapeHtml(track.artist)}
+
+
${badgesHtml}
+ `; + + item.addEventListener('click', () => { + selectTrack(track); + searchDropdown.style.display = 'none'; + clearSearch(); + }); + + searchDropdown.appendChild(item); + }); + + } catch (err) { + console.error('[Search] Error:', err); + searchDropdown.innerHTML = '
Suchfehler aufgetreten.
'; } } -function renderSuggestions(currentKey) { - const sugContainer = document.getElementById('suggestions'); - sugContainer.innerHTML = ''; - - if (!currentKey || !window.mixingRules[currentKey]) { - sugContainer.innerHTML = '
No suggestions available.
'; - return; - } - - // Create some dummy suggestions based on the rules for the mockup - const compatKeys = window.mixingRules[currentKey].slice(1); - const dummySuggestions = compatKeys.map((c, i) => { - return { - c: c, - m: window.camelotToMusicKey[c], - color: window.colorMatrix[c], - title: `Dummy Track ${i+1}`, - artist: `Artist ${c}`, - bpm: 120 + Math.floor(Math.random() * 10 - 5), - compat: i + 1 // 1=Quinte-1, 2=Quinte+1, etc. - }; - }); - - dummySuggestions.forEach(s => { - const div = document.createElement('div'); - div.className = 'sug'; - const idSafe = `sug-cover-${s.c.replace(/\s/g,'_')}-${s.title.replace(/[^A-Za-z0-9]/g,'')}`; - div.innerHTML = ` -
-
♪
-
-
-
${s.c}
-
${s.bpm} BPM
-
-
-
${s.title}
-
${s.artist} · ${s.m}
-
-
${window.compatLabels[s.compat]}
- `; - sugContainer.appendChild(div); - window.fetchCover(`${s.artist} ${s.title}`, div.querySelector('.sug-cover')); - }); -} - -// Temporary simulation function to show the UI working -function simulateRecognition(query) { - // Try to extract artist and title simply - const parts = query.split(' '); - const title = parts.slice(0, Math.max(1, parts.length - 1)).join(' '); - const artist = parts[parts.length - 1] || 'Unknown'; - - // Pick a random key for the demo - const keysArr = Object.keys(window.colorMatrix); - const randomKey = keysArr[Math.floor(Math.random() * keysArr.length)]; - const bpm = 110 + Math.floor(Math.random() * 30); - - updateHero({ - title, - artist, - key: randomKey, - bpm: bpm, - match: '99%', - tags: [randomKey, 'Electronic', 'Pop'] - }); -} - -function updateHero(track) { - window.currentTrack = track; - +async function selectTrack(track) { + // Update Hero UI document.getElementById('track-title').textContent = track.title; document.getElementById('track-artist').textContent = track.artist; - - document.getElementById('stat-key').textContent = track.key; - document.getElementById('stat-key').style.color = window.colorMatrix[track.key]; - document.getElementById('stat-key-sub').textContent = window.camelotToMusicKey[track.key]; - - document.getElementById('stat-bpm').textContent = track.bpm; - document.getElementById('stat-match').textContent = track.match; - - // Update tags - const tagsRow = document.getElementById('tags-row'); - tagsRow.innerHTML = ''; - track.tags.forEach(tag => { - const span = document.createElement('span'); - span.className = 'tag ' + (tag === track.key ? 'tag-key' : 'tag-genre'); - if (tag === track.key) { - span.style.background = window.colorMatrix[track.key]; + document.getElementById('stat-match').textContent = track.is_corrected ? '100%' : 'Online'; + document.getElementById('stat-source-sub').textContent = track.is_local ? (track.is_corrected ? 'PostgreSQL (Fix)' : 'PostgreSQL') : 'Deezer / Online'; + + // Update Cover + if (track.cover_url) { + const coverEl = document.getElementById('cover'); + coverEl.innerHTML = `cover`; + } else { + window.fetchCover(`${track.artist} ${track.title}`, document.getElementById('cover')); + } + + // Fetch or apply metadata + let key = track.camelot_key; + let bpm = track.bpm; + let tags = track.tags || ['dance']; + + if (!key || !bpm) { + // Query metadata route to get key, bpm, and persist into PostgreSQL + try { + const metaRes = await fetch(`/api/metadata?track=${encodeURIComponent(track.title)}&artist=${encodeURIComponent(track.artist)}`); + const metaJson = await metaRes.json(); + if (metaJson.status === 'success') { + key = metaJson.data.key; + bpm = metaJson.data.bpm; + tags = metaJson.data.tags || tags; + } + } catch (e) { + console.warn('[Search] Metadata fetch failed, using fallback', e); + key = '8B'; + bpm = 120; } - span.textContent = tag; - tagsRow.appendChild(span); - }); - - // Update Hero Border - document.documentElement.style.setProperty('--key-current', window.colorMatrix[track.key]); - - // Update Wheel - window.updateWheel(track.key); - - // Fetch Cover - window.fetchCover(`${track.artist} ${track.title}`, document.getElementById('cover')); - - // Update Suggestions - renderSuggestions(track.key); + } + + window.currentTrack = { + id: track.id, + title: track.title, + artist: track.artist, + key: key, + bpm: bpm, + cover_url: track.cover_url + }; + + updateHeroStats(key, bpm, tags); + renderSuggestions(key, bpm, track.artist, track.title); } +function updateHeroStats(key, bpm, tags = []) { + document.getElementById('stat-key').textContent = key; + const musicKey = window.camelotToMusicKey ? window.camelotToMusicKey[key] : ''; + document.getElementById('stat-key-sub').textContent = musicKey; + const keyColor = window.colorMatrix ? window.colorMatrix[key] : '#4F9D69'; + document.getElementById('stat-key').style.color = keyColor; + document.documentElement.style.setProperty('--key-current', keyColor); + + document.getElementById('stat-bpm').textContent = bpm; + document.getElementById('stat-bpm-sub').textContent = `± ${Math.round(bpm * 0.04)} BPM`; + + // Render Tags + const tagsRow = document.getElementById('tags-row'); + tagsRow.innerHTML = ''; + + const keyTag = document.createElement('span'); + keyTag.className = 'tag tag-key'; + keyTag.textContent = `${key} · ${musicKey}`; + keyTag.style.backgroundColor = keyColor; + tagsRow.appendChild(keyTag); + + tags.forEach(t => { + const el = document.createElement('span'); + el.className = 'tag tag-genre'; + el.textContent = t; + tagsRow.appendChild(el); + }); + + // Update Camelot Wheel + window.updateWheel(key); +} + +// Render real harmonic suggestions from PostgreSQL +async function renderSuggestions(currentKey, currentBpm = 120, artist = '', title = '') { + const sugContainer = document.getElementById('suggestions'); + if (!sugContainer) return; + + if (!currentKey) { + sugContainer.innerHTML = '
Wähle einen Track für Vorschläge.
'; + return; + } + + sugContainer.innerHTML = '
Berechne harmonische Übergänge aus PostgreSQL...
'; + + try { + const url = `/api/suggestions?key=${encodeURIComponent(currentKey)}&bpm=${currentBpm}&artist=${encodeURIComponent(artist)}&title=${encodeURIComponent(title)}`; + const res = await fetch(url); + const json = await res.json(); + + if (json.status !== 'success' || !json.data || json.data.length === 0) { + sugContainer.innerHTML = '
Keine passenden Tracks in der Datenbank gefunden. Suche weitere Tracks, um deine Library zu erweitern.
'; + return; + } + + sugContainer.innerHTML = ''; + json.data.forEach(s => { + const div = document.createElement('div'); + div.className = 'sug'; + const idSafe = `sug-${s.c}-${(s.title || '').replace(/[^A-Za-z0-9]/g, '')}`; + + div.innerHTML = ` +
+ ${s.cover_url ? `cover` : '
♪
'} +
+
+
${s.c}
+
${s.bpm} BPM
+
+
+
${escapeHtml(s.title)}
+
${escapeHtml(s.artist)} · ${s.m}
+
+
${s.compatLabel || 'KOMPATIBEL'}
+ `; + + // Click to transition to this song as next current track! + div.addEventListener('click', () => { + selectTrack(s); + }); + + sugContainer.appendChild(div); + + // Lazy load cover if not already available + if (!s.cover_url) { + window.fetchCover(`${s.artist} ${s.title}`, div.querySelector('.sug-cover')); + } + }); + + } catch (e) { + console.error('[Suggestions] Error loading suggestions:', e); + sugContainer.innerHTML = '
Fehler beim Laden der Vorschläge.
'; + } +} + +// Key & BPM Correction Modal +function initEditKeyOptions() { + const select = document.getElementById('edit-key-select'); + if (!select) return; + + const camelotKeys = [ + ['12B', 'F'], ['12A', 'Dm'], + ['1B', 'C'], ['1A', 'Am'], + ['2B', 'G'], ['2A', 'Em'], + ['3B', 'D'], ['3A', 'Bm'], + ['4B', 'A'], ['4A', 'F#m'], + ['5B', 'E'], ['5A', 'C#m'], + ['6B', 'B'], ['6A', 'G#m'], + ['7B', 'F#'], ['7A', 'D#m'], + ['8B', 'Db'], ['8A', 'Bbm'], + ['9B', 'Ab'], ['9A', 'Fm'], + ['10B', 'Eb'], ['10A', 'Cm'], + ['11B', 'Bb'], ['11A', 'Gm'], + ]; + + select.innerHTML = ''; + camelotKeys.forEach(([c, m]) => { + const opt = document.createElement('option'); + opt.value = c; + opt.textContent = `${c} — ${m}`; + select.appendChild(opt); + }); +} + +function openKeyBpmModal() { + if (!window.currentTrack || !window.currentTrack.title) { + alert('Bitte wähle zuerst einen Track aus oder spiele einen Song ab.'); + return; + } + + const modal = document.getElementById('edit-modal'); + const titleEl = document.getElementById('modal-track-title'); + const keySelect = document.getElementById('edit-key-select'); + const bpmInput = document.getElementById('edit-bpm-input'); + + titleEl.textContent = `Daten korrigieren: ${window.currentTrack.artist} – ${window.currentTrack.title}`; + if (window.currentTrack.key) keySelect.value = window.currentTrack.key; + if (window.currentTrack.bpm) bpmInput.value = window.currentTrack.bpm; + + modal.style.display = 'flex'; +} + +function closeKeyBpmModal() { + const modal = document.getElementById('edit-modal'); + if (modal) modal.style.display = 'none'; +} + +function closeModalOnOverlay(e) { + if (e.target.classList.contains('modal-overlay')) { + closeKeyBpmModal(); + } +} + +async function saveKeyBpmCorrection() { + if (!window.currentTrack) return; + + const keySelect = document.getElementById('edit-key-select'); + const bpmInput = document.getElementById('edit-bpm-input'); + + const newKey = keySelect.value; + const newBpm = parseInt(bpmInput.value, 10); + + if (!newKey || isNaN(newBpm)) { + alert('Bitte gültigen Key und BPM eingeben.'); + return; + } + + try { + const res = await fetch('/api/tracks/correct', { + method: 'POST', + headers: { 'Content-Type': 'application/json' }, + body: JSON.stringify({ + artist: window.currentTrack.artist, + title: window.currentTrack.title, + camelotKey: newKey, + bpm: newBpm + }) + }); + + const json = await res.json(); + if (json.status === 'success') { + window.currentTrack.key = newKey; + window.currentTrack.bpm = newBpm; + window.currentTrack.is_corrected = true; + + document.getElementById('stat-source-sub').textContent = 'PostgreSQL (Korrigiert)'; + updateHeroStats(newKey, newBpm, window.currentTrack.tags || ['dance']); + renderSuggestions(newKey, newBpm, window.currentTrack.artist, window.currentTrack.title); + closeKeyBpmModal(); + } else { + alert('Speichern fehlgeschlagen: ' + (json.error || 'Serverfehler')); + } + } catch (err) { + console.error('Correction save error:', err); + alert('Verbindungsfehler beim Speichern in PostgreSQL.'); + } +} + +function escapeHtml(str) { + if (!str) return ''; + return str.replace(/&/g, '&').replace(//g, '>').replace(/"/g, '"'); +} + +window.renderSuggestions = renderSuggestions; +window.selectTrack = selectTrack; +window.openKeyBpmModal = openKeyBpmModal; +window.closeKeyBpmModal = closeKeyBpmModal; +window.saveKeyBpmCorrection = saveKeyBpmCorrection; +window.closeModalOnOverlay = closeModalOnOverlay; diff --git a/public/styles.css b/public/styles.css index 5aa9186..de3fb3a 100644 --- a/public/styles.css +++ b/public/styles.css @@ -10,6 +10,7 @@ --bpm: #E0B423; --match: #4F9D69; --mic: #D62828; + --accent: #3B7DD8; } [data-theme="light"] { --bg: #F4F4F8; @@ -23,6 +24,7 @@ --bpm: #B88A1A; --match: #2E7A48; --mic: #C4202A; + --accent: #2B60B8; } * { box-sizing: border-box; margin: 0; padding: 0; } html, body { @@ -35,12 +37,48 @@ html, body { body { padding: 24px 32px; min-height: 100vh; } .container { max-width: 1600px; margin: 0 auto; } -.topbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; } -.brand { font-family: 'JetBrains Mono', monospace; font-size: 12px; font-weight: 700; letter-spacing: 0.3em; } -.topbar-right { display: flex; align-items: center; gap: 18px; } +/* Topbar */ +.topbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; flex-wrap: wrap; gap: 12px; } +.topbar-left { display: flex; align-items: center; gap: 16px; } +.brand { font-family: 'JetBrains Mono', monospace; font-size: 13px; font-weight: 700; letter-spacing: 0.3em; color: var(--text-bright); } + +.audio-source-wrapper { display: flex; align-items: center; gap: 8px; } +.source-select { + background: var(--surface); + border: 1px solid var(--border); + color: var(--text); + font-family: 'JetBrains Mono', monospace; + font-size: 11px; + padding: 6px 12px; + border-radius: 6px; + cursor: pointer; + outline: none; + transition: border-color .15s; +} +.source-select:hover, .source-select:focus { border-color: var(--text-dim); } + +.topbar-right { display: flex; align-items: center; gap: 16px; } + +/* Live Audio Level Meter */ +.audio-meter-container { + width: 50px; height: 10px; + background: var(--surface-2); + border: 1px solid var(--border); + border-radius: 4px; + overflow: hidden; + position: relative; +} +.audio-meter-bar { + height: 100%; width: 0%; + background: linear-gradient(90deg, #4F9D69, #E0B423, #D62828); + border-radius: 3px; + transition: width 0.08s ease; +} + .status { display: flex; align-items: center; gap: 8px; font-family: 'JetBrains Mono', monospace; font-size: 11px; color: var(--text-dim); letter-spacing: 0.12em; text-transform: uppercase; cursor: pointer; transition: color 0.12s; } .status:hover { color: var(--text); } .status i { color: var(--mic); font-size: 14px; } +.status.active i { color: #4F9D69; } .status.paused i { color: var(--text-dim); } .theme-toggle { @@ -51,6 +89,87 @@ body { padding: 24px 32px; min-height: 100vh; } } .theme-toggle:hover { color: var(--text); border-color: var(--text-dim); } +/* Search Box Container */ +.search-box-container { + position: relative; + margin-bottom: 20px; + z-index: 20; +} +.search-input-wrapper { + position: relative; + display: flex; + align-items: center; +} +.search-icon { + position: absolute; left: 16px; + color: var(--text-dim); + font-size: 14px; +} +#search-input { + width: 100%; + background: var(--surface); + border: 1px solid var(--border); + border-radius: 8px; + padding: 12px 40px 12px 44px; + color: var(--text-bright); + font-family: 'Inter', sans-serif; + font-size: 14px; + outline: none; + transition: border-color .15s, box-shadow .15s; +} +#search-input:focus { + border-color: var(--accent); + box-shadow: 0 0 0 2px rgba(59, 125, 216, 0.2); +} +.search-clear { + position: absolute; right: 14px; + background: none; border: none; + color: var(--text-dim); font-size: 18px; + cursor: pointer; line-height: 1; +} +.search-clear:hover { color: var(--text-bright); } + +/* Search Results Dropdown */ +.search-results-dropdown { + position: absolute; top: calc(100% + 4px); left: 0; right: 0; + background: var(--surface); + border: 1px solid var(--border); + border-radius: 8px; + box-shadow: 0 12px 32px rgba(0,0,0,0.4); + max-height: 380px; + overflow-y: auto; + z-index: 30; +} +.search-result-item { + display: flex; align-items: center; gap: 14px; + padding: 10px 16px; + cursor: pointer; + border-bottom: 1px solid var(--border); + transition: background .1s; +} +.search-result-item:last-child { border-bottom: none; } +.search-result-item:hover { background: var(--surface-2); } +.search-result-cover { + width: 44px; height: 44px; border-radius: 4px; + background: var(--surface-2); overflow: hidden; flex-shrink: 0; +} +.search-result-cover img { width: 100%; height: 100%; object-fit: cover; } +.search-result-info { flex: 1; min-width: 0; } +.search-result-title { font-size: 13px; font-weight: 600; color: var(--text-bright); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } +.search-result-artist { font-size: 11px; color: var(--text-dim); } +.search-result-badges { display: flex; align-items: center; gap: 6px; } +.search-badge { + font-family: 'JetBrains Mono', monospace; font-size: 10px; font-weight: 700; + padding: 3px 6px; border-radius: 3px; color: #fff; +} +.search-badge-local { + background: rgba(79, 157, 105, 0.15); color: #4F9D69; border: 1px solid #4F9D69; +} +.search-badge-bpm { + font-family: 'JetBrains Mono', monospace; font-size: 10px; color: var(--bpm); +} + +/* Hero */ .hero { display: grid; grid-template-columns: 240px 1fr; @@ -69,6 +188,7 @@ body { padding: 24px 32px; min-height: 100vh; } width: 3px; background: var(--key-current); transition: background-color .18s; } + /* WHEEL expanded mode */ .hero.wheel-mode { grid-template-columns: 1fr; @@ -80,6 +200,7 @@ body { padding: 24px 32px; min-height: 100vh; } .hero.wheel-mode .info-mid { display: none; } .hero.wheel-mode .info-bot { padding-top: 0; justify-content: center; } .hero.wheel-mode .wheel-container { width: 100%; max-width: 520px; height: 520px; } + /* COVER expanded mode */ .hero.cover-mode { grid-template-columns: 1fr; min-height: 540px; } .hero.cover-mode .info { display: none; } @@ -117,22 +238,20 @@ body { padding: 24px 32px; min-height: 100vh; } .info-mid { display: flex; flex-direction: column; gap: 14px; margin-top: 16px; } .info-bot { margin-top: auto; padding-top: 20px; display: flex; justify-content: flex-end; align-items: flex-end; min-height: 160px; } -.track-title { font-size: 30px; font-weight: 600; line-height: 1.1; letter-spacing: -0.01em; margin-bottom: 4px; } +.track-title { font-size: 28px; font-weight: 600; line-height: 1.15; letter-spacing: -0.01em; margin-bottom: 4px; color: var(--text-bright); } .track-artist { font-size: 15px; color: var(--text-dim); } -.search-fallback-btn { - position: absolute; top: 0; right: 0; - background: var(--surface-2); border: 1px solid var(--border); border-radius: 4px; - padding: 6px 12px; color: var(--text-dim); font-size: 11px; cursor: pointer; - font-family: 'JetBrains Mono', monospace; letter-spacing: 0.1em; text-transform: uppercase; - transition: all .12s; -} -.search-fallback-btn:hover { background: var(--border); color: var(--text); } -.search-fallback-btn i { margin-right: 6px; } - .stats-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--border); border: 1px solid var(--border); border-radius: 6px; overflow: hidden; } -.stat { background: var(--surface); padding: 12px 14px; } -.stat-label { font-family: 'JetBrains Mono', monospace; font-size: 9px; letter-spacing: 0.22em; text-transform: uppercase; color: var(--text-dim); margin-bottom: 6px; } +.stat { + background: var(--surface); padding: 12px 14px; + cursor: pointer; transition: background .12s; +} +.stat:hover { background: var(--surface-2); } +.stat-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; } +.stat-label { font-family: 'JetBrains Mono', monospace; font-size: 9px; letter-spacing: 0.22em; text-transform: uppercase; color: var(--text-dim); } +.edit-btn { font-size: 10px; color: var(--text-dim); opacity: 0.6; transition: opacity .12s, color .12s; } +.stat:hover .edit-btn { opacity: 1; color: var(--accent); } + .stat-value { font-family: 'JetBrains Mono', monospace; font-size: 22px; font-weight: 700; font-feature-settings: 'tnum'; line-height: 1; } .stat-value.k { color: var(--key-current); } .stat-value.b { color: var(--bpm); } @@ -144,8 +263,6 @@ body { padding: 24px 32px; min-height: 100vh; } .tag-key { background: var(--key-current); color: #fff; font-weight: 700; } .tag-genre { background: rgba(90, 138, 229, 0.13); color: #8AA8D8; border: 1px solid rgba(90, 138, 229, 0.32); } [data-theme="light"] .tag-genre { background: rgba(52, 90, 156, 0.10); color: #345A9C; border-color: rgba(52, 90, 156, 0.28); } -.tag-mood { background: rgba(214, 41, 102, 0.13); color: #D88096; border: 1px solid rgba(214, 41, 102, 0.32); } -[data-theme="light"] .tag-mood { background: rgba(168, 51, 106, 0.10); color: #A8336A; border-color: rgba(168, 51, 106, 0.28); } .wheel-container { width: 140px; height: 140px; @@ -180,9 +297,9 @@ body { padding: 24px 32px; min-height: 100vh; } border-radius: 8px; padding: 10px; display: flex; flex-direction: column; gap: 8px; cursor: pointer; - transition: border-color .12s, transform .12s; + transition: border-color .12s, transform .12s, box-shadow .12s; } -.sug:hover { border-color: var(--text-dim); transform: translateY(-2px); } +.sug:hover { border-color: var(--text-dim); transform: translateY(-2px); box-shadow: 0 4px 16px rgba(0,0,0,0.3); } .sug-cover { width: 100%; aspect-ratio: 1; border-radius: 4px; background: var(--surface-2); overflow: hidden; position: relative; } .sug-cover img { width: 100%; height: 100%; object-fit: cover; display: block; } .sug-cover-placeholder { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 20px; opacity: 0.25; } @@ -196,3 +313,65 @@ body { padding: 24px 32px; min-height: 100vh; } text-transform: uppercase; color: var(--text-dim); padding-top: 4px; border-top: 1px solid var(--border); } + +/* Modal */ +.modal-overlay { + position: fixed; inset: 0; + background: rgba(0, 0, 0, 0.65); + backdrop-filter: blur(4px); + display: flex; align-items: center; justify-content: center; + z-index: 100; padding: 16px; +} +.modal-card { + background: var(--surface); + border: 1px solid var(--border); + border-radius: 12px; + width: 100%; max-width: 440px; + box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5); + overflow: hidden; + animation: modalFadeIn .18s ease; +} +@keyframes modalFadeIn { + from { opacity: 0; transform: scale(0.96); } + to { opacity: 1; transform: scale(1); } +} +.modal-header { + display: flex; justify-content: space-between; align-items: center; + padding: 16px 20px; border-bottom: 1px solid var(--border); +} +.modal-header h3 { font-size: 15px; font-weight: 600; color: var(--text-bright); } +.modal-close { + background: none; border: none; font-size: 20px; + color: var(--text-dim); cursor: pointer; line-height: 1; +} +.modal-close:hover { color: var(--text-bright); } +.modal-body { padding: 20px; display: flex; flex-direction: column; gap: 16px; } +.modal-desc { font-size: 12px; color: var(--text-dim); line-height: 1.4; } +.form-group { display: flex; flex-direction: column; gap: 6px; } +.form-group label { font-family: 'JetBrains Mono', monospace; font-size: 11px; color: var(--text-dim); text-transform: uppercase; letter-spacing: 0.1em; } +.form-input { + background: var(--surface-2); + border: 1px solid var(--border); + border-radius: 6px; + padding: 10px 12px; + color: var(--text-bright); + font-family: 'JetBrains Mono', monospace; + font-size: 13px; + outline: none; + transition: border-color .15s; +} +.form-input:focus { border-color: var(--accent); } +.modal-footer { + display: flex; justify-content: flex-end; gap: 10px; + padding: 14px 20px; border-top: 1px solid var(--border); + background: var(--surface-2); +} +.btn { + padding: 8px 16px; border-radius: 6px; font-size: 12px; font-weight: 600; + cursor: pointer; transition: all .12s; border: none; + font-family: 'Inter', sans-serif; +} +.btn-secondary { background: var(--surface); border: 1px solid var(--border); color: var(--text); } +.btn-secondary:hover { border-color: var(--text-dim); } +.btn-primary { background: var(--accent); color: #fff; } +.btn-primary:hover { opacity: 0.9; } diff --git a/server/db.js b/server/db.js new file mode 100644 index 0000000..664a901 --- /dev/null +++ b/server/db.js @@ -0,0 +1,222 @@ +const { Pool } = require('pg'); +const fs = require('fs'); +const path = require('path'); + +let pool = null; +let isConnected = false; + +function getPool() { + if (pool) return pool; + + const config = process.env.DATABASE_URL + ? { connectionString: process.env.DATABASE_URL } + : { + host: process.env.DB_HOST || 'localhost', + port: parseInt(process.env.DB_PORT || '5432', 10), + user: process.env.DB_USER || 'postgres', + password: process.env.DB_PASSWORD || 'postgres', + database: process.env.DB_NAME || 'keyselector', + }; + + pool = new Pool(config); + + pool.on('error', (err) => { + console.error('[PostgreSQL] Unexpected pool error:', err.message); + }); + + return pool; +} + +async function initDb() { + try { + const p = getPool(); + const client = await p.connect(); + isConnected = true; + console.log('[PostgreSQL] Successfully connected to database.'); + + const schemaPath = path.join(__dirname, '../db/schema.sql'); + if (fs.existsSync(schemaPath)) { + const sql = fs.readFileSync(schemaPath, 'utf8'); + await client.query(sql); + console.log('[PostgreSQL] Schema and seed data verified/applied.'); + } + client.release(); + } catch (err) { + isConnected = false; + console.warn('[PostgreSQL] Database connection failed:', err.message); + console.warn('[PostgreSQL] Running with in-memory fallback until DB is available.'); + } +} + +// In-memory fallback if Postgres is temporarily down +const memoryTracks = new Map(); + +async function query(text, params = []) { + if (!isConnected) { + return { rows: [] }; + } + return getPool().query(text, params); +} + +// Find track by artist and title (case insensitive) +async function findTrack(artist, title) { + if (!artist || !title) return null; + + if (isConnected) { + try { + const res = await getPool().query( + `SELECT * FROM tracks + WHERE LOWER(artist) = LOWER($1) AND LOWER(title) = LOWER($2) + LIMIT 1`, + [artist.trim(), title.trim()] + ); + if (res.rows.length > 0) return res.rows[0]; + } catch (e) { + console.error('[DB] findTrack error:', e.message); + } + } + + const key = `${artist.trim().toLowerCase()} - ${title.trim().toLowerCase()}`; + return memoryTracks.get(key) || null; +} + +// Save or update track +async function saveTrack({ title, artist, camelot_key, bpm, music_key, cover_url, preview_url, tags = [], is_corrected = false, source = 'manual' }) { + if (!title || !artist || !camelot_key || !bpm) return null; + + if (isConnected) { + try { + const res = await getPool().query( + `INSERT INTO tracks (title, artist, camelot_key, bpm, music_key, cover_url, preview_url, tags, is_corrected, source, play_count, updated_at) + VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, 1, CURRENT_TIMESTAMP) + ON CONFLICT (artist, title) DO UPDATE + SET play_count = tracks.play_count + 1, + cover_url = COALESCE(EXCLUDED.cover_url, tracks.cover_url), + preview_url = COALESCE(EXCLUDED.preview_url, tracks.preview_url), + camelot_key = CASE WHEN tracks.is_corrected THEN tracks.camelot_key ELSE EXCLUDED.camelot_key END, + bpm = CASE WHEN tracks.is_corrected THEN tracks.bpm ELSE EXCLUDED.bpm END, + music_key = CASE WHEN tracks.is_corrected THEN tracks.music_key ELSE EXCLUDED.music_key END, + updated_at = CURRENT_TIMESTAMP + RETURNING *`, + [title.trim(), artist.trim(), camelot_key, Math.round(bpm), music_key, cover_url, preview_url, tags, is_corrected, source] + ); + return res.rows[0]; + } catch (e) { + console.error('[DB] saveTrack error:', e.message); + } + } + + const track = { title, artist, camelot_key, bpm: Math.round(bpm), music_key, cover_url, preview_url, tags, is_corrected, source }; + const key = `${artist.trim().toLowerCase()} - ${title.trim().toLowerCase()}`; + memoryTracks.set(key, track); + return track; +} + +// Save explicit user correction +async function correctTrack({ artist, title, camelot_key, bpm, music_key }) { + if (!artist || !title || !camelot_key || !bpm) return null; + + if (isConnected) { + try { + const res = await getPool().query( + `INSERT INTO tracks (title, artist, camelot_key, bpm, music_key, is_corrected, updated_at) + VALUES ($1, $2, $3, $4, $5, TRUE, CURRENT_TIMESTAMP) + ON CONFLICT (artist, title) DO UPDATE + SET camelot_key = EXCLUDED.camelot_key, + bpm = EXCLUDED.bpm, + music_key = EXCLUDED.music_key, + is_corrected = TRUE, + updated_at = CURRENT_TIMESTAMP + RETURNING *`, + [title.trim(), artist.trim(), camelot_key, Math.round(bpm), music_key] + ); + return res.rows[0]; + } catch (e) { + console.error('[DB] correctTrack error:', e.message); + } + } + + const existing = await findTrack(artist, title) || { title, artist }; + existing.camelot_key = camelot_key; + existing.bpm = Math.round(bpm); + existing.music_key = music_key; + existing.is_corrected = true; + const key = `${artist.trim().toLowerCase()} - ${title.trim().toLowerCase()}`; + memoryTracks.set(key, existing); + return existing; +} + +// Get suggestions matching compatible camelot keys and BPM range +async function getSuggestions(compatibleKeys = [], minBpm = 80, maxBpm = 180, limit = 10, excludeArtist = '', excludeTitle = '') { + if (isConnected) { + try { + const res = await getPool().query( + `SELECT id, title, artist, camelot_key, bpm, music_key, cover_url, preview_url, tags, play_count + FROM tracks + WHERE camelot_key = ANY($1) + AND bpm BETWEEN $2 AND $3 + AND NOT (LOWER(artist) = LOWER($4) AND LOWER(title) = LOWER($5)) + ORDER BY play_count DESC, id DESC + LIMIT $6`, + [compatibleKeys, Math.round(minBpm), Math.round(maxBpm), excludeArtist, excludeTitle, limit] + ); + return res.rows; + } catch (e) { + console.error('[DB] getSuggestions error:', e.message); + } + } + + // Fallback search in memory + const results = []; + for (const track of memoryTracks.values()) { + if (compatibleKeys.includes(track.camelot_key) && track.bpm >= minBpm && track.bpm <= maxBpm) { + if (excludeArtist && track.artist.toLowerCase() === excludeArtist.toLowerCase()) continue; + results.push(track); + if (results.length >= limit) break; + } + } + return results; +} + +// Search tracks by query +async function searchTracks(queryStr, limit = 10) { + if (!queryStr) return []; + const term = `%${queryStr.trim().toLowerCase()}%`; + + if (isConnected) { + try { + const res = await getPool().query( + `SELECT id, title, artist, camelot_key, bpm, music_key, cover_url, is_corrected + FROM tracks + WHERE LOWER(title) LIKE $1 OR LOWER(artist) LIKE $1 + ORDER BY is_corrected DESC, play_count DESC + LIMIT $2`, + [term, limit] + ); + return res.rows; + } catch (e) { + console.error('[DB] searchTracks error:', e.message); + } + } + + const results = []; + const q = queryStr.toLowerCase(); + for (const track of memoryTracks.values()) { + if (track.title.toLowerCase().includes(q) || track.artist.toLowerCase().includes(q)) { + results.push(track); + if (results.length >= limit) break; + } + } + return results; +} + +module.exports = { + initDb, + query, + findTrack, + saveTrack, + correctTrack, + getSuggestions, + searchTracks, + isDbConnected: () => isConnected +}; diff --git a/server/index.js b/server/index.js index 2822a88..84642cc 100644 --- a/server/index.js +++ b/server/index.js @@ -2,12 +2,14 @@ require('dotenv').config(); const express = require('express'); const cors = require('cors'); const path = require('path'); +const db = require('./db'); const recognizeRoute = require('./routes/recognize'); const metadataRoute = require('./routes/metadata'); const suggestionsRoute = require('./routes/suggestions'); +const searchRoute = require('./routes/search'); +const tracksRoute = require('./routes/tracks'); const coverRoute = require('./routes/cover'); -require('./workers/poll-quota'); // Start quota worker const app = express(); const port = process.env.PORT || 3000; @@ -15,7 +17,7 @@ const port = process.env.PORT || 3000; app.use(cors()); app.use(express.json()); -// Serve static frontend +// Serve static frontend and shared assets app.use(express.static(path.join(__dirname, '../public'))); app.use('/shared', express.static(path.join(__dirname, '../shared'))); @@ -23,8 +25,13 @@ app.use('/shared', express.static(path.join(__dirname, '../shared'))); app.use('/api/recognize', recognizeRoute); app.use('/api/metadata', metadataRoute); app.use('/api/suggestions', suggestionsRoute); +app.use('/api/search', searchRoute); +app.use('/api/tracks', tracksRoute); app.use('/api/cover', coverRoute); -app.listen(port, () => { - console.log(`KeySelector backend listening on port ${port}`); +// Start server after connecting DB +db.initDb().then(() => { + app.listen(port, () => { + console.log(`KeySelector backend listening on port ${port}`); + }); }); diff --git a/server/node_modules/.bin/mime b/server/node_modules/.bin/mime deleted file mode 100644 index 7751de3..0000000 --- a/server/node_modules/.bin/mime +++ /dev/null @@ -1,16 +0,0 @@ -#!/bin/sh -basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')") - -case `uname` in - *CYGWIN*|*MINGW*|*MSYS*) - if command -v cygpath > /dev/null 2>&1; then - basedir=`cygpath -w "$basedir"` - fi - ;; -esac - -if [ -x "$basedir/node" ]; then - exec "$basedir/node" "$basedir/../mime/cli.js" "$@" -else - exec node "$basedir/../mime/cli.js" "$@" -fi diff --git a/server/node_modules/.bin/mime.cmd b/server/node_modules/.bin/mime.cmd deleted file mode 100644 index 54491f1..0000000 --- a/server/node_modules/.bin/mime.cmd +++ /dev/null @@ -1,17 +0,0 @@ -@ECHO off -GOTO start -:find_dp0 -SET dp0=%~dp0 -EXIT /b -:start -SETLOCAL -CALL :find_dp0 - -IF EXIST "%dp0%\node.exe" ( - SET "_prog=%dp0%\node.exe" -) ELSE ( - SET "_prog=node" - SET PATHEXT=%PATHEXT:;.JS;=;% -) - -endLocal & goto #_undefined_# 2>NUL || title %COMSPEC% & "%_prog%" "%dp0%\..\mime\cli.js" %* diff --git a/server/node_modules/.bin/mime.ps1 b/server/node_modules/.bin/mime.ps1 deleted file mode 100644 index 2222f40..0000000 --- a/server/node_modules/.bin/mime.ps1 +++ /dev/null @@ -1,28 +0,0 @@ -#!/usr/bin/env pwsh -$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent - -$exe="" -if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) { - # Fix case when both the Windows and Linux builds of Node - # are installed in the same directory - $exe=".exe" -} -$ret=0 -if (Test-Path "$basedir/node$exe") { - # Support pipeline input - if ($MyInvocation.ExpectingInput) { - $input | & "$basedir/node$exe" "$basedir/../mime/cli.js" $args - } else { - & "$basedir/node$exe" "$basedir/../mime/cli.js" $args - } - $ret=$LASTEXITCODE -} else { - # Support pipeline input - if ($MyInvocation.ExpectingInput) { - $input | & "node$exe" "$basedir/../mime/cli.js" $args - } else { - & "node$exe" "$basedir/../mime/cli.js" $args - } - $ret=$LASTEXITCODE -} -exit $ret diff --git a/server/node_modules/.package-lock.json b/server/node_modules/.package-lock.json deleted file mode 100644 index 75e0142..0000000 --- a/server/node_modules/.package-lock.json +++ /dev/null @@ -1,1235 +0,0 @@ -{ - "name": "keyselector", - "version": "1.0.0", - "lockfileVersion": 3, - "requires": true, - "packages": { - "node_modules/accepts": { - "version": "1.3.8", - "resolved": "https://registry.npmjs.org/accepts/-/accepts-1.3.8.tgz", - "integrity": "sha512-PYAthTa2m2VKxuvSD3DPC/Gy+U+sOA1LAuT8mkmRuvw+NACSaeXEQ+NHcVF7rONl6qcaxV3Uuemwawk+7+SJLw==", - "license": "MIT", - "dependencies": { - "mime-types": "~2.1.34", - "negotiator": "0.6.3" - }, - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/agent-base": { - "version": "6.0.2", - "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-6.0.2.tgz", - "integrity": "sha512-RZNwNclF7+MS/8bDg70amg32dyeZGZxiDuQmZxKLAlQjr3jGyLx+4Kkk58UO7D2QdgFIQCovuSuZESne6RG6XQ==", - "license": "MIT", - "dependencies": { - "debug": "4" - }, - "engines": { - "node": ">= 6.0.0" - } - }, - "node_modules/agent-base/node_modules/debug": { - "version": "4.4.3", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.3.tgz", - "integrity": "sha512-RGwwWnwQvkVfavKVt22FGLw+xYSdzARwm0ru6DhTVA3umU5hZc28V3kO4stgYryrTlLpuvgI9GiijltAjNbcqA==", - "license": "MIT", - "dependencies": { - "ms": "^2.1.3" - }, - "engines": { - "node": ">=6.0" - }, - "peerDependenciesMeta": { - "supports-color": { - "optional": true - } - } - }, - "node_modules/agent-base/node_modules/ms": { - "version": "2.1.3", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", - "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", - "license": "MIT" - }, - "node_modules/append-field": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/append-field/-/append-field-1.0.0.tgz", - "integrity": "sha512-klpgFSWLW1ZEs8svjfb7g4qWY0YS5imI82dTg+QahUvJ8YqAY0P10Uk8tTyh9ZGuYEZEMaeJYCF5BFuX552hsw==", - "license": "MIT" - }, - "node_modules/array-flatten": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/array-flatten/-/array-flatten-1.1.1.tgz", - "integrity": "sha512-PCVAQswWemu6UdxsDFFX/+gVeYqKAod3D3UVm91jHwynguOwAvYPhx8nNlM++NqRcK6CxxpUafjmhIdKiHibqg==", - "license": "MIT" - }, - "node_modules/asynckit": { - "version": "0.4.0", - "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", - "integrity": "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==", - "license": "MIT" - }, - "node_modules/axios": { - "version": "1.19.0", - "resolved": "https://registry.npmjs.org/axios/-/axios-1.19.0.tgz", - "integrity": "sha512-ht/iuYZXEjFxLH/Hkezgd7m6JKlHHXEUSneaDz8uZe1Gj5QZtCnpyDsckvAiEnT89OEbCLmnte4R4sn7P0EKFw==", - "license": "MIT", - "dependencies": { - "follow-redirects": "^1.16.0", - "form-data": "^4.0.6", - "https-proxy-agent": "^5.0.1", - "proxy-from-env": "^2.1.0" - } - }, - "node_modules/body-parser": { - "version": "1.20.6", - "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.20.6.tgz", - "integrity": "sha512-p5tAzS57i5MV9fZFDj9LeIiTZEufbSe2eDozP+ElheSUq1m74CRq1jI4mYNDdVs9vQztXFLuk/Gd6BWTdwRJ5g==", - "license": "MIT", - "dependencies": { - "bytes": "~3.1.2", - "content-type": "~1.0.5", - "debug": "2.6.9", - "depd": "2.0.0", - "destroy": "~1.2.0", - "http-errors": "~2.0.1", - "iconv-lite": "~0.4.24", - "on-finished": "~2.4.1", - "qs": "~6.15.1", - "raw-body": "~2.5.3", - "type-is": "~1.6.18", - "unpipe": "~1.0.0" - }, - "engines": { - "node": ">= 0.8", - "npm": "1.2.8000 || >= 1.4.16" - } - }, - "node_modules/buffer-from": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.2.tgz", - "integrity": "sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ==", - "license": "MIT" - }, - "node_modules/busboy": { - "version": "1.6.0", - "resolved": "https://registry.npmjs.org/busboy/-/busboy-1.6.0.tgz", - "integrity": "sha512-8SFQbg/0hQ9xy3UNTB0YEnsNBbWfhf7RtnzpL7TkBiTBRfrQ9Fxcnz7VJsleJpyp6rVLvXiuORqjlHi5q+PYuA==", - "dependencies": { - "streamsearch": "^1.1.0" - }, - "engines": { - "node": ">=10.16.0" - } - }, - "node_modules/bytes": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/bytes/-/bytes-3.1.2.tgz", - "integrity": "sha512-/Nf7TyzTx6S3yRJObOAV7956r8cr2+Oj8AC5dt8wSP3BQAoeX58NoHyCU8P8zGkNXStjTSi6fzO6F0pBdcYbEg==", - "license": "MIT", - "engines": { - "node": ">= 0.8" - } - }, - "node_modules/call-bind-apply-helpers": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/call-bind-apply-helpers/-/call-bind-apply-helpers-1.0.2.tgz", - "integrity": "sha512-Sp1ablJ0ivDkSzjcaJdxEunN5/XvksFJ2sMBFfq6x0ryhQV/2b/KwFe21cMpmHtPOSij8K99/wSfoEuTObmuMQ==", - "license": "MIT", - "dependencies": { - "es-errors": "^1.3.0", - "function-bind": "^1.1.2" - }, - "engines": { - "node": ">= 0.4" - } - }, - "node_modules/call-bound": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/call-bound/-/call-bound-1.0.4.tgz", - "integrity": "sha512-+ys997U96po4Kx/ABpBCqhA9EuxJaQWDQg7295H4hBphv3IZg0boBKuwYpt4YXp6MZ5AmZQnU/tyMTlRpaSejg==", - "license": "MIT", - "dependencies": { - "call-bind-apply-helpers": "^1.0.2", - "get-intrinsic": "^1.3.0" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/combined-stream": { - "version": "1.0.8", - "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz", - "integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==", - "license": "MIT", - "dependencies": { - "delayed-stream": "~1.0.0" - }, - "engines": { - "node": ">= 0.8" - } - }, - "node_modules/concat-stream": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/concat-stream/-/concat-stream-2.0.0.tgz", - "integrity": "sha512-MWufYdFw53ccGjCA+Ol7XJYpAlW6/prSMzuPOTRnJGcGzuhLn4Scrz7qf6o8bROZ514ltazcIFJZevcfbo0x7A==", - "engines": [ - "node >= 6.0" - ], - "license": "MIT", - "dependencies": { - "buffer-from": "^1.0.0", - "inherits": "^2.0.3", - "readable-stream": "^3.0.2", - "typedarray": "^0.0.6" - } - }, - "node_modules/content-disposition": { - "version": "0.5.4", - "resolved": "https://registry.npmjs.org/content-disposition/-/content-disposition-0.5.4.tgz", - "integrity": "sha512-FveZTNuGw04cxlAiWbzi6zTAL/lhehaWbTtgluJh4/E95DqMwTmha3KZN1aAWA8cFIhHzMZUvLevkw5Rqk+tSQ==", - "license": "MIT", - "dependencies": { - "safe-buffer": "5.2.1" - }, - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/content-type": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/content-type/-/content-type-1.0.5.tgz", - "integrity": "sha512-nTjqfcBFEipKdXCv4YDQWCfmcLZKm81ldF0pAopTvyrFGVbcR6P/VAAd5G7N+0tTr8QqiU0tFadD6FK4NtJwOA==", - "license": "MIT", - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/cookie": { - "version": "0.7.2", - "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.7.2.tgz", - "integrity": "sha512-yki5XnKuf750l50uGTllt6kKILY4nQ1eNIQatoXEByZ5dWgnKqbnqmTrBE5B4N7lrMJKQ2ytWMiTO2o0v6Ew/w==", - "license": "MIT", - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/cookie-signature": { - "version": "1.0.7", - "resolved": "https://registry.npmjs.org/cookie-signature/-/cookie-signature-1.0.7.tgz", - "integrity": "sha512-NXdYc3dLr47pBkpUCHtKSwIOQXLVn8dZEuywboCOJY/osA0wFSLlSawr3KN8qXJEyX66FcONTH8EIlVuK0yyFA==", - "license": "MIT" - }, - "node_modules/cors": { - "version": "2.8.6", - "resolved": "https://registry.npmjs.org/cors/-/cors-2.8.6.tgz", - "integrity": "sha512-tJtZBBHA6vjIAaF6EnIaq6laBBP9aq/Y3ouVJjEfoHbRBcHBAHYcMh/w8LDrk2PvIMMq8gmopa5D4V8RmbrxGw==", - "license": "MIT", - "dependencies": { - "object-assign": "^4", - "vary": "^1" - }, - "engines": { - "node": ">= 0.10" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/express" - } - }, - "node_modules/data-uri-to-buffer": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/data-uri-to-buffer/-/data-uri-to-buffer-4.0.1.tgz", - "integrity": "sha512-0R9ikRb668HB7QDxT1vkpuUBtqc53YyAwMwGeUFKRojY/NWKvdZ+9UYtRfGmhqNbRkTSVpMbmyhXipFFv2cb/A==", - "license": "MIT", - "engines": { - "node": ">= 12" - } - }, - "node_modules/debug": { - "version": "2.6.9", - "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", - "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", - "license": "MIT", - "dependencies": { - "ms": "2.0.0" - } - }, - "node_modules/delayed-stream": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", - "integrity": "sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==", - "license": "MIT", - "engines": { - "node": ">=0.4.0" - } - }, - "node_modules/depd": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/depd/-/depd-2.0.0.tgz", - "integrity": "sha512-g7nH6P6dyDioJogAAGprGpCtVImJhpPk/roCzdb3fIh61/s/nPsfR6onyMwkCAR/OlC3yBC0lESvUoQEAssIrw==", - "license": "MIT", - "engines": { - "node": ">= 0.8" - } - }, - "node_modules/destroy": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/destroy/-/destroy-1.2.0.tgz", - "integrity": "sha512-2sJGJTaXIIaR1w4iJSNoN0hnMY7Gpc/n8D4qSCJw8QqFWXf7cuAgnEHxBpweaVcPevC2l3KpjYCx3NypQQgaJg==", - "license": "MIT", - "engines": { - "node": ">= 0.8", - "npm": "1.2.8000 || >= 1.4.16" - } - }, - "node_modules/dotenv": { - "version": "16.6.1", - "resolved": "https://registry.npmjs.org/dotenv/-/dotenv-16.6.1.tgz", - "integrity": "sha512-uBq4egWHTcTt33a72vpSG0z3HnPuIl6NqYcTrKEg2azoEyl2hpW0zqlxysq2pK9HlDIHyHyakeYaYnSAwd8bow==", - "license": "BSD-2-Clause", - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://dotenvx.com" - } - }, - "node_modules/dunder-proto": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/dunder-proto/-/dunder-proto-1.0.1.tgz", - "integrity": "sha512-KIN/nDJBQRcXw0MLVhZE9iQHmG68qAVIBg9CqmUYjmQIhgij9U5MFvrqkUL5FbtyyzZuOeOt0zdeRe4UY7ct+A==", - "license": "MIT", - "dependencies": { - "call-bind-apply-helpers": "^1.0.1", - "es-errors": "^1.3.0", - "gopd": "^1.2.0" - }, - "engines": { - "node": ">= 0.4" - } - }, - "node_modules/ee-first": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz", - "integrity": "sha512-WMwm9LhRUo+WUaRN+vRuETqG89IgZphVSNkdFgeb6sS/E4OrDIN7t48CAewSHXc6C8lefD8KKfr5vY61brQlow==", - "license": "MIT" - }, - "node_modules/encodeurl": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-2.0.0.tgz", - "integrity": "sha512-Q0n9HRi4m6JuGIV1eFlmvJB7ZEVxu93IrMyiMsGC0lrMJMWzRgx6WGquyfQgZVb31vhGgXnfmPNNXmxnOkRBrg==", - "license": "MIT", - "engines": { - "node": ">= 0.8" - } - }, - "node_modules/es-define-property": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/es-define-property/-/es-define-property-1.0.1.tgz", - "integrity": "sha512-e3nRfgfUZ4rNGL232gUgX06QNyyez04KdjFrF+LTRoOXmrOgFKDg4BCdsjW8EnT69eqdYGmRpJwiPVYNrCaW3g==", - "license": "MIT", - "engines": { - "node": ">= 0.4" - } - }, - "node_modules/es-errors": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/es-errors/-/es-errors-1.3.0.tgz", - "integrity": "sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==", - "license": "MIT", - "engines": { - "node": ">= 0.4" - } - }, - "node_modules/es-object-atoms": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/es-object-atoms/-/es-object-atoms-1.1.2.tgz", - "integrity": "sha512-HWcBoN6NileqtSydK2FqHbS/LoDd2pqrnQHLyJzBj4kOp/ky2MWMN694xOfkK8/SnUsW2DH7EfyVlydKCsm1Zw==", - "license": "MIT", - "dependencies": { - "es-errors": "^1.3.0" - }, - "engines": { - "node": ">= 0.4" - } - }, - "node_modules/es-set-tostringtag": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/es-set-tostringtag/-/es-set-tostringtag-2.1.0.tgz", - "integrity": "sha512-j6vWzfrGVfyXxge+O0x5sh6cvxAog0a/4Rdd2K36zCMV5eJ+/+tOAngRO8cODMNWbVRdVlmGZQL2YS3yR8bIUA==", - "license": "MIT", - "dependencies": { - "es-errors": "^1.3.0", - "get-intrinsic": "^1.2.6", - "has-tostringtag": "^1.0.2", - "hasown": "^2.0.2" - }, - "engines": { - "node": ">= 0.4" - } - }, - "node_modules/escape-html": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/escape-html/-/escape-html-1.0.3.tgz", - "integrity": "sha512-NiSupZ4OeuGwr68lGIeym/ksIZMJodUGOSCZ/FSnTxcrekbvqrgdUxlJOMpijaKZVjAJrWrGs/6Jy8OMuyj9ow==", - "license": "MIT" - }, - "node_modules/etag": { - "version": "1.8.1", - "resolved": "https://registry.npmjs.org/etag/-/etag-1.8.1.tgz", - "integrity": "sha512-aIL5Fx7mawVa300al2BnEE4iNvo1qETxLrPI/o05L7z6go7fCw1J6EQmbK4FmJ2AS7kgVF/KEZWufBfdClMcPg==", - "license": "MIT", - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/express": { - "version": "4.22.2", - "resolved": "https://registry.npmjs.org/express/-/express-4.22.2.tgz", - "integrity": "sha512-IuL+Elrou2ZvCFHs18/CIzy2Nzvo25nZ1/D2eIZlz7c+QUayAcYoiM2BthCjs+EBHVpjYjcuLDAiCWgeIX3X1Q==", - "license": "MIT", - "dependencies": { - "accepts": "~1.3.8", - "array-flatten": "1.1.1", - "body-parser": "~1.20.5", - "content-disposition": "~0.5.4", - "content-type": "~1.0.4", - "cookie": "~0.7.1", - "cookie-signature": "~1.0.6", - "debug": "2.6.9", - "depd": "2.0.0", - "encodeurl": "~2.0.0", - "escape-html": "~1.0.3", - "etag": "~1.8.1", - "finalhandler": "~1.3.1", - "fresh": "~0.5.2", - "http-errors": "~2.0.0", - "merge-descriptors": "1.0.3", - "methods": "~1.1.2", - "on-finished": "~2.4.1", - "parseurl": "~1.3.3", - "path-to-regexp": "~0.1.12", - "proxy-addr": "~2.0.7", - "qs": "~6.15.1", - "range-parser": "~1.2.1", - "safe-buffer": "5.2.1", - "send": "~0.19.0", - "serve-static": "~1.16.2", - "setprototypeof": "1.2.0", - "statuses": "~2.0.1", - "type-is": "~1.6.18", - "utils-merge": "1.0.1", - "vary": "~1.1.2" - }, - "engines": { - "node": ">= 0.10.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/express" - } - }, - "node_modules/fetch-blob": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/fetch-blob/-/fetch-blob-3.2.0.tgz", - "integrity": "sha512-7yAQpD2UMJzLi1Dqv7qFYnPbaPx7ZfFK6PiIxQ4PfkGPyNyl2Ugx+a/umUonmKqjhM4DnfbMvdX6otXq83soQQ==", - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/jimmywarting" - }, - { - "type": "paypal", - "url": "https://paypal.me/jimmywarting" - } - ], - "license": "MIT", - "dependencies": { - "node-domexception": "^1.0.0", - "web-streams-polyfill": "^3.0.3" - }, - "engines": { - "node": "^12.20 || >= 14.13" - } - }, - "node_modules/finalhandler": { - "version": "1.3.2", - "resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-1.3.2.tgz", - "integrity": "sha512-aA4RyPcd3badbdABGDuTXCMTtOneUCAYH/gxoYRTZlIJdF0YPWuGqiAsIrhNnnqdXGswYk6dGujem4w80UJFhg==", - "license": "MIT", - "dependencies": { - "debug": "2.6.9", - "encodeurl": "~2.0.0", - "escape-html": "~1.0.3", - "on-finished": "~2.4.1", - "parseurl": "~1.3.3", - "statuses": "~2.0.2", - "unpipe": "~1.0.0" - }, - "engines": { - "node": ">= 0.8" - } - }, - "node_modules/follow-redirects": { - "version": "1.16.0", - "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.16.0.tgz", - "integrity": "sha512-y5rN/uOsadFT/JfYwhxRS5R7Qce+g3zG97+JrtFZlC9klX/W5hD7iiLzScI4nZqUS7DNUdhPgw4xI8W2LuXlUw==", - "funding": [ - { - "type": "individual", - "url": "https://github.com/sponsors/RubenVerborgh" - } - ], - "license": "MIT", - "engines": { - "node": ">=4.0" - }, - "peerDependenciesMeta": { - "debug": { - "optional": true - } - } - }, - "node_modules/form-data": { - "version": "4.0.6", - "resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.6.tgz", - "integrity": "sha512-vKatAh4SlVfgbv+YtmhiRjhEMJsYpsG1Y2rMQtR+SVSbytsSD1YGzDIcrAJmdFec88u/+VoGmxnl+80gL1tRCQ==", - "license": "MIT", - "dependencies": { - "asynckit": "^0.4.0", - "combined-stream": "^1.0.8", - "es-set-tostringtag": "^2.1.0", - "hasown": "^2.0.4", - "mime-types": "^2.1.35" - }, - "engines": { - "node": ">= 6" - } - }, - "node_modules/formdata-polyfill": { - "version": "4.0.10", - "resolved": "https://registry.npmjs.org/formdata-polyfill/-/formdata-polyfill-4.0.10.tgz", - "integrity": "sha512-buewHzMvYL29jdeQTVILecSaZKnt/RJWjoZCF5OW60Z67/GmSLBkOFM7qh1PI3zFNtJbaZL5eQu1vLfazOwj4g==", - "license": "MIT", - "dependencies": { - "fetch-blob": "^3.1.2" - }, - "engines": { - "node": ">=12.20.0" - } - }, - "node_modules/forwarded": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/forwarded/-/forwarded-0.2.0.tgz", - "integrity": "sha512-buRG0fpBtRHSTCOASe6hD258tEubFoRLb4ZNA6NxMVHNw2gOcwHo9wyablzMzOA5z9xA9L1KNjk/Nt6MT9aYow==", - "license": "MIT", - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/fresh": { - "version": "0.5.2", - "resolved": "https://registry.npmjs.org/fresh/-/fresh-0.5.2.tgz", - "integrity": "sha512-zJ2mQYM18rEFOudeV4GShTGIQ7RbzA7ozbU9I/XBpm7kqgMywgmylMwXHxZJmkVoYkna9d2pVXVXPdYTP9ej8Q==", - "license": "MIT", - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/function-bind": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz", - "integrity": "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==", - "license": "MIT", - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/get-intrinsic": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.3.0.tgz", - "integrity": "sha512-9fSjSaos/fRIVIp+xSJlE6lfwhES7LNtKaCBIamHsjr2na1BiABJPo0mOjjz8GJDURarmCPGqaiVg5mfjb98CQ==", - "license": "MIT", - "dependencies": { - "call-bind-apply-helpers": "^1.0.2", - "es-define-property": "^1.0.1", - "es-errors": "^1.3.0", - "es-object-atoms": "^1.1.1", - "function-bind": "^1.1.2", - "get-proto": "^1.0.1", - "gopd": "^1.2.0", - "has-symbols": "^1.1.0", - "hasown": "^2.0.2", - "math-intrinsics": "^1.1.0" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/get-proto": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/get-proto/-/get-proto-1.0.1.tgz", - "integrity": "sha512-sTSfBjoXBp89JvIKIefqw7U2CCebsc74kiY6awiGogKtoSGbgjYE/G/+l9sF3MWFPNc9IcoOC4ODfKHfxFmp0g==", - "license": "MIT", - "dependencies": { - "dunder-proto": "^1.0.1", - "es-object-atoms": "^1.0.0" - }, - "engines": { - "node": ">= 0.4" - } - }, - "node_modules/gopd": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.2.0.tgz", - "integrity": "sha512-ZUKRh6/kUFoAiTAtTYPZJ3hw9wNxx+BIBOijnlG9PnrJsCcSjs1wyyD6vJpaYtgnzDrKYRSqf3OO6Rfa93xsRg==", - "license": "MIT", - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/has-symbols": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.1.0.tgz", - "integrity": "sha512-1cDNdwJ2Jaohmb3sg4OmKaMBwuC48sYni5HUw2DvsC8LjGTLK9h+eb1X6RyuOHe4hT0ULCW68iomhjUoKUqlPQ==", - "license": "MIT", - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/has-tostringtag": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/has-tostringtag/-/has-tostringtag-1.0.2.tgz", - "integrity": "sha512-NqADB8VjPFLM2V0VvHUewwwsw0ZWBaIdgo+ieHtK3hasLz4qeCRjYcqfB6AQrBggRKppKF8L52/VqdVsO47Dlw==", - "license": "MIT", - "dependencies": { - "has-symbols": "^1.0.3" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/hasown": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.4.tgz", - "integrity": "sha512-T2UbfbBEF32wiepXIsMlTW9+dDYC6wMh/t/vYA4tuOMKqWz/n3vr1NFSxQiyP+zk2mXsoMA/i/7qV6LKut1t1A==", - "license": "MIT", - "dependencies": { - "function-bind": "^1.1.2" - }, - "engines": { - "node": ">= 0.4" - } - }, - "node_modules/http-errors": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-2.0.1.tgz", - "integrity": "sha512-4FbRdAX+bSdmo4AUFuS0WNiPz8NgFt+r8ThgNWmlrjQjt1Q7ZR9+zTlce2859x4KSXrwIsaeTqDoKQmtP8pLmQ==", - "license": "MIT", - "dependencies": { - "depd": "~2.0.0", - "inherits": "~2.0.4", - "setprototypeof": "~1.2.0", - "statuses": "~2.0.2", - "toidentifier": "~1.0.1" - }, - "engines": { - "node": ">= 0.8" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/express" - } - }, - "node_modules/https-proxy-agent": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-5.0.1.tgz", - "integrity": "sha512-dFcAjpTQFgoLMzC2VwU+C/CbS7uRL0lWmxDITmqm7C+7F0Odmj6s9l6alZc6AELXhrnggM2CeWSXHGOdX2YtwA==", - "license": "MIT", - "dependencies": { - "agent-base": "6", - "debug": "4" - }, - "engines": { - "node": ">= 6" - } - }, - "node_modules/https-proxy-agent/node_modules/debug": { - "version": "4.4.3", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.3.tgz", - "integrity": "sha512-RGwwWnwQvkVfavKVt22FGLw+xYSdzARwm0ru6DhTVA3umU5hZc28V3kO4stgYryrTlLpuvgI9GiijltAjNbcqA==", - "license": "MIT", - "dependencies": { - "ms": "^2.1.3" - }, - "engines": { - "node": ">=6.0" - }, - "peerDependenciesMeta": { - "supports-color": { - "optional": true - } - } - }, - "node_modules/https-proxy-agent/node_modules/ms": { - "version": "2.1.3", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", - "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", - "license": "MIT" - }, - "node_modules/iconv-lite": { - "version": "0.4.24", - "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz", - "integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==", - "license": "MIT", - "dependencies": { - "safer-buffer": ">= 2.1.2 < 3" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/inherits": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", - "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", - "license": "ISC" - }, - "node_modules/ipaddr.js": { - "version": "1.9.1", - "resolved": "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-1.9.1.tgz", - "integrity": "sha512-0KI/607xoxSToH7GjN1FfSbLoU0+btTicjsQSWQlh/hZykN8KpmMf7uYwPW3R+akZ6R/w18ZlXSHBYXiYUPO3g==", - "license": "MIT", - "engines": { - "node": ">= 0.10" - } - }, - "node_modules/math-intrinsics": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/math-intrinsics/-/math-intrinsics-1.1.0.tgz", - "integrity": "sha512-/IXtbwEk5HTPyEwyKX6hGkYXxM9nbj64B+ilVJnC/R6B0pH5G4V3b0pVbL7DBj4tkhBAppbQUlf6F6Xl9LHu1g==", - "license": "MIT", - "engines": { - "node": ">= 0.4" - } - }, - "node_modules/media-typer": { - "version": "0.3.0", - "resolved": "https://registry.npmjs.org/media-typer/-/media-typer-0.3.0.tgz", - "integrity": "sha512-dq+qelQ9akHpcOl/gUVRTxVIOkAJ1wR3QAvb4RsVjS8oVoFjDGTc679wJYmUmknUF5HwMLOgb5O+a3KxfWapPQ==", - "license": "MIT", - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/merge-descriptors": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/merge-descriptors/-/merge-descriptors-1.0.3.tgz", - "integrity": "sha512-gaNvAS7TZ897/rVaZ0nMtAyxNyi/pdbjbAwUpFQpN70GqnVfOiXpeUUMKRBmzXaSQ8DdTX4/0ms62r2K+hE6mQ==", - "license": "MIT", - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/methods": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/methods/-/methods-1.1.2.tgz", - "integrity": "sha512-iclAHeNqNm68zFtnZ0e+1L2yUIdvzNoauKU4WBA3VvH/vPFieF7qfRlwUZU+DA9P9bPXIS90ulxoUoCH23sV2w==", - "license": "MIT", - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/mime": { - "version": "1.6.0", - "resolved": "https://registry.npmjs.org/mime/-/mime-1.6.0.tgz", - "integrity": "sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg==", - "license": "MIT", - "bin": { - "mime": "cli.js" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/mime-db": { - "version": "1.52.0", - "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz", - "integrity": "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==", - "license": "MIT", - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/mime-types": { - "version": "2.1.35", - "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.35.tgz", - "integrity": "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==", - "license": "MIT", - "dependencies": { - "mime-db": "1.52.0" - }, - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/ms": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", - "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==", - "license": "MIT" - }, - "node_modules/multer": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/multer/-/multer-2.2.0.tgz", - "integrity": "sha512-6rdyFg2kLrMh9Jee7/BMPuV9lEAd7lLW2YUpF9/YxR7njyoUwwQ0ZPh3TaIY50Sw6vlyD2HW3wGOkTS4P79xrQ==", - "license": "MIT", - "dependencies": { - "append-field": "^1.0.0", - "busboy": "^1.6.0", - "concat-stream": "^2.0.0", - "type-is": "^1.6.18" - }, - "engines": { - "node": ">= 10.16.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/express" - } - }, - "node_modules/negotiator": { - "version": "0.6.3", - "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.6.3.tgz", - "integrity": "sha512-+EUsqGPLsM+j/zdChZjsnX51g4XrHFOIXwfnCVPGlQk/k5giakcKsuxCObBRu6DSm9opw/O6slWbJdghQM4bBg==", - "license": "MIT", - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/node-domexception": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/node-domexception/-/node-domexception-1.0.0.tgz", - "integrity": "sha512-/jKZoMpw0F8GRwl4/eLROPA3cfcXtLApP0QzLmUT/HuPCZWyB7IY9ZrMeKw2O/nFIqPQB3PVM9aYm0F312AXDQ==", - "deprecated": "Use your platform's native DOMException instead", - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/jimmywarting" - }, - { - "type": "github", - "url": "https://paypal.me/jimmywarting" - } - ], - "license": "MIT", - "engines": { - "node": ">=10.5.0" - } - }, - "node_modules/node-fetch": { - "version": "3.3.2", - "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-3.3.2.tgz", - "integrity": "sha512-dRB78srN/l6gqWulah9SrxeYnxeddIG30+GOqK/9OlLVyLg3HPnr6SqOWTWOXKRwC2eGYCkZ59NNuSgvSrpgOA==", - "license": "MIT", - "dependencies": { - "data-uri-to-buffer": "^4.0.0", - "fetch-blob": "^3.1.4", - "formdata-polyfill": "^4.0.10" - }, - "engines": { - "node": "^12.20.0 || ^14.13.1 || >=16.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/node-fetch" - } - }, - "node_modules/object-assign": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", - "integrity": "sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==", - "license": "MIT", - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/object-inspect": { - "version": "1.13.4", - "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.13.4.tgz", - "integrity": "sha512-W67iLl4J2EXEGTbfeHCffrjDfitvLANg0UlX3wFUUSTx92KXRFegMHUVgSqE+wvhAbi4WqjGg9czysTV2Epbew==", - "license": "MIT", - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/on-finished": { - "version": "2.4.1", - "resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.4.1.tgz", - "integrity": "sha512-oVlzkg3ENAhCk2zdv7IJwd/QUD4z2RxRwpkcGY8psCVcCYZNq4wYnVWALHM+brtuJjePWiYF/ClmuDr8Ch5+kg==", - "license": "MIT", - "dependencies": { - "ee-first": "1.1.1" - }, - "engines": { - "node": ">= 0.8" - } - }, - "node_modules/parseurl": { - "version": "1.3.3", - "resolved": "https://registry.npmjs.org/parseurl/-/parseurl-1.3.3.tgz", - "integrity": "sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ==", - "license": "MIT", - "engines": { - "node": ">= 0.8" - } - }, - "node_modules/path-to-regexp": { - "version": "0.1.13", - "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.13.tgz", - "integrity": "sha512-A/AGNMFN3c8bOlvV9RreMdrv7jsmF9XIfDeCd87+I8RNg6s78BhJxMu69NEMHBSJFxKidViTEdruRwEk/WIKqA==", - "license": "MIT" - }, - "node_modules/proxy-addr": { - "version": "2.0.7", - "resolved": "https://registry.npmjs.org/proxy-addr/-/proxy-addr-2.0.7.tgz", - "integrity": "sha512-llQsMLSUDUPT44jdrU/O37qlnifitDP+ZwrmmZcoSKyLKvtZxpyV0n2/bD/N4tBAAZ/gJEdZU7KMraoK1+XYAg==", - "license": "MIT", - "dependencies": { - "forwarded": "0.2.0", - "ipaddr.js": "1.9.1" - }, - "engines": { - "node": ">= 0.10" - } - }, - "node_modules/proxy-from-env": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/proxy-from-env/-/proxy-from-env-2.1.0.tgz", - "integrity": "sha512-cJ+oHTW1VAEa8cJslgmUZrc+sjRKgAKl3Zyse6+PV38hZe/V6Z14TbCuXcan9F9ghlz4QrFr2c92TNF82UkYHA==", - "license": "MIT", - "engines": { - "node": ">=10" - } - }, - "node_modules/qs": { - "version": "6.15.3", - "resolved": "https://registry.npmjs.org/qs/-/qs-6.15.3.tgz", - "integrity": "sha512-O9gl3zCl5h5blw1KGUzQKhA5oUXSl8rwUIM5o0S3nCXMliSvy5Dzx7/DJcI+SwgICv+IneSZwhBh1oSyEHA71A==", - "license": "BSD-3-Clause", - "dependencies": { - "es-define-property": "^1.0.1", - "side-channel": "^1.1.1" - }, - "engines": { - "node": ">=0.6" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/range-parser": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/range-parser/-/range-parser-1.2.1.tgz", - "integrity": "sha512-Hrgsx+orqoygnmhFbKaHE6c296J+HTAQXoxEF6gNupROmmGJRoyzfG3ccAveqCBrwr/2yxQ5BVd/GTl5agOwSg==", - "license": "MIT", - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/raw-body": { - "version": "2.5.3", - "resolved": "https://registry.npmjs.org/raw-body/-/raw-body-2.5.3.tgz", - "integrity": "sha512-s4VSOf6yN0rvbRZGxs8Om5CWj6seneMwK3oDb4lWDH0UPhWcxwOWw5+qk24bxq87szX1ydrwylIOp2uG1ojUpA==", - "license": "MIT", - "dependencies": { - "bytes": "~3.1.2", - "http-errors": "~2.0.1", - "iconv-lite": "~0.4.24", - "unpipe": "~1.0.0" - }, - "engines": { - "node": ">= 0.8" - } - }, - "node_modules/readable-stream": { - "version": "3.6.2", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.2.tgz", - "integrity": "sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==", - "license": "MIT", - "dependencies": { - "inherits": "^2.0.3", - "string_decoder": "^1.1.1", - "util-deprecate": "^1.0.1" - }, - "engines": { - "node": ">= 6" - } - }, - "node_modules/safe-buffer": { - "version": "5.2.1", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", - "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ], - "license": "MIT" - }, - "node_modules/safer-buffer": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", - "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==", - "license": "MIT" - }, - "node_modules/send": { - "version": "0.19.2", - "resolved": "https://registry.npmjs.org/send/-/send-0.19.2.tgz", - "integrity": "sha512-VMbMxbDeehAxpOtWJXlcUS5E8iXh6QmN+BkRX1GARS3wRaXEEgzCcB10gTQazO42tpNIya8xIyNx8fll1OFPrg==", - "license": "MIT", - "dependencies": { - "debug": "2.6.9", - "depd": "2.0.0", - "destroy": "1.2.0", - "encodeurl": "~2.0.0", - "escape-html": "~1.0.3", - "etag": "~1.8.1", - "fresh": "~0.5.2", - "http-errors": "~2.0.1", - "mime": "1.6.0", - "ms": "2.1.3", - "on-finished": "~2.4.1", - "range-parser": "~1.2.1", - "statuses": "~2.0.2" - }, - "engines": { - "node": ">= 0.8.0" - } - }, - "node_modules/send/node_modules/ms": { - "version": "2.1.3", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", - "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", - "license": "MIT" - }, - "node_modules/serve-static": { - "version": "1.16.3", - "resolved": "https://registry.npmjs.org/serve-static/-/serve-static-1.16.3.tgz", - "integrity": "sha512-x0RTqQel6g5SY7Lg6ZreMmsOzncHFU7nhnRWkKgWuMTu5NN0DR5oruckMqRvacAN9d5w6ARnRBXl9xhDCgfMeA==", - "license": "MIT", - "dependencies": { - "encodeurl": "~2.0.0", - "escape-html": "~1.0.3", - "parseurl": "~1.3.3", - "send": "~0.19.1" - }, - "engines": { - "node": ">= 0.8.0" - } - }, - "node_modules/setprototypeof": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.2.0.tgz", - "integrity": "sha512-E5LDX7Wrp85Kil5bhZv46j8jOeboKq5JMmYM3gVGdGH8xFpPWXUMsNrlODCrkoxMEeNi/XZIwuRvY4XNwYMJpw==", - "license": "ISC" - }, - "node_modules/side-channel": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.1.1.tgz", - "integrity": "sha512-6x6dK6zJdpTzF4sQeNYxwtvBzf6Eg4GtlesS94HOvTudUeyK2WXAaIfmDgsyslYrRBeFIlsi54AYsFGUuhmvrQ==", - "license": "MIT", - "dependencies": { - "es-errors": "^1.3.0", - "object-inspect": "^1.13.4", - "side-channel-list": "^1.0.1", - "side-channel-map": "^1.0.1", - "side-channel-weakmap": "^1.0.2" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/side-channel-list": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/side-channel-list/-/side-channel-list-1.0.1.tgz", - "integrity": "sha512-mjn/0bi/oUURjc5Xl7IaWi/OJJJumuoJFQJfDDyO46+hBWsfaVM65TBHq2eoZBhzl9EchxOijpkbRC8SVBQU0w==", - "license": "MIT", - "dependencies": { - "es-errors": "^1.3.0", - "object-inspect": "^1.13.4" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/side-channel-map": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/side-channel-map/-/side-channel-map-1.0.1.tgz", - "integrity": "sha512-VCjCNfgMsby3tTdo02nbjtM/ewra6jPHmpThenkTYh8pG9ucZ/1P8So4u4FGBek/BjpOVsDCMoLA/iuBKIFXRA==", - "license": "MIT", - "dependencies": { - "call-bound": "^1.0.2", - "es-errors": "^1.3.0", - "get-intrinsic": "^1.2.5", - "object-inspect": "^1.13.3" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/side-channel-weakmap": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/side-channel-weakmap/-/side-channel-weakmap-1.0.2.tgz", - "integrity": "sha512-WPS/HvHQTYnHisLo9McqBHOJk2FkHO/tlpvldyrnem4aeQp4hai3gythswg6p01oSoTl58rcpiFAjF2br2Ak2A==", - "license": "MIT", - "dependencies": { - "call-bound": "^1.0.2", - "es-errors": "^1.3.0", - "get-intrinsic": "^1.2.5", - "object-inspect": "^1.13.3", - "side-channel-map": "^1.0.1" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/statuses": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/statuses/-/statuses-2.0.2.tgz", - "integrity": "sha512-DvEy55V3DB7uknRo+4iOGT5fP1slR8wQohVdknigZPMpMstaKJQWhwiYBACJE3Ul2pTnATihhBYnRhZQHGBiRw==", - "license": "MIT", - "engines": { - "node": ">= 0.8" - } - }, - "node_modules/streamsearch": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/streamsearch/-/streamsearch-1.1.0.tgz", - "integrity": "sha512-Mcc5wHehp9aXz1ax6bZUyY5afg9u2rv5cqQI3mRrYkGC8rW2hM02jWuwjtL++LS5qinSyhj2QfLyNsuc+VsExg==", - "engines": { - "node": ">=10.0.0" - } - }, - "node_modules/string_decoder": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz", - "integrity": "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==", - "license": "MIT", - "dependencies": { - "safe-buffer": "~5.2.0" - } - }, - "node_modules/toidentifier": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/toidentifier/-/toidentifier-1.0.1.tgz", - "integrity": "sha512-o5sSPKEkg/DIQNmH43V0/uerLrpzVedkUh8tGNvaeXpfpuwjKenlSox/2O/BTlZUtEe+JG7s5YhEz608PlAHRA==", - "license": "MIT", - "engines": { - "node": ">=0.6" - } - }, - "node_modules/type-is": { - "version": "1.6.18", - "resolved": "https://registry.npmjs.org/type-is/-/type-is-1.6.18.tgz", - "integrity": "sha512-TkRKr9sUTxEH8MdfuCSP7VizJyzRNMjj2J2do2Jr3Kym598JVdEksuzPQCnlFPW4ky9Q+iA+ma9BGm06XQBy8g==", - "license": "MIT", - "dependencies": { - "media-typer": "0.3.0", - "mime-types": "~2.1.24" - }, - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/typedarray": { - "version": "0.0.6", - "resolved": "https://registry.npmjs.org/typedarray/-/typedarray-0.0.6.tgz", - "integrity": "sha512-/aCDEGatGvZ2BIk+HmLf4ifCJFwvKFNb9/JeZPMulfgFracn9QFcAf5GO8B/mweUjSoblS5In0cWhqpfs/5PQA==", - "license": "MIT" - }, - "node_modules/unpipe": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/unpipe/-/unpipe-1.0.0.tgz", - "integrity": "sha512-pjy2bYhSsufwWlKwPc+l3cN7+wuJlK6uz0YdJEOlQDbl6jo/YlPi4mb8agUkVC8BF7V8NuzeyPNqRksA3hztKQ==", - "license": "MIT", - "engines": { - "node": ">= 0.8" - } - }, - "node_modules/util-deprecate": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", - "integrity": "sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==", - "license": "MIT" - }, - "node_modules/utils-merge": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/utils-merge/-/utils-merge-1.0.1.tgz", - "integrity": "sha512-pMZTvIkT1d+TFGvDOqodOclx0QWkkgi6Tdoa8gC8ffGAAqz9pzPTZWAybbsHHoED/ztMtkv/VoYTYyShUn81hA==", - "license": "MIT", - "engines": { - "node": ">= 0.4.0" - } - }, - "node_modules/vary": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz", - "integrity": "sha512-BNGbWLfd0eUPabhkXUVm0j8uuvREyTh5ovRa/dyow/BqAbZJyC+5fU+IzQOzmAKzYqYRAISoRhdQr3eIZ/PXqg==", - "license": "MIT", - "engines": { - "node": ">= 0.8" - } - }, - "node_modules/web-streams-polyfill": { - "version": "3.3.3", - "resolved": "https://registry.npmjs.org/web-streams-polyfill/-/web-streams-polyfill-3.3.3.tgz", - "integrity": "sha512-d2JWLCivmZYTSIoge9MsgFCZrt571BikcWGYkjC1khllbTeDlGqZ2D8vD8E/lJa8WGWbb7Plm8/XJYV7IJHZZw==", - "license": "MIT", - "engines": { - "node": ">= 8" - } - } - } -} diff --git a/server/node_modules/accepts/HISTORY.md b/server/node_modules/accepts/HISTORY.md deleted file mode 100644 index cb5990c..0000000 --- a/server/node_modules/accepts/HISTORY.md +++ /dev/null @@ -1,243 +0,0 @@ -1.3.8 / 2022-02-02 -================== - - * deps: mime-types@~2.1.34 - - deps: mime-db@~1.51.0 - * deps: negotiator@0.6.3 - -1.3.7 / 2019-04-29 -================== - - * deps: negotiator@0.6.2 - - Fix sorting charset, encoding, and language with extra parameters - -1.3.6 / 2019-04-28 -================== - - * deps: mime-types@~2.1.24 - - deps: mime-db@~1.40.0 - -1.3.5 / 2018-02-28 -================== - - * deps: mime-types@~2.1.18 - - deps: mime-db@~1.33.0 - -1.3.4 / 2017-08-22 -================== - - * deps: mime-types@~2.1.16 - - deps: mime-db@~1.29.0 - -1.3.3 / 2016-05-02 -================== - - * deps: mime-types@~2.1.11 - - deps: mime-db@~1.23.0 - * deps: negotiator@0.6.1 - - perf: improve `Accept` parsing speed - - perf: improve `Accept-Charset` parsing speed - - perf: improve `Accept-Encoding` parsing speed - - perf: improve `Accept-Language` parsing speed - -1.3.2 / 2016-03-08 -================== - - * deps: mime-types@~2.1.10 - - Fix extension of `application/dash+xml` - - Update primary extension for `audio/mp4` - - deps: mime-db@~1.22.0 - -1.3.1 / 2016-01-19 -================== - - * deps: mime-types@~2.1.9 - - deps: mime-db@~1.21.0 - -1.3.0 / 2015-09-29 -================== - - * deps: mime-types@~2.1.7 - - deps: mime-db@~1.19.0 - * deps: negotiator@0.6.0 - - Fix including type extensions in parameters in `Accept` parsing - - Fix parsing `Accept` parameters with quoted equals - - Fix parsing `Accept` parameters with quoted semicolons - - Lazy-load modules from main entry point - - perf: delay type concatenation until needed - - perf: enable strict mode - - perf: hoist regular expressions - - perf: remove closures getting spec properties - - perf: remove a closure from media type parsing - - perf: remove property delete from media type parsing - -1.2.13 / 2015-09-06 -=================== - - * deps: mime-types@~2.1.6 - - deps: mime-db@~1.18.0 - -1.2.12 / 2015-07-30 -=================== - - * deps: mime-types@~2.1.4 - - deps: mime-db@~1.16.0 - -1.2.11 / 2015-07-16 -=================== - - * deps: mime-types@~2.1.3 - - deps: mime-db@~1.15.0 - -1.2.10 / 2015-07-01 -=================== - - * deps: mime-types@~2.1.2 - - deps: mime-db@~1.14.0 - -1.2.9 / 2015-06-08 -================== - - * deps: mime-types@~2.1.1 - - perf: fix deopt during mapping - -1.2.8 / 2015-06-07 -================== - - * deps: mime-types@~2.1.0 - - deps: mime-db@~1.13.0 - * perf: avoid argument reassignment & argument slice - * perf: avoid negotiator recursive construction - * perf: enable strict mode - * perf: remove unnecessary bitwise operator - -1.2.7 / 2015-05-10 -================== - - * deps: negotiator@0.5.3 - - Fix media type parameter matching to be case-insensitive - -1.2.6 / 2015-05-07 -================== - - * deps: mime-types@~2.0.11 - - deps: mime-db@~1.9.1 - * deps: negotiator@0.5.2 - - Fix comparing media types with quoted values - - Fix splitting media types with quoted commas - -1.2.5 / 2015-03-13 -================== - - * deps: mime-types@~2.0.10 - - deps: mime-db@~1.8.0 - -1.2.4 / 2015-02-14 -================== - - * Support Node.js 0.6 - * deps: mime-types@~2.0.9 - - deps: mime-db@~1.7.0 - * deps: negotiator@0.5.1 - - Fix preference sorting to be stable for long acceptable lists - -1.2.3 / 2015-01-31 -================== - - * deps: mime-types@~2.0.8 - - deps: mime-db@~1.6.0 - -1.2.2 / 2014-12-30 -================== - - * deps: mime-types@~2.0.7 - - deps: mime-db@~1.5.0 - -1.2.1 / 2014-12-30 -================== - - * deps: mime-types@~2.0.5 - - deps: mime-db@~1.3.1 - -1.2.0 / 2014-12-19 -================== - - * deps: negotiator@0.5.0 - - Fix list return order when large accepted list - - Fix missing identity encoding when q=0 exists - - Remove dynamic building of Negotiator class - -1.1.4 / 2014-12-10 -================== - - * deps: mime-types@~2.0.4 - - deps: mime-db@~1.3.0 - -1.1.3 / 2014-11-09 -================== - - * deps: mime-types@~2.0.3 - - deps: mime-db@~1.2.0 - -1.1.2 / 2014-10-14 -================== - - * deps: negotiator@0.4.9 - - Fix error when media type has invalid parameter - -1.1.1 / 2014-09-28 -================== - - * deps: mime-types@~2.0.2 - - deps: mime-db@~1.1.0 - * deps: negotiator@0.4.8 - - Fix all negotiations to be case-insensitive - - Stable sort preferences of same quality according to client order - -1.1.0 / 2014-09-02 -================== - - * update `mime-types` - -1.0.7 / 2014-07-04 -================== - - * Fix wrong type returned from `type` when match after unknown extension - -1.0.6 / 2014-06-24 -================== - - * deps: negotiator@0.4.7 - -1.0.5 / 2014-06-20 -================== - - * fix crash when unknown extension given - -1.0.4 / 2014-06-19 -================== - - * use `mime-types` - -1.0.3 / 2014-06-11 -================== - - * deps: negotiator@0.4.6 - - Order by specificity when quality is the same - -1.0.2 / 2014-05-29 -================== - - * Fix interpretation when header not in request - * deps: pin negotiator@0.4.5 - -1.0.1 / 2014-01-18 -================== - - * Identity encoding isn't always acceptable - * deps: negotiator@~0.4.0 - -1.0.0 / 2013-12-27 -================== - - * Genesis diff --git a/server/node_modules/accepts/LICENSE b/server/node_modules/accepts/LICENSE deleted file mode 100644 index 0616607..0000000 --- a/server/node_modules/accepts/LICENSE +++ /dev/null @@ -1,23 +0,0 @@ -(The MIT License) - -Copyright (c) 2014 Jonathan Ong -Copyright (c) 2015 Douglas Christopher Wilson - -Permission is hereby granted, free of charge, to any person obtaining -a copy of this software and associated documentation files (the -'Software'), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sublicense, and/or sell copies of the Software, and to -permit persons to whom the Software is furnished to do so, subject to -the following conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, -TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE -SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/server/node_modules/accepts/README.md b/server/node_modules/accepts/README.md deleted file mode 100644 index 82680c5..0000000 --- a/server/node_modules/accepts/README.md +++ /dev/null @@ -1,140 +0,0 @@ -# accepts - -[![NPM Version][npm-version-image]][npm-url] -[![NPM Downloads][npm-downloads-image]][npm-url] -[![Node.js Version][node-version-image]][node-version-url] -[![Build Status][github-actions-ci-image]][github-actions-ci-url] -[![Test Coverage][coveralls-image]][coveralls-url] - -Higher level content negotiation based on [negotiator](https://www.npmjs.com/package/negotiator). -Extracted from [koa](https://www.npmjs.com/package/koa) for general use. - -In addition to negotiator, it allows: - -- Allows types as an array or arguments list, ie `(['text/html', 'application/json'])` - as well as `('text/html', 'application/json')`. -- Allows type shorthands such as `json`. -- Returns `false` when no types match -- Treats non-existent headers as `*` - -## Installation - -This is a [Node.js](https://nodejs.org/en/) module available through the -[npm registry](https://www.npmjs.com/). Installation is done using the -[`npm install` command](https://docs.npmjs.com/getting-started/installing-npm-packages-locally): - -```sh -$ npm install accepts -``` - -## API - -```js -var accepts = require('accepts') -``` - -### accepts(req) - -Create a new `Accepts` object for the given `req`. - -#### .charset(charsets) - -Return the first accepted charset. If nothing in `charsets` is accepted, -then `false` is returned. - -#### .charsets() - -Return the charsets that the request accepts, in the order of the client's -preference (most preferred first). - -#### .encoding(encodings) - -Return the first accepted encoding. If nothing in `encodings` is accepted, -then `false` is returned. - -#### .encodings() - -Return the encodings that the request accepts, in the order of the client's -preference (most preferred first). - -#### .language(languages) - -Return the first accepted language. If nothing in `languages` is accepted, -then `false` is returned. - -#### .languages() - -Return the languages that the request accepts, in the order of the client's -preference (most preferred first). - -#### .type(types) - -Return the first accepted type (and it is returned as the same text as what -appears in the `types` array). If nothing in `types` is accepted, then `false` -is returned. - -The `types` array can contain full MIME types or file extensions. Any value -that is not a full MIME types is passed to `require('mime-types').lookup`. - -#### .types() - -Return the types that the request accepts, in the order of the client's -preference (most preferred first). - -## Examples - -### Simple type negotiation - -This simple example shows how to use `accepts` to return a different typed -respond body based on what the client wants to accept. The server lists it's -preferences in order and will get back the best match between the client and -server. - -```js -var accepts = require('accepts') -var http = require('http') - -function app (req, res) { - var accept = accepts(req) - - // the order of this list is significant; should be server preferred order - switch (accept.type(['json', 'html'])) { - case 'json': - res.setHeader('Content-Type', 'application/json') - res.write('{"hello":"world!"}') - break - case 'html': - res.setHeader('Content-Type', 'text/html') - res.write('hello, world!') - break - default: - // the fallback is text/plain, so no need to specify it above - res.setHeader('Content-Type', 'text/plain') - res.write('hello, world!') - break - } - - res.end() -} - -http.createServer(app).listen(3000) -``` - -You can test this out with the cURL program: -```sh -curl -I -H'Accept: text/html' http://localhost:3000/ -``` - -## License - -[MIT](LICENSE) - -[coveralls-image]: https://badgen.net/coveralls/c/github/jshttp/accepts/master -[coveralls-url]: https://coveralls.io/r/jshttp/accepts?branch=master -[github-actions-ci-image]: https://badgen.net/github/checks/jshttp/accepts/master?label=ci -[github-actions-ci-url]: https://github.com/jshttp/accepts/actions/workflows/ci.yml -[node-version-image]: https://badgen.net/npm/node/accepts -[node-version-url]: https://nodejs.org/en/download -[npm-downloads-image]: https://badgen.net/npm/dm/accepts -[npm-url]: https://npmjs.org/package/accepts -[npm-version-image]: https://badgen.net/npm/v/accepts diff --git a/server/node_modules/accepts/index.js b/server/node_modules/accepts/index.js deleted file mode 100644 index e9b2f63..0000000 --- a/server/node_modules/accepts/index.js +++ /dev/null @@ -1,238 +0,0 @@ -/*! - * accepts - * Copyright(c) 2014 Jonathan Ong - * Copyright(c) 2015 Douglas Christopher Wilson - * MIT Licensed - */ - -'use strict' - -/** - * Module dependencies. - * @private - */ - -var Negotiator = require('negotiator') -var mime = require('mime-types') - -/** - * Module exports. - * @public - */ - -module.exports = Accepts - -/** - * Create a new Accepts object for the given req. - * - * @param {object} req - * @public - */ - -function Accepts (req) { - if (!(this instanceof Accepts)) { - return new Accepts(req) - } - - this.headers = req.headers - this.negotiator = new Negotiator(req) -} - -/** - * Check if the given `type(s)` is acceptable, returning - * the best match when true, otherwise `undefined`, in which - * case you should respond with 406 "Not Acceptable". - * - * The `type` value may be a single mime type string - * such as "application/json", the extension name - * such as "json" or an array `["json", "html", "text/plain"]`. When a list - * or array is given the _best_ match, if any is returned. - * - * Examples: - * - * // Accept: text/html - * this.types('html'); - * // => "html" - * - * // Accept: text/*, application/json - * this.types('html'); - * // => "html" - * this.types('text/html'); - * // => "text/html" - * this.types('json', 'text'); - * // => "json" - * this.types('application/json'); - * // => "application/json" - * - * // Accept: text/*, application/json - * this.types('image/png'); - * this.types('png'); - * // => undefined - * - * // Accept: text/*;q=.5, application/json - * this.types(['html', 'json']); - * this.types('html', 'json'); - * // => "json" - * - * @param {String|Array} types... - * @return {String|Array|Boolean} - * @public - */ - -Accepts.prototype.type = -Accepts.prototype.types = function (types_) { - var types = types_ - - // support flattened arguments - if (types && !Array.isArray(types)) { - types = new Array(arguments.length) - for (var i = 0; i < types.length; i++) { - types[i] = arguments[i] - } - } - - // no types, return all requested types - if (!types || types.length === 0) { - return this.negotiator.mediaTypes() - } - - // no accept header, return first given type - if (!this.headers.accept) { - return types[0] - } - - var mimes = types.map(extToMime) - var accepts = this.negotiator.mediaTypes(mimes.filter(validMime)) - var first = accepts[0] - - return first - ? types[mimes.indexOf(first)] - : false -} - -/** - * Return accepted encodings or best fit based on `encodings`. - * - * Given `Accept-Encoding: gzip, deflate` - * an array sorted by quality is returned: - * - * ['gzip', 'deflate'] - * - * @param {String|Array} encodings... - * @return {String|Array} - * @public - */ - -Accepts.prototype.encoding = -Accepts.prototype.encodings = function (encodings_) { - var encodings = encodings_ - - // support flattened arguments - if (encodings && !Array.isArray(encodings)) { - encodings = new Array(arguments.length) - for (var i = 0; i < encodings.length; i++) { - encodings[i] = arguments[i] - } - } - - // no encodings, return all requested encodings - if (!encodings || encodings.length === 0) { - return this.negotiator.encodings() - } - - return this.negotiator.encodings(encodings)[0] || false -} - -/** - * Return accepted charsets or best fit based on `charsets`. - * - * Given `Accept-Charset: utf-8, iso-8859-1;q=0.2, utf-7;q=0.5` - * an array sorted by quality is returned: - * - * ['utf-8', 'utf-7', 'iso-8859-1'] - * - * @param {String|Array} charsets... - * @return {String|Array} - * @public - */ - -Accepts.prototype.charset = -Accepts.prototype.charsets = function (charsets_) { - var charsets = charsets_ - - // support flattened arguments - if (charsets && !Array.isArray(charsets)) { - charsets = new Array(arguments.length) - for (var i = 0; i < charsets.length; i++) { - charsets[i] = arguments[i] - } - } - - // no charsets, return all requested charsets - if (!charsets || charsets.length === 0) { - return this.negotiator.charsets() - } - - return this.negotiator.charsets(charsets)[0] || false -} - -/** - * Return accepted languages or best fit based on `langs`. - * - * Given `Accept-Language: en;q=0.8, es, pt` - * an array sorted by quality is returned: - * - * ['es', 'pt', 'en'] - * - * @param {String|Array} langs... - * @return {Array|String} - * @public - */ - -Accepts.prototype.lang = -Accepts.prototype.langs = -Accepts.prototype.language = -Accepts.prototype.languages = function (languages_) { - var languages = languages_ - - // support flattened arguments - if (languages && !Array.isArray(languages)) { - languages = new Array(arguments.length) - for (var i = 0; i < languages.length; i++) { - languages[i] = arguments[i] - } - } - - // no languages, return all requested languages - if (!languages || languages.length === 0) { - return this.negotiator.languages() - } - - return this.negotiator.languages(languages)[0] || false -} - -/** - * Convert extnames to mime. - * - * @param {String} type - * @return {String} - * @private - */ - -function extToMime (type) { - return type.indexOf('/') === -1 - ? mime.lookup(type) - : type -} - -/** - * Check if mime is valid. - * - * @param {String} type - * @return {String} - * @private - */ - -function validMime (type) { - return typeof type === 'string' -} diff --git a/server/node_modules/accepts/package.json b/server/node_modules/accepts/package.json deleted file mode 100644 index 0f2d15d..0000000 --- a/server/node_modules/accepts/package.json +++ /dev/null @@ -1,47 +0,0 @@ -{ - "name": "accepts", - "description": "Higher-level content negotiation", - "version": "1.3.8", - "contributors": [ - "Douglas Christopher Wilson ", - "Jonathan Ong (http://jongleberry.com)" - ], - "license": "MIT", - "repository": "jshttp/accepts", - "dependencies": { - "mime-types": "~2.1.34", - "negotiator": "0.6.3" - }, - "devDependencies": { - "deep-equal": "1.0.1", - "eslint": "7.32.0", - "eslint-config-standard": "14.1.1", - "eslint-plugin-import": "2.25.4", - "eslint-plugin-markdown": "2.2.1", - "eslint-plugin-node": "11.1.0", - "eslint-plugin-promise": "4.3.1", - "eslint-plugin-standard": "4.1.0", - "mocha": "9.2.0", - "nyc": "15.1.0" - }, - "files": [ - "LICENSE", - "HISTORY.md", - "index.js" - ], - "engines": { - "node": ">= 0.6" - }, - "scripts": { - "lint": "eslint .", - "test": "mocha --reporter spec --check-leaks --bail test/", - "test-ci": "nyc --reporter=lcov --reporter=text npm test", - "test-cov": "nyc --reporter=html --reporter=text npm test" - }, - "keywords": [ - "content", - "negotiation", - "accept", - "accepts" - ] -} diff --git a/server/node_modules/agent-base/README.md b/server/node_modules/agent-base/README.md deleted file mode 100644 index 256f1f3..0000000 --- a/server/node_modules/agent-base/README.md +++ /dev/null @@ -1,145 +0,0 @@ -agent-base -========== -### Turn a function into an [`http.Agent`][http.Agent] instance -[![Build Status](https://github.com/TooTallNate/node-agent-base/workflows/Node%20CI/badge.svg)](https://github.com/TooTallNate/node-agent-base/actions?workflow=Node+CI) - -This module provides an `http.Agent` generator. That is, you pass it an async -callback function, and it returns a new `http.Agent` instance that will invoke the -given callback function when sending outbound HTTP requests. - -#### Some subclasses: - -Here's some more interesting uses of `agent-base`. -Send a pull request to list yours! - - * [`http-proxy-agent`][http-proxy-agent]: An HTTP(s) proxy `http.Agent` implementation for HTTP endpoints - * [`https-proxy-agent`][https-proxy-agent]: An HTTP(s) proxy `http.Agent` implementation for HTTPS endpoints - * [`pac-proxy-agent`][pac-proxy-agent]: A PAC file proxy `http.Agent` implementation for HTTP and HTTPS - * [`socks-proxy-agent`][socks-proxy-agent]: A SOCKS proxy `http.Agent` implementation for HTTP and HTTPS - - -Installation ------------- - -Install with `npm`: - -``` bash -$ npm install agent-base -``` - - -Example -------- - -Here's a minimal example that creates a new `net.Socket` connection to the server -for every HTTP request (i.e. the equivalent of `agent: false` option): - -```js -var net = require('net'); -var tls = require('tls'); -var url = require('url'); -var http = require('http'); -var agent = require('agent-base'); - -var endpoint = 'http://nodejs.org/api/'; -var parsed = url.parse(endpoint); - -// This is the important part! -parsed.agent = agent(function (req, opts) { - var socket; - // `secureEndpoint` is true when using the https module - if (opts.secureEndpoint) { - socket = tls.connect(opts); - } else { - socket = net.connect(opts); - } - return socket; -}); - -// Everything else works just like normal... -http.get(parsed, function (res) { - console.log('"response" event!', res.headers); - res.pipe(process.stdout); -}); -``` - -Returning a Promise or using an `async` function is also supported: - -```js -agent(async function (req, opts) { - await sleep(1000); - // etc… -}); -``` - -Return another `http.Agent` instance to "pass through" the responsibility -for that HTTP request to that agent: - -```js -agent(function (req, opts) { - return opts.secureEndpoint ? https.globalAgent : http.globalAgent; -}); -``` - - -API ---- - -## Agent(Function callback[, Object options]) → [http.Agent][] - -Creates a base `http.Agent` that will execute the callback function `callback` -for every HTTP request that it is used as the `agent` for. The callback function -is responsible for creating a `stream.Duplex` instance of some kind that will be -used as the underlying socket in the HTTP request. - -The `options` object accepts the following properties: - - * `timeout` - Number - Timeout for the `callback()` function in milliseconds. Defaults to Infinity (optional). - -The callback function should have the following signature: - -### callback(http.ClientRequest req, Object options, Function cb) → undefined - -The ClientRequest `req` can be accessed to read request headers and -and the path, etc. The `options` object contains the options passed -to the `http.request()`/`https.request()` function call, and is formatted -to be directly passed to `net.connect()`/`tls.connect()`, or however -else you want a Socket to be created. Pass the created socket to -the callback function `cb` once created, and the HTTP request will -continue to proceed. - -If the `https` module is used to invoke the HTTP request, then the -`secureEndpoint` property on `options` _will be set to `true`_. - - -License -------- - -(The MIT License) - -Copyright (c) 2013 Nathan Rajlich <nathan@tootallnate.net> - -Permission is hereby granted, free of charge, to any person obtaining -a copy of this software and associated documentation files (the -'Software'), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sublicense, and/or sell copies of the Software, and to -permit persons to whom the Software is furnished to do so, subject to -the following conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, -TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE -SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -[http-proxy-agent]: https://github.com/TooTallNate/node-http-proxy-agent -[https-proxy-agent]: https://github.com/TooTallNate/node-https-proxy-agent -[pac-proxy-agent]: https://github.com/TooTallNate/node-pac-proxy-agent -[socks-proxy-agent]: https://github.com/TooTallNate/node-socks-proxy-agent -[http.Agent]: https://nodejs.org/api/http.html#http_class_http_agent diff --git a/server/node_modules/agent-base/dist/src/index.d.ts b/server/node_modules/agent-base/dist/src/index.d.ts deleted file mode 100644 index bc4ab74..0000000 --- a/server/node_modules/agent-base/dist/src/index.d.ts +++ /dev/null @@ -1,78 +0,0 @@ -/// -import net from 'net'; -import http from 'http'; -import https from 'https'; -import { Duplex } from 'stream'; -import { EventEmitter } from 'events'; -declare function createAgent(opts?: createAgent.AgentOptions): createAgent.Agent; -declare function createAgent(callback: createAgent.AgentCallback, opts?: createAgent.AgentOptions): createAgent.Agent; -declare namespace createAgent { - interface ClientRequest extends http.ClientRequest { - _last?: boolean; - _hadError?: boolean; - method: string; - } - interface AgentRequestOptions { - host?: string; - path?: string; - port: number; - } - interface HttpRequestOptions extends AgentRequestOptions, Omit { - secureEndpoint: false; - } - interface HttpsRequestOptions extends AgentRequestOptions, Omit { - secureEndpoint: true; - } - type RequestOptions = HttpRequestOptions | HttpsRequestOptions; - type AgentLike = Pick | http.Agent; - type AgentCallbackReturn = Duplex | AgentLike; - type AgentCallbackCallback = (err?: Error | null, socket?: createAgent.AgentCallbackReturn) => void; - type AgentCallbackPromise = (req: createAgent.ClientRequest, opts: createAgent.RequestOptions) => createAgent.AgentCallbackReturn | Promise; - type AgentCallback = typeof Agent.prototype.callback; - type AgentOptions = { - timeout?: number; - }; - /** - * Base `http.Agent` implementation. - * No pooling/keep-alive is implemented by default. - * - * @param {Function} callback - * @api public - */ - class Agent extends EventEmitter { - timeout: number | null; - maxFreeSockets: number; - maxTotalSockets: number; - maxSockets: number; - sockets: { - [key: string]: net.Socket[]; - }; - freeSockets: { - [key: string]: net.Socket[]; - }; - requests: { - [key: string]: http.IncomingMessage[]; - }; - options: https.AgentOptions; - private promisifiedCallback?; - private explicitDefaultPort?; - private explicitProtocol?; - constructor(callback?: createAgent.AgentCallback | createAgent.AgentOptions, _opts?: createAgent.AgentOptions); - get defaultPort(): number; - set defaultPort(v: number); - get protocol(): string; - set protocol(v: string); - callback(req: createAgent.ClientRequest, opts: createAgent.RequestOptions, fn: createAgent.AgentCallbackCallback): void; - callback(req: createAgent.ClientRequest, opts: createAgent.RequestOptions): createAgent.AgentCallbackReturn | Promise; - /** - * Called by node-core's "_http_client.js" module when creating - * a new HTTP request with this Agent instance. - * - * @api public - */ - addRequest(req: ClientRequest, _opts: RequestOptions): void; - freeSocket(socket: net.Socket, opts: AgentOptions): void; - destroy(): void; - } -} -export = createAgent; diff --git a/server/node_modules/agent-base/dist/src/index.js b/server/node_modules/agent-base/dist/src/index.js deleted file mode 100644 index bfd9e22..0000000 --- a/server/node_modules/agent-base/dist/src/index.js +++ /dev/null @@ -1,203 +0,0 @@ -"use strict"; -var __importDefault = (this && this.__importDefault) || function (mod) { - return (mod && mod.__esModule) ? mod : { "default": mod }; -}; -const events_1 = require("events"); -const debug_1 = __importDefault(require("debug")); -const promisify_1 = __importDefault(require("./promisify")); -const debug = debug_1.default('agent-base'); -function isAgent(v) { - return Boolean(v) && typeof v.addRequest === 'function'; -} -function isSecureEndpoint() { - const { stack } = new Error(); - if (typeof stack !== 'string') - return false; - return stack.split('\n').some(l => l.indexOf('(https.js:') !== -1 || l.indexOf('node:https:') !== -1); -} -function createAgent(callback, opts) { - return new createAgent.Agent(callback, opts); -} -(function (createAgent) { - /** - * Base `http.Agent` implementation. - * No pooling/keep-alive is implemented by default. - * - * @param {Function} callback - * @api public - */ - class Agent extends events_1.EventEmitter { - constructor(callback, _opts) { - super(); - let opts = _opts; - if (typeof callback === 'function') { - this.callback = callback; - } - else if (callback) { - opts = callback; - } - // Timeout for the socket to be returned from the callback - this.timeout = null; - if (opts && typeof opts.timeout === 'number') { - this.timeout = opts.timeout; - } - // These aren't actually used by `agent-base`, but are required - // for the TypeScript definition files in `@types/node` :/ - this.maxFreeSockets = 1; - this.maxSockets = 1; - this.maxTotalSockets = Infinity; - this.sockets = {}; - this.freeSockets = {}; - this.requests = {}; - this.options = {}; - } - get defaultPort() { - if (typeof this.explicitDefaultPort === 'number') { - return this.explicitDefaultPort; - } - return isSecureEndpoint() ? 443 : 80; - } - set defaultPort(v) { - this.explicitDefaultPort = v; - } - get protocol() { - if (typeof this.explicitProtocol === 'string') { - return this.explicitProtocol; - } - return isSecureEndpoint() ? 'https:' : 'http:'; - } - set protocol(v) { - this.explicitProtocol = v; - } - callback(req, opts, fn) { - throw new Error('"agent-base" has no default implementation, you must subclass and override `callback()`'); - } - /** - * Called by node-core's "_http_client.js" module when creating - * a new HTTP request with this Agent instance. - * - * @api public - */ - addRequest(req, _opts) { - const opts = Object.assign({}, _opts); - if (typeof opts.secureEndpoint !== 'boolean') { - opts.secureEndpoint = isSecureEndpoint(); - } - if (opts.host == null) { - opts.host = 'localhost'; - } - if (opts.port == null) { - opts.port = opts.secureEndpoint ? 443 : 80; - } - if (opts.protocol == null) { - opts.protocol = opts.secureEndpoint ? 'https:' : 'http:'; - } - if (opts.host && opts.path) { - // If both a `host` and `path` are specified then it's most - // likely the result of a `url.parse()` call... we need to - // remove the `path` portion so that `net.connect()` doesn't - // attempt to open that as a unix socket file. - delete opts.path; - } - delete opts.agent; - delete opts.hostname; - delete opts._defaultAgent; - delete opts.defaultPort; - delete opts.createConnection; - // Hint to use "Connection: close" - // XXX: non-documented `http` module API :( - req._last = true; - req.shouldKeepAlive = false; - let timedOut = false; - let timeoutId = null; - const timeoutMs = opts.timeout || this.timeout; - const onerror = (err) => { - if (req._hadError) - return; - req.emit('error', err); - // For Safety. Some additional errors might fire later on - // and we need to make sure we don't double-fire the error event. - req._hadError = true; - }; - const ontimeout = () => { - timeoutId = null; - timedOut = true; - const err = new Error(`A "socket" was not created for HTTP request before ${timeoutMs}ms`); - err.code = 'ETIMEOUT'; - onerror(err); - }; - const callbackError = (err) => { - if (timedOut) - return; - if (timeoutId !== null) { - clearTimeout(timeoutId); - timeoutId = null; - } - onerror(err); - }; - const onsocket = (socket) => { - if (timedOut) - return; - if (timeoutId != null) { - clearTimeout(timeoutId); - timeoutId = null; - } - if (isAgent(socket)) { - // `socket` is actually an `http.Agent` instance, so - // relinquish responsibility for this `req` to the Agent - // from here on - debug('Callback returned another Agent instance %o', socket.constructor.name); - socket.addRequest(req, opts); - return; - } - if (socket) { - socket.once('free', () => { - this.freeSocket(socket, opts); - }); - req.onSocket(socket); - return; - } - const err = new Error(`no Duplex stream was returned to agent-base for \`${req.method} ${req.path}\``); - onerror(err); - }; - if (typeof this.callback !== 'function') { - onerror(new Error('`callback` is not defined')); - return; - } - if (!this.promisifiedCallback) { - if (this.callback.length >= 3) { - debug('Converting legacy callback function to promise'); - this.promisifiedCallback = promisify_1.default(this.callback); - } - else { - this.promisifiedCallback = this.callback; - } - } - if (typeof timeoutMs === 'number' && timeoutMs > 0) { - timeoutId = setTimeout(ontimeout, timeoutMs); - } - if ('port' in opts && typeof opts.port !== 'number') { - opts.port = Number(opts.port); - } - try { - debug('Resolving socket for %o request: %o', opts.protocol, `${req.method} ${req.path}`); - Promise.resolve(this.promisifiedCallback(req, opts)).then(onsocket, callbackError); - } - catch (err) { - Promise.reject(err).catch(callbackError); - } - } - freeSocket(socket, opts) { - debug('Freeing socket %o %o', socket.constructor.name, opts); - socket.destroy(); - } - destroy() { - debug('Destroying agent %o', this.constructor.name); - } - } - createAgent.Agent = Agent; - // So that `instanceof` works correctly - createAgent.prototype = createAgent.Agent.prototype; -})(createAgent || (createAgent = {})); -module.exports = createAgent; -//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/server/node_modules/agent-base/dist/src/index.js.map b/server/node_modules/agent-base/dist/src/index.js.map deleted file mode 100644 index bd118ab..0000000 --- a/server/node_modules/agent-base/dist/src/index.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;;AAIA,mCAAsC;AACtC,kDAAgC;AAChC,4DAAoC;AAEpC,MAAM,KAAK,GAAG,eAAW,CAAC,YAAY,CAAC,CAAC;AAExC,SAAS,OAAO,CAAC,CAAM;IACtB,OAAO,OAAO,CAAC,CAAC,CAAC,IAAI,OAAO,CAAC,CAAC,UAAU,KAAK,UAAU,CAAC;AACzD,CAAC;AAED,SAAS,gBAAgB;IACxB,MAAM,EAAE,KAAK,EAAE,GAAG,IAAI,KAAK,EAAE,CAAC;IAC9B,IAAI,OAAO,KAAK,KAAK,QAAQ;QAAE,OAAO,KAAK,CAAC;IAC5C,OAAO,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC,YAAY,CAAC,KAAK,CAAC,CAAC,IAAK,CAAC,CAAC,OAAO,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;AACxG,CAAC;AAOD,SAAS,WAAW,CAC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base/dist/src/promisify.d.ts b/server/node_modules/agent-base/dist/src/promisify.d.ts deleted file mode 100644 index 0268869..0000000 --- a/server/node_modules/agent-base/dist/src/promisify.d.ts +++ /dev/null @@ -1,4 +0,0 @@ -import { ClientRequest, RequestOptions, AgentCallbackCallback, AgentCallbackPromise } from './index'; -declare type LegacyCallback = (req: ClientRequest, opts: RequestOptions, fn: AgentCallbackCallback) => void; -export default function promisify(fn: LegacyCallback): AgentCallbackPromise; -export {}; diff --git a/server/node_modules/agent-base/dist/src/promisify.js b/server/node_modules/agent-base/dist/src/promisify.js deleted file mode 100644 index b2f6132..0000000 --- a/server/node_modules/agent-base/dist/src/promisify.js +++ /dev/null @@ -1,18 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -function promisify(fn) { - return function (req, opts) { - return new Promise((resolve, reject) => { - fn.call(this, req, opts, (err, rtn) => { - if (err) { - reject(err); - } - else { - resolve(rtn); - } - }); - }); - }; -} -exports.default = promisify; -//# sourceMappingURL=promisify.js.map \ No newline at end of file diff --git a/server/node_modules/agent-base/dist/src/promisify.js.map b/server/node_modules/agent-base/dist/src/promisify.js.map deleted file mode 100644 index 4bff9bf..0000000 --- a/server/node_modules/agent-base/dist/src/promisify.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"promisify.js","sourceRoot":"","sources":["../../src/promisify.ts"],"names":[],"mappings":";;AAeA,SAAwB,SAAS,CAAC,EAAkB;IACnD,OAAO,UAAsB,GAAkB,EAAE,IAAoB;QACpE,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;YACtC,EAAE,CAAC,IAAI,CACN,IAAI,EACJ,GAAG,EACH,IAAI,EACJ,CAAC,GAA6B,EAAE,GAAyB,EAAE,EAAE;gBAC5D,IAAI,GAAG,EAAE;oBACR,MAAM,CAAC,GAAG,CAAC,CAAC;iBACZ;qBAAM;oBACN,OAAO,CAAC,GAAG,CAAC,CAAC;iBACb;YACF,CAAC,CACD,CAAC;QACH,CAAC,CAAC,CAAC;IACJ,CAAC,CAAC;AACH,CAAC;AAjBD,4BAiBC"} \ No newline at end of file diff --git a/server/node_modules/agent-base/node_modules/debug/LICENSE b/server/node_modules/agent-base/node_modules/debug/LICENSE deleted file mode 100644 index 1a9820e..0000000 --- a/server/node_modules/agent-base/node_modules/debug/LICENSE +++ /dev/null @@ -1,20 +0,0 @@ -(The MIT License) - -Copyright (c) 2014-2017 TJ Holowaychuk -Copyright (c) 2018-2021 Josh Junon - -Permission is hereby granted, free of charge, to any person obtaining a copy of this software -and associated documentation files (the 'Software'), to deal in the Software without restriction, -including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, -and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, -subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all copies or substantial -portions of the Software. - -THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT -LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, -WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE -SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - diff --git a/server/node_modules/agent-base/node_modules/debug/README.md b/server/node_modules/agent-base/node_modules/debug/README.md deleted file mode 100644 index 9ebdfbf..0000000 --- a/server/node_modules/agent-base/node_modules/debug/README.md +++ /dev/null @@ -1,481 +0,0 @@ -# debug -[![OpenCollective](https://opencollective.com/debug/backers/badge.svg)](#backers) -[![OpenCollective](https://opencollective.com/debug/sponsors/badge.svg)](#sponsors) - - - -A tiny JavaScript debugging utility modelled after Node.js core's debugging -technique. Works in Node.js and web browsers. - -## Installation - -```bash -$ npm install debug -``` - -## Usage - -`debug` exposes a function; simply pass this function the name of your module, and it will return a decorated version of `console.error` for you to pass debug statements to. This will allow you to toggle the debug output for different parts of your module as well as the module as a whole. - -Example [_app.js_](./examples/node/app.js): - -```js -var debug = require('debug')('http') - , http = require('http') - , name = 'My App'; - -// fake app - -debug('booting %o', name); - -http.createServer(function(req, res){ - debug(req.method + ' ' + req.url); - res.end('hello\n'); -}).listen(3000, function(){ - debug('listening'); -}); - -// fake worker of some kind - -require('./worker'); -``` - -Example [_worker.js_](./examples/node/worker.js): - -```js -var a = require('debug')('worker:a') - , b = require('debug')('worker:b'); - -function work() { - a('doing lots of uninteresting work'); - setTimeout(work, Math.random() * 1000); -} - -work(); - -function workb() { - b('doing some work'); - setTimeout(workb, Math.random() * 2000); -} - -workb(); -``` - -The `DEBUG` environment variable is then used to enable these based on space or -comma-delimited names. - -Here are some examples: - -screen shot 2017-08-08 at 12 53 04 pm -screen shot 2017-08-08 at 12 53 38 pm -screen shot 2017-08-08 at 12 53 25 pm - -#### Windows command prompt notes - -##### CMD - -On Windows the environment variable is set using the `set` command. - -```cmd -set DEBUG=*,-not_this -``` - -Example: - -```cmd -set DEBUG=* & node app.js -``` - -##### PowerShell (VS Code default) - -PowerShell uses different syntax to set environment variables. - -```cmd -$env:DEBUG = "*,-not_this" -``` - -Example: - -```cmd -$env:DEBUG='app';node app.js -``` - -Then, run the program to be debugged as usual. - -npm script example: -```js - "windowsDebug": "@powershell -Command $env:DEBUG='*';node app.js", -``` - -## Namespace Colors - -Every debug instance has a color generated for it based on its namespace name. -This helps when visually parsing the debug output to identify which debug instance -a debug line belongs to. - -#### Node.js - -In Node.js, colors are enabled when stderr is a TTY. You also _should_ install -the [`supports-color`](https://npmjs.org/supports-color) module alongside debug, -otherwise debug will only use a small handful of basic colors. - - - -#### Web Browser - -Colors are also enabled on "Web Inspectors" that understand the `%c` formatting -option. These are WebKit web inspectors, Firefox ([since version -31](https://hacks.mozilla.org/2014/05/editable-box-model-multiple-selection-sublime-text-keys-much-more-firefox-developer-tools-episode-31/)) -and the Firebug plugin for Firefox (any version). - - - - -## Millisecond diff - -When actively developing an application it can be useful to see when the time spent between one `debug()` call and the next. Suppose for example you invoke `debug()` before requesting a resource, and after as well, the "+NNNms" will show you how much time was spent between calls. - - - -When stdout is not a TTY, `Date#toISOString()` is used, making it more useful for logging the debug information as shown below: - - - - -## Conventions - -If you're using this in one or more of your libraries, you _should_ use the name of your library so that developers may toggle debugging as desired without guessing names. If you have more than one debuggers you _should_ prefix them with your library name and use ":" to separate features. For example "bodyParser" from Connect would then be "connect:bodyParser". If you append a "*" to the end of your name, it will always be enabled regardless of the setting of the DEBUG environment variable. You can then use it for normal output as well as debug output. - -## Wildcards - -The `*` character may be used as a wildcard. Suppose for example your library has -debuggers named "connect:bodyParser", "connect:compress", "connect:session", -instead of listing all three with -`DEBUG=connect:bodyParser,connect:compress,connect:session`, you may simply do -`DEBUG=connect:*`, or to run everything using this module simply use `DEBUG=*`. - -You can also exclude specific debuggers by prefixing them with a "-" character. -For example, `DEBUG=*,-connect:*` would include all debuggers except those -starting with "connect:". - -## Environment Variables - -When running through Node.js, you can set a few environment variables that will -change the behavior of the debug logging: - -| Name | Purpose | -|-----------|-------------------------------------------------| -| `DEBUG` | Enables/disables specific debugging namespaces. | -| `DEBUG_HIDE_DATE` | Hide date from debug output (non-TTY). | -| `DEBUG_COLORS`| Whether or not to use colors in the debug output. | -| `DEBUG_DEPTH` | Object inspection depth. | -| `DEBUG_SHOW_HIDDEN` | Shows hidden properties on inspected objects. | - - -__Note:__ The environment variables beginning with `DEBUG_` end up being -converted into an Options object that gets used with `%o`/`%O` formatters. -See the Node.js documentation for -[`util.inspect()`](https://nodejs.org/api/util.html#util_util_inspect_object_options) -for the complete list. - -## Formatters - -Debug uses [printf-style](https://wikipedia.org/wiki/Printf_format_string) formatting. -Below are the officially supported formatters: - -| Formatter | Representation | -|-----------|----------------| -| `%O` | Pretty-print an Object on multiple lines. | -| `%o` | Pretty-print an Object all on a single line. | -| `%s` | String. | -| `%d` | Number (both integer and float). | -| `%j` | JSON. Replaced with the string '[Circular]' if the argument contains circular references. | -| `%%` | Single percent sign ('%'). This does not consume an argument. | - - -### Custom formatters - -You can add custom formatters by extending the `debug.formatters` object. -For example, if you wanted to add support for rendering a Buffer as hex with -`%h`, you could do something like: - -```js -const createDebug = require('debug') -createDebug.formatters.h = (v) => { - return v.toString('hex') -} - -// …elsewhere -const debug = createDebug('foo') -debug('this is hex: %h', new Buffer('hello world')) -// foo this is hex: 68656c6c6f20776f726c6421 +0ms -``` - - -## Browser Support - -You can build a browser-ready script using [browserify](https://github.com/substack/node-browserify), -or just use the [browserify-as-a-service](https://wzrd.in/) [build](https://wzrd.in/standalone/debug@latest), -if you don't want to build it yourself. - -Debug's enable state is currently persisted by `localStorage`. -Consider the situation shown below where you have `worker:a` and `worker:b`, -and wish to debug both. You can enable this using `localStorage.debug`: - -```js -localStorage.debug = 'worker:*' -``` - -And then refresh the page. - -```js -a = debug('worker:a'); -b = debug('worker:b'); - -setInterval(function(){ - a('doing some work'); -}, 1000); - -setInterval(function(){ - b('doing some work'); -}, 1200); -``` - -In Chromium-based web browsers (e.g. Brave, Chrome, and Electron), the JavaScript console will—by default—only show messages logged by `debug` if the "Verbose" log level is _enabled_. - - - -## Output streams - - By default `debug` will log to stderr, however this can be configured per-namespace by overriding the `log` method: - -Example [_stdout.js_](./examples/node/stdout.js): - -```js -var debug = require('debug'); -var error = debug('app:error'); - -// by default stderr is used -error('goes to stderr!'); - -var log = debug('app:log'); -// set this namespace to log via console.log -log.log = console.log.bind(console); // don't forget to bind to console! -log('goes to stdout'); -error('still goes to stderr!'); - -// set all output to go via console.info -// overrides all per-namespace log settings -debug.log = console.info.bind(console); -error('now goes to stdout via console.info'); -log('still goes to stdout, but via console.info now'); -``` - -## Extend -You can simply extend debugger -```js -const log = require('debug')('auth'); - -//creates new debug instance with extended namespace -const logSign = log.extend('sign'); -const logLogin = log.extend('login'); - -log('hello'); // auth hello -logSign('hello'); //auth:sign hello -logLogin('hello'); //auth:login hello -``` - -## Set dynamically - -You can also enable debug dynamically by calling the `enable()` method : - -```js -let debug = require('debug'); - -console.log(1, debug.enabled('test')); - -debug.enable('test'); -console.log(2, debug.enabled('test')); - -debug.disable(); -console.log(3, debug.enabled('test')); - -``` - -print : -``` -1 false -2 true -3 false -``` - -Usage : -`enable(namespaces)` -`namespaces` can include modes separated by a colon and wildcards. - -Note that calling `enable()` completely overrides previously set DEBUG variable : - -``` -$ DEBUG=foo node -e 'var dbg = require("debug"); dbg.enable("bar"); console.log(dbg.enabled("foo"))' -=> false -``` - -`disable()` - -Will disable all namespaces. The functions returns the namespaces currently -enabled (and skipped). This can be useful if you want to disable debugging -temporarily without knowing what was enabled to begin with. - -For example: - -```js -let debug = require('debug'); -debug.enable('foo:*,-foo:bar'); -let namespaces = debug.disable(); -debug.enable(namespaces); -``` - -Note: There is no guarantee that the string will be identical to the initial -enable string, but semantically they will be identical. - -## Checking whether a debug target is enabled - -After you've created a debug instance, you can determine whether or not it is -enabled by checking the `enabled` property: - -```javascript -const debug = require('debug')('http'); - -if (debug.enabled) { - // do stuff... -} -``` - -You can also manually toggle this property to force the debug instance to be -enabled or disabled. - -## Usage in child processes - -Due to the way `debug` detects if the output is a TTY or not, colors are not shown in child processes when `stderr` is piped. A solution is to pass the `DEBUG_COLORS=1` environment variable to the child process. -For example: - -```javascript -worker = fork(WORKER_WRAP_PATH, [workerPath], { - stdio: [ - /* stdin: */ 0, - /* stdout: */ 'pipe', - /* stderr: */ 'pipe', - 'ipc', - ], - env: Object.assign({}, process.env, { - DEBUG_COLORS: 1 // without this settings, colors won't be shown - }), -}); - -worker.stderr.pipe(process.stderr, { end: false }); -``` - - -## Authors - - - TJ Holowaychuk - - Nathan Rajlich - - Andrew Rhyne - - Josh Junon - -## Backers - -Support us with a monthly donation and help us continue our activities. [[Become a backer](https://opencollective.com/debug#backer)] - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -## Sponsors - -Become a sponsor and get your logo on our README on Github with a link to your site. [[Become a sponsor](https://opencollective.com/debug#sponsor)] - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -## License - -(The MIT License) - -Copyright (c) 2014-2017 TJ Holowaychuk <tj@vision-media.ca> -Copyright (c) 2018-2021 Josh Junon - -Permission is hereby granted, free of charge, to any person obtaining -a copy of this software and associated documentation files (the -'Software'), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sublicense, and/or sell copies of the Software, and to -permit persons to whom the Software is furnished to do so, subject to -the following conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, -TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE -SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/server/node_modules/agent-base/node_modules/debug/package.json b/server/node_modules/agent-base/node_modules/debug/package.json deleted file mode 100644 index ee8abb5..0000000 --- a/server/node_modules/agent-base/node_modules/debug/package.json +++ /dev/null @@ -1,64 +0,0 @@ -{ - "name": "debug", - "version": "4.4.3", - "repository": { - "type": "git", - "url": "git://github.com/debug-js/debug.git" - }, - "description": "Lightweight debugging utility for Node.js and the browser", - "keywords": [ - "debug", - "log", - "debugger" - ], - "files": [ - "src", - "LICENSE", - "README.md" - ], - "author": "Josh Junon (https://github.com/qix-)", - "contributors": [ - "TJ Holowaychuk ", - "Nathan Rajlich (http://n8.io)", - "Andrew Rhyne " - ], - "license": "MIT", - "scripts": { - "lint": "xo", - "test": "npm run test:node && npm run test:browser && npm run lint", - "test:node": "mocha test.js test.node.js", - "test:browser": "karma start --single-run", - "test:coverage": "cat ./coverage/lcov.info | coveralls" - }, - "dependencies": { - "ms": "^2.1.3" - }, - "devDependencies": { - "brfs": "^2.0.1", - "browserify": "^16.2.3", - "coveralls": "^3.0.2", - "karma": "^3.1.4", - "karma-browserify": "^6.0.0", - "karma-chrome-launcher": "^2.2.0", - "karma-mocha": "^1.3.0", - "mocha": "^5.2.0", - "mocha-lcov-reporter": "^1.2.0", - "sinon": "^14.0.0", - "xo": "^0.23.0" - }, - "peerDependenciesMeta": { - "supports-color": { - "optional": true - } - }, - "main": "./src/index.js", - "browser": "./src/browser.js", - "engines": { - "node": ">=6.0" - }, - "xo": { - "rules": { - "import/extensions": "off" - } - } -} diff --git a/server/node_modules/agent-base/node_modules/debug/src/browser.js b/server/node_modules/agent-base/node_modules/debug/src/browser.js deleted file mode 100644 index 5993451..0000000 --- a/server/node_modules/agent-base/node_modules/debug/src/browser.js +++ /dev/null @@ -1,272 +0,0 @@ -/* eslint-env browser */ - -/** - * This is the web browser implementation of `debug()`. - */ - -exports.formatArgs = formatArgs; -exports.save = save; -exports.load = load; -exports.useColors = useColors; -exports.storage = localstorage(); -exports.destroy = (() => { - let warned = false; - - return () => { - if (!warned) { - warned = true; - console.warn('Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.'); - } - }; -})(); - -/** - * Colors. - */ - -exports.colors = [ - '#0000CC', - '#0000FF', - '#0033CC', - '#0033FF', - '#0066CC', - '#0066FF', - '#0099CC', - '#0099FF', - '#00CC00', - '#00CC33', - '#00CC66', - '#00CC99', - '#00CCCC', - '#00CCFF', - '#3300CC', - '#3300FF', - '#3333CC', - '#3333FF', - '#3366CC', - '#3366FF', - '#3399CC', - '#3399FF', - '#33CC00', - '#33CC33', - '#33CC66', - '#33CC99', - '#33CCCC', - '#33CCFF', - '#6600CC', - '#6600FF', - '#6633CC', - '#6633FF', - '#66CC00', - '#66CC33', - '#9900CC', - '#9900FF', - '#9933CC', - '#9933FF', - '#99CC00', - '#99CC33', - '#CC0000', - '#CC0033', - '#CC0066', - '#CC0099', - '#CC00CC', - '#CC00FF', - '#CC3300', - '#CC3333', - '#CC3366', - '#CC3399', - '#CC33CC', - '#CC33FF', - '#CC6600', - '#CC6633', - '#CC9900', - '#CC9933', - '#CCCC00', - '#CCCC33', - '#FF0000', - '#FF0033', - '#FF0066', - '#FF0099', - '#FF00CC', - '#FF00FF', - '#FF3300', - '#FF3333', - '#FF3366', - '#FF3399', - '#FF33CC', - '#FF33FF', - '#FF6600', - '#FF6633', - '#FF9900', - '#FF9933', - '#FFCC00', - '#FFCC33' -]; - -/** - * Currently only WebKit-based Web Inspectors, Firefox >= v31, - * and the Firebug extension (any Firefox version) are known - * to support "%c" CSS customizations. - * - * TODO: add a `localStorage` variable to explicitly enable/disable colors - */ - -// eslint-disable-next-line complexity -function useColors() { - // NB: In an Electron preload script, document will be defined but not fully - // initialized. Since we know we're in Chrome, we'll just detect this case - // explicitly - if (typeof window !== 'undefined' && window.process && (window.process.type === 'renderer' || window.process.__nwjs)) { - return true; - } - - // Internet Explorer and Edge do not support colors. - if (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)) { - return false; - } - - let m; - - // Is webkit? http://stackoverflow.com/a/16459606/376773 - // document is undefined in react-native: https://github.com/facebook/react-native/pull/1632 - // eslint-disable-next-line no-return-assign - return (typeof document !== 'undefined' && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance) || - // Is firebug? http://stackoverflow.com/a/398120/376773 - (typeof window !== 'undefined' && window.console && (window.console.firebug || (window.console.exception && window.console.table))) || - // Is firefox >= v31? - // https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages - (typeof navigator !== 'undefined' && navigator.userAgent && (m = navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)) && parseInt(m[1], 10) >= 31) || - // Double check webkit in userAgent just in case we are in a worker - (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)); -} - -/** - * Colorize log arguments if enabled. - * - * @api public - */ - -function formatArgs(args) { - args[0] = (this.useColors ? '%c' : '') + - this.namespace + - (this.useColors ? ' %c' : ' ') + - args[0] + - (this.useColors ? '%c ' : ' ') + - '+' + module.exports.humanize(this.diff); - - if (!this.useColors) { - return; - } - - const c = 'color: ' + this.color; - args.splice(1, 0, c, 'color: inherit'); - - // The final "%c" is somewhat tricky, because there could be other - // arguments passed either before or after the %c, so we need to - // figure out the correct index to insert the CSS into - let index = 0; - let lastC = 0; - args[0].replace(/%[a-zA-Z%]/g, match => { - if (match === '%%') { - return; - } - index++; - if (match === '%c') { - // We only are interested in the *last* %c - // (the user may have provided their own) - lastC = index; - } - }); - - args.splice(lastC, 0, c); -} - -/** - * Invokes `console.debug()` when available. - * No-op when `console.debug` is not a "function". - * If `console.debug` is not available, falls back - * to `console.log`. - * - * @api public - */ -exports.log = console.debug || console.log || (() => {}); - -/** - * Save `namespaces`. - * - * @param {String} namespaces - * @api private - */ -function save(namespaces) { - try { - if (namespaces) { - exports.storage.setItem('debug', namespaces); - } else { - exports.storage.removeItem('debug'); - } - } catch (error) { - // Swallow - // XXX (@Qix-) should we be logging these? - } -} - -/** - * Load `namespaces`. - * - * @return {String} returns the previously persisted debug modes - * @api private - */ -function load() { - let r; - try { - r = exports.storage.getItem('debug') || exports.storage.getItem('DEBUG') ; - } catch (error) { - // Swallow - // XXX (@Qix-) should we be logging these? - } - - // If debug isn't set in LS, and we're in Electron, try to load $DEBUG - if (!r && typeof process !== 'undefined' && 'env' in process) { - r = process.env.DEBUG; - } - - return r; -} - -/** - * Localstorage attempts to return the localstorage. - * - * This is necessary because safari throws - * when a user disables cookies/localstorage - * and you attempt to access it. - * - * @return {LocalStorage} - * @api private - */ - -function localstorage() { - try { - // TVMLKit (Apple TV JS Runtime) does not have a window object, just localStorage in the global context - // The Browser also has localStorage in the global context. - return localStorage; - } catch (error) { - // Swallow - // XXX (@Qix-) should we be logging these? - } -} - -module.exports = require('./common')(exports); - -const {formatters} = module.exports; - -/** - * Map %j to `JSON.stringify()`, since no Web Inspectors do that by default. - */ - -formatters.j = function (v) { - try { - return JSON.stringify(v); - } catch (error) { - return '[UnexpectedJSONParseError]: ' + error.message; - } -}; diff --git a/server/node_modules/agent-base/node_modules/debug/src/common.js b/server/node_modules/agent-base/node_modules/debug/src/common.js deleted file mode 100644 index 141cb57..0000000 --- a/server/node_modules/agent-base/node_modules/debug/src/common.js +++ /dev/null @@ -1,292 +0,0 @@ - -/** - * This is the common logic for both the Node.js and web browser - * implementations of `debug()`. - */ - -function setup(env) { - createDebug.debug = createDebug; - createDebug.default = createDebug; - createDebug.coerce = coerce; - createDebug.disable = disable; - createDebug.enable = enable; - createDebug.enabled = enabled; - createDebug.humanize = require('ms'); - createDebug.destroy = destroy; - - Object.keys(env).forEach(key => { - createDebug[key] = env[key]; - }); - - /** - * The currently active debug mode names, and names to skip. - */ - - createDebug.names = []; - createDebug.skips = []; - - /** - * Map of special "%n" handling functions, for the debug "format" argument. - * - * Valid key names are a single, lower or upper-case letter, i.e. "n" and "N". - */ - createDebug.formatters = {}; - - /** - * Selects a color for a debug namespace - * @param {String} namespace The namespace string for the debug instance to be colored - * @return {Number|String} An ANSI color code for the given namespace - * @api private - */ - function selectColor(namespace) { - let hash = 0; - - for (let i = 0; i < namespace.length; i++) { - hash = ((hash << 5) - hash) + namespace.charCodeAt(i); - hash |= 0; // Convert to 32bit integer - } - - return createDebug.colors[Math.abs(hash) % createDebug.colors.length]; - } - createDebug.selectColor = selectColor; - - /** - * Create a debugger with the given `namespace`. - * - * @param {String} namespace - * @return {Function} - * @api public - */ - function createDebug(namespace) { - let prevTime; - let enableOverride = null; - let namespacesCache; - let enabledCache; - - function debug(...args) { - // Disabled? - if (!debug.enabled) { - return; - } - - const self = debug; - - // Set `diff` timestamp - const curr = Number(new Date()); - const ms = curr - (prevTime || curr); - self.diff = ms; - self.prev = prevTime; - self.curr = curr; - prevTime = curr; - - args[0] = createDebug.coerce(args[0]); - - if (typeof args[0] !== 'string') { - // Anything else let's inspect with %O - args.unshift('%O'); - } - - // Apply any `formatters` transformations - let index = 0; - args[0] = args[0].replace(/%([a-zA-Z%])/g, (match, format) => { - // If we encounter an escaped % then don't increase the array index - if (match === '%%') { - return '%'; - } - index++; - const formatter = createDebug.formatters[format]; - if (typeof formatter === 'function') { - const val = args[index]; - match = formatter.call(self, val); - - // Now we need to remove `args[index]` since it's inlined in the `format` - args.splice(index, 1); - index--; - } - return match; - }); - - // Apply env-specific formatting (colors, etc.) - createDebug.formatArgs.call(self, args); - - const logFn = self.log || createDebug.log; - logFn.apply(self, args); - } - - debug.namespace = namespace; - debug.useColors = createDebug.useColors(); - debug.color = createDebug.selectColor(namespace); - debug.extend = extend; - debug.destroy = createDebug.destroy; // XXX Temporary. Will be removed in the next major release. - - Object.defineProperty(debug, 'enabled', { - enumerable: true, - configurable: false, - get: () => { - if (enableOverride !== null) { - return enableOverride; - } - if (namespacesCache !== createDebug.namespaces) { - namespacesCache = createDebug.namespaces; - enabledCache = createDebug.enabled(namespace); - } - - return enabledCache; - }, - set: v => { - enableOverride = v; - } - }); - - // Env-specific initialization logic for debug instances - if (typeof createDebug.init === 'function') { - createDebug.init(debug); - } - - return debug; - } - - function extend(namespace, delimiter) { - const newDebug = createDebug(this.namespace + (typeof delimiter === 'undefined' ? ':' : delimiter) + namespace); - newDebug.log = this.log; - return newDebug; - } - - /** - * Enables a debug mode by namespaces. This can include modes - * separated by a colon and wildcards. - * - * @param {String} namespaces - * @api public - */ - function enable(namespaces) { - createDebug.save(namespaces); - createDebug.namespaces = namespaces; - - createDebug.names = []; - createDebug.skips = []; - - const split = (typeof namespaces === 'string' ? namespaces : '') - .trim() - .replace(/\s+/g, ',') - .split(',') - .filter(Boolean); - - for (const ns of split) { - if (ns[0] === '-') { - createDebug.skips.push(ns.slice(1)); - } else { - createDebug.names.push(ns); - } - } - } - - /** - * Checks if the given string matches a namespace template, honoring - * asterisks as wildcards. - * - * @param {String} search - * @param {String} template - * @return {Boolean} - */ - function matchesTemplate(search, template) { - let searchIndex = 0; - let templateIndex = 0; - let starIndex = -1; - let matchIndex = 0; - - while (searchIndex < search.length) { - if (templateIndex < template.length && (template[templateIndex] === search[searchIndex] || template[templateIndex] === '*')) { - // Match character or proceed with wildcard - if (template[templateIndex] === '*') { - starIndex = templateIndex; - matchIndex = searchIndex; - templateIndex++; // Skip the '*' - } else { - searchIndex++; - templateIndex++; - } - } else if (starIndex !== -1) { // eslint-disable-line no-negated-condition - // Backtrack to the last '*' and try to match more characters - templateIndex = starIndex + 1; - matchIndex++; - searchIndex = matchIndex; - } else { - return false; // No match - } - } - - // Handle trailing '*' in template - while (templateIndex < template.length && template[templateIndex] === '*') { - templateIndex++; - } - - return templateIndex === template.length; - } - - /** - * Disable debug output. - * - * @return {String} namespaces - * @api public - */ - function disable() { - const namespaces = [ - ...createDebug.names, - ...createDebug.skips.map(namespace => '-' + namespace) - ].join(','); - createDebug.enable(''); - return namespaces; - } - - /** - * Returns true if the given mode name is enabled, false otherwise. - * - * @param {String} name - * @return {Boolean} - * @api public - */ - function enabled(name) { - for (const skip of createDebug.skips) { - if (matchesTemplate(name, skip)) { - return false; - } - } - - for (const ns of createDebug.names) { - if (matchesTemplate(name, ns)) { - return true; - } - } - - return false; - } - - /** - * Coerce `val`. - * - * @param {Mixed} val - * @return {Mixed} - * @api private - */ - function coerce(val) { - if (val instanceof Error) { - return val.stack || val.message; - } - return val; - } - - /** - * XXX DO NOT USE. This is a temporary stub function. - * XXX It WILL be removed in the next major release. - */ - function destroy() { - console.warn('Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.'); - } - - createDebug.enable(createDebug.load()); - - return createDebug; -} - -module.exports = setup; diff --git a/server/node_modules/agent-base/node_modules/debug/src/index.js b/server/node_modules/agent-base/node_modules/debug/src/index.js deleted file mode 100644 index bf4c57f..0000000 --- a/server/node_modules/agent-base/node_modules/debug/src/index.js +++ /dev/null @@ -1,10 +0,0 @@ -/** - * Detect Electron renderer / nwjs process, which is node, but we should - * treat as a browser. - */ - -if (typeof process === 'undefined' || process.type === 'renderer' || process.browser === true || process.__nwjs) { - module.exports = require('./browser.js'); -} else { - module.exports = require('./node.js'); -} diff --git a/server/node_modules/agent-base/node_modules/debug/src/node.js b/server/node_modules/agent-base/node_modules/debug/src/node.js deleted file mode 100644 index 715560a..0000000 --- a/server/node_modules/agent-base/node_modules/debug/src/node.js +++ /dev/null @@ -1,263 +0,0 @@ -/** - * Module dependencies. - */ - -const tty = require('tty'); -const util = require('util'); - -/** - * This is the Node.js implementation of `debug()`. - */ - -exports.init = init; -exports.log = log; -exports.formatArgs = formatArgs; -exports.save = save; -exports.load = load; -exports.useColors = useColors; -exports.destroy = util.deprecate( - () => {}, - 'Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.' -); - -/** - * Colors. - */ - -exports.colors = [6, 2, 3, 4, 5, 1]; - -try { - // Optional dependency (as in, doesn't need to be installed, NOT like optionalDependencies in package.json) - // eslint-disable-next-line import/no-extraneous-dependencies - const supportsColor = require('supports-color'); - - if (supportsColor && (supportsColor.stderr || supportsColor).level >= 2) { - exports.colors = [ - 20, - 21, - 26, - 27, - 32, - 33, - 38, - 39, - 40, - 41, - 42, - 43, - 44, - 45, - 56, - 57, - 62, - 63, - 68, - 69, - 74, - 75, - 76, - 77, - 78, - 79, - 80, - 81, - 92, - 93, - 98, - 99, - 112, - 113, - 128, - 129, - 134, - 135, - 148, - 149, - 160, - 161, - 162, - 163, - 164, - 165, - 166, - 167, - 168, - 169, - 170, - 171, - 172, - 173, - 178, - 179, - 184, - 185, - 196, - 197, - 198, - 199, - 200, - 201, - 202, - 203, - 204, - 205, - 206, - 207, - 208, - 209, - 214, - 215, - 220, - 221 - ]; - } -} catch (error) { - // Swallow - we only care if `supports-color` is available; it doesn't have to be. -} - -/** - * Build up the default `inspectOpts` object from the environment variables. - * - * $ DEBUG_COLORS=no DEBUG_DEPTH=10 DEBUG_SHOW_HIDDEN=enabled node script.js - */ - -exports.inspectOpts = Object.keys(process.env).filter(key => { - return /^debug_/i.test(key); -}).reduce((obj, key) => { - // Camel-case - const prop = key - .substring(6) - .toLowerCase() - .replace(/_([a-z])/g, (_, k) => { - return k.toUpperCase(); - }); - - // Coerce string value into JS value - let val = process.env[key]; - if (/^(yes|on|true|enabled)$/i.test(val)) { - val = true; - } else if (/^(no|off|false|disabled)$/i.test(val)) { - val = false; - } else if (val === 'null') { - val = null; - } else { - val = Number(val); - } - - obj[prop] = val; - return obj; -}, {}); - -/** - * Is stdout a TTY? Colored output is enabled when `true`. - */ - -function useColors() { - return 'colors' in exports.inspectOpts ? - Boolean(exports.inspectOpts.colors) : - tty.isatty(process.stderr.fd); -} - -/** - * Adds ANSI color escape codes if enabled. - * - * @api public - */ - -function formatArgs(args) { - const {namespace: name, useColors} = this; - - if (useColors) { - const c = this.color; - const colorCode = '\u001B[3' + (c < 8 ? c : '8;5;' + c); - const prefix = ` ${colorCode};1m${name} \u001B[0m`; - - args[0] = prefix + args[0].split('\n').join('\n' + prefix); - args.push(colorCode + 'm+' + module.exports.humanize(this.diff) + '\u001B[0m'); - } else { - args[0] = getDate() + name + ' ' + args[0]; - } -} - -function getDate() { - if (exports.inspectOpts.hideDate) { - return ''; - } - return new Date().toISOString() + ' '; -} - -/** - * Invokes `util.formatWithOptions()` with the specified arguments and writes to stderr. - */ - -function log(...args) { - return process.stderr.write(util.formatWithOptions(exports.inspectOpts, ...args) + '\n'); -} - -/** - * Save `namespaces`. - * - * @param {String} namespaces - * @api private - */ -function save(namespaces) { - if (namespaces) { - process.env.DEBUG = namespaces; - } else { - // If you set a process.env field to null or undefined, it gets cast to the - // string 'null' or 'undefined'. Just delete instead. - delete process.env.DEBUG; - } -} - -/** - * Load `namespaces`. - * - * @return {String} returns the previously persisted debug modes - * @api private - */ - -function load() { - return process.env.DEBUG; -} - -/** - * Init logic for `debug` instances. - * - * Create a new `inspectOpts` object in case `useColors` is set - * differently for a particular `debug` instance. - */ - -function init(debug) { - debug.inspectOpts = {}; - - const keys = Object.keys(exports.inspectOpts); - for (let i = 0; i < keys.length; i++) { - debug.inspectOpts[keys[i]] = exports.inspectOpts[keys[i]]; - } -} - -module.exports = require('./common')(exports); - -const {formatters} = module.exports; - -/** - * Map %o to `util.inspect()`, all on a single line. - */ - -formatters.o = function (v) { - this.inspectOpts.colors = this.useColors; - return util.inspect(v, this.inspectOpts) - .split('\n') - .map(str => str.trim()) - .join(' '); -}; - -/** - * Map %O to `util.inspect()`, allowing multiple lines if needed. - */ - -formatters.O = function (v) { - this.inspectOpts.colors = this.useColors; - return util.inspect(v, this.inspectOpts); -}; diff --git a/server/node_modules/agent-base/node_modules/ms/index.js b/server/node_modules/agent-base/node_modules/ms/index.js deleted file mode 100644 index ea734fb..0000000 --- a/server/node_modules/agent-base/node_modules/ms/index.js +++ /dev/null @@ -1,162 +0,0 @@ -/** - * Helpers. - */ - -var s = 1000; -var m = s * 60; -var h = m * 60; -var d = h * 24; -var w = d * 7; -var y = d * 365.25; - -/** - * Parse or format the given `val`. - * - * Options: - * - * - `long` verbose formatting [false] - * - * @param {String|Number} val - * @param {Object} [options] - * @throws {Error} throw an error if val is not a non-empty string or a number - * @return {String|Number} - * @api public - */ - -module.exports = function (val, options) { - options = options || {}; - var type = typeof val; - if (type === 'string' && val.length > 0) { - return parse(val); - } else if (type === 'number' && isFinite(val)) { - return options.long ? fmtLong(val) : fmtShort(val); - } - throw new Error( - 'val is not a non-empty string or a valid number. val=' + - JSON.stringify(val) - ); -}; - -/** - * Parse the given `str` and return milliseconds. - * - * @param {String} str - * @return {Number} - * @api private - */ - -function parse(str) { - str = String(str); - if (str.length > 100) { - return; - } - var match = /^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec( - str - ); - if (!match) { - return; - } - var n = parseFloat(match[1]); - var type = (match[2] || 'ms').toLowerCase(); - switch (type) { - case 'years': - case 'year': - case 'yrs': - case 'yr': - case 'y': - return n * y; - case 'weeks': - case 'week': - case 'w': - return n * w; - case 'days': - case 'day': - case 'd': - return n * d; - case 'hours': - case 'hour': - case 'hrs': - case 'hr': - case 'h': - return n * h; - case 'minutes': - case 'minute': - case 'mins': - case 'min': - case 'm': - return n * m; - case 'seconds': - case 'second': - case 'secs': - case 'sec': - case 's': - return n * s; - case 'milliseconds': - case 'millisecond': - case 'msecs': - case 'msec': - case 'ms': - return n; - default: - return undefined; - } -} - -/** - * Short format for `ms`. - * - * @param {Number} ms - * @return {String} - * @api private - */ - -function fmtShort(ms) { - var msAbs = Math.abs(ms); - if (msAbs >= d) { - return Math.round(ms / d) + 'd'; - } - if (msAbs >= h) { - return Math.round(ms / h) + 'h'; - } - if (msAbs >= m) { - return Math.round(ms / m) + 'm'; - } - if (msAbs >= s) { - return Math.round(ms / s) + 's'; - } - return ms + 'ms'; -} - -/** - * Long format for `ms`. - * - * @param {Number} ms - * @return {String} - * @api private - */ - -function fmtLong(ms) { - var msAbs = Math.abs(ms); - if (msAbs >= d) { - return plural(ms, msAbs, d, 'day'); - } - if (msAbs >= h) { - return plural(ms, msAbs, h, 'hour'); - } - if (msAbs >= m) { - return plural(ms, msAbs, m, 'minute'); - } - if (msAbs >= s) { - return plural(ms, msAbs, s, 'second'); - } - return ms + ' ms'; -} - -/** - * Pluralization helper. - */ - -function plural(ms, msAbs, n, name) { - var isPlural = msAbs >= n * 1.5; - return Math.round(ms / n) + ' ' + name + (isPlural ? 's' : ''); -} diff --git a/server/node_modules/agent-base/node_modules/ms/license.md b/server/node_modules/agent-base/node_modules/ms/license.md deleted file mode 100644 index fa5d39b..0000000 --- a/server/node_modules/agent-base/node_modules/ms/license.md +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2020 Vercel, Inc. - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/server/node_modules/agent-base/node_modules/ms/package.json b/server/node_modules/agent-base/node_modules/ms/package.json deleted file mode 100644 index 4997189..0000000 --- a/server/node_modules/agent-base/node_modules/ms/package.json +++ /dev/null @@ -1,38 +0,0 @@ -{ - "name": "ms", - "version": "2.1.3", - "description": "Tiny millisecond conversion utility", - "repository": "vercel/ms", - "main": "./index", - "files": [ - "index.js" - ], - "scripts": { - "precommit": "lint-staged", - "lint": "eslint lib/* bin/*", - "test": "mocha tests.js" - }, - "eslintConfig": { - "extends": "eslint:recommended", - "env": { - "node": true, - "es6": true - } - }, - "lint-staged": { - "*.js": [ - "npm run lint", - "prettier --single-quote --write", - "git add" - ] - }, - "license": "MIT", - "devDependencies": { - "eslint": "4.18.2", - "expect.js": "0.3.1", - "husky": "0.14.3", - "lint-staged": "5.0.0", - "mocha": "4.0.1", - "prettier": "2.0.5" - } -} diff --git a/server/node_modules/agent-base/node_modules/ms/readme.md b/server/node_modules/agent-base/node_modules/ms/readme.md deleted file mode 100644 index 0fc1abb..0000000 --- a/server/node_modules/agent-base/node_modules/ms/readme.md +++ /dev/null @@ -1,59 +0,0 @@ -# ms - -![CI](https://github.com/vercel/ms/workflows/CI/badge.svg) - -Use this package to easily convert various time formats to milliseconds. - -## Examples - -```js -ms('2 days') // 172800000 -ms('1d') // 86400000 -ms('10h') // 36000000 -ms('2.5 hrs') // 9000000 -ms('2h') // 7200000 -ms('1m') // 60000 -ms('5s') // 5000 -ms('1y') // 31557600000 -ms('100') // 100 -ms('-3 days') // -259200000 -ms('-1h') // -3600000 -ms('-200') // -200 -``` - -### Convert from Milliseconds - -```js -ms(60000) // "1m" -ms(2 * 60000) // "2m" -ms(-3 * 60000) // "-3m" -ms(ms('10 hours')) // "10h" -``` - -### Time Format Written-Out - -```js -ms(60000, { long: true }) // "1 minute" -ms(2 * 60000, { long: true }) // "2 minutes" -ms(-3 * 60000, { long: true }) // "-3 minutes" -ms(ms('10 hours'), { long: true }) // "10 hours" -``` - -## Features - -- Works both in [Node.js](https://nodejs.org) and in the browser -- If a number is supplied to `ms`, a string with a unit is returned -- If a string that contains the number is supplied, it returns it as a number (e.g.: it returns `100` for `'100'`) -- If you pass a string with a number and a valid unit, the number of equivalent milliseconds is returned - -## Related Packages - -- [ms.macro](https://github.com/knpwrs/ms.macro) - Run `ms` as a macro at build-time. - -## Caught a Bug? - -1. [Fork](https://help.github.com/articles/fork-a-repo/) this repository to your own GitHub account and then [clone](https://help.github.com/articles/cloning-a-repository/) it to your local device -2. Link the package to the global module directory: `npm link` -3. Within the module you want to test your local development instance of ms, just link it to the dependencies: `npm link ms`. Instead of the default one from npm, Node.js will now use your clone of ms! - -As always, you can run the tests using: `npm test` diff --git a/server/node_modules/agent-base/package.json b/server/node_modules/agent-base/package.json deleted file mode 100644 index fadce3a..0000000 --- a/server/node_modules/agent-base/package.json +++ /dev/null @@ -1,64 +0,0 @@ -{ - "name": "agent-base", - "version": "6.0.2", - "description": "Turn a function into an `http.Agent` instance", - "main": "dist/src/index", - "typings": "dist/src/index", - "files": [ - "dist/src", - "src" - ], - "scripts": { - "prebuild": "rimraf dist", - "build": "tsc", - "postbuild": "cpy --parents src test '!**/*.ts' dist", - "test": "mocha --reporter spec dist/test/*.js", - "test-lint": "eslint src --ext .js,.ts", - "prepublishOnly": "npm run build" - }, - "repository": { - "type": "git", - "url": "git://github.com/TooTallNate/node-agent-base.git" - }, - "keywords": [ - "http", - "agent", - "base", - "barebones", - "https" - ], - "author": "Nathan Rajlich (http://n8.io/)", - "license": "MIT", - "bugs": { - "url": "https://github.com/TooTallNate/node-agent-base/issues" - }, - "dependencies": { - "debug": "4" - }, - "devDependencies": { - "@types/debug": "4", - "@types/mocha": "^5.2.7", - "@types/node": "^14.0.20", - "@types/semver": "^7.1.0", - "@types/ws": "^6.0.3", - "@typescript-eslint/eslint-plugin": "1.6.0", - "@typescript-eslint/parser": "1.1.0", - "async-listen": "^1.2.0", - "cpy-cli": "^2.0.0", - "eslint": "5.16.0", - "eslint-config-airbnb": "17.1.0", - "eslint-config-prettier": "4.1.0", - "eslint-import-resolver-typescript": "1.1.1", - "eslint-plugin-import": "2.16.0", - "eslint-plugin-jsx-a11y": "6.2.1", - "eslint-plugin-react": "7.12.4", - "mocha": "^6.2.0", - "rimraf": "^3.0.0", - "semver": "^7.1.2", - "typescript": "^3.5.3", - "ws": "^3.0.0" - }, - "engines": { - "node": ">= 6.0.0" - } -} diff --git a/server/node_modules/agent-base/src/index.ts b/server/node_modules/agent-base/src/index.ts deleted file mode 100644 index a47ccd4..0000000 --- a/server/node_modules/agent-base/src/index.ts +++ /dev/null @@ -1,345 +0,0 @@ -import net from 'net'; -import http from 'http'; -import https from 'https'; -import { Duplex } from 'stream'; -import { EventEmitter } from 'events'; -import createDebug from 'debug'; -import promisify from './promisify'; - -const debug = createDebug('agent-base'); - -function isAgent(v: any): v is createAgent.AgentLike { - return Boolean(v) && typeof v.addRequest === 'function'; -} - -function isSecureEndpoint(): boolean { - const { stack } = new Error(); - if (typeof stack !== 'string') return false; - return stack.split('\n').some(l => l.indexOf('(https.js:') !== -1 || l.indexOf('node:https:') !== -1); -} - -function createAgent(opts?: createAgent.AgentOptions): createAgent.Agent; -function createAgent( - callback: createAgent.AgentCallback, - opts?: createAgent.AgentOptions -): createAgent.Agent; -function createAgent( - callback?: createAgent.AgentCallback | createAgent.AgentOptions, - opts?: createAgent.AgentOptions -) { - return new createAgent.Agent(callback, opts); -} - -namespace createAgent { - export interface ClientRequest extends http.ClientRequest { - _last?: boolean; - _hadError?: boolean; - method: string; - } - - export interface AgentRequestOptions { - host?: string; - path?: string; - // `port` on `http.RequestOptions` can be a string or undefined, - // but `net.TcpNetConnectOpts` expects only a number - port: number; - } - - export interface HttpRequestOptions - extends AgentRequestOptions, - Omit { - secureEndpoint: false; - } - - export interface HttpsRequestOptions - extends AgentRequestOptions, - Omit { - secureEndpoint: true; - } - - export type RequestOptions = HttpRequestOptions | HttpsRequestOptions; - - export type AgentLike = Pick | http.Agent; - - export type AgentCallbackReturn = Duplex | AgentLike; - - export type AgentCallbackCallback = ( - err?: Error | null, - socket?: createAgent.AgentCallbackReturn - ) => void; - - export type AgentCallbackPromise = ( - req: createAgent.ClientRequest, - opts: createAgent.RequestOptions - ) => - | createAgent.AgentCallbackReturn - | Promise; - - export type AgentCallback = typeof Agent.prototype.callback; - - export type AgentOptions = { - timeout?: number; - }; - - /** - * Base `http.Agent` implementation. - * No pooling/keep-alive is implemented by default. - * - * @param {Function} callback - * @api public - */ - export class Agent extends EventEmitter { - public timeout: number | null; - public maxFreeSockets: number; - public maxTotalSockets: number; - public maxSockets: number; - public sockets: { - [key: string]: net.Socket[]; - }; - public freeSockets: { - [key: string]: net.Socket[]; - }; - public requests: { - [key: string]: http.IncomingMessage[]; - }; - public options: https.AgentOptions; - private promisifiedCallback?: createAgent.AgentCallbackPromise; - private explicitDefaultPort?: number; - private explicitProtocol?: string; - - constructor( - callback?: createAgent.AgentCallback | createAgent.AgentOptions, - _opts?: createAgent.AgentOptions - ) { - super(); - - let opts = _opts; - if (typeof callback === 'function') { - this.callback = callback; - } else if (callback) { - opts = callback; - } - - // Timeout for the socket to be returned from the callback - this.timeout = null; - if (opts && typeof opts.timeout === 'number') { - this.timeout = opts.timeout; - } - - // These aren't actually used by `agent-base`, but are required - // for the TypeScript definition files in `@types/node` :/ - this.maxFreeSockets = 1; - this.maxSockets = 1; - this.maxTotalSockets = Infinity; - this.sockets = {}; - this.freeSockets = {}; - this.requests = {}; - this.options = {}; - } - - get defaultPort(): number { - if (typeof this.explicitDefaultPort === 'number') { - return this.explicitDefaultPort; - } - return isSecureEndpoint() ? 443 : 80; - } - - set defaultPort(v: number) { - this.explicitDefaultPort = v; - } - - get protocol(): string { - if (typeof this.explicitProtocol === 'string') { - return this.explicitProtocol; - } - return isSecureEndpoint() ? 'https:' : 'http:'; - } - - set protocol(v: string) { - this.explicitProtocol = v; - } - - callback( - req: createAgent.ClientRequest, - opts: createAgent.RequestOptions, - fn: createAgent.AgentCallbackCallback - ): void; - callback( - req: createAgent.ClientRequest, - opts: createAgent.RequestOptions - ): - | createAgent.AgentCallbackReturn - | Promise; - callback( - req: createAgent.ClientRequest, - opts: createAgent.AgentOptions, - fn?: createAgent.AgentCallbackCallback - ): - | createAgent.AgentCallbackReturn - | Promise - | void { - throw new Error( - '"agent-base" has no default implementation, you must subclass and override `callback()`' - ); - } - - /** - * Called by node-core's "_http_client.js" module when creating - * a new HTTP request with this Agent instance. - * - * @api public - */ - addRequest(req: ClientRequest, _opts: RequestOptions): void { - const opts: RequestOptions = { ..._opts }; - - if (typeof opts.secureEndpoint !== 'boolean') { - opts.secureEndpoint = isSecureEndpoint(); - } - - if (opts.host == null) { - opts.host = 'localhost'; - } - - if (opts.port == null) { - opts.port = opts.secureEndpoint ? 443 : 80; - } - - if (opts.protocol == null) { - opts.protocol = opts.secureEndpoint ? 'https:' : 'http:'; - } - - if (opts.host && opts.path) { - // If both a `host` and `path` are specified then it's most - // likely the result of a `url.parse()` call... we need to - // remove the `path` portion so that `net.connect()` doesn't - // attempt to open that as a unix socket file. - delete opts.path; - } - - delete opts.agent; - delete opts.hostname; - delete opts._defaultAgent; - delete opts.defaultPort; - delete opts.createConnection; - - // Hint to use "Connection: close" - // XXX: non-documented `http` module API :( - req._last = true; - req.shouldKeepAlive = false; - - let timedOut = false; - let timeoutId: ReturnType | null = null; - const timeoutMs = opts.timeout || this.timeout; - - const onerror = (err: NodeJS.ErrnoException) => { - if (req._hadError) return; - req.emit('error', err); - // For Safety. Some additional errors might fire later on - // and we need to make sure we don't double-fire the error event. - req._hadError = true; - }; - - const ontimeout = () => { - timeoutId = null; - timedOut = true; - const err: NodeJS.ErrnoException = new Error( - `A "socket" was not created for HTTP request before ${timeoutMs}ms` - ); - err.code = 'ETIMEOUT'; - onerror(err); - }; - - const callbackError = (err: NodeJS.ErrnoException) => { - if (timedOut) return; - if (timeoutId !== null) { - clearTimeout(timeoutId); - timeoutId = null; - } - onerror(err); - }; - - const onsocket = (socket: AgentCallbackReturn) => { - if (timedOut) return; - if (timeoutId != null) { - clearTimeout(timeoutId); - timeoutId = null; - } - - if (isAgent(socket)) { - // `socket` is actually an `http.Agent` instance, so - // relinquish responsibility for this `req` to the Agent - // from here on - debug( - 'Callback returned another Agent instance %o', - socket.constructor.name - ); - (socket as createAgent.Agent).addRequest(req, opts); - return; - } - - if (socket) { - socket.once('free', () => { - this.freeSocket(socket as net.Socket, opts); - }); - req.onSocket(socket as net.Socket); - return; - } - - const err = new Error( - `no Duplex stream was returned to agent-base for \`${req.method} ${req.path}\`` - ); - onerror(err); - }; - - if (typeof this.callback !== 'function') { - onerror(new Error('`callback` is not defined')); - return; - } - - if (!this.promisifiedCallback) { - if (this.callback.length >= 3) { - debug('Converting legacy callback function to promise'); - this.promisifiedCallback = promisify(this.callback); - } else { - this.promisifiedCallback = this.callback; - } - } - - if (typeof timeoutMs === 'number' && timeoutMs > 0) { - timeoutId = setTimeout(ontimeout, timeoutMs); - } - - if ('port' in opts && typeof opts.port !== 'number') { - opts.port = Number(opts.port); - } - - try { - debug( - 'Resolving socket for %o request: %o', - opts.protocol, - `${req.method} ${req.path}` - ); - Promise.resolve(this.promisifiedCallback(req, opts)).then( - onsocket, - callbackError - ); - } catch (err) { - Promise.reject(err).catch(callbackError); - } - } - - freeSocket(socket: net.Socket, opts: AgentOptions) { - debug('Freeing socket %o %o', socket.constructor.name, opts); - socket.destroy(); - } - - destroy() { - debug('Destroying agent %o', this.constructor.name); - } - } - - // So that `instanceof` works correctly - createAgent.prototype = createAgent.Agent.prototype; -} - -export = createAgent; diff --git a/server/node_modules/agent-base/src/promisify.ts b/server/node_modules/agent-base/src/promisify.ts deleted file mode 100644 index 60cc662..0000000 --- a/server/node_modules/agent-base/src/promisify.ts +++ /dev/null @@ -1,33 +0,0 @@ -import { - Agent, - ClientRequest, - RequestOptions, - AgentCallbackCallback, - AgentCallbackPromise, - AgentCallbackReturn -} from './index'; - -type LegacyCallback = ( - req: ClientRequest, - opts: RequestOptions, - fn: AgentCallbackCallback -) => void; - -export default function promisify(fn: LegacyCallback): AgentCallbackPromise { - return function(this: Agent, req: ClientRequest, opts: RequestOptions) { - return new Promise((resolve, reject) => { - fn.call( - this, - req, - opts, - (err: Error | null | undefined, rtn?: AgentCallbackReturn) => { - if (err) { - reject(err); - } else { - resolve(rtn); - } - } - ); - }); - }; -} diff --git a/server/node_modules/append-field/.npmignore b/server/node_modules/append-field/.npmignore deleted file mode 100644 index c2658d7..0000000 --- a/server/node_modules/append-field/.npmignore +++ /dev/null @@ -1 +0,0 @@ -node_modules/ diff --git a/server/node_modules/append-field/LICENSE b/server/node_modules/append-field/LICENSE deleted file mode 100644 index 14b1f89..0000000 --- a/server/node_modules/append-field/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2015 Linus Unnebäck - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/server/node_modules/append-field/README.md b/server/node_modules/append-field/README.md deleted file mode 100644 index 62b901b..0000000 --- a/server/node_modules/append-field/README.md +++ /dev/null @@ -1,44 +0,0 @@ -# `append-field` - -A [W3C HTML JSON forms spec](http://www.w3.org/TR/html-json-forms/) compliant -field appender (for lack of a better name). Useful for people implementing -`application/x-www-form-urlencoded` and `multipart/form-data` parsers. - -It works best on objects created with `Object.create(null)`. Otherwise it might -conflict with variables from the prototype (e.g. `hasOwnProperty`). - -## Installation - -```sh -npm install --save append-field -``` - -## Usage - -```javascript -var appendField = require('append-field') -var obj = Object.create(null) - -appendField(obj, 'pets[0][species]', 'Dahut') -appendField(obj, 'pets[0][name]', 'Hypatia') -appendField(obj, 'pets[1][species]', 'Felis Stultus') -appendField(obj, 'pets[1][name]', 'Billie') - -console.log(obj) -``` - -```text -{ pets: - [ { species: 'Dahut', name: 'Hypatia' }, - { species: 'Felis Stultus', name: 'Billie' } ] } -``` - -## API - -### `appendField(store, key, value)` - -Adds the field named `key` with the value `value` to the object `store`. - -## License - -MIT diff --git a/server/node_modules/append-field/index.js b/server/node_modules/append-field/index.js deleted file mode 100644 index fc5acc8..0000000 --- a/server/node_modules/append-field/index.js +++ /dev/null @@ -1,12 +0,0 @@ -var parsePath = require('./lib/parse-path') -var setValue = require('./lib/set-value') - -function appendField (store, key, value) { - var steps = parsePath(key) - - steps.reduce(function (context, step) { - return setValue(context, step, context[step.key], value) - }, store) -} - -module.exports = appendField diff --git a/server/node_modules/append-field/lib/parse-path.js b/server/node_modules/append-field/lib/parse-path.js deleted file mode 100644 index 31d6179..0000000 --- a/server/node_modules/append-field/lib/parse-path.js +++ /dev/null @@ -1,53 +0,0 @@ -var reFirstKey = /^[^\[]*/ -var reDigitPath = /^\[(\d+)\]/ -var reNormalPath = /^\[([^\]]+)\]/ - -function parsePath (key) { - function failure () { - return [{ type: 'object', key: key, last: true }] - } - - var firstKey = reFirstKey.exec(key)[0] - if (!firstKey) return failure() - - var len = key.length - var pos = firstKey.length - var tail = { type: 'object', key: firstKey } - var steps = [tail] - - while (pos < len) { - var m - - if (key[pos] === '[' && key[pos + 1] === ']') { - pos += 2 - tail.append = true - if (pos !== len) return failure() - continue - } - - m = reDigitPath.exec(key.substring(pos)) - if (m !== null) { - pos += m[0].length - tail.nextType = 'array' - tail = { type: 'array', key: parseInt(m[1], 10) } - steps.push(tail) - continue - } - - m = reNormalPath.exec(key.substring(pos)) - if (m !== null) { - pos += m[0].length - tail.nextType = 'object' - tail = { type: 'object', key: m[1] } - steps.push(tail) - continue - } - - return failure() - } - - tail.last = true - return steps -} - -module.exports = parsePath diff --git a/server/node_modules/append-field/lib/set-value.js b/server/node_modules/append-field/lib/set-value.js deleted file mode 100644 index c15e873..0000000 --- a/server/node_modules/append-field/lib/set-value.js +++ /dev/null @@ -1,64 +0,0 @@ -function valueType (value) { - if (value === undefined) return 'undefined' - if (Array.isArray(value)) return 'array' - if (typeof value === 'object') return 'object' - return 'scalar' -} - -function setLastValue (context, step, currentValue, entryValue) { - switch (valueType(currentValue)) { - case 'undefined': - if (step.append) { - context[step.key] = [entryValue] - } else { - context[step.key] = entryValue - } - break - case 'array': - context[step.key].push(entryValue) - break - case 'object': - return setLastValue(currentValue, { type: 'object', key: '', last: true }, currentValue[''], entryValue) - case 'scalar': - context[step.key] = [context[step.key], entryValue] - break - } - - return context -} - -function setValue (context, step, currentValue, entryValue) { - if (step.last) return setLastValue(context, step, currentValue, entryValue) - - var obj - switch (valueType(currentValue)) { - case 'undefined': - if (step.nextType === 'array') { - context[step.key] = [] - } else { - context[step.key] = Object.create(null) - } - return context[step.key] - case 'object': - return context[step.key] - case 'array': - if (step.nextType === 'array') { - return currentValue - } - - obj = Object.create(null) - context[step.key] = obj - currentValue.forEach(function (item, i) { - if (item !== undefined) obj['' + i] = item - }) - - return obj - case 'scalar': - obj = Object.create(null) - obj[''] = currentValue - context[step.key] = obj - return obj - } -} - -module.exports = setValue diff --git a/server/node_modules/append-field/package.json b/server/node_modules/append-field/package.json deleted file mode 100644 index 8d6e716..0000000 --- a/server/node_modules/append-field/package.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "name": "append-field", - "version": "1.0.0", - "license": "MIT", - "author": "Linus Unnebäck ", - "main": "index.js", - "devDependencies": { - "mocha": "^2.2.4", - "standard": "^6.0.5", - "testdata-w3c-json-form": "^0.2.0" - }, - "scripts": { - "test": "standard && mocha" - }, - "repository": { - "type": "git", - "url": "http://github.com/LinusU/node-append-field.git" - } -} diff --git a/server/node_modules/append-field/test/forms.js b/server/node_modules/append-field/test/forms.js deleted file mode 100644 index dd6fbc9..0000000 --- a/server/node_modules/append-field/test/forms.js +++ /dev/null @@ -1,19 +0,0 @@ -/* eslint-env mocha */ - -var assert = require('assert') -var appendField = require('../') -var testData = require('testdata-w3c-json-form') - -describe('Append Field', function () { - for (var test of testData) { - it('handles ' + test.name, function () { - var store = Object.create(null) - - for (var field of test.fields) { - appendField(store, field.key, field.value) - } - - assert.deepEqual(store, test.expected) - }) - } -}) diff --git a/server/node_modules/array-flatten/LICENSE b/server/node_modules/array-flatten/LICENSE deleted file mode 100644 index 983fbe8..0000000 --- a/server/node_modules/array-flatten/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2014 Blake Embrey (hello@blakeembrey.com) - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/server/node_modules/array-flatten/README.md b/server/node_modules/array-flatten/README.md deleted file mode 100644 index 91fa5b6..0000000 --- a/server/node_modules/array-flatten/README.md +++ /dev/null @@ -1,43 +0,0 @@ -# Array Flatten - -[![NPM version][npm-image]][npm-url] -[![NPM downloads][downloads-image]][downloads-url] -[![Build status][travis-image]][travis-url] -[![Test coverage][coveralls-image]][coveralls-url] - -> Flatten an array of nested arrays into a single flat array. Accepts an optional depth. - -## Installation - -``` -npm install array-flatten --save -``` - -## Usage - -```javascript -var flatten = require('array-flatten') - -flatten([1, [2, [3, [4, [5], 6], 7], 8], 9]) -//=> [1, 2, 3, 4, 5, 6, 7, 8, 9] - -flatten([1, [2, [3, [4, [5], 6], 7], 8], 9], 2) -//=> [1, 2, 3, [4, [5], 6], 7, 8, 9] - -(function () { - flatten(arguments) //=> [1, 2, 3] -})(1, [2, 3]) -``` - -## License - -MIT - -[npm-image]: https://img.shields.io/npm/v/array-flatten.svg?style=flat -[npm-url]: https://npmjs.org/package/array-flatten -[downloads-image]: https://img.shields.io/npm/dm/array-flatten.svg?style=flat -[downloads-url]: https://npmjs.org/package/array-flatten -[travis-image]: https://img.shields.io/travis/blakeembrey/array-flatten.svg?style=flat -[travis-url]: https://travis-ci.org/blakeembrey/array-flatten -[coveralls-image]: https://img.shields.io/coveralls/blakeembrey/array-flatten.svg?style=flat -[coveralls-url]: https://coveralls.io/r/blakeembrey/array-flatten?branch=master diff --git a/server/node_modules/array-flatten/array-flatten.js b/server/node_modules/array-flatten/array-flatten.js deleted file mode 100644 index 089117b..0000000 --- a/server/node_modules/array-flatten/array-flatten.js +++ /dev/null @@ -1,64 +0,0 @@ -'use strict' - -/** - * Expose `arrayFlatten`. - */ -module.exports = arrayFlatten - -/** - * Recursive flatten function with depth. - * - * @param {Array} array - * @param {Array} result - * @param {Number} depth - * @return {Array} - */ -function flattenWithDepth (array, result, depth) { - for (var i = 0; i < array.length; i++) { - var value = array[i] - - if (depth > 0 && Array.isArray(value)) { - flattenWithDepth(value, result, depth - 1) - } else { - result.push(value) - } - } - - return result -} - -/** - * Recursive flatten function. Omitting depth is slightly faster. - * - * @param {Array} array - * @param {Array} result - * @return {Array} - */ -function flattenForever (array, result) { - for (var i = 0; i < array.length; i++) { - var value = array[i] - - if (Array.isArray(value)) { - flattenForever(value, result) - } else { - result.push(value) - } - } - - return result -} - -/** - * Flatten an array, with the ability to define a depth. - * - * @param {Array} array - * @param {Number} depth - * @return {Array} - */ -function arrayFlatten (array, depth) { - if (depth == null) { - return flattenForever(array, []) - } - - return flattenWithDepth(array, [], depth) -} diff --git a/server/node_modules/array-flatten/package.json b/server/node_modules/array-flatten/package.json deleted file mode 100644 index 1a24e2a..0000000 --- a/server/node_modules/array-flatten/package.json +++ /dev/null @@ -1,39 +0,0 @@ -{ - "name": "array-flatten", - "version": "1.1.1", - "description": "Flatten an array of nested arrays into a single flat array", - "main": "array-flatten.js", - "files": [ - "array-flatten.js", - "LICENSE" - ], - "scripts": { - "test": "istanbul cover _mocha -- -R spec" - }, - "repository": { - "type": "git", - "url": "git://github.com/blakeembrey/array-flatten.git" - }, - "keywords": [ - "array", - "flatten", - "arguments", - "depth" - ], - "author": { - "name": "Blake Embrey", - "email": "hello@blakeembrey.com", - "url": "http://blakeembrey.me" - }, - "license": "MIT", - "bugs": { - "url": "https://github.com/blakeembrey/array-flatten/issues" - }, - "homepage": "https://github.com/blakeembrey/array-flatten", - "devDependencies": { - "istanbul": "^0.3.13", - "mocha": "^2.2.4", - "pre-commit": "^1.0.7", - "standard": "^3.7.3" - } -} diff --git a/server/node_modules/asynckit/LICENSE b/server/node_modules/asynckit/LICENSE deleted file mode 100644 index c9eca5d..0000000 --- a/server/node_modules/asynckit/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2016 Alex Indigo - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/server/node_modules/asynckit/README.md b/server/node_modules/asynckit/README.md deleted file mode 100644 index ddcc7e6..0000000 --- a/server/node_modules/asynckit/README.md +++ /dev/null @@ -1,233 +0,0 @@ -# asynckit [![NPM Module](https://img.shields.io/npm/v/asynckit.svg?style=flat)](https://www.npmjs.com/package/asynckit) - -Minimal async jobs utility library, with streams support. - -[![PhantomJS Build](https://img.shields.io/travis/alexindigo/asynckit/v0.4.0.svg?label=browser&style=flat)](https://travis-ci.org/alexindigo/asynckit) -[![Linux Build](https://img.shields.io/travis/alexindigo/asynckit/v0.4.0.svg?label=linux:0.12-6.x&style=flat)](https://travis-ci.org/alexindigo/asynckit) -[![Windows Build](https://img.shields.io/appveyor/ci/alexindigo/asynckit/v0.4.0.svg?label=windows:0.12-6.x&style=flat)](https://ci.appveyor.com/project/alexindigo/asynckit) - -[![Coverage Status](https://img.shields.io/coveralls/alexindigo/asynckit/v0.4.0.svg?label=code+coverage&style=flat)](https://coveralls.io/github/alexindigo/asynckit?branch=master) -[![Dependency Status](https://img.shields.io/david/alexindigo/asynckit/v0.4.0.svg?style=flat)](https://david-dm.org/alexindigo/asynckit) -[![bitHound Overall Score](https://www.bithound.io/github/alexindigo/asynckit/badges/score.svg)](https://www.bithound.io/github/alexindigo/asynckit) - - - -AsyncKit provides harness for `parallel` and `serial` iterators over list of items represented by arrays or objects. -Optionally it accepts abort function (should be synchronously return by iterator for each item), and terminates left over jobs upon an error event. For specific iteration order built-in (`ascending` and `descending`) and custom sort helpers also supported, via `asynckit.serialOrdered` method. - -It ensures async operations to keep behavior more stable and prevent `Maximum call stack size exceeded` errors, from sync iterators. - -| compression | size | -| :----------------- | -------: | -| asynckit.js | 12.34 kB | -| asynckit.min.js | 4.11 kB | -| asynckit.min.js.gz | 1.47 kB | - - -## Install - -```sh -$ npm install --save asynckit -``` - -## Examples - -### Parallel Jobs - -Runs iterator over provided array in parallel. Stores output in the `result` array, -on the matching positions. In unlikely event of an error from one of the jobs, -will terminate rest of the active jobs (if abort function is provided) -and return error along with salvaged data to the main callback function. - -#### Input Array - -```javascript -var parallel = require('asynckit').parallel - , assert = require('assert') - ; - -var source = [ 1, 1, 4, 16, 64, 32, 8, 2 ] - , expectedResult = [ 2, 2, 8, 32, 128, 64, 16, 4 ] - , expectedTarget = [ 1, 1, 2, 4, 8, 16, 32, 64 ] - , target = [] - ; - -parallel(source, asyncJob, function(err, result) -{ - assert.deepEqual(result, expectedResult); - assert.deepEqual(target, expectedTarget); -}); - -// async job accepts one element from the array -// and a callback function -function asyncJob(item, cb) -{ - // different delays (in ms) per item - var delay = item * 25; - - // pretend different jobs take different time to finish - // and not in consequential order - var timeoutId = setTimeout(function() { - target.push(item); - cb(null, item * 2); - }, delay); - - // allow to cancel "leftover" jobs upon error - // return function, invoking of which will abort this job - return clearTimeout.bind(null, timeoutId); -} -``` - -More examples could be found in [test/test-parallel-array.js](test/test-parallel-array.js). - -#### Input Object - -Also it supports named jobs, listed via object. - -```javascript -var parallel = require('asynckit/parallel') - , assert = require('assert') - ; - -var source = { first: 1, one: 1, four: 4, sixteen: 16, sixtyFour: 64, thirtyTwo: 32, eight: 8, two: 2 } - , expectedResult = { first: 2, one: 2, four: 8, sixteen: 32, sixtyFour: 128, thirtyTwo: 64, eight: 16, two: 4 } - , expectedTarget = [ 1, 1, 2, 4, 8, 16, 32, 64 ] - , expectedKeys = [ 'first', 'one', 'two', 'four', 'eight', 'sixteen', 'thirtyTwo', 'sixtyFour' ] - , target = [] - , keys = [] - ; - -parallel(source, asyncJob, function(err, result) -{ - assert.deepEqual(result, expectedResult); - assert.deepEqual(target, expectedTarget); - assert.deepEqual(keys, expectedKeys); -}); - -// supports full value, key, callback (shortcut) interface -function asyncJob(item, key, cb) -{ - // different delays (in ms) per item - var delay = item * 25; - - // pretend different jobs take different time to finish - // and not in consequential order - var timeoutId = setTimeout(function() { - keys.push(key); - target.push(item); - cb(null, item * 2); - }, delay); - - // allow to cancel "leftover" jobs upon error - // return function, invoking of which will abort this job - return clearTimeout.bind(null, timeoutId); -} -``` - -More examples could be found in [test/test-parallel-object.js](test/test-parallel-object.js). - -### Serial Jobs - -Runs iterator over provided array sequentially. Stores output in the `result` array, -on the matching positions. In unlikely event of an error from one of the jobs, -will not proceed to the rest of the items in the list -and return error along with salvaged data to the main callback function. - -#### Input Array - -```javascript -var serial = require('asynckit/serial') - , assert = require('assert') - ; - -var source = [ 1, 1, 4, 16, 64, 32, 8, 2 ] - , expectedResult = [ 2, 2, 8, 32, 128, 64, 16, 4 ] - , expectedTarget = [ 0, 1, 2, 3, 4, 5, 6, 7 ] - , target = [] - ; - -serial(source, asyncJob, function(err, result) -{ - assert.deepEqual(result, expectedResult); - assert.deepEqual(target, expectedTarget); -}); - -// extended interface (item, key, callback) -// also supported for arrays -function asyncJob(item, key, cb) -{ - target.push(key); - - // it will be automatically made async - // even it iterator "returns" in the same event loop - cb(null, item * 2); -} -``` - -More examples could be found in [test/test-serial-array.js](test/test-serial-array.js). - -#### Input Object - -Also it supports named jobs, listed via object. - -```javascript -var serial = require('asynckit').serial - , assert = require('assert') - ; - -var source = [ 1, 1, 4, 16, 64, 32, 8, 2 ] - , expectedResult = [ 2, 2, 8, 32, 128, 64, 16, 4 ] - , expectedTarget = [ 0, 1, 2, 3, 4, 5, 6, 7 ] - , target = [] - ; - -var source = { first: 1, one: 1, four: 4, sixteen: 16, sixtyFour: 64, thirtyTwo: 32, eight: 8, two: 2 } - , expectedResult = { first: 2, one: 2, four: 8, sixteen: 32, sixtyFour: 128, thirtyTwo: 64, eight: 16, two: 4 } - , expectedTarget = [ 1, 1, 4, 16, 64, 32, 8, 2 ] - , target = [] - ; - - -serial(source, asyncJob, function(err, result) -{ - assert.deepEqual(result, expectedResult); - assert.deepEqual(target, expectedTarget); -}); - -// shortcut interface (item, callback) -// works for object as well as for the arrays -function asyncJob(item, cb) -{ - target.push(item); - - // it will be automatically made async - // even it iterator "returns" in the same event loop - cb(null, item * 2); -} -``` - -More examples could be found in [test/test-serial-object.js](test/test-serial-object.js). - -_Note: Since _object_ is an _unordered_ collection of properties, -it may produce unexpected results with sequential iterations. -Whenever order of the jobs' execution is important please use `serialOrdered` method._ - -### Ordered Serial Iterations - -TBD - -For example [compare-property](compare-property) package. - -### Streaming interface - -TBD - -## Want to Know More? - -More examples can be found in [test folder](test/). - -Or open an [issue](https://github.com/alexindigo/asynckit/issues) with questions and/or suggestions. - -## License - -AsyncKit is licensed under the MIT license. diff --git a/server/node_modules/asynckit/bench.js b/server/node_modules/asynckit/bench.js deleted file mode 100644 index c612f1a..0000000 --- a/server/node_modules/asynckit/bench.js +++ /dev/null @@ -1,76 +0,0 @@ -/* eslint no-console: "off" */ - -var asynckit = require('./') - , async = require('async') - , assert = require('assert') - , expected = 0 - ; - -var Benchmark = require('benchmark'); -var suite = new Benchmark.Suite; - -var source = []; -for (var z = 1; z < 100; z++) -{ - source.push(z); - expected += z; -} - -suite -// add tests - -.add('async.map', function(deferred) -{ - var total = 0; - - async.map(source, - function(i, cb) - { - setImmediate(function() - { - total += i; - cb(null, total); - }); - }, - function(err, result) - { - assert.ifError(err); - assert.equal(result[result.length - 1], expected); - deferred.resolve(); - }); -}, {'defer': true}) - - -.add('asynckit.parallel', function(deferred) -{ - var total = 0; - - asynckit.parallel(source, - function(i, cb) - { - setImmediate(function() - { - total += i; - cb(null, total); - }); - }, - function(err, result) - { - assert.ifError(err); - assert.equal(result[result.length - 1], expected); - deferred.resolve(); - }); -}, {'defer': true}) - - -// add listeners -.on('cycle', function(ev) -{ - console.log(String(ev.target)); -}) -.on('complete', function() -{ - console.log('Fastest is ' + this.filter('fastest').map('name')); -}) -// run async -.run({ 'async': true }); diff --git a/server/node_modules/asynckit/index.js b/server/node_modules/asynckit/index.js deleted file mode 100644 index 455f945..0000000 --- a/server/node_modules/asynckit/index.js +++ /dev/null @@ -1,6 +0,0 @@ -module.exports = -{ - parallel : require('./parallel.js'), - serial : require('./serial.js'), - serialOrdered : require('./serialOrdered.js') -}; diff --git a/server/node_modules/asynckit/lib/abort.js b/server/node_modules/asynckit/lib/abort.js deleted file mode 100644 index 114367e..0000000 --- a/server/node_modules/asynckit/lib/abort.js +++ /dev/null @@ -1,29 +0,0 @@ -// API -module.exports = abort; - -/** - * Aborts leftover active jobs - * - * @param {object} state - current state object - */ -function abort(state) -{ - Object.keys(state.jobs).forEach(clean.bind(state)); - - // reset leftover jobs - state.jobs = {}; -} - -/** - * Cleans up leftover job by invoking abort function for the provided job id - * - * @this state - * @param {string|number} key - job id to abort - */ -function clean(key) -{ - if (typeof this.jobs[key] == 'function') - { - this.jobs[key](); - } -} diff --git a/server/node_modules/asynckit/lib/async.js b/server/node_modules/asynckit/lib/async.js deleted file mode 100644 index 7f1288a..0000000 --- a/server/node_modules/asynckit/lib/async.js +++ /dev/null @@ -1,34 +0,0 @@ -var defer = require('./defer.js'); - -// API -module.exports = async; - -/** - * Runs provided callback asynchronously - * even if callback itself is not - * - * @param {function} callback - callback to invoke - * @returns {function} - augmented callback - */ -function async(callback) -{ - var isAsync = false; - - // check if async happened - defer(function() { isAsync = true; }); - - return function async_callback(err, result) - { - if (isAsync) - { - callback(err, result); - } - else - { - defer(function nextTick_callback() - { - callback(err, result); - }); - } - }; -} diff --git a/server/node_modules/asynckit/lib/defer.js b/server/node_modules/asynckit/lib/defer.js deleted file mode 100644 index b67110c..0000000 --- a/server/node_modules/asynckit/lib/defer.js +++ /dev/null @@ -1,26 +0,0 @@ -module.exports = defer; - -/** - * Runs provided function on next iteration of the event loop - * - * @param {function} fn - function to run - */ -function defer(fn) -{ - var nextTick = typeof setImmediate == 'function' - ? setImmediate - : ( - typeof process == 'object' && typeof process.nextTick == 'function' - ? process.nextTick - : null - ); - - if (nextTick) - { - nextTick(fn); - } - else - { - setTimeout(fn, 0); - } -} diff --git a/server/node_modules/asynckit/lib/iterate.js b/server/node_modules/asynckit/lib/iterate.js deleted file mode 100644 index 5d2839a..0000000 --- a/server/node_modules/asynckit/lib/iterate.js +++ /dev/null @@ -1,75 +0,0 @@ -var async = require('./async.js') - , abort = require('./abort.js') - ; - -// API -module.exports = iterate; - -/** - * Iterates over each job object - * - * @param {array|object} list - array or object (named list) to iterate over - * @param {function} iterator - iterator to run - * @param {object} state - current job status - * @param {function} callback - invoked when all elements processed - */ -function iterate(list, iterator, state, callback) -{ - // store current index - var key = state['keyedList'] ? state['keyedList'][state.index] : state.index; - - state.jobs[key] = runJob(iterator, key, list[key], function(error, output) - { - // don't repeat yourself - // skip secondary callbacks - if (!(key in state.jobs)) - { - return; - } - - // clean up jobs - delete state.jobs[key]; - - if (error) - { - // don't process rest of the results - // stop still active jobs - // and reset the list - abort(state); - } - else - { - state.results[key] = output; - } - - // return salvaged results - callback(error, state.results); - }); -} - -/** - * Runs iterator over provided job element - * - * @param {function} iterator - iterator to invoke - * @param {string|number} key - key/index of the element in the list of jobs - * @param {mixed} item - job description - * @param {function} callback - invoked after iterator is done with the job - * @returns {function|mixed} - job abort function or something else - */ -function runJob(iterator, key, item, callback) -{ - var aborter; - - // allow shortcut if iterator expects only two arguments - if (iterator.length == 2) - { - aborter = iterator(item, async(callback)); - } - // otherwise go with full three arguments - else - { - aborter = iterator(item, key, async(callback)); - } - - return aborter; -} diff --git a/server/node_modules/asynckit/lib/readable_asynckit.js b/server/node_modules/asynckit/lib/readable_asynckit.js deleted file mode 100644 index 78ad240..0000000 --- a/server/node_modules/asynckit/lib/readable_asynckit.js +++ /dev/null @@ -1,91 +0,0 @@ -var streamify = require('./streamify.js') - , defer = require('./defer.js') - ; - -// API -module.exports = ReadableAsyncKit; - -/** - * Base constructor for all streams - * used to hold properties/methods - */ -function ReadableAsyncKit() -{ - ReadableAsyncKit.super_.apply(this, arguments); - - // list of active jobs - this.jobs = {}; - - // add stream methods - this.destroy = destroy; - this._start = _start; - this._read = _read; -} - -/** - * Destroys readable stream, - * by aborting outstanding jobs - * - * @returns {void} - */ -function destroy() -{ - if (this.destroyed) - { - return; - } - - this.destroyed = true; - - if (typeof this.terminator == 'function') - { - this.terminator(); - } -} - -/** - * Starts provided jobs in async manner - * - * @private - */ -function _start() -{ - // first argument – runner function - var runner = arguments[0] - // take away first argument - , args = Array.prototype.slice.call(arguments, 1) - // second argument - input data - , input = args[0] - // last argument - result callback - , endCb = streamify.callback.call(this, args[args.length - 1]) - ; - - args[args.length - 1] = endCb; - // third argument - iterator - args[1] = streamify.iterator.call(this, args[1]); - - // allow time for proper setup - defer(function() - { - if (!this.destroyed) - { - this.terminator = runner.apply(null, args); - } - else - { - endCb(null, Array.isArray(input) ? [] : {}); - } - }.bind(this)); -} - - -/** - * Implement _read to comply with Readable streams - * Doesn't really make sense for flowing object mode - * - * @private - */ -function _read() -{ - -} diff --git a/server/node_modules/asynckit/lib/readable_parallel.js b/server/node_modules/asynckit/lib/readable_parallel.js deleted file mode 100644 index 5d2929f..0000000 --- a/server/node_modules/asynckit/lib/readable_parallel.js +++ /dev/null @@ -1,25 +0,0 @@ -var parallel = require('../parallel.js'); - -// API -module.exports = ReadableParallel; - -/** - * Streaming wrapper to `asynckit.parallel` - * - * @param {array|object} list - array or object (named list) to iterate over - * @param {function} iterator - iterator to run - * @param {function} callback - invoked when all elements processed - * @returns {stream.Readable#} - */ -function ReadableParallel(list, iterator, callback) -{ - if (!(this instanceof ReadableParallel)) - { - return new ReadableParallel(list, iterator, callback); - } - - // turn on object mode - ReadableParallel.super_.call(this, {objectMode: true}); - - this._start(parallel, list, iterator, callback); -} diff --git a/server/node_modules/asynckit/lib/readable_serial.js b/server/node_modules/asynckit/lib/readable_serial.js deleted file mode 100644 index 7822698..0000000 --- a/server/node_modules/asynckit/lib/readable_serial.js +++ /dev/null @@ -1,25 +0,0 @@ -var serial = require('../serial.js'); - -// API -module.exports = ReadableSerial; - -/** - * Streaming wrapper to `asynckit.serial` - * - * @param {array|object} list - array or object (named list) to iterate over - * @param {function} iterator - iterator to run - * @param {function} callback - invoked when all elements processed - * @returns {stream.Readable#} - */ -function ReadableSerial(list, iterator, callback) -{ - if (!(this instanceof ReadableSerial)) - { - return new ReadableSerial(list, iterator, callback); - } - - // turn on object mode - ReadableSerial.super_.call(this, {objectMode: true}); - - this._start(serial, list, iterator, callback); -} diff --git a/server/node_modules/asynckit/lib/readable_serial_ordered.js b/server/node_modules/asynckit/lib/readable_serial_ordered.js deleted file mode 100644 index 3de89c4..0000000 --- a/server/node_modules/asynckit/lib/readable_serial_ordered.js +++ /dev/null @@ -1,29 +0,0 @@ -var serialOrdered = require('../serialOrdered.js'); - -// API -module.exports = ReadableSerialOrdered; -// expose sort helpers -module.exports.ascending = serialOrdered.ascending; -module.exports.descending = serialOrdered.descending; - -/** - * Streaming wrapper to `asynckit.serialOrdered` - * - * @param {array|object} list - array or object (named list) to iterate over - * @param {function} iterator - iterator to run - * @param {function} sortMethod - custom sort function - * @param {function} callback - invoked when all elements processed - * @returns {stream.Readable#} - */ -function ReadableSerialOrdered(list, iterator, sortMethod, callback) -{ - if (!(this instanceof ReadableSerialOrdered)) - { - return new ReadableSerialOrdered(list, iterator, sortMethod, callback); - } - - // turn on object mode - ReadableSerialOrdered.super_.call(this, {objectMode: true}); - - this._start(serialOrdered, list, iterator, sortMethod, callback); -} diff --git a/server/node_modules/asynckit/lib/state.js b/server/node_modules/asynckit/lib/state.js deleted file mode 100644 index cbea7ad..0000000 --- a/server/node_modules/asynckit/lib/state.js +++ /dev/null @@ -1,37 +0,0 @@ -// API -module.exports = state; - -/** - * Creates initial state object - * for iteration over list - * - * @param {array|object} list - list to iterate over - * @param {function|null} sortMethod - function to use for keys sort, - * or `null` to keep them as is - * @returns {object} - initial state object - */ -function state(list, sortMethod) -{ - var isNamedList = !Array.isArray(list) - , initState = - { - index : 0, - keyedList: isNamedList || sortMethod ? Object.keys(list) : null, - jobs : {}, - results : isNamedList ? {} : [], - size : isNamedList ? Object.keys(list).length : list.length - } - ; - - if (sortMethod) - { - // sort array keys based on it's values - // sort object's keys just on own merit - initState.keyedList.sort(isNamedList ? sortMethod : function(a, b) - { - return sortMethod(list[a], list[b]); - }); - } - - return initState; -} diff --git a/server/node_modules/asynckit/lib/streamify.js b/server/node_modules/asynckit/lib/streamify.js deleted file mode 100644 index f56a1c9..0000000 --- a/server/node_modules/asynckit/lib/streamify.js +++ /dev/null @@ -1,141 +0,0 @@ -var async = require('./async.js'); - -// API -module.exports = { - iterator: wrapIterator, - callback: wrapCallback -}; - -/** - * Wraps iterators with long signature - * - * @this ReadableAsyncKit# - * @param {function} iterator - function to wrap - * @returns {function} - wrapped function - */ -function wrapIterator(iterator) -{ - var stream = this; - - return function(item, key, cb) - { - var aborter - , wrappedCb = async(wrapIteratorCallback.call(stream, cb, key)) - ; - - stream.jobs[key] = wrappedCb; - - // it's either shortcut (item, cb) - if (iterator.length == 2) - { - aborter = iterator(item, wrappedCb); - } - // or long format (item, key, cb) - else - { - aborter = iterator(item, key, wrappedCb); - } - - return aborter; - }; -} - -/** - * Wraps provided callback function - * allowing to execute snitch function before - * real callback - * - * @this ReadableAsyncKit# - * @param {function} callback - function to wrap - * @returns {function} - wrapped function - */ -function wrapCallback(callback) -{ - var stream = this; - - var wrapped = function(error, result) - { - return finisher.call(stream, error, result, callback); - }; - - return wrapped; -} - -/** - * Wraps provided iterator callback function - * makes sure snitch only called once, - * but passes secondary calls to the original callback - * - * @this ReadableAsyncKit# - * @param {function} callback - callback to wrap - * @param {number|string} key - iteration key - * @returns {function} wrapped callback - */ -function wrapIteratorCallback(callback, key) -{ - var stream = this; - - return function(error, output) - { - // don't repeat yourself - if (!(key in stream.jobs)) - { - callback(error, output); - return; - } - - // clean up jobs - delete stream.jobs[key]; - - return streamer.call(stream, error, {key: key, value: output}, callback); - }; -} - -/** - * Stream wrapper for iterator callback - * - * @this ReadableAsyncKit# - * @param {mixed} error - error response - * @param {mixed} output - iterator output - * @param {function} callback - callback that expects iterator results - */ -function streamer(error, output, callback) -{ - if (error && !this.error) - { - this.error = error; - this.pause(); - this.emit('error', error); - // send back value only, as expected - callback(error, output && output.value); - return; - } - - // stream stuff - this.push(output); - - // back to original track - // send back value only, as expected - callback(error, output && output.value); -} - -/** - * Stream wrapper for finishing callback - * - * @this ReadableAsyncKit# - * @param {mixed} error - error response - * @param {mixed} output - iterator output - * @param {function} callback - callback that expects final results - */ -function finisher(error, output, callback) -{ - // signal end of the stream - // only for successfully finished streams - if (!error) - { - this.push(null); - } - - // back to original track - callback(error, output); -} diff --git a/server/node_modules/asynckit/lib/terminator.js b/server/node_modules/asynckit/lib/terminator.js deleted file mode 100644 index d6eb992..0000000 --- a/server/node_modules/asynckit/lib/terminator.js +++ /dev/null @@ -1,29 +0,0 @@ -var abort = require('./abort.js') - , async = require('./async.js') - ; - -// API -module.exports = terminator; - -/** - * Terminates jobs in the attached state context - * - * @this AsyncKitState# - * @param {function} callback - final callback to invoke after termination - */ -function terminator(callback) -{ - if (!Object.keys(this.jobs).length) - { - return; - } - - // fast forward iteration index - this.index = this.size; - - // abort jobs - abort(this); - - // send back results we have so far - async(callback)(null, this.results); -} diff --git a/server/node_modules/asynckit/package.json b/server/node_modules/asynckit/package.json deleted file mode 100644 index 51147d6..0000000 --- a/server/node_modules/asynckit/package.json +++ /dev/null @@ -1,63 +0,0 @@ -{ - "name": "asynckit", - "version": "0.4.0", - "description": "Minimal async jobs utility library, with streams support", - "main": "index.js", - "scripts": { - "clean": "rimraf coverage", - "lint": "eslint *.js lib/*.js test/*.js", - "test": "istanbul cover --reporter=json tape -- 'test/test-*.js' | tap-spec", - "win-test": "tape test/test-*.js", - "browser": "browserify -t browserify-istanbul test/lib/browserify_adjustment.js test/test-*.js | obake --coverage | tap-spec", - "report": "istanbul report", - "size": "browserify index.js | size-table asynckit", - "debug": "tape test/test-*.js" - }, - "pre-commit": [ - "clean", - "lint", - "test", - "browser", - "report", - "size" - ], - "repository": { - "type": "git", - "url": "git+https://github.com/alexindigo/asynckit.git" - }, - "keywords": [ - "async", - "jobs", - "parallel", - "serial", - "iterator", - "array", - "object", - "stream", - "destroy", - "terminate", - "abort" - ], - "author": "Alex Indigo ", - "license": "MIT", - "bugs": { - "url": "https://github.com/alexindigo/asynckit/issues" - }, - "homepage": "https://github.com/alexindigo/asynckit#readme", - "devDependencies": { - "browserify": "^13.0.0", - "browserify-istanbul": "^2.0.0", - "coveralls": "^2.11.9", - "eslint": "^2.9.0", - "istanbul": "^0.4.3", - "obake": "^0.1.2", - "phantomjs-prebuilt": "^2.1.7", - "pre-commit": "^1.1.3", - "reamde": "^1.1.0", - "rimraf": "^2.5.2", - "size-table": "^0.2.0", - "tap-spec": "^4.1.1", - "tape": "^4.5.1" - }, - "dependencies": {} -} diff --git a/server/node_modules/asynckit/parallel.js b/server/node_modules/asynckit/parallel.js deleted file mode 100644 index 3c50344..0000000 --- a/server/node_modules/asynckit/parallel.js +++ /dev/null @@ -1,43 +0,0 @@ -var iterate = require('./lib/iterate.js') - , initState = require('./lib/state.js') - , terminator = require('./lib/terminator.js') - ; - -// Public API -module.exports = parallel; - -/** - * Runs iterator over provided array elements in parallel - * - * @param {array|object} list - array or object (named list) to iterate over - * @param {function} iterator - iterator to run - * @param {function} callback - invoked when all elements processed - * @returns {function} - jobs terminator - */ -function parallel(list, iterator, callback) -{ - var state = initState(list); - - while (state.index < (state['keyedList'] || list).length) - { - iterate(list, iterator, state, function(error, result) - { - if (error) - { - callback(error, result); - return; - } - - // looks like it's the last one - if (Object.keys(state.jobs).length === 0) - { - callback(null, state.results); - return; - } - }); - - state.index++; - } - - return terminator.bind(state, callback); -} diff --git a/server/node_modules/asynckit/serial.js b/server/node_modules/asynckit/serial.js deleted file mode 100644 index 6cd949a..0000000 --- a/server/node_modules/asynckit/serial.js +++ /dev/null @@ -1,17 +0,0 @@ -var serialOrdered = require('./serialOrdered.js'); - -// Public API -module.exports = serial; - -/** - * Runs iterator over provided array elements in series - * - * @param {array|object} list - array or object (named list) to iterate over - * @param {function} iterator - iterator to run - * @param {function} callback - invoked when all elements processed - * @returns {function} - jobs terminator - */ -function serial(list, iterator, callback) -{ - return serialOrdered(list, iterator, null, callback); -} diff --git a/server/node_modules/asynckit/serialOrdered.js b/server/node_modules/asynckit/serialOrdered.js deleted file mode 100644 index 607eafe..0000000 --- a/server/node_modules/asynckit/serialOrdered.js +++ /dev/null @@ -1,75 +0,0 @@ -var iterate = require('./lib/iterate.js') - , initState = require('./lib/state.js') - , terminator = require('./lib/terminator.js') - ; - -// Public API -module.exports = serialOrdered; -// sorting helpers -module.exports.ascending = ascending; -module.exports.descending = descending; - -/** - * Runs iterator over provided sorted array elements in series - * - * @param {array|object} list - array or object (named list) to iterate over - * @param {function} iterator - iterator to run - * @param {function} sortMethod - custom sort function - * @param {function} callback - invoked when all elements processed - * @returns {function} - jobs terminator - */ -function serialOrdered(list, iterator, sortMethod, callback) -{ - var state = initState(list, sortMethod); - - iterate(list, iterator, state, function iteratorHandler(error, result) - { - if (error) - { - callback(error, result); - return; - } - - state.index++; - - // are we there yet? - if (state.index < (state['keyedList'] || list).length) - { - iterate(list, iterator, state, iteratorHandler); - return; - } - - // done here - callback(null, state.results); - }); - - return terminator.bind(state, callback); -} - -/* - * -- Sort methods - */ - -/** - * sort helper to sort array elements in ascending order - * - * @param {mixed} a - an item to compare - * @param {mixed} b - an item to compare - * @returns {number} - comparison result - */ -function ascending(a, b) -{ - return a < b ? -1 : a > b ? 1 : 0; -} - -/** - * sort helper to sort array elements in descending order - * - * @param {mixed} a - an item to compare - * @param {mixed} b - an item to compare - * @returns {number} - comparison result - */ -function descending(a, b) -{ - return -1 * ascending(a, b); -} diff --git a/server/node_modules/asynckit/stream.js b/server/node_modules/asynckit/stream.js deleted file mode 100644 index d43465f..0000000 --- a/server/node_modules/asynckit/stream.js +++ /dev/null @@ -1,21 +0,0 @@ -var inherits = require('util').inherits - , Readable = require('stream').Readable - , ReadableAsyncKit = require('./lib/readable_asynckit.js') - , ReadableParallel = require('./lib/readable_parallel.js') - , ReadableSerial = require('./lib/readable_serial.js') - , ReadableSerialOrdered = require('./lib/readable_serial_ordered.js') - ; - -// API -module.exports = -{ - parallel : ReadableParallel, - serial : ReadableSerial, - serialOrdered : ReadableSerialOrdered, -}; - -inherits(ReadableAsyncKit, Readable); - -inherits(ReadableParallel, ReadableAsyncKit); -inherits(ReadableSerial, ReadableAsyncKit); -inherits(ReadableSerialOrdered, ReadableAsyncKit); diff --git a/server/node_modules/axios/CHANGELOG.md b/server/node_modules/axios/CHANGELOG.md deleted file mode 100644 index b190d0b..0000000 --- a/server/node_modules/axios/CHANGELOG.md +++ /dev/null @@ -1,1872 +0,0 @@ -# Changelog - -## v1.18.0 — June 13, 2026 - -This release hardens redirect and URL handling, improves the validateStatus configuration semantics, and includes updates to documentation, dependencies, and release metadata. - -## 🔒 Security Fixes - -* **Redirect Header Safety:** Added Node HTTP adapter support for stripping caller-specified sensitive headers on cross-origin redirects, helping prevent custom auth headers such as API keys from leaking to another origin. (__#10892__) - -* **URL And Request Hardening:** Rejects malformed `http:` and `https:` URLs that omit `//` with `ERR_INVALID_URL`, while tightening prototype-pollution-safe config reads, stream size limits, FormData depth handling, data URL sizing, and local `NO_PROXY` matching. (__#11000__) - -## 🐛 Bug Fixes - -* **Status Validation:** Added `transitional.validateStatusUndefinedResolves` so applications can opt in to treating `validateStatus: undefined` like the option was omitted, while `validateStatus: null` remains the explicit way to accept every status. (__#10899__) - -## 🔧 Maintenance & Chores - -* **Documentation:** Published the v1.17.0 release notes, fixed a changelog typo, clarified the package update PR policy, and marked the `proxy` request config as Node.js-only in the advanced docs. (__#10984__, __#10988__, __#10992__, __#10995__) - -* **Dependencies:** Bumped `@babel/core`, `@babel/preset-env`, `@commitlint/cli`, `@commitlint/config-conventional`, `@rollup/plugin-babel`, `@rollup/plugin-commonjs`, `@vitest/browser`, `@vitest/browser-playwright`, `eslint`, `lint-staged`, `rollup`, `vitest`, and `actions/checkout`. (__#10989__, __#10996__, __#10997__) - -* **Release Metadata:** Prepared the 1.18.0 release by updating package metadata and the runtime `VERSION` value. (__#11003__) - -## 🌟 New Contributors - -We are thrilled to welcome our new contributors. Thank you for helping improve axios: - -* __@drori12__ (__#10984__) -* __@eyupcanakman__ (__#10899__) -* __@Adi-Beker__ (__#10995__) - -[Full Changelog](https://github.com/axios/axios/compare/v1.17.0...v1.18.0) - -## v1.17.0 — June 1, 2026 - -This release adds Node HTTP zstd decompression, hardens config and release workflows, and fixes authentication, header, proxy, and type-handling regressions. - -## 🔒 Security Fixes - -* **Config Hardening:** Guarded `socketPath`, `params`, and `paramsSerializer` reads with own-property checks to prevent inherited prototype values from affecting request behavior, including SSRF-sensitive paths. (__#10901__, __#10922__) -* **Release Publishing:** Switched the publish workflow to npm staged publishing for safer, auditable package releases with provenance. (__#10926__) - -## 🚀 New Features - -* **HTTP Compression:** Added Node HTTP adapter support for zstd response decompression, with `transitional.advertiseZstdAcceptEncoding` controlling whether `zstd` is advertised in `Accept-Encoding`. (__#6792__, __#10920__) - -## 🐛 Bug Fixes - -* **Authentication Handling:** Restored Basic auth on same-origin Node redirects while continuing to strip credentials cross-origin, and aligned the fetch adapter with HTTP adapter behavior for URL-embedded Basic auth. (__#10929__, __#10896__) -* **Proxy TLS:** Preserved user `httpsAgent` TLS options when tunneling HTTPS requests through HTTP CONNECT proxies. (__#10957__) -* **React Native FormData:** Cleared default `Content-Type` for React Native `FormData` so multipart boundaries can be generated correctly. (__#10898__) -* **Headers:** Silently skipped empty or whitespace-only header names instead of throwing, matching parsed-header behavior and avoiding React Native response crashes. (__#10875__) -* **Request Data Merging:** Preserved enumerable symbol keys when cloning plain request data through axios merge logic. (__#10812__) -* **Bundler Compatibility:** Converted `resolveConfig` from an arrow default export to a named function export to avoid webpack and Babel transform interop failures. (__#10891__) -* **Types:** Corrected `AxiosHeaders.toJSON()` return types and updated CommonJS `isCancel` typings to narrow to `CanceledError`. (__#10956__, __#10952__) -* **Build Tooling:** Avoided emitting a null `Authorization` header from the GitHub build helper when `GITHUB_TOKEN` is unset. (__#10931__) - -## 🔧 Maintenance & Chores - -* **HTTP/2 Internals:** Extracted `Http2Sessions` into its own helper module and added direct unit coverage for session pooling, timeout, and cleanup behavior. (__#10861__) -* **Package Publishing:** Reduced published package size by switching to a `files` allowlist and dropping unneeded unminified bundle source maps. (__#10939__) -* **CI and Release Automation:** Added bundle-size reporting, moved reports to the job summary, fixed bundle-size comparison coverage, added Node 26 to the matrix, pinned npm for staged publishing, and prepared the 1.17.0 release. (__#10907__, __#10911__, __#10916__, __#10927__, __#10935__, __#10983__) -* **Developer Workflow:** Added a dev container and iterated on OpenSpec workflow files before removing them from the release branch. (__#10925__, __#10914__, __#10958__) -* **Documentation and Policy:** Updated disclosure, contributor, collaboration, threat-model, advanced docs, README badges, release notes, moderator configuration, and project metadata. (__#10890__, __#10889__, __#10921__, __#10945__, __#10905__, __#10933__, __#10915__, __#10887__, __#10955__) -* **Dependencies:** Bumped Babel tooling, Commitlint, ESLint, Rollup, Globals, Vitest, Playwright, `fs-extra`, `qs`, docs dependencies, and GitHub Actions dependencies including `actions/dependency-review-action` and `zizmorcore/zizmor-action`. (__#10871__, __#10879__, __#10918__, __#10919__, __#10934__, __#10947__, __#10954__, __#10960__) - -## 🌟 New Contributors - -We are thrilled to welcome our new contributors. Thank you for helping improve axios: - -* __@BasixKOR__ (__#6792__) -* __@carladams1299-lab__ (__#10861__) -* __@LaplaceYoung__ (__#10812__) -* __@JamieMagee__ (__#10939__) -* __@RonGamzu__ (__#10905__) -* __@sapirbaruch__ (__#10891__) -* __@nezukoagent__ (__#10901__) -* __@devareddy05__ (__#10929__) -* __@Mohammad-Faiz-Cloud-Engineer__ (__#10922__) -* __@azandabot__ (__#10931__) -* __@niksy__ (__#10896__) - -[Full Changelog](https://github.com/axios/axios/compare/v1.16.1...v1.17.0) - -## v1.16.1 — May 13, 2026 - -This release ships a defence-in-depth fix for prototype pollution in `formDataToJSON`, hardens proxy and CI workflows, restores Webpack 4 compatibility for the fetch adapter, and includes several small bug fixes and maintenance improvements. - -## 🔒 Security Fixes - -* **Prototype Pollution Defence-in-Depth:** Hardened `formDataToJSON` against already-polluted `Object.prototype` by walking own properties only, so attacker-controlled keys inherited from a poisoned prototype cannot propagate through deserialization. (__#7413__) -* **Proxy Cleartext Leak:** Fixed an issue where HTTPS request data could be transmitted in cleartext to an HTTP proxy under certain configurations. (__#10858__) -* **CI Cache Removal:** Removed all GitHub Actions caches as a defence-in-depth measure against cache poisoning vectors in the build pipeline. (__#10882__) - -## 🐛 Bug Fixes - -* **Data URI Parsing:** Updated the `fromDataURI` regex to match RFC 2397 more strictly, fixing edge cases in `data:` URL handling. (__#10829__) -* **Unicode Headers:** Preserved Unicode header values when running through request interceptors, so non-ASCII header content is no longer corrupted before dispatch. (__#10850__) -* **XHR Upload Progress:** Guarded against malformed `ProgressEvent` payloads emitted by some environments during XHR upload, preventing crashes when `loaded` / `total` are missing or invalid. (__#10868__) -* **Webpack 4 Fetch Adapter:** Fixed an "unexpected token" error caused by syntax in the fetch adapter that Webpack 4 could not parse, restoring compatibility for legacy bundler users. (__#10864__) -* **Type Definitions:** Made `parseReviver` `context.source` optional in the type definitions to align with the ES2023 specification. (__#10837__) -* **URL Object Support Reverted:** Reverted the change that allowed passing a `URL` object as `config.url` (originally __#10866__) due to regressions; this support will be reintroduced in a later release once the underlying issues are addressed. (__#10874__) - -## 🔧 Maintenance & Chores - -* **Cycle Detection Refactor:** Replaced the array-based cycle tracker in `toJSONObject` with a `WeakSet`, improving performance and memory behaviour on large nested structures. (__#10832__) -* **composeSignals Cleanup:** Refactored `composeSignals` to use a clearer early-return structure, simplifying the cancellation/abort composition path. (__#10844__) -* **AI Readiness & Repo Docs:** Added `AGENTS.md` and related contributor-guide updates for both human and AI agents, plus post-release documentation improvements. (__#10835__, __#10841__) -* **Docs Improvements:** Clarified the GET request example, fixed the interceptor `eject` example to reference the correct instance, and corrected the Buzzoid sponsor description in the README. (__#10836__, __#10853__, __#10856__) -* **Sponsorship Tooling:** Fixed empty sponsor arrays in the sponsor processing script, added the ability to inject additional sponsors, updated the sponsorship link, and added a Twicsy advertisement entry. (__#10843__, __#10859__, __#10869__) -* **Dependencies:** Bumped `@commitlint/cli` from 20.5.0 to 20.5.2. (__#10846__) - -## 🌟 New Contributors - -We are thrilled to welcome our new contributors. Thank you for helping improve axios: - -* __@hpinmetaverse__ (__#10836__) -* __@tommyhgunz14__ (__#7413__) -* __@abhu85__ (__#10829__) -* __@divyanshuraj1095__ (__#10853__) -* __@sagodi97__ (__#10856__) -* __@rkdfx__ (__#10868__) -* __@Liuwei1125__ (__#10866__) - -[Full Changelog](https://github.com/axios/axios/compare/v1.16.0...v1.16.1) - -## v1.16.0 — May 2, 2026 - -This release adds support for the QUERY HTTP method and a new `ECONNREFUSED` error constant, lands a substantial wave of HTTP, fetch, and XHR adapter bug fixes around redirects, aborts, headers, and timeouts, and welcomes 23 new contributors. - -## ⚠️ Notable Changes - -A handful of fixes in this release are either security-adjacent or change observable behaviour. Please review before upgrading: - -- **Fetch adapter now enforces `maxBodyLength` and `maxContentLength`.** These limits were silently ignored on the fetch adapter prior to 1.16.0 — anyone relying on them as a safety net (DoS protection, accidental large uploads) had no protection. (**#10795**) -- **Proxy requests now preserve user-supplied `Host` headers.** Previously, the proxy path could overwrite a custom `Host`. Virtual-host-style routing through a proxy will now behave correctly. (**#10822**) -- **Basic auth credentials embedded in URLs are now URL-decoded.** If you have percent-encoded credentials in a URL (e.g. `https://user:p%40ss@host`), the decoded value is what now goes on the wire. (**#10825**) -- **`parseProtocol` now strictly requires a colon in the protocol separator.** Strings that loosely parsed as protocols before may no longer match. (**#10729**) -- **Deprecated `unescape()` replaced with modern UTF-8 encoding.** Non-ASCII URL handling is now spec-correct; consumers depending on legacy `unescape()` quirks may see different output bytes. (**#7378**) -- **`transformRequest` input typing change was reverted.** The typing change introduced in #10745 was reverted in #10810 after follow-up review — net behavior is unchanged from 1.15.2. (**#10745**, **#10810**) - -## 🚀 New Features - -- **QUERY HTTP Method:** Added support for the QUERY HTTP method across adapters and type definitions. (**#10802**) -- **ECONNREFUSED Error Constant:** Exposed `ECONNREFUSED` as a constant on `AxiosError` so callers can match connection-refused failures without comparing string literals (closes #6485). (**#10680**) -- **Encode Helper Export:** Exported the internal `encode` helper from `buildURL` so userland param serializers can reuse the same encoding logic that axios uses internally. (**#6897**) - -## 🐛 Bug Fixes - -- **HTTP Adapter — Redirects & Headers:** Cleared stale headers when a redirect targets a no-proxy host, fixed the redirect listener chain so listeners no longer stack across hops, restored the missing `requestDetails` argument on `beforeRedirect`, preserved user-supplied `Host` headers when forwarding through a proxy, and properly URL-decoded basic auth credentials. (**#10794**, **#10800**, **#6241**, **#10822**, **#10825**) -- **HTTP Adapter — Streams & Timeouts:** Preserved the partial response object on `AxiosError` when a stream is aborted after headers arrive, honoured the `timeout` option during the connect phase when redirects are disabled, and resolved an unsettled-promise hang when an aborted request was combined with compression and `maxRedirects: 0`. (**#10708**, **#10819**, **#7149**) -- **Fetch Adapter:** Enforced `maxBodyLength` / `maxContentLength` in the fetch adapter, set the `User-Agent` header to match the HTTP adapter, preserved the original abort reason instead of replacing it with a generic error, and deferred global access so importing the module no longer throws a `TypeError` in restricted environments. (**#10795**, **#10772**, **#10806**, **#7260**) -- **XHR Adapter:** Unsubscribed the `cancelToken` and `AbortSignal` listeners on the error, timeout, and abort code paths to prevent leaked subscriptions. (**#10787**) -- **Error Handling:** Attached the parsed response to `AxiosError` when `JSON.parse` fails inside `dispatchRequest`, prevented `settle` from emitting `undefined` error codes, and tightened the `parseProtocol` regex to require a colon in the protocol separator. (**#10724**, **#7276**, **#10729**) -- **Types & Exports:** Aligned the CommonJS `CancelToken` typings with the ESM build, fixed a compiler error caused by `RawAxiosHeaders`, and re-exported `create` from the package index. (**#7414**, **#6389**, **#6460**) -- **UTF-8 Encoding:** Replaced the deprecated `unescape()` call with a modern UTF-8 encoding implementation. (**#7378**) -- **Misc Cleanup:** Resolved a batch of small inconsistencies and gadget-level issues across the codebase. (**#10833**) - -## 🔧 Maintenance & Chores - -- **Refactor — ES6 Modernisation:** Modernised the `utils` module and XHR adapter to use ES6 features, and tidied the multipart boundary error message. (**#10588**, **#7419**) -- **Tests:** Hardened the HTTP test server lifecycle to fix flaky `FormData` EPIPE failures, fixed Win32 platform support for the pipe tests, and corrected an incorrect test assumption. (**#10820**, **#10791**, **#10796**) -- **Docs:** Documented `paramsSerializer.encode` for strict RFC 3986 query encoding, updated the `parseReviver` TypeScript definitions and configuration docs for ES2023, added timeout guidance to the README's first async example, and expanded notes around the recent type changes. (**#10821**, **#10782**, **#10759**, **#10804**) -- **Reverted:** Reverted the `transformRequest` input typing change from #10745 after follow-up review. (**#10745**, **#10810**) -- **Dependencies:** Bumped `actions/setup-node`, the `github-actions` group, and `postcss` (in `/docs`) to their latest versions. (**#10785**, **#10813**, **#10814**) -- **Release:** Updated changelog and packages, and prepared the 1.16.0 release. (**#10790**, **#10834**) - -## 🌟 New Contributors - -We are thrilled to welcome our new contributors. Thank you for helping improve axios: - -- **@singhankit001** (**#10588**) -- **@cuiweixie** (**#7419**) -- **@iruizsalinas** (**#10787**) -- **@MarcosNocetti** (**#10680**) -- **@deepview-autofix** (**#10729**) -- **@atharvasingh7007** (**#10745**) -- **@OfekDanny** (**#10772**) -- **@mnahkies** (**#7414**) -- **@tboyila** (**#10759**) -- **@Kingo64** (**#6897**) -- **@ramram1048** (**#6389**) -- **@FLNacif** (**#6460**) -- **@zozo123** (**#10806**) -- **@pierluigilenoci** (**#10802**) -- **@afurm** (**#10708**) -- **@karan-lrn** (**#7378**) -- **@ebeigarts** (**#7149**) -- **@Raymondo97** (**#10782**) -- **@mixelburg** (**#10821**) -- **@ashishkr96** (**#10822**) -- **@cyphercodes** (**#10819**) -- **@Jye10032** (**#7260**) -- **@VeerShah41** (**#7276**) - -[Full Changelog](https://github.com/axios/axios/compare/v1.15.2...v1.16.0) - -## v1.15.2 - April 21, 2026 - -This release delivers prototype-pollution hardening for the Node HTTP adapter, adds an opt-in `allowedSocketPaths` allowlist to mitigate SSRF via Unix domain sockets, fixes a keep-alive socket memory leak, and ships supply-chain hardening across CI and security docs. - -## 🔒 Security Fixes - -- **Prototype Pollution Hardening (HTTP Adapter):** Hardened the Node HTTP adapter and `resolveConfig`/`mergeConfig`/validator paths to read only own properties and use null-prototype config objects, preventing polluted `auth`, `baseURL`, `socketPath`, `beforeRedirect`, and `insecureHTTPParser` from influencing requests. (**#10779**) -- **SSRF via `socketPath`:** Rejects non-string `socketPath` values and adds an opt-in `allowedSocketPaths` config option to restrict permitted Unix domain socket paths, returning `AxiosError` `ERR_BAD_OPTION_VALUE` on mismatch. (**#10777**) -- **Supply-chain Hardening:** Added `.npmrc` with `ignore-scripts=true`, lockfile lint CI, non-blocking reproducible build diff, scoped CODEOWNERS, expanded `SECURITY.md`/`THREATMODEL.md` with provenance verification (`npm audit signatures`), 60-day resolution policy, and maintainer incident-response runbook. (**#10776**) - -## 🚀 New Features - -- **`allowedSocketPaths` Config Option:** New request config option (and TypeScript types) to allowlist Unix domain socket paths used by the Node http adapter; backwards compatible when unset. (**#10777**) - -## 🐛 Bug Fixes - -- **Keep-alive Socket Memory Leak:** Installs a single per-socket `error` listener tracking the active request via `kAxiosSocketListener`/`kAxiosCurrentReq`, eliminating per-request listener accumulation, `MaxListenersExceededWarning`, and linear heap growth under concurrent or long-running keep-alive workloads (fixes #10780). (**#10788**) - -## 🔧 Maintenance & Chores - -- **Changelog:** Updated `CHANGELOG.md` with v1.15.1 release notes. (**#10781**) - -[Full Changelog](https://github.com/axios/axios/compare/v1.15.1...v1.15.2) - ---- - -## v1.15.1 - April 19, 2026 - -This release ships a coordinated set of security hardening fixes across headers, body/redirect limits, multipart handling, and XSRF/prototype-pollution vectors, alongside a broad sweep of bug fixes, test migrations, and threat-model documentation updates. - -## 🔒 Security Fixes - -- **Header Injection Hardening:** Tightened validation and sanitisation across request header construction to close the header-injection attack surface. (**#10749**) - -- **CRLF Stripping in Multipart Headers:** Correctly strips CR/LF from multipart header values to prevent injection via field names and filenames. (**#10758**) - -- **Prototype Pollution / Auth Bypass:** Replaced unsafe `in` checks with `hasOwnProperty` to prevent authentication bypass via prototype pollution on config objects, with additional regression tests. (**#10761**, **#10760**) - -- **`withXSRFToken` Truthy Bypass:** Short-circuits on any truthy non-boolean value, so an ambiguous config no longer silently leaks the XSRF token cross-origin. (**#10762**) - -- **`maxBodyLength` With Zero Redirects:** Enforces `maxBodyLength` even when `maxRedirects` is set to `0`, closing a bypass path for oversized request bodies. (**#10753**) - -- **Streamed Response `maxContentLength` Bypass:** Applies `maxContentLength` to streamed responses that previously bypassed the cap. (**#10754**) - -- **Follow-up CVE Completion:** Completes an earlier incomplete CVE fix to fully close the regression window. (**#10755**) - -## 🚀 New Features - -- **AI-Based Docs Translations:** Initial scaffold for AI-assisted translations of the documentation site. (**#10705**) - -- **`Location` Request Header Type:** Adds `Location` to `CommonRequestHeadersList` for accurate typing of redirect-aware requests. (**#7528**) - -## 🐛 Bug Fixes - -- **FormData Handling:** Removes `Content-Type` when no boundary is present on `FormData` fetch requests, supports multi-select fields, cancels `request.body` instead of the source stream on fetch abort, and fixes a recursion bug in form-data serialisation. (**#7314**, **#10676**, **#10702**, **#10726**) - -- **HTTP Adapter:** Handles socket-only request errors without leaking keep-alive listeners. (**#10576**) - -- **Progress Events:** Clamps `loaded` to `total` for computable upload/download progress events. (**#7458**) - -- **Types:** Aligns `runWhen` type with the runtime behaviour in `InterceptorManager` and makes response header keys case-insensitive. (**#7529**, **#10677**) - -- **`buildFullPath`:** Uses strict equality in the base/relative URL check. (**#7252**) - -- **`AxiosURLSearchParams` Regex:** Improves the regex used for param serialisation to avoid edge-case mismatches. (**#10736**) - -- **Resilient Value Parsing:** Parses out header/config values instead of throwing on malformed input. (**#10687**) - -- **Docs Artefact Cleanup:** Removes the docs content that was incorrectly committed. (**#10727**) - -## 🔧 Maintenance & Chores - -- **Threat Model & Security Docs:** Ongoing refinement of `THREATMODEL.md`, including Hopper security update, TLS and tag-replay wording, mitigation descriptions, decompression-bomb guidance, and further cleanup. (**#10672**, **#10715**, **#10718**, **#10722**, **#10763**, **#10765**) - -- **Test Coverage & Migration:** Expanded `shouldBypassProxy` coverage for wildcard/IPv6/edge cases, documented and tested `AxiosError.status`, and migrated `progressEventReducer` tests to Vitest. (**#10723**, **#10725**, **#10741**) - -- **Type Refactor:** Uses TypeScript utility types to deduplicate literal unions. (**#7520**) - -- **Repo & CI:** Adds `CODEOWNERS`, switches v1.x releases to an ephemeral release branch, and removes orphaned Bower support. (**#10739**, **#10738**, **#10746**) - -## 🌟 New Contributors - -We are thrilled to welcome our new contributors. Thank you for helping improve axios: - -- **@curiouscoder-cmd** (**#7252**) -- **@tryonelove** (**#7520**) -- **@darwin808** (**#7314**) -- **@zoontek** (**#10702**) -- **@AKIB473** (**#10725**) - -[Full Changelog](https://github.com/axios/axios/compare/v1.15.0...v1.15.1) - ---- - -## v1.15.0 - April 7, 2026 - -This release delivers two critical security patches targeting header injection and SSRF via proxy bypass, adds official runtime support for Deno and Bun, and includes significant CI security hardening. - -## 🔒 Security Fixes - -- **Header Injection (CRLF):** Rejects any header value containing `\r` or `\n` characters to block CRLF injection chains that could be used to exfiltrate cloud metadata (IMDS). Behavior change: headers with CR/LF now throw `"Invalid character in header content"`. (**#10660**) - -- **SSRF via `no_proxy` Bypass:** Introduces a `shouldBypassProxy` helper that normalises hostnames (strips trailing dots, handles bracketed IPv6) before evaluating `no_proxy`/`NO_PROXY` rules, closing a gap that could cause loopback or internal hosts to be inadvertently proxied. (**#10661**) - -## 🚀 New Features - -- **Deno & Bun Runtime Support:** Added full smoke test suites for Deno and Bun, with CI workflows that run both runtimes before any release is cut. (**#10652**) - -## 🐛 Bug Fixes - -- **Node.js v22 Compatibility:** Replaced deprecated `url.parse()` calls with the WHATWG `URL`/`URLSearchParams` API across examples, sandbox, and tests, eliminating `DEP0169` deprecation warnings on Node.js v22+. (**#10625**) - -## 🔧 Maintenance & Chores - -- **CI Security Hardening:** Added [zizmor](https://github.com/zizmorcore/zizmor) GitHub Actions security scanner; switched npm publish to OIDC Trusted Publishing (removing the long-lived `NODE_AUTH_TOKEN`); pinned all action references to full commit SHAs; narrowed workflow permissions to least privilege; gated the publish step behind a dedicated `npm-publish` environment; and blocked the sponsor-block workflow from running on forks. (**#10618**, **#10619**, **#10627**, **#10637**, **#10641**, **#10666**) - -- **Docs:** Clarified HTTP/2 support and the unsupported `httpVersion` option; added documentation for header case preservation; improved the `beforeRedirect` example to prevent accidental credential leakage. (**#10644**, **#10654**, **#10624**) - -- **Dependencies:** Bumped `picomatch`, `handlebars`, `serialize-javascript`, `vite` (×3), `denoland/setup-deno`, and 4 additional dev dependencies to latest versions. (**#10564**, **#10565**, **#10567**, **#10568**, **#10572**, **#10574**, **#10663**, **#10664**, **#10665**, **#10669**, **#10670**) - -## 🌟 New Contributors - -We are thrilled to welcome our new contributors. Thank you for helping improve axios: - -- **@Kilros0817** (**#10625**) -- **@shaanmajid** (**#10616**, **#10617**, **#10618**, **#10619**, **#10637**, **#10641**, **#10666**) -- **@ashstrc** (**#10624**, **#10644**) -- **@Abhi3975** (**#10589**) -- **@raashish1601** (**#10573**) - -[Full Changelog](https://github.com/axios/axios/compare/v1.14.0...v1.15.0) - ---- - -## v1.14.0 - March 27, 2026 - -This release fixes a security vulnerability in the `formidable` dependency, resolves a CommonJS compatibility regression, hardens proxy and HTTP/2 handling, and modernises the build and test toolchain. - -## 🔒 Security Fixes - -- **Formidable Vulnerability:** Upgraded `formidable` from v2 to v3 to address a reported arbitrary-file vulnerability. Updated test server and assertions to align with the v3 API. (**#7533**) - -## 🐛 Bug Fixes - -- **CommonJS Compatibility:** Restored `require('axios')` in Node.js by correcting the `main` field in `package.json` to point to the built CJS bundle. (**#7532**) - -- **Fetch Adapter:** Cancel the `ReadableStream` body after the request stream capability probe to prevent resource leaks. (**#7515**) - -- **Proxy:** Upgraded `proxy-from-env` to v2 and switched to the named `getProxyForUrl` export, fixing proxy detection from environment variables and resolving CJS bundling errors. (**#7499**) - -- **HTTP/2:** Close detached HTTP/2 sessions on timeout to free resources when no new requests arrive. (**#7457**) - -- **Headers:** Trim trailing CRLF characters from normalised header values. (**#7456**) - -## 🔧 Maintenance & Chores - -- **Toolchain Modernisation:** Migrated test suite to Vitest, updated ESLint to v10, upgraded Rollup and `@rollup/plugin-babel`, migrated to Husky 9, upgraded TypeScript to latest, and modernised the Express test harness. (**#7484**, **#7489**, **#7498**, **#7505**, **#7506**, **#7507**, **#7508**, **#7509**, **#7510**, **#7516**, **#7522**) - -- **Dependencies:** Bumped `multer` to v2, `minimatch`, `tar`, `pacote`, `@babel/preset-env`, and additional dev dependencies. (**#7453**, **#7480**, **#7491**, **#7504**, **#7517**, **#7531**) - -## 🌟 New Contributors - -We are thrilled to welcome our new contributors. Thank you for helping improve axios: - -- **@penkzhou** (**#7515**) -- **@aviu16** (**#7456**) -- **@fedotov** (**#7457**) - -[Full Changelog](https://github.com/axios/axios/compare/v1.13.6...v1.14.0) - ---- - -## v1.13.6 - February 27, 2026 - -This release adds React Native Blob support, fixes several enumeration and export regressions, and patches FormData detection for WeChat Mini Program environments. - -## 🚀 New Features - -- **React Native Blob Support:** Axios now correctly handles native Blob objects in React Native environments. (**#5764**) - -## 🐛 Bug Fixes - -- **AxiosError:** Fixed `AxiosError.from` not copying the `status` field from the source error. (**#7403**) - -- **AxiosError:** Made the `message` property enumerable so it appears in `JSON.stringify` output and `Object.keys`. (**#7392**) - -- **FormData Detection:** Corrected safe FormData detection for WeChat Mini Program environments. (**#7324**) - -- **React Native / Browserify Export:** Fixed broken module export that caused import failures in React Native and Browserify. (**#7386**) - -## 🔧 Maintenance & Chores - -- **Dependencies:** Migrated `@rollup/plugin-babel` from v5 to v6 and bumped the development dependencies group. (**#7424**, **#7432**) - -## 🌟 New Contributors - -We are thrilled to welcome our new contributors. Thank you for helping improve axios: - -- **@moh3n9595** (**#5764**) -- **@skrtheboss** (**#7403**) -- **@ybbus** (**#7392**) -- **@Shiwaangee** (**#7324**) -- **@Gudahtt** (**#7386**) - -[Full Changelog](https://github.com/axios/axios/compare/v1.13.5...v1.13.6) - ---- - -## v1.13.5 - February 8, 2026 - -This release patches a prototype pollution denial-of-service vulnerability, fixes a missing `status` field regression in `AxiosError`, adds interceptor ordering control, and introduces URL validation for `isAbsoluteURL`. - -## 🔒 Security Fixes - -- **Prototype Pollution (DoS):** Hardened `mergeConfig` to ignore `__proto__`, `constructor`, and `prototype` keys, preventing denial-of-service via prototype pollution when merging user-supplied config. (**#7369**) - -## 🚀 New Features - -- **`isAbsoluteURL` Validation:** Added input validation to `isAbsoluteURL` to handle malformed or unexpected input gracefully. (**#7326**) - -## 🐛 Bug Fixes - -- **AxiosError `status`:** Restored the `status` field on `AxiosError` instances, which was missing in v1.13.3 and later. (**#7368**) - -- **Interceptor Ordering:** Added a `useLegacyInterceptorOrder` option to restore pre-v1.13 interceptor execution order for applications relying on the previous behaviour. ([569f028](https://github.com/axios/axios/commit/569f028a5878faaec8d7d138ba686aac407bda4c)) - -## 🔧 Maintenance & Chores - -- **CI:** Fixed run conditions and updated workflow YAMLs. (**#7372**, **#7373**) - -- **Dependencies:** Bumped `karma-sourcemap-loader` and minor package versions. (**#7356**, **#7360**) - -## 🌟 New Contributors - -We are thrilled to welcome our new contributors. Thank you for helping improve axios: - -- **@asmitha-16** (**#7326**) - -[Full Changelog](https://github.com/axios/axios/compare/v1.13.4...v1.13.5) - ---- - -## v1.13.4 - January 27, 2026 - -Patch release fixing regressions introduced in v1.13.3, including TypeScript export compatibility and CI/build stability. - -## 🐛 Bug Fixes - -- **v1.13.3 Regressions:** Fixed multiple issues introduced by the v1.13.3 release, including broken merge configs. (**#7352**) - -- **TypeScript Exports:** Corrected TypeScript export declarations to restore proper type resolution. (**#4884**) - -## 🔧 Maintenance & Chores - -- **CI & Build:** Refactored CI pipeline and build configuration for stability. (**#7340**) - -[Full Changelog](https://github.com/axios/axios/compare/v1.13.3...v1.13.4) - ---- - -## [1.13.3](https://github.com/axios/axios/compare/v1.13.2...v1.13.3) (2026-01-20) - -### Bug Fixes - -- **http2:** Use port 443 for HTTPS connections by default. ([#7256](https://github.com/axios/axios/issues/7256)) ([d7e6065](https://github.com/axios/axios/commit/d7e60653460480ffacecf85383012ca1baa6263e)) -- **interceptor:** handle the error in the same interceptor ([#6269](https://github.com/axios/axios/issues/6269)) ([5945e40](https://github.com/axios/axios/commit/5945e40bb171d4ac4fc195df276cf952244f0f89)) -- main field in package.json should correspond to cjs artifacts ([#5756](https://github.com/axios/axios/issues/5756)) ([7373fbf](https://github.com/axios/axios/commit/7373fbff24cd92ce650d99ff6f7fe08c2e2a0a04)) -- **package.json:** add 'bun' package.json 'exports' condition. Load the Node.js build in Bun instead of the browser build ([#5754](https://github.com/axios/axios/issues/5754)) ([b89217e](https://github.com/axios/axios/commit/b89217e3e91de17a3d55e2b8f39ceb0e9d8aeda8)) -- silentJSONParsing=false should throw on invalid JSON ([#7253](https://github.com/axios/axios/issues/7253)) ([#7257](https://github.com/axios/axios/issues/7257)) ([7d19335](https://github.com/axios/axios/commit/7d19335e43d6754a1a9a66e424f7f7da259895bf)) -- turn AxiosError into a native error ([#5394](https://github.com/axios/axios/issues/5394)) ([#5558](https://github.com/axios/axios/issues/5558)) ([1c6a86d](https://github.com/axios/axios/commit/1c6a86dd2c0623ee1af043a8491dbc96d40e883b)) -- **types:** add handlers to AxiosInterceptorManager interface ([#5551](https://github.com/axios/axios/issues/5551)) ([8d1271b](https://github.com/axios/axios/commit/8d1271b49fc226ed7defd07cd577bd69a55bb13a)) -- **types:** restore AxiosError.cause type from unknown to Error ([#7327](https://github.com/axios/axios/issues/7327)) ([d8233d9](https://github.com/axios/axios/commit/d8233d9e8e9a64bfba9bbe01d475ba417510b82b)) -- unclear error message is thrown when specifying an empty proxy authorization ([#6314](https://github.com/axios/axios/issues/6314)) ([6ef867e](https://github.com/axios/axios/commit/6ef867e684adf7fb2343e3b29a79078a3c76dc29)) - -### Features - -- add `undefined` as a value in AxiosRequestConfig ([#5560](https://github.com/axios/axios/issues/5560)) ([095033c](https://github.com/axios/axios/commit/095033c626895ecdcda2288050b63dcf948db3bd)) -- add automatic minor and patch upgrades to dependabot ([#6053](https://github.com/axios/axios/issues/6053)) ([65a7584](https://github.com/axios/axios/commit/65a7584eda6164980ddb8cf5372f0afa2a04c1ed)) -- add Node.js coverage script using c8 (closes [#7289](https://github.com/axios/axios/issues/7289)) ([#7294](https://github.com/axios/axios/issues/7294)) ([ec9d94e](https://github.com/axios/axios/commit/ec9d94e9f88da13e9219acadf65061fb38ce080a)) -- added copilot instructions ([3f83143](https://github.com/axios/axios/commit/3f83143bfe617eec17f9d7dcf8bafafeeae74c26)) -- compatibility with frozen prototypes ([#6265](https://github.com/axios/axios/issues/6265)) ([860e033](https://github.com/axios/axios/commit/860e03396a536e9b926dacb6570732489c9d7012)) -- enhance pipeFileToResponse with error handling ([#7169](https://github.com/axios/axios/issues/7169)) ([88d7884](https://github.com/axios/axios/commit/88d78842541610692a04282233933d078a8a2552)) -- **types:** Intellisense for string literals in a widened union ([#6134](https://github.com/axios/axios/issues/6134)) ([f73474d](https://github.com/axios/axios/commit/f73474d02c5aa957b2daeecee65508557fd3c6e5)), closes [/github.com/microsoft/TypeScript/issues/33471#issuecomment-1376364329](https://github.com//github.com/microsoft/TypeScript/issues/33471/issues/issuecomment-1376364329) - -### Reverts - -- Revert "fix: silentJSONParsing=false should throw on invalid JSON (#7253) (#7…" (#7298) ([a4230f5](https://github.com/axios/axios/commit/a4230f5581b3f58b6ff531b6dbac377a4fd7942a)), closes [#7253](https://github.com/axios/axios/issues/7253) [#7](https://github.com/axios/axios/issues/7) [#7298](https://github.com/axios/axios/issues/7298) -- **deps:** bump peter-evans/create-pull-request from 7 to 8 in the github-actions group ([#7334](https://github.com/axios/axios/issues/7334)) ([2d6ad5e](https://github.com/axios/axios/commit/2d6ad5e48bd29b0b2b5e7e95fb473df98301543a)) - -### Contributors to this release - -- avatar [Ashvin Tiwari](https://github.com/ashvin2005 '+1752/-4 (#7218 #7218 )') -- avatar [Nikunj Mochi](https://github.com/mochinikunj '+940/-12 (#7294 #7294 )') -- avatar [Anchal Singh](https://github.com/imanchalsingh '+544/-102 (#7169 #7185 )') -- avatar [jasonsaayman](https://github.com/jasonsaayman '+317/-73 (#7334 #7298 )') -- avatar [Julian Dax](https://github.com/brodo '+99/-120 (#5558 )') -- avatar [Akash Dhar Dubey](https://github.com/AKASHDHARDUBEY '+167/-0 (#7287 #7288 )') -- avatar [Madhumita](https://github.com/madhumitaaa '+20/-68 (#7198 )') -- avatar [Tackoil](https://github.com/Tackoil '+80/-2 (#6269 )') -- avatar [Justin Dhillon](https://github.com/justindhillon '+41/-41 (#6324 #6315 )') -- avatar [Rudransh](https://github.com/Rudrxxx '+71/-2 (#7257 )') -- avatar [WuMingDao](https://github.com/WuMingDao '+36/-36 (#7215 )') -- avatar [codenomnom](https://github.com/codenomnom '+70/-0 (#7201 #7201 )') -- avatar [Nandan Acharya](https://github.com/Nandann018-ux '+60/-10 (#7272 )') -- avatar [Eric Dubé](https://github.com/KernelDeimos '+22/-40 (#7042 )') -- avatar [Tibor Pilz](https://github.com/tiborpilz '+40/-4 (#5551 )') -- avatar [Gabriel Quaresma](https://github.com/joaoGabriel55 '+31/-4 (#6314 )') -- avatar [Turadg Aleahmad](https://github.com/turadg '+23/-6 (#6265 )') -- avatar [JohnTitor](https://github.com/kiritosan '+14/-14 (#6155 )') -- avatar [rohit miryala](https://github.com/rohitmiryala '+22/-0 (#7250 )') -- avatar [Wilson Mun](https://github.com/wmundev '+20/-0 (#6053 )') -- avatar [techcodie](https://github.com/techcodie '+7/-7 (#7236 )') -- avatar [Ved Vadnere](https://github.com/Archis009 '+5/-6 (#7283 )') -- avatar [svihpinc](https://github.com/svihpinc '+5/-3 (#6134 )') -- avatar [SANDESH LENDVE](https://github.com/mrsandy1965 '+3/-3 (#7246 )') -- avatar [Lubos](https://github.com/mrlubos '+5/-1 (#7312 )') -- avatar [Jarred Sumner](https://github.com/Jarred-Sumner '+5/-1 (#5754 )') -- avatar [Adam Hines](https://github.com/thebanjomatic '+2/-1 (#5756 )') -- avatar [Subhan Kumar Rai](https://github.com/Subhan030 '+2/-1 (#7256 )') -- avatar [Joseph Frazier](https://github.com/josephfrazier '+1/-1 (#7311 )') -- avatar [KT0803](https://github.com/KT0803 '+0/-2 (#7229 )') -- avatar [Albie](https://github.com/AlbertoSadoc '+1/-1 (#5560 )') -- avatar [Jake Hayes](https://github.com/thejayhaykid '+1/-0 (#5999 )') - -## [1.13.2](https://github.com/axios/axios/compare/v1.13.1...v1.13.2) (2025-11-04) - -### Bug Fixes - -- **http:** fix 'socket hang up' bug for keep-alive requests when using timeouts; ([#7206](https://github.com/axios/axios/issues/7206)) ([8d37233](https://github.com/axios/axios/commit/8d372335f5c50ecd01e8615f2468a9eb19703117)) -- **http:** use default export for http2 module to support stubs; ([#7196](https://github.com/axios/axios/issues/7196)) ([0588880](https://github.com/axios/axios/commit/0588880ac7ddba7594ef179930493884b7e90bf5)) - -### Performance Improvements - -- **http:** fix early loop exit; ([#7202](https://github.com/axios/axios/issues/7202)) ([12c314b](https://github.com/axios/axios/commit/12c314b603e7852a157e93e47edb626a471ba6c5)) - -### Contributors to this release - -- avatar [Dmitriy Mozgovoy](https://github.com/DigitalBrainJS '+28/-9 (#7206 #7202 )') -- avatar [Kasper Isager Dalsgarð](https://github.com/kasperisager '+9/-9 (#7196 )') - -## [1.13.1](https://github.com/axios/axios/compare/v1.13.0...v1.13.1) (2025-10-28) - -### Bug Fixes - -- **http:** fixed a regression that caused the data stream to be interrupted for responses with non-OK HTTP statuses; ([#7193](https://github.com/axios/axios/issues/7193)) ([bcd5581](https://github.com/axios/axios/commit/bcd5581d208cd372055afdcb2fd10b68ca40613c)) - -### Contributors to this release - -- avatar [Anchal Singh](https://github.com/imanchalsingh '+220/-111 (#7173 )') -- avatar [Dmitriy Mozgovoy](https://github.com/DigitalBrainJS '+18/-1 (#7193 )') - -# [1.13.0](https://github.com/axios/axios/compare/v1.12.2...v1.13.0) (2025-10-27) - -### Bug Fixes - -- **fetch:** prevent TypeError when config.env is undefined ([#7155](https://github.com/axios/axios/issues/7155)) ([015faec](https://github.com/axios/axios/commit/015faeca9f26db76f9562760f04bb9f8229f4db1)) -- resolve issue [#7131](https://github.com/axios/axios/issues/7131) (added spacing in mergeConfig.js) ([#7133](https://github.com/axios/axios/issues/7133)) ([9b9ec98](https://github.com/axios/axios/commit/9b9ec98548d93e9f2204deea10a5f1528bf3ce62)) - -### Features - -- **http:** add HTTP2 support; ([#7150](https://github.com/axios/axios/issues/7150)) ([d676df7](https://github.com/axios/axios/commit/d676df772244726533ca320f42e967f5af056bac)) - -### Contributors to this release - -- avatar [Dmitriy Mozgovoy](https://github.com/DigitalBrainJS '+794/-180 (#7186 #7150 #7039 )') -- avatar [Noritaka Kobayashi](https://github.com/noritaka1166 '+24/-509 (#7032 )') -- avatar [Aviraj2929](https://github.com/Aviraj2929 '+211/-93 (#7136 #7135 #7134 #7112 )') -- avatar [prasoon patel](https://github.com/Prasoon52 '+167/-6 (#7099 )') -- avatar [Samyak Dandge](https://github.com/Samy-in '+134/-0 (#7171 )') -- avatar [Anchal Singh](https://github.com/imanchalsingh '+53/-56 (#7170 )') -- avatar [Rahul Kumar](https://github.com/jaiyankargupta '+28/-28 (#7073 )') -- avatar [Amit Verma](https://github.com/Amitverma0509 '+24/-13 (#7129 )') -- avatar [Abhishek3880](https://github.com/abhishekmaniy '+23/-4 (#7119 #7117 #7116 #7115 )') -- avatar [Dhvani Maktuporia](https://github.com/Dhvani365 '+14/-5 (#7175 )') -- avatar [Usama Ayoub](https://github.com/sam3690 '+4/-4 (#7133 )') -- avatar [ikuy1203](https://github.com/ikuy1203 '+3/-3 (#7166 )') -- avatar [Nikhil Simon Toppo](https://github.com/Kirito-Excalibur '+1/-1 (#7172 )') -- avatar [Jane Wangari](https://github.com/Wangarijane '+1/-1 (#7155 )') -- avatar [Supakorn Ieamgomol](https://github.com/Supakornn '+1/-1 (#7065 )') -- avatar [Kian-Meng Ang](https://github.com/kianmeng '+1/-1 (#7046 )') -- avatar [UTSUMI Keiji](https://github.com/k-utsumi '+1/-1 (#7037 )') - -## [1.12.2](https://github.com/axios/axios/compare/v1.12.1...v1.12.2) (2025-09-14) - -### Bug Fixes - -- **fetch:** use current global fetch instead of cached one when env fetch is not specified to keep MSW support; ([#7030](https://github.com/axios/axios/issues/7030)) ([cf78825](https://github.com/axios/axios/commit/cf78825e1229b60d1629ad0bbc8a752ff43c3f53)) - -### Contributors to this release - -- avatar [Dmitriy Mozgovoy](https://github.com/DigitalBrainJS '+247/-16 (#7030 #7022 #7024 )') -- avatar [Noritaka Kobayashi](https://github.com/noritaka1166 '+2/-6 (#7028 #7029 )') - -## [1.12.1](https://github.com/axios/axios/compare/v1.12.0...v1.12.1) (2025-09-12) - -### Bug Fixes - -- **types:** fixed env config types; ([#7020](https://github.com/axios/axios/issues/7020)) ([b5f26b7](https://github.com/axios/axios/commit/b5f26b75bdd9afa95016fb67d0cab15fc74cbf05)) - -### Contributors to this release - -- avatar [Dmitriy Mozgovoy](https://github.com/DigitalBrainJS '+10/-4 (#7020 )') - -# [1.12.0](https://github.com/axios/axios/compare/v1.11.0...v1.12.0) (2025-09-11) - -### Bug Fixes - -- adding build artifacts ([9ec86de](https://github.com/axios/axios/commit/9ec86de257bfa33856571036279169f385ed92bd)) -- dont add dist on release ([a2edc36](https://github.com/axios/axios/commit/a2edc3606a4f775d868a67bb3461ff18ce7ecd11)) -- **fetch-adapter:** set correct Content-Type for Node FormData ([#6998](https://github.com/axios/axios/issues/6998)) ([a9f47af](https://github.com/axios/axios/commit/a9f47afbf3224d2ca987dbd8188789c7ea853c5d)) -- **node:** enforce maxContentLength for data: URLs ([#7011](https://github.com/axios/axios/issues/7011)) ([945435f](https://github.com/axios/axios/commit/945435fc51467303768202250debb8d4ae892593)) -- package exports ([#5627](https://github.com/axios/axios/issues/5627)) ([aa78ac2](https://github.com/axios/axios/commit/aa78ac23fc9036163308c0f6bd2bb885e7af3f36)) -- **params:** removing '[' and ']' from URL encode exclude characters ([#3316](https://github.com/axios/axios/issues/3316)) ([#5715](https://github.com/axios/axios/issues/5715)) ([6d84189](https://github.com/axios/axios/commit/6d84189349c43b1dcdd977b522610660cc4c7042)) -- release pr run ([fd7f404](https://github.com/axios/axios/commit/fd7f404488b2c4f238c2fbe635b58026a634bfd2)) -- **types:** change the type guard on isCancel ([#5595](https://github.com/axios/axios/issues/5595)) ([0dbb7fd](https://github.com/axios/axios/commit/0dbb7fd4f61dc568498cd13a681fa7f907d6ec7e)) - -### Features - -- **adapter:** surface low‑level network error details; attach original error via cause ([#6982](https://github.com/axios/axios/issues/6982)) ([78b290c](https://github.com/axios/axios/commit/78b290c57c978ed2ab420b90d97350231c9e5d74)) -- **fetch:** add fetch, Request, Response env config variables for the adapter; ([#7003](https://github.com/axios/axios/issues/7003)) ([c959ff2](https://github.com/axios/axios/commit/c959ff29013a3bc90cde3ac7ea2d9a3f9c08974b)) -- support reviver on JSON.parse ([#5926](https://github.com/axios/axios/issues/5926)) ([2a97634](https://github.com/axios/axios/commit/2a9763426e43d996fd60d01afe63fa6e1f5b4fca)), closes [#5924](https://github.com/axios/axios/issues/5924) -- **types:** extend AxiosResponse interface to include custom headers type ([#6782](https://github.com/axios/axios/issues/6782)) ([7960d34](https://github.com/axios/axios/commit/7960d34eded2de66ffd30b4687f8da0e46c4903e)) - -### Contributors to this release - -- avatar [Willian Agostini](https://github.com/WillianAgostini '+132/-16760 (#7002 #5926 #6782 )') -- avatar [Dmitriy Mozgovoy](https://github.com/DigitalBrainJS '+4263/-293 (#7006 #7003 )') -- avatar [khani](https://github.com/mkhani01 '+111/-15 (#6982 )') -- avatar [Ameer Assadi](https://github.com/AmeerAssadi '+123/-0 (#7011 )') -- avatar [Emiedonmokumo Dick-Boro](https://github.com/emiedonmokumo '+55/-35 (#6998 )') -- avatar [Zeroday BYTE](https://github.com/opsysdebug '+8/-8 (#6980 )') -- avatar [Jason Saayman](https://github.com/jasonsaayman '+7/-7 (#6985 #6985 )') -- avatar [최예찬](https://github.com/HealGaren '+5/-7 (#5715 )') -- avatar [Gligor Kotushevski](https://github.com/gligorkot '+3/-1 (#5627 )') -- avatar [Aleksandar Dimitrov](https://github.com/adimit '+2/-1 (#5595 )') - -# [1.11.0](https://github.com/axios/axios/compare/v1.10.0...v1.11.0) (2025-07-22) - -### Bug Fixes - -- form-data npm package ([#6970](https://github.com/axios/axios/issues/6970)) ([e72c193](https://github.com/axios/axios/commit/e72c193722530db538b19e5ddaaa4544d226b253)) -- prevent RangeError when using large Buffers ([#6961](https://github.com/axios/axios/issues/6961)) ([a2214ca](https://github.com/axios/axios/commit/a2214ca1bc60540baf2c80573cea3a0ff91ba9d1)) -- **types:** resolve type discrepancies between ESM and CJS TypeScript declaration files ([#6956](https://github.com/axios/axios/issues/6956)) ([8517aa1](https://github.com/axios/axios/commit/8517aa16f8d082fc1d5309c642220fa736159110)) - -### Contributors to this release - -- avatar [izzy goldman](https://github.com/izzygld '+186/-93 (#6970 )') -- avatar [Manish Sahani](https://github.com/manishsahanidev '+70/-0 (#6961 )') -- avatar [Noritaka Kobayashi](https://github.com/noritaka1166 '+12/-10 (#6938 #6939 )') -- avatar [James Nail](https://github.com/jrnail23 '+13/-2 (#6956 )') -- avatar [Tejaswi1305](https://github.com/Tejaswi1305 '+1/-1 (#6894 )') - -# [1.10.0](https://github.com/axios/axios/compare/v1.9.0...v1.10.0) (2025-06-14) - -### Bug Fixes - -- **adapter:** pass fetchOptions to fetch function ([#6883](https://github.com/axios/axios/issues/6883)) ([0f50af8](https://github.com/axios/axios/commit/0f50af8e076b7fb403844789bd5e812dedcaf4ed)) -- **form-data:** convert boolean values to strings in FormData serialization ([#6917](https://github.com/axios/axios/issues/6917)) ([5064b10](https://github.com/axios/axios/commit/5064b108de336ff34862650709761b8a96d26be0)) -- **package:** add module entry point for React Native; ([#6933](https://github.com/axios/axios/issues/6933)) ([3d343b8](https://github.com/axios/axios/commit/3d343b86dc4fd0eea0987059c5af04327c7ae304)) - -### Features - -- **types:** improved fetchOptions interface ([#6867](https://github.com/axios/axios/issues/6867)) ([63f1fce](https://github.com/axios/axios/commit/63f1fce233009f5db1abf2586c145825ac98c3d7)) - -### Contributors to this release - -- avatar [Dmitriy Mozgovoy](https://github.com/DigitalBrainJS '+30/-19 (#6933 #6920 #6893 #6892 )') -- avatar [Noritaka Kobayashi](https://github.com/noritaka1166 '+2/-6 (#6922 #6923 )') -- avatar [Dimitrios Lazanas](https://github.com/dimitry-lzs '+4/-0 (#6917 )') -- avatar [Adrian Knapp](https://github.com/AdrianKnapp '+2/-2 (#6867 )') -- avatar [Howie Zhao](https://github.com/howiezhao '+3/-1 (#6872 )') -- avatar [Uhyeon Park](https://github.com/warpdev '+1/-1 (#6883 )') -- avatar [Sampo Silvennoinen](https://github.com/stscoundrel '+1/-1 (#6913 )') - -# [1.9.0](https://github.com/axios/axios/compare/v1.8.4...v1.9.0) (2025-04-24) - -### Bug Fixes - -- **core:** fix the Axios constructor implementation to treat the config argument as optional; ([#6881](https://github.com/axios/axios/issues/6881)) ([6c5d4cd](https://github.com/axios/axios/commit/6c5d4cd69286868059c5e52d45085cb9a894a983)) -- **fetch:** fixed ERR_NETWORK mapping for Safari browsers; ([#6767](https://github.com/axios/axios/issues/6767)) ([dfe8411](https://github.com/axios/axios/commit/dfe8411c9a082c3d068bdd1f8d6e73054f387f45)) -- **headers:** allow iterable objects to be a data source for the set method; ([#6873](https://github.com/axios/axios/issues/6873)) ([1b1f9cc](https://github.com/axios/axios/commit/1b1f9ccdc15f1ea745160ec9a5223de9db4673bc)) -- **headers:** fix `getSetCookie` by using 'get' method for caseless access; ([#6874](https://github.com/axios/axios/issues/6874)) ([d4f7df4](https://github.com/axios/axios/commit/d4f7df4b304af8b373488fdf8e830793ff843eb9)) -- **headers:** fixed support for setting multiple header values from an iterated source; ([#6885](https://github.com/axios/axios/issues/6885)) ([f7a3b5e](https://github.com/axios/axios/commit/f7a3b5e0f7e5e127b97defa92a132fbf1b55cf15)) -- **http:** send minimal end multipart boundary ([#6661](https://github.com/axios/axios/issues/6661)) ([987d2e2](https://github.com/axios/axios/commit/987d2e2dd3b362757550f36eab875e60640b6ddc)) -- **types:** fix autocomplete for adapter config ([#6855](https://github.com/axios/axios/issues/6855)) ([e61a893](https://github.com/axios/axios/commit/e61a8934d8f94dd429a2f309b48c67307c700df0)) - -### Features - -- **AxiosHeaders:** add getSetCookie method to retrieve set-cookie headers values ([#5707](https://github.com/axios/axios/issues/5707)) ([80ea756](https://github.com/axios/axios/commit/80ea756e72bcf53110fa792f5d7ab76e8b11c996)) - -### Contributors to this release - -- avatar [Dmitriy Mozgovoy](https://github.com/DigitalBrainJS '+200/-34 (#6890 #6889 #6888 #6885 #6881 #6767 #6874 #6873 )') -- avatar [Jay](https://github.com/jasonsaayman '+26/-1 ()') -- avatar [Willian Agostini](https://github.com/WillianAgostini '+21/-0 (#5707 )') -- avatar [George Cheng](https://github.com/Gerhut '+3/-3 (#5096 )') -- avatar [FatahChan](https://github.com/FatahChan '+2/-2 (#6855 )') -- avatar [Ionuț G. Stan](https://github.com/igstan '+1/-1 (#6661 )') - -## [1.8.4](https://github.com/axios/axios/compare/v1.8.3...v1.8.4) (2025-03-19) - -### Bug Fixes - -- **buildFullPath:** handle `allowAbsoluteUrls: false` without `baseURL` ([#6833](https://github.com/axios/axios/issues/6833)) ([f10c2e0](https://github.com/axios/axios/commit/f10c2e0de7fde0051f848609a29c2906d0caa1d9)) - -### Contributors to this release - -- avatar [Marc Hassan](https://github.com/mhassan1 '+5/-1 (#6833 )') - -## [1.8.3](https://github.com/axios/axios/compare/v1.8.2...v1.8.3) (2025-03-10) - -### Bug Fixes - -- add missing type for allowAbsoluteUrls ([#6818](https://github.com/axios/axios/issues/6818)) ([10fa70e](https://github.com/axios/axios/commit/10fa70ef14fe39558b15a179f0e82f5f5e5d11b2)) -- **xhr/fetch:** pass `allowAbsoluteUrls` to `buildFullPath` in `xhr` and `fetch` adapters ([#6814](https://github.com/axios/axios/issues/6814)) ([ec159e5](https://github.com/axios/axios/commit/ec159e507bdf08c04ba1a10fe7710094e9e50ec9)) - -### Contributors to this release - -- avatar [Ashcon Partovi](https://github.com/Electroid '+6/-0 (#6811 )') -- avatar [StefanBRas](https://github.com/StefanBRas '+4/-0 (#6818 )') -- avatar [Marc Hassan](https://github.com/mhassan1 '+2/-2 (#6814 )') - -## [1.8.2](https://github.com/axios/axios/compare/v1.8.1...v1.8.2) (2025-03-07) - -### Bug Fixes - -- **http-adapter:** add allowAbsoluteUrls to path building ([#6810](https://github.com/axios/axios/issues/6810)) ([fb8eec2](https://github.com/axios/axios/commit/fb8eec214ce7744b5ca787f2c3b8339b2f54b00f)) - -### Contributors to this release - -- avatar [Fasoro-Joseph Alexander](https://github.com/lexcorp16 '+1/-1 (#6810 )') - -## [1.8.1](https://github.com/axios/axios/compare/v1.8.0...v1.8.1) (2025-02-26) - -### Bug Fixes - -- **utils:** move `generateString` to platform utils to avoid importing crypto module into client builds; ([#6789](https://github.com/axios/axios/issues/6789)) ([36a5a62](https://github.com/axios/axios/commit/36a5a620bec0b181451927f13ac85b9888b86cec)) - -### Contributors to this release - -- avatar [Dmitriy Mozgovoy](https://github.com/DigitalBrainJS '+51/-47 (#6789 )') - -# [1.8.0](https://github.com/axios/axios/compare/v1.7.9...v1.8.0) (2025-02-25) - -### Bug Fixes - -- **examples:** application crashed when navigating examples in browser ([#5938](https://github.com/axios/axios/issues/5938)) ([1260ded](https://github.com/axios/axios/commit/1260ded634ec101dd5ed05d3b70f8e8f899dba6c)) -- missing word in SUPPORT_QUESTION.yml ([#6757](https://github.com/axios/axios/issues/6757)) ([1f890b1](https://github.com/axios/axios/commit/1f890b13f2c25a016f3c84ae78efb769f244133e)) -- **utils:** replace getRandomValues with crypto module ([#6788](https://github.com/axios/axios/issues/6788)) ([23a25af](https://github.com/axios/axios/commit/23a25af0688d1db2c396deb09229d2271cc24f6c)) - -### Features - -- Add config for ignoring absolute URLs ([#5902](https://github.com/axios/axios/issues/5902)) ([#6192](https://github.com/axios/axios/issues/6192)) ([32c7bcc](https://github.com/axios/axios/commit/32c7bcc0f233285ba27dec73a4b1e81fb7a219b3)) - -### Reverts - -- Revert "chore: expose fromDataToStream to be consumable (#6731)" (#6732) ([1317261](https://github.com/axios/axios/commit/1317261125e9c419fe9f126867f64d28f9c1efda)), closes [#6731](https://github.com/axios/axios/issues/6731) [#6732](https://github.com/axios/axios/issues/6732) - -### BREAKING CHANGES - -- code relying on the above will now combine the URLs instead of prefer request URL - -- feat: add config option for allowing absolute URLs - -- fix: add default value for allowAbsoluteUrls in buildFullPath - -- fix: typo in flow control when setting allowAbsoluteUrls - -### Contributors to this release - -- avatar [Michael Toscano](https://github.com/GethosTheWalrus '+42/-8 (#6192 )') -- avatar [Willian Agostini](https://github.com/WillianAgostini '+26/-3 (#6788 #6777 )') -- avatar [Naron](https://github.com/naronchen '+27/-0 (#5901 )') -- avatar [shravan || श्रvan](https://github.com/shravan20 '+7/-3 (#6116 )') -- avatar [Justin Dhillon](https://github.com/justindhillon '+0/-7 (#6312 )') -- avatar [yionr](https://github.com/yionr '+5/-1 (#6129 )') -- avatar [Shin'ya Ueoka](https://github.com/ueokande '+3/-3 (#5935 )') -- avatar [Dan Dascalescu](https://github.com/dandv '+3/-3 (#5908 #6757 )') -- avatar [Nitin Ramnani](https://github.com/NitinRamnani '+2/-2 (#5938 )') -- avatar [Shay Molcho](https://github.com/shaymolcho '+2/-2 (#6770 )') -- avatar [Jay](https://github.com/jasonsaayman '+0/-3 (#6732 )') -- fancy45daddy -- avatar [Habip Akyol](https://github.com/habipakyol '+1/-1 (#6030 )') -- avatar [Bailey Lissington](https://github.com/llamington '+1/-1 (#6771 )') -- avatar [Bernardo da Eira Duarte](https://github.com/bernardoduarte '+1/-1 (#6480 )') -- avatar [Shivam Batham](https://github.com/Shivam-Batham '+1/-1 (#5949 )') -- avatar [Lipin Kariappa](https://github.com/lipinnnnn '+1/-1 (#5936 )') - -## [1.7.9](https://github.com/axios/axios/compare/v1.7.8...v1.7.9) (2024-12-04) - -### Reverts - -- Revert "fix(types): export CJS types from ESM (#6218)" (#6729) ([c44d2f2](https://github.com/axios/axios/commit/c44d2f2316ad289b38997657248ba10de11deb6c)), closes [#6218](https://github.com/axios/axios/issues/6218) [#6729](https://github.com/axios/axios/issues/6729) - -### Contributors to this release - -- avatar [Jay](https://github.com/jasonsaayman '+596/-108 (#6729 )') - -## [1.7.8](https://github.com/axios/axios/compare/v1.7.7...v1.7.8) (2024-11-25) - -### Bug Fixes - -- allow passing a callback as paramsSerializer to buildURL ([#6680](https://github.com/axios/axios/issues/6680)) ([eac4619](https://github.com/axios/axios/commit/eac4619fe2e0926e876cd260ee21e3690381dbb5)) -- **core:** fixed config merging bug ([#6668](https://github.com/axios/axios/issues/6668)) ([5d99fe4](https://github.com/axios/axios/commit/5d99fe4491202a6268c71e5dcc09192359d73cea)) -- fixed width form to not shrink after 'Send Request' button is clicked ([#6644](https://github.com/axios/axios/issues/6644)) ([7ccd5fd](https://github.com/axios/axios/commit/7ccd5fd42402102d38712c32707bf055be72ab54)) -- **http:** add support for File objects as payload in http adapter ([#6588](https://github.com/axios/axios/issues/6588)) ([#6605](https://github.com/axios/axios/issues/6605)) ([6841d8d](https://github.com/axios/axios/commit/6841d8d18ddc71cc1bd202ffcfddb3f95622eef3)) -- **http:** fixed proxy-from-env module import ([#5222](https://github.com/axios/axios/issues/5222)) ([12b3295](https://github.com/axios/axios/commit/12b32957f1258aee94ef859809ed39f8f88f9dfa)) -- **http:** use `globalThis.TextEncoder` when available ([#6634](https://github.com/axios/axios/issues/6634)) ([df956d1](https://github.com/axios/axios/commit/df956d18febc9100a563298dfdf0f102c3d15410)) -- ios11 breaks when build ([#6608](https://github.com/axios/axios/issues/6608)) ([7638952](https://github.com/axios/axios/commit/763895270f7b50c7c780c3c9807ae8635de952cd)) -- **types:** add missing types for mergeConfig function ([#6590](https://github.com/axios/axios/issues/6590)) ([00de614](https://github.com/axios/axios/commit/00de614cd07b7149af335e202aef0e076c254f49)) -- **types:** export CJS types from ESM ([#6218](https://github.com/axios/axios/issues/6218)) ([c71811b](https://github.com/axios/axios/commit/c71811b00f2fcff558e4382ba913bdac4ad7200e)) -- updated stream aborted error message to be more clear ([#6615](https://github.com/axios/axios/issues/6615)) ([cc3217a](https://github.com/axios/axios/commit/cc3217a612024d83a663722a56d7a98d8759c6d5)) -- use URL API instead of DOM to fix a potential vulnerability warning; ([#6714](https://github.com/axios/axios/issues/6714)) ([0a8d6e1](https://github.com/axios/axios/commit/0a8d6e19da5b9899a2abafaaa06a75ee548597db)) - -### Contributors to this release - -- avatar [Remco Haszing](https://github.com/remcohaszing '+108/-596 (#6218 )') -- avatar [Jay](https://github.com/jasonsaayman '+281/-19 (#6640 #6619 )') -- avatar [Aayush Yadav](https://github.com/aayushyadav020 '+124/-111 (#6617 )') -- avatar [Dmitriy Mozgovoy](https://github.com/DigitalBrainJS '+12/-65 (#6714 )') -- avatar [Ell Bradshaw](https://github.com/cincodenada '+29/-0 (#6489 )') -- avatar [Amit Saini](https://github.com/amitsainii '+13/-3 (#5237 )') -- avatar [Tommaso Paulon](https://github.com/guuido '+14/-1 (#6680 )') -- avatar [Akki](https://github.com/Aakash-Rana '+5/-5 (#6668 )') -- avatar [Sampo Silvennoinen](https://github.com/stscoundrel '+3/-3 (#6633 )') -- avatar [Kasper Isager Dalsgarð](https://github.com/kasperisager '+2/-2 (#6634 )') -- avatar [Christian Clauss](https://github.com/cclauss '+4/-0 (#6683 )') -- avatar [Pavan Welihinda](https://github.com/pavan168 '+2/-2 (#5222 )') -- avatar [Taylor Flatt](https://github.com/taylorflatt '+2/-2 (#6615 )') -- avatar [Kenzo Wada](https://github.com/Kenzo-Wada '+2/-2 (#6608 )') -- avatar [Ngole Lawson](https://github.com/echelonnought '+3/-0 (#6644 )') -- avatar [Haven](https://github.com/Baoyx007 '+3/-0 (#6590 )') -- avatar [Shrivali Dutt](https://github.com/shrivalidutt '+1/-1 (#6637 )') -- avatar [Henco Appel](https://github.com/hencoappel '+1/-1 (#6605 )') - -## [1.7.7](https://github.com/axios/axios/compare/v1.7.6...v1.7.7) (2024-08-31) - -### Bug Fixes - -- **fetch:** fix stream handling in Safari by fallback to using a stream reader instead of an async iterator; ([#6584](https://github.com/axios/axios/issues/6584)) ([d198085](https://github.com/axios/axios/commit/d1980854fee1765cd02fa0787adf5d6e34dd9dcf)) -- **http:** fixed support for IPv6 literal strings in url ([#5731](https://github.com/axios/axios/issues/5731)) ([364993f](https://github.com/axios/axios/commit/364993f0d8bc6e0e06f76b8a35d2d0a35cab054c)) - -### Contributors to this release - -- avatar [Rishi556](https://github.com/Rishi556 '+39/-1 (#5731 )') -- avatar [Dmitriy Mozgovoy](https://github.com/DigitalBrainJS '+27/-7 (#6584 )') - -## [1.7.6](https://github.com/axios/axios/compare/v1.7.5...v1.7.6) (2024-08-30) - -### Bug Fixes - -- **fetch:** fix content length calculation for FormData payload; ([#6524](https://github.com/axios/axios/issues/6524)) ([085f568](https://github.com/axios/axios/commit/085f56861a83e9ac02c140ad9d68dac540dfeeaa)) -- **fetch:** optimize signals composing logic; ([#6582](https://github.com/axios/axios/issues/6582)) ([df9889b](https://github.com/axios/axios/commit/df9889b83c2cc37e9e6189675a73ab70c60f031f)) - -### Contributors to this release - -- avatar [Dmitriy Mozgovoy](https://github.com/DigitalBrainJS '+98/-46 (#6582 )') -- avatar [Jacques Germishuys](https://github.com/jacquesg '+5/-1 (#6524 )') -- avatar [kuroino721](https://github.com/kuroino721 '+3/-1 (#6575 )') - -## [1.7.5](https://github.com/axios/axios/compare/v1.7.4...v1.7.5) (2024-08-23) - -### Bug Fixes - -- **adapter:** fix undefined reference to hasBrowserEnv ([#6572](https://github.com/axios/axios/issues/6572)) ([7004707](https://github.com/axios/axios/commit/7004707c4180b416341863bd86913fe4fc2f1df1)) -- **core:** add the missed implementation of AxiosError#status property; ([#6573](https://github.com/axios/axios/issues/6573)) ([6700a8a](https://github.com/axios/axios/commit/6700a8adac06942205f6a7a21421ecb36c4e0852)) -- **core:** fix `ReferenceError: navigator is not defined` for custom environments; ([#6567](https://github.com/axios/axios/issues/6567)) ([fed1a4b](https://github.com/axios/axios/commit/fed1a4b2d78ed4a588c84e09d32749ed01dc2794)) -- **fetch:** fix credentials handling in Cloudflare workers ([#6533](https://github.com/axios/axios/issues/6533)) ([550d885](https://github.com/axios/axios/commit/550d885eb90fd156add7b93bbdc54d30d2f9a98d)) - -### Contributors to this release - -- avatar [Dmitriy Mozgovoy](https://github.com/DigitalBrainJS '+187/-83 (#6573 #6567 #6566 #6564 #6563 #6557 #6556 #6555 #6554 #6552 )') -- avatar [Antonin Bas](https://github.com/antoninbas '+6/-6 (#6572 )') -- avatar [Hans Otto Wirtz](https://github.com/hansottowirtz '+4/-1 (#6533 )') - -## [1.7.4](https://github.com/axios/axios/compare/v1.7.3...v1.7.4) (2024-08-13) - -### Bug Fixes - -- **sec:** CVE-2024-39338 ([#6539](https://github.com/axios/axios/issues/6539)) ([#6543](https://github.com/axios/axios/issues/6543)) ([6b6b605](https://github.com/axios/axios/commit/6b6b605eaf73852fb2dae033f1e786155959de3a)) -- **sec:** disregard protocol-relative URL to remediate SSRF ([#6539](https://github.com/axios/axios/issues/6539)) ([07a661a](https://github.com/axios/axios/commit/07a661a2a6b9092c4aa640dcc7f724ec5e65bdda)) - -### Contributors to this release - -- avatar [Lev Pachmanov](https://github.com/levpachmanov '+47/-11 (#6543 )') -- avatar [Đỗ Trọng Hải](https://github.com/hainenber '+49/-4 (#6539 )') - -## [1.7.3](https://github.com/axios/axios/compare/v1.7.2...v1.7.3) (2024-08-01) - -### Bug Fixes - -- **adapter:** fix progress event emitting; ([#6518](https://github.com/axios/axios/issues/6518)) ([e3c76fc](https://github.com/axios/axios/commit/e3c76fc9bdd03aa4d98afaf211df943e2031453f)) -- **fetch:** fix withCredentials request config ([#6505](https://github.com/axios/axios/issues/6505)) ([85d4d0e](https://github.com/axios/axios/commit/85d4d0ea0aae91082f04e303dec46510d1b4e787)) -- **xhr:** return original config on errors from XHR adapter ([#6515](https://github.com/axios/axios/issues/6515)) ([8966ee7](https://github.com/axios/axios/commit/8966ee7ea62ecbd6cfb39a905939bcdab5cf6388)) - -### Contributors to this release - -- avatar [Dmitriy Mozgovoy](https://github.com/DigitalBrainJS '+211/-159 (#6518 #6519 )') -- avatar [Valerii Sidorenko](https://github.com/ValeraS '+3/-3 (#6515 )') -- avatar [prianYu](https://github.com/prianyu '+2/-2 (#6505 )') - -## [1.7.2](https://github.com/axios/axios/compare/v1.7.1...v1.7.2) (2024-05-21) - -### Bug Fixes - -- **fetch:** enhance fetch API detection; ([#6413](https://github.com/axios/axios/issues/6413)) ([4f79aef](https://github.com/axios/axios/commit/4f79aef81b7c4644328365bfc33acf0a9ef595bc)) - -### Contributors to this release - -- avatar [Dmitriy Mozgovoy](https://github.com/DigitalBrainJS '+3/-3 (#6413 )') - -## [1.7.1](https://github.com/axios/axios/compare/v1.7.0...v1.7.1) (2024-05-20) - -### Bug Fixes - -- **fetch:** fixed ReferenceError issue when TextEncoder is not available in the environment; ([#6410](https://github.com/axios/axios/issues/6410)) ([733f15f](https://github.com/axios/axios/commit/733f15fe5bd2d67e1fadaee82e7913b70d45dc5e)) - -### Contributors to this release - -- avatar [Dmitriy Mozgovoy](https://github.com/DigitalBrainJS '+14/-9 (#6410 )') - -# [1.7.0](https://github.com/axios/axios/compare/v1.7.0-beta.2...v1.7.0) (2024-05-19) - -### Features - -- **adapter:** add fetch adapter; ([#6371](https://github.com/axios/axios/issues/6371)) ([a3ff99b](https://github.com/axios/axios/commit/a3ff99b59d8ec2ab5dd049e68c043617a4072e42)) - -### Bug Fixes - -- **core/axios:** handle un-writable error stack ([#6362](https://github.com/axios/axios/issues/6362)) ([81e0455](https://github.com/axios/axios/commit/81e0455b7b57fbaf2be16a73ebe0e6591cc6d8f9)) - -### Contributors to this release - -- avatar [Dmitriy Mozgovoy](https://github.com/DigitalBrainJS '+1015/-127 (#6371 )') -- avatar [Jay](https://github.com/jasonsaayman '+30/-14 ()') -- avatar [Alexandre ABRIOUX](https://github.com/alexandre-abrioux '+56/-6 (#6362 )') - -# [1.7.0-beta.2](https://github.com/axios/axios/compare/v1.7.0-beta.1...v1.7.0-beta.2) (2024-05-19) - -### Bug Fixes - -- **fetch:** capitalize HTTP method names; ([#6395](https://github.com/axios/axios/issues/6395)) ([ad3174a](https://github.com/axios/axios/commit/ad3174a3515c3c2573f4bcb94818d582826f3914)) -- **fetch:** fix & optimize progress capturing for cases when the request data has a nullish value or zero data length ([#6400](https://github.com/axios/axios/issues/6400)) ([95a3e8e](https://github.com/axios/axios/commit/95a3e8e346cfd6a5548e171f2341df3235d0e26b)) -- **fetch:** fix headers getting from a stream response; ([#6401](https://github.com/axios/axios/issues/6401)) ([870e0a7](https://github.com/axios/axios/commit/870e0a76f60d0094774a6a63fa606eec52a381af)) - -### Contributors to this release - -- avatar [Dmitriy Mozgovoy](https://github.com/DigitalBrainJS '+99/-46 (#6405 #6404 #6401 #6400 #6395 )') - -# [1.7.0-beta.1](https://github.com/axios/axios/compare/v1.7.0-beta.0...v1.7.0-beta.1) (2024-05-07) - -### Bug Fixes - -- **core/axios:** handle un-writable error stack ([#6362](https://github.com/axios/axios/issues/6362)) ([81e0455](https://github.com/axios/axios/commit/81e0455b7b57fbaf2be16a73ebe0e6591cc6d8f9)) -- **fetch:** fix cases when ReadableStream or Response.body are not available; ([#6377](https://github.com/axios/axios/issues/6377)) ([d1d359d](https://github.com/axios/axios/commit/d1d359da347704e8b28d768e61515a3e96c5b072)) -- **fetch:** treat fetch-related TypeError as an AxiosError.ERR_NETWORK error; ([#6380](https://github.com/axios/axios/issues/6380)) ([bb5f9a5](https://github.com/axios/axios/commit/bb5f9a5ab768452de9e166dc28d0ffc234245ef1)) - -### Contributors to this release - -- avatar [Alexandre ABRIOUX](https://github.com/alexandre-abrioux '+56/-6 (#6362 )') -- avatar [Dmitriy Mozgovoy](https://github.com/DigitalBrainJS '+42/-17 (#6380 #6377 )') - -# [1.7.0-beta.0](https://github.com/axios/axios/compare/v1.6.8...v1.7.0-beta.0) (2024-04-28) - -### Features - -- **adapter:** add fetch adapter; ([#6371](https://github.com/axios/axios/issues/6371)) ([a3ff99b](https://github.com/axios/axios/commit/a3ff99b59d8ec2ab5dd049e68c043617a4072e42)) - -### Contributors to this release - -- avatar [Dmitriy Mozgovoy](https://github.com/DigitalBrainJS '+1015/-127 (#6371 )') -- avatar [Jay](https://github.com/jasonsaayman '+30/-14 ()') - -## [1.6.8](https://github.com/axios/axios/compare/v1.6.7...v1.6.8) (2024-03-15) - -### Bug Fixes - -- **AxiosHeaders:** fix AxiosHeaders conversion to an object during config merging ([#6243](https://github.com/axios/axios/issues/6243)) ([2656612](https://github.com/axios/axios/commit/2656612bc10fe2757e9832b708ed773ab340b5cb)) -- **import:** use named export for EventEmitter; ([7320430](https://github.com/axios/axios/commit/7320430aef2e1ba2b89488a0eaf42681165498b1)) -- **vulnerability:** update follow-redirects to 1.15.6 ([#6300](https://github.com/axios/axios/issues/6300)) ([8786e0f](https://github.com/axios/axios/commit/8786e0ff55a8c68d4ca989801ad26df924042e27)) - -### Contributors to this release - -- avatar [Jay](https://github.com/jasonsaayman '+4572/-3446 (#6238 )') -- avatar [Dmitriy Mozgovoy](https://github.com/DigitalBrainJS '+30/-0 (#6231 )') -- avatar [Mitchell](https://github.com/Creaous '+9/-9 (#6300 )') -- avatar [Emmanuel](https://github.com/mannoeu '+2/-2 (#6196 )') -- avatar [Lucas Keller](https://github.com/ljkeller '+3/-0 (#6194 )') -- avatar [Aditya Mogili](https://github.com/ADITYA-176 '+1/-1 ()') -- avatar [Miroslav Petrov](https://github.com/petrovmiroslav '+1/-1 (#6243 )') - -## [1.6.7](https://github.com/axios/axios/compare/v1.6.6...v1.6.7) (2024-01-25) - -### Bug Fixes - -- capture async stack only for rejections with native error objects; ([#6203](https://github.com/axios/axios/issues/6203)) ([1a08f90](https://github.com/axios/axios/commit/1a08f90f402336e4d00e9ee82f211c6adb1640b0)) - -### Contributors to this release - -- avatar [Dmitriy Mozgovoy](https://github.com/DigitalBrainJS '+30/-26 (#6203 )') -- avatar [zhoulixiang](https://github.com/zh-lx '+0/-3 (#6186 )') - -## [1.6.6](https://github.com/axios/axios/compare/v1.6.5...v1.6.6) (2024-01-24) - -### Bug Fixes - -- fixed missed dispatchBeforeRedirect argument ([#5778](https://github.com/axios/axios/issues/5778)) ([a1938ff](https://github.com/axios/axios/commit/a1938ff073fcb0f89011f001dfbc1fa1dc995e39)) -- wrap errors to improve async stack trace ([#5987](https://github.com/axios/axios/issues/5987)) ([123f354](https://github.com/axios/axios/commit/123f354b920f154a209ea99f76b7b2ef3d9ebbab)) - -### Contributors to this release - -- avatar [Ilya Priven](https://github.com/ikonst '+91/-8 (#5987 )') -- avatar [Zao Soula](https://github.com/zaosoula '+6/-6 (#5778 )') - -## [1.6.5](https://github.com/axios/axios/compare/v1.6.4...v1.6.5) (2024-01-05) - -### Bug Fixes - -- **ci:** refactor notify action as a job of publish action; ([#6176](https://github.com/axios/axios/issues/6176)) ([0736f95](https://github.com/axios/axios/commit/0736f95ce8776366dc9ca569f49ba505feb6373c)) -- **dns:** fixed lookup error handling; ([#6175](https://github.com/axios/axios/issues/6175)) ([f4f2b03](https://github.com/axios/axios/commit/f4f2b039dd38eb4829e8583caede4ed6d2dd59be)) - -### Contributors to this release - -- avatar [Dmitriy Mozgovoy](https://github.com/DigitalBrainJS '+41/-6 (#6176 #6175 )') -- avatar [Jay](https://github.com/jasonsaayman '+6/-1 ()') - -## [1.6.4](https://github.com/axios/axios/compare/v1.6.3...v1.6.4) (2024-01-03) - -### Bug Fixes - -- **security:** fixed formToJSON prototype pollution vulnerability; ([#6167](https://github.com/axios/axios/issues/6167)) ([3c0c11c](https://github.com/axios/axios/commit/3c0c11cade045c4412c242b5727308cff9897a0e)) -- **security:** fixed security vulnerability in follow-redirects ([#6163](https://github.com/axios/axios/issues/6163)) ([75af1cd](https://github.com/axios/axios/commit/75af1cdff5b3a6ca3766d3d3afbc3115bb0811b8)) - -### Contributors to this release - -- avatar [Jay](https://github.com/jasonsaayman '+34/-6 ()') -- avatar [Dmitriy Mozgovoy](https://github.com/DigitalBrainJS '+34/-3 (#6172 #6167 )') -- avatar [Guy Nesher](https://github.com/gnesher '+10/-10 (#6163 )') - -## [1.6.3](https://github.com/axios/axios/compare/v1.6.2...v1.6.3) (2023-12-26) - -### Bug Fixes - -- Regular Expression Denial of Service (ReDoS) ([#6132](https://github.com/axios/axios/issues/6132)) ([5e7ad38](https://github.com/axios/axios/commit/5e7ad38fb0f819fceb19fb2ee5d5d38f56aa837d)) - -### Contributors to this release - -- avatar [Jay](https://github.com/jasonsaayman '+15/-6 (#6145 )') -- avatar [Willian Agostini](https://github.com/WillianAgostini '+17/-2 (#6132 )') -- avatar [Dmitriy Mozgovoy](https://github.com/DigitalBrainJS '+3/-0 (#6084 )') - -## [1.6.2](https://github.com/axios/axios/compare/v1.6.1...v1.6.2) (2023-11-14) - -### Features - -- **withXSRFToken:** added withXSRFToken option as a workaround to achieve the old `withCredentials` behavior; ([#6046](https://github.com/axios/axios/issues/6046)) ([cff9967](https://github.com/axios/axios/commit/cff996779b272a5e94c2b52f5503ccf668bc42dc)) - -### PRs - -- feat(withXSRFToken): added withXSRFToken option as a workaround to achieve the old `withCredentials` behavior; ( [#6046](https://api.github.com/repos/axios/axios/pulls/6046) ) - -``` - -📢 This PR added 'withXSRFToken' option as a replacement for old withCredentials behaviour. -You should now use withXSRFToken along with withCredential to get the old behavior. -This functionality is considered as a fix. -``` - -### Contributors to this release - -- avatar [Dmitriy Mozgovoy](https://github.com/DigitalBrainJS '+271/-146 (#6081 #6080 #6079 #6078 #6046 #6064 #6063 )') -- avatar [Ng Choon Khon (CK)](https://github.com/ckng0221 '+4/-4 (#6073 )') -- avatar [Muhammad Noman](https://github.com/mnomanmemon '+2/-2 (#6048 )') - -## [1.6.1](https://github.com/axios/axios/compare/v1.6.0...v1.6.1) (2023-11-08) - -### Bug Fixes - -- **formdata:** fixed content-type header normalization for non-standard browser environments; ([#6056](https://github.com/axios/axios/issues/6056)) ([dd465ab](https://github.com/axios/axios/commit/dd465ab22bbfa262c6567be6574bf46a057d5288)) -- **platform:** fixed emulated browser detection in node.js environment; ([#6055](https://github.com/axios/axios/issues/6055)) ([3dc8369](https://github.com/axios/axios/commit/3dc8369e505e32a4e12c22f154c55fd63ac67fbb)) - -### Contributors to this release - -- avatar [Dmitriy Mozgovoy](https://github.com/DigitalBrainJS '+432/-65 (#6059 #6056 #6055 )') -- avatar [Fabian Meyer](https://github.com/meyfa '+5/-2 (#5835 )') - -### PRs - -- feat(withXSRFToken): added withXSRFToken option as a workaround to achieve the old `withCredentials` behavior; ( [#6046](https://api.github.com/repos/axios/axios/pulls/6046) ) - -``` - -📢 This PR added 'withXSRFToken' option as a replacement for old withCredentials behaviour. -You should now use withXSRFToken along with withCredential to get the old behavior. -This functionality is considered as a fix. -``` - -# [1.6.0](https://github.com/axios/axios/compare/v1.5.1...v1.6.0) (2023-10-26) - -### Bug Fixes - -- **CSRF:** fixed CSRF vulnerability CVE-2023-45857 ([#6028](https://github.com/axios/axios/issues/6028)) ([96ee232](https://github.com/axios/axios/commit/96ee232bd3ee4de2e657333d4d2191cd389e14d0)) -- **dns:** fixed lookup function decorator to work properly in node v20; ([#6011](https://github.com/axios/axios/issues/6011)) ([5aaff53](https://github.com/axios/axios/commit/5aaff532a6b820bb9ab6a8cd0f77131b47e2adb8)) -- **types:** fix AxiosHeaders types; ([#5931](https://github.com/axios/axios/issues/5931)) ([a1c8ad0](https://github.com/axios/axios/commit/a1c8ad008b3c13d53e135bbd0862587fb9d3fc09)) - -### PRs - -- CVE 2023 45857 ( [#6028](https://api.github.com/repos/axios/axios/pulls/6028) ) - -``` - -⚠️ Critical vulnerability fix. See https://security.snyk.io/vuln/SNYK-JS-AXIOS-6032459 -``` - -### Contributors to this release - -- avatar [Dmitriy Mozgovoy](https://github.com/DigitalBrainJS '+449/-114 (#6032 #6021 #6011 #5932 #5931 )') -- avatar [Valentin Panov](https://github.com/valentin-panov '+4/-4 (#6028 )') -- avatar [Rinku Chaudhari](https://github.com/therealrinku '+1/-1 (#5889 )') - -## [1.5.1](https://github.com/axios/axios/compare/v1.5.0...v1.5.1) (2023-09-26) - -### Bug Fixes - -- **adapters:** improved adapters loading logic to have clear error messages; ([#5919](https://github.com/axios/axios/issues/5919)) ([e410779](https://github.com/axios/axios/commit/e4107797a7a1376f6209fbecfbbce73d3faa7859)) -- **formdata:** fixed automatic addition of the `Content-Type` header for FormData in non-browser environments; ([#5917](https://github.com/axios/axios/issues/5917)) ([bc9af51](https://github.com/axios/axios/commit/bc9af51b1886d1b3529617702f2a21a6c0ed5d92)) -- **headers:** allow `content-encoding` header to handle case-insensitive values ([#5890](https://github.com/axios/axios/issues/5890)) ([#5892](https://github.com/axios/axios/issues/5892)) ([4c89f25](https://github.com/axios/axios/commit/4c89f25196525e90a6e75eda9cb31ae0a2e18acd)) -- **types:** removed duplicated code ([9e62056](https://github.com/axios/axios/commit/9e6205630e1c9cf863adf141c0edb9e6d8d4b149)) - -### Contributors to this release - -- avatar [Dmitriy Mozgovoy](https://github.com/DigitalBrainJS '+89/-18 (#5919 #5917 )') -- avatar [David Dallas](https://github.com/DavidJDallas '+11/-5 ()') -- avatar [Sean Sattler](https://github.com/fb-sean '+2/-8 ()') -- avatar [Mustafa Ateş Uzun](https://github.com/0o001 '+4/-4 ()') -- avatar [Przemyslaw Motacki](https://github.com/sfc-gh-pmotacki '+2/-1 (#5892 )') -- avatar [Michael Di Prisco](https://github.com/Cadienvan '+1/-1 ()') - -### PRs - -- CVE 2023 45857 ( [#6028](https://api.github.com/repos/axios/axios/pulls/6028) ) - -``` - -⚠️ Critical vulnerability fix. See https://security.snyk.io/vuln/SNYK-JS-AXIOS-6032459 -``` - -# [1.5.0](https://github.com/axios/axios/compare/v1.4.0...v1.5.0) (2023-08-26) - -### Bug Fixes - -- **adapter:** make adapter loading error more clear by using platform-specific adapters explicitly ([#5837](https://github.com/axios/axios/issues/5837)) ([9a414bb](https://github.com/axios/axios/commit/9a414bb6c81796a95c6c7fe668637825458e8b6d)) -- **dns:** fixed `cacheable-lookup` integration; ([#5836](https://github.com/axios/axios/issues/5836)) ([b3e327d](https://github.com/axios/axios/commit/b3e327dcc9277bdce34c7ef57beedf644b00d628)) -- **headers:** added support for setting header names that overlap with class methods; ([#5831](https://github.com/axios/axios/issues/5831)) ([d8b4ca0](https://github.com/axios/axios/commit/d8b4ca0ea5f2f05efa4edfe1e7684593f9f68273)) -- **headers:** fixed common Content-Type header merging; ([#5832](https://github.com/axios/axios/issues/5832)) ([8fda276](https://github.com/axios/axios/commit/8fda2766b1e6bcb72c3fabc146223083ef13ce17)) - -### Features - -- export getAdapter function ([#5324](https://github.com/axios/axios/issues/5324)) ([ca73eb8](https://github.com/axios/axios/commit/ca73eb878df0ae2dace81fe3a7f1fb5986231bf1)) -- **export:** export adapters without `unsafe` prefix ([#5839](https://github.com/axios/axios/issues/5839)) ([1601f4a](https://github.com/axios/axios/commit/1601f4a27a81ab47fea228f1e244b2c4e3ce28bf)) - -### Contributors to this release - -- avatar [Dmitriy Mozgovoy](https://github.com/DigitalBrainJS '+66/-29 (#5839 #5837 #5836 #5832 #5831 )') -- avatar [夜葬](https://github.com/geekact '+42/-0 (#5324 )') -- avatar [Jonathan Budiman](https://github.com/JBudiman00 '+30/-0 (#5788 )') -- avatar [Michael Di Prisco](https://github.com/Cadienvan '+3/-5 (#5791 )') - -### PRs - -- CVE 2023 45857 ( [#6028](https://api.github.com/repos/axios/axios/pulls/6028) ) - -``` - -⚠️ Critical vulnerability fix. See https://security.snyk.io/vuln/SNYK-JS-AXIOS-6032459 -``` - -# [1.4.0](https://github.com/axios/axios/compare/v1.3.6...v1.4.0) (2023-04-27) - -### Bug Fixes - -- **formdata:** add `multipart/form-data` content type for FormData payload on custom client environments; ([#5678](https://github.com/axios/axios/issues/5678)) ([bbb61e7](https://github.com/axios/axios/commit/bbb61e70cb1185adfb1cbbb86eaf6652c48d89d1)) -- **package:** export package internals with unsafe path prefix; ([#5677](https://github.com/axios/axios/issues/5677)) ([df38c94](https://github.com/axios/axios/commit/df38c949f26414d88ba29ec1e353c4d4f97eaf09)) - -### Features - -- **dns:** added support for a custom lookup function; ([#5339](https://github.com/axios/axios/issues/5339)) ([2701911](https://github.com/axios/axios/commit/2701911260a1faa5cc5e1afe437121b330a3b7bb)) -- **types:** export `AxiosHeaderValue` type. ([#5525](https://github.com/axios/axios/issues/5525)) ([726f1c8](https://github.com/axios/axios/commit/726f1c8e00cffa0461a8813a9bdcb8f8b9d762cf)) - -### Performance Improvements - -- **merge-config:** optimize mergeConfig performance by avoiding duplicate key visits; ([#5679](https://github.com/axios/axios/issues/5679)) ([e6f7053](https://github.com/axios/axios/commit/e6f7053bf1a3e87cf1f9da8677e12e3fe829d68e)) - -### Contributors to this release - -- avatar [Dmitriy Mozgovoy](https://github.com/DigitalBrainJS '+151/-16 (#5684 #5339 #5679 #5678 #5677 )') -- avatar [Arthur Fiorette](https://github.com/arthurfiorette '+19/-19 (#5525 )') -- avatar [PIYUSH NEGI](https://github.com/npiyush97 '+2/-18 (#5670 )') - -### PRs - -- CVE 2023 45857 ( [#6028](https://api.github.com/repos/axios/axios/pulls/6028) ) - -``` - -⚠️ Critical vulnerability fix. See https://security.snyk.io/vuln/SNYK-JS-AXIOS-6032459 -``` - -## [1.3.6](https://github.com/axios/axios/compare/v1.3.5...v1.3.6) (2023-04-19) - -### Bug Fixes - -- **types:** added transport to RawAxiosRequestConfig ([#5445](https://github.com/axios/axios/issues/5445)) ([6f360a2](https://github.com/axios/axios/commit/6f360a2531d8d70363fd9becef6a45a323f170e2)) -- **utils:** make isFormData detection logic stricter to avoid unnecessary calling of the `toString` method on the target; ([#5661](https://github.com/axios/axios/issues/5661)) ([aa372f7](https://github.com/axios/axios/commit/aa372f7306295dfd1100c1c2c77ce95c95808e76)) - -### Contributors to this release - -- avatar [Dmitriy Mozgovoy](https://github.com/DigitalBrainJS '+48/-10 (#5665 #5661 #5663 )') -- avatar [Michael Di Prisco](https://github.com/Cadienvan '+2/-0 (#5445 )') - -### PRs - -- CVE 2023 45857 ( [#6028](https://api.github.com/repos/axios/axios/pulls/6028) ) - -``` - -⚠️ Critical vulnerability fix. See https://security.snyk.io/vuln/SNYK-JS-AXIOS-6032459 -``` - -## [1.3.5](https://github.com/axios/axios/compare/v1.3.4...v1.3.5) (2023-04-05) - -### Bug Fixes - -- **headers:** fixed isValidHeaderName to support full list of allowed characters; ([#5584](https://github.com/axios/axios/issues/5584)) ([e7decef](https://github.com/axios/axios/commit/e7decef6a99f4627e27ed9ea5b00ce8e201c3841)) -- **params:** re-added the ability to set the function as `paramsSerializer` config; ([#5633](https://github.com/axios/axios/issues/5633)) ([a56c866](https://github.com/axios/axios/commit/a56c8661209d5ce5a645a05f294a0e08a6c1f6b3)) - -### Contributors to this release - -- avatar [Dmitriy Mozgovoy](https://github.com/DigitalBrainJS '+28/-10 (#5633 #5584 )') - -### PRs - -- CVE 2023 45857 ( [#6028](https://api.github.com/repos/axios/axios/pulls/6028) ) - -``` - -⚠️ Critical vulnerability fix. See https://security.snyk.io/vuln/SNYK-JS-AXIOS-6032459 -``` - -## [1.3.4](https://github.com/axios/axios/compare/v1.3.3...v1.3.4) (2023-02-22) - -### Bug Fixes - -- **blob:** added a check to make sure the Blob class is available in the browser's global scope; ([#5548](https://github.com/axios/axios/issues/5548)) ([3772c8f](https://github.com/axios/axios/commit/3772c8fe74112a56e3e9551f894d899bc3a9443a)) -- **http:** fixed regression bug when handling synchronous errors inside the adapter; ([#5564](https://github.com/axios/axios/issues/5564)) ([a3b246c](https://github.com/axios/axios/commit/a3b246c9de5c3bc4b5a742e15add55b375479451)) - -### Contributors to this release - -- avatar [Dmitriy Mozgovoy](https://github.com/DigitalBrainJS '+38/-26 (#5564 )') -- avatar [lcysgsg](https://github.com/lcysgsg '+4/-0 (#5548 )') -- avatar [Michael Di Prisco](https://github.com/Cadienvan '+3/-0 (#5444 )') - -### PRs - -- CVE 2023 45857 ( [#6028](https://api.github.com/repos/axios/axios/pulls/6028) ) - -``` - -⚠️ Critical vulnerability fix. See https://security.snyk.io/vuln/SNYK-JS-AXIOS-6032459 -``` - -## [1.3.3](https://github.com/axios/axios/compare/v1.3.2...v1.3.3) (2023-02-13) - -### Bug Fixes - -- **formdata:** added a check to make sure the FormData class is available in the browser's global scope; ([#5545](https://github.com/axios/axios/issues/5545)) ([a6dfa72](https://github.com/axios/axios/commit/a6dfa72010db5ad52db8bd13c0f98e537e8fd05d)) -- **formdata:** fixed setting NaN as Content-Length for form payload in some cases; ([#5535](https://github.com/axios/axios/issues/5535)) ([c19f7bf](https://github.com/axios/axios/commit/c19f7bf770f90ae8307f4ea3104f227056912da1)) -- **headers:** fixed the filtering logic of the clear method; ([#5542](https://github.com/axios/axios/issues/5542)) ([ea87ebf](https://github.com/axios/axios/commit/ea87ebfe6d1699af072b9e7cd40faf8f14b0ab93)) - -### Contributors to this release - -- avatar [Dmitriy Mozgovoy](https://github.com/DigitalBrainJS '+11/-7 (#5545 #5535 #5542 )') -- avatar [陈若枫](https://github.com/ruofee '+2/-2 (#5467 )') - -### PRs - -- CVE 2023 45857 ( [#6028](https://api.github.com/repos/axios/axios/pulls/6028) ) - -``` - -⚠️ Critical vulnerability fix. See https://security.snyk.io/vuln/SNYK-JS-AXIOS-6032459 -``` - -## [1.3.2](https://github.com/axios/axios/compare/v1.3.1...v1.3.2) (2023-02-03) - -### Bug Fixes - -- **http:** treat http://localhost as base URL for relative paths to avoid `ERR_INVALID_URL` error; ([#5528](https://github.com/axios/axios/issues/5528)) ([128d56f](https://github.com/axios/axios/commit/128d56f4a0fb8f5f2ed6e0dd80bc9225fee9538c)) -- **http:** use explicit import instead of TextEncoder global; ([#5530](https://github.com/axios/axios/issues/5530)) ([6b3c305](https://github.com/axios/axios/commit/6b3c305fc40c56428e0afabedc6f4d29c2830f6f)) - -### Contributors to this release - -- avatar [Dmitriy Mozgovoy](https://github.com/DigitalBrainJS '+2/-1 (#5530 #5528 )') - -### PRs - -- CVE 2023 45857 ( [#6028](https://api.github.com/repos/axios/axios/pulls/6028) ) - -``` - -⚠️ Critical vulnerability fix. See https://security.snyk.io/vuln/SNYK-JS-AXIOS-6032459 -``` - -## [1.3.1](https://github.com/axios/axios/compare/v1.3.0...v1.3.1) (2023-02-01) - -### Bug Fixes - -- **formdata:** add hotfix to use the asynchronous API to compute the content-length header value; ([#5521](https://github.com/axios/axios/issues/5521)) ([96d336f](https://github.com/axios/axios/commit/96d336f527619f21da012fe1f117eeb53e5a2120)) -- **serializer:** fixed serialization of array-like objects; ([#5518](https://github.com/axios/axios/issues/5518)) ([08104c0](https://github.com/axios/axios/commit/08104c028c0f9353897b1b6691d74c440fd0c32d)) - -### Contributors to this release - -- avatar [Dmitriy Mozgovoy](https://github.com/DigitalBrainJS '+27/-8 (#5521 #5518 )') - -### PRs - -- CVE 2023 45857 ( [#6028](https://api.github.com/repos/axios/axios/pulls/6028) ) - -``` - -⚠️ Critical vulnerability fix. See https://security.snyk.io/vuln/SNYK-JS-AXIOS-6032459 -``` - -# [1.3.0](https://github.com/axios/axios/compare/v1.2.6...v1.3.0) (2023-01-31) - -### Bug Fixes - -- **headers:** fixed & optimized clear method; ([#5507](https://github.com/axios/axios/issues/5507)) ([9915635](https://github.com/axios/axios/commit/9915635c69d0ab70daca5738488421f67ca60959)) -- **http:** add zlib headers if missing ([#5497](https://github.com/axios/axios/issues/5497)) ([65e8d1e](https://github.com/axios/axios/commit/65e8d1e28ce829f47a837e45129730e541950d3c)) - -### Features - -- **fomdata:** added support for spec-compliant FormData & Blob types; ([#5316](https://github.com/axios/axios/issues/5316)) ([6ac574e](https://github.com/axios/axios/commit/6ac574e00a06731288347acea1e8246091196953)) - -### Contributors to this release - -- avatar [Dmitriy Mozgovoy](https://github.com/DigitalBrainJS '+352/-67 (#5514 #5512 #5510 #5509 #5508 #5316 #5507 )') -- avatar [ItsNotGoodName](https://github.com/ItsNotGoodName '+43/-2 (#5497 )') - -### PRs - -- CVE 2023 45857 ( [#6028](https://api.github.com/repos/axios/axios/pulls/6028) ) - -``` - -⚠️ Critical vulnerability fix. See https://security.snyk.io/vuln/SNYK-JS-AXIOS-6032459 -``` - -## [1.2.6](https://github.com/axios/axios/compare/v1.2.5...v1.2.6) (2023-01-28) - -### Bug Fixes - -- **headers:** added missed Authorization accessor; ([#5502](https://github.com/axios/axios/issues/5502)) ([342c0ba](https://github.com/axios/axios/commit/342c0ba9a16ea50f5ed7d2366c5c1a2c877e3f26)) -- **types:** fixed `CommonRequestHeadersList` & `CommonResponseHeadersList` types to be private in commonJS; ([#5503](https://github.com/axios/axios/issues/5503)) ([5a3d0a3](https://github.com/axios/axios/commit/5a3d0a3234d77361a1bc7cedee2da1e11df08e2c)) - -### Contributors to this release - -- ![avatar](https://avatars.githubusercontent.com/u/12586868?v=4&s=16) [Dmitriy Mozgovoy](https://github.com/DigitalBrainJS '+24/-9 (#5503 #5502 )') - -### PRs - -- CVE 2023 45857 ( [#6028](https://api.github.com/repos/axios/axios/pulls/6028) ) - -``` - -⚠️ Critical vulnerability fix. See https://security.snyk.io/vuln/SNYK-JS-AXIOS-6032459 -``` - -## [1.2.5](https://github.com/axios/axios/compare/v1.2.4...v1.2.5) (2023-01-26) - -### Bug Fixes - -- **types:** fixed AxiosHeaders to handle spread syntax by making all methods non-enumerable; ([#5499](https://github.com/axios/axios/issues/5499)) ([580f1e8](https://github.com/axios/axios/commit/580f1e8033a61baa38149d59fd16019de3932c22)) - -### Contributors to this release - -- ![avatar](https://avatars.githubusercontent.com/u/12586868?v=4&s=16) [Dmitriy Mozgovoy](https://github.com/DigitalBrainJS '+82/-54 (#5499 )') -- ![avatar](https://avatars.githubusercontent.com/u/20516159?v=4&s=16) [Elliot Ford](https://github.com/EFord36 '+1/-1 (#5462 )') - -### PRs - -- CVE 2023 45857 ( [#6028](https://api.github.com/repos/axios/axios/pulls/6028) ) - -``` - -⚠️ Critical vulnerability fix. See https://security.snyk.io/vuln/SNYK-JS-AXIOS-6032459 -``` - -## [1.2.4](https://github.com/axios/axios/compare/v1.2.3...v1.2.4) (2023-01-22) - -### Bug Fixes - -- **types:** renamed `RawAxiosRequestConfig` back to `AxiosRequestConfig`; ([#5486](https://github.com/axios/axios/issues/5486)) ([2a71f49](https://github.com/axios/axios/commit/2a71f49bc6c68495fa419003a3107ed8bd703ad0)) -- **types:** fix `AxiosRequestConfig` generic; ([#5478](https://github.com/axios/axios/issues/5478)) ([9bce81b](https://github.com/axios/axios/commit/186ea062da8b7d578ae78b1a5c220986b9bce81b)) - -### Contributors to this release - -- ![avatar](https://avatars.githubusercontent.com/u/12586868?v=4&s=16) [Dmitriy Mozgovoy](https://github.com/DigitalBrainJS '+242/-108 (#5486 #5482 )') -- ![avatar](https://avatars.githubusercontent.com/u/9430821?v=4&s=16) [Daniel Hillmann](https://github.com/hilleer '+1/-1 (#5478 )') - -### PRs - -- CVE 2023 45857 ( [#6028](https://api.github.com/repos/axios/axios/pulls/6028) ) - -``` - -⚠️ Critical vulnerability fix. See https://security.snyk.io/vuln/SNYK-JS-AXIOS-6032459 -``` - -## [1.2.3](https://github.com/axios/axios/compare/1.2.2...1.2.3) (2023-01-10) - -### Bug Fixes - -- **types:** fixed AxiosRequestConfig header interface by refactoring it to RawAxiosRequestConfig; ([#5420](https://github.com/axios/axios/issues/5420)) ([0811963](https://github.com/axios/axios/commit/08119634a22f1d5b19f5c9ea0adccb6d3eebc3bc)) - -### Contributors to this release - -- ![avatar](https://avatars.githubusercontent.com/u/12586868?v=4&s=16) [Dmitriy Mozgovoy](https://github.com/DigitalBrainJS '+938/-442 (#5456 #5455 #5453 #5451 #5449 #5447 #5446 #5443 #5442 #5439 #5420 )') - -### PRs - -- CVE 2023 45857 ( [#6028](https://api.github.com/repos/axios/axios/pulls/6028) ) - -``` - -⚠️ Critical vulnerability fix. See https://security.snyk.io/vuln/SNYK-JS-AXIOS-6032459 -``` - -## [1.2.2] - 2022-12-29 - -### Fixed - -- fix(ci): fix release script inputs [#5392](https://github.com/axios/axios/pull/5392) -- fix(ci): prerelease scipts [#5377](https://github.com/axios/axios/pull/5377) -- fix(ci): release scripts [#5376](https://github.com/axios/axios/pull/5376) -- fix(ci): typescript tests [#5375](https://github.com/axios/axios/pull/5375) -- fix: Brotli decompression [#5353](https://github.com/axios/axios/pull/5353) -- fix: add missing HttpStatusCode [#5345](https://github.com/axios/axios/pull/5345) - -### Chores - -- chore(ci): set conventional-changelog header config [#5406](https://github.com/axios/axios/pull/5406) -- chore(ci): fix automatic contributors resolving [#5403](https://github.com/axios/axios/pull/5403) -- chore(ci): improved logging for the contributors list generator [#5398](https://github.com/axios/axios/pull/5398) -- chore(ci): fix release action [#5397](https://github.com/axios/axios/pull/5397) -- chore(ci): fix version bump script by adding bump argument for target version [#5393](https://github.com/axios/axios/pull/5393) -- chore(deps): bump decode-uri-component from 0.2.0 to 0.2.2 [#5342](https://github.com/axios/axios/pull/5342) -- chore(ci): GitHub Actions Release script [#5384](https://github.com/axios/axios/pull/5384) -- chore(ci): release scripts [#5364](https://github.com/axios/axios/pull/5364) - -### Contributors to this release - -- ![avatar](https://avatars.githubusercontent.com/u/12586868?v=4&s=16) [Dmitriy Mozgovoy](https://github.com/DigitalBrainJS) -- ![avatar](https://avatars.githubusercontent.com/u/1652293?v=4&s=16) [Winnie](https://github.com/winniehell) - -## [1.2.1] - 2022-12-05 - -### Changed - -- feat(exports): export mergeConfig [#5151](https://github.com/axios/axios/pull/5151) - -### Fixed - -- fix(CancelledError): include config [#4922](https://github.com/axios/axios/pull/4922) -- fix(general): removing multiple/trailing/leading whitespace [#5022](https://github.com/axios/axios/pull/5022) -- fix(headers): decompression for responses without Content-Length header [#5306](https://github.com/axios/axios/pull/5306) -- fix(webWorker): exception to sending form data in web worker [#5139](https://github.com/axios/axios/pull/5139) - -### Refactors - -- refactor(types): AxiosProgressEvent.event type to any [#5308](https://github.com/axios/axios/pull/5308) -- refactor(types): add missing types for static AxiosError.from method [#4956](https://github.com/axios/axios/pull/4956) - -### Chores - -- chore(docs): remove README link to non-existent upgrade guide [#5307](https://github.com/axios/axios/pull/5307) -- chore(docs): typo in issue template name [#5159](https://github.com/axios/axios/pull/5159) - -### Contributors to this release - -- [Dmitriy Mozgovoy](https://github.com/DigitalBrainJS) -- [Zachary Lysobey](https://github.com/zachlysobey) -- [Kevin Ennis](https://github.com/kevincennis) -- [Philipp Loose](https://github.com/phloose) -- [secondl1ght](https://github.com/secondl1ght) -- [wenzheng](https://github.com/0x30) -- [Ivan Barsukov](https://github.com/ovarn) -- [Arthur Fiorette](https://github.com/arthurfiorette) - -### PRs - -- CVE 2023 45857 ( [#6028](https://api.github.com/repos/axios/axios/pulls/6028) ) - -``` - -⚠️ Critical vulnerability fix. See https://security.snyk.io/vuln/SNYK-JS-AXIOS-6032459 -``` - -## [1.2.0] - 2022-11-10 - -### Changed - -- changed: refactored module exports [#5162](https://github.com/axios/axios/pull/5162) -- change: re-added support for loading Axios with require('axios').default [#5225](https://github.com/axios/axios/pull/5225) - -### Fixed - -- fix: improve AxiosHeaders class [#5224](https://github.com/axios/axios/pull/5224) -- fix: TypeScript type definitions for commonjs [#5196](https://github.com/axios/axios/pull/5196) -- fix: type definition of use method on AxiosInterceptorManager to match the README [#5071](https://github.com/axios/axios/pull/5071) -- fix: \_\_dirname is not defined in the sandbox [#5269](https://github.com/axios/axios/pull/5269) -- fix: AxiosError.toJSON method to avoid circular references [#5247](https://github.com/axios/axios/pull/5247) -- fix: Z_BUF_ERROR when content-encoding is set but the response body is empty [#5250](https://github.com/axios/axios/pull/5250) - -### Refactors - -- refactor: allowing adapters to be loaded by name [#5277](https://github.com/axios/axios/pull/5277) - -### Chores - -- chore: force CI restart [#5243](https://github.com/axios/axios/pull/5243) -- chore: update ECOSYSTEM.md [#5077](https://github.com/axios/axios/pull/5077) -- chore: update get/index.html [#5116](https://github.com/axios/axios/pull/5116) -- chore: update Sandbox UI/UX [#5205](https://github.com/axios/axios/pull/5205) -- chore:(actions): remove git credentials after checkout [#5235](https://github.com/axios/axios/pull/5235) -- chore(actions): bump actions/dependency-review-action from 2 to 3 [#5266](https://github.com/axios/axios/pull/5266) -- chore(packages): bump loader-utils from 1.4.1 to 1.4.2 [#5295](https://github.com/axios/axios/pull/5295) -- chore(packages): bump engine.io from 6.2.0 to 6.2.1 [#5294](https://github.com/axios/axios/pull/5294) -- chore(packages): bump socket.io-parser from 4.0.4 to 4.0.5 [#5241](https://github.com/axios/axios/pull/5241) -- chore(packages): bump loader-utils from 1.4.0 to 1.4.1 [#5245](https://github.com/axios/axios/pull/5245) -- chore(docs): update Resources links in README [#5119](https://github.com/axios/axios/pull/5119) -- chore(docs): update the link for JSON url [#5265](https://github.com/axios/axios/pull/5265) -- chore(docs): fix broken links [#5218](https://github.com/axios/axios/pull/5218) -- chore(docs): update and rename UPGRADE_GUIDE.md to MIGRATION_GUIDE.md [#5170](https://github.com/axios/axios/pull/5170) -- chore(docs): typo fix line #856 and #920 [#5194](https://github.com/axios/axios/pull/5194) -- chore(docs): typo fix #800 [#5193](https://github.com/axios/axios/pull/5193) -- chore(docs): fix typos [#5184](https://github.com/axios/axios/pull/5184) -- chore(docs): fix punctuation in README.md [#5197](https://github.com/axios/axios/pull/5197) -- chore(docs): update readme in the Handling Errors section - issue reference #5260 [#5261](https://github.com/axios/axios/pull/5261) -- chore: remove \b from filename [#5207](https://github.com/axios/axios/pull/5207) -- chore(docs): update CHANGELOG.md [#5137](https://github.com/axios/axios/pull/5137) -- chore: add sideEffects false to package.json [#5025](https://github.com/axios/axios/pull/5025) - -### Contributors to this release - -- [Maddy Miller](https://github.com/me4502) -- [Amit Saini](https://github.com/amitsainii) -- [ecyrbe](https://github.com/ecyrbe) -- [Ikko Ashimine](https://github.com/eltociear) -- [Geeth Gunnampalli](https://github.com/thetechie7) -- [Shreem Asati](https://github.com/shreem-123) -- [Frieder Bluemle](https://github.com/friederbluemle) -- [윤세영](https://github.com/yunseyeong) -- [Claudio Busatto](https://github.com/cjcbusatto) -- [Remco Haszing](https://github.com/remcohaszing) -- [Dmitriy Mozgovoy](https://github.com/DigitalBrainJS) -- [Csaba Maulis](https://github.com/om4csaba) -- [MoPaMo](https://github.com/MoPaMo) -- [Daniel Fjeldstad](https://github.com/w3bdesign) -- [Adrien Brunet](https://github.com/adrien-may) -- [Frazer Smith](https://github.com/Fdawgs) -- [HaiTao](https://github.com/836334258) -- [AZM](https://github.com/aziyatali) -- [relbns](https://github.com/relbns) - -### PRs - -- CVE 2023 45857 ( [#6028](https://api.github.com/repos/axios/axios/pulls/6028) ) - -``` - -⚠️ Critical vulnerability fix. See https://security.snyk.io/vuln/SNYK-JS-AXIOS-6032459 -``` - -## [1.1.3] - 2022-10-15 - -### Added - -- Added custom params serializer support [#5113](https://github.com/axios/axios/pull/5113) - -### Fixed - -- Fixed top-level export to keep them in-line with static properties [#5109](https://github.com/axios/axios/pull/5109) -- Stopped including null values to query string. [#5108](https://github.com/axios/axios/pull/5108) -- Restored proxy config backwards compatibility with 0.x [#5097](https://github.com/axios/axios/pull/5097) -- Added back AxiosHeaders in AxiosHeaderValue [#5103](https://github.com/axios/axios/pull/5103) -- Pin CDN install instructions to a specific version [#5060](https://github.com/axios/axios/pull/5060) -- Handling of array values fixed for AxiosHeaders [#5085](https://github.com/axios/axios/pull/5085) - -### Chores - -- docs: match badge style, add link to them [#5046](https://github.com/axios/axios/pull/5046) -- chore: fixing comments typo [#5054](https://github.com/axios/axios/pull/5054) -- chore: update issue template [#5061](https://github.com/axios/axios/pull/5061) -- chore: added progress capturing section to the docs; [#5084](https://github.com/axios/axios/pull/5084) - -### Contributors to this release - -- [Jason Saayman](https://github.com/jasonsaayman) -- [scarf](https://github.com/scarf005) -- [Lenz Weber-Tronic](https://github.com/phryneas) -- [Arvindh](https://github.com/itsarvindh) -- [Félix Legrelle](https://github.com/FelixLgr) -- [Patrick Petrovic](https://github.com/ppati000) -- [Dmitriy Mozgovoy](https://github.com/DigitalBrainJS) -- [littledian](https://github.com/littledian) -- [ChronosMasterOfAllTime](https://github.com/ChronosMasterOfAllTime) - -### PRs - -- CVE 2023 45857 ( [#6028](https://api.github.com/repos/axios/axios/pulls/6028) ) - -``` - -⚠️ Critical vulnerability fix. See https://security.snyk.io/vuln/SNYK-JS-AXIOS-6032459 -``` - -## [1.1.2] - 2022-10-07 - -### Fixed - -- Fixed broken exports for UMD builds. - -### Contributors to this release - -- [Jason Saayman](https://github.com/jasonsaayman) - -### PRs - -- CVE 2023 45857 ( [#6028](https://api.github.com/repos/axios/axios/pulls/6028) ) - -``` - -⚠️ Critical vulnerability fix. See https://security.snyk.io/vuln/SNYK-JS-AXIOS-6032459 -``` - -## [1.1.1] - 2022-10-07 - -### Fixed - -- Fixed broken exports for common js. This fix breaks a prior fix, I will fix both issues ASAP but the commonJS use is more impactful. - -### Contributors to this release - -- [Jason Saayman](https://github.com/jasonsaayman) - -### PRs - -- CVE 2023 45857 ( [#6028](https://api.github.com/repos/axios/axios/pulls/6028) ) - -``` - -⚠️ Critical vulnerability fix. See https://security.snyk.io/vuln/SNYK-JS-AXIOS-6032459 -``` - -## [1.1.0] - 2022-10-06 - -### Fixed - -- Fixed missing exports in type definition index.d.ts [#5003](https://github.com/axios/axios/pull/5003) -- Fixed query params composing [#5018](https://github.com/axios/axios/pull/5018) -- Fixed GenericAbortSignal interface by making it more generic [#5021](https://github.com/axios/axios/pull/5021) -- Fixed adding "clear" to AxiosInterceptorManager [#5010](https://github.com/axios/axios/pull/5010) -- Fixed commonjs & umd exports [#5030](https://github.com/axios/axios/pull/5030) -- Fixed inability to access response headers when using axios 1.x with Jest [#5036](https://github.com/axios/axios/pull/5036) - -### Contributors to this release - -- [Trim21](https://github.com/trim21) -- [Dmitriy Mozgovoy](https://github.com/DigitalBrainJS) -- [shingo.sasaki](https://github.com/s-sasaki-0529) -- [Ivan Pepelko](https://github.com/ivanpepelko) -- [Richard Kořínek](https://github.com/risa) - -### PRs - -- CVE 2023 45857 ( [#6028](https://api.github.com/repos/axios/axios/pulls/6028) ) - -``` - -⚠️ Critical vulnerability fix. See https://security.snyk.io/vuln/SNYK-JS-AXIOS-6032459 -``` - -## [1.0.0] - 2022-10-04 - -### Added - -- Added stack trace to AxiosError [#4624](https://github.com/axios/axios/pull/4624) -- Add AxiosError to AxiosStatic [#4654](https://github.com/axios/axios/pull/4654) -- Replaced Rollup as our build runner [#4596](https://github.com/axios/axios/pull/4596) -- Added generic TS types for the exposed toFormData helper [#4668](https://github.com/axios/axios/pull/4668) -- Added listen callback function [#4096](https://github.com/axios/axios/pull/4096) -- Added instructions for installing using PNPM [#4207](https://github.com/axios/axios/pull/4207) -- Added generic AxiosAbortSignal TS interface to avoid importing AbortController polyfill [#4229](https://github.com/axios/axios/pull/4229) -- Added axios-url-template in ECOSYSTEM.md [#4238](https://github.com/axios/axios/pull/4238) -- Added a clear() function to the request and response interceptors object so a user can ensure that all interceptors have been removed from an axios instance [#4248](https://github.com/axios/axios/pull/4248) -- Added react hook plugin [#4319](https://github.com/axios/axios/pull/4319) -- Adding HTTP status code for transformResponse [#4580](https://github.com/axios/axios/pull/4580) -- Added blob to the list of protocols supported by the browser [#4678](https://github.com/axios/axios/pull/4678) -- Resolving proxy from env on redirect [#4436](https://github.com/axios/axios/pull/4436) -- Added enhanced toFormData implementation with additional options [4704](https://github.com/axios/axios/pull/4704) -- Adding Canceler parameters config and request [#4711](https://github.com/axios/axios/pull/4711) -- Added automatic payload serialization to application/x-www-form-urlencoded [#4714](https://github.com/axios/axios/pull/4714) -- Added the ability for webpack users to overwrite built-ins [#4715](https://github.com/axios/axios/pull/4715) -- Added string[] to AxiosRequestHeaders type [#4322](https://github.com/axios/axios/pull/4322) -- Added the ability for the url-encoded-form serializer to respect the formSerializer config [#4721](https://github.com/axios/axios/pull/4721) -- Added isCancel type assert [#4293](https://github.com/axios/axios/pull/4293) -- Added data URL support for node.js [#4725](https://github.com/axios/axios/pull/4725) -- Adding types for progress event callbacks [#4675](https://github.com/axios/axios/pull/4675) -- URL params serializer [#4734](https://github.com/axios/axios/pull/4734) -- Added axios.formToJSON method [#4735](https://github.com/axios/axios/pull/4735) -- Bower platform add data protocol [#4804](https://github.com/axios/axios/pull/4804) -- Use WHATWG URL API instead of url.parse() [#4852](https://github.com/axios/axios/pull/4852) -- Add ENUM containing Http Status Codes to typings [#4903](https://github.com/axios/axios/pull/4903) -- Improve typing of timeout in index.d.ts [#4934](https://github.com/axios/axios/pull/4934) - -### Changed - -- Updated AxiosError.config to be optional in the type definition [#4665](https://github.com/axios/axios/pull/4665) -- Updated README emphasizing the URLSearchParam built-in interface over other solutions [#4590](https://github.com/axios/axios/pull/4590) -- Include request and config when creating a CanceledError instance [#4659](https://github.com/axios/axios/pull/4659) -- Changed func-names eslint rule to as-needed [#4492](https://github.com/axios/axios/pull/4492) -- Replacing deprecated substr() with slice() as substr() is deprecated [#4468](https://github.com/axios/axios/pull/4468) -- Updating HTTP links in README.md to use HTTPS [#4387](https://github.com/axios/axios/pull/4387) -- Updated to a better trim() polyfill [#4072](https://github.com/axios/axios/pull/4072) -- Updated types to allow specifying partial default headers on instance create [#4185](https://github.com/axios/axios/pull/4185) -- Expanded isAxiosError types [#4344](https://github.com/axios/axios/pull/4344) -- Updated type definition for axios instance methods [#4224](https://github.com/axios/axios/pull/4224) -- Updated eslint config [#4722](https://github.com/axios/axios/pull/4722) -- Updated Docs [#4742](https://github.com/axios/axios/pull/4742) -- Refactored Axios to use ES2017 [#4787](https://github.com/axios/axios/pull/4787) - -### Deprecated - -- There are multiple deprecations, refactors and fixes provided in this release. Please read through the full release notes to see how this may impact your project and use case. - -### Removed - -- Removed incorrect argument for NetworkError constructor [#4656](https://github.com/axios/axios/pull/4656) -- Removed Webpack [#4596](https://github.com/axios/axios/pull/4596) -- Removed function that transform arguments to array [#4544](https://github.com/axios/axios/pull/4544) - -### Fixed - -- Fixed grammar in README [#4649](https://github.com/axios/axios/pull/4649) -- Fixed code error in README [#4599](https://github.com/axios/axios/pull/4599) -- Optimized the code that checks cancellation [#4587](https://github.com/axios/axios/pull/4587) -- Fix url pointing to defaults.js in README [#4532](https://github.com/axios/axios/pull/4532) -- Use type alias instead of interface for AxiosPromise [#4505](https://github.com/axios/axios/pull/4505) -- Fix some word spelling and lint style in code comments [#4500](https://github.com/axios/axios/pull/4500) -- Edited readme with 3 updated browser icons of Chrome, FireFox and Safari [#4414](https://github.com/axios/axios/pull/4414) -- Bump follow-redirects from 1.14.9 to 1.15.0 [#4673](https://github.com/axios/axios/pull/4673) -- Fixing http tests to avoid hanging when assertions fail [#4435](https://github.com/axios/axios/pull/4435) -- Fix TS definition for AxiosRequestTransformer [#4201](https://github.com/axios/axios/pull/4201) -- Fix grammatical issues in README [#4232](https://github.com/axios/axios/pull/4232) -- Fixing instance.defaults.headers type [#4557](https://github.com/axios/axios/pull/4557) -- Fixed race condition on immediate requests cancellation [#4261](https://github.com/axios/axios/pull/4261) -- Fixing Z_BUF_ERROR when no content [#4701](https://github.com/axios/axios/pull/4701) -- Fixing proxy beforeRedirect regression [#4708](https://github.com/axios/axios/pull/4708) -- Fixed AxiosError status code type [#4717](https://github.com/axios/axios/pull/4717) -- Fixed AxiosError stack capturing [#4718](https://github.com/axios/axios/pull/4718) -- Fixing AxiosRequestHeaders typings [#4334](https://github.com/axios/axios/pull/4334) -- Fixed max body length defaults [#4731](https://github.com/axios/axios/pull/4731) -- Fixed toFormData Blob issue on node>v17 [#4728](https://github.com/axios/axios/pull/4728) -- Bump grunt from 1.5.2 to 1.5.3 [#4743](https://github.com/axios/axios/pull/4743) -- Fixing content-type header repeated [#4745](https://github.com/axios/axios/pull/4745) -- Fixed timeout error message for http [4738](https://github.com/axios/axios/pull/4738) -- Request ignores false, 0 and empty string as body values [#4785](https://github.com/axios/axios/pull/4785) -- Added back missing minified builds [#4805](https://github.com/axios/axios/pull/4805) -- Fixed a type error [#4815](https://github.com/axios/axios/pull/4815) -- Fixed a regression bug with unsubscribing from cancel token; [#4819](https://github.com/axios/axios/pull/4819) -- Remove repeated compression algorithm [#4820](https://github.com/axios/axios/pull/4820) -- The error of calling extend to pass parameters [#4857](https://github.com/axios/axios/pull/4857) -- SerializerOptions.indexes allows boolean | null | undefined [#4862](https://github.com/axios/axios/pull/4862) -- Require interceptors to return values [#4874](https://github.com/axios/axios/pull/4874) -- Removed unused imports [#4949](https://github.com/axios/axios/pull/4949) -- Allow null indexes on formSerializer and paramsSerializer [#4960](https://github.com/axios/axios/pull/4960) - -### Chores - -- Set permissions for GitHub actions [#4765](https://github.com/axios/axios/pull/4765) -- Included githubactions in the dependabot config [#4770](https://github.com/axios/axios/pull/4770) -- Included dependency review [#4771](https://github.com/axios/axios/pull/4771) -- Update security.md [#4784](https://github.com/axios/axios/pull/4784) -- Remove unnecessary spaces [#4854](https://github.com/axios/axios/pull/4854) -- Simplify the import path of AxiosError [#4875](https://github.com/axios/axios/pull/4875) -- Fix Gitpod dead link [#4941](https://github.com/axios/axios/pull/4941) -- Enable syntax highlighting for a code block [#4970](https://github.com/axios/axios/pull/4970) -- Using Logo Axios in Readme.md [#4993](https://github.com/axios/axios/pull/4993) -- Fix markup for note in README [#4825](https://github.com/axios/axios/pull/4825) -- Fix typo and formatting, add colons [#4853](https://github.com/axios/axios/pull/4853) -- Fix typo in readme [#4942](https://github.com/axios/axios/pull/4942) - -### Security - -- Update SECURITY.md [#4687](https://github.com/axios/axios/pull/4687) - -### Contributors to this release - -- [Bertrand Marron](https://github.com/tusbar) -- [Dmitriy Mozgovoy](https://github.com/DigitalBrainJS) -- [Dan Mooney](https://github.com/danmooney) -- [Michael Li](https://github.com/xiaoyu-tamu) -- [aong](https://github.com/yxwzaxns) -- [Des Preston](https://github.com/despreston) -- [Ted Robertson](https://github.com/tredondo) -- [zhoulixiang](https://github.com/zh-lx) -- [Arthur Fiorette](https://github.com/arthurfiorette) -- [Kumar Shanu](https://github.com/Kr-Shanu) -- [JALAL](https://github.com/JLL32) -- [Jingyi Lin](https://github.com/MageeLin) -- [Philipp Loose](https://github.com/phloose) -- [Alexander Shchukin](https://github.com/sashsvamir) -- [Dave Cardwell](https://github.com/davecardwell) -- [Cat Scarlet](https://github.com/catscarlet) -- [Luca Pizzini](https://github.com/lpizzinidev) -- [Kai](https://github.com/Schweinepriester) -- [Maxime Bargiel](https://github.com/mbargiel) -- [Brian Helba](https://github.com/brianhelba) -- [reslear](https://github.com/reslear) -- [Jamie Slome](https://github.com/JamieSlome) -- [Landro3](https://github.com/Landro3) -- [rafw87](https://github.com/rafw87) -- [Afzal Sayed](https://github.com/afzalsayed96) -- [Koki Oyatsu](https://github.com/kaishuu0123) -- [Dave](https://github.com/wangcch) -- [暴走老七](https://github.com/baozouai) -- [Spencer](https://github.com/spalger) -- [Adrian Wieprzkowicz](https://github.com/Argeento) -- [Jamie Telin](https://github.com/lejahmie) -- [毛呆](https://github.com/aweikalee) -- [Kirill Shakirov](https://github.com/turisap) -- [Rraji Abdelbari](https://github.com/estarossa0) -- [Jelle Schutter](https://github.com/jelleschutter) -- [Tom Ceuppens](https://github.com/KyorCode) -- [Johann Cooper](https://github.com/JohannCooper) -- [Dimitris Halatsis](https://github.com/mitsos1os) -- [chenjigeng](https://github.com/chenjigeng) -- [João Gabriel Quaresma](https://github.com/joaoGabriel55) -- [Victor Augusto](https://github.com/VictorAugDB) -- [neilnaveen](https://github.com/neilnaveen) -- [Pavlos](https://github.com/psmoros) -- [Kiryl Valkovich](https://github.com/visortelle) -- [Naveen](https://github.com/naveensrinivasan) -- [wenzheng](https://github.com/0x30) -- [hcwhan](https://github.com/hcwhan) -- [Bassel Rachid](https://github.com/basselworkforce) -- [Grégoire Pineau](https://github.com/lyrixx) -- [felipedamin](https://github.com/felipedamin) -- [Karl Horky](https://github.com/karlhorky) -- [Yue JIN](https://github.com/kingyue737) -- [Usman Ali Siddiqui](https://github.com/usman250994) -- [WD](https://github.com/techbirds) -- [Günther Foidl](https://github.com/gfoidl) -- [Stephen Jennings](https://github.com/jennings) -- [C.T.Lin](https://github.com/chentsulin) -- [mia-z](https://github.com/mia-z) -- [Parth Banathia](https://github.com/Parth0105) -- [parth0105pluang](https://github.com/parth0105pluang) -- [Marco Weber](https://github.com/mrcwbr) -- [Luca Pizzini](https://github.com/lpizzinidev) -- [Willian Agostini](https://github.com/WillianAgostini) - -- [Huyen Nguyen](https://github.com/huyenltnguyen) diff --git a/server/node_modules/axios/LICENSE b/server/node_modules/axios/LICENSE deleted file mode 100644 index 05006a5..0000000 --- a/server/node_modules/axios/LICENSE +++ /dev/null @@ -1,7 +0,0 @@ -# Copyright (c) 2014-present Matt Zabriskie & Collaborators - -Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/server/node_modules/axios/MIGRATION_GUIDE.md b/server/node_modules/axios/MIGRATION_GUIDE.md deleted file mode 100644 index 2e59d9d..0000000 --- a/server/node_modules/axios/MIGRATION_GUIDE.md +++ /dev/null @@ -1,877 +0,0 @@ -# Axios Migration Guide - -> **Migrating from Axios 0.x to 1.x** -> -> This guide helps developers upgrade from Axios 0.x to 1.x by documenting breaking changes, providing migration strategies, and offering solutions to common upgrade challenges. - -## Table of Contents - -- [Overview](#overview) -- [Breaking Changes](#breaking-changes) -- [Error Handling Migration](#error-handling-migration) -- [API Changes](#api-changes) -- [Configuration Changes](#configuration-changes) -- [Migration Strategies](#migration-strategies) -- [Common Patterns](#common-patterns) -- [Troubleshooting](#troubleshooting) -- [Resources](#resources) - -## Overview - -Axios 1.x introduced several breaking changes to improve consistency, security, and developer experience. While these changes provide better error handling and more predictable behavior, they require code updates when migrating from 0.x versions. - -### Key Changes Summary - -| Area | 0.x Behavior | 1.x Behavior | Impact | -|------|--------------|--------------|--------| -| Error Handling | Selective throwing | Consistent throwing | High | -| JSON Parsing | Lenient | Strict | Medium | -| Browser Support | IE11+ | Modern browsers | Low-Medium | -| TypeScript | Partial | Full support | Low | - -### Migration Complexity - -- **Simple applications**: 1-2 hours -- **Medium applications**: 1-2 days -- **Large applications with complex error handling**: 3-5 days - -## Breaking Changes - -### 1. Error Handling Changes - -**The most significant change in Axios 1.x is how errors are handled.** - -#### 0.x Behavior -```javascript -// Axios 0.x - Some HTTP error codes didn't throw -axios.get('/api/data') - .then(response => { - // Response interceptor could handle all errors - console.log('Success:', response.data); - }); - -// Response interceptor handled everything -axios.interceptors.response.use( - response => response, - error => { - handleError(error); - // Error was "handled" and didn't propagate - } -); -``` - -#### 1.x Behavior -```javascript -// Axios 1.x - All HTTP errors throw consistently -axios.get('/api/data') - .then(response => { - console.log('Success:', response.data); - }) - .catch(error => { - // Must handle errors at call site or they propagate - console.error('Request failed:', error); - }); - -// Response interceptor must re-throw or return rejected promise -axios.interceptors.response.use( - response => response, - error => { - handleError(error); - // Must explicitly handle propagation - return Promise.reject(error); // or throw error; - } -); -``` - -#### Impact -- **Response interceptors** can no longer "swallow" errors silently -- **Every API call** must handle errors explicitly or they become unhandled promise rejections -- **Centralized error handling** requires new patterns - -### 2. JSON Parsing Changes - -#### 0.x Behavior -```javascript -// Axios 0.x - Lenient JSON parsing -// Would attempt to parse even invalid JSON -response.data; // Might contain partial data or fallbacks -``` - -#### 1.x Behavior -```javascript -// Axios 1.x - Strict JSON parsing -// Throws clear errors for invalid JSON -try { - const data = response.data; -} catch (error) { - // Handle JSON parsing errors explicitly -} -``` - -### 3. Request/Response Transform Changes - -#### 0.x Behavior -```javascript -// Implicit transformations with some edge cases -transformRequest: [function (data) { - // Less predictable behavior - return data; -}] -``` - -#### 1.x Behavior -```javascript -// More consistent transformation pipeline -transformRequest: [function (data, headers) { - // Headers parameter always available - // More predictable behavior - return data; -}] -``` - -### 4. Browser Support Changes - -- **0.x**: Supported IE11 and older browsers -- **1.x**: Requires modern browsers with Promise support -- **Polyfills**: May be needed for older browser support - -## Error Handling Migration - -The error handling changes are the most complex part of migrating to Axios 1.x. Here are proven strategies: - -### Strategy 1: Centralized Error Handling with Error Boundary - -```javascript -// Create a centralized error handler -class ApiErrorHandler { - constructor() { - this.setupInterceptors(); - } - - setupInterceptors() { - axios.interceptors.response.use( - response => response, - error => { - // Centralized error processing - this.processError(error); - - // Return a resolved promise with error info for handled errors - if (this.isHandledError(error)) { - return Promise.resolve({ - data: null, - error: this.normalizeError(error), - handled: true - }); - } - - // Re-throw unhandled errors - return Promise.reject(error); - } - ); - } - - processError(error) { - // Log errors - console.error('API Error:', error); - - // Show user notifications - if (error.response?.status === 401) { - this.handleAuthError(); - } else if (error.response?.status >= 500) { - this.showErrorNotification('Server error occurred'); - } - } - - isHandledError(error) { - // Define which errors are "handled" centrally - const handledStatuses = [401, 403, 404, 422, 500, 502, 503]; - return handledStatuses.includes(error.response?.status); - } - - normalizeError(error) { - return { - status: error.response?.status, - message: error.response?.data?.message || error.message, - code: error.response?.data?.code || error.code - }; - } - - handleAuthError() { - // Redirect to login, clear tokens, etc. - localStorage.removeItem('token'); - window.location.href = '/login'; - } - - showErrorNotification(message) { - // Show user-friendly error message - console.error(message); // Replace with your notification system - } -} - -// Initialize globally -const errorHandler = new ApiErrorHandler(); - -// Usage in components/services -async function fetchUserData(userId) { - try { - const response = await axios.get(`/api/users/${userId}`); - - // Check if error was handled centrally - if (response.handled) { - return { data: null, error: response.error }; - } - - return { data: response.data, error: null }; - } catch (error) { - // Unhandled errors still need local handling - return { data: null, error: { message: 'Unexpected error occurred' } }; - } -} -``` - -### Strategy 2: Wrapper Function Pattern - -```javascript -// Create a wrapper that provides 0.x-like behavior -function createApiWrapper() { - const api = axios.create(); - - // Add response interceptor for centralized handling - api.interceptors.response.use( - response => response, - error => { - // Handle common errors centrally - if (error.response?.status === 401) { - // Handle auth errors - handleAuthError(); - } - - if (error.response?.status >= 500) { - // Handle server errors - showServerErrorNotification(); - } - - // Always reject to maintain error propagation - return Promise.reject(error); - } - ); - - // Wrapper function that mimics 0.x behavior - function safeRequest(requestConfig, options = {}) { - return api(requestConfig) - .then(response => response) - .catch(error => { - if (options.suppressErrors) { - // Return error info instead of throwing - return { - data: null, - error: { - status: error.response?.status, - message: error.response?.data?.message || error.message - } - }; - } - throw error; - }); - } - - return { safeRequest, axios: api }; -} - -// Usage -const { safeRequest } = createApiWrapper(); - -// For calls where you want centralized error handling -const result = await safeRequest( - { method: 'get', url: '/api/data' }, - { suppressErrors: true } -); - -if (result.error) { - // Handle error case - console.log('Request failed:', result.error.message); -} else { - // Handle success case - console.log('Data:', result.data); -} -``` - -### Strategy 3: Global Error Handler with Custom Events - -```javascript -// Set up global error handling with events -class GlobalErrorHandler extends EventTarget { - constructor() { - super(); - this.setupInterceptors(); - } - - setupInterceptors() { - axios.interceptors.response.use( - response => response, - error => { - // Emit custom event for global handling - this.dispatchEvent(new CustomEvent('apiError', { - detail: { error, timestamp: new Date() } - })); - - // Always reject to maintain proper error flow - return Promise.reject(error); - } - ); - } -} - -const globalErrorHandler = new GlobalErrorHandler(); - -// Set up global listeners -globalErrorHandler.addEventListener('apiError', (event) => { - const { error } = event.detail; - - // Centralized error logic - if (error.response?.status === 401) { - handleAuthError(); - } - - if (error.response?.status >= 500) { - showErrorNotification('Server error occurred'); - } -}); - -// Usage remains clean -async function apiCall() { - try { - const response = await axios.get('/api/data'); - return response.data; - } catch (error) { - // Error was already handled globally - // Just handle component-specific logic - return null; - } -} -``` - -## API Changes - -### Request Configuration - -#### 0.x to 1.x Changes -```javascript -// 0.x - Some properties had different defaults -const config = { - timeout: 0, // No timeout by default - maxContentLength: -1, // No limit -}; - -// 1.x - More secure defaults -const config = { - timeout: 0, // Still no timeout, but easier to configure - maxContentLength: 2000, // Default limit for security - maxBodyLength: 2000, // New property -}; -``` - -### Response Object - -The response object structure remains largely the same, but error responses are more consistent: - -```javascript -// Both 0.x and 1.x -response = { - data: {}, // Response body - status: 200, // HTTP status - statusText: 'OK', // HTTP status message - headers: {}, // Response headers - config: {}, // Request config - request: {} // Request object -}; - -// Error responses are more consistent in 1.x -error.response = { - data: {}, // Error response body - status: 404, // HTTP error status - statusText: 'Not Found', - headers: {}, - config: {}, - request: {} -}; -``` - -## Configuration Changes - -### Default Configuration Updates - -```javascript -// 0.x defaults -axios.defaults.timeout = 0; // No timeout -axios.defaults.maxContentLength = -1; // No limit - -// 1.x defaults (more secure) -axios.defaults.timeout = 0; // Still no timeout -axios.defaults.maxContentLength = 2000; // 2MB limit -axios.defaults.maxBodyLength = 2000; // 2MB limit -``` - -### Instance Configuration - -```javascript -// 0.x - Instance creation -const api = axios.create({ - baseURL: 'https://api.example.com', - timeout: 1000, -}); - -// 1.x - Same API, but more options available -const api = axios.create({ - baseURL: 'https://api.example.com', - timeout: 1000, - maxBodyLength: Infinity, // Override default if needed - maxContentLength: Infinity, -}); -``` - -## Migration Strategies - -### Step-by-Step Migration Process - -#### Phase 1: Preparation -1. **Audit Current Error Handling** - ```bash - # Find all axios usage - grep -r "axios\." src/ - grep -r "\.catch" src/ - grep -r "interceptors" src/ - ``` - -2. **Identify Patterns** - - Response interceptors that handle errors - - Components that rely on centralized error handling - - Authentication and retry logic - -3. **Create Test Cases** - ```javascript - // Test current error handling behavior - describe('Error Handling Migration', () => { - it('should handle 401 errors consistently', async () => { - // Test authentication error flows - }); - - it('should handle 500 errors with user feedback', async () => { - // Test server error handling - }); - }); - ``` - -#### Phase 2: Implementation -1. **Update Dependencies** - ```bash - npm update axios - ``` - -2. **Implement New Error Handling** - - Choose one of the strategies above - - Update response interceptors - - Add error handling to API calls - -3. **Update Authentication Logic** - ```javascript - // 0.x pattern - axios.interceptors.response.use(null, error => { - if (error.response?.status === 401) { - logout(); - // Error was "handled" - } - }); - - // 1.x pattern - axios.interceptors.response.use( - response => response, - error => { - if (error.response?.status === 401) { - logout(); - } - return Promise.reject(error); // Always propagate - } - ); - ``` - -#### Phase 3: Testing and Validation -1. **Test Error Scenarios** - - Network failures - - HTTP error codes (401, 403, 404, 500, etc.) - - Timeout errors - - JSON parsing errors - -2. **Validate User Experience** - - Error messages are shown appropriately - - Authentication redirects work - - Loading states are handled correctly - -### Gradual Migration Approach - -For large applications, consider gradual migration: - -```javascript -// Create a compatibility layer -const axiosCompat = { - // Use new axios instance for new code - v1: axios.create({ - // 1.x configuration - }), - - // Wrapper for legacy code - legacy: createLegacyWrapper(axios.create({ - // Configuration that mimics 0.x behavior - })) -}; - -function createLegacyWrapper(axiosInstance) { - // Add interceptors that provide 0.x-like behavior - axiosInstance.interceptors.response.use( - response => response, - error => { - // Handle errors in 0.x style for legacy code - handleLegacyError(error); - // Don't propagate certain errors - if (shouldSuppressError(error)) { - return Promise.resolve({ data: null, error: true }); - } - return Promise.reject(error); - } - ); - - return axiosInstance; -} -``` - -## Common Patterns - -### Authentication Interceptors - -#### Updated Authentication Pattern -```javascript -// Token refresh interceptor for 1.x -let isRefreshing = false; -let refreshSubscribers = []; - -function subscribeTokenRefresh(cb) { - refreshSubscribers.push(cb); -} - -function onTokenRefreshed(token) { - refreshSubscribers.forEach(cb => cb(token)); - refreshSubscribers = []; -} - -axios.interceptors.response.use( - response => response, - async error => { - const originalRequest = error.config; - - if (error.response?.status === 401 && !originalRequest._retry) { - if (isRefreshing) { - // Wait for token refresh - return new Promise(resolve => { - subscribeTokenRefresh(token => { - originalRequest.headers.Authorization = `Bearer ${token}`; - resolve(axios(originalRequest)); - }); - }); - } - - originalRequest._retry = true; - isRefreshing = true; - - try { - const newToken = await refreshToken(); - onTokenRefreshed(newToken); - isRefreshing = false; - - originalRequest.headers.Authorization = `Bearer ${newToken}`; - return axios(originalRequest); - } catch (refreshError) { - isRefreshing = false; - logout(); - return Promise.reject(refreshError); - } - } - - return Promise.reject(error); - } -); -``` - -### Retry Logic - -```javascript -// Retry interceptor for 1.x -function createRetryInterceptor(maxRetries = 3, retryDelay = 1000) { - return axios.interceptors.response.use( - response => response, - async error => { - const config = error.config; - - if (!config || !config.retry) { - return Promise.reject(error); - } - - config.__retryCount = config.__retryCount || 0; - - if (config.__retryCount >= maxRetries) { - return Promise.reject(error); - } - - config.__retryCount += 1; - - // Exponential backoff - const delay = retryDelay * Math.pow(2, config.__retryCount - 1); - await new Promise(resolve => setTimeout(resolve, delay)); - - return axios(config); - } - ); -} - -// Usage -const api = axios.create(); -createRetryInterceptor(3, 1000); - -// Make request with retry -api.get('/api/data', { retry: true }); -``` - -### Loading State Management - -```javascript -// Loading interceptor for 1.x -class LoadingManager { - constructor() { - this.requests = new Set(); - this.setupInterceptors(); - } - - setupInterceptors() { - axios.interceptors.request.use(config => { - this.requests.add(config); - this.updateLoadingState(); - return config; - }); - - axios.interceptors.response.use( - response => { - this.requests.delete(response.config); - this.updateLoadingState(); - return response; - }, - error => { - this.requests.delete(error.config); - this.updateLoadingState(); - return Promise.reject(error); - } - ); - } - - updateLoadingState() { - const isLoading = this.requests.size > 0; - // Update your loading UI - document.body.classList.toggle('loading', isLoading); - } -} - -const loadingManager = new LoadingManager(); -``` - -## Troubleshooting - -### Common Migration Issues - -#### Issue 1: Unhandled Promise Rejections - -**Problem:** -```javascript -// This pattern worked in 0.x but causes unhandled rejections in 1.x -axios.get('/api/data'); // No .catch() handler -``` - -**Solution:** -```javascript -// Always handle promises -axios.get('/api/data') - .catch(error => { - // Handle error appropriately - console.error('Request failed:', error.message); - }); - -// Or use async/await with try/catch -async function fetchData() { - try { - const response = await axios.get('/api/data'); - return response.data; - } catch (error) { - console.error('Request failed:', error.message); - return null; - } -} -``` - -#### Issue 2: Response Interceptors Not "Handling" Errors - -**Problem:** -```javascript -// 0.x style - interceptor "handled" errors -axios.interceptors.response.use(null, error => { - showErrorMessage(error.message); - // Error was considered "handled" -}); -``` - -**Solution:** -```javascript -// 1.x style - explicitly control error propagation -axios.interceptors.response.use( - response => response, - error => { - showErrorMessage(error.message); - - // Choose whether to propagate the error - if (shouldPropagateError(error)) { - return Promise.reject(error); - } - - // Return success-like response for "handled" errors - return Promise.resolve({ - data: null, - handled: true, - error: normalizeError(error) - }); - } -); -``` - -#### Issue 3: JSON Parsing Errors - -**Problem:** -```javascript -// 1.x is stricter about JSON parsing -// This might throw where 0.x was lenient -const data = response.data; -``` - -**Solution:** -```javascript -// Add response transformer for better error handling -axios.defaults.transformResponse = [ - function (data) { - if (typeof data === 'string') { - try { - return JSON.parse(data); - } catch (e) { - // Handle JSON parsing errors gracefully - console.warn('Invalid JSON response:', data); - return { error: 'Invalid JSON', rawData: data }; - } - } - return data; - } -]; -``` - -#### Issue 4: TypeScript Errors After Upgrade - -**Problem:** -```typescript -// TypeScript errors after upgrade -const response = await axios.get('/api/data'); -// Property 'someProperty' does not exist on type 'any' -``` - -**Solution:** -```typescript -// Define proper interfaces -interface ApiResponse { - data: any; - message: string; - success: boolean; -} - -const response = await axios.get('/api/data'); -// Now properly typed -console.log(response.data.data); -``` - -### Debug Migration Issues - -#### Enable Debug Logging -```javascript -// Add request/response logging -axios.interceptors.request.use(config => { - console.log('Request:', config); - return config; -}); - -axios.interceptors.response.use( - response => { - console.log('Response:', response); - return response; - }, - error => { - console.log('Error:', error); - return Promise.reject(error); - } -); -``` - -#### Compare Behavior -```javascript -// Create side-by-side comparison during migration -const axios0x = require('axios-0x'); // Keep old version for testing -const axios1x = require('axios'); - -async function compareRequests(config) { - try { - const [result0x, result1x] = await Promise.allSettled([ - axios0x(config), - axios1x(config) - ]); - - console.log('0.x result:', result0x); - console.log('1.x result:', result1x); - } catch (error) { - console.log('Comparison error:', error); - } -} -``` - -## Resources - -### Official Documentation -- [Axios 1.x Documentation](https://axios-http.com/) -- [Axios GitHub Repository](https://github.com/axios/axios) -- [Axios Changelog](https://github.com/axios/axios/blob/main/CHANGELOG.md) - -### Migration Tools -- [Axios Migration Codemod](https://github.com/axios/axios-migration-codemod) *(if available)* -- [ESLint Rules for Axios 1.x](https://github.com/axios/eslint-plugin-axios) *(if available)* - -### Community Resources -- [Stack Overflow - Axios Migration Questions](https://stackoverflow.com/questions/tagged/axios+migration) -- [GitHub Discussions](https://github.com/axios/axios/discussions) -- [Axios Discord Community](https://discord.gg/axios) *(if available)* - -### Related Issues -- [Error Handling Changes Discussion](https://github.com/axios/axios/issues/7208) -- [Migration Guide Request](https://github.com/axios/axios/issues/xxxx) *(link to related issues)* - ---- - -## Need Help? - -If you encounter issues during migration that aren't covered in this guide: - -1. **Search existing issues** in the [Axios GitHub repository](https://github.com/axios/axios/issues) -2. **Ask questions** in [GitHub Discussions](https://github.com/axios/axios/discussions) -3. **Contribute improvements** to this migration guide - ---- - -*This migration guide is maintained by the community. If you find errors or have suggestions, please [open an issue](https://github.com/axios/axios/issues) or submit a pull request.* \ No newline at end of file diff --git a/server/node_modules/axios/README.md b/server/node_modules/axios/README.md deleted file mode 100644 index 583441e..0000000 --- a/server/node_modules/axios/README.md +++ /dev/null @@ -1,2623 +0,0 @@ -

💎 Platinum sponsors

- - - - - -
- - Thanks.dev - -

- We're passionate about making open source sustainable. Scan your dependency tree to better understand which open source projects need funding. -

-

- thanks.dev -

-
- 💜 Become a sponsor -
- - - - - -
- 💜 Become a sponsor - - 💜 Become a sponsor -
-

🥇 Gold sponsors

- - - - - - - - - - - - - - - - - - - - - -
- - Principal Financial Group - -

- Free tools to help with your financial planning needs! -

-

- principal.com -

-
- - SAP - -

- BSAP SE, a global software company, is one of the largest vendors of ERP and other enterprise applications. -

-

- opensource.sap.com -

-
- - Descope - -

- Reduce user friction, prevent account takeover, and get a 360° view of your customer and agentic identities with the Descope External IAM platform. -

-

- descope.com -

-
- - Stytch - -

- The identity platform for humans & AI agents -

-

- stytch.com -

-
- - RxDB - -

- RxDB is a NoSQL database for JavaScript that runs directly in your app. -

-

- rxdb.info -

-
- - Poprey - -

- Buy Instagram Likes -

-

- poprey.com -

-
- - Buzzoid - Buy Instagram Followers - -

- At Buzzoid, you can buy Instagram followers through a short checkout flow with safety controls. Rated world's #1 IG service since 2012. -

-

- buzzoid.com -

-
- - Buy Instagram Followers Twicsy - -

- Buy real Instagram followers from Twicsy. Twicsy has been voted the best site to buy followers from the likes of US Magazine. -

-

- twicsy.com -

-
- - Fun 88 - -

- Fun88 is a global online gambling and betting brand founded in 2009, offering a wide range of services including sports betting, live casino games, slots, and virtual gaming. -

-

- global.fun88.com -

-
- - JBO Vietnam - -

- JBO Vietnam is a prominent online entertainment brand in Vietnam, offering sports betting, esports, online casino games, and a wide range of other exciting games. -

-

- jbo88b.com -

-
- - JBO Thailand - -

- JBO Thailand is a prominent online entertainment brand in Thailand, offering sports betting, esports, online casino games, and a wide range of other exciting games. -

-

- jbo88b.com -

-
- 💜 Become a sponsor -
- - - -

- -
- Axios
-
- -

Promise based HTTP client for the browser and node.js

- -

- Website • - Documentation -

- -
- -[![npm version](https://img.shields.io/npm/v/axios.svg?style=flat-square)](https://www.npmjs.org/package/axios) -[![Build status](https://img.shields.io/github/actions/workflow/status/axios/axios/ci.yml?branch=v1.x&label=CI&logo=github&style=flat-square)](https://github.com/axios/axios/actions/workflows/ci.yml) -[![Gitpod Ready-to-Code](https://img.shields.io/badge/Gitpod-Ready--to--Code-blue?logo=gitpod&style=flat-square)](https://gitpod.io/#https://github.com/axios/axios) -[![install size](https://img.shields.io/badge/dynamic/json?url=https://packagephobia.com/v2/api.json?p=axios&query=$.install.pretty&label=install%20size&style=flat-square)](https://packagephobia.now.sh/result?p=axios) -[![npm bundle size](https://img.shields.io/bundlephobia/minzip/axios?style=flat-square)](https://bundlephobia.com/package/axios@latest) -[![npm downloads](https://img.shields.io/npm/dm/axios.svg?style=flat-square)](https://npm-stat.com/charts.html?package=axios) -[![gitter chat](https://img.shields.io/gitter/room/mzabriskie/axios.svg?style=flat-square)](https://gitter.im/mzabriskie/axios) -[![code helpers](https://www.codetriage.com/axios/axios/badges/users.svg)](https://www.codetriage.com/axios/axios) -[![Contributors](https://img.shields.io/github/contributors/axios/axios.svg?style=flat-square)](CONTRIBUTORS.md) -[![Agent Friendly](https://agentfriendlycode.com/api/badge/github/axios/axios.svg)](https://agentfriendlycode.com/repo/32) - -
- -## Table of contents - -- [Features](#features) -- [Browser support](#browser-support) -- [Installing](#installing) - - [Package manager](#package-manager) - - [CDN](#cdn) -- [Example](#example) -- [Axios API](#axios-api) -- [Request method aliases](#request-method-aliases) -- [Concurrency](#concurrency-deprecated) -- [Creating an instance](#creating-an-instance) -- [Instance methods](#instance-methods) -- [Request config](#request-config) -- [Response schema](#response-schema) -- [Config defaults](#config-defaults) - - [Global axios defaults](#global-axios-defaults) - - [Custom instance defaults](#custom-instance-defaults) - - [Config order of precedence](#config-order-of-precedence) -- [Interceptors](#interceptors) - - [Multiple interceptors](#multiple-interceptors) -- [Handling errors](#handling-errors) -- [Handling timeouts](#handling-timeouts) -- [Cancellation](#cancellation) - - [AbortController](#abortcontroller) - - [CancelToken](#canceltoken-deprecated) -- [Using application/x-www-form-urlencoded format](#using-applicationx-www-form-urlencoded-format) - - [URLSearchParams](#urlsearchparams) - - [Query string](#query-string-older-browsers) - - [Automatic serialization](#automatic-serialization-to-urlsearchparams) -- [Using multipart/form-data format](#using-multipartform-data-format) - - [FormData](#formdata) - - [Automatic serialization](#automatic-serialization-to-formdata) -- [Posting files](#posting-files) -- [HTML form posting](#html-form-posting-browser) -- [Progress capturing](#progress-capturing) -- [Rate limiting](#rate-limiting) -- [AxiosHeaders](#axiosheaders) -- [Fetch adapter](#fetch-adapter) - - [Custom fetch](#custom-fetch) - - [Using with Tauri](#using-with-tauri) - - [Using with SvelteKit](#using-with-sveltekit) -- [HTTP/2 support](#http2-support) -- [Semver](#semver) -- [Promises](#promises) -- [TypeScript](#typescript) -- [Contributing](#contributing) - - [Local setup](#local-setup) -- [Resources](#resources) -- [Credits](#credits) -- [License](#license) - -## Features - -- Make [XMLHttpRequests](https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest) from the browser. -- Make [http](https://nodejs.org/api/http.html) requests from Node.js. -- Use the [Promise](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise) API for asynchronous request handling. -- Intercept requests and responses to add custom logic or transform data. -- Transform request and response data. -- Cancel requests with built-in cancellation APIs. -- Serialize and parse [JSON](https://www.json.org/json-en.html) data. -- Serialize data objects to `multipart/form-data` or `application/x-www-form-urlencoded`. -- Add client-side protection against [Cross-Site Request Forgery](https://en.wikipedia.org/wiki/Cross-site_request_forgery). - -## Browser support - -| Chrome | Firefox | Safari | Opera | Edge | -| :------------------------------------------------------------------------------------------------------------: | :---------------------------------------------------------------------------------------------------------------: | :------------------------------------------------------------------------------------------------------------: | :---------------------------------------------------------------------------------------------------------: | :------------------------------------------------------------------------------------------------------: | -| ![Chrome browser logo](https://raw.githubusercontent.com/alrra/browser-logos/main/src/chrome/chrome_48x48.png) | ![Firefox browser logo](https://raw.githubusercontent.com/alrra/browser-logos/main/src/firefox/firefox_48x48.png) | ![Safari browser logo](https://raw.githubusercontent.com/alrra/browser-logos/main/src/safari/safari_48x48.png) | ![Opera browser logo](https://raw.githubusercontent.com/alrra/browser-logos/main/src/opera/opera_48x48.png) | ![Edge browser logo](https://raw.githubusercontent.com/alrra/browser-logos/main/src/edge/edge_48x48.png) | -| Latest ✔ | Latest ✔ | Latest ✔ | Latest ✔ | Latest ✔ | - -[![Browser Matrix](https://saucelabs.com/open_sauce/build_matrix/axios.svg)](https://saucelabs.com/u/axios) - -## Installing - -### Package manager - -Using npm: - -```bash -$ npm install axios -``` - -Using yarn: - -```bash -$ yarn add axios -``` - -Using pnpm: - -```bash -$ pnpm add axios -``` - -Using bun: - -```bash -$ bun add axios -``` - -Using Deno: - -```bash -$ deno add axios -``` - -Once the package is installed, import it with `import` or `require`: - -```js -import axios, { isCancel, AxiosError } from 'axios'; -``` - -You can also use the default export, since the named export is just a re-export from the Axios factory: - -```js -import axios from 'axios'; - -console.log(axios.isCancel('something')); -``` - -If you use `require` for importing, **only the default export is available**: - -```js -const axios = require('axios'); - -console.log(axios.isCancel('something')); -``` - -Some bundlers and ES6 linters need this form: - -```js -import { default as axios } from 'axios'; -``` - -In custom or legacy environments, you can import the bundle directly: - -```js -const axios = require('axios/dist/browser/axios.cjs'); // browser commonJS bundle (ES2017) -// const axios = require('axios/dist/node/axios.cjs'); // node commonJS bundle (ES2017) -``` - -### CDN - -Using jsDelivr CDN (ES5 UMD browser module): - -```html - -``` - -Using unpkg CDN: - -```html - -``` - -## Example - -```js -import axios from 'axios'; -//const axios = require('axios'); // legacy way - -try { - const response = await axios.get('/user?ID=12345'); - console.log(response); -} catch (error) { - console.error(error); -} - -// Optionally the request above could also be done as -axios - .get('/user', { - params: { - ID: 12345, - }, - timeout: 5000, // 5 seconds. See "Handling Timeouts" below for matching error handling - }) - .then(function (response) { - console.log(response); - }) - .catch(function (error) { - console.log(error); - }) - .finally(function () { - // always executed - }); - -// Want to use async/await? Add the `async` keyword to your outer function/method. -async function getUser() { - try { - // Example: GET request with query parameters - const response = await axios.get('/user', { - params: { - ID: 12345, - }, - }); - - // Using the `params` option improves readability and automatically formats query strings - - console.log(response); - } catch (error) { - console.error(error); - } -} -``` - -> Note: Set a `timeout` in production. Without one, a stalled request can hang -> indefinitely. See [Handling Timeouts](#handling-timeouts) for the matching error handling. - -> Note: `async/await` is part of ECMAScript 2017 and is not supported in Internet -> Explorer and older browsers, so use with caution. - -Performing a `POST` request - -```js -const response = await axios.post('/user', { - firstName: 'Fred', - lastName: 'Flintstone', -}); -console.log(response); -``` - -Performing multiple concurrent requests - -```js -function getUserAccount() { - return axios.get('/user/12345'); -} - -function getUserPermissions() { - return axios.get('/user/12345/permissions'); -} - -Promise.all([getUserAccount(), getUserPermissions()]).then(function (results) { - const acct = results[0]; - const perm = results[1]; -}); -``` - -## axios API - -Requests can be made by passing the relevant config to `axios`. - -##### axios(config) - -```js -// Send a POST request -axios({ - method: 'post', - url: '/user/12345', - data: { - firstName: 'Fred', - lastName: 'Flintstone', - }, -}); -``` - -```js -// GET request for remote image in node.js -const response = await axios({ - method: 'get', - url: 'https://bit.ly/2mTM3nY', - responseType: 'stream', -}); -response.data.pipe(fs.createWriteStream('ada_lovelace.jpg')); -``` - -##### axios(url[, config]) - -```js -// Send a GET request (default method) -axios('/user/12345'); -``` - -### Request method aliases - -For convenience, aliases have been provided for all common request methods. - -##### axios.request(config) - -##### axios.get(url[, config]) - -##### axios.delete(url[, config]) - -##### axios.head(url[, config]) - -##### axios.options(url[, config]) - -##### axios.post(url[, data[, config]]) - -##### axios.put(url[, data[, config]]) - -##### axios.patch(url[, data[, config]]) - -###### Note - -When using the alias methods `url`, `method`, and `data` properties don't need to be specified in config. - -### Concurrency (deprecated) - -Use `Promise.all` instead of these helpers. - -Helper functions for dealing with concurrent requests. - -axios.all(iterable) -axios.spread(callback) - -### Creating an instance - -You can create a new instance of axios with a custom config. - -##### axios.create([config]) - -```js -const instance = axios.create({ - baseURL: 'https://some-domain.com/api/', - timeout: 1000, - headers: { 'X-Custom-Header': 'foobar' }, -}); -``` - -### Instance methods - -The following instance methods are available. Axios merges the specified config with the instance config. - -##### axios#request(config) - -##### axios#get(url[, config]) - -##### axios#delete(url[, config]) - -##### axios#head(url[, config]) - -##### axios#options(url[, config]) - -##### axios#post(url[, data[, config]]) - -##### axios#put(url[, data[, config]]) - -##### axios#patch(url[, data[, config]]) - -##### axios#getUri([config]) - -## Request config - -### Security notice: decompression-bomb protection is opt-in - -By default `maxContentLength` and `maxBodyLength` are `-1` (unlimited). A malicious or compromised server can return a tiny gzip/deflate/brotli/zstd body that expands to gigabytes and exhaust the Node.js process. - -If you call servers you do not fully trust, **set a cap**: - -```js -axios.defaults.maxContentLength = 10 * 1024 * 1024; // 10 MB -axios.defaults.maxBodyLength = 10 * 1024 * 1024; -``` - -See the [security guide](https://axios.rest/pages/misc/security.html) for details. - -These config options are available for requests. Only `url` is required. Requests default to `GET` when `method` is not set. - -```js -{ - // `url` is the server URL for the request - url: '/user', - - // `method` is the request method to be used when making the request - method: 'get', // default - - // Axios prepends `baseURL` to `url` unless `url` is absolute and `allowAbsoluteUrls` is set to true. - // It can be convenient to set `baseURL` for an instance of axios to pass relative URLs - // to the methods of that instance. - // `baseURL` is not a security boundary. If `url` is attacker-controlled, validate it - // before passing it to axios. Relative URLs can contain `..` segments that resolve - // outside an intended path prefix after the final URL is parsed. - baseURL: 'https://some-domain.com/api/', - - // `allowAbsoluteUrls` determines whether or not absolute URLs will override a configured `baseUrl`. - // When set to true (default), absolute values for `url` will override `baseUrl`. - // When set to false, absolute values for `url` will always be prepended by `baseUrl`. - allowAbsoluteUrls: true, - - // `transformRequest` allows changes to the request data before it is sent to the server - // This is only applicable for request methods 'PUT', 'POST', 'PATCH' and 'DELETE' - // The last function in the array must return a string or an instance of Buffer, ArrayBuffer, - // FormData or Stream - // You may modify the headers object. - transformRequest: [function (data, headers) { - // Do whatever you want to transform the data - - return data; - }], - - // `transformResponse` allows changes to the response data to be made before - // it is passed to then/catch - transformResponse: [function (data) { - // Do whatever you want to transform the data - - return data; - }], - - // `parseReviver` is an optional function passed as the - // second argument (reviver) to JSON.parse() - parseReviver: function (key, value, context) { - // In modern environments, context.source provides the raw JSON string - // allowing for precision-safe parsing of BigInt - if (typeof value === 'number' && context?.source) { - const isInteger = Number.isInteger(value); - const isUnsafe = !Number.isSafeInteger(value); - const isValidIntegerString = /^-?\d+$/.test(context.source); - - if (isInteger && isUnsafe && isValidIntegerString) { - try { - return BigInt(context.source); - } catch { - // Fallback: return original value if parsing fails - } - } - } - return value; - }, - - // `headers` are custom headers to be sent - headers: {'X-Requested-With': 'XMLHttpRequest'}, - - // `params` are the URL parameters to be sent with the request - // Must be a plain object or a URLSearchParams object - params: { - ID: 12345 - }, - - // `paramsSerializer` is an optional config that allows you to customize serializing `params`. - paramsSerializer: { - - // Custom encoder function which sends key/value pairs in an iterative fashion. - encode?: (param: string): string => { /* Do custom operations here and return transformed string */ }, - - // Custom serializer function for the entire parameter. Allows the user to mimic pre 1.x behaviour. - serialize?: (params: Record, options?: ParamsSerializerOptions ), - - // Configuration for formatting array indexes in the params. - indexes: false, // Three available options: (1) indexes: null (leads to no brackets), (2) (default) indexes: false (leads to empty brackets), (3) indexes: true (leads to brackets with indexes). - - // Maximum object nesting depth when serializing params. Payloads deeper than this throw an - // AxiosError with code ERR_FORM_DATA_DEPTH_EXCEEDED. Default: 100. Set to Infinity to disable. - maxDepth: 100 - - }, - - // `data` is the data to be sent as the request body - // Only applicable for request methods 'PUT', 'POST', 'DELETE', and 'PATCH' - // `data` is request-specific: axios does not inherit or deep-merge it from defaults. - // To add shared body fields, use a request interceptor or transformRequest. - // When no `transformRequest` is set, it must be of one of the following types: - // - string, plain object, ArrayBuffer, ArrayBufferView, URLSearchParams - // - Browser only: FormData, File, Blob - // - React Native: FormData - // - Node only: Stream, Buffer, FormData (form-data package) - data: { - firstName: 'Fred' - }, - - // `formDataHeaderPolicy` controls how node.js FormData#getHeaders() is copied. - // 'legacy' (default) copies all returned headers for v1 compatibility. - // 'content-only' copies only Content-Type and Content-Length. - formDataHeaderPolicy: 'legacy', - - // syntax alternative to send data into the body - // method post - // only the value is sent, not the key - data: 'Country=Brasil&City=Belo Horizonte', - - // `timeout` specifies the number of milliseconds before the request times out. - // If the request takes longer than `timeout`, Axios aborts it. - timeout: 1000, // default is `0` (no timeout) - - // `withCredentials` indicates whether or not cross-site Access-Control requests - // should be made using credentials - // This only controls whether the browser sends credentials. - // It does not control whether the XSRF header is added. - withCredentials: false, // default - - // `adapter` allows custom handling of requests which makes testing easier. - // Return a promise and supply a valid response (see lib/adapters/README.md) - adapter: function (config) { - /* ... */ - }, - // Also, you can set the name of the built-in adapter, or provide an array with their names - // to choose the first available in the environment - adapter: 'xhr', // 'fetch' | 'http' | ['xhr', 'http', 'fetch'] - - // `auth` indicates that HTTP Basic auth should be used, and supplies credentials. - // This will set an `Authorization` header, overwriting any existing - // `Authorization` custom headers you have set using `headers`. - // If `auth` is omitted, the Node.js HTTP and fetch adapters can read - // HTTP Basic auth credentials from the request URL, for example - // `https://user:pass@example.com`. Axios decodes percent-encoded URL - // credentials, and `auth` takes precedence over URL-embedded credentials. - // The Node.js HTTP adapter preserves Basic auth on same-origin redirects - // and strips it on cross-origin redirects. - // Please note that only HTTP Basic auth is configurable through this parameter. - // For Bearer tokens and such, use `Authorization` custom headers instead. - auth: { - username: 'janedoe', - password: 's00pers3cret' - }, - - // `responseType` indicates the type of data that the server will respond with - // options are: 'arraybuffer', 'document', 'json', 'text', 'stream' - // browser only: 'blob' - responseType: 'json', // default - - // `responseEncoding` indicates encoding to use for decoding responses (Node.js only) - // Note: Ignored for `responseType` of 'stream' or client-side requests - // options are: 'ascii', 'ASCII', 'ansi', 'ANSI', 'binary', 'BINARY', 'base64', 'BASE64', 'base64url', - // 'BASE64URL', 'hex', 'HEX', 'latin1', 'LATIN1', 'ucs-2', 'UCS-2', 'ucs2', 'UCS2', 'utf-8', 'UTF-8', - // 'utf8', 'UTF8', 'utf16le', 'UTF16LE' - responseEncoding: 'utf8', // default - - // `xsrfCookieName` is the name of the cookie to use as a value for the xsrf token - xsrfCookieName: 'XSRF-TOKEN', // default - - // `xsrfHeaderName` is the name of the http header that carries the xsrf token value - xsrfHeaderName: 'X-XSRF-TOKEN', // default - - // `withXSRFToken` defines whether to send the XSRF header in browser requests. - // `undefined` (default) - set XSRF header only for the same origin requests - // `true` - always set XSRF header, including for cross-origin requests - // `false` - never set XSRF header - // function - resolve with custom logic; receives the internal config object - withXSRFToken: boolean | undefined | ((config: InternalAxiosRequestConfig) => boolean | undefined), - - // `withXSRFToken` controls whether Axios reads the XSRF cookie and sets the XSRF header. - // - `undefined` (default): the XSRF header is set only for same-origin requests. - // - `true`: attempt to set the XSRF header for all requests (including cross-origin). - // - `false`: never set the XSRF header. - // - function: a callback that receives the request `config` and returns `true`, - // `false`, or `undefined` to decide per-request behavior. - // - // Note about `withCredentials`: `withCredentials` controls whether cross-site - // requests include credentials (cookies and HTTP auth). In older Axios versions, - // setting `withCredentials: true` implicitly caused Axios to set the XSRF header - // for cross-origin requests. Newer Axios separates these concerns: to allow the - // XSRF header to be sent for cross-origin requests you should set both - // `withCredentials: true` and `withXSRFToken: true`. - // - // Example: - // axios.get('/user', { withCredentials: true, withXSRFToken: true }); - - // `onUploadProgress` allows handling of progress events for uploads - // browser & node.js - onUploadProgress: function ({loaded, total, progress, bytes, estimated, rate, upload = true}) { - // Do whatever you want with the Axios progress event - }, - - // `onDownloadProgress` allows handling of progress events for downloads - // browser & node.js - onDownloadProgress: function ({loaded, total, progress, bytes, estimated, rate, download = true}) { - // Do whatever you want with the Axios progress event - }, - - // `maxContentLength` defines the max size of the response content in bytes. - // It is enforced by the Node.js HTTP adapter and the fetch adapter. - maxContentLength: 2000, - - // `maxBodyLength` defines the max size of the request content in bytes. - // It is enforced by the Node.js HTTP adapter and the fetch adapter when the body length can be determined. - maxBodyLength: 2000, - - // `redact` masks matching config keys when AxiosError#toJSON() is called. - // Matching is case-insensitive and recursive. It does not change the request. - redact: ['authorization', 'password'], - - // `validateStatus` defines whether to resolve or reject the promise for a given - // HTTP response status code. If `validateStatus` returns `true` or is set to - // `null`, Axios resolves the promise; otherwise, Axios rejects it. - // Explicit `validateStatus: undefined` resolves every status by default for - // backward compatibility. Set `transitional.validateStatusUndefinedResolves` - // to `false` to make explicit `undefined` behave as if this option was omitted. - validateStatus: function (status) { - return status >= 200 && status < 300; // default - }, - - // `maxRedirects` defines the maximum number of redirects to follow in node.js. - // If set to 0, Axios follows no redirects. - maxRedirects: 21, // default - - // `sensitiveHeaders` (Node only option) lists custom secret-bearing headers - // (such as `X-API-Key`) to remove from cross-origin redirects. Matching is - // case-insensitive. Same-origin redirects keep these headers. If - // `maxRedirects` is 0, this option is not used. - sensitiveHeaders: ['X-API-Key'], - - // `beforeRedirect` defines a function that Axios calls before redirect. - // Use this to adjust the request options upon redirecting, - // to inspect the latest response headers, - // or to cancel the request by throwing an error - // If maxRedirects is set to 0, `beforeRedirect` is not used. - - beforeRedirect: (options, { headers }) => { - if ( - options.hostname === "example.com" && - options.protocol === "https:" - ) { - options.auth = "user:password"; - } - }, - // Security note: - // The `beforeRedirect` hook runs after sensitive headers are stripped during redirects. - // `follow-redirects` removes credentials on protocol downgrades - // (HTTPS to HTTP). Because `beforeRedirect` runs after that step, - // re-injecting credentials without checking the destination can expose - // sensitive data. Only add credentials for trusted HTTPS destinations. - - // `socketPath` defines a UNIX Socket to be used in node.js. - // e.g. '/var/run/docker.sock' to send requests to the docker daemon. - // Only either `socketPath` or `proxy` can be specified. - // If both are specified, `socketPath` is used. - // - // Security: when `socketPath` is set, hostname/port of the URL are ignored, - // which bypasses hostname-based SSRF protections. Never derive `socketPath` - // from untrusted input. Use `allowedSocketPaths` (below) to restrict accepted - // socket paths for defense-in-depth. - socketPath: null, // default - - // `allowedSocketPaths` restricts which `socketPath` values are accepted. - // Accepts a string or array of strings. Entries and the incoming socketPath - // are compared after path.resolve(). A mismatch throws AxiosError with code - // `ERR_BAD_OPTION_VALUE`. When null/undefined, no restriction is applied. - allowedSocketPaths: null, // default - - // `transport` determines the transport method for the request. - // If defined, Axios uses it. Otherwise, if `maxRedirects` is 0, - // Axios uses the default `http` or `https` library, depending on the protocol specified in `protocol`. - // Otherwise, Axios uses the `httpFollow` or `httpsFollow` library, again depending on the protocol, - // which can handle redirects. - transport: undefined, // default - - // `httpAgent` and `httpsAgent` define a custom agent to be used when performing http - // and https requests, respectively, in node.js. This allows options to be added like - // `keepAlive` that are not enabled by default before Node.js v19.0.0. After Node.js - // v19.0.0, you no longer need to customize the agent to enable `keepAlive` because - // `http.globalAgent` has `keepAlive` enabled by default. - httpAgent: new http.Agent({ keepAlive: true }), - httpsAgent: new https.Agent({ keepAlive: true }), - - // `proxy` defines the hostname, port, and protocol of the proxy server. - // You can also define your proxy using the conventional `http_proxy` and - // `https_proxy` environment variables. If you are using environment variables - // for your proxy configuration, you can also define a `no_proxy` environment - // variable as a comma-separated list of domains that should not be proxied. - // Use `false` to disable proxies, ignoring environment variables. - // On Node.js versions with native environment proxy support, axios defers - // environment proxy handling to Node when the selected agent has `proxyEnv` - // enabled, including processes started with `NODE_USE_ENV_PROXY=1`, - // `--use-env-proxy`, or `NODE_OPTIONS=--use-env-proxy`. Custom agents without - // `proxyEnv` continue to use axios environment proxy resolution. Explicit - // `proxy` config is still handled by axios. - // `auth` indicates that HTTP Basic auth should be used to connect to the proxy, and - // supplies credentials. - // For `http://` targets, axios sends the request to the proxy in - // forward-proxy mode and stamps `Proxy-Authorization` onto the request - // headers (overwriting any user-supplied `Proxy-Authorization` header). - // For `https://` targets, axios establishes a CONNECT tunnel through the - // proxy and performs TLS end-to-end with the origin; `Proxy-Authorization` - // is sent on the CONNECT request only, never on the wrapped TLS request, - // so the proxy never sees the URL, headers, or body. Axios forwards - // `httpsAgent` TLS options such as `ca`, `cert`, `key`, and - // `rejectUnauthorized` to the generated tunneling agent, so they still apply - // to the origin TLS connection. - // If you supply an `HttpsProxyAgent`, axios leaves tunneling to that agent. - // If the proxy server uses HTTPS, then you must set the protocol to `https`. - // A user-supplied `Host` header in `headers` is preserved when forwarding - // through a proxy (case-insensitive match on `host`/`Host`/`HOST`); this - // lets you target a virtual host that differs from the request URL, for - // example, hitting `127.0.0.1:4000` while having the proxy treat the - // request as `example.com`. If no `Host` header is supplied, axios - // defaults it to the request URL's `hostname:port` as before. The Host - // header is only set in forward-proxy mode (HTTP targets); for HTTPS - // tunneling the Host header is sent inside the TLS connection, not seen - // by the proxy. - proxy: { - protocol: 'https', - host: '127.0.0.1', - // hostname: '127.0.0.1' // Takes precedence over 'host' if both are defined - port: 9000, - auth: { - username: 'mikeymike', - password: 'rapunz3l' - } - }, - - // `cancelToken` specifies a cancel token that can be used to cancel the request - // (see Cancellation section below for details) - cancelToken: new CancelToken(function (cancel) { - }), - - // an alternative way to cancel Axios requests using AbortController - signal: new AbortController().signal, - - // `decompress` indicates whether or not the response body should be decompressed - // automatically. If set to `true` will also remove the 'content-encoding' header - // from the responses objects of all decompressed responses - // Axios supports gzip, deflate, brotli, and zstd when the current Node.js - // runtime provides the corresponding zlib decompressor. - // - Node only (XHR cannot turn off decompression) - decompress: true, // default - - // `insecureHTTPParser` boolean. - // Indicates where to use an insecure HTTP parser that accepts invalid HTTP headers. - // This may allow interoperability with non-conformant HTTP implementations. - // Using the insecure parser should be avoided. - // see options https://nodejs.org/dist/latest-v12.x/docs/api/http.html#http_http_request_url_options_callback - // see also https://nodejs.org/en/blog/vulnerability/february-2020-security-releases/#strict-http-header-parsing-none - insecureHTTPParser: undefined, // default - - // transitional options for backward compatibility that may be removed in the newer versions - transitional: { - // silent JSON parsing mode - // `true` - ignore JSON parsing errors and set response.data to null if parsing failed (old behaviour) - // `false` - throw SyntaxError if JSON parsing failed - // Important: this option only takes effect when `responseType` is explicitly set to 'json'. - // When `responseType` is omitted (defaults to no value), axios uses `forcedJSONParsing` - // to attempt JSON parsing, but will silently return the raw string on failure regardless - // of this setting. To have invalid JSON throw errors, use: - // { responseType: 'json', transitional: { silentJSONParsing: false } } - silentJSONParsing: true, // default value for the current Axios version - - // try to parse the response string as JSON even if `responseType` is not 'json' - forcedJSONParsing: true, - - // throw ETIMEDOUT error instead of generic ECONNABORTED on request timeouts - clarifyTimeoutError: false, - - // keep explicit `validateStatus: undefined` resolving every response status - // for backward compatibility. Set to false to make explicit undefined behave - // as if validateStatus was omitted. - validateStatusUndefinedResolves: true, - - // advertise `zstd` in the default Accept-Encoding header when the current - // Node.js runtime supports zstd decompression. Axios still decompresses - // zstd responses when support exists and `decompress` is true. - advertiseZstdAcceptEncoding: false, - - // use the legacy interceptor request/response ordering - legacyInterceptorReqResOrdering: true, // default - }, - - env: { - // The FormData class to be used to automatically serialize the payload into a FormData object - FormData: window?.FormData || global?.FormData - }, - - formSerializer: { - visitor: (value, key, path, helpers) => {}; // custom visitor function to serialize form values - dots: boolean; // use dots instead of brackets format - metaTokens: boolean; // keep special endings like {} in parameter key - indexes: boolean; // array indexes format null - no brackets, false - empty brackets, true - brackets with indexes - maxDepth: 100; // maximum object nesting depth; throws AxiosError (ERR_FORM_DATA_DEPTH_EXCEEDED) if exceeded. Set to Infinity to disable. - }, - - // http adapter only (node.js) - maxRate: [ - 100 * 1024, // 100KB/s upload limit, - 100 * 1024 // 100KB/s download limit - ] -} -``` - -For custom secret-bearing headers in Node.js, list them in `sensitiveHeaders` so Axios removes them when following a redirect to another origin: - -```js -axios.get('https://api.example.com/users', { - headers: { 'X-API-Key': 'secret' }, - sensitiveHeaders: ['X-API-Key'], -}); -``` - -### Strict RFC 3986 percent-encoding for query params - -By default, axios decodes `%3A`, `%24`, `%2C` and `%20` back to `:`, `$`, `,` and `+` for readability (the `+` follows the `application/x-www-form-urlencoded` convention for spaces in query strings). These characters are valid in a query component under [RFC 3986](https://datatracker.ietf.org/doc/html/rfc3986#section-3.4), so the default output is correct, but some backends require strict percent-encoding and reject the readable form. - -Override the default encoder via `paramsSerializer.encode`: - -```js -// Per-request: emit strict RFC 3986 percent-encoding for query values -axios.get('/foo', { - params: { filter: JSON.stringify({ startedAt: '2026-01-23' }) }, - paramsSerializer: { encode: encodeURIComponent }, -}); - -// Or set it on the instance defaults -const client = axios.create({ - paramsSerializer: { encode: encodeURIComponent }, -}); -``` - -## HTTP/2 support - -Axios has experimental HTTP/2 support in the Node.js HTTP adapter. - -Support depends on the runtime environment and Node.js version. Redirects and some adapter behavior may differ from HTTP/1.1. - -Options like `httpVersion` and `http2Options` are adapter-specific and may not work the same way in every environment. - -If you need HTTP/2, check runtime support or use a custom adapter. - -## Response schema - -The response to a request contains the following information. - -```js -{ - // `data` is the response that was provided by the server - data: {}, - - // `status` is the HTTP status code from the server response - status: 200, - - // `statusText` is the HTTP status message from the server response - statusText: 'OK', - - // `headers` the HTTP headers that the server responded with - // All header names are lowercase and can be accessed using the bracket notation. - // Example: `response.headers['content-type']` - headers: {}, - - // `config` is the config that was provided to `axios` for the request - config: {}, - - // `request` is the request that generated this response - // It is the last ClientRequest instance in node.js (in redirects) - // and an XMLHttpRequest instance in the browser - request: {} -} -``` - -When using `then`, you receive the response like this: - -```js -const response = await axios.get('/user/12345'); -console.log(response.data); -console.log(response.status); -console.log(response.statusText); -console.log(response.headers); -console.log(response.config); -``` - -When using `catch`, or passing a [rejection callback](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise/then) as the second parameter of `then`, read the response from the `error` object. See [Handling errors](#handling-errors). - -## Config defaults - -Config defaults apply to every request. - -### Global axios defaults - -```js -axios.defaults.baseURL = 'https://api.example.com'; - -// Important: If you use axios with multiple domains, Axios sends AUTH_TOKEN to all of them. -// See below for an example using Custom instance defaults instead. -axios.defaults.headers.common['Authorization'] = AUTH_TOKEN; - -axios.defaults.headers.post['Content-Type'] = 'application/x-www-form-urlencoded'; -``` - -### Custom instance defaults - -```js -// Set config defaults when creating the instance -const instance = axios.create({ - baseURL: 'https://api.example.com', -}); - -// Alter defaults after instance has been created -instance.defaults.headers.common['Authorization'] = AUTH_TOKEN; -``` - -### Config order of precedence - -Axios merges config in this order: library defaults from [lib/defaults/index.js](https://github.com/axios/axios/blob/main/lib/defaults/index.js#L49), the instance `defaults` property, and the request `config` argument. Later values take precedence over earlier ones. - -Some options are request-specific and are only taken from the request `config`. `data` is one of those options: axios does not inherit or deep-merge request bodies from global or instance defaults. If every request needs shared body fields, add them with a request interceptor or `transformRequest`, and scope that logic carefully so sensitive values are not sent to the wrong endpoint. - -```js -// Create an instance using the config defaults provided by the library -// At this point the timeout config value is `0` as is the default for the library -const instance = axios.create(); - -// Override timeout default for the library -// Now all requests using this instance will wait 2.5 seconds before timing out -instance.defaults.timeout = 2500; - -// Override timeout for this request as it's known to take a long time -instance.get('/longRequest', { - timeout: 5000, -}); -``` - -## Interceptors - -You can intercept requests or responses before methods like `.get()` or `.post()` -resolve their promises (before code inside `then` or `catch`, or after `await`) - -```js -const instance = axios.create(); - -// Add a request interceptor -instance.interceptors.request.use( - function (config) { - // Do something before the request is sent - return config; - }, - function (error) { - // Do something with the request error - return Promise.reject(error); - } -); - -// Add a response interceptor -instance.interceptors.response.use( - function (response) { - // Any status code that lies within the range of 2xx causes this function to trigger - // Do something with response data - return response; - }, - function (error) { - // Any status codes that fall outside the range of 2xx cause this function to trigger - // Do something with response error - return Promise.reject(error); - } -); -``` - -If you need to remove an interceptor later you can. - -```js -const instance = axios.create(); -const myInterceptor = instance.interceptors.request.use(function () { - /*...*/ -}); -instance.interceptors.request.eject(myInterceptor); -``` - -You can also clear all interceptors for requests or responses. - -```js -const instance = axios.create(); -instance.interceptors.request.use(function () { - /*...*/ -}); -instance.interceptors.request.clear(); // Removes interceptors from requests -instance.interceptors.response.use(function () { - /*...*/ -}); -instance.interceptors.response.clear(); // Removes interceptors from responses -``` - -You can add interceptors to a custom instance of axios. - -```js -const instance = axios.create(); -instance.interceptors.request.use(function () { - /*...*/ -}); -``` - -When you add request interceptors, they are presumed to be asynchronous by default. This can cause a delay -in the execution of your axios request when the main thread is blocked (a promise is created under the hood for -the interceptor and your request gets put at the bottom of the call stack). If your request interceptors are synchronous you can add a flag -to the options object that will tell axios to run the code synchronously and avoid any delays in request execution. - -```js -axios.interceptors.request.use( - function (config) { - config.headers.test = 'I am only a header!'; - return config; - }, - null, - { synchronous: true } -); -``` - -If you want to execute a particular interceptor based on a runtime check, -you can add a `runWhen` function to the options object. The request interceptor will not run **if and only if** the return -of `runWhen` is `false`. Axios calls the function with the config -object (don't forget that you can bind your own arguments to it as well.) This can be handy when you have an -asynchronous request interceptor that only needs to run at certain times. - -```js -function onGetCall(config) { - return config.method === 'get'; -} -axios.interceptors.request.use( - function (config) { - config.headers.test = 'special get headers'; - return config; - }, - null, - { runWhen: onGetCall } -); -``` - -> Note: The options parameter (with `synchronous` and `runWhen` properties) is only supported for request interceptors at the moment. - -### Interceptor execution order - -Request and response interceptors use different execution orders. - -Request interceptors run in reverse order (LIFO: last in, first out). The last interceptor added runs first. - -Response interceptors run in the order they were added (FIFO: first in, first out). The first interceptor added runs first. - -Example: - -```js -const instance = axios.create(); - -const interceptor = (id) => (base) => { - console.log(id); - return base; -}; - -instance.interceptors.request.use(interceptor('Request Interceptor 1')); -instance.interceptors.request.use(interceptor('Request Interceptor 2')); -instance.interceptors.request.use(interceptor('Request Interceptor 3')); -instance.interceptors.response.use(interceptor('Response Interceptor 1')); -instance.interceptors.response.use(interceptor('Response Interceptor 2')); -instance.interceptors.response.use(interceptor('Response Interceptor 3')); - -// Console output: -// Request Interceptor 3 -// Request Interceptor 2 -// Request Interceptor 1 -// [HTTP request is made] -// Response Interceptor 1 -// Response Interceptor 2 -// Response Interceptor 3 -``` - -### Multiple interceptors - -When a response is fulfilled and multiple response interceptors are registered: - -- Each interceptor runs in registration order. -- Each interceptor receives the result from the previous interceptor. -- The chain returns the result from the last interceptor. -- If a fulfillment interceptor throws, Axios skips the next fulfillment interceptor and calls the next rejection interceptor. -- After the error is caught, later fulfillment interceptors run again, just like in a promise chain. - -Read [the interceptor tests](./test/specs/interceptors.spec.js) to see all this in code. - -## Error types - -Axios error messages include details that can help you debug the request. - -Axios errors use this structure: -| Property | Definition | -| -------- | ---------- | -| message | A quick summary of the error message and the status it failed with. | -| name | This defines where the error originated from. For axios, it will always be an 'AxiosError'. | -| stack | Stack trace for the error. | -| config | An axios config object with specific instance configurations defined by the user from when the request was made | -| code | Axios error code. The table below lists internal Axios error codes. | -| status | HTTP response status code. See [here](https://en.wikipedia.org/wiki/List_of_HTTP_status_codes) for common HTTP response status code meanings. - -These are the internal Axios error codes: - -| Code | Definition | -| ------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| ERR_BAD_OPTION_VALUE | Invalid value provided in axios configuration. | -| ERR_BAD_OPTION | Invalid option provided in axios configuration. | -| ERR_NOT_SUPPORT | Feature or method not supported in the current axios environment. | -| ERR_DEPRECATED | Deprecated feature or method used in axios. | -| ERR_INVALID_URL | Invalid URL provided for axios request. | -| ECONNABORTED | Typically indicates that the request has been timed out (unless `transitional.clarifyTimeoutError` is set) or aborted by the browser or its plugin. | -| ERR_CANCELED | The user explicitly canceled the request with an AbortSignal or CancelToken. | -| ETIMEDOUT | Request timed out after exceeding the configured Axios timeout. Set `transitional.clarifyTimeoutError` to `true`; otherwise Axios throws a generic `ECONNABORTED` error. | -| ERR_NETWORK | Network-related issue. In the browser, this error can also be caused by a [CORS](https://developer.mozilla.org/ru/docs/Web/HTTP/Guides/CORS) or [Mixed Content](https://developer.mozilla.org/en-US/docs/Web/Security/Mixed_content) policy violation. The browser does not allow the JS code to clarify the real reason for the error caused by security issues, so please check the console. | -| ERR_FR_TOO_MANY_REDIRECTS | Request exceeded the configured maximum number of redirects. | -| ERR_BAD_RESPONSE | Response cannot be parsed properly or is in an unexpected format. Usually related to a response with `5xx` status code. | -| ERR_BAD_REQUEST | The request has an unexpected format or is missing required parameters. Usually related to a response with `4xx` status code. | - -## Handling errors - -By default, Axios rejects responses with status codes outside the 2xx range. - -```js -axios.get('/user/12345').catch(function (error) { - if (error.response) { - // The request was made and the server responded with a status code - // that falls out of the range of 2xx - console.log(error.response.data); - console.log(error.response.status); - console.log(error.response.headers); - } else if (error.request) { - // The request was made but no response was received - // `error.request` is an instance of XMLHttpRequest in the browser and an instance of - // http.ClientRequest in node.js - console.log(error.request); - } else { - // Something happened in setting up the request that triggered an Error - console.log('Error', error.message); - } - console.log(error.config); -}); -``` - -Use `validateStatus` to override the default condition (`status >= 200 && status < 300`) and choose which HTTP status codes should reject. - -```js -axios.get('/user/12345', { - validateStatus: function (status) { - return status < 500; // Resolve only if the status code is less than 500 - }, -}); -``` - -By default, explicit `validateStatus: undefined` keeps legacy behavior and resolves every response status because `transitional.validateStatusUndefinedResolves` defaults to `true`. Set it to `false` to make explicit `validateStatus: undefined` behave like the option was omitted, so Axios uses the configured/default validator and rejects non-2xx responses by default. - -`validateStatus: null` still accepts every response status. If you disable the transitional behavior and intentionally want all statuses to resolve, use `null` or `() => true`. - -```js -axios.get('/user/12345', { - validateStatus: undefined, - transitional: { - validateStatusUndefinedResolves: false, - }, -}); -``` - -Use `toJSON` to get more information about the HTTP error. - -```js -axios.get('/user/12345').catch(function (error) { - console.log(error.toJSON()); -}); -``` - -To avoid logging secrets from `error.config`, pass a `redact` array in the request config. Matching config keys are masked case-insensitively at any depth when `AxiosError#toJSON()` is called. - -```js -axios - .get('/user/12345', { - headers: { Authorization: 'Bearer token' }, - redact: ['authorization'], - }) - .catch(function (error) { - console.log(error.toJSON().config.headers.Authorization); // [REDACTED ****] - }); -``` - -## Handling timeouts - -```js -async function fetchWithTimeout() { - try { - const response = await axios.get('https://example.com/data', { - timeout: 5000, // 5 seconds - transitional: { - // set to true if you prefer ETIMEDOUT over ECONNABORTED - clarifyTimeoutError: false, - }, - }); - - console.log('Response:', response.data); - } catch (error) { - if (axios.isAxiosError(error)) { - if (error.code === 'ECONNABORTED' || error.code === 'ETIMEDOUT') { - console.error('Request timed out. Please try again.'); - return; - } - - console.error('Axios error:', error.message); - return; - } - - console.error('Unexpected error:', error); - } -} -``` - -## Cancellation - -### AbortController - -Since `v0.22.0`, Axios supports AbortController: - -```js -const controller = new AbortController(); - -axios - .get('/foo/bar', { - signal: controller.signal, - }) - .then(function (response) { - //... - }); -// cancel the request -controller.abort(); -``` - -### CancelToken (deprecated) - -You can also cancel a request using a _CancelToken_. - -> The axios cancel token API is based on the withdrawn [cancellable promises proposal](https://github.com/tc39/proposal-cancelable-promises). - -> This API is deprecated since v0.22.0 and should not be used in new projects. - -Create a cancel token with the `CancelToken.source` factory: - -```js -const CancelToken = axios.CancelToken; -const source = CancelToken.source(); - -axios - .get('/user/12345', { - cancelToken: source.token, - }) - .catch(function (thrown) { - if (axios.isCancel(thrown)) { - console.log('Request canceled', thrown.message); - } else { - // handle error - } - }); - -axios.post( - '/user/12345', - { - name: 'new name', - }, - { - cancelToken: source.token, - } -); - -// cancel the request (the message parameter is optional) -source.cancel('Operation canceled by the user.'); -``` - -You can also pass an executor function to the `CancelToken` constructor: - -```js -const CancelToken = axios.CancelToken; -let cancel; - -axios.get('/user/12345', { - cancelToken: new CancelToken(function executor(c) { - // An executor function receives a cancel function as a parameter - cancel = c; - }), -}); - -// cancel the request -cancel(); -``` - -`CancelToken` also exposes low-level helpers for legacy integrations: - -```js -const source = axios.CancelToken.source(); - -const listener = (cancel) => { - console.log(cancel.message); -}; - -source.token.subscribe(listener); - -const signal = source.token.toAbortSignal(); -// Pass `signal` to APIs that accept AbortSignal. - -source.cancel('Operation canceled by the user.'); -source.token.unsubscribe(listener); -``` - -Canceled requests reject with `axios.CanceledError`. The legacy `axios.Cancel` export is an alias of `axios.CanceledError`, and cancellation errors include `__CANCEL__` for `axios.isCancel` compatibility. - -> Note: You can cancel several requests with the same cancel token or abort controller. -> If a cancellation token is already cancelled when an Axios request starts, Axios cancels the request immediately without making a real request. - -> During the transition period, you can use both cancellation APIs, even for the same request: - -```js -const controller = new AbortController(); -const source = axios.CancelToken.source(); - -axios.get('/user/12345', { - cancelToken: source.token, - signal: controller.signal, -}); - -controller.abort(); -source.cancel('Operation canceled by the user.'); -``` - -## Using `application/x-www-form-urlencoded` format - -### URLSearchParams - -By default, axios serializes JavaScript objects to `JSON`. To send data as [`application/x-www-form-urlencoded`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Methods/POST), use the [`URLSearchParams`](https://developer.mozilla.org/en-US/docs/Web/API/URLSearchParams) API. It works in most browsers and in [Node](https://nodejs.org/api/url.html#url_class_urlsearchparams) v10 and later. - -```js -const params = new URLSearchParams({ foo: 'bar' }); -params.append('extraparam', 'value'); -axios.post('/foo', params); -``` - -### Query string (older browsers) - -For very old browsers, use a [polyfill](https://github.com/WebReflection/url-search-params) and make sure it patches the global environment. - -Alternatively, you can encode data using the [`qs`](https://github.com/ljharb/qs) library: - -```js -const qs = require('qs'); -axios.post('/foo', qs.stringify({ bar: 123 })); -``` - -With ES modules: - -```js -import qs from 'qs'; -const data = { bar: 123 }; -const options = { - method: 'POST', - headers: { 'content-type': 'application/x-www-form-urlencoded' }, - data: qs.stringify(data), - url, -}; -axios(options); -``` - -### Older Node.js versions - -For older Node.js engines, use the [`querystring`](https://nodejs.org/api/querystring.html) module: - -```js -const querystring = require('querystring'); -axios.post('https://something.com/', querystring.stringify({ foo: 'bar' })); -``` - -You can also use the [`qs`](https://github.com/ljharb/qs) library. - -> Note: The `qs` library is preferable if you need to stringify nested objects, as the `querystring` method has [known issues](https://github.com/nodejs/node-v0.x-archive/issues/1665) with that use case. - -### Automatic serialization to URLSearchParams - -Axios automatically serializes the data object to urlencoded format if the content-type header is set to "application/x-www-form-urlencoded". - -```js -const data = { - x: 1, - arr: [1, 2, 3], - arr2: [1, [2], 3], - users: [ - { name: 'Peter', surname: 'Griffin' }, - { name: 'Thomas', surname: 'Anderson' }, - ], -}; - -await axios.postForm('https://postman-echo.com/post', data, { - headers: { 'content-type': 'application/x-www-form-urlencoded' }, -}); -``` - -The server receives these fields: - -```js - { - x: '1', - 'arr[]': [ '1', '2', '3' ], - 'arr2[0]': '1', - 'arr2[1][0]': '2', - 'arr2[2]': '3', - 'arr3[]': [ '1', '2', '3' ], - 'users[0][name]': 'Peter', - 'users[0][surname]': 'griffin', - 'users[1][name]': 'Thomas', - 'users[1][surname]': 'Anderson' - } -``` - -If your backend body parser, such as `body-parser` for `express.js`, supports nested object decoding, the server receives the same object structure: - -```js -const app = express(); - -app.use(bodyParser.urlencoded({ extended: true })); // support encoded bodies - -app.post('/', function (req, res, next) { - // echo body as JSON - res.send(JSON.stringify(req.body)); -}); - -server = app.listen(3000); -``` - -## Using `multipart/form-data` format - -### FormData - -To send data as `multipart/form-data`, pass a FormData instance as the payload. -You do not need to set the `Content-Type` header. Axios detects it from the payload type. -For browser, web worker, and React Native `FormData`, leave `Content-Type` unset so the runtime can add the multipart boundary. - -```js -const formData = new FormData(); -formData.append('foo', 'bar'); - -axios.post('https://httpbin.org/post', formData); -``` - -In node.js, use the [`form-data`](https://github.com/form-data/form-data) library: - -```js -const FormData = require('form-data'); - -const form = new FormData(); -form.append('my_field', 'my value'); -form.append('my_buffer', Buffer.alloc(10)); -form.append('my_file', fs.createReadStream('/foo/bar.jpg')); - -axios.post('https://example.com', form); -``` - -In node.js, when a `FormData` object provides `getHeaders()`, axios copies all returned headers by default for v1 compatibility. If the `FormData` object is custom or not fully trusted, set `formDataHeaderPolicy: 'content-only'` to copy only `Content-Type` and `Content-Length`, and set any other request headers explicitly with the request `headers` config. - -### Automatic serialization to FormData - -Since `v0.27.0`, Axios can serialize an object to FormData if the request `Content-Type` -header is set to `multipart/form-data`. - -This request submits data as FormData in browsers and Node.js: - -```js -import axios from 'axios'; - -axios - .post( - 'https://httpbin.org/post', - { x: 1 }, - { - headers: { - 'Content-Type': 'multipart/form-data', - }, - } - ) - .then(({ data }) => console.log(data)); -``` - -The Node.js build uses the [`form-data`](https://github.com/form-data/form-data) polyfill by default. - -You can override the FormData class with the `env.FormData` config option, but most applications do not need this: - -```js -const axios = require('axios'); -var FormData = require('form-data'); - -axios - .post( - 'https://httpbin.org/post', - { x: 1, buf: Buffer.alloc(10) }, - { - headers: { - 'Content-Type': 'multipart/form-data', - }, - } - ) - .then(({ data }) => console.log(data)); -``` - -The Axios FormData serializer supports these special endings: - -- `{}` - serialize the value with JSON.stringify -- `[]` - unwrap the array-like object as separate fields with the same key - -> Note: Arrays and FileList objects are unwrapped by default. - -FormData serializer supports additional options via `config.formSerializer: object` property to handle rare cases: - -- `visitor: Function` - user-defined visitor function that Axios calls recursively to serialize the data object - to a `FormData` object by following custom rules. - -- `dots: boolean = false` - use dot notation instead of brackets to serialize arrays and objects; - -- `metaTokens: boolean = true` - add the special ending (e.g `user{}: '{"name": "John"}'`) in the FormData key. - A backend body parser can use this meta-information to parse the value as JSON. - -- `indexes: null|false|true = false` - controls how Axios adds indexes to unwrapped keys of `flat` array-like objects. - - `null` - don't add brackets (`arr: 1`, `arr: 2`, `arr: 3`) - - `false`(default) - add empty brackets (`arr[]: 1`, `arr[]: 2`, `arr[]: 3`) - - `true` - add brackets with indexes (`arr[0]: 1`, `arr[1]: 2`, `arr[2]: 3`) -- `maxDepth: number = 100` - maximum object nesting depth the serializer will recurse into. If the - input object exceeds this depth, an `AxiosError` with `code: 'ERR_FORM_DATA_DEPTH_EXCEEDED'` is - thrown instead of overflowing the call stack. This protects server applications from DoS - attacks via deeply nested payloads. Set to `Infinity` to disable the limit and restore pre-fix behaviour. -- `Blob: typeof Blob` - Blob constructor used when converting ArrayBuffer-like values for spec-compliant - `FormData`. Override it only for runtimes that provide a compatible `Blob` constructor under a - different binding. - -```js -// Raise the limit for a schema that genuinely nests deeper than 100 levels: -axios.postForm('/api', data, { formSerializer: { maxDepth: 200 } }); - -// Same protection applies to params serialization: -axios.get('/api', { params: data, paramsSerializer: { maxDepth: 200 } }); -``` - -Given this object: - -```js -const obj = { - x: 1, - arr: [1, 2, 3], - arr2: [1, [2], 3], - users: [ - { name: 'Peter', surname: 'Griffin' }, - { name: 'Thomas', surname: 'Anderson' }, - ], - 'obj2{}': [{ x: 1 }], -}; -``` - -The Axios serializer appends these fields: - -```js -const formData = new FormData(); -formData.append('x', '1'); -formData.append('arr[]', '1'); -formData.append('arr[]', '2'); -formData.append('arr[]', '3'); -formData.append('arr2[0]', '1'); -formData.append('arr2[1][0]', '2'); -formData.append('arr2[2]', '3'); -formData.append('users[0][name]', 'Peter'); -formData.append('users[0][surname]', 'Griffin'); -formData.append('users[1][name]', 'Thomas'); -formData.append('users[1][surname]', 'Anderson'); -formData.append('obj2{}', '[{"x":1}]'); -``` - -Axios supports `postForm`, `putForm`, and `patchForm` as shortcuts for the matching HTTP methods with the `Content-Type` header preset to `multipart/form-data`. - -## Posting files - -Submit a single file: - -```js -await axios.postForm('https://httpbin.org/post', { - myVar: 'foo', - file: document.querySelector('#fileInput').files[0], -}); -``` - -or multiple files as `multipart/form-data`: - -```js -await axios.postForm('https://httpbin.org/post', { - 'files[]': document.querySelector('#fileInput').files, -}); -``` - -`FileList` object can be passed directly: - -```js -await axios.postForm('https://httpbin.org/post', document.querySelector('#fileInput').files); -``` - -Axios sends all files with the same field name: `files[]`. - -## HTML form posting (browser) - -Pass an HTML Form element as a payload to submit it as `multipart/form-data` content. - -```js -await axios.postForm('https://httpbin.org/post', document.querySelector('#htmlForm')); -``` - -`FormData` and `HTMLForm` objects can also be posted as `JSON` by explicitly setting the `Content-Type` header to `application/json`: - -```js -await axios.post('https://httpbin.org/post', document.querySelector('#htmlForm'), { - headers: { - 'Content-Type': 'application/json', - }, -}); -``` - -For example, the Form - -```html -
- - - - - - - - - -
-``` - -submits this JSON object: - -```js -{ - "foo": "1", - "deep": { - "prop": { - "spaced": "3" - } - }, - "baz": [ - "4", - "5" - ], - "user": { - "age": "value2" - } -} -``` - -Sending `Blobs`/`Files` as JSON (`base64`) is not currently supported. - -## Progress capturing - -Axios can capture request upload and download progress in browsers and Node.js. -Progress events are limited to `3` times per second. - -```js -await axios.post(url, data, { - onUploadProgress: function (axiosProgressEvent) { - /*{ - loaded: number; - total?: number; - progress?: number; // in range [0..1] - bytes: number; // how many bytes have been transferred since the last trigger (delta) - estimated?: number; // estimated time in seconds - rate?: number; // upload speed in bytes - upload: true; // upload sign - }*/ - }, - - onDownloadProgress: function (axiosProgressEvent) { - /*{ - loaded: number; - total?: number; - progress?: number; - bytes: number; - estimated?: number; - rate?: number; // download speed in bytes - download: true; // download sign - }*/ - }, -}); -``` - -You can also track stream upload/download progress in node.js: - -```js -const { data } = await axios.post(SERVER_URL, readableStream, { - onUploadProgress: ({ progress }) => { - console.log((progress * 100).toFixed(2)); - }, - - headers: { - 'Content-Length': contentLength, - }, - - maxRedirects: 0, // avoid buffering the entire stream -}); -``` - -> Note: -> Capturing FormData upload progress is not currently supported in node.js environments. - -> Warning: -> Set `maxRedirects: 0` when uploading streams in node.js. -> The follow-redirects package buffers the entire stream in RAM and does not follow the "backpressure" algorithm. - -## Rate limiting - -Download and upload rate limits can only be set for the http adapter (node.js): - -```js -const { data } = await axios.post(LOCAL_SERVER_URL, myBuffer, { - onUploadProgress: ({ progress, rate }) => { - console.log(`Upload [${(progress * 100).toFixed(2)}%]: ${(rate / 1024).toFixed(2)}KB/s`); - }, - - maxRate: [100 * 1024], // 100KB/s limit -}); -``` - -## AxiosHeaders - -Axios includes an `AxiosHeaders` class for working with headers through a Map-like API. -HTTP header names are case-insensitive, but Axios keeps the original header case for style and for servers that incorrectly depend on case. -Directly manipulating the headers object still works, but it is deprecated. - -### Working with headers - -An `AxiosHeaders` instance can contain several internal value types that control setting and merging. -Axios gets the final headers object with string values by calling `toJSON`. - -> Note: By JSON here we mean an object consisting only of string values intended to be sent over the network. - -The header value can be one of the following types: - -- `string` - normal string value sent to the server -- `null` - skip header when rendering to JSON -- `false` - skip header when rendering to JSON. Also indicates that the `set` method must be called with `rewrite` set to `true` - to overwrite this value (Axios uses this internally to allow users to opt out of installing certain headers like `User-Agent` or `Content-Type`) -- `undefined` - value is not set - -> Note: The header value is considered set if it is not equal to undefined. - -The headers object is always initialized inside interceptors and transformers: - -```ts -axios.interceptors.request.use((request: InternalAxiosRequestConfig) => { - request.headers.set('My-header', 'value'); - - request.headers.set({ - 'My-set-header1': 'my-set-value1', - 'My-set-header2': 'my-set-value2', - }); - - request.headers.set('User-Agent', false); // prevent Axios from setting this header later - - request.headers.setContentType('text/plain'); - - request.headers['My-set-header2'] = 'newValue'; // direct access is deprecated - - return request; -}); -``` - -You can iterate over an `AxiosHeaders` instance using a `for...of` statement: - -```js -const headers = new AxiosHeaders({ - foo: '1', - bar: '2', - baz: '3', -}); - -for (const [header, value] of headers) { - console.log(header, value); -} - -// foo 1 -// bar 2 -// baz 3 -``` - -### Preserving a specific header case - -Header names are case-insensitive, but `AxiosHeaders` keeps the case of the first matching key it sees. -If you need a specific case for non-standard case-sensitive servers, define a case preset with `undefined` and then set the value later: - -```js -const api = axios.create(); - -api.defaults.headers.common = { - 'content-type': undefined, - accept: undefined, -}; - -await api.put(url, data, { - headers: { - 'Content-Type': 'application/octet-stream', - Accept: 'application/json', - }, -}); -``` - -You can also compose the same behavior with `AxiosHeaders.concat`: - -```js -const headers = axios.AxiosHeaders.concat( - { 'content-type': undefined }, - { 'Content-Type': 'application/octet-stream' } -); - -await axios.put(url, data, { headers }); -``` - -### new AxiosHeaders(headers?) - -Constructs a new `AxiosHeaders` instance. - -``` -constructor(headers?: RawAxiosHeaders | AxiosHeaders | string); -``` - -If the headers object is a string, Axios parses it as raw HTTP headers. - -```js -const headers = new AxiosHeaders(` -Host: www.bing.com -User-Agent: curl/7.54.0 -Accept: */*`); - -console.log(headers); - -// Object [AxiosHeaders] { -// host: 'www.bing.com', -// 'user-agent': 'curl/7.54.0', -// accept: '*/*' -// } -``` - -### AxiosHeaders#set - -```ts -set(headerName, value: Axios, rewrite?: boolean); -set(headerName, value, rewrite?: (this: AxiosHeaders, value: string, name: string, headers: RawAxiosHeaders) => boolean); -set(headers?: RawAxiosHeaders | AxiosHeaders | string, rewrite?: boolean); -set(headers?: Iterable<[string, AxiosHeaderValue]>, rewrite?: boolean); -``` - -The `rewrite` argument controls the overwriting behavior: - -- `false` - do not overwrite if the header's value is set (is not `undefined`) -- `undefined` (default) - overwrite the header unless its value is set to `false` -- `true` - rewrite anyway - -The option can also accept a user-defined function that determines whether to overwrite the value. - -Empty or whitespace-only header names are ignored. - -Iterable key/value pairs, such as a `Map`, are accepted: - -```js -const headers = new AxiosHeaders(); - -headers.set( - new Map([ - ['X-Trace-Id', 'abc123'], - ['Accept', 'application/json'], - ]) -); -``` - -Returns `this`. - -### AxiosHeaders#get(header) - -``` - get(headerName: string, matcher?: true | AxiosHeaderMatcher): AxiosHeaderValue; - get(headerName: string, parser: RegExp): RegExpExecArray | null; -``` - -Returns the internal value of the header. It can take an extra argument to parse the header's value with `RegExp.exec`, -matcher function or internal key-value parser. - -```ts -const headers = new AxiosHeaders({ - 'Content-Type': 'multipart/form-data; boundary=Asrf456BGe4h', -}); - -console.log(headers.get('Content-Type')); -// multipart/form-data; boundary=Asrf456BGe4h - -console.log(headers.get('Content-Type', true)); // parse key-value pairs from a string separated with \s,;= delimiters: -// [Object: null prototype] { -// 'multipart/form-data': undefined, -// boundary: 'Asrf456BGe4h' -// } - -console.log( - headers.get('Content-Type', (value, name, headers) => { - return String(value).replace(/a/g, 'ZZZ'); - }) -); -// multipZZZrt/form-dZZZtZZZ; boundZZZry=Asrf456BGe4h - -console.log(headers.get('Content-Type', /boundary=(\w+)/)?.[0]); -// boundary=Asrf456BGe4h -``` - -Returns the value of the header. - -### AxiosHeaders#has(header, matcher?) - -``` -has(header: string, matcher?: AxiosHeaderMatcher): boolean; -``` - -Returns `true` if the header is set (has no `undefined` value). - -### AxiosHeaders#delete(header, matcher?) - -``` -delete(header: string | string[], matcher?: AxiosHeaderMatcher): boolean; -``` - -Returns `true` if at least one header has been removed. - -### AxiosHeaders#clear(matcher?) - -``` -clear(matcher?: AxiosHeaderMatcher): boolean; -``` - -Removes all headers. -Unlike the `delete` method matcher, this optional matcher matches the header name rather than the value. - -```ts -const headers = new AxiosHeaders({ - foo: '1', - 'x-foo': '2', - 'x-bar': '3', -}); - -console.log(headers.clear(/^x-/)); // true - -console.log(headers.toJSON()); // [Object: null prototype] { foo: '1' } -``` - -Returns `true` if at least one header has been cleared. - -### AxiosHeaders#normalize(format); - -If the headers object was changed directly, it can have duplicates with the same name but in different cases. -This method normalizes the headers object by combining duplicate keys into one. -Axios uses this method internally after calling each interceptor. -Set `format` to true for converting header names to lowercase and capitalizing the initial letters (`cOntEnt-type` => `Content-Type`) - -```js -const headers = new AxiosHeaders({ - foo: '1', -}); - -headers.Foo = '2'; -headers.FOO = '3'; - -console.log(headers.toJSON()); // [Object: null prototype] { foo: '1', Foo: '2', FOO: '3' } -console.log(headers.normalize().toJSON()); // [Object: null prototype] { foo: '3' } -console.log(headers.normalize(true).toJSON()); // [Object: null prototype] { Foo: '3' } -``` - -Returns `this`. - -### AxiosHeaders#concat(...targets) - -``` -concat(...targets: Array): AxiosHeaders; -``` - -Merges the instance with targets into a new `AxiosHeaders` instance. If the target is a string, Axios parses it as raw HTTP headers. - -Returns a new `AxiosHeaders` instance. - -### AxiosHeaders#toJSON(asStrings?) - -``` -toJSON(asStrings: true): Record; -toJSON(asStrings?: false): Record; -``` - -Resolves all internal header values into a new null prototype object. -Set `asStrings` to true to resolve arrays as a string containing all elements, separated by commas. - -### AxiosHeaders#toString() - -``` -toString(): string; -``` - -Returns the headers as a CRLF-free HTTP header block, one `name: value` pair per line. - -### AxiosHeaders.from(thing?) - -``` -from(thing?: AxiosHeaders | RawAxiosHeaders | string): AxiosHeaders; -``` - -Returns a new `AxiosHeaders` instance created from the raw headers passed in, -or returns the given headers object if it's already an `AxiosHeaders` instance. - -### AxiosHeaders.concat(...targets) - -``` -concat(...targets: Array): AxiosHeaders; -``` - -Returns a new `AxiosHeaders` instance created by merging the target objects. - -### Shortcuts - -The following shortcuts are available: - -- `setContentType`, `getContentType`, `hasContentType` - -- `setContentLength`, `getContentLength`, `hasContentLength` - -- `setAccept`, `getAccept`, `hasAccept` - -- `setUserAgent`, `getUserAgent`, `hasUserAgent` - -- `setContentEncoding`, `getContentEncoding`, `hasContentEncoding` - -## Fetch adapter - -Axios introduced the fetch adapter in `v1.7.0`. By default, Axios uses it when the `xhr` and `http` adapters are not available in the build or not supported by the environment. -To use it by default, select it explicitly: - -```js -const { data } = axios.get(url, { - adapter: 'fetch', // by default ['xhr', 'http', 'fetch'] -}); -``` - -You can create a separate instance for this: - -```js -const fetchAxios = axios.create({ - adapter: 'fetch', -}); - -const { data } = fetchAxios.get(url); -``` - -The adapter supports the same features as the `xhr` adapter, including upload and download progress capturing. -It also supports response types such as `stream` and `formdata` when the environment supports them. - -When `auth` is omitted, the fetch adapter can read HTTP Basic auth credentials from the request URL, for example `https://user:pass@example.com`. Percent-encoded URL credentials are decoded before the `Authorization` header is generated, and `auth` takes precedence over URL-embedded credentials. - -### Custom fetch - -Since `v1.12.0`, you can configure the fetch adapter to use a custom fetch API instead of environment globals. -Pass a custom `fetch` function, `Request`, and `Response` constructors through `env` config. -This helps in custom environments and app frameworks. - -When using a custom fetch, you may also need to set custom `Request` and `Response` constructors. If you do not set them, Axios uses the global objects. -If your custom fetch API does not provide these objects and the globals are incompatible with it, pass `null` to disable them inside the fetch adapter. - -> Note: Setting `Request` and `Response` to `null` prevents the fetch adapter from capturing upload and download progress. - -Basic example: - -```js -import customFetchFunction from 'customFetchModule'; - -const instance = axios.create({ - adapter: 'fetch', - onDownloadProgress(e) { - console.log('downloadProgress', e); - }, - env: { - fetch: customFetchFunction, - Request: null, // undefined -> use the global constructor - Response: null, - }, -}); -``` - -#### Using with Tauri - -A minimal example of setting up Axios for use in a [Tauri](https://tauri.app/plugin/http-client/) app with a platform fetch function that ignores CORS policy for requests. - -```js -import { fetch } from '@tauri-apps/plugin-http'; -import axios from 'axios'; - -const instance = axios.create({ - adapter: 'fetch', - onDownloadProgress(e) { - console.log('downloadProgress', e); - }, - env: { - fetch, - }, -}); - -const { data } = await instance.get('https://google.com'); -``` - -#### Using with SvelteKit - -[SvelteKit](https://svelte.dev/docs/kit/web-standards#Fetch-APIs) uses a custom fetch function for server rendering in `load` functions. It also uses relative paths, which are incompatible with the standard URL API. Configure Axios to use SvelteKit's custom fetch API: - -```js -export async function load({ fetch }) { - const { data: post } = await axios.get('https://jsonplaceholder.typicode.com/posts/1', { - adapter: 'fetch', - env: { - fetch, - Request: null, - Response: null, - }, - }); - - return { post }; -} -``` - -#### HTTP/2 support - -Axios supports HTTP/2 through the Node.js `http` adapter, introduced in v1.13.0. - -Support depends on the runtime environment. Axios relies on Node.js APIs, so HTTP/2 works in supported Node.js versions but may not work in other environments such as Bun or Deno. - -Options like `httpVersion` and `http2Options` are adapter-specific and may not behave the same way in every environment. - -Note: HTTP/2 redirects are currently not supported by the HTTP/2 adapter. - -```js -const form = new FormData(); - -form.append('foo', '123'); - -const { data, headers, status } = await axios.post('https://httpbin.org/post', form, { - onUploadProgress(e) { - console.log('upload progress', e); - }, - onDownloadProgress(e) { - console.log('download progress', e); - }, - responseType: 'arraybuffer', -}); -``` - -## Semver - -Axios follows [semver](https://semver.org/) since `v1.0.0`. - -## Promises - -axios depends on a native ES6 Promise implementation to be [supported](https://caniuse.com/promises). -If your environment doesn't support ES6 Promises, you can [polyfill](https://github.com/jakearchibald/es6-promise). - -## TypeScript - -axios includes [TypeScript](https://typescriptlang.org) definitions and a type guard for axios errors. - -```typescript -let user: User = null; -try { - const { data } = await axios.get('/user?ID=12345'); - user = data.userDetails; -} catch (error) { - if (axios.isAxiosError(error)) { - handleAxiosError(error); - } else { - handleUnexpectedError(error); - } -} -``` - -Use `axios.isCancel()` to narrow cancellation errors to `CanceledError`: - -```typescript -const controller = new AbortController(); - -try { - await axios.get('/user?ID=12345', { signal: controller.signal }); -} catch (error) { - if (axios.isCancel(error)) { - handleCancellation(error); - } -} -``` - -Because axios publishes an ESM default export and a CJS `module.exports`, TypeScript has a few caveats. -The recommended setting is `"moduleResolution": "node16"`, which is implied by `"module": "node16"`. This requires TypeScript 4.7 or greater. -If you use ESM, your settings should be fine. -If you compile TypeScript to CJS and can't use `"moduleResolution": "node 16"`, enable `esModuleInterop`. -If you use TypeScript to type check CJS JavaScript code, your only option is to use `"moduleResolution": "node16"`. - -You can also create a custom instance with typed interceptors: - -```typescript -import axios, { AxiosInstance, InternalAxiosRequestConfig } from 'axios'; - -const apiClient: AxiosInstance = axios.create({ - baseURL: 'https://api.example.com', - timeout: 10000, -}); - -apiClient.interceptors.request.use((config: InternalAxiosRequestConfig) => { - // Add auth token - return config; -}); -``` - -## Online one-click setup - -You can use Gitpod, a free online IDE for open source projects, to contribute or run the examples online. - -[![Open in Gitpod](https://gitpod.io/button/open-in-gitpod.svg)](https://gitpod.io/#https://github.com/axios/axios/blob/main/examples/server.js) - -## Contributing - -### Local setup - -As a supply-chain hardening measure, this repository ships a project-level `.npmrc` that sets `ignore-scripts=true`. This blocks npm lifecycle scripts (`preinstall`, `install`, `postinstall`, `prepare`) from any direct or transitive dependency when you run `npm install` or `npm ci` inside the repo. See [THREATMODEL.md](./THREATMODEL.md) (threat T-S2) for the rationale. - -One consequence: the repository's own `prepare` hook (which installs Husky's git hooks) will **not** run automatically. After your first install, enable the git hooks manually: - -```bash -npm ci -npm rebuild husky && npx husky -``` - -Run those two commands once per fresh checkout. You do **not** need to re-run them after every subsequent `npm install`. - -Do not remove `ignore-scripts=true` from `.npmrc` to "fix" this. That reopens the lifecycle-script attack surface for every other package in the tree. All CI workflows already invoke npm with `--ignore-scripts`, so local behaviour matches CI. - -## Resources - -- [Changelog](https://github.com/axios/axios/blob/v1.x/CHANGELOG.md) -- [Ecosystem](https://github.com/axios/axios/blob/v1.x/ECOSYSTEM.md) -- [Contributing Guide](https://github.com/axios/axios/blob/v1.x/CONTRIBUTING.md) -- [Code of Conduct](https://github.com/axios/axios/blob/v1.x/CODE_OF_CONDUCT.md) - -## Credits - -axios is heavily inspired by the [$http service](https://docs.angularjs.org/api/ng/service/$http) in [AngularJS](https://angularjs.org/). It provides a standalone `$http`-like service for use outside AngularJS. - -## License - -[![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](LICENSE) diff --git a/server/node_modules/axios/dist/axios.js b/server/node_modules/axios/dist/axios.js deleted file mode 100644 index a659f74..0000000 --- a/server/node_modules/axios/dist/axios.js +++ /dev/null @@ -1,5509 +0,0 @@ -/*! Axios v1.19.0 Copyright (c) 2026 Matt Zabriskie and contributors */ -(function (global, factory) { - typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() : - typeof define === 'function' && define.amd ? define(factory) : - (global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.axios = factory()); -})(this, (function () { 'use strict'; - - function _OverloadYield(e, d) { - this.v = e, this.k = d; - } - function _arrayLikeToArray(r, a) { - (null == a || a > r.length) && (a = r.length); - for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; - return n; - } - function _arrayWithHoles(r) { - if (Array.isArray(r)) return r; - } - function _arrayWithoutHoles(r) { - if (Array.isArray(r)) return _arrayLikeToArray(r); - } - function _assertThisInitialized(e) { - if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); - return e; - } - function _asyncGeneratorDelegate(t) { - var e = {}, - n = false; - function pump(e, r) { - return n = true, r = new Promise(function (n) { - n(t[e](r)); - }), { - done: false, - value: new _OverloadYield(r, 1) - }; - } - return e["undefined" != typeof Symbol && Symbol.iterator || "@@iterator"] = function () { - return this; - }, e.next = function (t) { - return n ? (n = false, t) : pump("next", t); - }, "function" == typeof t.throw && (e.throw = function (t) { - if (n) throw n = false, t; - return pump("throw", t); - }), "function" == typeof t.return && (e.return = function (t) { - return n ? (n = false, t) : pump("return", t); - }), e; - } - function _asyncIterator(r) { - var n, - t, - o, - e = 2; - for ("undefined" != typeof Symbol && (t = Symbol.asyncIterator, o = Symbol.iterator); e--;) { - if (t && null != (n = r[t])) return n.call(r); - if (o && null != (n = r[o])) return new AsyncFromSyncIterator(n.call(r)); - t = "@@asyncIterator", o = "@@iterator"; - } - throw new TypeError("Object is not async iterable"); - } - function AsyncFromSyncIterator(r) { - function AsyncFromSyncIteratorContinuation(r) { - if (Object(r) !== r) return Promise.reject(new TypeError(r + " is not an object.")); - var n = r.done; - return Promise.resolve(r.value).then(function (r) { - return { - value: r, - done: n - }; - }); - } - return AsyncFromSyncIterator = function (r) { - this.s = r, this.n = r.next; - }, AsyncFromSyncIterator.prototype = { - s: null, - n: null, - next: function () { - return AsyncFromSyncIteratorContinuation(this.n.apply(this.s, arguments)); - }, - return: function (r) { - var n = this.s.return; - return void 0 === n ? Promise.resolve({ - value: r, - done: true - }) : AsyncFromSyncIteratorContinuation(n.apply(this.s, arguments)); - }, - throw: function (r) { - var n = this.s.return; - return void 0 === n ? Promise.reject(r) : AsyncFromSyncIteratorContinuation(n.apply(this.s, arguments)); - } - }, new AsyncFromSyncIterator(r); - } - function asyncGeneratorStep(n, t, e, r, o, a, c) { - try { - var i = n[a](c), - u = i.value; - } catch (n) { - return void e(n); - } - i.done ? t(u) : Promise.resolve(u).then(r, o); - } - function _asyncToGenerator(n) { - return function () { - var t = this, - e = arguments; - return new Promise(function (r, o) { - var a = n.apply(t, e); - function _next(n) { - asyncGeneratorStep(a, r, o, _next, _throw, "next", n); - } - function _throw(n) { - asyncGeneratorStep(a, r, o, _next, _throw, "throw", n); - } - _next(void 0); - }); - }; - } - function _awaitAsyncGenerator(e) { - return new _OverloadYield(e, 0); - } - function _callSuper(t, o, e) { - return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); - } - function _classCallCheck(a, n) { - if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); - } - function _construct(t, e, r) { - if (_isNativeReflectConstruct()) return Reflect.construct.apply(null, arguments); - var o = [null]; - o.push.apply(o, e); - var p = new (t.bind.apply(t, o))(); - return r && _setPrototypeOf(p, r.prototype), p; - } - function _defineProperties(e, r) { - for (var t = 0; t < r.length; t++) { - var o = r[t]; - o.enumerable = o.enumerable || false, o.configurable = true, "value" in o && (o.writable = true), Object.defineProperty(e, _toPropertyKey(o.key), o); - } - } - function _createClass(e, r, t) { - return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { - writable: false - }), e; - } - function _createForOfIteratorHelper(r, e) { - var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; - if (!t) { - if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e) { - t && (r = t); - var n = 0, - F = function () {}; - return { - s: F, - n: function () { - return n >= r.length ? { - done: true - } : { - done: false, - value: r[n++] - }; - }, - e: function (r) { - throw r; - }, - f: F - }; - } - throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); - } - var o, - a = true, - u = false; - return { - s: function () { - t = t.call(r); - }, - n: function () { - var r = t.next(); - return a = r.done, r; - }, - e: function (r) { - u = true, o = r; - }, - f: function () { - try { - a || null == t.return || t.return(); - } finally { - if (u) throw o; - } - } - }; - } - function _defineProperty(e, r, t) { - return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { - value: t, - enumerable: true, - configurable: true, - writable: true - }) : e[r] = t, e; - } - function _getPrototypeOf(t) { - return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) { - return t.__proto__ || Object.getPrototypeOf(t); - }, _getPrototypeOf(t); - } - function _inherits(t, e) { - if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function"); - t.prototype = Object.create(e && e.prototype, { - constructor: { - value: t, - writable: true, - configurable: true - } - }), Object.defineProperty(t, "prototype", { - writable: false - }), e && _setPrototypeOf(t, e); - } - function _isNativeFunction(t) { - try { - return -1 !== Function.toString.call(t).indexOf("[native code]"); - } catch (n) { - return "function" == typeof t; - } - } - function _isNativeReflectConstruct() { - try { - var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); - } catch (t) {} - return (_isNativeReflectConstruct = function () { - return !!t; - })(); - } - function _iterableToArray(r) { - if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r); - } - function _iterableToArrayLimit(r, l) { - var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; - if (null != t) { - var e, - n, - i, - u, - a = [], - f = true, - o = false; - try { - if (i = (t = t.call(r)).next, 0 === l) { - if (Object(t) !== t) return; - f = !1; - } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); - } catch (r) { - o = true, n = r; - } finally { - try { - if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; - } finally { - if (o) throw n; - } - } - return a; - } - } - function _nonIterableRest() { - throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); - } - function _nonIterableSpread() { - throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); - } - function ownKeys(e, r) { - var t = Object.keys(e); - if (Object.getOwnPropertySymbols) { - var o = Object.getOwnPropertySymbols(e); - r && (o = o.filter(function (r) { - return Object.getOwnPropertyDescriptor(e, r).enumerable; - })), t.push.apply(t, o); - } - return t; - } - function _objectSpread2(e) { - for (var r = 1; r < arguments.length; r++) { - var t = null != arguments[r] ? arguments[r] : {}; - r % 2 ? ownKeys(Object(t), true).forEach(function (r) { - _defineProperty(e, r, t[r]); - }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { - Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); - }); - } - return e; - } - function _possibleConstructorReturn(t, e) { - if (e && ("object" == typeof e || "function" == typeof e)) return e; - if (void 0 !== e) throw new TypeError("Derived constructors may only return object or undefined"); - return _assertThisInitialized(t); - } - function _regenerator() { - /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */ - var e, - t, - r = "function" == typeof Symbol ? Symbol : {}, - n = r.iterator || "@@iterator", - o = r.toStringTag || "@@toStringTag"; - function i(r, n, o, i) { - var c = n && n.prototype instanceof Generator ? n : Generator, - u = Object.create(c.prototype); - return _regeneratorDefine(u, "_invoke", function (r, n, o) { - var i, - c, - u, - f = 0, - p = o || [], - y = false, - G = { - p: 0, - n: 0, - v: e, - a: d, - f: d.bind(e, 4), - d: function (t, r) { - return i = t, c = 0, u = e, G.n = r, a; - } - }; - function d(r, n) { - for (c = r, u = n, t = 0; !y && f && !o && t < p.length; t++) { - var o, - i = p[t], - d = G.p, - l = i[2]; - r > 3 ? (o = l === n) && (u = i[(c = i[4]) ? 5 : (c = 3, 3)], i[4] = i[5] = e) : i[0] <= d && ((o = r < 2 && d < i[1]) ? (c = 0, G.v = n, G.n = i[1]) : d < l && (o = r < 3 || i[0] > n || n > l) && (i[4] = r, i[5] = n, G.n = l, c = 0)); - } - if (o || r > 1) return a; - throw y = true, n; - } - return function (o, p, l) { - if (f > 1) throw TypeError("Generator is already running"); - for (y && 1 === p && d(p, l), c = p, u = l; (t = c < 2 ? e : u) || !y;) { - i || (c ? c < 3 ? (c > 1 && (G.n = -1), d(c, u)) : G.n = u : G.v = u); - try { - if (f = 2, i) { - if (c || (o = "next"), t = i[o]) { - if (!(t = t.call(i, u))) throw TypeError("iterator result is not an object"); - if (!t.done) return t; - u = t.value, c < 2 && (c = 0); - } else 1 === c && (t = i.return) && t.call(i), c < 2 && (u = TypeError("The iterator does not provide a '" + o + "' method"), c = 1); - i = e; - } else if ((t = (y = G.n < 0) ? u : r.call(n, G)) !== a) break; - } catch (t) { - i = e, c = 1, u = t; - } finally { - f = 1; - } - } - return { - value: t, - done: y - }; - }; - }(r, o, i), true), u; - } - var a = {}; - function Generator() {} - function GeneratorFunction() {} - function GeneratorFunctionPrototype() {} - t = Object.getPrototypeOf; - var c = [][n] ? t(t([][n]())) : (_regeneratorDefine(t = {}, n, function () { - return this; - }), t), - u = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(c); - function f(e) { - return Object.setPrototypeOf ? Object.setPrototypeOf(e, GeneratorFunctionPrototype) : (e.__proto__ = GeneratorFunctionPrototype, _regeneratorDefine(e, o, "GeneratorFunction")), e.prototype = Object.create(u), e; - } - return GeneratorFunction.prototype = GeneratorFunctionPrototype, _regeneratorDefine(u, "constructor", GeneratorFunctionPrototype), _regeneratorDefine(GeneratorFunctionPrototype, "constructor", GeneratorFunction), GeneratorFunction.displayName = "GeneratorFunction", _regeneratorDefine(GeneratorFunctionPrototype, o, "GeneratorFunction"), _regeneratorDefine(u), _regeneratorDefine(u, o, "Generator"), _regeneratorDefine(u, n, function () { - return this; - }), _regeneratorDefine(u, "toString", function () { - return "[object Generator]"; - }), (_regenerator = function () { - return { - w: i, - m: f - }; - })(); - } - function _regeneratorDefine(e, r, n, t) { - var i = Object.defineProperty; - try { - i({}, "", {}); - } catch (e) { - i = 0; - } - _regeneratorDefine = function (e, r, n, t) { - function o(r, n) { - _regeneratorDefine(e, r, function (e) { - return this._invoke(r, n, e); - }); - } - r ? i ? i(e, r, { - value: n, - enumerable: !t, - configurable: !t, - writable: !t - }) : e[r] = n : (o("next", 0), o("throw", 1), o("return", 2)); - }, _regeneratorDefine(e, r, n, t); - } - function _regeneratorValues(e) { - if (null != e) { - var t = e["function" == typeof Symbol && Symbol.iterator || "@@iterator"], - r = 0; - if (t) return t.call(e); - if ("function" == typeof e.next) return e; - if (!isNaN(e.length)) return { - next: function () { - return e && r >= e.length && (e = void 0), { - value: e && e[r++], - done: !e - }; - } - }; - } - throw new TypeError(typeof e + " is not iterable"); - } - function _setPrototypeOf(t, e) { - return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { - return t.__proto__ = e, t; - }, _setPrototypeOf(t, e); - } - function _slicedToArray(r, e) { - return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); - } - function _toConsumableArray(r) { - return _arrayWithoutHoles(r) || _iterableToArray(r) || _unsupportedIterableToArray(r) || _nonIterableSpread(); - } - function _toPrimitive(t, r) { - if ("object" != typeof t || !t) return t; - var e = t[Symbol.toPrimitive]; - if (void 0 !== e) { - var i = e.call(t, r); - if ("object" != typeof i) return i; - throw new TypeError("@@toPrimitive must return a primitive value."); - } - return ("string" === r ? String : Number)(t); - } - function _toPropertyKey(t) { - var i = _toPrimitive(t, "string"); - return "symbol" == typeof i ? i : i + ""; - } - function _typeof(o) { - "@babel/helpers - typeof"; - - return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { - return typeof o; - } : function (o) { - return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; - }, _typeof(o); - } - function _unsupportedIterableToArray(r, a) { - if (r) { - if ("string" == typeof r) return _arrayLikeToArray(r, a); - var t = {}.toString.call(r).slice(8, -1); - return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; - } - } - function _wrapAsyncGenerator(e) { - return function () { - return new AsyncGenerator(e.apply(this, arguments)); - }; - } - function AsyncGenerator(e) { - var t, n; - function resume(t, n) { - try { - var r = e[t](n), - o = r.value, - u = o instanceof _OverloadYield; - Promise.resolve(u ? o.v : o).then(function (n) { - if (u) { - var i = "return" === t && o.k ? t : "next"; - if (!o.k || n.done) return resume(i, n); - n = e[i](n).value; - } - settle(!!r.done, n); - }, function (e) { - resume("throw", e); - }); - } catch (e) { - settle(2, e); - } - } - function settle(e, r) { - 2 === e ? t.reject(r) : t.resolve({ - value: r, - done: e - }), (t = t.next) ? resume(t.key, t.arg) : n = null; - } - this._invoke = function (e, r) { - return new Promise(function (o, u) { - var i = { - key: e, - arg: r, - resolve: o, - reject: u, - next: null - }; - n ? n = n.next = i : (t = n = i, resume(e, r)); - }); - }, "function" != typeof e.return && (this.return = void 0); - } - AsyncGenerator.prototype["function" == typeof Symbol && Symbol.asyncIterator || "@@asyncIterator"] = function () { - return this; - }, AsyncGenerator.prototype.next = function (e) { - return this._invoke("next", e); - }, AsyncGenerator.prototype.throw = function (e) { - return this._invoke("throw", e); - }, AsyncGenerator.prototype.return = function (e) { - return this._invoke("return", e); - }; - function _wrapNativeSuper(t) { - var r = "function" == typeof Map ? new Map() : void 0; - return _wrapNativeSuper = function (t) { - if (null === t || !_isNativeFunction(t)) return t; - if ("function" != typeof t) throw new TypeError("Super expression must either be null or a function"); - if (void 0 !== r) { - if (r.has(t)) return r.get(t); - r.set(t, Wrapper); - } - function Wrapper() { - return _construct(t, arguments, _getPrototypeOf(this).constructor); - } - return Wrapper.prototype = Object.create(t.prototype, { - constructor: { - value: Wrapper, - enumerable: false, - writable: true, - configurable: true - } - }), _setPrototypeOf(Wrapper, t); - }, _wrapNativeSuper(t); - } - - /** - * Create a bound version of a function with a specified `this` context - * - * @param {Function} fn - The function to bind - * @param {*} thisArg - The value to be passed as the `this` parameter - * @returns {Function} A new function that will call the original function with the specified `this` context - */ - function bind(fn, thisArg) { - return function wrap() { - return fn.apply(thisArg, arguments); - }; - } - - // utils is a library of generic helper functions non-specific to axios - - var toString = Object.prototype.toString; - var getPrototypeOf = Object.getPrototypeOf; - var iterator = Symbol.iterator, - toStringTag = Symbol.toStringTag; - - /* Creating a function that will check if an object has a property. */ - var hasOwnProperty = function (_ref) { - var hasOwnProperty = _ref.hasOwnProperty; - return function (obj, prop) { - return hasOwnProperty.call(obj, prop); - }; - }(Object.prototype); - - /** - * Walk the prototype chain (excluding the shared Object.prototype) looking for - * an own `prop`. This distinguishes genuine own/inherited members — including - * class accessors and template prototypes — from members injected via - * Object.prototype pollution (e.g. `Object.prototype.username = '...'`), which - * live on Object.prototype itself and are therefore never matched. - * - * @param {*} thing The value whose chain to inspect - * @param {string|symbol} prop The property key to look for - * - * @returns {boolean} True when `prop` is owned below Object.prototype - */ - var hasOwnInPrototypeChain = function hasOwnInPrototypeChain(thing, prop) { - var obj = thing; - var seen = []; - while (obj != null && obj !== Object.prototype) { - if (seen.indexOf(obj) !== -1) { - return false; - } - seen.push(obj); - if (hasOwnProperty(obj, prop)) { - return true; - } - obj = getPrototypeOf(obj); - } - return false; - }; - - /** - * Read `obj[prop]` only when it is safe from Object.prototype pollution. Own - * properties and members inherited from a non-Object.prototype source (a class - * instance or template object) are honored; a value reachable only through a - * polluted Object.prototype is ignored and `undefined` is returned. - * - * @param {*} obj The source object - * @param {string|symbol} prop The property key to read - * - * @returns {*} The resolved value, or undefined when unsafe/absent - */ - var getSafeProp = function getSafeProp(obj, prop) { - return obj != null && hasOwnInPrototypeChain(obj, prop) ? obj[prop] : undefined; - }; - var kindOf = function (cache) { - return function (thing) { - var str = toString.call(thing); - return cache[str] || (cache[str] = str.slice(8, -1).toLowerCase()); - }; - }(Object.create(null)); - var kindOfTest = function kindOfTest(type) { - type = type.toLowerCase(); - return function (thing) { - return kindOf(thing) === type; - }; - }; - var typeOfTest = function typeOfTest(type) { - return function (thing) { - return _typeof(thing) === type; - }; - }; - - /** - * Determine if a value is a non-null object - * - * @param {Object} val The value to test - * - * @returns {boolean} True if value is an Array, otherwise false - */ - var isArray = Array.isArray; - - /** - * Determine if a value is undefined - * - * @param {*} val The value to test - * - * @returns {boolean} True if the value is undefined, otherwise false - */ - var isUndefined = typeOfTest('undefined'); - - /** - * Determine if a value is a Buffer - * - * @param {*} val The value to test - * - * @returns {boolean} True if value is a Buffer, otherwise false - */ - function isBuffer(val) { - return val !== null && !isUndefined(val) && val.constructor !== null && !isUndefined(val.constructor) && isFunction$1(val.constructor.isBuffer) && val.constructor.isBuffer(val); - } - - /** - * Determine if a value is an ArrayBuffer - * - * @param {*} val The value to test - * - * @returns {boolean} True if value is an ArrayBuffer, otherwise false - */ - var isArrayBuffer = kindOfTest('ArrayBuffer'); - - /** - * Determine if a value is a view on an ArrayBuffer - * - * @param {*} val The value to test - * - * @returns {boolean} True if value is a view on an ArrayBuffer, otherwise false - */ - function isArrayBufferView(val) { - var result; - if (typeof ArrayBuffer !== 'undefined' && ArrayBuffer.isView) { - result = ArrayBuffer.isView(val); - } else { - result = val && val.buffer && isArrayBuffer(val.buffer); - } - return result; - } - - /** - * Determine if a value is a String - * - * @param {*} val The value to test - * - * @returns {boolean} True if value is a String, otherwise false - */ - var isString = typeOfTest('string'); - - /** - * Determine if a value is a Function - * - * @param {*} val The value to test - * @returns {boolean} True if value is a Function, otherwise false - */ - var isFunction$1 = typeOfTest('function'); - - /** - * Determine if a value is a Number - * - * @param {*} val The value to test - * - * @returns {boolean} True if value is a Number, otherwise false - */ - var isNumber = typeOfTest('number'); - - /** - * Determine if a value is an Object - * - * @param {*} thing The value to test - * - * @returns {boolean} True if value is an Object, otherwise false - */ - var isObject = function isObject(thing) { - return thing !== null && _typeof(thing) === 'object'; - }; - - /** - * Determine if a value is a Boolean - * - * @param {*} thing The value to test - * @returns {boolean} True if value is a Boolean, otherwise false - */ - var isBoolean = function isBoolean(thing) { - return thing === true || thing === false; - }; - - /** - * Determine if a value is a plain Object - * - * @param {*} val The value to test - * - * @returns {boolean} True if value is a plain Object, otherwise false - */ - var isPlainObject = function isPlainObject(val) { - if (!isObject(val)) { - return false; - } - var prototype = getPrototypeOf(val); - return (prototype === null || prototype === Object.prototype || getPrototypeOf(prototype) === null) && - // Treat any genuine (non-Object.prototype-polluted) Symbol.toStringTag or - // Symbol.iterator as evidence the value is a tagged/iterable type rather - // than a plain object, while ignoring keys injected onto Object.prototype. - !hasOwnInPrototypeChain(val, toStringTag) && !hasOwnInPrototypeChain(val, iterator); - }; - - /** - * Determine if a value is an empty object (safely handles Buffers) - * - * @param {*} val The value to test - * - * @returns {boolean} True if value is an empty object, otherwise false - */ - var isEmptyObject = function isEmptyObject(val) { - // Early return for non-objects or Buffers to prevent RangeError - if (!isObject(val) || isBuffer(val)) { - return false; - } - try { - return Object.keys(val).length === 0 && Object.getPrototypeOf(val) === Object.prototype; - } catch (e) { - // Fallback for any other objects that might cause RangeError with Object.keys() - return false; - } - }; - - /** - * Determine if a value is a Date - * - * @param {*} val The value to test - * - * @returns {boolean} True if value is a Date, otherwise false - */ - var isDate = kindOfTest('Date'); - - /** - * Determine if a value is a File - * - * @param {*} val The value to test - * - * @returns {boolean} True if value is a File, otherwise false - */ - var isFile = kindOfTest('File'); - - /** - * Determine if a value is a React Native Blob - * React Native "blob": an object with a `uri` attribute. Optionally, it can - * also have a `name` and `type` attribute to specify filename and content type - * - * @see https://github.com/facebook/react-native/blob/26684cf3adf4094eb6c405d345a75bf8c7c0bf88/Libraries/Network/FormData.js#L68-L71 - * - * @param {*} value The value to test - * - * @returns {boolean} True if value is a React Native Blob, otherwise false - */ - var isReactNativeBlob = function isReactNativeBlob(value) { - return !!(value && typeof value.uri !== 'undefined'); - }; - - /** - * Determine if environment is React Native - * ReactNative `FormData` has a non-standard `getParts()` method - * - * @param {*} formData The formData to test - * - * @returns {boolean} True if environment is React Native, otherwise false - */ - var isReactNative = function isReactNative(formData) { - return formData && typeof formData.getParts !== 'undefined'; - }; - - /** - * Determine if a value is a Blob - * - * @param {*} val The value to test - * - * @returns {boolean} True if value is a Blob, otherwise false - */ - var isBlob = kindOfTest('Blob'); - - /** - * Determine if a value is a FileList - * - * @param {*} val The value to test - * - * @returns {boolean} True if value is a FileList, otherwise false - */ - var isFileList = kindOfTest('FileList'); - var isSet = kindOfTest('Set'); - - /** - * Determine if a value is a Stream - * - * @param {*} val The value to test - * - * @returns {boolean} True if value is a Stream, otherwise false - */ - var isStream = function isStream(val) { - return isObject(val) && isFunction$1(val.pipe); - }; - - /** - * Determine if a value is a FormData - * - * @param {*} thing The value to test - * - * @returns {boolean} True if value is an FormData, otherwise false - */ - function getGlobal() { - if (typeof globalThis !== 'undefined') return globalThis; - if (typeof self !== 'undefined') return self; - if (typeof window !== 'undefined') return window; - if (typeof global !== 'undefined') return global; - return {}; - } - var G = getGlobal(); - var FormDataCtor = typeof G.FormData !== 'undefined' ? G.FormData : undefined; - var isFormData = function isFormData(thing) { - if (!thing) return false; - if (FormDataCtor && thing instanceof FormDataCtor) return true; - // Reject plain objects inheriting directly from Object.prototype so prototype-pollution gadgets can't spoof FormData. - var proto = getPrototypeOf(thing); - if (!proto || proto === Object.prototype) return false; - if (!isFunction$1(thing.append)) return false; - var kind = kindOf(thing); - return kind === 'formdata' || - // detect form-data instance - kind === 'object' && isFunction$1(thing.toString) && thing.toString() === '[object FormData]'; - }; - - /** - * Determine if a value is a URLSearchParams object - * - * @param {*} val The value to test - * - * @returns {boolean} True if value is a URLSearchParams object, otherwise false - */ - var isURLSearchParams = kindOfTest('URLSearchParams'); - var _map = ['ReadableStream', 'Request', 'Response', 'Headers'].map(kindOfTest), - _map2 = _slicedToArray(_map, 4), - isReadableStream = _map2[0], - isRequest = _map2[1], - isResponse = _map2[2], - isHeaders = _map2[3]; - - /** - * Trim excess whitespace off the beginning and end of a string - * - * @param {String} str The String to trim - * - * @returns {String} The String freed of excess whitespace - */ - var trim = function trim(str) { - return str.trim ? str.trim() : str.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, ''); - }; - /** - * Iterate over an Array or an Object invoking a function for each item. - * - * If `obj` is an Array callback will be called passing - * the value, index, and complete array for each item. - * - * If 'obj' is an Object callback will be called passing - * the value, key, and complete object for each property. - * - * @param {Object|Array} obj The object to iterate - * @param {Function} fn The callback to invoke for each item - * - * @param {Object} [options] - * @param {Boolean} [options.allOwnKeys = false] - * @returns {any} - */ - function forEach(obj, fn) { - var _ref2 = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}, - _ref2$allOwnKeys = _ref2.allOwnKeys, - allOwnKeys = _ref2$allOwnKeys === void 0 ? false : _ref2$allOwnKeys; - // Don't bother if no value provided - if (obj === null || typeof obj === 'undefined') { - return; - } - var i; - var l; - - // Force an array if not already something iterable - if (_typeof(obj) !== 'object') { - /*eslint no-param-reassign:0*/ - obj = [obj]; - } - if (isArray(obj)) { - // Iterate over array values - for (i = 0, l = obj.length; i < l; i++) { - fn.call(null, obj[i], i, obj); - } - } else { - // Buffer check - if (isBuffer(obj)) { - return; - } - - // Iterate over object keys - var keys = allOwnKeys ? Object.getOwnPropertyNames(obj) : Object.keys(obj); - var len = keys.length; - var key; - for (i = 0; i < len; i++) { - key = keys[i]; - fn.call(null, obj[key], key, obj); - } - } - } - - /** - * Finds a key in an object, case-insensitive, returning the actual key name. - * Returns null if the object is a Buffer or if no match is found. - * - * @param {Object} obj - The object to search. - * @param {string} key - The key to find (case-insensitive). - * @returns {?string} The actual key name if found, otherwise null. - */ - function findKey(obj, key) { - if (isBuffer(obj)) { - return null; - } - key = key.toLowerCase(); - var keys = Object.keys(obj); - var i = keys.length; - var _key; - while (i-- > 0) { - _key = keys[i]; - if (key === _key.toLowerCase()) { - return _key; - } - } - return null; - } - var _global = function () { - /*eslint no-undef:0*/ - if (typeof globalThis !== 'undefined') return globalThis; - return typeof self !== 'undefined' ? self : typeof window !== 'undefined' ? window : global; - }(); - var isContextDefined = function isContextDefined(context) { - return !isUndefined(context) && context !== _global; - }; - - /** - * Accepts varargs expecting each argument to be an object, then - * immutably merges the properties of each object and returns result. - * - * When multiple objects contain the same key the later object in - * the arguments list will take precedence. - * - * Example: - * - * ```js - * const result = merge({foo: 123}, {foo: 456}); - * console.log(result.foo); // outputs 456 - * ``` - * - * @param {Object} obj1 Object to merge - * - * @returns {Object} Result of all merge properties - */ - function merge() { - var _ref3 = isContextDefined(this) && this || {}, - caseless = _ref3.caseless, - skipUndefined = _ref3.skipUndefined; - var result = {}; - var assignValue = function assignValue(val, key) { - // Skip dangerous property names to prevent prototype pollution - if (key === '__proto__' || key === 'constructor' || key === 'prototype') { - return; - } - - // findKey lowercases the key, so caseless lookup only applies to strings — - // symbol keys are identity-matched. - var targetKey = caseless && typeof key === 'string' && findKey(result, key) || key; - // Read via own-prop only — a bare `result[targetKey]` walks the prototype - // chain, so a polluted Object.prototype value could surface here and get - // copied into the merged result. - var existing = hasOwnProperty(result, targetKey) ? result[targetKey] : undefined; - if (isPlainObject(existing) && isPlainObject(val)) { - result[targetKey] = merge(existing, val); - } else if (isPlainObject(val)) { - result[targetKey] = merge({}, val); - } else if (isArray(val)) { - result[targetKey] = val.slice(); - } else if (!skipUndefined || !isUndefined(val)) { - result[targetKey] = val; - } - }; - for (var i = 0, l = arguments.length; i < l; i++) { - var source = i < 0 || arguments.length <= i ? undefined : arguments[i]; - if (!source || isBuffer(source)) { - continue; - } - forEach(source, assignValue); - if (_typeof(source) !== 'object' || isArray(source)) { - continue; - } - var symbols = Object.getOwnPropertySymbols(source); - for (var j = 0; j < symbols.length; j++) { - var symbol = symbols[j]; - if (propertyIsEnumerable.call(source, symbol)) { - assignValue(source[symbol], symbol); - } - } - } - return result; - } - - /** - * Extends object a by mutably adding to it the properties of object b. - * - * @param {Object} a The object to be extended - * @param {Object} b The object to copy properties from - * @param {Object} thisArg The object to bind function to - * - * @param {Object} [options] - * @param {Boolean} [options.allOwnKeys] - * @returns {Object} The resulting value of object a - */ - var extend = function extend(a, b, thisArg) { - var _ref4 = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {}, - allOwnKeys = _ref4.allOwnKeys; - forEach(b, function (val, key) { - if (thisArg && isFunction$1(val)) { - Object.defineProperty(a, key, { - // Null-proto descriptor so a polluted Object.prototype.get cannot - // hijack defineProperty's accessor-vs-data resolution. - __proto__: null, - value: bind(val, thisArg), - writable: true, - enumerable: true, - configurable: true - }); - } else { - Object.defineProperty(a, key, { - __proto__: null, - value: val, - writable: true, - enumerable: true, - configurable: true - }); - } - }, { - allOwnKeys: allOwnKeys - }); - return a; - }; - - /** - * Remove byte order marker. This catches EF BB BF (the UTF-8 BOM) - * - * @param {string} content with BOM - * - * @returns {string} content value without BOM - */ - var stripBOM = function stripBOM(content) { - if (content.charCodeAt(0) === 0xfeff) { - content = content.slice(1); - } - return content; - }; - - /** - * Inherit the prototype methods from one constructor into another - * @param {function} constructor - * @param {function} superConstructor - * @param {object} [props] - * @param {object} [descriptors] - * - * @returns {void} - */ - var inherits = function inherits(constructor, superConstructor, props, descriptors) { - constructor.prototype = Object.create(superConstructor.prototype, descriptors); - Object.defineProperty(constructor.prototype, 'constructor', { - __proto__: null, - value: constructor, - writable: true, - enumerable: false, - configurable: true - }); - Object.defineProperty(constructor, 'super', { - __proto__: null, - value: superConstructor.prototype - }); - props && Object.assign(constructor.prototype, props); - }; - - /** - * Resolve object with deep prototype chain to a flat object - * @param {Object} sourceObj source object - * @param {Object} [destObj] - * @param {Function|Boolean} [filter] - * @param {Function} [propFilter] - * - * @returns {Object} - */ - var toFlatObject = function toFlatObject(sourceObj, destObj, filter, propFilter) { - var props; - var i; - var prop; - var merged = {}; - destObj = destObj || {}; - // eslint-disable-next-line no-eq-null,eqeqeq - if (sourceObj == null) return destObj; - do { - props = Object.getOwnPropertyNames(sourceObj); - i = props.length; - while (i-- > 0) { - prop = props[i]; - if ((!propFilter || propFilter(prop, sourceObj, destObj)) && !merged[prop]) { - destObj[prop] = sourceObj[prop]; - merged[prop] = true; - } - } - sourceObj = filter !== false && getPrototypeOf(sourceObj); - } while (sourceObj && (!filter || filter(sourceObj, destObj)) && sourceObj !== Object.prototype); - return destObj; - }; - - /** - * Determines whether a string ends with the characters of a specified string - * - * @param {String} str - * @param {String} searchString - * @param {Number} [position= 0] - * - * @returns {boolean} - */ - var endsWith = function endsWith(str, searchString, position) { - str = String(str); - if (position === undefined || position > str.length) { - position = str.length; - } - position -= searchString.length; - var lastIndex = str.indexOf(searchString, position); - return lastIndex !== -1 && lastIndex === position; - }; - - /** - * Returns new array from array like object or null if failed - * - * @param {*} [thing] - * - * @returns {?Array} - */ - var toArray = function toArray(thing) { - if (!thing) return null; - if (isArray(thing)) return thing; - var i = thing.length; - if (!isNumber(i)) return null; - var arr = new Array(i); - while (i-- > 0) { - arr[i] = thing[i]; - } - return arr; - }; - - /** - * Checking if the Uint8Array exists and if it does, it returns a function that checks if the - * thing passed in is an instance of Uint8Array - * - * @param {TypedArray} - * - * @returns {Array} - */ - // eslint-disable-next-line func-names - var isTypedArray = function (TypedArray) { - // eslint-disable-next-line func-names - return function (thing) { - return TypedArray && thing instanceof TypedArray; - }; - }(typeof Uint8Array !== 'undefined' && getPrototypeOf(Uint8Array)); - - /** - * For each entry in the object, call the function with the key and value. - * - * @param {Object} obj - The object to iterate over. - * @param {Function} fn - The function to call for each entry. - * - * @returns {void} - */ - var forEachEntry = function forEachEntry(obj, fn) { - var generator = obj && obj[iterator]; - var _iterator = generator.call(obj); - var result; - while ((result = _iterator.next()) && !result.done) { - var pair = result.value; - fn.call(obj, pair[0], pair[1]); - } - }; - - /** - * It takes a regular expression and a string, and returns an array of all the matches - * - * @param {string} regExp - The regular expression to match against. - * @param {string} str - The string to search. - * - * @returns {Array} - */ - var matchAll = function matchAll(regExp, str) { - var matches; - var arr = []; - while ((matches = regExp.exec(str)) !== null) { - arr.push(matches); - } - return arr; - }; - - /* Checking if the kindOfTest function returns true when passed an HTMLFormElement. */ - var isHTMLForm = kindOfTest('HTMLFormElement'); - var toCamelCase = function toCamelCase(str) { - return str.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g, function replacer(m, p1, p2) { - return p1.toUpperCase() + p2; - }); - }; - var propertyIsEnumerable = Object.prototype.propertyIsEnumerable; - - /** - * Determine if a value is a RegExp object - * - * @param {*} val The value to test - * - * @returns {boolean} True if value is a RegExp object, otherwise false - */ - var isRegExp = kindOfTest('RegExp'); - var reduceDescriptors = function reduceDescriptors(obj, reducer) { - var descriptors = Object.getOwnPropertyDescriptors(obj); - var reducedDescriptors = {}; - forEach(descriptors, function (descriptor, name) { - var ret; - if ((ret = reducer(descriptor, name, obj)) !== false) { - reducedDescriptors[name] = ret || descriptor; - } - }); - Object.defineProperties(obj, reducedDescriptors); - }; - - /** - * Makes all methods read-only - * @param {Object} obj - */ - - var freezeMethods = function freezeMethods(obj) { - reduceDescriptors(obj, function (descriptor, name) { - // skip restricted props in strict mode - if (isFunction$1(obj) && ['arguments', 'caller', 'callee'].includes(name)) { - return false; - } - var value = obj[name]; - if (!isFunction$1(value)) return; - descriptor.enumerable = false; - if ('writable' in descriptor) { - descriptor.writable = false; - return; - } - if (!descriptor.set) { - descriptor.set = function () { - throw Error("Can not rewrite read-only method '" + name + "'"); - }; - } - }); - }; - - /** - * Converts an array or a delimited string into an object set with values as keys and true as values. - * Useful for fast membership checks. - * - * @param {Array|string} arrayOrString - The array or string to convert. - * @param {string} delimiter - The delimiter to use if input is a string. - * @returns {Object} An object with keys from the array or string, values set to true. - */ - var toObjectSet = function toObjectSet(arrayOrString, delimiter) { - var obj = {}; - var define = function define(arr) { - arr.forEach(function (value) { - obj[value] = true; - }); - }; - isArray(arrayOrString) ? define(arrayOrString) : define(String(arrayOrString).split(delimiter)); - return obj; - }; - var noop = function noop() {}; - var toFiniteNumber = function toFiniteNumber(value, defaultValue) { - return value != null && Number.isFinite(value = +value) ? value : defaultValue; - }; - - /** - * If the thing is a FormData object, return true, otherwise return false. - * - * @param {unknown} thing - The thing to check. - * - * @returns {boolean} - */ - function isSpecCompliantForm(thing) { - return !!(thing && isFunction$1(thing.append) && thing[toStringTag] === 'FormData' && thing[iterator]); - } - - /** - * Recursively converts an object to a JSON-compatible object, handling circular references and Buffers. - * - * @param {Object} obj - The object to convert. - * @returns {Object} The JSON-compatible object. - */ - var toJSONObject = function toJSONObject(obj) { - var visited = new WeakSet(); - var _visit = function visit(source) { - if (isObject(source)) { - if (visited.has(source)) { - return; - } - - //Buffer check - if (isBuffer(source)) { - return source; - } - if (!('toJSON' in source)) { - // add-on descent / delete-on-ascent: preserves path semantics, so DAG nodes serialise at every occurrence (see #7230). - visited.add(source); - var target; - if (isSet(source)) { - target = []; - var _iterator2 = _createForOfIteratorHelper(source), - _step; - try { - for (_iterator2.s(); !(_step = _iterator2.n()).done;) { - var value = _step.value; - var reducedValue = _visit(value); - !isUndefined(reducedValue) && target.push(reducedValue); - } - } catch (err) { - _iterator2.e(err); - } finally { - _iterator2.f(); - } - } else { - target = isArray(source) ? [] : {}; - forEach(source, function (value, key) { - var reducedValue = _visit(value); - !isUndefined(reducedValue) && (target[key] = reducedValue); - }); - } - visited["delete"](source); - return target; - } - } - return source; - }; - return _visit(obj); - }; - - /** - * Determines if a value is an async function. - * - * @param {*} thing - The value to test. - * @returns {boolean} True if value is an async function, otherwise false. - */ - var isAsyncFn = kindOfTest('AsyncFunction'); - - /** - * Determines if a value is thenable (has then and catch methods). - * - * @param {*} thing - The value to test. - * @returns {boolean} True if value is thenable, otherwise false. - */ - var isThenable = function isThenable(thing) { - return thing && (isObject(thing) || isFunction$1(thing)) && isFunction$1(thing.then) && isFunction$1(thing["catch"]); - }; - - // original code - // https://github.com/DigitalBrainJS/AxiosPromise/blob/16deab13710ec09779922131f3fa5954320f83ab/lib/utils.js#L11-L34 - - /** - * Provides a cross-platform setImmediate implementation. - * Uses native setImmediate if available, otherwise falls back to postMessage or setTimeout. - * - * @param {boolean} setImmediateSupported - Whether setImmediate is supported. - * @param {boolean} postMessageSupported - Whether postMessage is supported. - * @returns {Function} A function to schedule a callback asynchronously. - */ - var _setImmediate = function (setImmediateSupported, postMessageSupported) { - if (setImmediateSupported) { - return setImmediate; - } - return postMessageSupported ? function (token, callbacks) { - _global.addEventListener('message', function (_ref5) { - var source = _ref5.source, - data = _ref5.data; - if (source === _global && data === token) { - callbacks.length && callbacks.shift()(); - } - }, false); - return function (cb) { - callbacks.push(cb); - _global.postMessage(token, '*'); - }; - }("axios@".concat(Math.random()), []) : function (cb) { - return setTimeout(cb); - }; - }(typeof setImmediate === 'function', isFunction$1(_global.postMessage)); - - /** - * Schedules a microtask or asynchronous callback as soon as possible. - * Uses queueMicrotask if available, otherwise falls back to process.nextTick or _setImmediate. - * - * @type {Function} - */ - var asap = typeof queueMicrotask !== 'undefined' ? queueMicrotask.bind(_global) : typeof process !== 'undefined' && process.nextTick || _setImmediate; - - // ********************* - - var isIterable = function isIterable(thing) { - return thing != null && isFunction$1(thing[iterator]); - }; - - /** - * Determine if a value is iterable via an iterator that is NOT sourced solely - * from a polluted Object.prototype. Use this instead of `isIterable` whenever - * the iterable comes from untrusted input (e.g. user-supplied header sources), - * so `Object.prototype[Symbol.iterator] = ...` cannot turn an ordinary object - * into an attacker-controlled entries iterator. - * - * @param {*} thing The value to test - * - * @returns {boolean} True if value has a non-polluted iterator - */ - var isSafeIterable = function isSafeIterable(thing) { - return thing != null && hasOwnInPrototypeChain(thing, iterator) && isIterable(thing); - }; - var utils$1 = { - isArray: isArray, - isArrayBuffer: isArrayBuffer, - isBuffer: isBuffer, - isFormData: isFormData, - isArrayBufferView: isArrayBufferView, - isString: isString, - isNumber: isNumber, - isBoolean: isBoolean, - isObject: isObject, - isPlainObject: isPlainObject, - isEmptyObject: isEmptyObject, - isReadableStream: isReadableStream, - isRequest: isRequest, - isResponse: isResponse, - isHeaders: isHeaders, - isUndefined: isUndefined, - isDate: isDate, - isFile: isFile, - isReactNativeBlob: isReactNativeBlob, - isReactNative: isReactNative, - isBlob: isBlob, - isRegExp: isRegExp, - isFunction: isFunction$1, - isStream: isStream, - isURLSearchParams: isURLSearchParams, - isTypedArray: isTypedArray, - isFileList: isFileList, - forEach: forEach, - merge: merge, - extend: extend, - trim: trim, - stripBOM: stripBOM, - inherits: inherits, - toFlatObject: toFlatObject, - kindOf: kindOf, - kindOfTest: kindOfTest, - endsWith: endsWith, - toArray: toArray, - forEachEntry: forEachEntry, - matchAll: matchAll, - isHTMLForm: isHTMLForm, - hasOwnProperty: hasOwnProperty, - hasOwnProp: hasOwnProperty, - // an alias to avoid ESLint no-prototype-builtins detection - hasOwnInPrototypeChain: hasOwnInPrototypeChain, - getSafeProp: getSafeProp, - reduceDescriptors: reduceDescriptors, - freezeMethods: freezeMethods, - toObjectSet: toObjectSet, - toCamelCase: toCamelCase, - noop: noop, - toFiniteNumber: toFiniteNumber, - findKey: findKey, - global: _global, - isContextDefined: isContextDefined, - isSpecCompliantForm: isSpecCompliantForm, - toJSONObject: toJSONObject, - isAsyncFn: isAsyncFn, - isThenable: isThenable, - setImmediate: _setImmediate, - asap: asap, - isIterable: isIterable, - isSafeIterable: isSafeIterable - }; - - // RawAxiosHeaders whose duplicates are ignored by node - // c.f. https://nodejs.org/api/http.html#http_message_headers - var ignoreDuplicateOf = utils$1.toObjectSet(['age', 'authorization', 'content-length', 'content-type', 'etag', 'expires', 'from', 'host', 'if-modified-since', 'if-unmodified-since', 'last-modified', 'location', 'max-forwards', 'proxy-authorization', 'referer', 'retry-after', 'user-agent']); - - /** - * Parse headers into an object - * - * ``` - * Date: Wed, 27 Aug 2014 08:58:49 GMT - * Content-Type: application/json - * Connection: keep-alive - * Transfer-Encoding: chunked - * ``` - * - * @param {String} rawHeaders Headers needing to be parsed - * - * @returns {Object} Headers parsed into an object - */ - var parseHeaders = (function (rawHeaders) { - var parsed = {}; - var key; - var val; - var i; - rawHeaders && rawHeaders.split('\n').forEach(function parser(line) { - i = line.indexOf(':'); - key = line.substring(0, i).trim().toLowerCase(); - val = line.substring(i + 1).trim(); - var hasKey = utils$1.hasOwnProp(parsed, key); - if (!key || hasKey && utils$1.hasOwnProp(ignoreDuplicateOf, key)) { - return; - } - if (key === 'set-cookie') { - if (hasKey) { - parsed[key].push(val); - } else { - parsed[key] = [val]; - } - } else { - parsed[key] = hasKey ? parsed[key] + ', ' + val : val; - } - }); - return parsed; - }); - - function trimSPorHTAB(str) { - var start = 0; - var end = str.length; - while (start < end) { - var code = str.charCodeAt(start); - if (code !== 0x09 && code !== 0x20) { - break; - } - start += 1; - } - while (end > start) { - var _code = str.charCodeAt(end - 1); - if (_code !== 0x09 && _code !== 0x20) { - break; - } - end -= 1; - } - return start === 0 && end === str.length ? str : str.slice(start, end); - } - - // The control-code ranges are intentional: header sanitization strips C0/DEL bytes. - // eslint-disable-next-line no-control-regex - var INVALID_UNICODE_HEADER_VALUE_CHARS = new RegExp("[\\u0000-\\u0008\\u000a-\\u001f\\u007f]+", 'g'); - // eslint-disable-next-line no-control-regex - var INVALID_BYTE_STRING_HEADER_VALUE_CHARS = new RegExp("[^\\u0009\\u0020-\\u007e\\u0080-\\u00ff]+", 'g'); - function sanitizeValue(value, invalidChars) { - if (utils$1.isArray(value)) { - return value.map(function (item) { - return sanitizeValue(item, invalidChars); - }); - } - return trimSPorHTAB(String(value).replace(invalidChars, '')); - } - var sanitizeHeaderValue = function sanitizeHeaderValue(value) { - return sanitizeValue(value, INVALID_UNICODE_HEADER_VALUE_CHARS); - }; - var sanitizeByteStringHeaderValue = function sanitizeByteStringHeaderValue(value) { - return sanitizeValue(value, INVALID_BYTE_STRING_HEADER_VALUE_CHARS); - }; - function toByteStringHeaderObject(headers) { - var byteStringHeaders = Object.create(null); - utils$1.forEach(headers.toJSON(), function (value, header) { - byteStringHeaders[header] = sanitizeByteStringHeaderValue(value); - }); - return byteStringHeaders; - } - - var $internals = Symbol('internals'); - function normalizeHeader(header) { - return header && String(header).trim().toLowerCase(); - } - function normalizeValue(value) { - if (value === false || value == null) { - return value; - } - return utils$1.isArray(value) ? value.map(normalizeValue) : sanitizeHeaderValue(String(value)); - } - function parseTokens(str) { - var tokens = Object.create(null); - var tokensRE = /([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g; - var match; - while (match = tokensRE.exec(str)) { - tokens[match[1]] = match[2]; - } - return tokens; - } - var parameterNameRE = /^[!#$%&'*+\-.^_`|~0-9A-Za-z]+$/; - function trimOWS(value) { - var start = 0; - var end = value.length; - while (start < end) { - var code = value.charCodeAt(start); - if (code !== 0x09 && code !== 0x20) { - break; - } - start += 1; - } - while (end > start) { - var _code = value.charCodeAt(end - 1); - if (_code !== 0x09 && _code !== 0x20) { - break; - } - end -= 1; - } - return start === 0 && end === value.length ? value : value.slice(start, end); - } - function decodeQuotedString(value) { - var last = value.length - 1; - if (last < 1 || value.charCodeAt(0) !== 0x22 || value.charCodeAt(last) !== 0x22) { - return value; - } - var decoded = ''; - for (var i = 1; i < last; i++) { - var code = value.charCodeAt(i); - if (code === 0x22) { - return value; - } - if (code === 0x5c) { - i += 1; - if (i >= last) { - return value; - } - } - decoded += value[i]; - } - return decoded; - } - function _parseParameters(value) { - var parameters = Object.create(null); - var str = String(value); - var start = 0; - var quoted = false; - var escaped = false; - function parseParameter(end) { - var part = trimOWS(str.slice(start, end)); - var equals = part.indexOf('='); - if (equals < 1) { - return; - } - var name = trimOWS(part.slice(0, equals)); - if (!parameterNameRE.test(name)) { - return; - } - var normalizedName = name.toLowerCase(); - if (normalizedName === '__proto__' || normalizedName === 'constructor' || normalizedName === 'prototype') { - return; - } - var parameterValue = trimOWS(part.slice(equals + 1)); - parameters[normalizedName] = decodeQuotedString(parameterValue); - } - for (var i = 0; i < str.length; i++) { - var code = str.charCodeAt(i); - if (quoted) { - if (escaped) { - escaped = false; - } else if (code === 0x5c) { - escaped = true; - } else if (code === 0x22) { - quoted = false; - } - } else if (code === 0x22) { - quoted = true; - } else if (code === 0x2c || code === 0x3b) { - parseParameter(i); - start = i + 1; - } - } - parseParameter(str.length); - return parameters; - } - var isValidHeaderName = function isValidHeaderName(str) { - return /^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(str.trim()); - }; - function matchHeaderValue(context, value, header, filter, isHeaderNameFilter) { - if (utils$1.isFunction(filter)) { - return filter.call(this, value, header); - } - if (isHeaderNameFilter) { - value = header; - } - if (!utils$1.isString(value)) return; - if (utils$1.isString(filter)) { - return value.indexOf(filter) !== -1; - } - if (utils$1.isRegExp(filter)) { - return filter.test(value); - } - } - function formatHeader(header) { - return header.trim().toLowerCase().replace(/([a-z\d])(\w*)/g, function (w, _char, str) { - return _char.toUpperCase() + str; - }); - } - function buildAccessors(obj, header) { - var accessorName = utils$1.toCamelCase(' ' + header); - ['get', 'set', 'has'].forEach(function (methodName) { - Object.defineProperty(obj, methodName + accessorName, { - // Null-proto descriptor so a polluted Object.prototype.get cannot turn - // this data descriptor into an accessor descriptor on the way in. - __proto__: null, - value: function value(arg1, arg2, arg3) { - return this[methodName].call(this, header, arg1, arg2, arg3); - }, - configurable: true - }); - }); - } - var AxiosHeaders = /*#__PURE__*/function () { - function AxiosHeaders(headers) { - _classCallCheck(this, AxiosHeaders); - headers && this.set(headers); - } - return _createClass(AxiosHeaders, [{ - key: "set", - value: function set(header, valueOrRewrite, rewrite) { - var self = this; - function setHeader(_value, _header, _rewrite) { - var lHeader = normalizeHeader(_header); - if (!lHeader) { - return; - } - var key = utils$1.findKey(self, lHeader); - if (!key || self[key] === undefined || _rewrite === true || _rewrite === undefined && self[key] !== false) { - self[key || _header] = normalizeValue(_value); - } - } - var setHeaders = function setHeaders(headers, _rewrite) { - return utils$1.forEach(headers, function (_value, _header) { - return setHeader(_value, _header, _rewrite); - }); - }; - if (utils$1.isPlainObject(header) || header instanceof this.constructor) { - setHeaders(header, valueOrRewrite); - } else if (utils$1.isString(header) && (header = header.trim()) && !isValidHeaderName(header)) { - setHeaders(parseHeaders(header), valueOrRewrite); - } else if (utils$1.isObject(header) && utils$1.isSafeIterable(header)) { - var obj = Object.create(null), - dest, - key; - var _iterator = _createForOfIteratorHelper(header), - _step; - try { - for (_iterator.s(); !(_step = _iterator.n()).done;) { - var entry = _step.value; - if (!utils$1.isArray(entry)) { - throw new TypeError('Object iterator must return a key-value pair'); - } - key = entry[0]; - if (utils$1.hasOwnProp(obj, key)) { - dest = obj[key]; - obj[key] = utils$1.isArray(dest) ? [].concat(_toConsumableArray(dest), [entry[1]]) : [dest, entry[1]]; - } else { - obj[key] = entry[1]; - } - } - } catch (err) { - _iterator.e(err); - } finally { - _iterator.f(); - } - setHeaders(obj, valueOrRewrite); - } else { - header != null && setHeader(valueOrRewrite, header, rewrite); - } - return this; - } - }, { - key: "get", - value: function get(header, parser) { - header = normalizeHeader(header); - if (header) { - var key = utils$1.findKey(this, header); - if (key) { - var value = this[key]; - if (!parser) { - return value; - } - if (parser === true) { - return parseTokens(value); - } - if (utils$1.isFunction(parser)) { - return parser.call(this, value, key); - } - if (utils$1.isRegExp(parser)) { - return parser.exec(value); - } - throw new TypeError('parser must be boolean|regexp|function'); - } - } - } - }, { - key: "has", - value: function has(header, matcher) { - header = normalizeHeader(header); - if (header) { - var key = utils$1.findKey(this, header); - return !!(key && this[key] !== undefined && (!matcher || matchHeaderValue(this, this[key], key, matcher))); - } - return false; - } - }, { - key: "delete", - value: function _delete(header, matcher) { - var self = this; - var deleted = false; - function deleteHeader(_header) { - _header = normalizeHeader(_header); - if (_header) { - var key = utils$1.findKey(self, _header); - if (key && (!matcher || matchHeaderValue(self, self[key], key, matcher))) { - delete self[key]; - deleted = true; - } - } - } - if (utils$1.isArray(header)) { - header.forEach(deleteHeader); - } else { - deleteHeader(header); - } - return deleted; - } - }, { - key: "clear", - value: function clear(matcher) { - var keys = Object.keys(this); - var i = keys.length; - var deleted = false; - while (i--) { - var key = keys[i]; - if (!matcher || matchHeaderValue(this, this[key], key, matcher, true)) { - delete this[key]; - deleted = true; - } - } - return deleted; - } - }, { - key: "normalize", - value: function normalize(format) { - var self = this; - var headers = {}; - utils$1.forEach(this, function (value, header) { - var key = utils$1.findKey(headers, header); - if (key) { - self[key] = normalizeValue(value); - delete self[header]; - return; - } - var normalized = format ? formatHeader(header) : String(header).trim(); - if (normalized !== header) { - delete self[header]; - } - self[normalized] = normalizeValue(value); - headers[normalized] = true; - }); - return this; - } - }, { - key: "concat", - value: function concat() { - var _this$constructor; - for (var _len = arguments.length, targets = new Array(_len), _key = 0; _key < _len; _key++) { - targets[_key] = arguments[_key]; - } - return (_this$constructor = this.constructor).concat.apply(_this$constructor, [this].concat(targets)); - } - }, { - key: "toJSON", - value: function toJSON(asStrings) { - var obj = Object.create(null); - utils$1.forEach(this, function (value, header) { - value != null && value !== false && (obj[header] = asStrings && utils$1.isArray(value) ? value.join(', ') : value); - }); - return obj; - } - }, { - key: Symbol.iterator, - value: function value() { - return Object.entries(this.toJSON())[Symbol.iterator](); - } - }, { - key: "toString", - value: function toString() { - return Object.entries(this.toJSON()).map(function (_ref) { - var _ref2 = _slicedToArray(_ref, 2), - header = _ref2[0], - value = _ref2[1]; - return header + ': ' + value; - }).join('\n'); - } - }, { - key: "getSetCookie", - value: function getSetCookie() { - var value = this.get('set-cookie'); - return utils$1.isArray(value) ? value : value == null || value === false ? [] : [value]; - } - }, { - key: Symbol.toStringTag, - get: function get() { - return 'AxiosHeaders'; - } - }], [{ - key: "from", - value: function from(thing) { - return thing instanceof this ? thing : new this(thing); - } - }, { - key: "parseParameters", - value: function parseParameters(value) { - return _parseParameters(value); - } - }, { - key: "concat", - value: function concat(first) { - var computed = new this(first); - for (var _len2 = arguments.length, targets = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) { - targets[_key2 - 1] = arguments[_key2]; - } - targets.forEach(function (target) { - return computed.set(target); - }); - return computed; - } - }, { - key: "accessor", - value: function accessor(header) { - var internals = this[$internals] = this[$internals] = { - accessors: {} - }; - var accessors = internals.accessors; - var prototype = this.prototype; - function defineAccessor(_header) { - var lHeader = normalizeHeader(_header); - if (!accessors[lHeader]) { - buildAccessors(prototype, _header); - accessors[lHeader] = true; - } - } - utils$1.isArray(header) ? header.forEach(defineAccessor) : defineAccessor(header); - return this; - } - }]); - }(); - AxiosHeaders.accessor(['Content-Type', 'Content-Length', 'Accept', 'Accept-Encoding', 'User-Agent', 'Authorization']); - - // reserved names hotfix - utils$1.reduceDescriptors(AxiosHeaders.prototype, function (_ref3, key) { - var value = _ref3.value; - var mapped = key[0].toUpperCase() + key.slice(1); // map `set` => `Set` - return { - get: function get() { - return value; - }, - set: function set(headerValue) { - this[mapped] = headerValue; - } - }; - }); - utils$1.freezeMethods(AxiosHeaders); - - var REDACTED = '[REDACTED ****]'; - function hasOwnOrPrototypeToJSON(source) { - if (utils$1.hasOwnProp(source, 'toJSON')) { - return true; - } - var prototype = Object.getPrototypeOf(source); - while (prototype && prototype !== Object.prototype) { - if (utils$1.hasOwnProp(prototype, 'toJSON')) { - return true; - } - prototype = Object.getPrototypeOf(prototype); - } - return false; - } - - // Build a plain-object snapshot of `config` and replace the value of any key - // (case-insensitive) listed in `redactKeys` with REDACTED. Walks through arrays - // and AxiosHeaders, and short-circuits on circular references. - function redactConfig(config, redactKeys) { - var lowerKeys = new Set(redactKeys.map(function (k) { - return String(k).toLowerCase(); - })); - var seen = []; - var _visit = function visit(source) { - if (source === null || _typeof(source) !== 'object') return source; - if (utils$1.isBuffer(source)) return source; - if (seen.indexOf(source) !== -1) return undefined; - if (source instanceof AxiosHeaders) { - source = source.toJSON(); - } - seen.push(source); - var result; - if (utils$1.isArray(source)) { - result = []; - source.forEach(function (v, i) { - var reducedValue = _visit(v); - if (!utils$1.isUndefined(reducedValue)) { - result[i] = reducedValue; - } - }); - } else { - if (!utils$1.isPlainObject(source) && hasOwnOrPrototypeToJSON(source)) { - seen.pop(); - return source; - } - result = Object.create(null); - for (var _i = 0, _Object$entries = Object.entries(source); _i < _Object$entries.length; _i++) { - var _Object$entries$_i = _slicedToArray(_Object$entries[_i], 2), - key = _Object$entries$_i[0], - value = _Object$entries$_i[1]; - var reducedValue = lowerKeys.has(key.toLowerCase()) ? REDACTED : _visit(value); - if (!utils$1.isUndefined(reducedValue)) { - result[key] = reducedValue; - } - } - } - seen.pop(); - return result; - }; - return _visit(config); - } - function stringifySafely$1(value) { - try { - return String(value); - } catch (err) { - return ''; - } - } - function aggregateErrorMessage(error) { - var message = error.errors.map(function (entry) { - try { - return entry && entry.message ? stringifySafely$1(entry.message) : stringifySafely$1(entry); - } catch (err) { - return ''; - } - }).filter(Boolean).join('; '); - return message || error.name || 'AggregateError'; - } - var AxiosError = /*#__PURE__*/function (_Error) { - /** - * Create an Error with the specified message, config, error code, request and response. - * - * @param {string} message The error message. - * @param {string} [code] The error code (for example, 'ECONNABORTED'). - * @param {Object} [config] The config. - * @param {Object} [request] The request. - * @param {Object} [response] The response. - * - * @returns {Error} The created error. - */ - function AxiosError(message, code, config, request, response) { - var _this; - _classCallCheck(this, AxiosError); - _this = _callSuper(this, AxiosError, [message]); - - // Make message enumerable to maintain backward compatibility - // The native Error constructor sets message as non-enumerable, - // but axios < v1.13.3 had it as enumerable - Object.defineProperty(_this, 'message', { - // Null-proto descriptor so a polluted Object.prototype.get cannot turn - // this data descriptor into an accessor descriptor on the way in. - __proto__: null, - value: message, - enumerable: true, - writable: true, - configurable: true - }); - _this.name = 'AxiosError'; - _this.isAxiosError = true; - code && (_this.code = code); - config && (_this.config = config); - request && (_this.request = request); - if (response) { - _this.response = response; - _this.status = response.status; - } - return _this; - } - _inherits(AxiosError, _Error); - return _createClass(AxiosError, [{ - key: "toJSON", - value: function toJSON() { - // Opt-in redaction: when the request config carries a `redact` array, the - // value of any matching key (case-insensitive, at any depth) is replaced - // with REDACTED in the serialized snapshot. Undefined or empty leaves the - // existing serialization behavior unchanged. - var config = this.config; - var redactKeys = config && utils$1.hasOwnProp(config, 'redact') ? config.redact : undefined; - var serializedConfig = utils$1.isArray(redactKeys) && redactKeys.length > 0 ? redactConfig(config, redactKeys) : utils$1.toJSONObject(config); - return { - // Standard - message: this.message, - name: this.name, - // Microsoft - description: this.description, - number: this.number, - // Mozilla - fileName: this.fileName, - lineNumber: this.lineNumber, - columnNumber: this.columnNumber, - stack: this.stack, - // Axios - config: serializedConfig, - code: this.code, - status: this.status - }; - } - }], [{ - key: "from", - value: function from(error, code, config, request, response, customProps) { - // `AggregateError` (thrown by Node on dual-stack/Happy-Eyeballs connection - // failures) has an empty `message`; its detail lives in `errors[]`. Without - // this, the wrapped error surfaces with a blank message (see #6721). - var message = error.message; - if (!message && utils$1.isArray(error.errors) && error.errors.length) { - message = aggregateErrorMessage(error); - } - var axiosError = new AxiosError(message, code || error.code, config, request, response); - // Match native `Error` `cause` semantics: non-enumerable. The wrapped - // error often carries circular internals (sockets, requests, agents), so - // an enumerable `cause` makes structured loggers (pino/winston) and any - // own-property walk throw "Converting circular structure to JSON". - // Regression from #6982; see #7205. `__proto__: null` mirrors the - // `message` descriptor below (prototype-pollution-safe descriptor). - Object.defineProperty(axiosError, 'cause', { - __proto__: null, - value: error, - writable: true, - enumerable: false, - configurable: true - }); - axiosError.name = error.name; - - // Preserve status from the original error if not already set from response - if (error.status != null && axiosError.status == null) { - axiosError.status = error.status; - } - customProps && Object.assign(axiosError, customProps); - return axiosError; - } - }]); - }(/*#__PURE__*/_wrapNativeSuper(Error)); // This can be changed to static properties as soon as the parser options in .eslint.cjs are updated. - AxiosError.ERR_BAD_OPTION_VALUE = 'ERR_BAD_OPTION_VALUE'; - AxiosError.ERR_BAD_OPTION = 'ERR_BAD_OPTION'; - AxiosError.ECONNABORTED = 'ECONNABORTED'; - AxiosError.ETIMEDOUT = 'ETIMEDOUT'; - AxiosError.ECONNREFUSED = 'ECONNREFUSED'; - AxiosError.ERR_NETWORK = 'ERR_NETWORK'; - AxiosError.ERR_FR_TOO_MANY_REDIRECTS = 'ERR_FR_TOO_MANY_REDIRECTS'; - AxiosError.ERR_DEPRECATED = 'ERR_DEPRECATED'; - AxiosError.ERR_BAD_RESPONSE = 'ERR_BAD_RESPONSE'; - AxiosError.ERR_BAD_REQUEST = 'ERR_BAD_REQUEST'; - AxiosError.ERR_CANCELED = 'ERR_CANCELED'; - AxiosError.ERR_NOT_SUPPORT = 'ERR_NOT_SUPPORT'; - AxiosError.ERR_INVALID_URL = 'ERR_INVALID_URL'; - AxiosError.ERR_FORM_DATA_DEPTH_EXCEEDED = 'ERR_FORM_DATA_DEPTH_EXCEEDED'; - - // eslint-disable-next-line strict - var httpAdapter = null; - - // Default nesting limit shared with the inverse transform (formDataToJSON) so - // the FormData <-> JSON round-trip stays symmetric. - var DEFAULT_FORM_DATA_MAX_DEPTH = 100; - - /** - * Determines if the given thing is a array or js object. - * - * @param {string} thing - The object or array to be visited. - * - * @returns {boolean} - */ - function isVisitable(thing) { - return utils$1.isPlainObject(thing) || utils$1.isArray(thing); - } - - /** - * It removes the brackets from the end of a string - * - * @param {string} key - The key of the parameter. - * - * @returns {string} the key without the brackets. - */ - function removeBrackets(key) { - return utils$1.endsWith(key, '[]') ? key.slice(0, -2) : key; - } - - /** - * It takes a path, a key, and a boolean, and returns a string - * - * @param {string} path - The path to the current key. - * @param {string} key - The key of the current object being iterated over. - * @param {string} dots - If true, the key will be rendered with dots instead of brackets. - * - * @returns {string} The path to the current key. - */ - function renderKey(path, key, dots) { - if (!path) return key; - return path.concat(key).map(function each(token, i) { - // eslint-disable-next-line no-param-reassign - token = removeBrackets(token); - return !dots && i ? '[' + token + ']' : token; - }).join(dots ? '.' : ''); - } - - /** - * If the array is an array and none of its elements are visitable, then it's a flat array. - * - * @param {Array} arr - The array to check - * - * @returns {boolean} - */ - function isFlatArray(arr) { - return utils$1.isArray(arr) && !arr.some(isVisitable); - } - var predicates = utils$1.toFlatObject(utils$1, {}, null, function filter(prop) { - return /^is[A-Z]/.test(prop); - }); - - /** - * Convert a data object to FormData - * - * @param {Object} obj - * @param {?Object} [formData] - * @param {?Object} [options] - * @param {Function} [options.visitor] - * @param {Boolean} [options.metaTokens = true] - * @param {Boolean} [options.dots = false] - * @param {?Boolean} [options.indexes = false] - * - * @returns {Object} - **/ - - /** - * It converts an object into a FormData object - * - * @param {Object} obj - The object to convert to form data. - * @param {string} formData - The FormData object to append to. - * @param {Object} options - * - * @returns - */ - function toFormData(obj, formData, options) { - if (!utils$1.isObject(obj)) { - throw new TypeError('target must be an object'); - } - - // eslint-disable-next-line no-param-reassign - formData = formData || new (FormData)(); - - // eslint-disable-next-line no-param-reassign - options = utils$1.toFlatObject(options, { - metaTokens: true, - dots: false, - indexes: false - }, false, function defined(option, source) { - // eslint-disable-next-line no-eq-null,eqeqeq - return !utils$1.isUndefined(source[option]); - }); - var metaTokens = options.metaTokens; - // eslint-disable-next-line no-use-before-define - var visitor = options.visitor || defaultVisitor; - var dots = options.dots; - var indexes = options.indexes; - var _Blob = options.Blob || typeof Blob !== 'undefined' && Blob; - var maxDepth = options.maxDepth === undefined ? DEFAULT_FORM_DATA_MAX_DEPTH : options.maxDepth; - var useBlob = _Blob && utils$1.isSpecCompliantForm(formData); - var stack = []; - if (!utils$1.isFunction(visitor)) { - throw new TypeError('visitor must be a function'); - } - function convertValue(value) { - if (value === null) return ''; - if (utils$1.isDate(value)) { - return value.toISOString(); - } - if (utils$1.isBoolean(value)) { - return value.toString(); - } - if (!useBlob && utils$1.isBlob(value)) { - throw new AxiosError('Blob is not supported. Use a Buffer instead.'); - } - if (utils$1.isArrayBuffer(value) || utils$1.isTypedArray(value)) { - if (useBlob && typeof _Blob === 'function') { - return new _Blob([value]); - } - throw new AxiosError('Blob is not supported. Use a Buffer instead.', AxiosError.ERR_NOT_SUPPORT); - } - return value; - } - function throwIfMaxDepthExceeded(depth) { - if (depth > maxDepth) { - throw new AxiosError('Object is too deeply nested (' + depth + ' levels). Max depth: ' + maxDepth, AxiosError.ERR_FORM_DATA_DEPTH_EXCEEDED); - } - } - function stringifyWithDepthLimit(value, depth) { - if (maxDepth === Infinity) { - return JSON.stringify(value); - } - var ancestors = []; - return JSON.stringify(value, function limitDepth(_key, currentValue) { - if (!utils$1.isObject(currentValue)) { - return currentValue; - } - while (ancestors.length && ancestors[ancestors.length - 1] !== this) { - ancestors.pop(); - } - ancestors.push(currentValue); - throwIfMaxDepthExceeded(depth + ancestors.length - 1); - return currentValue; - }); - } - - /** - * Default visitor. - * - * @param {*} value - * @param {String|Number} key - * @param {Array} path - * @this {FormData} - * - * @returns {boolean} return true to visit the each prop of the value recursively - */ - function defaultVisitor(value, key, path) { - var arr = value; - if (utils$1.isReactNative(formData) && utils$1.isReactNativeBlob(value)) { - formData.append(renderKey(path, key, dots), convertValue(value)); - return false; - } - if (value && !path && _typeof(value) === 'object') { - if (utils$1.endsWith(key, '{}')) { - // eslint-disable-next-line no-param-reassign - key = metaTokens ? key : key.slice(0, -2); - // eslint-disable-next-line no-param-reassign - value = stringifyWithDepthLimit(value, 1); - } else if (utils$1.isArray(value) && isFlatArray(value) || (utils$1.isFileList(value) || utils$1.endsWith(key, '[]')) && (arr = utils$1.toArray(value))) { - // eslint-disable-next-line no-param-reassign - key = removeBrackets(key); - arr.forEach(function each(el, index) { - !(utils$1.isUndefined(el) || el === null) && formData.append( - // eslint-disable-next-line no-nested-ternary - indexes === true ? renderKey([key], index, dots) : indexes === null ? key : key + '[]', convertValue(el)); - }); - return false; - } - } - if (isVisitable(value)) { - return true; - } - formData.append(renderKey(path, key, dots), convertValue(value)); - return false; - } - var exposedHelpers = Object.assign(predicates, { - defaultVisitor: defaultVisitor, - convertValue: convertValue, - isVisitable: isVisitable - }); - function build(value, path) { - var depth = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0; - if (utils$1.isUndefined(value)) return; - throwIfMaxDepthExceeded(depth); - if (stack.indexOf(value) !== -1) { - throw new Error('Circular reference detected in ' + path.join('.')); - } - stack.push(value); - utils$1.forEach(value, function each(el, key) { - var result = !(utils$1.isUndefined(el) || el === null) && visitor.call(formData, el, utils$1.isString(key) ? key.trim() : key, path, exposedHelpers); - if (result === true) { - build(el, path ? path.concat(key) : [key], depth + 1); - } - }); - stack.pop(); - } - if (!utils$1.isObject(obj)) { - throw new TypeError('data must be an object'); - } - build(obj); - return formData; - } - - /** - * It encodes a string by replacing all characters that are not in the unreserved set with - * their percent-encoded equivalents - * - * @param {string} str - The string to encode. - * - * @returns {string} The encoded string. - */ - function encode$1(str) { - var charMap = { - '!': '%21', - "'": '%27', - '(': '%28', - ')': '%29', - '~': '%7E', - '%20': '+' - }; - return encodeURIComponent(str).replace(/[!'()~]|%20/g, function replacer(match) { - return charMap[match]; - }); - } - - /** - * It takes a params object and converts it to a FormData object - * - * @param {Object} params - The parameters to be converted to a FormData object. - * @param {Object} options - The options object passed to the Axios constructor. - * - * @returns {void} - */ - function AxiosURLSearchParams(params, options) { - this._pairs = []; - params && toFormData(params, this, options); - } - var prototype = AxiosURLSearchParams.prototype; - prototype.append = function append(name, value) { - this._pairs.push([name, value]); - }; - prototype.toString = function toString(encoder) { - var _this = this; - var _encode = encoder ? function (value) { - return encoder.call(_this, value, encode$1); - } : encode$1; - return this._pairs.map(function each(pair) { - return _encode(pair[0]) + '=' + _encode(pair[1]); - }, '').join('&'); - }; - - /** - * It replaces URL-encoded forms of `:`, `$`, `,`, and spaces with - * their plain counterparts (`:`, `$`, `,`, `+`). - * - * @param {string} val The value to be encoded. - * - * @returns {string} The encoded value. - */ - function encode(val) { - return encodeURIComponent(val).replace(/%3A/gi, ':').replace(/%24/g, '$').replace(/%2C/gi, ',').replace(/%20/g, '+'); - } - - /** - * Build a URL by appending params to the end - * - * @param {string} url The base of the url (e.g., http://www.google.com) - * @param {object} [params] The params to be appended - * @param {?(object|Function)} options - * - * @returns {string} The formatted url - */ - function buildURL(url, params, options) { - if (!params) { - return url; - } - url = url || ''; - var _options = utils$1.isFunction(options) ? { - serialize: options - } : options; - - // Read serializer options pollution-safely: own properties and methods on a - // class/template prototype are honored, but values injected onto a polluted - // Object.prototype are ignored. - var _encode = utils$1.getSafeProp(_options, 'encode') || encode; - var serializeFn = utils$1.getSafeProp(_options, 'serialize'); - var serializedParams; - if (serializeFn) { - serializedParams = serializeFn(params, _options); - } else { - serializedParams = utils$1.isURLSearchParams(params) ? params.toString() : new AxiosURLSearchParams(params, _options).toString(_encode); - } - if (serializedParams) { - var hashmarkIndex = url.indexOf('#'); - if (hashmarkIndex !== -1) { - url = url.slice(0, hashmarkIndex); - } - url += (url.indexOf('?') === -1 ? '?' : '&') + serializedParams; - } - return url; - } - - var InterceptorManager = /*#__PURE__*/function () { - function InterceptorManager() { - _classCallCheck(this, InterceptorManager); - this.handlers = []; - } - - /** - * Add a new interceptor to the stack - * - * @param {Function} fulfilled The function to handle `then` for a `Promise` - * @param {Function} rejected The function to handle `reject` for a `Promise` - * @param {Object} options The options for the interceptor, synchronous and runWhen - * - * @return {Number} An ID used to remove interceptor later - */ - return _createClass(InterceptorManager, [{ - key: "use", - value: function use(fulfilled, rejected, options) { - this.handlers.push({ - fulfilled: fulfilled, - rejected: rejected, - synchronous: options ? options.synchronous : false, - runWhen: options ? options.runWhen : null - }); - return this.handlers.length - 1; - } - - /** - * Remove an interceptor from the stack - * - * @param {Number} id The ID that was returned by `use` - * - * @returns {void} - */ - }, { - key: "eject", - value: function eject(id) { - if (this.handlers[id]) { - this.handlers[id] = null; - } - } - - /** - * Clear all interceptors from the stack - * - * @returns {void} - */ - }, { - key: "clear", - value: function clear() { - if (this.handlers) { - this.handlers = []; - } - } - - /** - * Iterate over all the registered interceptors - * - * This method is particularly useful for skipping over any - * interceptors that may have become `null` calling `eject`. - * - * @param {Function} fn The function to call for each interceptor - * - * @returns {void} - */ - }, { - key: "forEach", - value: function forEach(fn) { - utils$1.forEach(this.handlers, function forEachHandler(h) { - if (h !== null) { - fn(h); - } - }); - } - }]); - }(); - - var transitionalDefaults = { - silentJSONParsing: true, - forcedJSONParsing: true, - clarifyTimeoutError: false, - legacyInterceptorReqResOrdering: true, - advertiseZstdAcceptEncoding: false, - validateStatusUndefinedResolves: true - }; - - var URLSearchParams$1 = typeof URLSearchParams !== 'undefined' ? URLSearchParams : AxiosURLSearchParams; - - var FormData$1 = typeof FormData !== 'undefined' ? FormData : null; - - var Blob$1 = typeof Blob !== 'undefined' ? Blob : null; - - var platform$1 = { - isBrowser: true, - classes: { - URLSearchParams: URLSearchParams$1, - FormData: FormData$1, - Blob: Blob$1 - }, - protocols: ['http', 'https', 'file', 'blob', 'url', 'data'] - }; - - var hasBrowserEnv = typeof window !== 'undefined' && typeof document !== 'undefined'; - var _navigator = (typeof navigator === "undefined" ? "undefined" : _typeof(navigator)) === 'object' && navigator || undefined; - - /** - * Determine if we're running in a standard browser environment - * - * This allows axios to run in a web worker, and react-native. - * Both environments support XMLHttpRequest, but not fully standard globals. - * - * web workers: - * typeof window -> undefined - * typeof document -> undefined - * - * react-native: - * navigator.product -> 'ReactNative' - * nativescript - * navigator.product -> 'NativeScript' or 'NS' - * - * @returns {boolean} - */ - var hasStandardBrowserEnv = hasBrowserEnv && (!_navigator || ['ReactNative', 'NativeScript', 'NS'].indexOf(_navigator.product) < 0); - - /** - * Determine if we're running in a standard browser webWorker environment - * - * Although the `isStandardBrowserEnv` method indicates that - * `allows axios to run in a web worker`, the WebWorker will still be - * filtered out due to its judgment standard - * `typeof window !== 'undefined' && typeof document !== 'undefined'`. - * This leads to a problem when axios post `FormData` in webWorker - */ - var hasStandardBrowserWebWorkerEnv = function () { - return typeof WorkerGlobalScope !== 'undefined' && - // eslint-disable-next-line no-undef - self instanceof WorkerGlobalScope && typeof self.importScripts === 'function'; - }(); - var origin = hasBrowserEnv && window.location.href || 'http://localhost'; - - var utils = /*#__PURE__*/Object.freeze({ - __proto__: null, - hasBrowserEnv: hasBrowserEnv, - hasStandardBrowserEnv: hasStandardBrowserEnv, - hasStandardBrowserWebWorkerEnv: hasStandardBrowserWebWorkerEnv, - navigator: _navigator, - origin: origin - }); - - var platform = _objectSpread2(_objectSpread2({}, utils), platform$1); - - function toURLEncodedForm(data, options) { - return toFormData(data, new platform.classes.URLSearchParams(), _objectSpread2({ - visitor: function visitor(value, key, path, helpers) { - if (platform.isNode && utils$1.isBuffer(value)) { - this.append(key, value.toString('base64')); - return false; - } - return helpers.defaultVisitor.apply(this, arguments); - } - }, options)); - } - - var MAX_DEPTH = DEFAULT_FORM_DATA_MAX_DEPTH; - function throwIfDepthExceeded(index) { - if (index > MAX_DEPTH) { - throw new AxiosError('FormData field is too deeply nested (' + index + ' levels). Max depth: ' + MAX_DEPTH, AxiosError.ERR_FORM_DATA_DEPTH_EXCEEDED); - } - } - - /** - * It takes a string like `foo[x][y][z]` and returns an array like `['foo', 'x', 'y', 'z'] - * - * @param {string} name - The name of the property to get. - * - * @returns An array of strings. - */ - function parsePropPath(name) { - // foo[x][y][z] -> ['foo', 'x', 'y', 'z'] - // foo.x.y.z -> ['foo', 'x', 'y', 'z'] - // A path is split on `.` and on `[...]` groups. A segment — whether written - // in dot notation or captured inside brackets — may contain any character - // except `.`, `[` and `]`, so a key like `user-name` or `user name` is kept - // literal instead of being split (#5402). `.`, `[` and `]` keep their existing - // meaning, e.g. `foo[bar.baz]` -> ['foo', 'bar', 'baz'] and `[]` is an array push. - // Excluding `[` from the bracket group also makes the match fail fast at the - // next `[`, so a malformed name cannot rescan to the end of the string from - // every unmatched `[` — parsing stays linear in the length of the name. - var path = []; - var pattern = /[^.[\]]+|\[([^.[\]]*)]/g; - var match; - while ((match = pattern.exec(name)) !== null) { - throwIfDepthExceeded(path.length); - path.push(match[0] === '[]' ? '' : match[1] || match[0]); - } - return path; - } - - /** - * Convert an array to an object. - * - * @param {Array} arr - The array to convert to an object. - * - * @returns An object with the same keys and values as the array. - */ - function arrayToObject(arr) { - var obj = {}; - var keys = Object.keys(arr); - var i; - var len = keys.length; - var key; - for (i = 0; i < len; i++) { - key = keys[i]; - obj[key] = arr[key]; - } - return obj; - } - - /** - * It takes a FormData object and returns a JavaScript object - * - * @param {string} formData The FormData object to convert to JSON. - * - * @returns {Object | null} The converted object. - */ - function formDataToJSON(formData) { - function buildPath(path, value, target, index) { - throwIfDepthExceeded(index); - var name = path[index++]; - if (name === '__proto__') return true; - var isNumericKey = Number.isFinite(+name); - var isLast = index >= path.length; - name = !name && utils$1.isArray(target) ? target.length : name; - if (isLast) { - if (utils$1.hasOwnProp(target, name)) { - target[name] = utils$1.isArray(target[name]) ? target[name].concat(value) : [target[name], value]; - } else { - target[name] = value; - } - return !isNumericKey; - } - if (!utils$1.hasOwnProp(target, name) || !utils$1.isObject(target[name])) { - target[name] = []; - } - var result = buildPath(path, value, target[name], index); - if (result && utils$1.isArray(target[name])) { - target[name] = arrayToObject(target[name]); - } - return !isNumericKey; - } - if (utils$1.isFormData(formData) && utils$1.isFunction(formData.entries)) { - var obj = {}; - utils$1.forEachEntry(formData, function (name, value) { - buildPath(parsePropPath(name), value, obj, 0); - }); - return obj; - } - return null; - } - - var own = function own(obj, key) { - return obj != null && utils$1.hasOwnProp(obj, key) ? obj[key] : undefined; - }; - - /** - * It takes a string, tries to parse it, and if it fails, it returns the stringified version - * of the input - * - * @param {any} rawValue - The value to be stringified. - * @param {Function} parser - A function that parses a string into a JavaScript object. - * @param {Function} encoder - A function that takes a value and returns a string. - * - * @returns {string} A stringified version of the rawValue. - */ - function stringifySafely(rawValue, parser, encoder) { - if (utils$1.isString(rawValue)) { - try { - (parser || JSON.parse)(rawValue); - return utils$1.trim(rawValue); - } catch (e) { - if (e.name !== 'SyntaxError') { - throw e; - } - } - } - return (encoder || JSON.stringify)(rawValue); - } - var defaults = { - transitional: transitionalDefaults, - adapter: ['xhr', 'http', 'fetch'], - transformRequest: [function transformRequest(data, headers) { - var contentType = headers.getContentType() || ''; - var hasJSONContentType = contentType.indexOf('application/json') > -1; - var isObjectPayload = utils$1.isObject(data); - if (isObjectPayload && utils$1.isHTMLForm(data)) { - data = new FormData(data); - } - var isFormData = utils$1.isFormData(data); - if (isFormData) { - return hasJSONContentType ? JSON.stringify(formDataToJSON(data)) : data; - } - if (utils$1.isArrayBuffer(data) || utils$1.isBuffer(data) || utils$1.isStream(data) || utils$1.isFile(data) || utils$1.isBlob(data) || utils$1.isReadableStream(data)) { - return data; - } - if (utils$1.isArrayBufferView(data)) { - return data.buffer; - } - if (utils$1.isURLSearchParams(data)) { - headers.setContentType('application/x-www-form-urlencoded;charset=utf-8', false); - return data.toString(); - } - var isFileList; - if (isObjectPayload) { - var formSerializer = own(this, 'formSerializer'); - if (contentType.indexOf('application/x-www-form-urlencoded') > -1) { - return toURLEncodedForm(data, formSerializer).toString(); - } - if ((isFileList = utils$1.isFileList(data)) || contentType.indexOf('multipart/form-data') > -1) { - var env = own(this, 'env'); - var _FormData = env && env.FormData; - return toFormData(isFileList ? { - 'files[]': data - } : data, _FormData && new _FormData(), formSerializer); - } - } - if (isObjectPayload || hasJSONContentType) { - headers.setContentType('application/json', false); - return stringifySafely(data); - } - return data; - }], - transformResponse: [function transformResponse(data) { - var transitional = own(this, 'transitional') || defaults.transitional; - var forcedJSONParsing = transitional && transitional.forcedJSONParsing; - var responseType = own(this, 'responseType'); - var JSONRequested = responseType === 'json'; - if (utils$1.isResponse(data) || utils$1.isReadableStream(data)) { - return data; - } - if (data && utils$1.isString(data) && (forcedJSONParsing && !responseType || JSONRequested)) { - var silentJSONParsing = transitional && transitional.silentJSONParsing; - var strictJSONParsing = !silentJSONParsing && JSONRequested; - try { - return JSON.parse(data, own(this, 'parseReviver')); - } catch (e) { - if (strictJSONParsing) { - if (e.name === 'SyntaxError') { - throw AxiosError.from(e, AxiosError.ERR_BAD_RESPONSE, this, null, own(this, 'response')); - } - throw e; - } - } - } - return data; - }], - /** - * A timeout in milliseconds to abort a request. If set to 0 (default) a - * timeout is not created. - */ - timeout: 0, - xsrfCookieName: 'XSRF-TOKEN', - xsrfHeaderName: 'X-XSRF-TOKEN', - maxContentLength: -1, - maxBodyLength: -1, - env: { - FormData: platform.classes.FormData, - Blob: platform.classes.Blob - }, - validateStatus: function validateStatus(status) { - return status >= 200 && status < 300; - }, - headers: { - common: { - Accept: 'application/json, text/plain, */*', - 'Content-Type': undefined - } - } - }; - utils$1.forEach(['delete', 'get', 'head', 'post', 'put', 'patch', 'query'], function (method) { - defaults.headers[method] = {}; - }); - - /** - * Transform the data for a request or a response - * - * @param {Array|Function} fns A single function or Array of functions - * @param {?Object} response The response object - * - * @returns {*} The resulting transformed data - */ - function transformData(fns, response) { - var config = this || defaults; - var context = response || config; - var headers = AxiosHeaders.from(context.headers); - var data = context.data; - utils$1.forEach(fns, function transform(fn) { - data = fn.call(config, data, headers.normalize(), response ? response.status : undefined); - }); - headers.normalize(); - return data; - } - - function isCancel(value) { - return !!(value && value.__CANCEL__); - } - - var CanceledError = /*#__PURE__*/function (_AxiosError) { - /** - * A `CanceledError` is an object that is thrown when an operation is canceled. - * - * @param {string=} message The message. - * @param {Object=} config The config. - * @param {Object=} request The request. - * - * @returns {CanceledError} The created error. - */ - function CanceledError(message, config, request) { - var _this; - _classCallCheck(this, CanceledError); - _this = _callSuper(this, CanceledError, [message == null ? 'canceled' : message, AxiosError.ERR_CANCELED, config, request]); - _this.name = 'CanceledError'; - _this.__CANCEL__ = true; - return _this; - } - _inherits(CanceledError, _AxiosError); - return _createClass(CanceledError); - }(AxiosError); - - /** - * Resolve or reject a Promise based on response status. - * - * @param {Function} resolve A function that resolves the promise. - * @param {Function} reject A function that rejects the promise. - * @param {object} response The response. - * - * @returns {object} The response. - */ - function settle(resolve, reject, response) { - var validateStatus = response.config.validateStatus; - if (!response.status || !validateStatus || validateStatus(response.status)) { - resolve(response); - } else { - reject(new AxiosError('Request failed with status code ' + response.status, response.status >= 400 && response.status < 500 ? AxiosError.ERR_BAD_REQUEST : AxiosError.ERR_BAD_RESPONSE, response.config, response.request, response)); - } - } - - function parseProtocol(url) { - var match = /^([-+\w]{1,25}):(?:\/\/)?/.exec(url); - return match && match[1] || ''; - } - - /** - * Calculate data maxRate - * @param {Number} [samplesCount= 10] - * @param {Number} [min= 1000] - * @returns {Function} - */ - function speedometer(samplesCount, min) { - samplesCount = samplesCount || 10; - var bytes = new Array(samplesCount); - var timestamps = new Array(samplesCount); - var head = 0; - var tail = 0; - var firstSampleTS; - min = min !== undefined ? min : 1000; - return function push(chunkLength) { - var now = Date.now(); - var startedAt = timestamps[tail]; - if (!firstSampleTS) { - firstSampleTS = now; - } - bytes[head] = chunkLength; - timestamps[head] = now; - var i = tail; - var bytesCount = 0; - while (i !== head) { - bytesCount += bytes[i++]; - i = i % samplesCount; - } - head = (head + 1) % samplesCount; - if (head === tail) { - tail = (tail + 1) % samplesCount; - } - if (now - firstSampleTS < min) { - return; - } - var passed = startedAt && now - startedAt; - return passed ? Math.round(bytesCount * 1000 / passed) : undefined; - }; - } - - /** - * Throttle decorator - * @param {Function} fn - * @param {Number} freq - * @return {Function} - */ - function throttle(fn, freq) { - var timestamp = 0; - var threshold = 1000 / freq; - var lastArgs; - var timer; - var invoke = function invoke(args) { - var now = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : Date.now(); - timestamp = now; - lastArgs = null; - if (timer) { - clearTimeout(timer); - timer = null; - } - fn.apply(void 0, _toConsumableArray(args)); - }; - var throttled = function throttled() { - var now = Date.now(); - var passed = now - timestamp; - for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { - args[_key] = arguments[_key]; - } - if (passed >= threshold) { - invoke(args, now); - } else { - lastArgs = args; - if (!timer) { - timer = setTimeout(function () { - timer = null; - invoke(lastArgs); - }, threshold - passed); - } - } - }; - var flush = function flush() { - return lastArgs && invoke(lastArgs); - }; - return [throttled, flush]; - } - - var progressEventReducer = function progressEventReducer(listener, isDownloadStream) { - var freq = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 3; - var bytesNotified = 0; - var _speedometer = speedometer(50, 250); - return throttle(function (e) { - if (!e || typeof e.loaded !== 'number') { - return; - } - var rawLoaded = e.loaded; - var total = e.lengthComputable ? e.total : undefined; - var loaded = Math.max(0, total != null ? Math.min(rawLoaded, total) : rawLoaded); - var progressBytes = Math.max(0, loaded - bytesNotified); - var rate = _speedometer(progressBytes); - bytesNotified = Math.max(bytesNotified, loaded); - var data = _defineProperty({ - loaded: loaded, - total: total, - progress: total ? loaded / total : undefined, - bytes: progressBytes, - rate: rate ? rate : undefined, - estimated: rate && total ? (total - loaded) / rate : undefined, - event: e, - lengthComputable: total != null - }, isDownloadStream ? 'download' : 'upload', true); - listener(data); - }, freq); - }; - var progressEventDecorator = function progressEventDecorator(total, throttled) { - var lengthComputable = total != null; - return [function (loaded) { - return throttled[0]({ - lengthComputable: lengthComputable, - total: total, - loaded: loaded - }); - }, throttled[1]]; - }; - var asyncDecorator = function asyncDecorator(fn) { - var scheduler = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : utils$1.asap; - return function () { - for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { - args[_key] = arguments[_key]; - } - return scheduler(function () { - return fn.apply(void 0, args); - }); - }; - }; - - var isURLSameOrigin = platform.hasStandardBrowserEnv ? function (origin, isMSIE) { - return function (url) { - url = new URL(url, platform.origin); - return origin.protocol === url.protocol && origin.host === url.host && (isMSIE || origin.port === url.port); - }; - }(new URL(platform.origin), platform.navigator && /(msie|trident)/i.test(platform.navigator.userAgent)) : function () { - return true; - }; - - var cookies = platform.hasStandardBrowserEnv ? - // Standard browser envs support document.cookie - { - write: function write(name, value, expires, path, domain, secure, sameSite) { - if (typeof document === 'undefined') return; - var cookie = ["".concat(name, "=").concat(encodeURIComponent(value))]; - if (utils$1.isNumber(expires)) { - cookie.push("expires=".concat(new Date(expires).toUTCString())); - } - if (utils$1.isString(path)) { - cookie.push("path=".concat(path)); - } - if (utils$1.isString(domain)) { - cookie.push("domain=".concat(domain)); - } - if (secure === true) { - cookie.push('secure'); - } - if (utils$1.isString(sameSite)) { - cookie.push("SameSite=".concat(sameSite)); - } - document.cookie = cookie.join('; '); - }, - read: function read(name) { - if (typeof document === 'undefined') return null; - // Match name=value by splitting on the semicolon separator instead of building a - // RegExp from `name` — interpolating an unescaped string into a RegExp would let - // metacharacters (e.g. `.+?` in an attacker-influenced cookie name) cause ReDoS or - // match the wrong cookie. Browsers may serialize cookie pairs as either ";" or - // "; ", so ignore optional whitespace before each cookie name. - var cookies = document.cookie.split(';'); - for (var i = 0; i < cookies.length; i++) { - var cookie = cookies[i].replace(/^\s+/, ''); - var eq = cookie.indexOf('='); - if (eq !== -1 && cookie.slice(0, eq) === name) { - try { - return decodeURIComponent(cookie.slice(eq + 1)); - } catch (e) { - return cookie.slice(eq + 1); - } - } - } - return null; - }, - remove: function remove(name) { - this.write(name, '', Date.now() - 86400000, '/'); - } - } : - // Non-standard browser env (web workers, react-native) lack needed support. - { - write: function write() {}, - read: function read() { - return null; - }, - remove: function remove() {} - }; - - /** - * Determines whether the specified URL is absolute - * - * @param {string} url The URL to test - * - * @returns {boolean} True if the specified URL is absolute, otherwise false - */ - function isAbsoluteURL(url) { - // A URL is considered absolute if it begins with "://" or "//" (protocol-relative URL). - // RFC 3986 defines scheme name as a sequence of characters beginning with a letter and followed - // by any combination of letters, digits, plus, period, or hyphen. - if (typeof url !== 'string') { - return false; - } - return /^([a-z][a-z\d+\-.]*:)?\/\//i.test(url); - } - - /** - * Creates a new URL by combining the specified URLs - * - * @param {string} baseURL The base URL - * @param {string} relativeURL The relative URL - * - * @returns {string} The combined URL - */ - function combineURLs(baseURL, relativeURL) { - if (!relativeURL) { - return baseURL; - } - var end = baseURL.length; - while (end > 0 && baseURL.charCodeAt(end - 1) === 47) { - end--; - } - return baseURL.slice(0, end) + '/' + relativeURL.replace(/^\/+/, ''); - } - - var malformedHttpProtocol = /^https?:(?!\/\/)/i; - var httpProtocolControlCharacters = /[\t\n\r]/g; - function stripLeadingC0ControlOrSpace(url) { - var i = 0; - while (i < url.length && url.charCodeAt(i) <= 0x20) { - i++; - } - return url.slice(i); - } - function normalizeURLForProtocolCheck(url) { - return stripLeadingC0ControlOrSpace(url).replace(httpProtocolControlCharacters, ''); - } - - // Redact the parts of a URL that can carry secrets before it is embedded in an - // error message. AxiosError.toJSON() serializes `message` verbatim and errors - // are commonly logged, while the opt-in `config.redact` model only cleans - // config keys — it cannot reach the message. Redact only the genuinely - // sensitive substrings — userinfo (credentials), query parameter values and - // fragment contents — with the same REDACTED marker the config redaction uses, - // while keeping the scheme, host, path and parameter names so the offending - // request stays accurately identifiable. - function redactFragment(fragment) { - if (!fragment) { - return fragment; - } - return fragment.replace(/(^|&)([^=&]*=)?[^&]+/g, function (match, separator) { - var parameterName = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : ''; - return "".concat(separator).concat(parameterName).concat(REDACTED); - }); - } - function redactSensitiveURLParts(url) { - var redactedURL = url.replace(/^(https?:\/{0,2})[^/?#]*@/i, "$1".concat(REDACTED, "@")); - var fragmentIndex = redactedURL.indexOf('#'); - var urlWithoutFragment = fragmentIndex === -1 ? redactedURL : redactedURL.slice(0, fragmentIndex); - var redactedURLWithoutFragment = urlWithoutFragment.replace(/([?&][^=&#]*=)[^&#]*/g, "$1".concat(REDACTED)); - if (fragmentIndex === -1) { - return redactedURLWithoutFragment; - } - return "".concat(redactedURLWithoutFragment, "#").concat(redactFragment(redactedURL.slice(fragmentIndex + 1))); - } - function assertValidHttpProtocolURL(url, config) { - if (typeof url === 'string') { - var normalizedURL = normalizeURLForProtocolCheck(url); - if (malformedHttpProtocol.test(normalizedURL)) { - throw new AxiosError("Invalid URL ".concat(JSON.stringify(redactSensitiveURLParts(normalizedURL)), ": missing \"//\" after protocol"), AxiosError.ERR_INVALID_URL, config); - } - } - } - - /** - * Creates a new URL by combining the baseURL with the requestedURL, - * only when the requestedURL is not already an absolute URL. - * If the requestURL is absolute, this function returns the requestedURL untouched. - * - * @param {string} baseURL The base URL - * @param {string} requestedURL Absolute or relative URL to combine - * - * @returns {string} The combined full path - */ - function buildFullPath(baseURL, requestedURL, allowAbsoluteUrls, config) { - assertValidHttpProtocolURL(requestedURL, config); - var isRelativeUrl = !isAbsoluteURL(requestedURL); - if (baseURL && (isRelativeUrl || allowAbsoluteUrls === false)) { - assertValidHttpProtocolURL(baseURL, config); - return combineURLs(baseURL, requestedURL); - } - return requestedURL; - } - - var headersToObject = function headersToObject(thing) { - return thing instanceof AxiosHeaders ? _objectSpread2({}, thing) : thing; - }; - var ownEnumerableKeys = function ownEnumerableKeys(thing) { - if (Object.getOwnPropertySymbols && Object.getOwnPropertyDescriptor) { - return Object.keys(thing).concat(Object.getOwnPropertySymbols(thing).filter(function (symbol) { - return Object.getOwnPropertyDescriptor(thing, symbol).enumerable; - })); - } - return Object.keys(thing); - }; - - /** - * Config-specific merge-function which creates a new config-object - * by merging two configuration objects together. - * - * @param {Object} config1 - * @param {Object} config2 - * - * @returns {Object} New object resulting from merging config2 to config1 - */ - function mergeConfig(config1, config2) { - // eslint-disable-next-line no-param-reassign - config1 = config1 || {}; - config2 = config2 || {}; - - // Use a null-prototype object so that downstream reads such as `config.auth` - // or `config.baseURL` cannot inherit polluted values from Object.prototype. - // `hasOwnProperty` is restored as a non-enumerable own slot to preserve - // ergonomics for user code that relies on it. - var config = Object.create(null); - Object.defineProperty(config, 'hasOwnProperty', { - // Null-proto descriptor so a polluted Object.prototype.get cannot turn - // this data descriptor into an accessor descriptor on the way in. - __proto__: null, - value: Object.prototype.hasOwnProperty, - enumerable: false, - writable: true, - configurable: true - }); - function getMergedValue(target, source, prop, caseless) { - if (utils$1.isPlainObject(target) && utils$1.isPlainObject(source)) { - return utils$1.merge.call({ - caseless: caseless - }, target, source); - } else if (utils$1.isPlainObject(source)) { - return utils$1.merge({}, source); - } else if (utils$1.isArray(source)) { - return source.slice(); - } - return source; - } - function mergeDeepProperties(a, b, prop, caseless) { - if (!utils$1.isUndefined(b)) { - return getMergedValue(a, b, prop, caseless); - } else if (!utils$1.isUndefined(a)) { - return getMergedValue(undefined, a, prop, caseless); - } - } - - // eslint-disable-next-line consistent-return - function valueFromConfig2(a, b) { - if (!utils$1.isUndefined(b)) { - return getMergedValue(undefined, b); - } - } - - // eslint-disable-next-line consistent-return - function defaultToConfig2(a, b) { - if (!utils$1.isUndefined(b)) { - return getMergedValue(undefined, b); - } else if (!utils$1.isUndefined(a)) { - return getMergedValue(undefined, a); - } - } - function getMergedTransitionalOption(prop) { - var transitional2 = utils$1.hasOwnProp(config2, 'transitional') ? config2.transitional : undefined; - if (!utils$1.isUndefined(transitional2)) { - if (utils$1.isPlainObject(transitional2)) { - if (utils$1.hasOwnProp(transitional2, prop)) { - return transitional2[prop]; - } - } else { - return undefined; - } - } - var transitional1 = utils$1.hasOwnProp(config1, 'transitional') ? config1.transitional : undefined; - if (utils$1.isPlainObject(transitional1) && utils$1.hasOwnProp(transitional1, prop)) { - return transitional1[prop]; - } - return undefined; - } - - // eslint-disable-next-line consistent-return - function mergeDirectKeys(a, b, prop) { - if (utils$1.hasOwnProp(config2, prop)) { - return getMergedValue(a, b); - } else if (utils$1.hasOwnProp(config1, prop)) { - return getMergedValue(undefined, a); - } - } - var mergeMap = { - url: valueFromConfig2, - method: valueFromConfig2, - data: valueFromConfig2, - baseURL: defaultToConfig2, - transformRequest: defaultToConfig2, - transformResponse: defaultToConfig2, - paramsSerializer: defaultToConfig2, - timeout: defaultToConfig2, - timeoutMessage: defaultToConfig2, - withCredentials: defaultToConfig2, - withXSRFToken: defaultToConfig2, - adapter: defaultToConfig2, - responseType: defaultToConfig2, - xsrfCookieName: defaultToConfig2, - xsrfHeaderName: defaultToConfig2, - onUploadProgress: defaultToConfig2, - onDownloadProgress: defaultToConfig2, - decompress: defaultToConfig2, - maxContentLength: defaultToConfig2, - maxBodyLength: defaultToConfig2, - beforeRedirect: defaultToConfig2, - transport: defaultToConfig2, - httpAgent: defaultToConfig2, - httpsAgent: defaultToConfig2, - cancelToken: defaultToConfig2, - socketPath: defaultToConfig2, - allowedSocketPaths: defaultToConfig2, - responseEncoding: defaultToConfig2, - validateStatus: mergeDirectKeys, - headers: function headers(a, b, prop) { - return mergeDeepProperties(headersToObject(a), headersToObject(b), prop, true); - } - }; - utils$1.forEach(ownEnumerableKeys(_objectSpread2(_objectSpread2({}, config1), config2)), function computeConfigValue(prop) { - if (prop === '__proto__' || prop === 'constructor' || prop === 'prototype') return; - var merge = utils$1.hasOwnProp(mergeMap, prop) ? mergeMap[prop] : mergeDeepProperties; - var a = utils$1.hasOwnProp(config1, prop) ? config1[prop] : undefined; - var b = utils$1.hasOwnProp(config2, prop) ? config2[prop] : undefined; - var configValue = merge(a, b, prop); - utils$1.isUndefined(configValue) && merge !== mergeDirectKeys || (config[prop] = configValue); - }); - if (utils$1.hasOwnProp(config2, 'validateStatus') && utils$1.isUndefined(config2.validateStatus) && getMergedTransitionalOption('validateStatusUndefinedResolves') === false) { - if (utils$1.hasOwnProp(config1, 'validateStatus')) { - config.validateStatus = getMergedValue(undefined, config1.validateStatus); - } else { - delete config.validateStatus; - } - } - return config; - } - - var FORM_DATA_CONTENT_HEADERS = ['content-type', 'content-length']; - - /** - * Apply the headers generated by a FormData implementation to the request headers, - * honoring the `formDataHeaderPolicy` option: with 'content-only', copy only the - * content-* headers; otherwise merge all of them. - * - * @param {AxiosHeaders} headers - the request headers to mutate - * @param {Object | null | undefined} formHeaders - headers produced by the FormData implementation - * @param {String} [policy] - the resolved `formDataHeaderPolicy` config value - * - * @returns {void} - */ - function setFormDataHeaders(headers, formHeaders, policy) { - if (policy !== 'content-only') { - headers.set(formHeaders); - return; - } - Object.entries(formHeaders || {}).forEach(function (_ref) { - var _ref2 = _slicedToArray(_ref, 2), - key = _ref2[0], - val = _ref2[1]; - if (FORM_DATA_CONTENT_HEADERS.includes(key.toLowerCase())) { - headers.set(key, val); - } - }); - } - - /** - * Encode a UTF-8 string to a Latin-1 byte string for use with btoa(). - * This is a modern replacement for the deprecated unescape(encodeURIComponent(str)) pattern. - * - * @param {string} str The string to encode - * - * @returns {string} UTF-8 bytes as a Latin-1 string - */ - var encodeUTF8$1 = function encodeUTF8(str) { - return encodeURIComponent(str).replace(/%([0-9A-F]{2})/gi, function (_, hex) { - return String.fromCharCode(parseInt(hex, 16)); - }); - }; - function resolveConfig(config) { - var newConfig = mergeConfig({}, config); - - // Read only own properties to prevent prototype pollution gadgets - // (e.g. Object.prototype.baseURL = 'https://evil.com'). - var own = function own(key) { - return utils$1.hasOwnProp(newConfig, key) ? newConfig[key] : undefined; - }; - var data = own('data'); - var withXSRFToken = own('withXSRFToken'); - var xsrfHeaderName = own('xsrfHeaderName'); - var xsrfCookieName = own('xsrfCookieName'); - var headers = own('headers'); - var auth = own('auth'); - var baseURL = own('baseURL'); - var allowAbsoluteUrls = own('allowAbsoluteUrls'); - var url = own('url'); - newConfig.headers = headers = AxiosHeaders.from(headers); - newConfig.url = buildURL(buildFullPath(baseURL, url, allowAbsoluteUrls, newConfig), own('params'), own('paramsSerializer')); - - // HTTP basic authentication - if (auth) { - var username = utils$1.getSafeProp(auth, 'username') || ''; - var password = utils$1.getSafeProp(auth, 'password') || ''; - try { - headers.set('Authorization', 'Basic ' + btoa(username + ':' + (password ? encodeUTF8$1(password) : ''))); - } catch (e) { - throw AxiosError.from(e, AxiosError.ERR_BAD_OPTION_VALUE, config); - } - } - if (utils$1.isFormData(data)) { - if (platform.hasStandardBrowserEnv || platform.hasStandardBrowserWebWorkerEnv || utils$1.isReactNative(data)) { - headers.setContentType(undefined); // browser/web worker/RN handles it - } else if (utils$1.isFunction(data.getHeaders)) { - // Node.js FormData (like form-data package) - setFormDataHeaders(headers, data.getHeaders(), own('formDataHeaderPolicy')); - } - } - - // Add xsrf header - // This is only done if running in a standard browser environment. - // Specifically not if we're in a web worker, or react-native. - - if (platform.hasStandardBrowserEnv) { - if (utils$1.isFunction(withXSRFToken)) { - withXSRFToken = withXSRFToken(newConfig); - } - - // Strict boolean check — prevents proto-pollution gadgets (e.g. Object.prototype.withXSRFToken = 1) - // and misconfigurations (e.g. "false") from short-circuiting the same-origin check and leaking - // the XSRF token cross-origin. - var shouldSendXSRF = withXSRFToken === true || withXSRFToken == null && isURLSameOrigin(newConfig.url); - if (shouldSendXSRF) { - var xsrfValue = xsrfHeaderName && xsrfCookieName && cookies.read(xsrfCookieName); - if (xsrfValue) { - headers.set(xsrfHeaderName, xsrfValue); - } - } - } - return newConfig; - } - - var isXHRAdapterSupported = typeof XMLHttpRequest !== 'undefined'; - var xhrAdapter = isXHRAdapterSupported && function (config) { - return new Promise(function dispatchXhrRequest(resolve, reject) { - var _config = resolveConfig(config); - var requestData = _config.data; - var requestHeaders = AxiosHeaders.from(_config.headers).normalize(); - var responseType = _config.responseType, - onUploadProgress = _config.onUploadProgress, - onDownloadProgress = _config.onDownloadProgress; - var onCanceled; - var uploadThrottled, downloadThrottled; - var flushUpload, flushDownload; - function done() { - flushUpload && flushUpload(); // flush events - flushDownload && flushDownload(); // flush events - - _config.cancelToken && _config.cancelToken.unsubscribe(onCanceled); - _config.signal && _config.signal.removeEventListener('abort', onCanceled); - } - var request = new XMLHttpRequest(); - request.open(_config.method.toUpperCase(), _config.url, true); - - // Set the request timeout in MS - request.timeout = _config.timeout; - function onloadend() { - if (!request) { - return; - } - // Prepare the response - var responseHeaders = AxiosHeaders.from('getAllResponseHeaders' in request && request.getAllResponseHeaders()); - var responseData = !responseType || responseType === 'text' || responseType === 'json' ? request.responseText : request.response; - var response = { - data: responseData, - status: request.status, - statusText: request.statusText, - headers: responseHeaders, - config: config, - request: request - }; - settle(function _resolve(value) { - resolve(value); - done(); - }, function _reject(err) { - reject(err); - done(); - }, response); - - // Clean up request - request = null; - } - if ('onloadend' in request) { - // Use onloadend if available - request.onloadend = onloadend; - } else { - // Listen for ready state to emulate onloadend - request.onreadystatechange = function handleLoad() { - if (!request || request.readyState !== 4) { - return; - } - - // The request errored out and we didn't get a response, this will be - // handled by onerror instead - // With one exception: request that using file: protocol, most browsers - // will return status as 0 even though it's a successful request - if (request.status === 0 && !(request.responseURL && request.responseURL.startsWith('file:'))) { - return; - } - // readystate handler is calling before onerror or ontimeout handlers, - // so we should call onloadend on the next 'tick' - setTimeout(onloadend); - }; - } - - // Handle browser request cancellation (as opposed to a manual cancellation) - request.onabort = function handleAbort() { - if (!request) { - return; - } - reject(new AxiosError('Request aborted', AxiosError.ECONNABORTED, config, request)); - done(); - - // Clean up request - request = null; - }; - - // Handle low level network errors - request.onerror = function handleError(event) { - // Browsers deliver a ProgressEvent in XHR onerror - // (message may be empty; when present, surface it) - // See https://developer.mozilla.org/docs/Web/API/XMLHttpRequest/error_event - var msg = event && event.message ? event.message : 'Network Error'; - var err = new AxiosError(msg, AxiosError.ERR_NETWORK, config, request); - // attach the underlying event for consumers who want details - err.event = event || null; - reject(err); - done(); - request = null; - }; - - // Handle timeout - request.ontimeout = function handleTimeout() { - var timeoutErrorMessage = _config.timeout ? 'timeout of ' + _config.timeout + 'ms exceeded' : 'timeout exceeded'; - var transitional = _config.transitional || transitionalDefaults; - if (_config.timeoutErrorMessage) { - timeoutErrorMessage = _config.timeoutErrorMessage; - } - reject(new AxiosError(timeoutErrorMessage, transitional.clarifyTimeoutError ? AxiosError.ETIMEDOUT : AxiosError.ECONNABORTED, config, request)); - done(); - - // Clean up request - request = null; - }; - - // Remove Content-Type if data is undefined - requestData === undefined && requestHeaders.setContentType(null); - - // Add headers to the request - if ('setRequestHeader' in request) { - utils$1.forEach(toByteStringHeaderObject(requestHeaders), function setRequestHeader(val, key) { - request.setRequestHeader(key, val); - }); - } - - // Add withCredentials to request if needed - if (!utils$1.isUndefined(_config.withCredentials)) { - request.withCredentials = !!_config.withCredentials; - } - - // Add responseType to request if needed - if (responseType && responseType !== 'json') { - request.responseType = _config.responseType; - } - - // Handle progress if needed - if (onDownloadProgress) { - var _progressEventReducer = progressEventReducer(onDownloadProgress, true); - var _progressEventReducer2 = _slicedToArray(_progressEventReducer, 2); - downloadThrottled = _progressEventReducer2[0]; - flushDownload = _progressEventReducer2[1]; - request.addEventListener('progress', downloadThrottled); - } - - // Not all browsers support upload events - if (onUploadProgress && request.upload) { - var _progressEventReducer3 = progressEventReducer(onUploadProgress); - var _progressEventReducer4 = _slicedToArray(_progressEventReducer3, 2); - uploadThrottled = _progressEventReducer4[0]; - flushUpload = _progressEventReducer4[1]; - request.upload.addEventListener('progress', uploadThrottled); - request.upload.addEventListener('loadend', flushUpload); - } - if (_config.cancelToken || _config.signal) { - // Handle cancellation - // eslint-disable-next-line func-names - onCanceled = function onCanceled(cancel) { - if (!request) { - return; - } - reject(!cancel || cancel.type ? new CanceledError(null, config, request) : cancel); - request.abort(); - done(); - request = null; - }; - _config.cancelToken && _config.cancelToken.subscribe(onCanceled); - if (_config.signal) { - _config.signal.aborted ? onCanceled() : _config.signal.addEventListener('abort', onCanceled); - } - } - var protocol = parseProtocol(_config.url); - if (protocol && !platform.protocols.includes(protocol)) { - reject(new AxiosError('Unsupported protocol ' + protocol + ':', AxiosError.ERR_BAD_REQUEST, config)); - done(); - return; - } - - // Send the request - request.send(requestData || null); - }); - }; - - var composeSignals = function composeSignals(signals, timeout) { - signals = signals ? signals.filter(Boolean) : []; - if (!timeout && !signals.length) { - return; - } - var controller = new AbortController(); - var aborted = false; - var onabort = function onabort(reason) { - if (!aborted) { - aborted = true; - unsubscribe(); - var err = reason instanceof Error ? reason : this.reason; - controller.abort(err instanceof AxiosError ? err : new CanceledError(err instanceof Error ? err.message : err)); - } - }; - var timer = timeout && setTimeout(function () { - timer = null; - onabort(new AxiosError("timeout of ".concat(timeout, "ms exceeded"), AxiosError.ETIMEDOUT)); - }, timeout); - var unsubscribe = function unsubscribe() { - if (!signals) { - return; - } - timer && clearTimeout(timer); - timer = null; - signals.forEach(function (signal) { - signal.unsubscribe ? signal.unsubscribe(onabort) : signal.removeEventListener('abort', onabort); - }); - signals = null; - }; - signals.forEach(function (signal) { - if (aborted) { - return; - } - if (signal.aborted) { - onabort.call(signal); - return; - } - signal.addEventListener('abort', onabort, { - once: true - }); - }); - var signal = controller.signal; - signal.unsubscribe = function () { - return utils$1.asap(unsubscribe); - }; - return signal; - }; - - var streamChunk = /*#__PURE__*/_regenerator().m(function streamChunk(chunk, chunkSize) { - var len, pos, end; - return _regenerator().w(function (_context) { - while (1) switch (_context.n) { - case 0: - len = chunk.byteLength; - if (!(!chunkSize || len < chunkSize)) { - _context.n = 2; - break; - } - _context.n = 1; - return chunk; - case 1: - return _context.a(2); - case 2: - pos = 0; - case 3: - if (!(pos < len)) { - _context.n = 5; - break; - } - end = pos + chunkSize; - _context.n = 4; - return chunk.slice(pos, end); - case 4: - pos = end; - _context.n = 3; - break; - case 5: - return _context.a(2); - } - }, streamChunk); - }); - var readBytes = /*#__PURE__*/function () { - var _ref = _wrapAsyncGenerator(/*#__PURE__*/_regenerator().m(function _callee(iterable, chunkSize) { - var _iteratorAbruptCompletion, _didIteratorError, _iteratorError, _iterator, _step, chunk, _t; - return _regenerator().w(function (_context2) { - while (1) switch (_context2.p = _context2.n) { - case 0: - _iteratorAbruptCompletion = false; - _didIteratorError = false; - _context2.p = 1; - _iterator = _asyncIterator(readStream(iterable)); - case 2: - _context2.n = 3; - return _awaitAsyncGenerator(_iterator.next()); - case 3: - if (!(_iteratorAbruptCompletion = !(_step = _context2.v).done)) { - _context2.n = 5; - break; - } - chunk = _step.value; - return _context2.d(_regeneratorValues(_asyncGeneratorDelegate(_asyncIterator(streamChunk(chunk, chunkSize)))), 4); - case 4: - _iteratorAbruptCompletion = false; - _context2.n = 2; - break; - case 5: - _context2.n = 7; - break; - case 6: - _context2.p = 6; - _t = _context2.v; - _didIteratorError = true; - _iteratorError = _t; - case 7: - _context2.p = 7; - _context2.p = 8; - if (!(_iteratorAbruptCompletion && _iterator["return"] != null)) { - _context2.n = 9; - break; - } - _context2.n = 9; - return _awaitAsyncGenerator(_iterator["return"]()); - case 9: - _context2.p = 9; - if (!_didIteratorError) { - _context2.n = 10; - break; - } - throw _iteratorError; - case 10: - return _context2.f(9); - case 11: - return _context2.f(7); - case 12: - return _context2.a(2); - } - }, _callee, null, [[8,, 9, 11], [1, 6, 7, 12]]); - })); - return function readBytes(_x, _x2) { - return _ref.apply(this, arguments); - }; - }(); - var readStream = /*#__PURE__*/function () { - var _ref2 = _wrapAsyncGenerator(/*#__PURE__*/_regenerator().m(function _callee2(stream) { - var reader, _yield$_awaitAsyncGen, done, value; - return _regenerator().w(function (_context3) { - while (1) switch (_context3.p = _context3.n) { - case 0: - if (!stream[Symbol.asyncIterator]) { - _context3.n = 2; - break; - } - return _context3.d(_regeneratorValues(_asyncGeneratorDelegate(_asyncIterator(stream))), 1); - case 1: - return _context3.a(2); - case 2: - reader = stream.getReader(); - _context3.p = 3; - case 4: - _context3.n = 5; - return _awaitAsyncGenerator(reader.read()); - case 5: - _yield$_awaitAsyncGen = _context3.v; - done = _yield$_awaitAsyncGen.done; - value = _yield$_awaitAsyncGen.value; - if (!done) { - _context3.n = 6; - break; - } - return _context3.a(3, 8); - case 6: - _context3.n = 7; - return value; - case 7: - _context3.n = 4; - break; - case 8: - _context3.p = 8; - _context3.n = 9; - return _awaitAsyncGenerator(reader.cancel()); - case 9: - return _context3.f(8); - case 10: - return _context3.a(2); - } - }, _callee2, null, [[3,, 8, 10]]); - })); - return function readStream(_x3) { - return _ref2.apply(this, arguments); - }; - }(); - var trackStream = function trackStream(stream, chunkSize, onProgress, onFinish) { - var iterator = readBytes(stream, chunkSize); - var bytes = 0; - var done; - var _onFinish = function _onFinish(e) { - if (!done) { - done = true; - onFinish && onFinish(e); - } - }; - return new ReadableStream({ - pull: function pull(controller) { - return _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee3() { - var _yield$iterator$next, _done, value, len, loadedBytes, _t2; - return _regenerator().w(function (_context4) { - while (1) switch (_context4.p = _context4.n) { - case 0: - _context4.p = 0; - _context4.n = 1; - return iterator.next(); - case 1: - _yield$iterator$next = _context4.v; - _done = _yield$iterator$next.done; - value = _yield$iterator$next.value; - if (!_done) { - _context4.n = 2; - break; - } - _onFinish(); - controller.close(); - return _context4.a(2); - case 2: - len = value.byteLength; - if (onProgress) { - loadedBytes = bytes += len; - onProgress(loadedBytes); - } - controller.enqueue(new Uint8Array(value)); - _context4.n = 4; - break; - case 3: - _context4.p = 3; - _t2 = _context4.v; - _onFinish(_t2); - throw _t2; - case 4: - return _context4.a(2); - } - }, _callee3, null, [[0, 3]]); - }))(); - }, - cancel: function cancel(reason) { - _onFinish(reason); - return iterator["return"](); - } - }, { - highWaterMark: 2 - }); - }; - - /** - * Estimate data: URL byte lengths *without* allocating large buffers. - * - Fetch percent-decodes a base64 body before decoding it. - * - Node's Buffer.from(body, 'base64') sizes its backing allocation from the - * raw body, including ignored characters and content after padding. - * - Non-base64 data is percent-decoded and then encoded as UTF-8. - */ - var isHexDigit = function isHexDigit(charCode) { - return charCode >= 48 && charCode <= 57 || charCode >= 65 && charCode <= 70 || charCode >= 97 && charCode <= 102; - }; - var isPercentEncodedByte = function isPercentEncodedByte(str, i, len) { - return i + 2 < len && isHexDigit(str.charCodeAt(i + 1)) && isHexDigit(str.charCodeAt(i + 2)); - }; - var hexValue = function hexValue(charCode) { - return charCode <= 57 ? charCode - 48 : (charCode & 0xdf) - 55; - }; - var isBase64Char = function isBase64Char(charCode) { - return charCode >= 65 && charCode <= 90 || - // A-Z - charCode >= 97 && charCode <= 122 || - // a-z - charCode >= 48 && charCode <= 57 || - // 0-9 - charCode === 43 || - // + - charCode === 47 || - // / - charCode === 45 || - // - (base64url) - charCode === 95; - }; // _ (base64url) - - var isBase64Whitespace = function isBase64Whitespace(charCode) { - return charCode === 9 || charCode === 10 || charCode === 12 || charCode === 13 || charCode === 32; - }; - var base64Bytes = function base64Bytes(significant) { - var groups = Math.floor(significant / 4); - var remainder = significant % 4; - return groups * 3 + (remainder === 2 ? 1 : remainder === 3 ? 2 : 0); - }; - - // Buffer.byteLength(body, 'base64') uses the raw string length as an allocation - // upper bound even when Buffer.from later ignores characters or stops at '='. - var estimateBase64BufferAllocation = function estimateBase64BufferAllocation(body) { - var len = body.length; - var padding = 0; - if (len > 0 && body.charCodeAt(len - 1) === 61 /* '=' */) { - padding++; - if (len > 1 && body.charCodeAt(len - 2) === 61 /* '=' */) { - padding++; - } - } - return Math.floor((len - padding) * 3 / 4); - }; - var estimatePercentDecodedBase64Bytes = function estimatePercentDecodedBase64Bytes(body) { - var len = body.length; - var significant = 0; - var padding = 0; - var invalid = false; - for (var i = 0; i < len; i++) { - var code = body.charCodeAt(i); - if (code === 37 /* '%' */ && isPercentEncodedByte(body, i, len)) { - code = hexValue(body.charCodeAt(i + 1)) * 16 + hexValue(body.charCodeAt(i + 2)); - i += 2; - } - if (isBase64Whitespace(code)) { - continue; - } - if (code === 61 /* '=' */) { - padding++; - continue; - } - if (!isBase64Char(code) || padding > 0) { - invalid = true; - continue; - } - significant++; - } - - // Fetch rejects malformed forgiving-base64 input. Returning the raw-size - // allocation bound keeps that invalid input from becoming a pre-check bypass. - if (invalid || padding > 2 || padding > 0 && (significant + padding) % 4 !== 0 || significant % 4 === 1) { - return estimateBase64BufferAllocation(body); - } - return base64Bytes(significant); - }; - var estimateDataURLBytes = function estimateDataURLBytes(url, estimateBase64) { - if (!url || typeof url !== 'string') return 0; - if (!url.startsWith('data:')) return 0; - var comma = url.indexOf(','); - if (comma < 0) return 0; - var meta = url.slice(5, comma); - var body = url.slice(comma + 1); - var isBase64 = /;base64/i.test(meta); - if (isBase64) { - return estimateBase64(body); - } - - // Compute UTF-8 byte length directly from UTF-16 code units without allocating - // a byte buffer (TextEncoder.encode would defeat the DoS guard on large bodies). - // Valid %XX triplets count as one decoded byte; this matches the bytes that - // decodeURIComponent(body) would produce before Buffer re-encodes the string. - var bytes = 0; - for (var i = 0, len = body.length; i < len; i++) { - var c = body.charCodeAt(i); - if (c === 37 /* '%' */ && isPercentEncodedByte(body, i, len)) { - bytes += 1; - i += 2; - } else if (c < 0x80) { - bytes += 1; - } else if (c < 0x800) { - bytes += 2; - } else if (c >= 0xd800 && c <= 0xdbff && i + 1 < len) { - var next = body.charCodeAt(i + 1); - if (next >= 0xdc00 && next <= 0xdfff) { - bytes += 4; - i++; - } else { - bytes += 3; - } - } else { - bytes += 3; - } - } - return bytes; - }; - - /** - * Estimate the percent-decoded payload size used by Fetch data: URLs. - * - * @param {string} url - * @returns {number} - */ - function estimateDataURLDecodedBytes(url) { - // Fetch removes URL fragments before processing a data: URL. - var fragmentIndex = typeof url === 'string' ? url.indexOf('#') : -1; - return estimateDataURLBytes(fragmentIndex === -1 ? url : url.slice(0, fragmentIndex), estimatePercentDecodedBase64Bytes); - } - - var VERSION = "1.19.0"; - - var DEFAULT_CHUNK_SIZE = 64 * 1024; - var isFunction = utils$1.isFunction; - - /** - * Encode a UTF-8 string to a Latin-1 byte string for use with btoa(). - * This is a modern replacement for the deprecated unescape(encodeURIComponent(str)) pattern. - * - * @param {string} str The string to encode - * - * @returns {string} UTF-8 bytes as a Latin-1 string - */ - var encodeUTF8 = function encodeUTF8(str) { - return encodeURIComponent(str).replace(/%([0-9A-F]{2})/gi, function (_, hex) { - return String.fromCharCode(parseInt(hex, 16)); - }); - }; - - // Node's WHATWG URL parser returns `username` and `password` percent-encoded. - // Decode before composing the `auth` option so credentials such as - // `my%40email.com:pass` are sent as `my@email.com:pass`. Falls back to the - // original value for malformed input so a bad encoding never throws. - var decodeURIComponentSafe = function decodeURIComponentSafe(value) { - if (!utils$1.isString(value)) { - return value; - } - try { - return decodeURIComponent(value); - } catch (error) { - return value; - } - }; - var test = function test(fn) { - try { - for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { - args[_key - 1] = arguments[_key]; - } - return !!fn.apply(void 0, args); - } catch (e) { - return false; - } - }; - var maybeWithAuthCredentials = function maybeWithAuthCredentials(url) { - var protocolIndex = url.indexOf('://'); - var urlToCheck = url; - if (protocolIndex !== -1) { - urlToCheck = urlToCheck.slice(protocolIndex + 3); - } - return urlToCheck.includes('@') || urlToCheck.includes(':'); - }; - var factory = function factory(env) { - var globalObject = utils$1.global !== undefined && utils$1.global !== null ? utils$1.global : globalThis; - var ReadableStream = globalObject.ReadableStream, - TextEncoder = globalObject.TextEncoder; - env = utils$1.merge.call({ - skipUndefined: true - }, { - Request: globalObject.Request, - Response: globalObject.Response - }, env); - var _env = env, - envFetch = _env.fetch, - Request = _env.Request, - Response = _env.Response; - var isFetchSupported = envFetch ? isFunction(envFetch) : typeof fetch === 'function'; - var isRequestSupported = isFunction(Request); - var isResponseSupported = isFunction(Response); - if (!isFetchSupported) { - return false; - } - var isReadableStreamSupported = isFetchSupported && isFunction(ReadableStream); - var encodeText = isFetchSupported && (typeof TextEncoder === 'function' ? function (encoder) { - return function (str) { - return encoder.encode(str); - }; - }(new TextEncoder()) : (/*#__PURE__*/function () { - var _ref = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee(str) { - var _t, _t2; - return _regenerator().w(function (_context) { - while (1) switch (_context.n) { - case 0: - _t = Uint8Array; - _context.n = 1; - return new Request(str).arrayBuffer(); - case 1: - _t2 = _context.v; - return _context.a(2, new _t(_t2)); - } - }, _callee); - })); - return function (_x) { - return _ref.apply(this, arguments); - }; - }())); - var supportsRequestStream = isRequestSupported && isReadableStreamSupported && test(function () { - var duplexAccessed = false; - var request = new Request(platform.origin, { - body: new ReadableStream(), - method: 'POST', - get duplex() { - duplexAccessed = true; - return 'half'; - } - }); - var hasContentType = request.headers.has('Content-Type'); - if (request.body != null) { - request.body.cancel(); - } - return duplexAccessed && !hasContentType; - }); - var supportsResponseStream = isResponseSupported && isReadableStreamSupported && test(function () { - return utils$1.isReadableStream(new Response('').body); - }); - var resolvers = { - stream: supportsResponseStream && function (res) { - return res.body; - } - }; - isFetchSupported && function () { - ['text', 'arrayBuffer', 'blob', 'formData', 'stream'].forEach(function (type) { - !resolvers[type] && (resolvers[type] = function (res, config) { - var method = res && res[type]; - if (method) { - return method.call(res); - } - throw new AxiosError("Response type '".concat(type, "' is not supported"), AxiosError.ERR_NOT_SUPPORT, config); - }); - }); - }(); - var getBodyLength = /*#__PURE__*/function () { - var _ref2 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee2(body) { - var _request; - return _regenerator().w(function (_context2) { - while (1) switch (_context2.n) { - case 0: - if (!(body == null)) { - _context2.n = 1; - break; - } - return _context2.a(2, 0); - case 1: - if (!utils$1.isBlob(body)) { - _context2.n = 2; - break; - } - return _context2.a(2, body.size); - case 2: - if (!utils$1.isSpecCompliantForm(body)) { - _context2.n = 4; - break; - } - _request = new Request(platform.origin, { - method: 'POST', - body: body - }); - _context2.n = 3; - return _request.arrayBuffer(); - case 3: - return _context2.a(2, _context2.v.byteLength); - case 4: - if (!(utils$1.isArrayBufferView(body) || utils$1.isArrayBuffer(body))) { - _context2.n = 5; - break; - } - return _context2.a(2, body.byteLength); - case 5: - if (utils$1.isURLSearchParams(body)) { - body = body + ''; - } - if (!utils$1.isString(body)) { - _context2.n = 7; - break; - } - _context2.n = 6; - return encodeText(body); - case 6: - return _context2.a(2, _context2.v.byteLength); - case 7: - return _context2.a(2); - } - }, _callee2); - })); - return function getBodyLength(_x2) { - return _ref2.apply(this, arguments); - }; - }(); - var resolveBodyLength = /*#__PURE__*/function () { - var _ref3 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee3(headers, body) { - var length; - return _regenerator().w(function (_context3) { - while (1) switch (_context3.n) { - case 0: - length = utils$1.toFiniteNumber(headers.getContentLength()); - return _context3.a(2, length == null ? getBodyLength(body) : length); - } - }, _callee3); - })); - return function resolveBodyLength(_x3, _x4) { - return _ref3.apply(this, arguments); - }; - }(); - return /*#__PURE__*/function () { - var _ref4 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee4(config) { - var _resolveConfig, url, method, data, signal, cancelToken, timeout, onDownloadProgress, onUploadProgress, responseType, headers, _resolveConfig$withCr, withCredentials, fetchOptions, maxContentLength, maxBodyLength, hasMaxContentLength, hasMaxBodyLength, own, _fetch, composedSignal, request, unsubscribe, requestContentLength, pendingBodyError, maxBodyLengthError, auth, configAuth, username, password, parsedURL, urlUsername, urlPassword, estimated, outboundLength, mustEnforceStreamBody, trackRequestStream, _request, contentTypeHeader, _ref5, _ref6, onProgress, flush, isCredentialsSupported, contentType, resolvedOptions, response, responseHeaders, declaredLength, isStreamResponse, options, responseContentLength, _ref7, _ref8, _onProgress, _flush, bytesRead, onChunkProgress, responseData, materializedSize, canceledError, networkError, _t3, _t4; - return _regenerator().w(function (_context4) { - while (1) switch (_context4.p = _context4.n) { - case 0: - _resolveConfig = resolveConfig(config), url = _resolveConfig.url, method = _resolveConfig.method, data = _resolveConfig.data, signal = _resolveConfig.signal, cancelToken = _resolveConfig.cancelToken, timeout = _resolveConfig.timeout, onDownloadProgress = _resolveConfig.onDownloadProgress, onUploadProgress = _resolveConfig.onUploadProgress, responseType = _resolveConfig.responseType, headers = _resolveConfig.headers, _resolveConfig$withCr = _resolveConfig.withCredentials, withCredentials = _resolveConfig$withCr === void 0 ? 'same-origin' : _resolveConfig$withCr, fetchOptions = _resolveConfig.fetchOptions, maxContentLength = _resolveConfig.maxContentLength, maxBodyLength = _resolveConfig.maxBodyLength; - hasMaxContentLength = utils$1.isNumber(maxContentLength) && maxContentLength > -1; - hasMaxBodyLength = utils$1.isNumber(maxBodyLength) && maxBodyLength > -1; - own = function own(key) { - return utils$1.hasOwnProp(config, key) ? config[key] : undefined; - }; - _fetch = envFetch || fetch; - responseType = responseType ? (responseType + '').toLowerCase() : 'text'; - composedSignal = composeSignals([signal, cancelToken && cancelToken.toAbortSignal()], timeout); - request = null; - unsubscribe = composedSignal && composedSignal.unsubscribe && function () { - composedSignal.unsubscribe(); - }; - // AxiosError we raise while the request body is being streamed. Captured - // by identity so the catch block can surface it directly, regardless of - // how the runtime wraps the resulting fetch rejection (undici exposes it - // as `err.cause`; some browsers drop the original error entirely). - pendingBodyError = null; - maxBodyLengthError = function maxBodyLengthError() { - return new AxiosError('Request body larger than maxBodyLength limit', AxiosError.ERR_BAD_REQUEST, config, request); - }; - _context4.p = 1; - // HTTP basic authentication - auth = undefined; - configAuth = own('auth'); - if (configAuth) { - username = utils$1.getSafeProp(configAuth, 'username') || ''; - password = utils$1.getSafeProp(configAuth, 'password') || ''; - auth = { - username: username, - password: password - }; - } - if (maybeWithAuthCredentials(url)) { - parsedURL = new URL(url, platform.origin); - if (!auth && (parsedURL.username || parsedURL.password)) { - urlUsername = decodeURIComponentSafe(parsedURL.username); - urlPassword = decodeURIComponentSafe(parsedURL.password); - auth = { - username: urlUsername, - password: urlPassword - }; - } - if (parsedURL.username || parsedURL.password) { - parsedURL.username = ''; - parsedURL.password = ''; - url = parsedURL.href; - } - } - if (auth) { - headers["delete"]('authorization'); - headers.set('Authorization', 'Basic ' + btoa(encodeUTF8((auth.username || '') + ':' + (auth.password || '')))); - } - - // Enforce maxContentLength for data: URLs up-front so we never materialize - // an oversized payload. The HTTP adapter applies the same check (see http.js - // "if (protocol === 'data:')" branch). - if (!(hasMaxContentLength && typeof url === 'string' && url.startsWith('data:'))) { - _context4.n = 2; - break; - } - estimated = estimateDataURLDecodedBytes(url); - if (!(estimated > maxContentLength)) { - _context4.n = 2; - break; - } - throw new AxiosError('maxContentLength size of ' + maxContentLength + ' exceeded', AxiosError.ERR_BAD_RESPONSE, config, request); - case 2: - if (!(hasMaxBodyLength && method !== 'get' && method !== 'head')) { - _context4.n = 4; - break; - } - _context4.n = 3; - return getBodyLength(data); - case 3: - outboundLength = _context4.v; - if (!(typeof outboundLength === 'number' && isFinite(outboundLength))) { - _context4.n = 4; - break; - } - requestContentLength = outboundLength; - if (!(outboundLength > maxBodyLength)) { - _context4.n = 4; - break; - } - throw maxBodyLengthError(); - case 4: - // A streamed body under maxBodyLength must be counted as fetch consumes - // it; its size is never trusted from a caller-declared Content-Length. - mustEnforceStreamBody = hasMaxBodyLength && (utils$1.isReadableStream(data) || utils$1.isStream(data)); - trackRequestStream = function trackRequestStream(stream, onProgress, flush) { - return trackStream(stream, DEFAULT_CHUNK_SIZE, function (loadedBytes) { - if (hasMaxBodyLength && loadedBytes > maxBodyLength) { - throw pendingBodyError = maxBodyLengthError(); - } - onProgress && onProgress(loadedBytes); - }, flush); - }; - if (!(supportsRequestStream && method !== 'get' && method !== 'head' && (onUploadProgress || mustEnforceStreamBody))) { - _context4.n = 8; - break; - } - if (!(requestContentLength == null)) { - _context4.n = 6; - break; - } - _context4.n = 5; - return resolveBodyLength(headers, data); - case 5: - _t3 = _context4.v; - _context4.n = 7; - break; - case 6: - _t3 = requestContentLength; - case 7: - requestContentLength = _t3; - // A declared length of 0 is only trusted to skip the wrap when we are - // not enforcing a stream limit (which must not rely on that header). - if (requestContentLength !== 0 || mustEnforceStreamBody) { - _request = new Request(url, { - method: 'POST', - body: data, - duplex: 'half' - }); - if (utils$1.isFormData(data) && (contentTypeHeader = _request.headers.get('content-type'))) { - headers.setContentType(contentTypeHeader); - } - if (_request.body) { - _ref5 = onUploadProgress && progressEventDecorator(requestContentLength, progressEventReducer(asyncDecorator(onUploadProgress))) || [], _ref6 = _slicedToArray(_ref5, 2), onProgress = _ref6[0], flush = _ref6[1]; - data = trackRequestStream(_request.body, onProgress, flush); - } - } - _context4.n = 10; - break; - case 8: - if (!(mustEnforceStreamBody && !isRequestSupported && isReadableStreamSupported && method !== 'get' && method !== 'head')) { - _context4.n = 9; - break; - } - data = trackRequestStream(data); - _context4.n = 10; - break; - case 9: - if (!(mustEnforceStreamBody && isRequestSupported && !supportsRequestStream && method !== 'get' && method !== 'head')) { - _context4.n = 10; - break; - } - throw new AxiosError('Stream request bodies are not supported by the current fetch implementation', AxiosError.ERR_NOT_SUPPORT, config, request); - case 10: - if (!utils$1.isString(withCredentials)) { - withCredentials = withCredentials ? 'include' : 'omit'; - } - - // Cloudflare Workers throws when credentials are defined - // see https://github.com/cloudflare/workerd/issues/902 - isCredentialsSupported = isRequestSupported && 'credentials' in Request.prototype; // If data is FormData and Content-Type is multipart/form-data without boundary, - // delete it so fetch can set it correctly with the boundary - if (utils$1.isFormData(data)) { - contentType = headers.getContentType(); - if (contentType && /^multipart\/form-data/i.test(contentType) && !/boundary=/i.test(contentType)) { - headers["delete"]('content-type'); - } - } - - // Set User-Agent header if not already set (fetch defaults to 'node' in Node.js) - headers.set('User-Agent', 'axios/' + VERSION, false); - resolvedOptions = _objectSpread2(_objectSpread2({}, fetchOptions), {}, { - signal: composedSignal, - method: method.toUpperCase(), - headers: toByteStringHeaderObject(headers.normalize()), - body: data, - duplex: 'half', - credentials: isCredentialsSupported ? withCredentials : undefined - }); - request = isRequestSupported && new Request(url, resolvedOptions); - _context4.n = 11; - return isRequestSupported ? _fetch(request, fetchOptions) : _fetch(url, resolvedOptions); - case 11: - response = _context4.v; - responseHeaders = AxiosHeaders.from(response.headers); // Cheap pre-check: if the server honestly declares a content-length that - // already exceeds the cap, reject before we start streaming. - if (!hasMaxContentLength) { - _context4.n = 12; - break; - } - declaredLength = utils$1.toFiniteNumber(responseHeaders.getContentLength()); - if (!(declaredLength != null && declaredLength > maxContentLength)) { - _context4.n = 12; - break; - } - throw new AxiosError('maxContentLength size of ' + maxContentLength + ' exceeded', AxiosError.ERR_BAD_RESPONSE, config, request); - case 12: - isStreamResponse = supportsResponseStream && (responseType === 'stream' || responseType === 'response'); - if (supportsResponseStream && response.body && (onDownloadProgress || hasMaxContentLength || isStreamResponse && unsubscribe)) { - options = {}; - ['status', 'statusText', 'headers'].forEach(function (prop) { - options[prop] = response[prop]; - }); - responseContentLength = utils$1.toFiniteNumber(responseHeaders.getContentLength()); - _ref7 = onDownloadProgress && progressEventDecorator(responseContentLength, progressEventReducer(asyncDecorator(onDownloadProgress), true)) || [], _ref8 = _slicedToArray(_ref7, 2), _onProgress = _ref8[0], _flush = _ref8[1]; - bytesRead = 0; - onChunkProgress = function onChunkProgress(loadedBytes) { - if (hasMaxContentLength) { - bytesRead = loadedBytes; - if (bytesRead > maxContentLength) { - throw new AxiosError('maxContentLength size of ' + maxContentLength + ' exceeded', AxiosError.ERR_BAD_RESPONSE, config, request); - } - } - _onProgress && _onProgress(loadedBytes); - }; - response = new Response(trackStream(response.body, DEFAULT_CHUNK_SIZE, onChunkProgress, function () { - _flush && _flush(); - unsubscribe && unsubscribe(); - }), options); - } - responseType = responseType || 'text'; - _context4.n = 13; - return resolvers[utils$1.findKey(resolvers, responseType) || 'text'](response, config); - case 13: - responseData = _context4.v; - if (!(hasMaxContentLength && !supportsResponseStream && !isStreamResponse)) { - _context4.n = 14; - break; - } - if (responseData != null) { - if (typeof responseData.byteLength === 'number') { - materializedSize = responseData.byteLength; - } else if (typeof responseData.size === 'number') { - materializedSize = responseData.size; - } else if (typeof responseData === 'string') { - materializedSize = typeof TextEncoder === 'function' ? new TextEncoder().encode(responseData).byteLength : responseData.length; - } - } - if (!(typeof materializedSize === 'number' && materializedSize > maxContentLength)) { - _context4.n = 14; - break; - } - throw new AxiosError('maxContentLength size of ' + maxContentLength + ' exceeded', AxiosError.ERR_BAD_RESPONSE, config, request); - case 14: - !isStreamResponse && unsubscribe && unsubscribe(); - _context4.n = 15; - return new Promise(function (resolve, reject) { - settle(resolve, reject, { - data: responseData, - headers: AxiosHeaders.from(response.headers), - status: response.status, - statusText: response.statusText, - config: config, - request: request - }); - }); - case 15: - return _context4.a(2, _context4.v); - case 16: - _context4.p = 16; - _t4 = _context4.v; - unsubscribe && unsubscribe(); - - // Safari can surface fetch aborts as a DOMException-like object whose - // branded getters throw. Prefer our composed signal reason before reading - // the caught error, preserving timeout vs cancellation semantics. - if (!(composedSignal && composedSignal.aborted && composedSignal.reason instanceof AxiosError)) { - _context4.n = 17; - break; - } - canceledError = composedSignal.reason; - canceledError.config = config; - request && (canceledError.request = request); - if (_t4 !== canceledError) { - // Non-enumerable to match native Error `cause` semantics so loggers - // don't recurse into circular fetch internals (see #7205). - Object.defineProperty(canceledError, 'cause', { - __proto__: null, - value: _t4, - writable: true, - enumerable: false, - configurable: true - }); - } - throw canceledError; - case 17: - if (!pendingBodyError) { - _context4.n = 18; - break; - } - request && !pendingBodyError.request && (pendingBodyError.request = request); - throw pendingBodyError; - case 18: - if (!(_t4 instanceof AxiosError)) { - _context4.n = 19; - break; - } - request && !_t4.request && (_t4.request = request); - throw _t4; - case 19: - if (!(_t4 && _t4.name === 'TypeError' && /Load failed|fetch/i.test(_t4.message))) { - _context4.n = 20; - break; - } - networkError = new AxiosError('Network Error', AxiosError.ERR_NETWORK, config, request, _t4 && _t4.response); // Non-enumerable to match native Error `cause` semantics so loggers - // don't recurse into circular fetch internals (see #7205). - Object.defineProperty(networkError, 'cause', { - __proto__: null, - value: _t4.cause || _t4, - writable: true, - enumerable: false, - configurable: true - }); - throw networkError; - case 20: - throw AxiosError.from(_t4, _t4 && _t4.code, config, request, _t4 && _t4.response); - case 21: - return _context4.a(2); - } - }, _callee4, null, [[1, 16]]); - })); - return function (_x5) { - return _ref4.apply(this, arguments); - }; - }(); - }; - var seedCache = new Map(); - var getFetch = function getFetch(config) { - var env = config && config.env || {}; - var fetch = env.fetch, - Request = env.Request, - Response = env.Response; - var seeds = [Request, Response, fetch]; - var len = seeds.length, - i = len, - seed, - target, - map = seedCache; - while (i--) { - seed = seeds[i]; - target = map.get(seed); - target === undefined && map.set(seed, target = i ? new Map() : factory(env)); - map = target; - } - return target; - }; - getFetch(); - - /** - * Known adapters mapping. - * Provides environment-specific adapters for Axios: - * - `http` for Node.js - * - `xhr` for browsers - * - `fetch` for fetch API-based requests - * - * @type {Object} - */ - var knownAdapters = { - http: httpAdapter, - xhr: xhrAdapter, - fetch: { - get: getFetch - } - }; - - // Assign adapter names for easier debugging and identification - utils$1.forEach(knownAdapters, function (fn, value) { - if (fn) { - try { - // Null-proto descriptors so a polluted Object.prototype.get cannot turn - // these data descriptors into accessor descriptors on the way in. - Object.defineProperty(fn, 'name', { - __proto__: null, - value: value - }); - } catch (e) { - // eslint-disable-next-line no-empty - } - Object.defineProperty(fn, 'adapterName', { - __proto__: null, - value: value - }); - } - }); - - /** - * Render a rejection reason string for unknown or unsupported adapters - * - * @param {string} reason - * @returns {string} - */ - var renderReason = function renderReason(reason) { - return "- ".concat(reason); - }; - - /** - * Check if the adapter is resolved (function, null, or false) - * - * @param {Function|null|false} adapter - * @returns {boolean} - */ - var isResolvedHandle = function isResolvedHandle(adapter) { - return utils$1.isFunction(adapter) || adapter === null || adapter === false; - }; - - /** - * Get the first suitable adapter from the provided list. - * Tries each adapter in order until a supported one is found. - * Throws an AxiosError if no adapter is suitable. - * - * @param {Array|string|Function} adapters - Adapter(s) by name or function. - * @param {Object} config - Axios request configuration - * @throws {AxiosError} If no suitable adapter is available - * @returns {Function} The resolved adapter function - */ - function getAdapter(adapters, config) { - adapters = utils$1.isArray(adapters) ? adapters : [adapters]; - var _adapters = adapters, - length = _adapters.length; - var nameOrAdapter; - var adapter; - var rejectedReasons = {}; - for (var i = 0; i < length; i++) { - nameOrAdapter = adapters[i]; - var id = void 0; - adapter = nameOrAdapter; - if (!isResolvedHandle(nameOrAdapter)) { - adapter = knownAdapters[(id = String(nameOrAdapter)).toLowerCase()]; - if (adapter === undefined) { - throw new AxiosError("Unknown adapter '".concat(id, "'")); - } - } - if (adapter && (utils$1.isFunction(adapter) || (adapter = adapter.get(config)))) { - break; - } - rejectedReasons[id || '#' + i] = adapter; - } - if (!adapter) { - var reasons = Object.entries(rejectedReasons).map(function (_ref) { - var _ref2 = _slicedToArray(_ref, 2), - id = _ref2[0], - state = _ref2[1]; - return "adapter ".concat(id, " ") + (state === false ? 'is not supported by the environment' : 'is not available in the build'); - }); - var s = length ? reasons.length > 1 ? 'since :\n' + reasons.map(renderReason).join('\n') : ' ' + renderReason(reasons[0]) : 'as no adapter specified'; - throw new AxiosError("There is no suitable adapter to dispatch the request " + s, AxiosError.ERR_NOT_SUPPORT); - } - return adapter; - } - - /** - * Exports Axios adapters and utility to resolve an adapter - */ - var adapters = { - /** - * Resolve an adapter from a list of adapter names or functions. - * @type {Function} - */ - getAdapter: getAdapter, - /** - * Exposes all known adapters - * @type {Object} - */ - adapters: knownAdapters - }; - - /** - * Throws a `CanceledError` if cancellation has been requested. - * - * @param {Object} config The config that is to be used for the request - * - * @returns {void} - */ - function throwIfCancellationRequested(config) { - if (config.cancelToken) { - config.cancelToken.throwIfRequested(); - } - if (config.signal && config.signal.aborted) { - throw new CanceledError(null, config); - } - } - - /** - * Dispatch a request to the server using the configured adapter. - * - * @param {object} config The config that is to be used for the request - * - * @returns {Promise} The Promise to be fulfilled - */ - function dispatchRequest(config) { - throwIfCancellationRequested(config); - config.headers = AxiosHeaders.from(config.headers); - - // Transform request data - config.data = transformData.call(config, config.transformRequest); - if (['post', 'put', 'patch'].indexOf(config.method) !== -1) { - config.headers.setContentType('application/x-www-form-urlencoded', false); - } - var adapter = adapters.getAdapter(config.adapter || defaults.adapter, config); - return adapter(config).then(function onAdapterResolution(response) { - throwIfCancellationRequested(config); - - // Expose the current response on config so that transformResponse can - // attach it to any AxiosError it throws (e.g. on JSON parse failure). - // We clean it up afterwards to avoid polluting the config object. - config.response = response; - try { - response.data = transformData.call(config, config.transformResponse, response); - } finally { - delete config.response; - } - response.headers = AxiosHeaders.from(response.headers); - return response; - }, function onAdapterRejection(reason) { - if (!isCancel(reason)) { - throwIfCancellationRequested(config); - - // Transform response data - if (reason && reason.response) { - config.response = reason.response; - try { - reason.response.data = transformData.call(config, config.transformResponse, reason.response); - } finally { - delete config.response; - } - reason.response.headers = AxiosHeaders.from(reason.response.headers); - } - } - return Promise.reject(reason); - }); - } - - var validators$1 = {}; - - // eslint-disable-next-line func-names - ['object', 'boolean', 'number', 'function', 'string', 'symbol'].forEach(function (type, i) { - validators$1[type] = function validator(thing) { - return _typeof(thing) === type || 'a' + (i < 1 ? 'n ' : ' ') + type; - }; - }); - var deprecatedWarnings = {}; - - /** - * Transitional option validator - * - * @param {function|boolean?} validator - set to false if the transitional option has been removed - * @param {string?} version - deprecated version / removed since version - * @param {string?} message - some message with additional info - * - * @returns {function} - */ - validators$1.transitional = function transitional(validator, version, message) { - function formatMessage(opt, desc) { - return '[Axios v' + VERSION + "] Transitional option '" + opt + "'" + desc + (message ? '. ' + message : ''); - } - - // eslint-disable-next-line func-names - return function (value, opt, opts) { - if (validator === false) { - throw new AxiosError(formatMessage(opt, ' has been removed' + (version ? ' in ' + version : '')), AxiosError.ERR_DEPRECATED); - } - if (version && !deprecatedWarnings[opt]) { - deprecatedWarnings[opt] = true; - // eslint-disable-next-line no-console - console.warn(formatMessage(opt, ' has been deprecated since v' + version + ' and will be removed in the near future')); - } - return validator ? validator(value, opt, opts) : true; - }; - }; - validators$1.spelling = function spelling(correctSpelling) { - return function (value, opt) { - // eslint-disable-next-line no-console - console.warn("".concat(opt, " is likely a misspelling of ").concat(correctSpelling)); - return true; - }; - }; - - /** - * Assert object's properties type - * - * @param {object} options - * @param {object} schema - * @param {boolean?} allowUnknown - * - * @returns {object} - */ - - function assertOptions(options, schema, allowUnknown) { - if (_typeof(options) !== 'object' || options === null) { - throw new AxiosError('options must be an object', AxiosError.ERR_BAD_OPTION_VALUE); - } - var keys = Object.keys(options); - var i = keys.length; - while (i-- > 0) { - var opt = keys[i]; - // Use hasOwnProperty so a polluted Object.prototype. cannot supply - // a non-function validator and cause a TypeError. - var validator = Object.prototype.hasOwnProperty.call(schema, opt) ? schema[opt] : undefined; - if (validator) { - var value = options[opt]; - var result = value === undefined || validator(value, opt, options); - if (result !== true) { - throw new AxiosError('option ' + opt + ' must be ' + result, AxiosError.ERR_BAD_OPTION_VALUE); - } - continue; - } - if (allowUnknown !== true) { - throw new AxiosError('Unknown option ' + opt, AxiosError.ERR_BAD_OPTION); - } - } - } - var validator = { - assertOptions: assertOptions, - validators: validators$1 - }; - - var validators = validator.validators; - - /** - * Create a new instance of Axios - * - * @param {Object} instanceConfig The default config for the instance - * - * @return {Axios} A new instance of Axios - */ - var Axios = /*#__PURE__*/function () { - function Axios(instanceConfig) { - _classCallCheck(this, Axios); - this.defaults = instanceConfig || {}; - this.interceptors = { - request: new InterceptorManager(), - response: new InterceptorManager() - }; - } - - /** - * Dispatch a request - * - * @param {String|Object} configOrUrl The config specific for this request (merged with this.defaults) - * @param {?Object} config - * - * @returns {Promise} The Promise to be fulfilled - */ - return _createClass(Axios, [{ - key: "request", - value: (function () { - var _request2 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee(configOrUrl, config) { - var dummy, stack, firstNewlineIndex, secondNewlineIndex, stackWithoutTwoTopLines, _t; - return _regenerator().w(function (_context) { - while (1) switch (_context.p = _context.n) { - case 0: - _context.p = 0; - _context.n = 1; - return this._request(configOrUrl, config); - case 1: - return _context.a(2, _context.v); - case 2: - _context.p = 2; - _t = _context.v; - if (_t instanceof Error) { - dummy = {}; - Error.captureStackTrace ? Error.captureStackTrace(dummy) : dummy = new Error(); - - // slice off the Error: ... line - stack = function () { - if (!dummy.stack) { - return ''; - } - var firstNewlineIndex = dummy.stack.indexOf('\n'); - return firstNewlineIndex === -1 ? '' : dummy.stack.slice(firstNewlineIndex + 1); - }(); - try { - if (!_t.stack) { - _t.stack = stack; - // match without the 2 top stack lines - } else if (stack) { - firstNewlineIndex = stack.indexOf('\n'); - secondNewlineIndex = firstNewlineIndex === -1 ? -1 : stack.indexOf('\n', firstNewlineIndex + 1); - stackWithoutTwoTopLines = secondNewlineIndex === -1 ? '' : stack.slice(secondNewlineIndex + 1); - if (!String(_t.stack).endsWith(stackWithoutTwoTopLines)) { - _t.stack += '\n' + stack; - } - } - } catch (e) { - // ignore the case where "stack" is an un-writable property - } - } - throw _t; - case 3: - return _context.a(2); - } - }, _callee, this, [[0, 2]]); - })); - function request(_x, _x2) { - return _request2.apply(this, arguments); - } - return request; - }()) - }, { - key: "_request", - value: function _request(configOrUrl, config) { - var _this = this; - /*eslint no-param-reassign:0*/ - // Allow for axios('example/url'[, config]) a la fetch API - if (typeof configOrUrl === 'string') { - config = config || {}; - config.url = configOrUrl; - } else { - config = configOrUrl || {}; - } - config = mergeConfig(this.defaults, config); - var _config = config, - transitional = _config.transitional, - paramsSerializer = _config.paramsSerializer, - headers = _config.headers; - if (transitional !== undefined) { - validator.assertOptions(transitional, { - silentJSONParsing: validators.transitional(validators["boolean"]), - forcedJSONParsing: validators.transitional(validators["boolean"]), - clarifyTimeoutError: validators.transitional(validators["boolean"]), - legacyInterceptorReqResOrdering: validators.transitional(validators["boolean"]), - advertiseZstdAcceptEncoding: validators.transitional(validators["boolean"]), - validateStatusUndefinedResolves: validators.transitional(validators["boolean"]) - }, false); - } - if (paramsSerializer != null) { - if (utils$1.isFunction(paramsSerializer)) { - config.paramsSerializer = { - serialize: paramsSerializer - }; - } else { - validator.assertOptions(paramsSerializer, { - encode: validators["function"], - serialize: validators["function"] - }, true); - } - } - - // Set config.allowAbsoluteUrls - if (config.allowAbsoluteUrls !== undefined) ; else if (this.defaults.allowAbsoluteUrls !== undefined) { - config.allowAbsoluteUrls = this.defaults.allowAbsoluteUrls; - } else { - config.allowAbsoluteUrls = true; - } - validator.assertOptions(config, { - baseUrl: validators.spelling('baseURL'), - withXsrfToken: validators.spelling('withXSRFToken') - }, true); - - // Set config.method - config.method = (config.method || this.defaults.method || 'get').toLowerCase(); - - // Flatten headers - var contextHeaders = headers && utils$1.merge(headers.common, headers[config.method]); - headers && utils$1.forEach(['delete', 'get', 'head', 'post', 'put', 'patch', 'query', 'common'], function (method) { - delete headers[method]; - }); - config.headers = AxiosHeaders.concat(contextHeaders, headers); - - // filter out skipped interceptors - var requestInterceptorChain = []; - var synchronousRequestInterceptors = true; - this.interceptors.request.forEach(function unshiftRequestInterceptors(interceptor) { - if (typeof interceptor.runWhen === 'function' && interceptor.runWhen(config) === false) { - return; - } - synchronousRequestInterceptors = synchronousRequestInterceptors && interceptor.synchronous; - var transitional = config.transitional || transitionalDefaults; - var legacyInterceptorReqResOrdering = transitional && transitional.legacyInterceptorReqResOrdering; - if (legacyInterceptorReqResOrdering) { - requestInterceptorChain.unshift(interceptor.fulfilled, interceptor.rejected); - } else { - requestInterceptorChain.push(interceptor.fulfilled, interceptor.rejected); - } - }); - var responseInterceptorChain = []; - this.interceptors.response.forEach(function pushResponseInterceptors(interceptor) { - responseInterceptorChain.push(interceptor.fulfilled, interceptor.rejected); - }); - var promise; - var i = 0; - var len; - if (!synchronousRequestInterceptors) { - var chain = [dispatchRequest.bind(this), undefined]; - chain.unshift.apply(chain, requestInterceptorChain); - chain.push.apply(chain, responseInterceptorChain); - len = chain.length; - promise = Promise.resolve(config); - while (i < len) { - promise = promise.then(chain[i++], chain[i++]); - } - return promise; - } - len = requestInterceptorChain.length; - var newConfig = config; - while (i < len) { - var onFulfilled = requestInterceptorChain[i++]; - var onRejected = requestInterceptorChain[i++]; - try { - newConfig = onFulfilled ? onFulfilled(newConfig) : newConfig; - } catch (error) { - if (!onRejected) { - promise = Promise.reject(error); - break; - } - try { - var rejectedResult = onRejected.call(this, error); - if (utils$1.isThenable(rejectedResult)) { - promise = Promise.resolve(rejectedResult).then(function () { - return dispatchRequest.call(_this, newConfig); - }); - } - } catch (rejectedError) { - promise = Promise.reject(rejectedError); - } - break; - } - } - if (!promise) { - try { - promise = dispatchRequest.call(this, newConfig); - } catch (error) { - promise = Promise.reject(error); - } - } - i = 0; - len = responseInterceptorChain.length; - while (i < len) { - promise = promise.then(responseInterceptorChain[i++], responseInterceptorChain[i++]); - } - return promise; - } - }, { - key: "getUri", - value: function getUri(config) { - config = mergeConfig(this.defaults, config); - var fullPath = buildFullPath(config.baseURL, config.url, config.allowAbsoluteUrls, config); - return buildURL(fullPath, config.params, config.paramsSerializer); - } - }]); - }(); // Provide aliases for supported request methods - utils$1.forEach(['delete', 'get', 'head', 'options'], function forEachMethodNoData(method) { - /*eslint func-names:0*/ - Axios.prototype[method] = function (url, config) { - return this.request(mergeConfig(config || {}, { - method: method, - url: url, - data: config && utils$1.hasOwnProp(config, 'data') ? config.data : undefined - })); - }; - }); - utils$1.forEach(['post', 'put', 'patch', 'query'], function forEachMethodWithData(method) { - function generateHTTPMethod(isForm) { - return function httpMethod(url, data, config) { - return this.request(mergeConfig(config || {}, { - method: method, - headers: isForm ? { - 'Content-Type': 'multipart/form-data' - } : {}, - url: url, - data: data - })); - }; - } - Axios.prototype[method] = generateHTTPMethod(); - - // QUERY is a safe/idempotent read method; multipart form bodies don't fit - // its semantics, so no queryForm shorthand is generated. - if (method !== 'query') { - Axios.prototype[method + 'Form'] = generateHTTPMethod(true); - } - }); - - /** - * A `CancelToken` is an object that can be used to request cancellation of an operation. - * - * @param {Function} executor The executor function. - * - * @returns {CancelToken} - */ - var CancelToken = /*#__PURE__*/function () { - function CancelToken(executor) { - _classCallCheck(this, CancelToken); - if (typeof executor !== 'function') { - throw new TypeError('executor must be a function.'); - } - var resolvePromise; - this.promise = new Promise(function promiseExecutor(resolve) { - resolvePromise = resolve; - }); - var token = this; - - // eslint-disable-next-line func-names - this.promise.then(function (cancel) { - if (!token._listeners) return; - var i = token._listeners.length; - while (i-- > 0) { - token._listeners[i](cancel); - } - token._listeners = null; - }); - - // eslint-disable-next-line func-names - this.promise.then = function (onfulfilled) { - var _resolve; - // eslint-disable-next-line func-names - var promise = new Promise(function (resolve) { - token.subscribe(resolve); - _resolve = resolve; - }).then(onfulfilled); - promise.cancel = function reject() { - token.unsubscribe(_resolve); - }; - return promise; - }; - executor(function cancel(message, config, request) { - if (token.reason) { - // Cancellation has already been requested - return; - } - token.reason = new CanceledError(message, config, request); - resolvePromise(token.reason); - }); - } - - /** - * Throws a `CanceledError` if cancellation has been requested. - */ - return _createClass(CancelToken, [{ - key: "throwIfRequested", - value: function throwIfRequested() { - if (this.reason) { - throw this.reason; - } - } - - /** - * Subscribe to the cancel signal - */ - }, { - key: "subscribe", - value: function subscribe(listener) { - if (this.reason) { - listener(this.reason); - return; - } - if (this._listeners) { - this._listeners.push(listener); - } else { - this._listeners = [listener]; - } - } - - /** - * Unsubscribe from the cancel signal - */ - }, { - key: "unsubscribe", - value: function unsubscribe(listener) { - if (!this._listeners) { - return; - } - var index = this._listeners.indexOf(listener); - if (index !== -1) { - this._listeners.splice(index, 1); - } - } - }, { - key: "toAbortSignal", - value: function toAbortSignal() { - var _this = this; - var controller = new AbortController(); - var abort = function abort(err) { - controller.abort(err); - }; - this.subscribe(abort); - controller.signal.unsubscribe = function () { - return _this.unsubscribe(abort); - }; - return controller.signal; - } - - /** - * Returns an object that contains a new `CancelToken` and a function that, when called, - * cancels the `CancelToken`. - */ - }], [{ - key: "source", - value: function source() { - var cancel; - var token = new CancelToken(function executor(c) { - cancel = c; - }); - return { - token: token, - cancel: cancel - }; - } - }]); - }(); - - /** - * Syntactic sugar for invoking a function and expanding an array for arguments. - * - * Common use case would be to use `Function.prototype.apply`. - * - * ```js - * function f(x, y, z) {} - * const args = [1, 2, 3]; - * f.apply(null, args); - * ``` - * - * With `spread` this example can be re-written. - * - * ```js - * spread(function(x, y, z) {})([1, 2, 3]); - * ``` - * - * @param {Function} callback - * - * @returns {Function} - */ - function spread(callback) { - return function wrap(arr) { - return callback.apply(null, arr); - }; - } - - /** - * Determines whether the payload is an error thrown by Axios - * - * @param {*} payload The value to test - * - * @returns {boolean} True if the payload is an error thrown by Axios, otherwise false - */ - function isAxiosError(payload) { - return utils$1.isObject(payload) && payload.isAxiosError === true; - } - - var HttpStatusCode = { - Continue: 100, - SwitchingProtocols: 101, - Processing: 102, - EarlyHints: 103, - Ok: 200, - Created: 201, - Accepted: 202, - NonAuthoritativeInformation: 203, - NoContent: 204, - ResetContent: 205, - PartialContent: 206, - MultiStatus: 207, - AlreadyReported: 208, - ImUsed: 226, - MultipleChoices: 300, - MovedPermanently: 301, - Found: 302, - SeeOther: 303, - NotModified: 304, - UseProxy: 305, - Unused: 306, - TemporaryRedirect: 307, - PermanentRedirect: 308, - BadRequest: 400, - Unauthorized: 401, - PaymentRequired: 402, - Forbidden: 403, - NotFound: 404, - MethodNotAllowed: 405, - NotAcceptable: 406, - ProxyAuthenticationRequired: 407, - RequestTimeout: 408, - Conflict: 409, - Gone: 410, - LengthRequired: 411, - PreconditionFailed: 412, - PayloadTooLarge: 413, - UriTooLong: 414, - UnsupportedMediaType: 415, - RangeNotSatisfiable: 416, - ExpectationFailed: 417, - ImATeapot: 418, - MisdirectedRequest: 421, - UnprocessableEntity: 422, - Locked: 423, - FailedDependency: 424, - TooEarly: 425, - UpgradeRequired: 426, - PreconditionRequired: 428, - TooManyRequests: 429, - RequestHeaderFieldsTooLarge: 431, - UnavailableForLegalReasons: 451, - InternalServerError: 500, - NotImplemented: 501, - BadGateway: 502, - ServiceUnavailable: 503, - GatewayTimeout: 504, - HttpVersionNotSupported: 505, - VariantAlsoNegotiates: 506, - InsufficientStorage: 507, - LoopDetected: 508, - NotExtended: 510, - NetworkAuthenticationRequired: 511, - WebServerReturnsAnUnknownError: 520, - WebServerIsDown: 521, - ConnectionTimedOut: 522, - OriginIsUnreachable: 523, - TimeoutOccurred: 524, - SslHandshakeFailed: 525, - InvalidSslCertificate: 526 - }; - Object.entries(HttpStatusCode).forEach(function (_ref) { - var _ref2 = _slicedToArray(_ref, 2), - key = _ref2[0], - value = _ref2[1]; - HttpStatusCode[value] = key; - }); - - /** - * Create an instance of Axios - * - * @param {Object} defaultConfig The default config for the instance - * - * @returns {Axios} A new instance of Axios - */ - function createInstance(defaultConfig) { - var context = new Axios(defaultConfig); - var instance = bind(Axios.prototype.request, context); - - // Copy axios.prototype to instance - utils$1.extend(instance, Axios.prototype, context, { - allOwnKeys: true - }); - - // Copy context to instance - utils$1.extend(instance, context, null, { - allOwnKeys: true - }); - - // Factory for creating new instances - instance.create = function create(instanceConfig) { - return createInstance(mergeConfig(defaultConfig, instanceConfig)); - }; - return instance; - } - - // Create the default instance to be exported - var axios = createInstance(defaults); - - // Expose Axios class to allow class inheritance - axios.Axios = Axios; - - // Expose Cancel & CancelToken - axios.CanceledError = CanceledError; - axios.CancelToken = CancelToken; - axios.isCancel = isCancel; - axios.VERSION = VERSION; - axios.toFormData = toFormData; - - // Expose AxiosError class - axios.AxiosError = AxiosError; - - // alias for CanceledError for backward compatibility - axios.Cancel = axios.CanceledError; - - // Expose all/spread - axios.all = function all(promises) { - return Promise.all(promises); - }; - axios.spread = spread; - - // Expose isAxiosError - axios.isAxiosError = isAxiosError; - - // Expose mergeConfig - axios.mergeConfig = mergeConfig; - axios.AxiosHeaders = AxiosHeaders; - axios.formToJSON = function (thing) { - return formDataToJSON(utils$1.isHTMLForm(thing) ? new FormData(thing) : thing); - }; - axios.getAdapter = adapters.getAdapter; - axios.HttpStatusCode = HttpStatusCode; - axios["default"] = axios; - - return axios; - -})); diff --git a/server/node_modules/axios/dist/axios.min.js b/server/node_modules/axios/dist/axios.min.js deleted file mode 100644 index 7f5d365..0000000 --- a/server/node_modules/axios/dist/axios.min.js +++ /dev/null @@ -1,5 +0,0 @@ -/*! Axios v1.19.0 Copyright (c) 2026 Matt Zabriskie and contributors */ -!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e="undefined"!=typeof globalThis?globalThis:e||self).axios=t()}(this,function(){"use strict";function e(e,t){this.v=e,this.k=t}function t(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){u=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}function p(e,t,n){return(t=_(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function h(e){return h=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},h(e)}function v(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&E(e,t)}function y(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(y=function(){return!!e})()}function b(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function m(e){for(var t=1;t3?(o=h===r)&&(s=i[(u=i[4])?5:(u=3,3)],i[4]=i[5]=e):i[0]<=p&&((o=n<2&&pr||r>h)&&(i[4]=n,i[5]=r,d.n=h,u=0))}if(o||n>1)return a;throw l=!0,r}return function(o,f,h){if(c>1)throw TypeError("Generator is already running");for(l&&1===f&&p(f,h),u=f,s=h;(t=u<2?e:s)||!l;){i||(u?u<3?(u>1&&(d.n=-1),p(u,s)):d.n=s:d.v=s);try{if(c=2,i){if(u||(o="next"),t=i[o]){if(!(t=t.call(i,s)))throw TypeError("iterator result is not an object");if(!t.done)return t;s=t.value,u<2&&(u=0)}else 1===u&&(t=i.return)&&t.call(i),u<2&&(s=TypeError("The iterator does not provide a '"+o+"' method"),u=1);i=e}else if((t=(l=d.n<0)?s:n.call(r,d))!==a)break}catch(t){i=e,u=1,s=t}finally{c=1}}return{value:t,done:l}}}(n,o,i),!0),c}var a={};function u(){}function s(){}function c(){}t=Object.getPrototypeOf;var f=[][r]?t(t([][r]())):(w(t={},r,function(){return this}),t),l=c.prototype=u.prototype=Object.create(f);function d(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,c):(e.__proto__=c,w(e,o,"GeneratorFunction")),e.prototype=Object.create(l),e}return s.prototype=c,w(l,"constructor",c),w(c,"constructor",s),s.displayName="GeneratorFunction",w(c,o,"GeneratorFunction"),w(l),w(l,o,"Generator"),w(l,r,function(){return this}),w(l,"toString",function(){return"[object Generator]"}),(g=function(){return{w:i,m:d}})()}function w(e,t,n,r){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}w=function(e,t,n,r){function i(t,n){w(e,t,function(e){return this._invoke(t,n,e)})}t?o?o(e,t,{value:n,enumerable:!r,configurable:!r,writable:!r}):e[t]=n:(i("next",0),i("throw",1),i("return",2))},w(e,t,n,r)}function O(e){if(null!=e){var t=e["function"==typeof Symbol&&Symbol.iterator||"@@iterator"],n=0;if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length))return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}}}throw new TypeError(typeof e+" is not iterable")}function E(e,t){return E=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},E(e,t)}function R(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i,a,u=[],s=!0,c=!1;try{if(i=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;s=!1}else for(;!(s=(r=i.call(n)).done)&&(u.push(r.value),u.length!==t);s=!0);}catch(e){c=!0,o=e}finally{try{if(!s&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(c)throw o}}return u}}(e,t)||P(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function S(e){return function(e){if(Array.isArray(e))return t(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||P(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function _(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t);if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:t+""}function A(e){return A="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},A(e)}function P(e,n){if(e){if("string"==typeof e)return t(e,n);var r={}.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?t(e,n):void 0}}function j(e){return function(){return new T(e.apply(this,arguments))}}function T(t){var n,r;function o(n,r){try{var a=t[n](r),u=a.value,s=u instanceof e;Promise.resolve(s?u.v:u).then(function(e){if(s){var r="return"===n&&u.k?n:"next";if(!u.k||e.done)return o(r,e);e=t[r](e).value}i(!!a.done,e)},function(e){o("throw",e)})}catch(e){i(2,e)}}function i(e,t){2===e?n.reject(t):n.resolve({value:t,done:e}),(n=n.next)?o(n.key,n.arg):r=null}this._invoke=function(e,t){return new Promise(function(i,a){var u={key:e,arg:t,resolve:i,reject:a,next:null};r?r=r.next=u:(n=r=u,o(e,t))})},"function"!=typeof t.return&&(this.return=void 0)}function k(e){var t="function"==typeof Map?new Map:void 0;return k=function(e){if(null===e||!function(e){try{return-1!==Function.toString.call(e).indexOf("[native code]")}catch(t){return"function"==typeof e}}(e))return e;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,n)}function n(){return function(e,t,n){if(y())return Reflect.construct.apply(null,arguments);var r=[null];r.push.apply(r,t);var o=new(e.bind.apply(e,r));return n&&E(o,n.prototype),o}(e,arguments,h(this).constructor)}return n.prototype=Object.create(e.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),E(n,e)},k(e)}function C(e,t){return function(){return e.apply(t,arguments)}}T.prototype["function"==typeof Symbol&&Symbol.asyncIterator||"@@asyncIterator"]=function(){return this},T.prototype.next=function(e){return this._invoke("next",e)},T.prototype.throw=function(e){return this._invoke("throw",e)},T.prototype.return=function(e){return this._invoke("return",e)};var x,N=Object.prototype.toString,U=Object.getPrototypeOf,D=Symbol.iterator,L=Symbol.toStringTag,F=function(){var e=Object.prototype.hasOwnProperty;return function(t,n){return e.call(t,n)}}(),B=function(e,t){for(var n=e,r=[];null!=n&&n!==Object.prototype;){if(-1!==r.indexOf(n))return!1;if(r.push(n),F(n,t))return!0;n=U(n)}return!1},I=(x=Object.create(null),function(e){var t=N.call(e);return x[t]||(x[t]=t.slice(8,-1).toLowerCase())}),q=function(e){return e=e.toLowerCase(),function(t){return I(t)===e}},M=function(e){return function(t){return A(t)===e}},z=Array.isArray,H=M("undefined");function W(e){return null!==e&&!H(e)&&null!==e.constructor&&!H(e.constructor)&&K(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}var J=q("ArrayBuffer");var V=M("string"),K=M("function"),X=M("number"),G=function(e){return null!==e&&"object"===A(e)},$=function(e){if(!G(e))return!1;var t=U(e);return!(null!==t&&t!==Object.prototype&&null!==U(t)||B(e,L)||B(e,D))},Q=q("Date"),Z=q("File"),Y=q("Blob"),ee=q("FileList"),te=q("Set");var ne="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:"undefined"!=typeof global?global:{},re=void 0!==ne.FormData?ne.FormData:void 0,oe=q("URLSearchParams"),ie=R(["ReadableStream","Request","Response","Headers"].map(q),4),ae=ie[0],ue=ie[1],se=ie[2],ce=ie[3];function fe(e,t){var n,r,o=(arguments.length>2&&void 0!==arguments[2]?arguments[2]:{}).allOwnKeys,i=void 0!==o&&o;if(null!=e)if("object"!==A(e)&&(e=[e]),z(e))for(n=0,r=e.length;n0;)if(t===(n=r[o]).toLowerCase())return n;return null}var de="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:global,pe=function(e){return!H(e)&&e!==de};var he,ve=(he="undefined"!=typeof Uint8Array&&U(Uint8Array),function(e){return he&&e instanceof he}),ye=q("HTMLFormElement"),be=Object.prototype.propertyIsEnumerable,me=q("RegExp"),ge=function(e,t){var n=Object.getOwnPropertyDescriptors(e),r={};fe(n,function(n,o){var i;!1!==(i=t(n,o,e))&&(r[o]=i||n)}),Object.defineProperties(e,r)};var we,Oe,Ee,Re,Se=q("AsyncFunction"),_e=(we="function"==typeof setImmediate,Oe=K(de.postMessage),we?setImmediate:Oe?(Ee="axios@".concat(Math.random()),Re=[],de.addEventListener("message",function(e){var t=e.source,n=e.data;t===de&&n===Ee&&Re.length&&Re.shift()()},!1),function(e){Re.push(e),de.postMessage(Ee,"*")}):function(e){return setTimeout(e)}),Ae="undefined"!=typeof queueMicrotask?queueMicrotask.bind(de):"undefined"!=typeof process&&process.nextTick||_e,Pe=function(e){return null!=e&&K(e[D])},je={isArray:z,isArrayBuffer:J,isBuffer:W,isFormData:function(e){if(!e)return!1;if(re&&e instanceof re)return!0;var t=U(e);if(!t||t===Object.prototype)return!1;if(!K(e.append))return!1;var n=I(e);return"formdata"===n||"object"===n&&K(e.toString)&&"[object FormData]"===e.toString()},isArrayBufferView:function(e){return"undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&J(e.buffer)},isString:V,isNumber:X,isBoolean:function(e){return!0===e||!1===e},isObject:G,isPlainObject:$,isEmptyObject:function(e){if(!G(e)||W(e))return!1;try{return 0===Object.keys(e).length&&Object.getPrototypeOf(e)===Object.prototype}catch(e){return!1}},isReadableStream:ae,isRequest:ue,isResponse:se,isHeaders:ce,isUndefined:H,isDate:Q,isFile:Z,isReactNativeBlob:function(e){return!(!e||void 0===e.uri)},isReactNative:function(e){return e&&void 0!==e.getParts},isBlob:Y,isRegExp:me,isFunction:K,isStream:function(e){return G(e)&&K(e.pipe)},isURLSearchParams:oe,isTypedArray:ve,isFileList:ee,forEach:fe,merge:function e(){for(var t=pe(this)&&this||{},n=t.caseless,r=t.skipUndefined,o={},i=function(t,i){if("__proto__"!==i&&"constructor"!==i&&"prototype"!==i){var a=n&&"string"==typeof i&&le(o,i)||i,u=F(o,a)?o[a]:void 0;$(u)&&$(t)?o[a]=e(u,t):$(t)?o[a]=e({},t):z(t)?o[a]=t.slice():r&&H(t)||(o[a]=t)}},a=0,u=arguments.length;a3&&void 0!==arguments[3]?arguments[3]:{}).allOwnKeys}),e},trim:function(e){return e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")},stripBOM:function(e){return 65279===e.charCodeAt(0)&&(e=e.slice(1)),e},inherits:function(e,t,n,r){e.prototype=Object.create(t.prototype,r),Object.defineProperty(e.prototype,"constructor",{__proto__:null,value:e,writable:!0,enumerable:!1,configurable:!0}),Object.defineProperty(e,"super",{__proto__:null,value:t.prototype}),n&&Object.assign(e.prototype,n)},toFlatObject:function(e,t,n,r){var o,i,a,u={};if(t=t||{},null==e)return t;do{for(i=(o=Object.getOwnPropertyNames(e)).length;i-- >0;)a=o[i],r&&!r(a,e,t)||u[a]||(t[a]=e[a],u[a]=!0);e=!1!==n&&U(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},kindOf:I,kindOfTest:q,endsWith:function(e,t,n){e=String(e),(void 0===n||n>e.length)&&(n=e.length),n-=t.length;var r=e.indexOf(t,n);return-1!==r&&r===n},toArray:function(e){if(!e)return null;if(z(e))return e;var t=e.length;if(!X(t))return null;for(var n=new Array(t);t-- >0;)n[t]=e[t];return n},forEachEntry:function(e,t){for(var n,r=(e&&e[D]).call(e);(n=r.next())&&!n.done;){var o=n.value;t.call(e,o[0],o[1])}},matchAll:function(e,t){for(var n,r=[];null!==(n=e.exec(t));)r.push(n);return r},isHTMLForm:ye,hasOwnProperty:F,hasOwnProp:F,hasOwnInPrototypeChain:B,getSafeProp:function(e,t){return null!=e&&B(e,t)?e[t]:void 0},reduceDescriptors:ge,freezeMethods:function(e){ge(e,function(t,n){if(K(e)&&["arguments","caller","callee"].includes(n))return!1;var r=e[n];K(r)&&(t.enumerable=!1,"writable"in t?t.writable=!1:t.set||(t.set=function(){throw Error("Can not rewrite read-only method '"+n+"'")}))})},toObjectSet:function(e,t){var n={},r=function(e){e.forEach(function(e){n[e]=!0})};return z(e)?r(e):r(String(e).split(t)),n},toCamelCase:function(e){return e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(e,t,n){return t.toUpperCase()+n})},noop:function(){},toFiniteNumber:function(e,t){return null!=e&&Number.isFinite(e=+e)?e:t},findKey:le,global:de,isContextDefined:pe,isSpecCompliantForm:function(e){return!!(e&&K(e.append)&&"FormData"===e[L]&&e[D])},toJSONObject:function(e){var t=new WeakSet,n=function(e){if(G(e)){if(t.has(e))return;if(W(e))return e;if(!("toJSON"in e)){var r;if(t.add(e),te(e)){r=[];var o,i=d(e);try{for(i.s();!(o=i.n()).done;){var a=o.value,u=n(a);!H(u)&&r.push(u)}}catch(e){i.e(e)}finally{i.f()}}else r=z(e)?[]:{},fe(e,function(e,t){var o=n(e);!H(o)&&(r[t]=o)});return t.delete(e),r}}return e};return n(e)},isAsyncFn:Se,isThenable:function(e){return e&&(G(e)||K(e))&&K(e.then)&&K(e.catch)},setImmediate:_e,asap:Ae,isIterable:Pe,isSafeIterable:function(e){return null!=e&&B(e,D)&&Pe(e)}},Te=je.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]);var ke=new RegExp("[\\u0000-\\u0008\\u000a-\\u001f\\u007f]+","g"),Ce=new RegExp("[^\\u0009\\u0020-\\u007e\\u0080-\\u00ff]+","g");function xe(e,t){return je.isArray(e)?e.map(function(e){return xe(e,t)}):function(e){for(var t=0,n=e.length;tt;){var o=e.charCodeAt(n-1);if(9!==o&&32!==o)break;n-=1}return 0===t&&n===e.length?e:e.slice(t,n)}(String(e).replace(t,""))}function Ne(e){var t=Object.create(null);return je.forEach(e.toJSON(),function(e,n){t[n]=function(e){return xe(e,Ce)}(e)}),t}var Ue=Symbol("internals");function De(e){return e&&String(e).trim().toLowerCase()}function Le(e){return!1===e||null==e?e:je.isArray(e)?e.map(Le):function(e){return xe(e,ke)}(String(e))}var Fe=/^[!#$%&'*+\-.^_`|~0-9A-Za-z]+$/;function Be(e){for(var t=0,n=e.length;tt;){var o=e.charCodeAt(n-1);if(9!==o&&32!==o)break;n-=1}return 0===t&&n===e.length?e:e.slice(t,n)}function Ie(e,t,n,r,o){return je.isFunction(r)?r.call(this,t,n):(o&&(t=n),je.isString(t)?je.isString(r)?-1!==t.indexOf(r):je.isRegExp(r)?r.test(t):void 0:void 0)}var qe=function(){return l(function e(t){c(this,e),t&&this.set(t)},[{key:"set",value:function(e,t,n){var r=this;function o(e,t,n){var o=De(t);if(o){var i=je.findKey(r,o);(!i||void 0===r[i]||!0===n||void 0===n&&!1!==r[i])&&(r[i||t]=Le(e))}}var i=function(e,t){return je.forEach(e,function(e,n){return o(e,n,t)})};if(je.isPlainObject(e)||e instanceof this.constructor)i(e,t);else if(je.isString(e)&&(e=e.trim())&&!/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim()))i(function(e){var t,n,r,o={};return e&&e.split("\n").forEach(function(e){r=e.indexOf(":"),t=e.substring(0,r).trim().toLowerCase(),n=e.substring(r+1).trim();var i=je.hasOwnProp(o,t);!t||i&&je.hasOwnProp(Te,t)||("set-cookie"===t?i?o[t].push(n):o[t]=[n]:o[t]=i?o[t]+", "+n:n)}),o}(e),t);else if(je.isObject(e)&&je.isSafeIterable(e)){var a,u,s,c=Object.create(null),f=d(e);try{for(f.s();!(s=f.n()).done;){var l=s.value;if(!je.isArray(l))throw new TypeError("Object iterator must return a key-value pair");u=l[0],je.hasOwnProp(c,u)?(a=c[u],c[u]=je.isArray(a)?[].concat(S(a),[l[1]]):[a,l[1]]):c[u]=l[1]}}catch(e){f.e(e)}finally{f.f()}i(c,t)}else null!=e&&o(t,e,n);return this}},{key:"get",value:function(e,t){if(e=De(e)){var n=je.findKey(this,e);if(n){var r=this[n];if(!t)return r;if(!0===t)return function(e){for(var t,n=Object.create(null),r=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;t=r.exec(e);)n[t[1]]=t[2];return n}(r);if(je.isFunction(t))return t.call(this,r,n);if(je.isRegExp(t))return t.exec(r);throw new TypeError("parser must be boolean|regexp|function")}}}},{key:"has",value:function(e,t){if(e=De(e)){var n=je.findKey(this,e);return!(!n||void 0===this[n]||t&&!Ie(0,this[n],n,t))}return!1}},{key:"delete",value:function(e,t){var n=this,r=!1;function o(e){if(e=De(e)){var o=je.findKey(n,e);!o||t&&!Ie(0,n[o],o,t)||(delete n[o],r=!0)}}return je.isArray(e)?e.forEach(o):o(e),r}},{key:"clear",value:function(e){for(var t=Object.keys(this),n=t.length,r=!1;n--;){var o=t[n];e&&!Ie(0,this[o],o,e,!0)||(delete this[o],r=!0)}return r}},{key:"normalize",value:function(e){var t=this,n={};return je.forEach(this,function(r,o){var i=je.findKey(n,o);if(i)return t[i]=Le(r),void delete t[o];var a=e?function(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,function(e,t,n){return t.toUpperCase()+n})}(o):String(o).trim();a!==o&&delete t[o],t[a]=Le(r),n[a]=!0}),this}},{key:"concat",value:function(){for(var e,t=arguments.length,n=new Array(t),r=0;r=t)return e;n+=e[r]}return n}(s)}}}}for(var u=0;u1?n-1:0),o=1;o0?ze(e,t):je.toJSONObject(e);return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:n,code:this.code,status:this.status}}}],[{key:"from",value:function(e,n,r,o,i,a){var u=e.message;!u&&je.isArray(e.errors)&&e.errors.length&&(u=function(e){return e.errors.map(function(e){try{return e&&e.message?He(e.message):He(e)}catch(e){return""}}).filter(Boolean).join("; ")||e.name||"AggregateError"}(e));var s=new t(u,n||e.code,r,o,i);return Object.defineProperty(s,"cause",{__proto__:null,value:e,writable:!0,enumerable:!1,configurable:!0}),s.name=e.name,null!=e.status&&null==s.status&&(s.status=e.status),a&&Object.assign(s,a),s}}])}(k(Error));We.ERR_BAD_OPTION_VALUE="ERR_BAD_OPTION_VALUE",We.ERR_BAD_OPTION="ERR_BAD_OPTION",We.ECONNABORTED="ECONNABORTED",We.ETIMEDOUT="ETIMEDOUT",We.ECONNREFUSED="ECONNREFUSED",We.ERR_NETWORK="ERR_NETWORK",We.ERR_FR_TOO_MANY_REDIRECTS="ERR_FR_TOO_MANY_REDIRECTS",We.ERR_DEPRECATED="ERR_DEPRECATED",We.ERR_BAD_RESPONSE="ERR_BAD_RESPONSE",We.ERR_BAD_REQUEST="ERR_BAD_REQUEST",We.ERR_CANCELED="ERR_CANCELED",We.ERR_NOT_SUPPORT="ERR_NOT_SUPPORT",We.ERR_INVALID_URL="ERR_INVALID_URL",We.ERR_FORM_DATA_DEPTH_EXCEEDED="ERR_FORM_DATA_DEPTH_EXCEEDED";function Je(e){return je.isPlainObject(e)||je.isArray(e)}function Ve(e){return je.endsWith(e,"[]")?e.slice(0,-2):e}function Ke(e,t,n){return e?e.concat(t).map(function(e,t){return e=Ve(e),!n&&t?"["+e+"]":e}).join(n?".":""):t}var Xe=je.toFlatObject(je,{},null,function(e){return/^is[A-Z]/.test(e)});function Ge(e,t,n){if(!je.isObject(e))throw new TypeError("target must be an object");t=t||new FormData;var r=(n=je.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(e,t){return!je.isUndefined(t[e])})).metaTokens,o=n.visitor||p,i=n.dots,a=n.indexes,u=n.Blob||"undefined"!=typeof Blob&&Blob,s=void 0===n.maxDepth?100:n.maxDepth,c=u&&je.isSpecCompliantForm(t),f=[];if(!je.isFunction(o))throw new TypeError("visitor must be a function");function l(e){if(null===e)return"";if(je.isDate(e))return e.toISOString();if(je.isBoolean(e))return e.toString();if(!c&&je.isBlob(e))throw new We("Blob is not supported. Use a Buffer instead.");if(je.isArrayBuffer(e)||je.isTypedArray(e)){if(c&&"function"==typeof u)return new u([e]);throw new We("Blob is not supported. Use a Buffer instead.",We.ERR_NOT_SUPPORT)}return e}function d(e){if(e>s)throw new We("Object is too deeply nested ("+e+" levels). Max depth: "+s,We.ERR_FORM_DATA_DEPTH_EXCEEDED)}function p(e,n,o){var u=e;if(je.isReactNative(t)&&je.isReactNativeBlob(e))return t.append(Ke(o,n,i),l(e)),!1;if(e&&!o&&"object"===A(e))if(je.endsWith(n,"{}"))n=r?n:n.slice(0,-2),e=function(e,t){if(s===1/0)return JSON.stringify(e);var n=[];return JSON.stringify(e,function(e,r){if(!je.isObject(r))return r;for(;n.length&&n[n.length-1]!==this;)n.pop();return n.push(r),d(t+n.length-1),r})}(e,1);else if(je.isArray(e)&&function(e){return je.isArray(e)&&!e.some(Je)}(e)||(je.isFileList(e)||je.endsWith(n,"[]"))&&(u=je.toArray(e)))return n=Ve(n),u.forEach(function(e,r){!je.isUndefined(e)&&null!==e&&t.append(!0===a?Ke([n],r,i):null===a?n:n+"[]",l(e))}),!1;return!!Je(e)||(t.append(Ke(o,n,i),l(e)),!1)}var h=Object.assign(Xe,{defaultVisitor:p,convertValue:l,isVisitable:Je});if(!je.isObject(e))throw new TypeError("data must be an object");return function e(n,r){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;if(!je.isUndefined(n)){if(d(i),-1!==f.indexOf(n))throw new Error("Circular reference detected in "+r.join("."));f.push(n),je.forEach(n,function(n,a){!0===(!(je.isUndefined(n)||null===n)&&o.call(t,n,je.isString(a)?a.trim():a,r,h))&&e(n,r?r.concat(a):[a],i+1)}),f.pop()}}(e),t}function $e(e){var t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+"};return encodeURIComponent(e).replace(/[!'()~]|%20/g,function(e){return t[e]})}function Qe(e,t){this._pairs=[],e&&Ge(e,this,t)}var Ze=Qe.prototype;function Ye(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function et(e,t,n){if(!t)return e;e=e||"";var r,o=je.isFunction(n)?{serialize:n}:n,i=je.getSafeProp(o,"encode")||Ye,a=je.getSafeProp(o,"serialize");if(r=a?a(t,o):je.isURLSearchParams(t)?t.toString():new Qe(t,o).toString(i)){var u=e.indexOf("#");-1!==u&&(e=e.slice(0,u)),e+=(-1===e.indexOf("?")?"?":"&")+r}return e}Ze.append=function(e,t){this._pairs.push([e,t])},Ze.toString=function(e){var t=this,n=e?function(n){return e.call(t,n,$e)}:$e;return this._pairs.map(function(e){return n(e[0])+"="+n(e[1])},"").join("&")};var tt=function(){return l(function e(){c(this,e),this.handlers=[]},[{key:"use",value:function(e,t,n){return this.handlers.push({fulfilled:e,rejected:t,synchronous:!!n&&n.synchronous,runWhen:n?n.runWhen:null}),this.handlers.length-1}},{key:"eject",value:function(e){this.handlers[e]&&(this.handlers[e]=null)}},{key:"clear",value:function(){this.handlers&&(this.handlers=[])}},{key:"forEach",value:function(e){je.forEach(this.handlers,function(t){null!==t&&e(t)})}}])}(),nt={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1,legacyInterceptorReqResOrdering:!0,advertiseZstdAcceptEncoding:!1,validateStatusUndefinedResolves:!0},rt={isBrowser:!0,classes:{URLSearchParams:"undefined"!=typeof URLSearchParams?URLSearchParams:Qe,FormData:"undefined"!=typeof FormData?FormData:null,Blob:"undefined"!=typeof Blob?Blob:null},protocols:["http","https","file","blob","url","data"]},ot="undefined"!=typeof window&&"undefined"!=typeof document,it="object"===("undefined"==typeof navigator?"undefined":A(navigator))&&navigator||void 0,at=ot&&(!it||["ReactNative","NativeScript","NS"].indexOf(it.product)<0),ut="undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&"function"==typeof self.importScripts,st=ot&&window.location.href||"http://localhost",ct=m(m({},Object.freeze({__proto__:null,hasBrowserEnv:ot,hasStandardBrowserEnv:at,hasStandardBrowserWebWorkerEnv:ut,navigator:it,origin:st})),rt);function ft(e){if(e>100)throw new We("FormData field is too deeply nested ("+e+" levels). Max depth: 100",We.ERR_FORM_DATA_DEPTH_EXCEEDED)}function lt(e){function t(e,n,r,o){ft(o);var i=e[o++];if("__proto__"===i)return!0;var a=Number.isFinite(+i),u=o>=e.length;return i=!i&&je.isArray(r)?r.length:i,u?(je.hasOwnProp(r,i)?r[i]=je.isArray(r[i])?r[i].concat(n):[r[i],n]:r[i]=n,!a):(je.hasOwnProp(r,i)&&je.isObject(r[i])||(r[i]=[]),t(e,n,r[i],o)&&je.isArray(r[i])&&(r[i]=function(e){var t,n,r={},o=Object.keys(e),i=o.length;for(t=0;t-1,i=je.isObject(e);if(i&&je.isHTMLForm(e)&&(e=new FormData(e)),je.isFormData(e))return o?JSON.stringify(lt(e)):e;if(je.isArrayBuffer(e)||je.isBuffer(e)||je.isStream(e)||je.isFile(e)||je.isBlob(e)||je.isReadableStream(e))return e;if(je.isArrayBufferView(e))return e.buffer;if(je.isURLSearchParams(e))return t.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();if(i){var a=dt(this,"formSerializer");if(r.indexOf("application/x-www-form-urlencoded")>-1)return function(e,t){return Ge(e,new ct.classes.URLSearchParams,m({visitor:function(e,t,n,r){return ct.isNode&&je.isBuffer(e)?(this.append(t,e.toString("base64")),!1):r.defaultVisitor.apply(this,arguments)}},t))}(e,a).toString();if((n=je.isFileList(e))||r.indexOf("multipart/form-data")>-1){var u=dt(this,"env"),s=u&&u.FormData;return Ge(n?{"files[]":e}:e,s&&new s,a)}}return i||o?(t.setContentType("application/json",!1),function(e,t,n){if(je.isString(e))try{return(t||JSON.parse)(e),je.trim(e)}catch(e){if("SyntaxError"!==e.name)throw e}return(n||JSON.stringify)(e)}(e)):e}],transformResponse:[function(e){var t=dt(this,"transitional")||pt.transitional,n=t&&t.forcedJSONParsing,r=dt(this,"responseType"),o="json"===r;if(je.isResponse(e)||je.isReadableStream(e))return e;if(e&&je.isString(e)&&(n&&!r||o)){var i=!(t&&t.silentJSONParsing)&&o;try{return JSON.parse(e,dt(this,"parseReviver"))}catch(e){if(i){if("SyntaxError"===e.name)throw We.from(e,We.ERR_BAD_RESPONSE,this,null,dt(this,"response"));throw e}}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:ct.classes.FormData,Blob:ct.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};function ht(e,t){var n=this||pt,r=t||n,o=qe.from(r.headers),i=r.data;return je.forEach(e,function(e){i=e.call(n,i,o.normalize(),t?t.status:void 0)}),o.normalize(),i}function vt(e){return!(!e||!e.__CANCEL__)}je.forEach(["delete","get","head","post","put","patch","query"],function(e){pt.headers[e]={}});var yt=function(e){function t(e,n,r){var o;return c(this,t),(o=s(this,t,[null==e?"canceled":e,We.ERR_CANCELED,n,r])).name="CanceledError",o.__CANCEL__=!0,o}return v(t,e),l(t)}(We);function bt(e,t,n){var r=n.config.validateStatus;n.status&&r&&!r(n.status)?t(new We("Request failed with status code "+n.status,n.status>=400&&n.status<500?We.ERR_BAD_REQUEST:We.ERR_BAD_RESPONSE,n.config,n.request,n)):e(n)}var mt=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:3,r=0,o=function(e,t){e=e||10;var n,r=new Array(e),o=new Array(e),i=0,a=0;return t=void 0!==t?t:1e3,function(u){var s=Date.now(),c=o[a];n||(n=s),r[i]=u,o[i]=s;for(var f=a,l=0;f!==i;)l+=r[f++],f%=e;if((i=(i+1)%e)===a&&(a=(a+1)%e),!(s-n1&&void 0!==arguments[1]?arguments[1]:Date.now();o=i,n=null,r&&(clearTimeout(r),r=null),e.apply(void 0,S(t))};return[function(){for(var e=Date.now(),t=e-o,u=arguments.length,s=new Array(u),c=0;c=i?a(s,e):(n=s,r||(r=setTimeout(function(){r=null,a(n)},i-t)))},function(){return n&&a(n)}]}(function(n){if(n&&"number"==typeof n.loaded){var i=n.loaded,a=n.lengthComputable?n.total:void 0,u=Math.max(0,null!=a?Math.min(i,a):i),s=Math.max(0,u-r),c=o(s);r=Math.max(r,u);var f=p({loaded:u,total:a,progress:a?u/a:void 0,bytes:s,rate:c||void 0,estimated:c&&a?(a-u)/c:void 0,event:n,lengthComputable:null!=a},t?"download":"upload",!0);e(f)}},n)},gt=function(e,t){var n=null!=e;return[function(r){return t[0]({lengthComputable:n,total:e,loaded:r})},t[1]]},wt=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:je.asap;return function(){for(var n=arguments.length,r=new Array(n),o=0;o2&&void 0!==arguments[2]?arguments[2]:"";return"".concat(t).concat(n).concat(Me)}):t)}function At(e,t){if("string"==typeof e){var n=function(e){return function(e){for(var t=0;t0&&47===e.charCodeAt(n-1);)n--;return e.slice(0,n)+"/"+t.replace(/^\/+/,"")}(e,t)):t}var jt=function(e){return e instanceof qe?m({},e):e};function Tt(e,t){e=e||{},t=t||{};var n=Object.create(null);function r(e,t,n,r){return je.isPlainObject(e)&&je.isPlainObject(t)?je.merge.call({caseless:r},e,t):je.isPlainObject(t)?je.merge({},t):je.isArray(t)?t.slice():t}function o(e,t,n,o){return je.isUndefined(t)?je.isUndefined(e)?void 0:r(void 0,e,0,o):r(e,t,0,o)}function i(e,t){if(!je.isUndefined(t))return r(void 0,t)}function a(e,t){return je.isUndefined(t)?je.isUndefined(e)?void 0:r(void 0,e):r(void 0,t)}function u(n,o,i){return je.hasOwnProp(t,i)?r(n,o):je.hasOwnProp(e,i)?r(void 0,n):void 0}Object.defineProperty(n,"hasOwnProperty",{__proto__:null,value:Object.prototype.hasOwnProperty,enumerable:!1,writable:!0,configurable:!0});var s,c={url:i,method:i,data:i,baseURL:a,transformRequest:a,transformResponse:a,paramsSerializer:a,timeout:a,timeoutMessage:a,withCredentials:a,withXSRFToken:a,adapter:a,responseType:a,xsrfCookieName:a,xsrfHeaderName:a,onUploadProgress:a,onDownloadProgress:a,decompress:a,maxContentLength:a,maxBodyLength:a,beforeRedirect:a,transport:a,httpAgent:a,httpsAgent:a,cancelToken:a,socketPath:a,allowedSocketPaths:a,responseEncoding:a,validateStatus:u,headers:function(e,t,n){return o(jt(e),jt(t),0,!0)}};return je.forEach((s=m(m({},e),t),Object.getOwnPropertySymbols&&Object.getOwnPropertyDescriptor?Object.keys(s).concat(Object.getOwnPropertySymbols(s).filter(function(e){return Object.getOwnPropertyDescriptor(s,e).enumerable})):Object.keys(s)),function(r){if("__proto__"!==r&&"constructor"!==r&&"prototype"!==r){var i=je.hasOwnProp(c,r)?c[r]:o,a=i(je.hasOwnProp(e,r)?e[r]:void 0,je.hasOwnProp(t,r)?t[r]:void 0,r);je.isUndefined(a)&&i!==u||(n[r]=a)}}),je.hasOwnProp(t,"validateStatus")&&je.isUndefined(t.validateStatus)&&!1===function(n){var r=je.hasOwnProp(t,"transitional")?t.transitional:void 0;if(!je.isUndefined(r)){if(!je.isPlainObject(r))return;if(je.hasOwnProp(r,n))return r[n]}var o=je.hasOwnProp(e,"transitional")?e.transitional:void 0;if(je.isPlainObject(o)&&je.hasOwnProp(o,n))return o[n]}("validateStatusUndefinedResolves")&&(je.hasOwnProp(e,"validateStatus")?n.validateStatus=r(void 0,e.validateStatus):delete n.validateStatus),n}var kt=["content-type","content-length"];function Ct(e){var t=Tt({},e),n=function(e){return je.hasOwnProp(t,e)?t[e]:void 0},r=n("data"),o=n("withXSRFToken"),i=n("xsrfHeaderName"),a=n("xsrfCookieName"),u=n("headers"),s=n("auth"),c=n("baseURL"),f=n("allowAbsoluteUrls"),l=n("url");if(t.headers=u=qe.from(u),t.url=et(Pt(c,l,f,t),n("params"),n("paramsSerializer")),s){var d=je.getSafeProp(s,"username")||"",p=je.getSafeProp(s,"password")||"";try{u.set("Authorization","Basic "+btoa(d+":"+(p?encodeURIComponent(p).replace(/%([0-9A-F]{2})/gi,function(e,t){return String.fromCharCode(parseInt(t,16))}):"")))}catch(t){throw We.from(t,We.ERR_BAD_OPTION_VALUE,e)}}if((je.isFormData(r)&&(ct.hasStandardBrowserEnv||ct.hasStandardBrowserWebWorkerEnv||je.isReactNative(r)?u.setContentType(void 0):je.isFunction(r.getHeaders)&&function(e,t,n){"content-only"===n?Object.entries(t||{}).forEach(function(t){var n=R(t,2),r=n[0],o=n[1];kt.includes(r.toLowerCase())&&e.set(r,o)}):e.set(t)}(u,r.getHeaders(),n("formDataHeaderPolicy"))),ct.hasStandardBrowserEnv)&&(je.isFunction(o)&&(o=o(t)),!0===o||null==o&&Ot(t.url))){var h=i&&a&&Et.read(a);h&&u.set(i,h)}return t}var xt="undefined"!=typeof XMLHttpRequest&&function(e){return new Promise(function(t,n){var r,o,i,a,u,s=Ct(e),c=s.data,f=qe.from(s.headers).normalize(),l=s.responseType,d=s.onUploadProgress,p=s.onDownloadProgress;function h(){a&&a(),u&&u(),s.cancelToken&&s.cancelToken.unsubscribe(r),s.signal&&s.signal.removeEventListener("abort",r)}var v=new XMLHttpRequest;function y(){if(v){var r=qe.from("getAllResponseHeaders"in v&&v.getAllResponseHeaders());bt(function(e){t(e),h()},function(e){n(e),h()},{data:l&&"text"!==l&&"json"!==l?v.response:v.responseText,status:v.status,statusText:v.statusText,headers:r,config:e,request:v}),v=null}}if(v.open(s.method.toUpperCase(),s.url,!0),v.timeout=s.timeout,"onloadend"in v?v.onloadend=y:v.onreadystatechange=function(){v&&4===v.readyState&&(0!==v.status||v.responseURL&&v.responseURL.startsWith("file:"))&&setTimeout(y)},v.onabort=function(){v&&(n(new We("Request aborted",We.ECONNABORTED,e,v)),h(),v=null)},v.onerror=function(t){var r=t&&t.message?t.message:"Network Error",o=new We(r,We.ERR_NETWORK,e,v);o.event=t||null,n(o),h(),v=null},v.ontimeout=function(){var t=s.timeout?"timeout of "+s.timeout+"ms exceeded":"timeout exceeded",r=s.transitional||nt;s.timeoutErrorMessage&&(t=s.timeoutErrorMessage),n(new We(t,r.clarifyTimeoutError?We.ETIMEDOUT:We.ECONNABORTED,e,v)),h(),v=null},void 0===c&&f.setContentType(null),"setRequestHeader"in v&&je.forEach(Ne(f),function(e,t){v.setRequestHeader(t,e)}),je.isUndefined(s.withCredentials)||(v.withCredentials=!!s.withCredentials),l&&"json"!==l&&(v.responseType=s.responseType),p){var b=R(mt(p,!0),2);i=b[0],u=b[1],v.addEventListener("progress",i)}if(d&&v.upload){var m=R(mt(d),2);o=m[0],a=m[1],v.upload.addEventListener("progress",o),v.upload.addEventListener("loadend",a)}(s.cancelToken||s.signal)&&(r=function(t){v&&(n(!t||t.type?new yt(null,e,v):t),v.abort(),h(),v=null)},s.cancelToken&&s.cancelToken.subscribe(r),s.signal&&(s.signal.aborted?r():s.signal.addEventListener("abort",r)));var g,w,O=(g=s.url,(w=/^([-+\w]{1,25}):(?:\/\/)?/.exec(g))&&w[1]||"");if(O&&!ct.protocols.includes(O))return n(new We("Unsupported protocol "+O+":",We.ERR_BAD_REQUEST,e)),void h();v.send(c||null)})},Nt=function(e,t){if(e=e?e.filter(Boolean):[],t||e.length){var n=new AbortController,r=!1,o=function(e){if(!r){r=!0,a();var t=e instanceof Error?e:this.reason;n.abort(t instanceof We?t:new yt(t instanceof Error?t.message:t))}},i=t&&setTimeout(function(){i=null,o(new We("timeout of ".concat(t,"ms exceeded"),We.ETIMEDOUT))},t),a=function(){e&&(i&&clearTimeout(i),i=null,e.forEach(function(e){e.unsubscribe?e.unsubscribe(o):e.removeEventListener("abort",o)}),e=null)};e.forEach(function(e){r||(e.aborted?o.call(e):e.addEventListener("abort",o,{once:!0}))});var u=n.signal;return u.unsubscribe=function(){return je.asap(a)},u}},Ut=g().m(function e(t,n){var r,o,i;return g().w(function(e){for(;;)switch(e.n){case 0:if(r=t.byteLength,n&&!(r=48&&e<=57||e>=65&&e<=70||e>=97&&e<=102},It=function(e,t,n){return t+2=65&&e<=90||e>=97&&e<=122||e>=48&&e<=57||43===e||47===e||45===e||95===e},zt=function(e){return 9===e||10===e||12===e||13===e||32===e},Ht=function(e){for(var t=e.length,n=0,r=0,o=!1,i=0;i0?o=!0:n++:r++)}return o||r>2||r>0&&(n+r)%4!=0||n%4==1?function(e){var t=e.length,n=0;return t>0&&61===e.charCodeAt(t-1)&&(n++,t>1&&61===e.charCodeAt(t-2)&&n++),Math.floor(3*(t-n)/4)}(e):function(e){var t=e%4;return 3*Math.floor(e/4)+(2===t?1:3===t?2:0)}(n)};function Wt(e){var t="string"==typeof e?e.indexOf("#"):-1;return function(e,t){if(!e||"string"!=typeof e)return 0;if(!e.startsWith("data:"))return 0;var n=e.indexOf(",");if(n<0)return 0;var r=e.slice(5,n),o=e.slice(n+1);if(/;base64/i.test(r))return t(o);for(var i=0,a=0,u=o.length;a=55296&&s<=56319&&a+1=56320&&c<=57343?(i+=4,a++):i+=3}else i+=3}return i}(-1===t?e:e.slice(0,t),Ht)}var Jt="1.19.0",Vt=je.isFunction,Kt=function(e){return encodeURIComponent(e).replace(/%([0-9A-F]{2})/gi,function(e,t){return String.fromCharCode(parseInt(t,16))})},Xt=function(e){if(!je.isString(e))return e;try{return decodeURIComponent(e)}catch(t){return e}},Gt=function(e){try{for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r-1,N=je.isNumber(C)&&C>-1,U=function(e){return je.hasOwnProp(t,e)?t[e]:void 0},D=i||fetch,_=_?(_+"").toLowerCase():"text",L=Nt([l,d&&d.toAbortSignal()],h),F=null,B=L&&L.unsubscribe&&function(){L.unsubscribe()},q=null,M=function(){return new We("Request body larger than maxBodyLength limit",We.ERR_BAD_REQUEST,t,F)},e.p=1,z=void 0,(H=U("auth"))&&(W=je.getSafeProp(H,"username")||"",J=je.getSafeProp(H,"password")||"",z={username:W,password:J}),$t(o)&&(V=new URL(o,ct.origin),z||!V.username&&!V.password||(K=Xt(V.username),X=Xt(V.password),z={username:K,password:X}),(V.username||V.password)&&(V.username="",V.password="",o=V.href)),z&&(A.delete("authorization"),A.set("Authorization","Basic "+btoa(Kt((z.username||"")+":"+(z.password||""))))),!x||"string"!=typeof o||!o.startsWith("data:")){e.n=2;break}if(!(Wt(o)>k)){e.n=2;break}throw new We("maxContentLength size of "+k+" exceeded",We.ERR_BAD_RESPONSE,t,F);case 2:if(!N||"get"===a||"head"===a){e.n=4;break}return e.n=3,w(c);case 3:if("number"!=typeof(G=e.v)||!isFinite(G)){e.n=4;break}if(I=G,!(G>C)){e.n=4;break}throw M();case 4:if($=N&&(je.isReadableStream(c)||je.isStream(c)),Q=function(e,t,n){return Ft(e,65536,function(e){if(N&&e>C)throw q=M();t&&t(e)},n)},!v||"get"===a||"head"===a||!S&&!$){e.n=8;break}if(null!=I){e.n=6;break}return e.n=5,O(A,c);case 5:Ee=e.v,e.n=7;break;case 6:Ee=I;case 7:(0!==(I=Ee)||$)&&(Z=new u(o,{method:"POST",body:c,duplex:"half"}),je.isFormData(c)&&(Y=Z.headers.get("content-type"))&&A.setContentType(Y),Z.body&&(ee=S&>(I,mt(wt(S)))||[],te=R(ee,2),ne=te[0],re=te[1],c=Q(Z.body,ne,re))),e.n=10;break;case 8:if(!$||f||!p||"get"===a||"head"===a){e.n=9;break}c=Q(c),e.n=10;break;case 9:if(!$||!f||v||"get"===a||"head"===a){e.n=10;break}throw new We("Stream request bodies are not supported by the current fetch implementation",We.ERR_NOT_SUPPORT,t,F);case 10:return je.isString(j)||(j=j?"include":"omit"),oe=f&&"credentials"in u.prototype,je.isFormData(c)&&(ie=A.getContentType())&&/^multipart\/form-data/i.test(ie)&&!/boundary=/i.test(ie)&&A.delete("content-type"),A.set("User-Agent","axios/"+Jt,!1),ae=m(m({},T),{},{signal:L,method:a.toUpperCase(),headers:Ne(A.normalize()),body:c,duplex:"half",credentials:oe?j:void 0}),F=f&&new u(o,ae),e.n=11,f?D(F,T):D(o,ae);case 11:if(ue=e.v,se=qe.from(ue.headers),!x){e.n=12;break}if(!(null!=(ce=je.toFiniteNumber(se.getContentLength()))&&ce>k)){e.n=12;break}throw new We("maxContentLength size of "+k+" exceeded",We.ERR_BAD_RESPONSE,t,F);case 12:return fe=y&&("stream"===_||"response"===_),y&&ue.body&&(E||x||fe&&B)&&(le={},["status","statusText","headers"].forEach(function(e){le[e]=ue[e]}),de=je.toFiniteNumber(se.getContentLength()),pe=E&>(de,mt(wt(E),!0))||[],he=R(pe,2),ve=he[0],ye=he[1],be=function(e){if(x&&e>k)throw new We("maxContentLength size of "+k+" exceeded",We.ERR_BAD_RESPONSE,t,F);ve&&ve(e)},ue=new s(Ft(ue.body,65536,be,function(){ye&&ye(),B&&B()}),le)),_=_||"text",e.n=13,b[je.findKey(b,_)||"text"](ue,t);case 13:if(me=e.v,!x||y||fe){e.n=14;break}if(null!=me&&("number"==typeof me.byteLength?ge=me.byteLength:"number"==typeof me.size?ge=me.size:"string"==typeof me&&(ge="function"==typeof r?(new r).encode(me).byteLength:me.length)),!("number"==typeof ge&&ge>k)){e.n=14;break}throw new We("maxContentLength size of "+k+" exceeded",We.ERR_BAD_RESPONSE,t,F);case 14:return!fe&&B&&B(),e.n=15,new Promise(function(e,n){bt(e,n,{data:me,headers:qe.from(ue.headers),status:ue.status,statusText:ue.statusText,config:t,request:F})});case 15:return e.a(2,e.v);case 16:if(e.p=16,Re=e.v,B&&B(),!(L&&L.aborted&&L.reason instanceof We)){e.n=17;break}throw(we=L.reason).config=t,F&&(we.request=F),Re!==we&&Object.defineProperty(we,"cause",{__proto__:null,value:Re,writable:!0,enumerable:!1,configurable:!0}),we;case 17:if(!q){e.n=18;break}throw F&&!q.request&&(q.request=F),q;case 18:if(!(Re instanceof We)){e.n=19;break}throw F&&!Re.request&&(Re.request=F),Re;case 19:if(!Re||"TypeError"!==Re.name||!/Load failed|fetch/i.test(Re.message)){e.n=20;break}throw Oe=new We("Network Error",We.ERR_NETWORK,t,F,Re&&Re.response),Object.defineProperty(Oe,"cause",{__proto__:null,value:Re.cause||Re,writable:!0,enumerable:!1,configurable:!0}),Oe;case 20:throw We.from(Re,Re&&Re.code,t,F,Re&&Re.response);case 21:return e.a(2)}},e,null,[[1,16]])}));return function(t){return e.apply(this,arguments)}}()},Zt=new Map,Yt=function(e){for(var t,n,r=e&&e.env||{},o=r.fetch,i=[r.Request,r.Response,o],a=i.length,u=Zt;a--;)t=i[a],void 0===(n=u.get(t))&&u.set(t,n=a?new Map:Qt(r)),u=n;return n};Yt();var en={http:null,xhr:xt,fetch:{get:Yt}};je.forEach(en,function(e,t){if(e){try{Object.defineProperty(e,"name",{__proto__:null,value:t})}catch(e){}Object.defineProperty(e,"adapterName",{__proto__:null,value:t})}});var tn=function(e){return"- ".concat(e)},nn=function(e){return je.isFunction(e)||null===e||!1===e};var rn={getAdapter:function(e,t){for(var n,r,o=(e=je.isArray(e)?e:[e]).length,i={},a=0;a1?"since :\n"+s.map(tn).join("\n"):" "+tn(s[0]):"as no adapter specified";throw new We("There is no suitable adapter to dispatch the request "+c,We.ERR_NOT_SUPPORT)}return r},adapters:en};function on(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new yt(null,e)}function an(e){return on(e),e.headers=qe.from(e.headers),e.data=ht.call(e,e.transformRequest),-1!==["post","put","patch"].indexOf(e.method)&&e.headers.setContentType("application/x-www-form-urlencoded",!1),rn.getAdapter(e.adapter||pt.adapter,e)(e).then(function(t){on(e),e.response=t;try{t.data=ht.call(e,e.transformResponse,t)}finally{delete e.response}return t.headers=qe.from(t.headers),t},function(t){if(!vt(t)&&(on(e),t&&t.response)){e.response=t.response;try{t.response.data=ht.call(e,e.transformResponse,t.response)}finally{delete e.response}t.response.headers=qe.from(t.response.headers)}return Promise.reject(t)})}var un={};["object","boolean","number","function","string","symbol"].forEach(function(e,t){un[e]=function(n){return A(n)===e||"a"+(t<1?"n ":" ")+e}});var sn={};un.transitional=function(e,t,n){function r(e,t){return"[Axios v"+Jt+"] Transitional option '"+e+"'"+t+(n?". "+n:"")}return function(n,o,i){if(!1===e)throw new We(r(o," has been removed"+(t?" in "+t:"")),We.ERR_DEPRECATED);return t&&!sn[o]&&(sn[o]=!0,console.warn(r(o," has been deprecated since v"+t+" and will be removed in the near future"))),!e||e(n,o,i)}},un.spelling=function(e){return function(t,n){return console.warn("".concat(n," is likely a misspelling of ").concat(e)),!0}};var cn={assertOptions:function(e,t,n){if("object"!==A(e)||null===e)throw new We("options must be an object",We.ERR_BAD_OPTION_VALUE);for(var r=Object.keys(e),o=r.length;o-- >0;){var i=r[o],a=Object.prototype.hasOwnProperty.call(t,i)?t[i]:void 0;if(a){var u=e[i],s=void 0===u||a(u,i,e);if(!0!==s)throw new We("option "+i+" must be "+s,We.ERR_BAD_OPTION_VALUE)}else if(!0!==n)throw new We("Unknown option "+i,We.ERR_BAD_OPTION)}},validators:un},fn=cn.validators,ln=function(){return l(function e(t){c(this,e),this.defaults=t||{},this.interceptors={request:new tt,response:new tt}},[{key:"request",value:(e=a(g().m(function e(t,n){var r,o,i,a,u,s;return g().w(function(e){for(;;)switch(e.p=e.n){case 0:return e.p=0,e.n=1,this._request(t,n);case 1:return e.a(2,e.v);case 2:if(e.p=2,(s=e.v)instanceof Error){r={},Error.captureStackTrace?Error.captureStackTrace(r):r=new Error,o=function(){if(!r.stack)return"";var e=r.stack.indexOf("\n");return-1===e?"":r.stack.slice(e+1)}();try{s.stack?o&&(i=o.indexOf("\n"),a=-1===i?-1:o.indexOf("\n",i+1),u=-1===a?"":o.slice(a+1),String(s.stack).endsWith(u)||(s.stack+="\n"+o)):s.stack=o}catch(e){}}throw s;case 3:return e.a(2)}},e,this,[[0,2]])})),function(t,n){return e.apply(this,arguments)})},{key:"_request",value:function(e,t){var n=this;"string"==typeof e?(t=t||{}).url=e:t=e||{};var r=t=Tt(this.defaults,t),o=r.transitional,i=r.paramsSerializer,a=r.headers;void 0!==o&&cn.assertOptions(o,{silentJSONParsing:fn.transitional(fn.boolean),forcedJSONParsing:fn.transitional(fn.boolean),clarifyTimeoutError:fn.transitional(fn.boolean),legacyInterceptorReqResOrdering:fn.transitional(fn.boolean),advertiseZstdAcceptEncoding:fn.transitional(fn.boolean),validateStatusUndefinedResolves:fn.transitional(fn.boolean)},!1),null!=i&&(je.isFunction(i)?t.paramsSerializer={serialize:i}:cn.assertOptions(i,{encode:fn.function,serialize:fn.function},!0)),void 0!==t.allowAbsoluteUrls||(void 0!==this.defaults.allowAbsoluteUrls?t.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:t.allowAbsoluteUrls=!0),cn.assertOptions(t,{baseUrl:fn.spelling("baseURL"),withXsrfToken:fn.spelling("withXSRFToken")},!0),t.method=(t.method||this.defaults.method||"get").toLowerCase();var u=a&&je.merge(a.common,a[t.method]);a&&je.forEach(["delete","get","head","post","put","patch","query","common"],function(e){delete a[e]}),t.headers=qe.concat(u,a);var s=[],c=!0;this.interceptors.request.forEach(function(e){if("function"!=typeof e.runWhen||!1!==e.runWhen(t)){c=c&&e.synchronous;var n=t.transitional||nt;n&&n.legacyInterceptorReqResOrdering?s.unshift(e.fulfilled,e.rejected):s.push(e.fulfilled,e.rejected)}});var f,l=[];this.interceptors.response.forEach(function(e){l.push(e.fulfilled,e.rejected)});var d,p=0;if(!c){var h=[an.bind(this),void 0];for(h.unshift.apply(h,s),h.push.apply(h,l),d=h.length,f=Promise.resolve(t);p0;)r._listeners[t](e);r._listeners=null}}),this.promise.then=function(e){var t,n=new Promise(function(e){r.subscribe(e),t=e}).then(e);return n.cancel=function(){r.unsubscribe(t)},n},t(function(e,t,o){r.reason||(r.reason=new yt(e,t,o),n(r.reason))})}return l(e,[{key:"throwIfRequested",value:function(){if(this.reason)throw this.reason}},{key:"subscribe",value:function(e){this.reason?e(this.reason):this._listeners?this._listeners.push(e):this._listeners=[e]}},{key:"unsubscribe",value:function(e){if(this._listeners){var t=this._listeners.indexOf(e);-1!==t&&this._listeners.splice(t,1)}}},{key:"toAbortSignal",value:function(){var e=this,t=new AbortController,n=function(e){t.abort(e)};return this.subscribe(n),t.signal.unsubscribe=function(){return e.unsubscribe(n)},t.signal}}],[{key:"source",value:function(){var t;return{token:new e(function(e){t=e}),cancel:t}}}])}();var pn={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511,WebServerReturnsAnUnknownError:520,WebServerIsDown:521,ConnectionTimedOut:522,OriginIsUnreachable:523,TimeoutOccurred:524,SslHandshakeFailed:525,InvalidSslCertificate:526};Object.entries(pn).forEach(function(e){var t=R(e,2),n=t[0],r=t[1];pn[r]=n});var hn=function e(t){var n=new ln(t),r=C(ln.prototype.request,n);return je.extend(r,ln.prototype,n,{allOwnKeys:!0}),je.extend(r,n,null,{allOwnKeys:!0}),r.create=function(n){return e(Tt(t,n))},r}(pt);return hn.Axios=ln,hn.CanceledError=yt,hn.CancelToken=dn,hn.isCancel=vt,hn.VERSION=Jt,hn.toFormData=Ge,hn.AxiosError=We,hn.Cancel=hn.CanceledError,hn.all=function(e){return Promise.all(e)},hn.spread=function(e){return function(t){return e.apply(null,t)}},hn.isAxiosError=function(e){return je.isObject(e)&&!0===e.isAxiosError},hn.mergeConfig=Tt,hn.AxiosHeaders=qe,hn.formToJSON=function(e){return lt(je.isHTMLForm(e)?new FormData(e):e)},hn.getAdapter=rn.getAdapter,hn.HttpStatusCode=pn,hn.default=hn,hn}); -//# sourceMappingURL=axios.min.js.map diff --git a/server/node_modules/axios/dist/axios.min.js.map b/server/node_modules/axios/dist/axios.min.js.map deleted file mode 100644 index 2698e85..0000000 --- a/server/node_modules/axios/dist/axios.min.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"axios.min.js","sources":["../lib/helpers/bind.js","../lib/utils.js","../lib/helpers/parseHeaders.js","../lib/helpers/sanitizeHeaderValue.js","../lib/core/AxiosHeaders.js","../lib/core/AxiosError.js","../lib/helpers/toFormData.js","../lib/helpers/AxiosURLSearchParams.js","../lib/helpers/buildURL.js","../lib/core/InterceptorManager.js","../lib/defaults/transitional.js","../lib/platform/browser/index.js","../lib/platform/browser/classes/URLSearchParams.js","../lib/platform/browser/classes/FormData.js","../lib/platform/browser/classes/Blob.js","../lib/platform/common/utils.js","../lib/platform/index.js","../lib/helpers/formDataToJSON.js","../lib/defaults/index.js","../lib/helpers/toURLEncodedForm.js","../lib/core/transformData.js","../lib/cancel/isCancel.js","../lib/cancel/CanceledError.js","../lib/core/settle.js","../lib/helpers/progressEventReducer.js","../lib/helpers/speedometer.js","../lib/helpers/throttle.js","../lib/helpers/isURLSameOrigin.js","../lib/helpers/cookies.js","../lib/core/buildFullPath.js","../lib/helpers/isAbsoluteURL.js","../lib/helpers/combineURLs.js","../lib/core/mergeConfig.js","../lib/core/setFormDataHeaders.js","../lib/helpers/resolveConfig.js","../lib/adapters/xhr.js","../lib/helpers/parseProtocol.js","../lib/helpers/composeSignals.js","../lib/helpers/trackStream.js","../lib/helpers/estimateDataURLDecodedBytes.js","../lib/env/data.js","../lib/adapters/fetch.js","../lib/adapters/adapters.js","../lib/helpers/null.js","../lib/core/dispatchRequest.js","../lib/helpers/validator.js","../lib/core/Axios.js","../lib/cancel/CancelToken.js","../lib/helpers/HttpStatusCode.js","../lib/axios.js","../lib/helpers/spread.js","../lib/helpers/isAxiosError.js"],"sourcesContent":["'use strict';\n\n/**\n * Create a bound version of a function with a specified `this` context\n *\n * @param {Function} fn - The function to bind\n * @param {*} thisArg - The value to be passed as the `this` parameter\n * @returns {Function} A new function that will call the original function with the specified `this` context\n */\nexport default function bind(fn, thisArg) {\n return function wrap() {\n return fn.apply(thisArg, arguments);\n };\n}\n","'use strict';\n\nimport bind from './helpers/bind.js';\n\n// utils is a library of generic helper functions non-specific to axios\n\nconst { toString } = Object.prototype;\nconst { getPrototypeOf } = Object;\nconst { iterator, toStringTag } = Symbol;\n\n/* Creating a function that will check if an object has a property. */\nconst hasOwnProperty = (\n ({ hasOwnProperty }) =>\n (obj, prop) =>\n hasOwnProperty.call(obj, prop)\n)(Object.prototype);\n\n/**\n * Walk the prototype chain (excluding the shared Object.prototype) looking for\n * an own `prop`. This distinguishes genuine own/inherited members — including\n * class accessors and template prototypes — from members injected via\n * Object.prototype pollution (e.g. `Object.prototype.username = '...'`), which\n * live on Object.prototype itself and are therefore never matched.\n *\n * @param {*} thing The value whose chain to inspect\n * @param {string|symbol} prop The property key to look for\n *\n * @returns {boolean} True when `prop` is owned below Object.prototype\n */\nconst hasOwnInPrototypeChain = (thing, prop) => {\n let obj = thing;\n const seen = [];\n\n while (obj != null && obj !== Object.prototype) {\n if (seen.indexOf(obj) !== -1) {\n return false;\n }\n seen.push(obj);\n\n if (hasOwnProperty(obj, prop)) {\n return true;\n }\n obj = getPrototypeOf(obj);\n }\n return false;\n};\n\n/**\n * Read `obj[prop]` only when it is safe from Object.prototype pollution. Own\n * properties and members inherited from a non-Object.prototype source (a class\n * instance or template object) are honored; a value reachable only through a\n * polluted Object.prototype is ignored and `undefined` is returned.\n *\n * @param {*} obj The source object\n * @param {string|symbol} prop The property key to read\n *\n * @returns {*} The resolved value, or undefined when unsafe/absent\n */\nconst getSafeProp = (obj, prop) =>\n obj != null && hasOwnInPrototypeChain(obj, prop) ? obj[prop] : undefined;\n\nconst kindOf = ((cache) => (thing) => {\n const str = toString.call(thing);\n return cache[str] || (cache[str] = str.slice(8, -1).toLowerCase());\n})(Object.create(null));\n\nconst kindOfTest = (type) => {\n type = type.toLowerCase();\n return (thing) => kindOf(thing) === type;\n};\n\nconst typeOfTest = (type) => (thing) => typeof thing === type;\n\n/**\n * Determine if a value is a non-null object\n *\n * @param {Object} val The value to test\n *\n * @returns {boolean} True if value is an Array, otherwise false\n */\nconst { isArray } = Array;\n\n/**\n * Determine if a value is undefined\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if the value is undefined, otherwise false\n */\nconst isUndefined = typeOfTest('undefined');\n\n/**\n * Determine if a value is a Buffer\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a Buffer, otherwise false\n */\nfunction isBuffer(val) {\n return (\n val !== null &&\n !isUndefined(val) &&\n val.constructor !== null &&\n !isUndefined(val.constructor) &&\n isFunction(val.constructor.isBuffer) &&\n val.constructor.isBuffer(val)\n );\n}\n\n/**\n * Determine if a value is an ArrayBuffer\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is an ArrayBuffer, otherwise false\n */\nconst isArrayBuffer = kindOfTest('ArrayBuffer');\n\n/**\n * Determine if a value is a view on an ArrayBuffer\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a view on an ArrayBuffer, otherwise false\n */\nfunction isArrayBufferView(val) {\n let result;\n if (typeof ArrayBuffer !== 'undefined' && ArrayBuffer.isView) {\n result = ArrayBuffer.isView(val);\n } else {\n result = val && val.buffer && isArrayBuffer(val.buffer);\n }\n return result;\n}\n\n/**\n * Determine if a value is a String\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a String, otherwise false\n */\nconst isString = typeOfTest('string');\n\n/**\n * Determine if a value is a Function\n *\n * @param {*} val The value to test\n * @returns {boolean} True if value is a Function, otherwise false\n */\nconst isFunction = typeOfTest('function');\n\n/**\n * Determine if a value is a Number\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a Number, otherwise false\n */\nconst isNumber = typeOfTest('number');\n\n/**\n * Determine if a value is an Object\n *\n * @param {*} thing The value to test\n *\n * @returns {boolean} True if value is an Object, otherwise false\n */\nconst isObject = (thing) => thing !== null && typeof thing === 'object';\n\n/**\n * Determine if a value is a Boolean\n *\n * @param {*} thing The value to test\n * @returns {boolean} True if value is a Boolean, otherwise false\n */\nconst isBoolean = (thing) => thing === true || thing === false;\n\n/**\n * Determine if a value is a plain Object\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a plain Object, otherwise false\n */\nconst isPlainObject = (val) => {\n if (!isObject(val)) {\n return false;\n }\n\n const prototype = getPrototypeOf(val);\n return (\n (prototype === null ||\n prototype === Object.prototype ||\n getPrototypeOf(prototype) === null) &&\n // Treat any genuine (non-Object.prototype-polluted) Symbol.toStringTag or\n // Symbol.iterator as evidence the value is a tagged/iterable type rather\n // than a plain object, while ignoring keys injected onto Object.prototype.\n !hasOwnInPrototypeChain(val, toStringTag) &&\n !hasOwnInPrototypeChain(val, iterator)\n );\n};\n\n/**\n * Determine if a value is an empty object (safely handles Buffers)\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is an empty object, otherwise false\n */\nconst isEmptyObject = (val) => {\n // Early return for non-objects or Buffers to prevent RangeError\n if (!isObject(val) || isBuffer(val)) {\n return false;\n }\n\n try {\n return Object.keys(val).length === 0 && Object.getPrototypeOf(val) === Object.prototype;\n } catch (e) {\n // Fallback for any other objects that might cause RangeError with Object.keys()\n return false;\n }\n};\n\n/**\n * Determine if a value is a Date\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a Date, otherwise false\n */\nconst isDate = kindOfTest('Date');\n\n/**\n * Determine if a value is a File\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a File, otherwise false\n */\nconst isFile = kindOfTest('File');\n\n/**\n * Determine if a value is a React Native Blob\n * React Native \"blob\": an object with a `uri` attribute. Optionally, it can\n * also have a `name` and `type` attribute to specify filename and content type\n *\n * @see https://github.com/facebook/react-native/blob/26684cf3adf4094eb6c405d345a75bf8c7c0bf88/Libraries/Network/FormData.js#L68-L71\n *\n * @param {*} value The value to test\n *\n * @returns {boolean} True if value is a React Native Blob, otherwise false\n */\nconst isReactNativeBlob = (value) => {\n return !!(value && typeof value.uri !== 'undefined');\n};\n\n/**\n * Determine if environment is React Native\n * ReactNative `FormData` has a non-standard `getParts()` method\n *\n * @param {*} formData The formData to test\n *\n * @returns {boolean} True if environment is React Native, otherwise false\n */\nconst isReactNative = (formData) => formData && typeof formData.getParts !== 'undefined';\n\n/**\n * Determine if a value is a Blob\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a Blob, otherwise false\n */\nconst isBlob = kindOfTest('Blob');\n\n/**\n * Determine if a value is a FileList\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a FileList, otherwise false\n */\nconst isFileList = kindOfTest('FileList');\nconst isSet = kindOfTest('Set');\n\n/**\n * Determine if a value is a Stream\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a Stream, otherwise false\n */\nconst isStream = (val) => isObject(val) && isFunction(val.pipe);\n\n/**\n * Determine if a value is a FormData\n *\n * @param {*} thing The value to test\n *\n * @returns {boolean} True if value is an FormData, otherwise false\n */\nfunction getGlobal() {\n if (typeof globalThis !== 'undefined') return globalThis;\n if (typeof self !== 'undefined') return self;\n if (typeof window !== 'undefined') return window;\n if (typeof global !== 'undefined') return global;\n return {};\n}\n\nconst G = getGlobal();\nconst FormDataCtor = typeof G.FormData !== 'undefined' ? G.FormData : undefined;\n\nconst isFormData = (thing) => {\n if (!thing) return false;\n if (FormDataCtor && thing instanceof FormDataCtor) return true;\n // Reject plain objects inheriting directly from Object.prototype so prototype-pollution gadgets can't spoof FormData.\n const proto = getPrototypeOf(thing);\n if (!proto || proto === Object.prototype) return false;\n if (!isFunction(thing.append)) return false;\n const kind = kindOf(thing);\n return (\n kind === 'formdata' ||\n // detect form-data instance\n (kind === 'object' && isFunction(thing.toString) && thing.toString() === '[object FormData]')\n );\n};\n\n/**\n * Determine if a value is a URLSearchParams object\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a URLSearchParams object, otherwise false\n */\nconst isURLSearchParams = kindOfTest('URLSearchParams');\n\nconst [isReadableStream, isRequest, isResponse, isHeaders] = [\n 'ReadableStream',\n 'Request',\n 'Response',\n 'Headers',\n].map(kindOfTest);\n\n/**\n * Trim excess whitespace off the beginning and end of a string\n *\n * @param {String} str The String to trim\n *\n * @returns {String} The String freed of excess whitespace\n */\nconst trim = (str) => {\n return str.trim ? str.trim() : str.replace(/^[\\s\\uFEFF\\xA0]+|[\\s\\uFEFF\\xA0]+$/g, '');\n};\n/**\n * Iterate over an Array or an Object invoking a function for each item.\n *\n * If `obj` is an Array callback will be called passing\n * the value, index, and complete array for each item.\n *\n * If 'obj' is an Object callback will be called passing\n * the value, key, and complete object for each property.\n *\n * @param {Object|Array} obj The object to iterate\n * @param {Function} fn The callback to invoke for each item\n *\n * @param {Object} [options]\n * @param {Boolean} [options.allOwnKeys = false]\n * @returns {any}\n */\nfunction forEach(obj, fn, { allOwnKeys = false } = {}) {\n // Don't bother if no value provided\n if (obj === null || typeof obj === 'undefined') {\n return;\n }\n\n let i;\n let l;\n\n // Force an array if not already something iterable\n if (typeof obj !== 'object') {\n /*eslint no-param-reassign:0*/\n obj = [obj];\n }\n\n if (isArray(obj)) {\n // Iterate over array values\n for (i = 0, l = obj.length; i < l; i++) {\n fn.call(null, obj[i], i, obj);\n }\n } else {\n // Buffer check\n if (isBuffer(obj)) {\n return;\n }\n\n // Iterate over object keys\n const keys = allOwnKeys ? Object.getOwnPropertyNames(obj) : Object.keys(obj);\n const len = keys.length;\n let key;\n\n for (i = 0; i < len; i++) {\n key = keys[i];\n fn.call(null, obj[key], key, obj);\n }\n }\n}\n\n/**\n * Finds a key in an object, case-insensitive, returning the actual key name.\n * Returns null if the object is a Buffer or if no match is found.\n *\n * @param {Object} obj - The object to search.\n * @param {string} key - The key to find (case-insensitive).\n * @returns {?string} The actual key name if found, otherwise null.\n */\nfunction findKey(obj, key) {\n if (isBuffer(obj)) {\n return null;\n }\n\n key = key.toLowerCase();\n const keys = Object.keys(obj);\n let i = keys.length;\n let _key;\n while (i-- > 0) {\n _key = keys[i];\n if (key === _key.toLowerCase()) {\n return _key;\n }\n }\n return null;\n}\n\nconst _global = (() => {\n /*eslint no-undef:0*/\n if (typeof globalThis !== 'undefined') return globalThis;\n return typeof self !== 'undefined' ? self : typeof window !== 'undefined' ? window : global;\n})();\n\nconst isContextDefined = (context) => !isUndefined(context) && context !== _global;\n\n/**\n * Accepts varargs expecting each argument to be an object, then\n * immutably merges the properties of each object and returns result.\n *\n * When multiple objects contain the same key the later object in\n * the arguments list will take precedence.\n *\n * Example:\n *\n * ```js\n * const result = merge({foo: 123}, {foo: 456});\n * console.log(result.foo); // outputs 456\n * ```\n *\n * @param {Object} obj1 Object to merge\n *\n * @returns {Object} Result of all merge properties\n */\nfunction merge(...objs) {\n const { caseless, skipUndefined } = (isContextDefined(this) && this) || {};\n const result = {};\n const assignValue = (val, key) => {\n // Skip dangerous property names to prevent prototype pollution\n if (key === '__proto__' || key === 'constructor' || key === 'prototype') {\n return;\n }\n\n // findKey lowercases the key, so caseless lookup only applies to strings —\n // symbol keys are identity-matched.\n const targetKey = (caseless && typeof key === 'string' && findKey(result, key)) || key;\n // Read via own-prop only — a bare `result[targetKey]` walks the prototype\n // chain, so a polluted Object.prototype value could surface here and get\n // copied into the merged result.\n const existing = hasOwnProperty(result, targetKey) ? result[targetKey] : undefined;\n if (isPlainObject(existing) && isPlainObject(val)) {\n result[targetKey] = merge(existing, val);\n } else if (isPlainObject(val)) {\n result[targetKey] = merge({}, val);\n } else if (isArray(val)) {\n result[targetKey] = val.slice();\n } else if (!skipUndefined || !isUndefined(val)) {\n result[targetKey] = val;\n }\n };\n\n for (let i = 0, l = objs.length; i < l; i++) {\n const source = objs[i];\n if (!source || isBuffer(source)) {\n continue;\n }\n\n forEach(source, assignValue);\n\n if (typeof source !== 'object' || isArray(source)) {\n continue;\n }\n\n const symbols = Object.getOwnPropertySymbols(source);\n for (let j = 0; j < symbols.length; j++) {\n const symbol = symbols[j];\n if (propertyIsEnumerable.call(source, symbol)) {\n assignValue(source[symbol], symbol);\n }\n }\n }\n return result;\n}\n\n/**\n * Extends object a by mutably adding to it the properties of object b.\n *\n * @param {Object} a The object to be extended\n * @param {Object} b The object to copy properties from\n * @param {Object} thisArg The object to bind function to\n *\n * @param {Object} [options]\n * @param {Boolean} [options.allOwnKeys]\n * @returns {Object} The resulting value of object a\n */\nconst extend = (a, b, thisArg, { allOwnKeys } = {}) => {\n forEach(\n b,\n (val, key) => {\n if (thisArg && isFunction(val)) {\n Object.defineProperty(a, key, {\n // Null-proto descriptor so a polluted Object.prototype.get cannot\n // hijack defineProperty's accessor-vs-data resolution.\n __proto__: null,\n value: bind(val, thisArg),\n writable: true,\n enumerable: true,\n configurable: true,\n });\n } else {\n Object.defineProperty(a, key, {\n __proto__: null,\n value: val,\n writable: true,\n enumerable: true,\n configurable: true,\n });\n }\n },\n { allOwnKeys }\n );\n return a;\n};\n\n/**\n * Remove byte order marker. This catches EF BB BF (the UTF-8 BOM)\n *\n * @param {string} content with BOM\n *\n * @returns {string} content value without BOM\n */\nconst stripBOM = (content) => {\n if (content.charCodeAt(0) === 0xfeff) {\n content = content.slice(1);\n }\n return content;\n};\n\n/**\n * Inherit the prototype methods from one constructor into another\n * @param {function} constructor\n * @param {function} superConstructor\n * @param {object} [props]\n * @param {object} [descriptors]\n *\n * @returns {void}\n */\nconst inherits = (constructor, superConstructor, props, descriptors) => {\n constructor.prototype = Object.create(superConstructor.prototype, descriptors);\n Object.defineProperty(constructor.prototype, 'constructor', {\n __proto__: null,\n value: constructor,\n writable: true,\n enumerable: false,\n configurable: true,\n });\n Object.defineProperty(constructor, 'super', {\n __proto__: null,\n value: superConstructor.prototype,\n });\n props && Object.assign(constructor.prototype, props);\n};\n\n/**\n * Resolve object with deep prototype chain to a flat object\n * @param {Object} sourceObj source object\n * @param {Object} [destObj]\n * @param {Function|Boolean} [filter]\n * @param {Function} [propFilter]\n *\n * @returns {Object}\n */\nconst toFlatObject = (sourceObj, destObj, filter, propFilter) => {\n let props;\n let i;\n let prop;\n const merged = {};\n\n destObj = destObj || {};\n // eslint-disable-next-line no-eq-null,eqeqeq\n if (sourceObj == null) return destObj;\n\n do {\n props = Object.getOwnPropertyNames(sourceObj);\n i = props.length;\n while (i-- > 0) {\n prop = props[i];\n if ((!propFilter || propFilter(prop, sourceObj, destObj)) && !merged[prop]) {\n destObj[prop] = sourceObj[prop];\n merged[prop] = true;\n }\n }\n sourceObj = filter !== false && getPrototypeOf(sourceObj);\n } while (sourceObj && (!filter || filter(sourceObj, destObj)) && sourceObj !== Object.prototype);\n\n return destObj;\n};\n\n/**\n * Determines whether a string ends with the characters of a specified string\n *\n * @param {String} str\n * @param {String} searchString\n * @param {Number} [position= 0]\n *\n * @returns {boolean}\n */\nconst endsWith = (str, searchString, position) => {\n str = String(str);\n if (position === undefined || position > str.length) {\n position = str.length;\n }\n position -= searchString.length;\n const lastIndex = str.indexOf(searchString, position);\n return lastIndex !== -1 && lastIndex === position;\n};\n\n/**\n * Returns new array from array like object or null if failed\n *\n * @param {*} [thing]\n *\n * @returns {?Array}\n */\nconst toArray = (thing) => {\n if (!thing) return null;\n if (isArray(thing)) return thing;\n let i = thing.length;\n if (!isNumber(i)) return null;\n const arr = new Array(i);\n while (i-- > 0) {\n arr[i] = thing[i];\n }\n return arr;\n};\n\n/**\n * Checking if the Uint8Array exists and if it does, it returns a function that checks if the\n * thing passed in is an instance of Uint8Array\n *\n * @param {TypedArray}\n *\n * @returns {Array}\n */\n// eslint-disable-next-line func-names\nconst isTypedArray = ((TypedArray) => {\n // eslint-disable-next-line func-names\n return (thing) => {\n return TypedArray && thing instanceof TypedArray;\n };\n})(typeof Uint8Array !== 'undefined' && getPrototypeOf(Uint8Array));\n\n/**\n * For each entry in the object, call the function with the key and value.\n *\n * @param {Object} obj - The object to iterate over.\n * @param {Function} fn - The function to call for each entry.\n *\n * @returns {void}\n */\nconst forEachEntry = (obj, fn) => {\n const generator = obj && obj[iterator];\n\n const _iterator = generator.call(obj);\n\n let result;\n\n while ((result = _iterator.next()) && !result.done) {\n const pair = result.value;\n fn.call(obj, pair[0], pair[1]);\n }\n};\n\n/**\n * It takes a regular expression and a string, and returns an array of all the matches\n *\n * @param {string} regExp - The regular expression to match against.\n * @param {string} str - The string to search.\n *\n * @returns {Array}\n */\nconst matchAll = (regExp, str) => {\n let matches;\n const arr = [];\n\n while ((matches = regExp.exec(str)) !== null) {\n arr.push(matches);\n }\n\n return arr;\n};\n\n/* Checking if the kindOfTest function returns true when passed an HTMLFormElement. */\nconst isHTMLForm = kindOfTest('HTMLFormElement');\n\nconst toCamelCase = (str) => {\n return str.toLowerCase().replace(/[-_\\s]([a-z\\d])(\\w*)/g, function replacer(m, p1, p2) {\n return p1.toUpperCase() + p2;\n });\n};\n\nconst { propertyIsEnumerable } = Object.prototype;\n\n/**\n * Determine if a value is a RegExp object\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a RegExp object, otherwise false\n */\nconst isRegExp = kindOfTest('RegExp');\n\nconst reduceDescriptors = (obj, reducer) => {\n const descriptors = Object.getOwnPropertyDescriptors(obj);\n const reducedDescriptors = {};\n\n forEach(descriptors, (descriptor, name) => {\n let ret;\n if ((ret = reducer(descriptor, name, obj)) !== false) {\n reducedDescriptors[name] = ret || descriptor;\n }\n });\n\n Object.defineProperties(obj, reducedDescriptors);\n};\n\n/**\n * Makes all methods read-only\n * @param {Object} obj\n */\n\nconst freezeMethods = (obj) => {\n reduceDescriptors(obj, (descriptor, name) => {\n // skip restricted props in strict mode\n if (isFunction(obj) && ['arguments', 'caller', 'callee'].includes(name)) {\n return false;\n }\n\n const value = obj[name];\n\n if (!isFunction(value)) return;\n\n descriptor.enumerable = false;\n\n if ('writable' in descriptor) {\n descriptor.writable = false;\n return;\n }\n\n if (!descriptor.set) {\n descriptor.set = () => {\n throw Error(\"Can not rewrite read-only method '\" + name + \"'\");\n };\n }\n });\n};\n\n/**\n * Converts an array or a delimited string into an object set with values as keys and true as values.\n * Useful for fast membership checks.\n *\n * @param {Array|string} arrayOrString - The array or string to convert.\n * @param {string} delimiter - The delimiter to use if input is a string.\n * @returns {Object} An object with keys from the array or string, values set to true.\n */\nconst toObjectSet = (arrayOrString, delimiter) => {\n const obj = {};\n\n const define = (arr) => {\n arr.forEach((value) => {\n obj[value] = true;\n });\n };\n\n isArray(arrayOrString) ? define(arrayOrString) : define(String(arrayOrString).split(delimiter));\n\n return obj;\n};\n\nconst noop = () => {};\n\nconst toFiniteNumber = (value, defaultValue) => {\n return value != null && Number.isFinite((value = +value)) ? value : defaultValue;\n};\n\n/**\n * If the thing is a FormData object, return true, otherwise return false.\n *\n * @param {unknown} thing - The thing to check.\n *\n * @returns {boolean}\n */\nfunction isSpecCompliantForm(thing) {\n return !!(\n thing &&\n isFunction(thing.append) &&\n thing[toStringTag] === 'FormData' &&\n thing[iterator]\n );\n}\n\n/**\n * Recursively converts an object to a JSON-compatible object, handling circular references and Buffers.\n *\n * @param {Object} obj - The object to convert.\n * @returns {Object} The JSON-compatible object.\n */\nconst toJSONObject = (obj) => {\n const visited = new WeakSet();\n\n const visit = (source) => {\n if (isObject(source)) {\n if (visited.has(source)) {\n return;\n }\n\n //Buffer check\n if (isBuffer(source)) {\n return source;\n }\n\n if (!('toJSON' in source)) {\n // add-on descent / delete-on-ascent: preserves path semantics, so DAG nodes serialise at every occurrence (see #7230).\n visited.add(source);\n\n let target;\n\n if (isSet(source)) {\n target = [];\n for (const value of source) {\n const reducedValue = visit(value);\n !isUndefined(reducedValue) && target.push(reducedValue);\n }\n } else {\n target = isArray(source) ? [] : {};\n\n forEach(source, (value, key) => {\n const reducedValue = visit(value);\n !isUndefined(reducedValue) && (target[key] = reducedValue);\n });\n }\n\n visited.delete(source);\n\n return target;\n }\n }\n\n return source;\n };\n\n return visit(obj);\n};\n\n/**\n * Determines if a value is an async function.\n *\n * @param {*} thing - The value to test.\n * @returns {boolean} True if value is an async function, otherwise false.\n */\nconst isAsyncFn = kindOfTest('AsyncFunction');\n\n/**\n * Determines if a value is thenable (has then and catch methods).\n *\n * @param {*} thing - The value to test.\n * @returns {boolean} True if value is thenable, otherwise false.\n */\nconst isThenable = (thing) =>\n thing &&\n (isObject(thing) || isFunction(thing)) &&\n isFunction(thing.then) &&\n isFunction(thing.catch);\n\n// original code\n// https://github.com/DigitalBrainJS/AxiosPromise/blob/16deab13710ec09779922131f3fa5954320f83ab/lib/utils.js#L11-L34\n\n/**\n * Provides a cross-platform setImmediate implementation.\n * Uses native setImmediate if available, otherwise falls back to postMessage or setTimeout.\n *\n * @param {boolean} setImmediateSupported - Whether setImmediate is supported.\n * @param {boolean} postMessageSupported - Whether postMessage is supported.\n * @returns {Function} A function to schedule a callback asynchronously.\n */\nconst _setImmediate = ((setImmediateSupported, postMessageSupported) => {\n if (setImmediateSupported) {\n return setImmediate;\n }\n\n return postMessageSupported\n ? ((token, callbacks) => {\n _global.addEventListener(\n 'message',\n ({ source, data }) => {\n if (source === _global && data === token) {\n callbacks.length && callbacks.shift()();\n }\n },\n false\n );\n\n return (cb) => {\n callbacks.push(cb);\n _global.postMessage(token, '*');\n };\n })(`axios@${Math.random()}`, [])\n : (cb) => setTimeout(cb);\n})(typeof setImmediate === 'function', isFunction(_global.postMessage));\n\n/**\n * Schedules a microtask or asynchronous callback as soon as possible.\n * Uses queueMicrotask if available, otherwise falls back to process.nextTick or _setImmediate.\n *\n * @type {Function}\n */\nconst asap =\n typeof queueMicrotask !== 'undefined'\n ? queueMicrotask.bind(_global)\n : (typeof process !== 'undefined' && process.nextTick) || _setImmediate;\n\n// *********************\n\nconst isIterable = (thing) => thing != null && isFunction(thing[iterator]);\n\n/**\n * Determine if a value is iterable via an iterator that is NOT sourced solely\n * from a polluted Object.prototype. Use this instead of `isIterable` whenever\n * the iterable comes from untrusted input (e.g. user-supplied header sources),\n * so `Object.prototype[Symbol.iterator] = ...` cannot turn an ordinary object\n * into an attacker-controlled entries iterator.\n *\n * @param {*} thing The value to test\n *\n * @returns {boolean} True if value has a non-polluted iterator\n */\nconst isSafeIterable = (thing) =>\n thing != null && hasOwnInPrototypeChain(thing, iterator) && isIterable(thing);\n\nexport default {\n isArray,\n isArrayBuffer,\n isBuffer,\n isFormData,\n isArrayBufferView,\n isString,\n isNumber,\n isBoolean,\n isObject,\n isPlainObject,\n isEmptyObject,\n isReadableStream,\n isRequest,\n isResponse,\n isHeaders,\n isUndefined,\n isDate,\n isFile,\n isReactNativeBlob,\n isReactNative,\n isBlob,\n isRegExp,\n isFunction,\n isStream,\n isURLSearchParams,\n isTypedArray,\n isFileList,\n forEach,\n merge,\n extend,\n trim,\n stripBOM,\n inherits,\n toFlatObject,\n kindOf,\n kindOfTest,\n endsWith,\n toArray,\n forEachEntry,\n matchAll,\n isHTMLForm,\n hasOwnProperty,\n hasOwnProp: hasOwnProperty, // an alias to avoid ESLint no-prototype-builtins detection\n hasOwnInPrototypeChain,\n getSafeProp,\n reduceDescriptors,\n freezeMethods,\n toObjectSet,\n toCamelCase,\n noop,\n toFiniteNumber,\n findKey,\n global: _global,\n isContextDefined,\n isSpecCompliantForm,\n toJSONObject,\n isAsyncFn,\n isThenable,\n setImmediate: _setImmediate,\n asap,\n isIterable,\n isSafeIterable,\n};\n","'use strict';\n\nimport utils from '../utils.js';\n\n// RawAxiosHeaders whose duplicates are ignored by node\n// c.f. https://nodejs.org/api/http.html#http_message_headers\nconst ignoreDuplicateOf = utils.toObjectSet([\n 'age',\n 'authorization',\n 'content-length',\n 'content-type',\n 'etag',\n 'expires',\n 'from',\n 'host',\n 'if-modified-since',\n 'if-unmodified-since',\n 'last-modified',\n 'location',\n 'max-forwards',\n 'proxy-authorization',\n 'referer',\n 'retry-after',\n 'user-agent',\n]);\n\n/**\n * Parse headers into an object\n *\n * ```\n * Date: Wed, 27 Aug 2014 08:58:49 GMT\n * Content-Type: application/json\n * Connection: keep-alive\n * Transfer-Encoding: chunked\n * ```\n *\n * @param {String} rawHeaders Headers needing to be parsed\n *\n * @returns {Object} Headers parsed into an object\n */\nexport default (rawHeaders) => {\n const parsed = {};\n let key;\n let val;\n let i;\n\n rawHeaders &&\n rawHeaders.split('\\n').forEach(function parser(line) {\n i = line.indexOf(':');\n key = line.substring(0, i).trim().toLowerCase();\n val = line.substring(i + 1).trim();\n\n const hasKey = utils.hasOwnProp(parsed, key);\n\n if (!key || (hasKey && utils.hasOwnProp(ignoreDuplicateOf, key))) {\n return;\n }\n\n if (key === 'set-cookie') {\n if (hasKey) {\n parsed[key].push(val);\n } else {\n parsed[key] = [val];\n }\n } else {\n parsed[key] = hasKey ? parsed[key] + ', ' + val : val;\n }\n });\n\n return parsed;\n};\n","'use strict';\n\nimport utils from '../utils.js';\n\nfunction trimSPorHTAB(str) {\n let start = 0;\n let end = str.length;\n\n while (start < end) {\n const code = str.charCodeAt(start);\n\n if (code !== 0x09 && code !== 0x20) {\n break;\n }\n\n start += 1;\n }\n\n while (end > start) {\n const code = str.charCodeAt(end - 1);\n\n if (code !== 0x09 && code !== 0x20) {\n break;\n }\n\n end -= 1;\n }\n\n return start === 0 && end === str.length ? str : str.slice(start, end);\n}\n\n// The control-code ranges are intentional: header sanitization strips C0/DEL bytes.\n// eslint-disable-next-line no-control-regex\nconst INVALID_UNICODE_HEADER_VALUE_CHARS = new RegExp('[\\\\u0000-\\\\u0008\\\\u000a-\\\\u001f\\\\u007f]+', 'g');\n// eslint-disable-next-line no-control-regex\nconst INVALID_BYTE_STRING_HEADER_VALUE_CHARS = new RegExp('[^\\\\u0009\\\\u0020-\\\\u007e\\\\u0080-\\\\u00ff]+', 'g');\n\nfunction sanitizeValue(value, invalidChars) {\n if (utils.isArray(value)) {\n return value.map((item) => sanitizeValue(item, invalidChars));\n }\n\n return trimSPorHTAB(String(value).replace(invalidChars, ''));\n}\n\nexport const sanitizeHeaderValue = (value) =>\n sanitizeValue(value, INVALID_UNICODE_HEADER_VALUE_CHARS);\n\nexport const sanitizeByteStringHeaderValue = (value) =>\n sanitizeValue(value, INVALID_BYTE_STRING_HEADER_VALUE_CHARS);\n\nexport function toByteStringHeaderObject(headers) {\n const byteStringHeaders = Object.create(null);\n\n utils.forEach(headers.toJSON(), (value, header) => {\n byteStringHeaders[header] = sanitizeByteStringHeaderValue(value);\n });\n\n return byteStringHeaders;\n}\n","'use strict';\n\nimport utils from '../utils.js';\nimport parseHeaders from '../helpers/parseHeaders.js';\nimport { sanitizeHeaderValue } from '../helpers/sanitizeHeaderValue.js';\n\nconst $internals = Symbol('internals');\n\nfunction normalizeHeader(header) {\n return header && String(header).trim().toLowerCase();\n}\n\nfunction normalizeValue(value) {\n if (value === false || value == null) {\n return value;\n }\n\n return utils.isArray(value) ? value.map(normalizeValue) : sanitizeHeaderValue(String(value));\n}\n\nfunction parseTokens(str) {\n const tokens = Object.create(null);\n const tokensRE = /([^\\s,;=]+)\\s*(?:=\\s*([^,;]+))?/g;\n let match;\n\n while ((match = tokensRE.exec(str))) {\n tokens[match[1]] = match[2];\n }\n\n return tokens;\n}\n\nconst parameterNameRE = /^[!#$%&'*+\\-.^_`|~0-9A-Za-z]+$/;\n\nfunction trimOWS(value) {\n let start = 0;\n let end = value.length;\n\n while (start < end) {\n const code = value.charCodeAt(start);\n\n if (code !== 0x09 && code !== 0x20) {\n break;\n }\n\n start += 1;\n }\n\n while (end > start) {\n const code = value.charCodeAt(end - 1);\n\n if (code !== 0x09 && code !== 0x20) {\n break;\n }\n\n end -= 1;\n }\n\n return start === 0 && end === value.length ? value : value.slice(start, end);\n}\n\nfunction decodeQuotedString(value) {\n const last = value.length - 1;\n\n if (last < 1 || value.charCodeAt(0) !== 0x22 || value.charCodeAt(last) !== 0x22) {\n return value;\n }\n\n let decoded = '';\n\n for (let i = 1; i < last; i++) {\n const code = value.charCodeAt(i);\n\n if (code === 0x22) {\n return value;\n }\n\n if (code === 0x5c) {\n i += 1;\n\n if (i >= last) {\n return value;\n }\n }\n\n decoded += value[i];\n }\n\n return decoded;\n}\n\nfunction parseParameters(value) {\n const parameters = Object.create(null);\n const str = String(value);\n let start = 0;\n let quoted = false;\n let escaped = false;\n\n function parseParameter(end) {\n const part = trimOWS(str.slice(start, end));\n const equals = part.indexOf('=');\n\n if (equals < 1) {\n return;\n }\n\n const name = trimOWS(part.slice(0, equals));\n\n if (!parameterNameRE.test(name)) {\n return;\n }\n\n const normalizedName = name.toLowerCase();\n\n if (\n normalizedName === '__proto__' ||\n normalizedName === 'constructor' ||\n normalizedName === 'prototype'\n ) {\n return;\n }\n\n const parameterValue = trimOWS(part.slice(equals + 1));\n parameters[normalizedName] = decodeQuotedString(parameterValue);\n }\n\n for (let i = 0; i < str.length; i++) {\n const code = str.charCodeAt(i);\n\n if (quoted) {\n if (escaped) {\n escaped = false;\n } else if (code === 0x5c) {\n escaped = true;\n } else if (code === 0x22) {\n quoted = false;\n }\n } else if (code === 0x22) {\n quoted = true;\n } else if (code === 0x2c || code === 0x3b) {\n parseParameter(i);\n start = i + 1;\n }\n }\n\n parseParameter(str.length);\n\n return parameters;\n}\n\nconst isValidHeaderName = (str) => /^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(str.trim());\n\nfunction matchHeaderValue(context, value, header, filter, isHeaderNameFilter) {\n if (utils.isFunction(filter)) {\n return filter.call(this, value, header);\n }\n\n if (isHeaderNameFilter) {\n value = header;\n }\n\n if (!utils.isString(value)) return;\n\n if (utils.isString(filter)) {\n return value.indexOf(filter) !== -1;\n }\n\n if (utils.isRegExp(filter)) {\n return filter.test(value);\n }\n}\n\nfunction formatHeader(header) {\n return header\n .trim()\n .toLowerCase()\n .replace(/([a-z\\d])(\\w*)/g, (w, char, str) => {\n return char.toUpperCase() + str;\n });\n}\n\nfunction buildAccessors(obj, header) {\n const accessorName = utils.toCamelCase(' ' + header);\n\n ['get', 'set', 'has'].forEach((methodName) => {\n Object.defineProperty(obj, methodName + accessorName, {\n // Null-proto descriptor so a polluted Object.prototype.get cannot turn\n // this data descriptor into an accessor descriptor on the way in.\n __proto__: null,\n value: function (arg1, arg2, arg3) {\n return this[methodName].call(this, header, arg1, arg2, arg3);\n },\n configurable: true,\n });\n });\n}\n\nclass AxiosHeaders {\n constructor(headers) {\n headers && this.set(headers);\n }\n\n set(header, valueOrRewrite, rewrite) {\n const self = this;\n\n function setHeader(_value, _header, _rewrite) {\n const lHeader = normalizeHeader(_header);\n\n if (!lHeader) {\n return;\n }\n\n const key = utils.findKey(self, lHeader);\n\n if (\n !key ||\n self[key] === undefined ||\n _rewrite === true ||\n (_rewrite === undefined && self[key] !== false)\n ) {\n self[key || _header] = normalizeValue(_value);\n }\n }\n\n const setHeaders = (headers, _rewrite) =>\n utils.forEach(headers, (_value, _header) => setHeader(_value, _header, _rewrite));\n\n if (utils.isPlainObject(header) || header instanceof this.constructor) {\n setHeaders(header, valueOrRewrite);\n } else if (utils.isString(header) && (header = header.trim()) && !isValidHeaderName(header)) {\n setHeaders(parseHeaders(header), valueOrRewrite);\n } else if (utils.isObject(header) && utils.isSafeIterable(header)) {\n let obj = Object.create(null),\n dest,\n key;\n for (const entry of header) {\n if (!utils.isArray(entry)) {\n throw new TypeError('Object iterator must return a key-value pair');\n }\n\n key = entry[0];\n\n if (utils.hasOwnProp(obj, key)) {\n dest = obj[key];\n obj[key] = utils.isArray(dest) ? [...dest, entry[1]] : [dest, entry[1]];\n } else {\n obj[key] = entry[1];\n }\n }\n\n setHeaders(obj, valueOrRewrite);\n } else {\n header != null && setHeader(valueOrRewrite, header, rewrite);\n }\n\n return this;\n }\n\n get(header, parser) {\n header = normalizeHeader(header);\n\n if (header) {\n const key = utils.findKey(this, header);\n\n if (key) {\n const value = this[key];\n\n if (!parser) {\n return value;\n }\n\n if (parser === true) {\n return parseTokens(value);\n }\n\n if (utils.isFunction(parser)) {\n return parser.call(this, value, key);\n }\n\n if (utils.isRegExp(parser)) {\n return parser.exec(value);\n }\n\n throw new TypeError('parser must be boolean|regexp|function');\n }\n }\n }\n\n has(header, matcher) {\n header = normalizeHeader(header);\n\n if (header) {\n const key = utils.findKey(this, header);\n\n return !!(\n key &&\n this[key] !== undefined &&\n (!matcher || matchHeaderValue(this, this[key], key, matcher))\n );\n }\n\n return false;\n }\n\n delete(header, matcher) {\n const self = this;\n let deleted = false;\n\n function deleteHeader(_header) {\n _header = normalizeHeader(_header);\n\n if (_header) {\n const key = utils.findKey(self, _header);\n\n if (key && (!matcher || matchHeaderValue(self, self[key], key, matcher))) {\n delete self[key];\n\n deleted = true;\n }\n }\n }\n\n if (utils.isArray(header)) {\n header.forEach(deleteHeader);\n } else {\n deleteHeader(header);\n }\n\n return deleted;\n }\n\n clear(matcher) {\n const keys = Object.keys(this);\n let i = keys.length;\n let deleted = false;\n\n while (i--) {\n const key = keys[i];\n if (!matcher || matchHeaderValue(this, this[key], key, matcher, true)) {\n delete this[key];\n deleted = true;\n }\n }\n\n return deleted;\n }\n\n normalize(format) {\n const self = this;\n const headers = {};\n\n utils.forEach(this, (value, header) => {\n const key = utils.findKey(headers, header);\n\n if (key) {\n self[key] = normalizeValue(value);\n delete self[header];\n return;\n }\n\n const normalized = format ? formatHeader(header) : String(header).trim();\n\n if (normalized !== header) {\n delete self[header];\n }\n\n self[normalized] = normalizeValue(value);\n\n headers[normalized] = true;\n });\n\n return this;\n }\n\n concat(...targets) {\n return this.constructor.concat(this, ...targets);\n }\n\n toJSON(asStrings) {\n const obj = Object.create(null);\n\n utils.forEach(this, (value, header) => {\n value != null &&\n value !== false &&\n (obj[header] = asStrings && utils.isArray(value) ? value.join(', ') : value);\n });\n\n return obj;\n }\n\n [Symbol.iterator]() {\n return Object.entries(this.toJSON())[Symbol.iterator]();\n }\n\n toString() {\n return Object.entries(this.toJSON())\n .map(([header, value]) => header + ': ' + value)\n .join('\\n');\n }\n\n getSetCookie() {\n const value = this.get('set-cookie');\n return utils.isArray(value) ? value : value == null || value === false ? [] : [value];\n }\n\n get [Symbol.toStringTag]() {\n return 'AxiosHeaders';\n }\n\n static from(thing) {\n return thing instanceof this ? thing : new this(thing);\n }\n\n static parseParameters(value) {\n return parseParameters(value);\n }\n\n static concat(first, ...targets) {\n const computed = new this(first);\n\n targets.forEach((target) => computed.set(target));\n\n return computed;\n }\n\n static accessor(header) {\n const internals =\n (this[$internals] =\n this[$internals] =\n {\n accessors: {},\n });\n\n const accessors = internals.accessors;\n const prototype = this.prototype;\n\n function defineAccessor(_header) {\n const lHeader = normalizeHeader(_header);\n\n if (!accessors[lHeader]) {\n buildAccessors(prototype, _header);\n accessors[lHeader] = true;\n }\n }\n\n utils.isArray(header) ? header.forEach(defineAccessor) : defineAccessor(header);\n\n return this;\n }\n}\n\nAxiosHeaders.accessor([\n 'Content-Type',\n 'Content-Length',\n 'Accept',\n 'Accept-Encoding',\n 'User-Agent',\n 'Authorization',\n]);\n\n// reserved names hotfix\nutils.reduceDescriptors(AxiosHeaders.prototype, ({ value }, key) => {\n let mapped = key[0].toUpperCase() + key.slice(1); // map `set` => `Set`\n return {\n get: () => value,\n set(headerValue) {\n this[mapped] = headerValue;\n },\n };\n});\n\nutils.freezeMethods(AxiosHeaders);\n\nexport default AxiosHeaders;\n","'use strict';\n\nimport utils from '../utils.js';\nimport AxiosHeaders from './AxiosHeaders.js';\n\nexport const REDACTED = '[REDACTED ****]';\n\nfunction hasOwnOrPrototypeToJSON(source) {\n if (utils.hasOwnProp(source, 'toJSON')) {\n return true;\n }\n\n let prototype = Object.getPrototypeOf(source);\n\n while (prototype && prototype !== Object.prototype) {\n if (utils.hasOwnProp(prototype, 'toJSON')) {\n return true;\n }\n\n prototype = Object.getPrototypeOf(prototype);\n }\n\n return false;\n}\n\n// Build a plain-object snapshot of `config` and replace the value of any key\n// (case-insensitive) listed in `redactKeys` with REDACTED. Walks through arrays\n// and AxiosHeaders, and short-circuits on circular references.\nfunction redactConfig(config, redactKeys) {\n const lowerKeys = new Set(redactKeys.map((k) => String(k).toLowerCase()));\n const seen = [];\n\n const visit = (source) => {\n if (source === null || typeof source !== 'object') return source;\n if (utils.isBuffer(source)) return source;\n if (seen.indexOf(source) !== -1) return undefined;\n\n if (source instanceof AxiosHeaders) {\n source = source.toJSON();\n }\n\n seen.push(source);\n\n let result;\n if (utils.isArray(source)) {\n result = [];\n source.forEach((v, i) => {\n const reducedValue = visit(v);\n if (!utils.isUndefined(reducedValue)) {\n result[i] = reducedValue;\n }\n });\n } else {\n if (!utils.isPlainObject(source) && hasOwnOrPrototypeToJSON(source)) {\n seen.pop();\n return source;\n }\n\n result = Object.create(null);\n for (const [key, value] of Object.entries(source)) {\n const reducedValue = lowerKeys.has(key.toLowerCase()) ? REDACTED : visit(value);\n if (!utils.isUndefined(reducedValue)) {\n result[key] = reducedValue;\n }\n }\n }\n\n seen.pop();\n return result;\n };\n\n return visit(config);\n}\n\nfunction stringifySafely(value) {\n try {\n return String(value);\n } catch (err) {\n return '';\n }\n}\n\nfunction aggregateErrorMessage(error) {\n const message = error.errors\n .map((entry) => {\n try {\n return entry && entry.message ? stringifySafely(entry.message) : stringifySafely(entry);\n } catch (err) {\n return '';\n }\n })\n .filter(Boolean)\n .join('; ');\n\n return message || error.name || 'AggregateError';\n}\n\nclass AxiosError extends Error {\n static from(error, code, config, request, response, customProps) {\n // `AggregateError` (thrown by Node on dual-stack/Happy-Eyeballs connection\n // failures) has an empty `message`; its detail lives in `errors[]`. Without\n // this, the wrapped error surfaces with a blank message (see #6721).\n let message = error.message;\n if (!message && utils.isArray(error.errors) && error.errors.length) {\n message = aggregateErrorMessage(error);\n }\n\n const axiosError = new AxiosError(message, code || error.code, config, request, response);\n // Match native `Error` `cause` semantics: non-enumerable. The wrapped\n // error often carries circular internals (sockets, requests, agents), so\n // an enumerable `cause` makes structured loggers (pino/winston) and any\n // own-property walk throw \"Converting circular structure to JSON\".\n // Regression from #6982; see #7205. `__proto__: null` mirrors the\n // `message` descriptor below (prototype-pollution-safe descriptor).\n Object.defineProperty(axiosError, 'cause', {\n __proto__: null,\n value: error,\n writable: true,\n enumerable: false,\n configurable: true,\n });\n axiosError.name = error.name;\n\n // Preserve status from the original error if not already set from response\n if (error.status != null && axiosError.status == null) {\n axiosError.status = error.status;\n }\n\n customProps && Object.assign(axiosError, customProps);\n return axiosError;\n }\n\n /**\n * Create an Error with the specified message, config, error code, request and response.\n *\n * @param {string} message The error message.\n * @param {string} [code] The error code (for example, 'ECONNABORTED').\n * @param {Object} [config] The config.\n * @param {Object} [request] The request.\n * @param {Object} [response] The response.\n *\n * @returns {Error} The created error.\n */\n constructor(message, code, config, request, response) {\n super(message);\n\n // Make message enumerable to maintain backward compatibility\n // The native Error constructor sets message as non-enumerable,\n // but axios < v1.13.3 had it as enumerable\n Object.defineProperty(this, 'message', {\n // Null-proto descriptor so a polluted Object.prototype.get cannot turn\n // this data descriptor into an accessor descriptor on the way in.\n __proto__: null,\n value: message,\n enumerable: true,\n writable: true,\n configurable: true,\n });\n\n this.name = 'AxiosError';\n this.isAxiosError = true;\n code && (this.code = code);\n config && (this.config = config);\n request && (this.request = request);\n if (response) {\n this.response = response;\n this.status = response.status;\n }\n }\n\n toJSON() {\n // Opt-in redaction: when the request config carries a `redact` array, the\n // value of any matching key (case-insensitive, at any depth) is replaced\n // with REDACTED in the serialized snapshot. Undefined or empty leaves the\n // existing serialization behavior unchanged.\n const config = this.config;\n const redactKeys = config && utils.hasOwnProp(config, 'redact') ? config.redact : undefined;\n const serializedConfig =\n utils.isArray(redactKeys) && redactKeys.length > 0\n ? redactConfig(config, redactKeys)\n : utils.toJSONObject(config);\n\n return {\n // Standard\n message: this.message,\n name: this.name,\n // Microsoft\n description: this.description,\n number: this.number,\n // Mozilla\n fileName: this.fileName,\n lineNumber: this.lineNumber,\n columnNumber: this.columnNumber,\n stack: this.stack,\n // Axios\n config: serializedConfig,\n code: this.code,\n status: this.status,\n };\n }\n}\n\n// This can be changed to static properties as soon as the parser options in .eslint.cjs are updated.\nAxiosError.ERR_BAD_OPTION_VALUE = 'ERR_BAD_OPTION_VALUE';\nAxiosError.ERR_BAD_OPTION = 'ERR_BAD_OPTION';\nAxiosError.ECONNABORTED = 'ECONNABORTED';\nAxiosError.ETIMEDOUT = 'ETIMEDOUT';\nAxiosError.ECONNREFUSED = 'ECONNREFUSED';\nAxiosError.ERR_NETWORK = 'ERR_NETWORK';\nAxiosError.ERR_FR_TOO_MANY_REDIRECTS = 'ERR_FR_TOO_MANY_REDIRECTS';\nAxiosError.ERR_DEPRECATED = 'ERR_DEPRECATED';\nAxiosError.ERR_BAD_RESPONSE = 'ERR_BAD_RESPONSE';\nAxiosError.ERR_BAD_REQUEST = 'ERR_BAD_REQUEST';\nAxiosError.ERR_CANCELED = 'ERR_CANCELED';\nAxiosError.ERR_NOT_SUPPORT = 'ERR_NOT_SUPPORT';\nAxiosError.ERR_INVALID_URL = 'ERR_INVALID_URL';\nAxiosError.ERR_FORM_DATA_DEPTH_EXCEEDED = 'ERR_FORM_DATA_DEPTH_EXCEEDED';\n\nexport default AxiosError;\n","'use strict';\n\nimport utils from '../utils.js';\nimport AxiosError from '../core/AxiosError.js';\n// temporary hotfix to avoid circular references until AxiosURLSearchParams is refactored\nimport PlatformFormData from '../platform/node/classes/FormData.js';\nimport PlatformBuffer from '../platform/node/classes/Buffer.js';\n\n// Default nesting limit shared with the inverse transform (formDataToJSON) so\n// the FormData <-> JSON round-trip stays symmetric.\nexport const DEFAULT_FORM_DATA_MAX_DEPTH = 100;\n\n/**\n * Determines if the given thing is a array or js object.\n *\n * @param {string} thing - The object or array to be visited.\n *\n * @returns {boolean}\n */\nfunction isVisitable(thing) {\n return utils.isPlainObject(thing) || utils.isArray(thing);\n}\n\n/**\n * It removes the brackets from the end of a string\n *\n * @param {string} key - The key of the parameter.\n *\n * @returns {string} the key without the brackets.\n */\nfunction removeBrackets(key) {\n return utils.endsWith(key, '[]') ? key.slice(0, -2) : key;\n}\n\n/**\n * It takes a path, a key, and a boolean, and returns a string\n *\n * @param {string} path - The path to the current key.\n * @param {string} key - The key of the current object being iterated over.\n * @param {string} dots - If true, the key will be rendered with dots instead of brackets.\n *\n * @returns {string} The path to the current key.\n */\nfunction renderKey(path, key, dots) {\n if (!path) return key;\n return path\n .concat(key)\n .map(function each(token, i) {\n // eslint-disable-next-line no-param-reassign\n token = removeBrackets(token);\n return !dots && i ? '[' + token + ']' : token;\n })\n .join(dots ? '.' : '');\n}\n\n/**\n * If the array is an array and none of its elements are visitable, then it's a flat array.\n *\n * @param {Array} arr - The array to check\n *\n * @returns {boolean}\n */\nfunction isFlatArray(arr) {\n return utils.isArray(arr) && !arr.some(isVisitable);\n}\n\nconst predicates = utils.toFlatObject(utils, {}, null, function filter(prop) {\n return /^is[A-Z]/.test(prop);\n});\n\n/**\n * Convert a data object to FormData\n *\n * @param {Object} obj\n * @param {?Object} [formData]\n * @param {?Object} [options]\n * @param {Function} [options.visitor]\n * @param {Boolean} [options.metaTokens = true]\n * @param {Boolean} [options.dots = false]\n * @param {?Boolean} [options.indexes = false]\n *\n * @returns {Object}\n **/\n\n/**\n * It converts an object into a FormData object\n *\n * @param {Object} obj - The object to convert to form data.\n * @param {string} formData - The FormData object to append to.\n * @param {Object} options\n *\n * @returns\n */\nfunction toFormData(obj, formData, options) {\n if (!utils.isObject(obj)) {\n throw new TypeError('target must be an object');\n }\n\n // eslint-disable-next-line no-param-reassign\n formData = formData || new (PlatformFormData || FormData)();\n\n // eslint-disable-next-line no-param-reassign\n options = utils.toFlatObject(\n options,\n {\n metaTokens: true,\n dots: false,\n indexes: false,\n },\n false,\n function defined(option, source) {\n // eslint-disable-next-line no-eq-null,eqeqeq\n return !utils.isUndefined(source[option]);\n }\n );\n\n const metaTokens = options.metaTokens;\n // eslint-disable-next-line no-use-before-define\n const visitor = options.visitor || defaultVisitor;\n const dots = options.dots;\n const indexes = options.indexes;\n const _Blob = options.Blob || (typeof Blob !== 'undefined' && Blob);\n const maxDepth = options.maxDepth === undefined ? DEFAULT_FORM_DATA_MAX_DEPTH : options.maxDepth;\n const useBlob = _Blob && utils.isSpecCompliantForm(formData);\n const stack = [];\n\n if (!utils.isFunction(visitor)) {\n throw new TypeError('visitor must be a function');\n }\n\n function convertValue(value) {\n if (value === null) return '';\n\n if (utils.isDate(value)) {\n return value.toISOString();\n }\n\n if (utils.isBoolean(value)) {\n return value.toString();\n }\n\n if (!useBlob && utils.isBlob(value)) {\n throw new AxiosError('Blob is not supported. Use a Buffer instead.');\n }\n\n if (utils.isArrayBuffer(value) || utils.isTypedArray(value)) {\n if (useBlob && typeof _Blob === 'function') {\n return new _Blob([value]);\n }\n if (PlatformBuffer && PlatformBuffer.isBufferAvailable()) {\n return PlatformBuffer.from(value);\n }\n throw new AxiosError('Blob is not supported. Use a Buffer instead.', AxiosError.ERR_NOT_SUPPORT);\n }\n\n return value;\n }\n\n function throwIfMaxDepthExceeded(depth) {\n if (depth > maxDepth) {\n throw new AxiosError(\n 'Object is too deeply nested (' + depth + ' levels). Max depth: ' + maxDepth,\n AxiosError.ERR_FORM_DATA_DEPTH_EXCEEDED\n );\n }\n }\n\n function stringifyWithDepthLimit(value, depth) {\n if (maxDepth === Infinity) {\n return JSON.stringify(value);\n }\n\n const ancestors = [];\n\n return JSON.stringify(value, function limitDepth(_key, currentValue) {\n if (!utils.isObject(currentValue)) {\n return currentValue;\n }\n\n while (ancestors.length && ancestors[ancestors.length - 1] !== this) {\n ancestors.pop();\n }\n\n ancestors.push(currentValue);\n throwIfMaxDepthExceeded(depth + ancestors.length - 1);\n\n return currentValue;\n });\n }\n\n /**\n * Default visitor.\n *\n * @param {*} value\n * @param {String|Number} key\n * @param {Array} path\n * @this {FormData}\n *\n * @returns {boolean} return true to visit the each prop of the value recursively\n */\n function defaultVisitor(value, key, path) {\n let arr = value;\n\n if (utils.isReactNative(formData) && utils.isReactNativeBlob(value)) {\n formData.append(renderKey(path, key, dots), convertValue(value));\n return false;\n }\n\n if (value && !path && typeof value === 'object') {\n if (utils.endsWith(key, '{}')) {\n // eslint-disable-next-line no-param-reassign\n key = metaTokens ? key : key.slice(0, -2);\n // eslint-disable-next-line no-param-reassign\n value = stringifyWithDepthLimit(value, 1);\n } else if (\n (utils.isArray(value) && isFlatArray(value)) ||\n ((utils.isFileList(value) || utils.endsWith(key, '[]')) && (arr = utils.toArray(value)))\n ) {\n // eslint-disable-next-line no-param-reassign\n key = removeBrackets(key);\n\n arr.forEach(function each(el, index) {\n !(utils.isUndefined(el) || el === null) &&\n formData.append(\n // eslint-disable-next-line no-nested-ternary\n indexes === true\n ? renderKey([key], index, dots)\n : indexes === null\n ? key\n : key + '[]',\n convertValue(el)\n );\n });\n return false;\n }\n }\n\n if (isVisitable(value)) {\n return true;\n }\n\n formData.append(renderKey(path, key, dots), convertValue(value));\n\n return false;\n }\n\n const exposedHelpers = Object.assign(predicates, {\n defaultVisitor,\n convertValue,\n isVisitable,\n });\n\n function build(value, path, depth = 0) {\n if (utils.isUndefined(value)) return;\n\n throwIfMaxDepthExceeded(depth);\n\n if (stack.indexOf(value) !== -1) {\n throw new Error('Circular reference detected in ' + path.join('.'));\n }\n\n stack.push(value);\n\n utils.forEach(value, function each(el, key) {\n const result =\n !(utils.isUndefined(el) || el === null) &&\n visitor.call(formData, el, utils.isString(key) ? key.trim() : key, path, exposedHelpers);\n\n if (result === true) {\n build(el, path ? path.concat(key) : [key], depth + 1);\n }\n });\n\n stack.pop();\n }\n\n if (!utils.isObject(obj)) {\n throw new TypeError('data must be an object');\n }\n\n build(obj);\n\n return formData;\n}\n\nexport default toFormData;\n","'use strict';\n\nimport toFormData from './toFormData.js';\n\n/**\n * It encodes a string by replacing all characters that are not in the unreserved set with\n * their percent-encoded equivalents\n *\n * @param {string} str - The string to encode.\n *\n * @returns {string} The encoded string.\n */\nfunction encode(str) {\n const charMap = {\n '!': '%21',\n \"'\": '%27',\n '(': '%28',\n ')': '%29',\n '~': '%7E',\n '%20': '+',\n };\n return encodeURIComponent(str).replace(/[!'()~]|%20/g, function replacer(match) {\n return charMap[match];\n });\n}\n\n/**\n * It takes a params object and converts it to a FormData object\n *\n * @param {Object} params - The parameters to be converted to a FormData object.\n * @param {Object} options - The options object passed to the Axios constructor.\n *\n * @returns {void}\n */\nfunction AxiosURLSearchParams(params, options) {\n this._pairs = [];\n\n params && toFormData(params, this, options);\n}\n\nconst prototype = AxiosURLSearchParams.prototype;\n\nprototype.append = function append(name, value) {\n this._pairs.push([name, value]);\n};\n\nprototype.toString = function toString(encoder) {\n const _encode = encoder\n ? (value) => encoder.call(this, value, encode)\n : encode;\n\n return this._pairs\n .map(function each(pair) {\n return _encode(pair[0]) + '=' + _encode(pair[1]);\n }, '')\n .join('&');\n};\n\nexport default AxiosURLSearchParams;\n","'use strict';\n\nimport utils from '../utils.js';\nimport AxiosURLSearchParams from './AxiosURLSearchParams.js';\n\n/**\n * It replaces URL-encoded forms of `:`, `$`, `,`, and spaces with\n * their plain counterparts (`:`, `$`, `,`, `+`).\n *\n * @param {string} val The value to be encoded.\n *\n * @returns {string} The encoded value.\n */\nexport function encode(val) {\n return encodeURIComponent(val)\n .replace(/%3A/gi, ':')\n .replace(/%24/g, '$')\n .replace(/%2C/gi, ',')\n .replace(/%20/g, '+');\n}\n\n/**\n * Build a URL by appending params to the end\n *\n * @param {string} url The base of the url (e.g., http://www.google.com)\n * @param {object} [params] The params to be appended\n * @param {?(object|Function)} options\n *\n * @returns {string} The formatted url\n */\nexport default function buildURL(url, params, options) {\n if (!params) {\n return url;\n }\n url = url || '';\n\n const _options = utils.isFunction(options)\n ? {\n serialize: options,\n }\n : options;\n\n // Read serializer options pollution-safely: own properties and methods on a\n // class/template prototype are honored, but values injected onto a polluted\n // Object.prototype are ignored.\n const _encode = utils.getSafeProp(_options, 'encode') || encode;\n const serializeFn = utils.getSafeProp(_options, 'serialize');\n\n let serializedParams;\n\n if (serializeFn) {\n serializedParams = serializeFn(params, _options);\n } else {\n serializedParams = utils.isURLSearchParams(params)\n ? params.toString()\n : new AxiosURLSearchParams(params, _options).toString(_encode);\n }\n\n if (serializedParams) {\n const hashmarkIndex = url.indexOf('#');\n\n if (hashmarkIndex !== -1) {\n url = url.slice(0, hashmarkIndex);\n }\n url += (url.indexOf('?') === -1 ? '?' : '&') + serializedParams;\n }\n\n return url;\n}\n","'use strict';\n\nimport utils from '../utils.js';\n\nclass InterceptorManager {\n constructor() {\n this.handlers = [];\n }\n\n /**\n * Add a new interceptor to the stack\n *\n * @param {Function} fulfilled The function to handle `then` for a `Promise`\n * @param {Function} rejected The function to handle `reject` for a `Promise`\n * @param {Object} options The options for the interceptor, synchronous and runWhen\n *\n * @return {Number} An ID used to remove interceptor later\n */\n use(fulfilled, rejected, options) {\n this.handlers.push({\n fulfilled,\n rejected,\n synchronous: options ? options.synchronous : false,\n runWhen: options ? options.runWhen : null,\n });\n return this.handlers.length - 1;\n }\n\n /**\n * Remove an interceptor from the stack\n *\n * @param {Number} id The ID that was returned by `use`\n *\n * @returns {void}\n */\n eject(id) {\n if (this.handlers[id]) {\n this.handlers[id] = null;\n }\n }\n\n /**\n * Clear all interceptors from the stack\n *\n * @returns {void}\n */\n clear() {\n if (this.handlers) {\n this.handlers = [];\n }\n }\n\n /**\n * Iterate over all the registered interceptors\n *\n * This method is particularly useful for skipping over any\n * interceptors that may have become `null` calling `eject`.\n *\n * @param {Function} fn The function to call for each interceptor\n *\n * @returns {void}\n */\n forEach(fn) {\n utils.forEach(this.handlers, function forEachHandler(h) {\n if (h !== null) {\n fn(h);\n }\n });\n }\n}\n\nexport default InterceptorManager;\n","'use strict';\n\nexport default {\n silentJSONParsing: true,\n forcedJSONParsing: true,\n clarifyTimeoutError: false,\n legacyInterceptorReqResOrdering: true,\n advertiseZstdAcceptEncoding: false,\n validateStatusUndefinedResolves: true,\n};\n","import URLSearchParams from './classes/URLSearchParams.js';\nimport FormData from './classes/FormData.js';\nimport Blob from './classes/Blob.js';\n\nexport default {\n isBrowser: true,\n classes: {\n URLSearchParams,\n FormData,\n Blob,\n },\n protocols: ['http', 'https', 'file', 'blob', 'url', 'data'],\n};\n","'use strict';\n\nimport AxiosURLSearchParams from '../../../helpers/AxiosURLSearchParams.js';\nexport default typeof URLSearchParams !== 'undefined' ? URLSearchParams : AxiosURLSearchParams;\n","'use strict';\n\nexport default typeof FormData !== 'undefined' ? FormData : null;\n","'use strict';\n\nexport default typeof Blob !== 'undefined' ? Blob : null;\n","const hasBrowserEnv = typeof window !== 'undefined' && typeof document !== 'undefined';\n\nconst _navigator = (typeof navigator === 'object' && navigator) || undefined;\n\n/**\n * Determine if we're running in a standard browser environment\n *\n * This allows axios to run in a web worker, and react-native.\n * Both environments support XMLHttpRequest, but not fully standard globals.\n *\n * web workers:\n * typeof window -> undefined\n * typeof document -> undefined\n *\n * react-native:\n * navigator.product -> 'ReactNative'\n * nativescript\n * navigator.product -> 'NativeScript' or 'NS'\n *\n * @returns {boolean}\n */\nconst hasStandardBrowserEnv =\n hasBrowserEnv &&\n (!_navigator || ['ReactNative', 'NativeScript', 'NS'].indexOf(_navigator.product) < 0);\n\n/**\n * Determine if we're running in a standard browser webWorker environment\n *\n * Although the `isStandardBrowserEnv` method indicates that\n * `allows axios to run in a web worker`, the WebWorker will still be\n * filtered out due to its judgment standard\n * `typeof window !== 'undefined' && typeof document !== 'undefined'`.\n * This leads to a problem when axios post `FormData` in webWorker\n */\nconst hasStandardBrowserWebWorkerEnv = (() => {\n return (\n typeof WorkerGlobalScope !== 'undefined' &&\n // eslint-disable-next-line no-undef\n self instanceof WorkerGlobalScope &&\n typeof self.importScripts === 'function'\n );\n})();\n\nconst origin = (hasBrowserEnv && window.location.href) || 'http://localhost';\n\nexport {\n hasBrowserEnv,\n hasStandardBrowserWebWorkerEnv,\n hasStandardBrowserEnv,\n _navigator as navigator,\n origin,\n};\n","import platform from './node/index.js';\nimport * as utils from './common/utils.js';\n\nexport default {\n ...utils,\n ...platform,\n};\n","'use strict';\n\nimport utils from '../utils.js';\nimport AxiosError from '../core/AxiosError.js';\nimport { DEFAULT_FORM_DATA_MAX_DEPTH } from './toFormData.js';\n\nconst MAX_DEPTH = DEFAULT_FORM_DATA_MAX_DEPTH;\n\nfunction throwIfDepthExceeded(index) {\n if (index > MAX_DEPTH) {\n throw new AxiosError(\n 'FormData field is too deeply nested (' + index + ' levels). Max depth: ' + MAX_DEPTH,\n AxiosError.ERR_FORM_DATA_DEPTH_EXCEEDED\n );\n }\n}\n\n/**\n * It takes a string like `foo[x][y][z]` and returns an array like `['foo', 'x', 'y', 'z']\n *\n * @param {string} name - The name of the property to get.\n *\n * @returns An array of strings.\n */\nfunction parsePropPath(name) {\n // foo[x][y][z] -> ['foo', 'x', 'y', 'z']\n // foo.x.y.z -> ['foo', 'x', 'y', 'z']\n // A path is split on `.` and on `[...]` groups. A segment — whether written\n // in dot notation or captured inside brackets — may contain any character\n // except `.`, `[` and `]`, so a key like `user-name` or `user name` is kept\n // literal instead of being split (#5402). `.`, `[` and `]` keep their existing\n // meaning, e.g. `foo[bar.baz]` -> ['foo', 'bar', 'baz'] and `[]` is an array push.\n // Excluding `[` from the bracket group also makes the match fail fast at the\n // next `[`, so a malformed name cannot rescan to the end of the string from\n // every unmatched `[` — parsing stays linear in the length of the name.\n const path = [];\n const pattern = /[^.[\\]]+|\\[([^.[\\]]*)]/g;\n let match;\n\n while ((match = pattern.exec(name)) !== null) {\n throwIfDepthExceeded(path.length);\n path.push(match[0] === '[]' ? '' : match[1] || match[0]);\n }\n\n return path;\n}\n\n/**\n * Convert an array to an object.\n *\n * @param {Array} arr - The array to convert to an object.\n *\n * @returns An object with the same keys and values as the array.\n */\nfunction arrayToObject(arr) {\n const obj = {};\n const keys = Object.keys(arr);\n let i;\n const len = keys.length;\n let key;\n for (i = 0; i < len; i++) {\n key = keys[i];\n obj[key] = arr[key];\n }\n return obj;\n}\n\n/**\n * It takes a FormData object and returns a JavaScript object\n *\n * @param {string} formData The FormData object to convert to JSON.\n *\n * @returns {Object | null} The converted object.\n */\nfunction formDataToJSON(formData) {\n function buildPath(path, value, target, index) {\n throwIfDepthExceeded(index);\n\n let name = path[index++];\n\n if (name === '__proto__') return true;\n\n const isNumericKey = Number.isFinite(+name);\n const isLast = index >= path.length;\n name = !name && utils.isArray(target) ? target.length : name;\n\n if (isLast) {\n if (utils.hasOwnProp(target, name)) {\n target[name] = utils.isArray(target[name])\n ? target[name].concat(value)\n : [target[name], value];\n } else {\n target[name] = value;\n }\n\n return !isNumericKey;\n }\n\n if (!utils.hasOwnProp(target, name) || !utils.isObject(target[name])) {\n target[name] = [];\n }\n\n const result = buildPath(path, value, target[name], index);\n\n if (result && utils.isArray(target[name])) {\n target[name] = arrayToObject(target[name]);\n }\n\n return !isNumericKey;\n }\n\n if (utils.isFormData(formData) && utils.isFunction(formData.entries)) {\n const obj = {};\n\n utils.forEachEntry(formData, (name, value) => {\n buildPath(parsePropPath(name), value, obj, 0);\n });\n\n return obj;\n }\n\n return null;\n}\n\nexport default formDataToJSON;\n","'use strict';\n\nimport utils from '../utils.js';\nimport AxiosError from '../core/AxiosError.js';\nimport transitionalDefaults from './transitional.js';\nimport toFormData from '../helpers/toFormData.js';\nimport toURLEncodedForm from '../helpers/toURLEncodedForm.js';\nimport platform from '../platform/index.js';\nimport formDataToJSON from '../helpers/formDataToJSON.js';\n\nconst own = (obj, key) => (obj != null && utils.hasOwnProp(obj, key) ? obj[key] : undefined);\n\n/**\n * It takes a string, tries to parse it, and if it fails, it returns the stringified version\n * of the input\n *\n * @param {any} rawValue - The value to be stringified.\n * @param {Function} parser - A function that parses a string into a JavaScript object.\n * @param {Function} encoder - A function that takes a value and returns a string.\n *\n * @returns {string} A stringified version of the rawValue.\n */\nfunction stringifySafely(rawValue, parser, encoder) {\n if (utils.isString(rawValue)) {\n try {\n (parser || JSON.parse)(rawValue);\n return utils.trim(rawValue);\n } catch (e) {\n if (e.name !== 'SyntaxError') {\n throw e;\n }\n }\n }\n\n return (encoder || JSON.stringify)(rawValue);\n}\n\nconst defaults = {\n transitional: transitionalDefaults,\n\n adapter: ['xhr', 'http', 'fetch'],\n\n transformRequest: [\n function transformRequest(data, headers) {\n const contentType = headers.getContentType() || '';\n const hasJSONContentType = contentType.indexOf('application/json') > -1;\n const isObjectPayload = utils.isObject(data);\n\n if (isObjectPayload && utils.isHTMLForm(data)) {\n data = new FormData(data);\n }\n\n const isFormData = utils.isFormData(data);\n\n if (isFormData) {\n return hasJSONContentType ? JSON.stringify(formDataToJSON(data)) : data;\n }\n\n if (\n utils.isArrayBuffer(data) ||\n utils.isBuffer(data) ||\n utils.isStream(data) ||\n utils.isFile(data) ||\n utils.isBlob(data) ||\n utils.isReadableStream(data)\n ) {\n return data;\n }\n if (utils.isArrayBufferView(data)) {\n return data.buffer;\n }\n if (utils.isURLSearchParams(data)) {\n headers.setContentType('application/x-www-form-urlencoded;charset=utf-8', false);\n return data.toString();\n }\n\n let isFileList;\n\n if (isObjectPayload) {\n const formSerializer = own(this, 'formSerializer');\n if (contentType.indexOf('application/x-www-form-urlencoded') > -1) {\n return toURLEncodedForm(data, formSerializer).toString();\n }\n\n if (\n (isFileList = utils.isFileList(data)) ||\n contentType.indexOf('multipart/form-data') > -1\n ) {\n const env = own(this, 'env');\n const _FormData = env && env.FormData;\n\n return toFormData(\n isFileList ? { 'files[]': data } : data,\n _FormData && new _FormData(),\n formSerializer\n );\n }\n }\n\n if (isObjectPayload || hasJSONContentType) {\n headers.setContentType('application/json', false);\n return stringifySafely(data);\n }\n\n return data;\n },\n ],\n\n transformResponse: [\n function transformResponse(data) {\n const transitional = own(this, 'transitional') || defaults.transitional;\n const forcedJSONParsing = transitional && transitional.forcedJSONParsing;\n const responseType = own(this, 'responseType');\n const JSONRequested = responseType === 'json';\n\n if (utils.isResponse(data) || utils.isReadableStream(data)) {\n return data;\n }\n\n if (\n data &&\n utils.isString(data) &&\n ((forcedJSONParsing && !responseType) || JSONRequested)\n ) {\n const silentJSONParsing = transitional && transitional.silentJSONParsing;\n const strictJSONParsing = !silentJSONParsing && JSONRequested;\n\n try {\n return JSON.parse(data, own(this, 'parseReviver'));\n } catch (e) {\n if (strictJSONParsing) {\n if (e.name === 'SyntaxError') {\n throw AxiosError.from(e, AxiosError.ERR_BAD_RESPONSE, this, null, own(this, 'response'));\n }\n throw e;\n }\n }\n }\n\n return data;\n },\n ],\n\n /**\n * A timeout in milliseconds to abort a request. If set to 0 (default) a\n * timeout is not created.\n */\n timeout: 0,\n\n xsrfCookieName: 'XSRF-TOKEN',\n xsrfHeaderName: 'X-XSRF-TOKEN',\n\n maxContentLength: -1,\n maxBodyLength: -1,\n\n env: {\n FormData: platform.classes.FormData,\n Blob: platform.classes.Blob,\n },\n\n validateStatus: function validateStatus(status) {\n return status >= 200 && status < 300;\n },\n\n headers: {\n common: {\n Accept: 'application/json, text/plain, */*',\n 'Content-Type': undefined,\n },\n },\n};\n\nutils.forEach(['delete', 'get', 'head', 'post', 'put', 'patch', 'query'], (method) => {\n defaults.headers[method] = {};\n});\n\nexport default defaults;\n","'use strict';\n\nimport utils from '../utils.js';\nimport toFormData from './toFormData.js';\nimport platform from '../platform/index.js';\n\nexport default function toURLEncodedForm(data, options) {\n return toFormData(data, new platform.classes.URLSearchParams(), {\n visitor: function (value, key, path, helpers) {\n if (platform.isNode && utils.isBuffer(value)) {\n this.append(key, value.toString('base64'));\n return false;\n }\n\n return helpers.defaultVisitor.apply(this, arguments);\n },\n ...options,\n });\n}\n","'use strict';\n\nimport utils from '../utils.js';\nimport defaults from '../defaults/index.js';\nimport AxiosHeaders from '../core/AxiosHeaders.js';\n\n/**\n * Transform the data for a request or a response\n *\n * @param {Array|Function} fns A single function or Array of functions\n * @param {?Object} response The response object\n *\n * @returns {*} The resulting transformed data\n */\nexport default function transformData(fns, response) {\n const config = this || defaults;\n const context = response || config;\n const headers = AxiosHeaders.from(context.headers);\n let data = context.data;\n\n utils.forEach(fns, function transform(fn) {\n data = fn.call(config, data, headers.normalize(), response ? response.status : undefined);\n });\n\n headers.normalize();\n\n return data;\n}\n","'use strict';\n\nexport default function isCancel(value) {\n return !!(value && value.__CANCEL__);\n}\n","'use strict';\n\nimport AxiosError from '../core/AxiosError.js';\n\nclass CanceledError extends AxiosError {\n /**\n * A `CanceledError` is an object that is thrown when an operation is canceled.\n *\n * @param {string=} message The message.\n * @param {Object=} config The config.\n * @param {Object=} request The request.\n *\n * @returns {CanceledError} The created error.\n */\n constructor(message, config, request) {\n super(message == null ? 'canceled' : message, AxiosError.ERR_CANCELED, config, request);\n this.name = 'CanceledError';\n this.__CANCEL__ = true;\n }\n}\n\nexport default CanceledError;\n","'use strict';\n\nimport AxiosError from './AxiosError.js';\n\n/**\n * Resolve or reject a Promise based on response status.\n *\n * @param {Function} resolve A function that resolves the promise.\n * @param {Function} reject A function that rejects the promise.\n * @param {object} response The response.\n *\n * @returns {object} The response.\n */\nexport default function settle(resolve, reject, response) {\n const validateStatus = response.config.validateStatus;\n if (!response.status || !validateStatus || validateStatus(response.status)) {\n resolve(response);\n } else {\n reject(new AxiosError(\n 'Request failed with status code ' + response.status,\n response.status >= 400 && response.status < 500 ? AxiosError.ERR_BAD_REQUEST : AxiosError.ERR_BAD_RESPONSE,\n response.config,\n response.request,\n response\n ));\n }\n}\n","import speedometer from './speedometer.js';\nimport throttle from './throttle.js';\nimport utils from '../utils.js';\n\nexport const progressEventReducer = (listener, isDownloadStream, freq = 3) => {\n let bytesNotified = 0;\n const _speedometer = speedometer(50, 250);\n\n return throttle((e) => {\n if (!e || typeof e.loaded !== 'number') {\n return;\n }\n const rawLoaded = e.loaded;\n const total = e.lengthComputable ? e.total : undefined;\n const loaded = Math.max(0, total != null ? Math.min(rawLoaded, total) : rawLoaded);\n const progressBytes = Math.max(0, loaded - bytesNotified);\n const rate = _speedometer(progressBytes);\n\n bytesNotified = Math.max(bytesNotified, loaded);\n\n const data = {\n loaded,\n total,\n progress: total ? loaded / total : undefined,\n bytes: progressBytes,\n rate: rate ? rate : undefined,\n estimated: rate && total ? (total - loaded) / rate : undefined,\n event: e,\n lengthComputable: total != null,\n [isDownloadStream ? 'download' : 'upload']: true,\n };\n\n listener(data);\n }, freq);\n};\n\nexport const progressEventDecorator = (total, throttled) => {\n const lengthComputable = total != null;\n\n return [\n (loaded) =>\n throttled[0]({\n lengthComputable,\n total,\n loaded,\n }),\n throttled[1],\n ];\n};\n\nexport const asyncDecorator =\n (fn, scheduler = utils.asap) =>\n (...args) =>\n scheduler(() => fn(...args));\n","'use strict';\n\n/**\n * Calculate data maxRate\n * @param {Number} [samplesCount= 10]\n * @param {Number} [min= 1000]\n * @returns {Function}\n */\nfunction speedometer(samplesCount, min) {\n samplesCount = samplesCount || 10;\n const bytes = new Array(samplesCount);\n const timestamps = new Array(samplesCount);\n let head = 0;\n let tail = 0;\n let firstSampleTS;\n\n min = min !== undefined ? min : 1000;\n\n return function push(chunkLength) {\n const now = Date.now();\n\n const startedAt = timestamps[tail];\n\n if (!firstSampleTS) {\n firstSampleTS = now;\n }\n\n bytes[head] = chunkLength;\n timestamps[head] = now;\n\n let i = tail;\n let bytesCount = 0;\n\n while (i !== head) {\n bytesCount += bytes[i++];\n i = i % samplesCount;\n }\n\n head = (head + 1) % samplesCount;\n\n if (head === tail) {\n tail = (tail + 1) % samplesCount;\n }\n\n if (now - firstSampleTS < min) {\n return;\n }\n\n const passed = startedAt && now - startedAt;\n\n return passed ? Math.round((bytesCount * 1000) / passed) : undefined;\n };\n}\n\nexport default speedometer;\n","/**\n * Throttle decorator\n * @param {Function} fn\n * @param {Number} freq\n * @return {Function}\n */\nfunction throttle(fn, freq) {\n let timestamp = 0;\n let threshold = 1000 / freq;\n let lastArgs;\n let timer;\n\n const invoke = (args, now = Date.now()) => {\n timestamp = now;\n lastArgs = null;\n if (timer) {\n clearTimeout(timer);\n timer = null;\n }\n fn(...args);\n };\n\n const throttled = (...args) => {\n const now = Date.now();\n const passed = now - timestamp;\n if (passed >= threshold) {\n invoke(args, now);\n } else {\n lastArgs = args;\n if (!timer) {\n timer = setTimeout(() => {\n timer = null;\n invoke(lastArgs);\n }, threshold - passed);\n }\n }\n };\n\n const flush = () => lastArgs && invoke(lastArgs);\n\n return [throttled, flush];\n}\n\nexport default throttle;\n","import platform from '../platform/index.js';\n\nexport default platform.hasStandardBrowserEnv\n ? ((origin, isMSIE) => (url) => {\n url = new URL(url, platform.origin);\n\n return (\n origin.protocol === url.protocol &&\n origin.host === url.host &&\n (isMSIE || origin.port === url.port)\n );\n })(\n new URL(platform.origin),\n platform.navigator && /(msie|trident)/i.test(platform.navigator.userAgent)\n )\n : () => true;\n","import utils from '../utils.js';\nimport platform from '../platform/index.js';\n\nexport default platform.hasStandardBrowserEnv\n ? // Standard browser envs support document.cookie\n {\n write(name, value, expires, path, domain, secure, sameSite) {\n if (typeof document === 'undefined') return;\n\n const cookie = [`${name}=${encodeURIComponent(value)}`];\n\n if (utils.isNumber(expires)) {\n cookie.push(`expires=${new Date(expires).toUTCString()}`);\n }\n if (utils.isString(path)) {\n cookie.push(`path=${path}`);\n }\n if (utils.isString(domain)) {\n cookie.push(`domain=${domain}`);\n }\n if (secure === true) {\n cookie.push('secure');\n }\n if (utils.isString(sameSite)) {\n cookie.push(`SameSite=${sameSite}`);\n }\n\n document.cookie = cookie.join('; ');\n },\n\n read(name) {\n if (typeof document === 'undefined') return null;\n // Match name=value by splitting on the semicolon separator instead of building a\n // RegExp from `name` — interpolating an unescaped string into a RegExp would let\n // metacharacters (e.g. `.+?` in an attacker-influenced cookie name) cause ReDoS or\n // match the wrong cookie. Browsers may serialize cookie pairs as either \";\" or\n // \"; \", so ignore optional whitespace before each cookie name.\n const cookies = document.cookie.split(';');\n for (let i = 0; i < cookies.length; i++) {\n const cookie = cookies[i].replace(/^\\s+/, '');\n const eq = cookie.indexOf('=');\n if (eq !== -1 && cookie.slice(0, eq) === name) {\n try {\n return decodeURIComponent(cookie.slice(eq + 1));\n } catch (e) {\n return cookie.slice(eq + 1);\n }\n }\n }\n return null;\n },\n\n remove(name) {\n this.write(name, '', Date.now() - 86400000, '/');\n },\n }\n : // Non-standard browser env (web workers, react-native) lack needed support.\n {\n write() {},\n read() {\n return null;\n },\n remove() {},\n };\n","'use strict';\n\nimport AxiosError, { REDACTED } from './AxiosError.js';\nimport isAbsoluteURL from '../helpers/isAbsoluteURL.js';\nimport combineURLs from '../helpers/combineURLs.js';\n\nconst malformedHttpProtocol = /^https?:(?!\\/\\/)/i;\nconst httpProtocolControlCharacters = /[\\t\\n\\r]/g;\n\nfunction stripLeadingC0ControlOrSpace(url) {\n let i = 0;\n while (i < url.length && url.charCodeAt(i) <= 0x20) {\n i++;\n }\n return url.slice(i);\n}\n\nfunction normalizeURLForProtocolCheck(url) {\n return stripLeadingC0ControlOrSpace(url).replace(httpProtocolControlCharacters, '');\n}\n\n// Redact the parts of a URL that can carry secrets before it is embedded in an\n// error message. AxiosError.toJSON() serializes `message` verbatim and errors\n// are commonly logged, while the opt-in `config.redact` model only cleans\n// config keys — it cannot reach the message. Redact only the genuinely\n// sensitive substrings — userinfo (credentials), query parameter values and\n// fragment contents — with the same REDACTED marker the config redaction uses,\n// while keeping the scheme, host, path and parameter names so the offending\n// request stays accurately identifiable.\nfunction redactFragment(fragment) {\n if (!fragment) {\n return fragment;\n }\n\n return fragment.replace(/(^|&)([^=&]*=)?[^&]+/g, (match, separator, parameterName = '') => {\n return `${separator}${parameterName}${REDACTED}`;\n });\n}\n\nfunction redactSensitiveURLParts(url) {\n const redactedURL = url.replace(/^(https?:\\/{0,2})[^/?#]*@/i, `$1${REDACTED}@`);\n const fragmentIndex = redactedURL.indexOf('#');\n const urlWithoutFragment =\n fragmentIndex === -1 ? redactedURL : redactedURL.slice(0, fragmentIndex);\n const redactedURLWithoutFragment = urlWithoutFragment.replace(\n /([?&][^=&#]*=)[^&#]*/g,\n `$1${REDACTED}`\n );\n\n if (fragmentIndex === -1) {\n return redactedURLWithoutFragment;\n }\n\n return `${redactedURLWithoutFragment}#${redactFragment(redactedURL.slice(fragmentIndex + 1))}`;\n}\n\nfunction assertValidHttpProtocolURL(url, config) {\n if (typeof url === 'string') {\n const normalizedURL = normalizeURLForProtocolCheck(url);\n if (malformedHttpProtocol.test(normalizedURL)) {\n throw new AxiosError(\n `Invalid URL ${JSON.stringify(redactSensitiveURLParts(normalizedURL))}: missing \"//\" after protocol`,\n AxiosError.ERR_INVALID_URL,\n config\n );\n }\n }\n}\n\n/**\n * Creates a new URL by combining the baseURL with the requestedURL,\n * only when the requestedURL is not already an absolute URL.\n * If the requestURL is absolute, this function returns the requestedURL untouched.\n *\n * @param {string} baseURL The base URL\n * @param {string} requestedURL Absolute or relative URL to combine\n *\n * @returns {string} The combined full path\n */\nexport default function buildFullPath(baseURL, requestedURL, allowAbsoluteUrls, config) {\n assertValidHttpProtocolURL(requestedURL, config);\n let isRelativeUrl = !isAbsoluteURL(requestedURL);\n if (baseURL && (isRelativeUrl || allowAbsoluteUrls === false)) {\n assertValidHttpProtocolURL(baseURL, config);\n return combineURLs(baseURL, requestedURL);\n }\n return requestedURL;\n}\n","'use strict';\n\n/**\n * Determines whether the specified URL is absolute\n *\n * @param {string} url The URL to test\n *\n * @returns {boolean} True if the specified URL is absolute, otherwise false\n */\nexport default function isAbsoluteURL(url) {\n // A URL is considered absolute if it begins with \"://\" or \"//\" (protocol-relative URL).\n // RFC 3986 defines scheme name as a sequence of characters beginning with a letter and followed\n // by any combination of letters, digits, plus, period, or hyphen.\n if (typeof url !== 'string') {\n return false;\n }\n\n return /^([a-z][a-z\\d+\\-.]*:)?\\/\\//i.test(url);\n}\n","'use strict';\n\n/**\n * Creates a new URL by combining the specified URLs\n *\n * @param {string} baseURL The base URL\n * @param {string} relativeURL The relative URL\n *\n * @returns {string} The combined URL\n */\nexport default function combineURLs(baseURL, relativeURL) {\n if (!relativeURL) {\n return baseURL;\n }\n\n let end = baseURL.length;\n\n while (end > 0 && baseURL.charCodeAt(end - 1) === 47) {\n end--;\n }\n\n return baseURL.slice(0, end) + '/' + relativeURL.replace(/^\\/+/, '');\n}\n","'use strict';\n\nimport utils from '../utils.js';\nimport AxiosHeaders from './AxiosHeaders.js';\n\nconst headersToObject = (thing) => (thing instanceof AxiosHeaders ? { ...thing } : thing);\n\nconst ownEnumerableKeys = (thing) => {\n if (Object.getOwnPropertySymbols && Object.getOwnPropertyDescriptor) {\n return Object.keys(thing).concat(\n Object.getOwnPropertySymbols(thing).filter(\n (symbol) => Object.getOwnPropertyDescriptor(thing, symbol).enumerable\n )\n );\n }\n return Object.keys(thing);\n};\n\n/**\n * Config-specific merge-function which creates a new config-object\n * by merging two configuration objects together.\n *\n * @param {Object} config1\n * @param {Object} config2\n *\n * @returns {Object} New object resulting from merging config2 to config1\n */\nexport default function mergeConfig(config1, config2) {\n // eslint-disable-next-line no-param-reassign\n config1 = config1 || {};\n config2 = config2 || {};\n\n // Use a null-prototype object so that downstream reads such as `config.auth`\n // or `config.baseURL` cannot inherit polluted values from Object.prototype.\n // `hasOwnProperty` is restored as a non-enumerable own slot to preserve\n // ergonomics for user code that relies on it.\n const config = Object.create(null);\n Object.defineProperty(config, 'hasOwnProperty', {\n // Null-proto descriptor so a polluted Object.prototype.get cannot turn\n // this data descriptor into an accessor descriptor on the way in.\n __proto__: null,\n value: Object.prototype.hasOwnProperty,\n enumerable: false,\n writable: true,\n configurable: true,\n });\n\n function getMergedValue(target, source, prop, caseless) {\n if (utils.isPlainObject(target) && utils.isPlainObject(source)) {\n return utils.merge.call({ caseless }, target, source);\n } else if (utils.isPlainObject(source)) {\n return utils.merge({}, source);\n } else if (utils.isArray(source)) {\n return source.slice();\n }\n return source;\n }\n\n function mergeDeepProperties(a, b, prop, caseless) {\n if (!utils.isUndefined(b)) {\n return getMergedValue(a, b, prop, caseless);\n } else if (!utils.isUndefined(a)) {\n return getMergedValue(undefined, a, prop, caseless);\n }\n }\n\n // eslint-disable-next-line consistent-return\n function valueFromConfig2(a, b) {\n if (!utils.isUndefined(b)) {\n return getMergedValue(undefined, b);\n }\n }\n\n // eslint-disable-next-line consistent-return\n function defaultToConfig2(a, b) {\n if (!utils.isUndefined(b)) {\n return getMergedValue(undefined, b);\n } else if (!utils.isUndefined(a)) {\n return getMergedValue(undefined, a);\n }\n }\n\n function getMergedTransitionalOption(prop) {\n const transitional2 = utils.hasOwnProp(config2, 'transitional')\n ? config2.transitional\n : undefined;\n\n if (!utils.isUndefined(transitional2)) {\n if (utils.isPlainObject(transitional2)) {\n if (utils.hasOwnProp(transitional2, prop)) {\n return transitional2[prop];\n }\n } else {\n return undefined;\n }\n }\n\n const transitional1 = utils.hasOwnProp(config1, 'transitional')\n ? config1.transitional\n : undefined;\n\n if (utils.isPlainObject(transitional1) && utils.hasOwnProp(transitional1, prop)) {\n return transitional1[prop];\n }\n\n return undefined;\n }\n\n // eslint-disable-next-line consistent-return\n function mergeDirectKeys(a, b, prop) {\n if (utils.hasOwnProp(config2, prop)) {\n return getMergedValue(a, b);\n } else if (utils.hasOwnProp(config1, prop)) {\n return getMergedValue(undefined, a);\n }\n }\n\n const mergeMap = {\n url: valueFromConfig2,\n method: valueFromConfig2,\n data: valueFromConfig2,\n baseURL: defaultToConfig2,\n transformRequest: defaultToConfig2,\n transformResponse: defaultToConfig2,\n paramsSerializer: defaultToConfig2,\n timeout: defaultToConfig2,\n timeoutMessage: defaultToConfig2,\n withCredentials: defaultToConfig2,\n withXSRFToken: defaultToConfig2,\n adapter: defaultToConfig2,\n responseType: defaultToConfig2,\n xsrfCookieName: defaultToConfig2,\n xsrfHeaderName: defaultToConfig2,\n onUploadProgress: defaultToConfig2,\n onDownloadProgress: defaultToConfig2,\n decompress: defaultToConfig2,\n maxContentLength: defaultToConfig2,\n maxBodyLength: defaultToConfig2,\n beforeRedirect: defaultToConfig2,\n transport: defaultToConfig2,\n httpAgent: defaultToConfig2,\n httpsAgent: defaultToConfig2,\n cancelToken: defaultToConfig2,\n socketPath: defaultToConfig2,\n allowedSocketPaths: defaultToConfig2,\n responseEncoding: defaultToConfig2,\n validateStatus: mergeDirectKeys,\n headers: (a, b, prop) =>\n mergeDeepProperties(headersToObject(a), headersToObject(b), prop, true),\n };\n\n utils.forEach(ownEnumerableKeys({ ...config1, ...config2 }), function computeConfigValue(prop) {\n if (prop === '__proto__' || prop === 'constructor' || prop === 'prototype') return;\n const merge = utils.hasOwnProp(mergeMap, prop) ? mergeMap[prop] : mergeDeepProperties;\n const a = utils.hasOwnProp(config1, prop) ? config1[prop] : undefined;\n const b = utils.hasOwnProp(config2, prop) ? config2[prop] : undefined;\n const configValue = merge(a, b, prop);\n (utils.isUndefined(configValue) && merge !== mergeDirectKeys) || (config[prop] = configValue);\n });\n\n if (\n utils.hasOwnProp(config2, 'validateStatus') &&\n utils.isUndefined(config2.validateStatus) &&\n getMergedTransitionalOption('validateStatusUndefinedResolves') === false\n ) {\n if (utils.hasOwnProp(config1, 'validateStatus')) {\n config.validateStatus = getMergedValue(undefined, config1.validateStatus);\n } else {\n delete config.validateStatus;\n }\n }\n\n return config;\n}\n","'use strict';\n\nconst FORM_DATA_CONTENT_HEADERS = ['content-type', 'content-length'];\n\n/**\n * Apply the headers generated by a FormData implementation to the request headers,\n * honoring the `formDataHeaderPolicy` option: with 'content-only', copy only the\n * content-* headers; otherwise merge all of them.\n *\n * @param {AxiosHeaders} headers - the request headers to mutate\n * @param {Object | null | undefined} formHeaders - headers produced by the FormData implementation\n * @param {String} [policy] - the resolved `formDataHeaderPolicy` config value\n *\n * @returns {void}\n */\nexport default function setFormDataHeaders(headers, formHeaders, policy) {\n if (policy !== 'content-only') {\n headers.set(formHeaders);\n return;\n }\n\n Object.entries(formHeaders || {}).forEach(([key, val]) => {\n if (FORM_DATA_CONTENT_HEADERS.includes(key.toLowerCase())) {\n headers.set(key, val);\n }\n });\n}\n","import platform from '../platform/index.js';\nimport utils from '../utils.js';\nimport AxiosError from '../core/AxiosError.js';\nimport isURLSameOrigin from './isURLSameOrigin.js';\nimport cookies from './cookies.js';\nimport buildFullPath from '../core/buildFullPath.js';\nimport mergeConfig from '../core/mergeConfig.js';\nimport AxiosHeaders from '../core/AxiosHeaders.js';\nimport setFormDataHeaders from '../core/setFormDataHeaders.js';\nimport buildURL from './buildURL.js';\n\n/**\n * Encode a UTF-8 string to a Latin-1 byte string for use with btoa().\n * This is a modern replacement for the deprecated unescape(encodeURIComponent(str)) pattern.\n *\n * @param {string} str The string to encode\n *\n * @returns {string} UTF-8 bytes as a Latin-1 string\n */\nconst encodeUTF8 = (str) =>\n encodeURIComponent(str).replace(/%([0-9A-F]{2})/gi, (_, hex) =>\n String.fromCharCode(parseInt(hex, 16))\n );\n\nfunction resolveConfig(config) {\n const newConfig = mergeConfig({}, config);\n\n // Read only own properties to prevent prototype pollution gadgets\n // (e.g. Object.prototype.baseURL = 'https://evil.com').\n const own = (key) => (utils.hasOwnProp(newConfig, key) ? newConfig[key] : undefined);\n\n const data = own('data');\n let withXSRFToken = own('withXSRFToken');\n const xsrfHeaderName = own('xsrfHeaderName');\n const xsrfCookieName = own('xsrfCookieName');\n let headers = own('headers');\n const auth = own('auth');\n const baseURL = own('baseURL');\n const allowAbsoluteUrls = own('allowAbsoluteUrls');\n const url = own('url');\n\n newConfig.headers = headers = AxiosHeaders.from(headers);\n\n newConfig.url = buildURL(\n buildFullPath(baseURL, url, allowAbsoluteUrls, newConfig),\n own('params'),\n own('paramsSerializer')\n );\n\n // HTTP basic authentication\n if (auth) {\n const username = utils.getSafeProp(auth, 'username') || '';\n const password = utils.getSafeProp(auth, 'password') || '';\n\n try {\n headers.set(\n 'Authorization',\n 'Basic ' + btoa(username + ':' + (password ? encodeUTF8(password) : ''))\n );\n } catch (e) {\n throw AxiosError.from(e, AxiosError.ERR_BAD_OPTION_VALUE, config);\n }\n }\n\n if (utils.isFormData(data)) {\n if (\n platform.hasStandardBrowserEnv ||\n platform.hasStandardBrowserWebWorkerEnv ||\n utils.isReactNative(data)\n ) {\n headers.setContentType(undefined); // browser/web worker/RN handles it\n } else if (utils.isFunction(data.getHeaders)) {\n // Node.js FormData (like form-data package)\n setFormDataHeaders(headers, data.getHeaders(), own('formDataHeaderPolicy'));\n }\n }\n\n // Add xsrf header\n // This is only done if running in a standard browser environment.\n // Specifically not if we're in a web worker, or react-native.\n\n if (platform.hasStandardBrowserEnv) {\n if (utils.isFunction(withXSRFToken)) {\n withXSRFToken = withXSRFToken(newConfig);\n }\n\n // Strict boolean check — prevents proto-pollution gadgets (e.g. Object.prototype.withXSRFToken = 1)\n // and misconfigurations (e.g. \"false\") from short-circuiting the same-origin check and leaking\n // the XSRF token cross-origin.\n const shouldSendXSRF =\n withXSRFToken === true || (withXSRFToken == null && isURLSameOrigin(newConfig.url));\n\n if (shouldSendXSRF) {\n const xsrfValue = xsrfHeaderName && xsrfCookieName && cookies.read(xsrfCookieName);\n\n if (xsrfValue) {\n headers.set(xsrfHeaderName, xsrfValue);\n }\n }\n }\n\n return newConfig;\n}\n\nexport default resolveConfig;\n","import utils from '../utils.js';\nimport settle from '../core/settle.js';\nimport transitionalDefaults from '../defaults/transitional.js';\nimport AxiosError from '../core/AxiosError.js';\nimport CanceledError from '../cancel/CanceledError.js';\nimport parseProtocol from '../helpers/parseProtocol.js';\nimport platform from '../platform/index.js';\nimport AxiosHeaders from '../core/AxiosHeaders.js';\nimport { progressEventReducer } from '../helpers/progressEventReducer.js';\nimport resolveConfig from '../helpers/resolveConfig.js';\nimport { toByteStringHeaderObject } from '../helpers/sanitizeHeaderValue.js';\n\nconst isXHRAdapterSupported = typeof XMLHttpRequest !== 'undefined';\n\nexport default isXHRAdapterSupported &&\n function (config) {\n return new Promise(function dispatchXhrRequest(resolve, reject) {\n const _config = resolveConfig(config);\n let requestData = _config.data;\n const requestHeaders = AxiosHeaders.from(_config.headers).normalize();\n let { responseType, onUploadProgress, onDownloadProgress } = _config;\n let onCanceled;\n let uploadThrottled, downloadThrottled;\n let flushUpload, flushDownload;\n\n function done() {\n flushUpload && flushUpload(); // flush events\n flushDownload && flushDownload(); // flush events\n\n _config.cancelToken && _config.cancelToken.unsubscribe(onCanceled);\n\n _config.signal && _config.signal.removeEventListener('abort', onCanceled);\n }\n\n let request = new XMLHttpRequest();\n\n request.open(_config.method.toUpperCase(), _config.url, true);\n\n // Set the request timeout in MS\n request.timeout = _config.timeout;\n\n function onloadend() {\n if (!request) {\n return;\n }\n // Prepare the response\n const responseHeaders = AxiosHeaders.from(\n 'getAllResponseHeaders' in request && request.getAllResponseHeaders()\n );\n const responseData =\n !responseType || responseType === 'text' || responseType === 'json'\n ? request.responseText\n : request.response;\n const response = {\n data: responseData,\n status: request.status,\n statusText: request.statusText,\n headers: responseHeaders,\n config,\n request,\n };\n\n settle(\n function _resolve(value) {\n resolve(value);\n done();\n },\n function _reject(err) {\n reject(err);\n done();\n },\n response\n );\n\n // Clean up request\n request = null;\n }\n\n if ('onloadend' in request) {\n // Use onloadend if available\n request.onloadend = onloadend;\n } else {\n // Listen for ready state to emulate onloadend\n request.onreadystatechange = function handleLoad() {\n if (!request || request.readyState !== 4) {\n return;\n }\n\n // The request errored out and we didn't get a response, this will be\n // handled by onerror instead\n // With one exception: request that using file: protocol, most browsers\n // will return status as 0 even though it's a successful request\n if (\n request.status === 0 &&\n !(request.responseURL && request.responseURL.startsWith('file:'))\n ) {\n return;\n }\n // readystate handler is calling before onerror or ontimeout handlers,\n // so we should call onloadend on the next 'tick'\n setTimeout(onloadend);\n };\n }\n\n // Handle browser request cancellation (as opposed to a manual cancellation)\n request.onabort = function handleAbort() {\n if (!request) {\n return;\n }\n\n reject(new AxiosError('Request aborted', AxiosError.ECONNABORTED, config, request));\n done();\n\n // Clean up request\n request = null;\n };\n\n // Handle low level network errors\n request.onerror = function handleError(event) {\n // Browsers deliver a ProgressEvent in XHR onerror\n // (message may be empty; when present, surface it)\n // See https://developer.mozilla.org/docs/Web/API/XMLHttpRequest/error_event\n const msg = event && event.message ? event.message : 'Network Error';\n const err = new AxiosError(msg, AxiosError.ERR_NETWORK, config, request);\n // attach the underlying event for consumers who want details\n err.event = event || null;\n reject(err);\n done();\n request = null;\n };\n\n // Handle timeout\n request.ontimeout = function handleTimeout() {\n let timeoutErrorMessage = _config.timeout\n ? 'timeout of ' + _config.timeout + 'ms exceeded'\n : 'timeout exceeded';\n const transitional = _config.transitional || transitionalDefaults;\n if (_config.timeoutErrorMessage) {\n timeoutErrorMessage = _config.timeoutErrorMessage;\n }\n reject(\n new AxiosError(\n timeoutErrorMessage,\n transitional.clarifyTimeoutError ? AxiosError.ETIMEDOUT : AxiosError.ECONNABORTED,\n config,\n request\n )\n );\n done();\n\n // Clean up request\n request = null;\n };\n\n // Remove Content-Type if data is undefined\n requestData === undefined && requestHeaders.setContentType(null);\n\n // Add headers to the request\n if ('setRequestHeader' in request) {\n utils.forEach(toByteStringHeaderObject(requestHeaders), function setRequestHeader(val, key) {\n request.setRequestHeader(key, val);\n });\n }\n\n // Add withCredentials to request if needed\n if (!utils.isUndefined(_config.withCredentials)) {\n request.withCredentials = !!_config.withCredentials;\n }\n\n // Add responseType to request if needed\n if (responseType && responseType !== 'json') {\n request.responseType = _config.responseType;\n }\n\n // Handle progress if needed\n if (onDownloadProgress) {\n [downloadThrottled, flushDownload] = progressEventReducer(onDownloadProgress, true);\n request.addEventListener('progress', downloadThrottled);\n }\n\n // Not all browsers support upload events\n if (onUploadProgress && request.upload) {\n [uploadThrottled, flushUpload] = progressEventReducer(onUploadProgress);\n\n request.upload.addEventListener('progress', uploadThrottled);\n\n request.upload.addEventListener('loadend', flushUpload);\n }\n\n if (_config.cancelToken || _config.signal) {\n // Handle cancellation\n // eslint-disable-next-line func-names\n onCanceled = (cancel) => {\n if (!request) {\n return;\n }\n reject(!cancel || cancel.type ? new CanceledError(null, config, request) : cancel);\n request.abort();\n done();\n request = null;\n };\n\n _config.cancelToken && _config.cancelToken.subscribe(onCanceled);\n if (_config.signal) {\n _config.signal.aborted\n ? onCanceled()\n : _config.signal.addEventListener('abort', onCanceled);\n }\n }\n\n const protocol = parseProtocol(_config.url);\n\n if (protocol && !platform.protocols.includes(protocol)) {\n reject(\n new AxiosError(\n 'Unsupported protocol ' + protocol + ':',\n AxiosError.ERR_BAD_REQUEST,\n config\n )\n );\n done();\n return;\n }\n\n // Send the request\n request.send(requestData || null);\n });\n };\n","'use strict';\n\nexport default function parseProtocol(url) {\n const match = /^([-+\\w]{1,25}):(?:\\/\\/)?/.exec(url);\n return (match && match[1]) || '';\n}\n","import CanceledError from '../cancel/CanceledError.js';\nimport AxiosError from '../core/AxiosError.js';\nimport utils from '../utils.js';\n\nconst composeSignals = (signals, timeout) => {\n signals = signals ? signals.filter(Boolean) : [];\n\n if (!timeout && !signals.length) {\n return;\n }\n\n const controller = new AbortController();\n\n let aborted = false;\n\n const onabort = function (reason) {\n if (!aborted) {\n aborted = true;\n unsubscribe();\n const err = reason instanceof Error ? reason : this.reason;\n controller.abort(\n err instanceof AxiosError\n ? err\n : new CanceledError(err instanceof Error ? err.message : err)\n );\n }\n };\n\n let timer =\n timeout &&\n setTimeout(() => {\n timer = null;\n onabort(new AxiosError(`timeout of ${timeout}ms exceeded`, AxiosError.ETIMEDOUT));\n }, timeout);\n\n const unsubscribe = () => {\n if (!signals) { return; }\n timer && clearTimeout(timer);\n timer = null;\n signals.forEach((signal) => {\n signal.unsubscribe\n ? signal.unsubscribe(onabort)\n : signal.removeEventListener('abort', onabort);\n });\n signals = null;\n };\n\n signals.forEach((signal) => {\n if (aborted) {\n return;\n }\n\n if (signal.aborted) {\n onabort.call(signal);\n return;\n }\n\n signal.addEventListener('abort', onabort, { once: true });\n });\n\n const { signal } = controller;\n\n signal.unsubscribe = () => utils.asap(unsubscribe);\n\n return signal;\n};\n\nexport default composeSignals;\n","export const streamChunk = function* (chunk, chunkSize) {\n let len = chunk.byteLength;\n\n if (!chunkSize || len < chunkSize) {\n yield chunk;\n return;\n }\n\n let pos = 0;\n let end;\n\n while (pos < len) {\n end = pos + chunkSize;\n yield chunk.slice(pos, end);\n pos = end;\n }\n};\n\nexport const readBytes = async function* (iterable, chunkSize) {\n for await (const chunk of readStream(iterable)) {\n yield* streamChunk(chunk, chunkSize);\n }\n};\n\nconst readStream = async function* (stream) {\n if (stream[Symbol.asyncIterator]) {\n yield* stream;\n return;\n }\n\n const reader = stream.getReader();\n try {\n for (;;) {\n const { done, value } = await reader.read();\n if (done) {\n break;\n }\n yield value;\n }\n } finally {\n await reader.cancel();\n }\n};\n\nexport const trackStream = (stream, chunkSize, onProgress, onFinish) => {\n const iterator = readBytes(stream, chunkSize);\n\n let bytes = 0;\n let done;\n let _onFinish = (e) => {\n if (!done) {\n done = true;\n onFinish && onFinish(e);\n }\n };\n\n return new ReadableStream(\n {\n async pull(controller) {\n try {\n const { done, value } = await iterator.next();\n\n if (done) {\n _onFinish();\n controller.close();\n return;\n }\n\n let len = value.byteLength;\n if (onProgress) {\n let loadedBytes = (bytes += len);\n onProgress(loadedBytes);\n }\n controller.enqueue(new Uint8Array(value));\n } catch (err) {\n _onFinish(err);\n throw err;\n }\n },\n cancel(reason) {\n _onFinish(reason);\n return iterator.return();\n },\n },\n {\n highWaterMark: 2,\n }\n );\n};\n","/**\n * Estimate data: URL byte lengths *without* allocating large buffers.\n * - Fetch percent-decodes a base64 body before decoding it.\n * - Node's Buffer.from(body, 'base64') sizes its backing allocation from the\n * raw body, including ignored characters and content after padding.\n * - Non-base64 data is percent-decoded and then encoded as UTF-8.\n */\nconst isHexDigit = (charCode) =>\n (charCode >= 48 && charCode <= 57) ||\n (charCode >= 65 && charCode <= 70) ||\n (charCode >= 97 && charCode <= 102);\n\nconst isPercentEncodedByte = (str, i, len) =>\n i + 2 < len && isHexDigit(str.charCodeAt(i + 1)) && isHexDigit(str.charCodeAt(i + 2));\n\nconst hexValue = (charCode) => (charCode <= 57 ? charCode - 48 : (charCode & 0xdf) - 55);\n\nconst isBase64Char = (charCode) =>\n (charCode >= 65 && charCode <= 90) || // A-Z\n (charCode >= 97 && charCode <= 122) || // a-z\n (charCode >= 48 && charCode <= 57) || // 0-9\n charCode === 43 || // +\n charCode === 47 || // /\n charCode === 45 || // - (base64url)\n charCode === 95; // _ (base64url)\n\nconst isBase64Whitespace = (charCode) =>\n charCode === 9 || charCode === 10 || charCode === 12 || charCode === 13 || charCode === 32;\n\nconst base64Bytes = (significant) => {\n const groups = Math.floor(significant / 4);\n const remainder = significant % 4;\n return groups * 3 + (remainder === 2 ? 1 : remainder === 3 ? 2 : 0);\n};\n\n// Buffer.byteLength(body, 'base64') uses the raw string length as an allocation\n// upper bound even when Buffer.from later ignores characters or stops at '='.\nconst estimateBase64BufferAllocation = (body) => {\n const len = body.length;\n let padding = 0;\n\n if (len > 0 && body.charCodeAt(len - 1) === 61 /* '=' */) {\n padding++;\n\n if (len > 1 && body.charCodeAt(len - 2) === 61 /* '=' */) {\n padding++;\n }\n }\n\n return Math.floor(((len - padding) * 3) / 4);\n};\n\nconst estimatePercentDecodedBase64Bytes = (body) => {\n const len = body.length;\n let significant = 0;\n let padding = 0;\n let invalid = false;\n\n for (let i = 0; i < len; i++) {\n let code = body.charCodeAt(i);\n\n if (code === 37 /* '%' */ && isPercentEncodedByte(body, i, len)) {\n code = hexValue(body.charCodeAt(i + 1)) * 16 + hexValue(body.charCodeAt(i + 2));\n i += 2;\n }\n\n if (isBase64Whitespace(code)) {\n continue;\n }\n\n if (code === 61 /* '=' */) {\n padding++;\n continue;\n }\n\n if (!isBase64Char(code) || padding > 0) {\n invalid = true;\n continue;\n }\n\n significant++;\n }\n\n // Fetch rejects malformed forgiving-base64 input. Returning the raw-size\n // allocation bound keeps that invalid input from becoming a pre-check bypass.\n if (\n invalid ||\n padding > 2 ||\n (padding > 0 && (significant + padding) % 4 !== 0) ||\n significant % 4 === 1\n ) {\n return estimateBase64BufferAllocation(body);\n }\n\n return base64Bytes(significant);\n};\n\nconst estimateDataURLBytes = (url, estimateBase64) => {\n if (!url || typeof url !== 'string') return 0;\n if (!url.startsWith('data:')) return 0;\n\n const comma = url.indexOf(',');\n if (comma < 0) return 0;\n\n const meta = url.slice(5, comma);\n const body = url.slice(comma + 1);\n const isBase64 = /;base64/i.test(meta);\n\n if (isBase64) {\n return estimateBase64(body);\n }\n\n // Compute UTF-8 byte length directly from UTF-16 code units without allocating\n // a byte buffer (TextEncoder.encode would defeat the DoS guard on large bodies).\n // Valid %XX triplets count as one decoded byte; this matches the bytes that\n // decodeURIComponent(body) would produce before Buffer re-encodes the string.\n let bytes = 0;\n for (let i = 0, len = body.length; i < len; i++) {\n const c = body.charCodeAt(i);\n if (c === 37 /* '%' */ && isPercentEncodedByte(body, i, len)) {\n bytes += 1;\n i += 2;\n } else if (c < 0x80) {\n bytes += 1;\n } else if (c < 0x800) {\n bytes += 2;\n } else if (c >= 0xd800 && c <= 0xdbff && i + 1 < len) {\n const next = body.charCodeAt(i + 1);\n if (next >= 0xdc00 && next <= 0xdfff) {\n bytes += 4;\n i++;\n } else {\n bytes += 3;\n }\n } else {\n bytes += 3;\n }\n }\n return bytes;\n};\n\n/**\n * Estimate the percent-decoded payload size used by Fetch data: URLs.\n *\n * @param {string} url\n * @returns {number}\n */\nexport default function estimateDataURLDecodedBytes(url) {\n // Fetch removes URL fragments before processing a data: URL.\n const fragmentIndex = typeof url === 'string' ? url.indexOf('#') : -1;\n\n return estimateDataURLBytes(\n fragmentIndex === -1 ? url : url.slice(0, fragmentIndex),\n estimatePercentDecodedBase64Bytes\n );\n}\n\n/**\n * Estimate the Buffer backing allocation used by Node's raw base64 decoder.\n *\n * @param {string} url\n * @returns {number}\n */\nexport function estimateDataURLBufferAllocation(url) {\n return estimateDataURLBytes(url, estimateBase64BufferAllocation);\n}\n","export const VERSION = \"1.19.0\";","import platform from '../platform/index.js';\nimport utils from '../utils.js';\nimport AxiosError from '../core/AxiosError.js';\nimport composeSignals from '../helpers/composeSignals.js';\nimport { trackStream } from '../helpers/trackStream.js';\nimport AxiosHeaders from '../core/AxiosHeaders.js';\nimport {\n progressEventReducer,\n progressEventDecorator,\n asyncDecorator,\n} from '../helpers/progressEventReducer.js';\nimport resolveConfig from '../helpers/resolveConfig.js';\nimport settle from '../core/settle.js';\nimport estimateDataURLDecodedBytes from '../helpers/estimateDataURLDecodedBytes.js';\nimport { VERSION } from '../env/data.js';\nimport { toByteStringHeaderObject } from '../helpers/sanitizeHeaderValue.js';\n\nconst DEFAULT_CHUNK_SIZE = 64 * 1024;\n\nconst { isFunction } = utils;\n\n/**\n * Encode a UTF-8 string to a Latin-1 byte string for use with btoa().\n * This is a modern replacement for the deprecated unescape(encodeURIComponent(str)) pattern.\n *\n * @param {string} str The string to encode\n *\n * @returns {string} UTF-8 bytes as a Latin-1 string\n */\nconst encodeUTF8 = (str) =>\n encodeURIComponent(str).replace(/%([0-9A-F]{2})/gi, (_, hex) =>\n String.fromCharCode(parseInt(hex, 16))\n );\n\n// Node's WHATWG URL parser returns `username` and `password` percent-encoded.\n// Decode before composing the `auth` option so credentials such as\n// `my%40email.com:pass` are sent as `my@email.com:pass`. Falls back to the\n// original value for malformed input so a bad encoding never throws.\nconst decodeURIComponentSafe = (value) => {\n if (!utils.isString(value)) {\n return value;\n }\n\n try {\n return decodeURIComponent(value);\n } catch (error) {\n return value;\n }\n};\n\nconst test = (fn, ...args) => {\n try {\n return !!fn(...args);\n } catch (e) {\n return false;\n }\n};\n\nconst maybeWithAuthCredentials = (url) => {\n const protocolIndex = url.indexOf('://');\n let urlToCheck = url;\n if (protocolIndex !== -1) {\n urlToCheck = urlToCheck.slice(protocolIndex + 3);\n }\n return urlToCheck.includes('@') || urlToCheck.includes(':');\n};\n\nconst factory = (env) => {\n const globalObject =\n utils.global !== undefined && utils.global !== null\n ? utils.global\n : globalThis;\n const { ReadableStream, TextEncoder } = globalObject;\n\n env = utils.merge.call(\n {\n skipUndefined: true,\n },\n {\n Request: globalObject.Request,\n Response: globalObject.Response,\n },\n env\n );\n\n const { fetch: envFetch, Request, Response } = env;\n const isFetchSupported = envFetch ? isFunction(envFetch) : typeof fetch === 'function';\n const isRequestSupported = isFunction(Request);\n const isResponseSupported = isFunction(Response);\n\n if (!isFetchSupported) {\n return false;\n }\n\n const isReadableStreamSupported = isFetchSupported && isFunction(ReadableStream);\n\n const encodeText =\n isFetchSupported &&\n (typeof TextEncoder === 'function'\n ? (\n (encoder) => (str) =>\n encoder.encode(str)\n )(new TextEncoder())\n : async (str) => new Uint8Array(await new Request(str).arrayBuffer()));\n\n const supportsRequestStream =\n isRequestSupported &&\n isReadableStreamSupported &&\n test(() => {\n let duplexAccessed = false;\n\n const request = new Request(platform.origin, {\n body: new ReadableStream(),\n method: 'POST',\n get duplex() {\n duplexAccessed = true;\n return 'half';\n },\n });\n\n const hasContentType = request.headers.has('Content-Type');\n\n if (request.body != null) {\n request.body.cancel();\n }\n\n return duplexAccessed && !hasContentType;\n });\n\n const supportsResponseStream =\n isResponseSupported &&\n isReadableStreamSupported &&\n test(() => utils.isReadableStream(new Response('').body));\n\n const resolvers = {\n stream: supportsResponseStream && ((res) => res.body),\n };\n\n isFetchSupported &&\n (() => {\n ['text', 'arrayBuffer', 'blob', 'formData', 'stream'].forEach((type) => {\n !resolvers[type] &&\n (resolvers[type] = (res, config) => {\n let method = res && res[type];\n\n if (method) {\n return method.call(res);\n }\n\n throw new AxiosError(\n `Response type '${type}' is not supported`,\n AxiosError.ERR_NOT_SUPPORT,\n config\n );\n });\n });\n })();\n\n const getBodyLength = async (body) => {\n if (body == null) {\n return 0;\n }\n\n if (utils.isBlob(body)) {\n return body.size;\n }\n\n if (utils.isSpecCompliantForm(body)) {\n const _request = new Request(platform.origin, {\n method: 'POST',\n body,\n });\n return (await _request.arrayBuffer()).byteLength;\n }\n\n if (utils.isArrayBufferView(body) || utils.isArrayBuffer(body)) {\n return body.byteLength;\n }\n\n if (utils.isURLSearchParams(body)) {\n body = body + '';\n }\n\n if (utils.isString(body)) {\n return (await encodeText(body)).byteLength;\n }\n };\n\n const resolveBodyLength = async (headers, body) => {\n const length = utils.toFiniteNumber(headers.getContentLength());\n\n return length == null ? getBodyLength(body) : length;\n };\n\n return async (config) => {\n let {\n url,\n method,\n data,\n signal,\n cancelToken,\n timeout,\n onDownloadProgress,\n onUploadProgress,\n responseType,\n headers,\n withCredentials = 'same-origin',\n fetchOptions,\n maxContentLength,\n maxBodyLength,\n } = resolveConfig(config);\n\n const hasMaxContentLength = utils.isNumber(maxContentLength) && maxContentLength > -1;\n const hasMaxBodyLength = utils.isNumber(maxBodyLength) && maxBodyLength > -1;\n const own = (key) => (utils.hasOwnProp(config, key) ? config[key] : undefined);\n\n let _fetch = envFetch || fetch;\n\n responseType = responseType ? (responseType + '').toLowerCase() : 'text';\n\n let composedSignal = composeSignals(\n [signal, cancelToken && cancelToken.toAbortSignal()],\n timeout\n );\n\n let request = null;\n\n const unsubscribe =\n composedSignal &&\n composedSignal.unsubscribe &&\n (() => {\n composedSignal.unsubscribe();\n });\n\n let requestContentLength;\n\n // AxiosError we raise while the request body is being streamed. Captured\n // by identity so the catch block can surface it directly, regardless of\n // how the runtime wraps the resulting fetch rejection (undici exposes it\n // as `err.cause`; some browsers drop the original error entirely).\n let pendingBodyError = null;\n\n const maxBodyLengthError = () =>\n new AxiosError(\n 'Request body larger than maxBodyLength limit',\n AxiosError.ERR_BAD_REQUEST,\n config,\n request\n );\n\n try {\n // HTTP basic authentication\n let auth = undefined;\n const configAuth = own('auth');\n\n if (configAuth) {\n const username = utils.getSafeProp(configAuth, 'username') || '';\n const password = utils.getSafeProp(configAuth, 'password') || '';\n auth = {\n username,\n password\n };\n }\n\n if (maybeWithAuthCredentials(url)) {\n const parsedURL = new URL(url, platform.origin);\n\n if (!auth && (parsedURL.username || parsedURL.password)) {\n const urlUsername = decodeURIComponentSafe(parsedURL.username);\n const urlPassword = decodeURIComponentSafe(parsedURL.password);\n auth = {\n username: urlUsername,\n password: urlPassword\n };\n }\n\n if (parsedURL.username || parsedURL.password) {\n parsedURL.username = '';\n parsedURL.password = '';\n url = parsedURL.href;\n }\n }\n\n if (auth) {\n headers.delete('authorization');\n headers.set(\n 'Authorization',\n 'Basic ' + btoa(encodeUTF8((auth.username || '') + ':' + (auth.password || '')))\n );\n }\n\n // Enforce maxContentLength for data: URLs up-front so we never materialize\n // an oversized payload. The HTTP adapter applies the same check (see http.js\n // \"if (protocol === 'data:')\" branch).\n if (hasMaxContentLength && typeof url === 'string' && url.startsWith('data:')) {\n const estimated = estimateDataURLDecodedBytes(url);\n if (estimated > maxContentLength) {\n throw new AxiosError(\n 'maxContentLength size of ' + maxContentLength + ' exceeded',\n AxiosError.ERR_BAD_RESPONSE,\n config,\n request\n );\n }\n }\n\n // Enforce maxBodyLength against known-size bodies before dispatch using\n // the body's *actual* size — never a caller-declared Content-Length,\n // which could under-report to slip an oversized body past the check.\n // Unknown-size streams return undefined here and are counted per-chunk\n // below as fetch consumes them.\n if (hasMaxBodyLength && method !== 'get' && method !== 'head') {\n const outboundLength = await getBodyLength(data);\n if (typeof outboundLength === 'number' && isFinite(outboundLength)) {\n requestContentLength = outboundLength;\n if (outboundLength > maxBodyLength) {\n throw maxBodyLengthError();\n }\n }\n }\n\n // A streamed body under maxBodyLength must be counted as fetch consumes\n // it; its size is never trusted from a caller-declared Content-Length.\n const mustEnforceStreamBody =\n hasMaxBodyLength && (utils.isReadableStream(data) || utils.isStream(data));\n\n const trackRequestStream = (stream, onProgress, flush) =>\n trackStream(\n stream,\n DEFAULT_CHUNK_SIZE,\n (loadedBytes) => {\n if (hasMaxBodyLength && loadedBytes > maxBodyLength) {\n throw (pendingBodyError = maxBodyLengthError());\n }\n onProgress && onProgress(loadedBytes);\n },\n flush\n );\n\n if (\n supportsRequestStream &&\n method !== 'get' &&\n method !== 'head' &&\n (onUploadProgress || mustEnforceStreamBody)\n ) {\n requestContentLength =\n requestContentLength == null ? await resolveBodyLength(headers, data) : requestContentLength;\n\n // A declared length of 0 is only trusted to skip the wrap when we are\n // not enforcing a stream limit (which must not rely on that header).\n if (requestContentLength !== 0 || mustEnforceStreamBody) {\n let _request = new Request(url, {\n method: 'POST',\n body: data,\n duplex: 'half',\n });\n\n let contentTypeHeader;\n\n if (utils.isFormData(data) && (contentTypeHeader = _request.headers.get('content-type'))) {\n headers.setContentType(contentTypeHeader);\n }\n\n if (_request.body) {\n const [onProgress, flush] =\n (onUploadProgress &&\n progressEventDecorator(\n requestContentLength,\n progressEventReducer(asyncDecorator(onUploadProgress))\n )) ||\n [];\n\n data = trackRequestStream(_request.body, onProgress, flush);\n }\n }\n } else if (\n mustEnforceStreamBody &&\n !isRequestSupported &&\n isReadableStreamSupported &&\n method !== 'get' &&\n method !== 'head'\n ) {\n data = trackRequestStream(data);\n } else if (\n mustEnforceStreamBody &&\n isRequestSupported &&\n !supportsRequestStream &&\n method !== 'get' &&\n method !== 'head'\n ) {\n throw new AxiosError(\n 'Stream request bodies are not supported by the current fetch implementation',\n AxiosError.ERR_NOT_SUPPORT,\n config,\n request\n );\n }\n\n if (!utils.isString(withCredentials)) {\n withCredentials = withCredentials ? 'include' : 'omit';\n }\n\n // Cloudflare Workers throws when credentials are defined\n // see https://github.com/cloudflare/workerd/issues/902\n const isCredentialsSupported = isRequestSupported && 'credentials' in Request.prototype;\n\n // If data is FormData and Content-Type is multipart/form-data without boundary,\n // delete it so fetch can set it correctly with the boundary\n if (utils.isFormData(data)) {\n const contentType = headers.getContentType();\n if (\n contentType &&\n /^multipart\\/form-data/i.test(contentType) &&\n !/boundary=/i.test(contentType)\n ) {\n headers.delete('content-type');\n }\n }\n\n // Set User-Agent header if not already set (fetch defaults to 'node' in Node.js)\n headers.set('User-Agent', 'axios/' + VERSION, false);\n\n const resolvedOptions = {\n ...fetchOptions,\n signal: composedSignal,\n method: method.toUpperCase(),\n headers: toByteStringHeaderObject(headers.normalize()),\n body: data,\n duplex: 'half',\n credentials: isCredentialsSupported ? withCredentials : undefined,\n };\n\n request = isRequestSupported && new Request(url, resolvedOptions);\n\n let response = await (isRequestSupported\n ? _fetch(request, fetchOptions)\n : _fetch(url, resolvedOptions));\n\n const responseHeaders = AxiosHeaders.from(response.headers);\n\n // Cheap pre-check: if the server honestly declares a content-length that\n // already exceeds the cap, reject before we start streaming.\n if (hasMaxContentLength) {\n const declaredLength = utils.toFiniteNumber(responseHeaders.getContentLength());\n if (declaredLength != null && declaredLength > maxContentLength) {\n throw new AxiosError(\n 'maxContentLength size of ' + maxContentLength + ' exceeded',\n AxiosError.ERR_BAD_RESPONSE,\n config,\n request\n );\n }\n }\n\n const isStreamResponse =\n supportsResponseStream && (responseType === 'stream' || responseType === 'response');\n\n if (\n supportsResponseStream &&\n response.body &&\n (onDownloadProgress || hasMaxContentLength || (isStreamResponse && unsubscribe))\n ) {\n const options = {};\n\n ['status', 'statusText', 'headers'].forEach((prop) => {\n options[prop] = response[prop];\n });\n\n const responseContentLength = utils.toFiniteNumber(responseHeaders.getContentLength());\n\n const [onProgress, flush] =\n (onDownloadProgress &&\n progressEventDecorator(\n responseContentLength,\n progressEventReducer(asyncDecorator(onDownloadProgress), true)\n )) ||\n [];\n\n let bytesRead = 0;\n const onChunkProgress = (loadedBytes) => {\n if (hasMaxContentLength) {\n bytesRead = loadedBytes;\n if (bytesRead > maxContentLength) {\n throw new AxiosError(\n 'maxContentLength size of ' + maxContentLength + ' exceeded',\n AxiosError.ERR_BAD_RESPONSE,\n config,\n request\n );\n }\n }\n onProgress && onProgress(loadedBytes);\n };\n\n response = new Response(\n trackStream(response.body, DEFAULT_CHUNK_SIZE, onChunkProgress, () => {\n flush && flush();\n unsubscribe && unsubscribe();\n }),\n options\n );\n }\n\n responseType = responseType || 'text';\n\n let responseData = await resolvers[utils.findKey(resolvers, responseType) || 'text'](\n response,\n config\n );\n\n // Fallback enforcement for environments without ReadableStream support\n // (legacy runtimes). Detect materialized size from typed output; skip\n // streams/Response passthrough since the user will read those themselves.\n if (hasMaxContentLength && !supportsResponseStream && !isStreamResponse) {\n let materializedSize;\n if (responseData != null) {\n if (typeof responseData.byteLength === 'number') {\n materializedSize = responseData.byteLength;\n } else if (typeof responseData.size === 'number') {\n materializedSize = responseData.size;\n } else if (typeof responseData === 'string') {\n materializedSize =\n typeof TextEncoder === 'function'\n ? new TextEncoder().encode(responseData).byteLength\n : responseData.length;\n }\n }\n if (typeof materializedSize === 'number' && materializedSize > maxContentLength) {\n throw new AxiosError(\n 'maxContentLength size of ' + maxContentLength + ' exceeded',\n AxiosError.ERR_BAD_RESPONSE,\n config,\n request\n );\n }\n }\n\n !isStreamResponse && unsubscribe && unsubscribe();\n\n return await new Promise((resolve, reject) => {\n settle(resolve, reject, {\n data: responseData,\n headers: AxiosHeaders.from(response.headers),\n status: response.status,\n statusText: response.statusText,\n config,\n request,\n });\n });\n } catch (err) {\n unsubscribe && unsubscribe();\n\n // Safari can surface fetch aborts as a DOMException-like object whose\n // branded getters throw. Prefer our composed signal reason before reading\n // the caught error, preserving timeout vs cancellation semantics.\n if (composedSignal && composedSignal.aborted && composedSignal.reason instanceof AxiosError) {\n const canceledError = composedSignal.reason;\n canceledError.config = config;\n request && (canceledError.request = request);\n if (err !== canceledError) {\n // Non-enumerable to match native Error `cause` semantics so loggers\n // don't recurse into circular fetch internals (see #7205).\n Object.defineProperty(canceledError, 'cause', {\n __proto__: null,\n value: err,\n writable: true,\n enumerable: false,\n configurable: true,\n });\n }\n throw canceledError;\n }\n\n // Surface a maxBodyLength violation we raised while the request body was\n // being streamed. Matching by identity (rather than reading\n // `err.cause.isAxiosError`) keeps the error deterministic across runtimes\n // and avoids both prototype-pollution reads and mis-attributing a foreign\n // AxiosError that merely happened to land in `err.cause`.\n if (pendingBodyError) {\n request && !pendingBodyError.request && (pendingBodyError.request = request);\n throw pendingBodyError;\n }\n\n // Re-throw AxiosErrors we raised synchronously (data: URL / content-length\n // pre-checks, response size enforcement) without re-wrapping them.\n if (err instanceof AxiosError) {\n request && !err.request && (err.request = request);\n throw err;\n }\n\n if (err && err.name === 'TypeError' && /Load failed|fetch/i.test(err.message)) {\n const networkError = new AxiosError(\n 'Network Error',\n AxiosError.ERR_NETWORK,\n config,\n request,\n err && err.response\n );\n // Non-enumerable to match native Error `cause` semantics so loggers\n // don't recurse into circular fetch internals (see #7205).\n Object.defineProperty(networkError, 'cause', {\n __proto__: null,\n value: err.cause || err,\n writable: true,\n enumerable: false,\n configurable: true,\n });\n throw networkError;\n }\n\n throw AxiosError.from(err, err && err.code, config, request, err && err.response);\n }\n };\n};\n\nconst seedCache = new Map();\n\nexport const getFetch = (config) => {\n let env = (config && config.env) || {};\n const { fetch, Request, Response } = env;\n const seeds = [Request, Response, fetch];\n\n let len = seeds.length,\n i = len,\n seed,\n target,\n map = seedCache;\n\n while (i--) {\n seed = seeds[i];\n target = map.get(seed);\n\n target === undefined && map.set(seed, (target = i ? new Map() : factory(env)));\n\n map = target;\n }\n\n return target;\n};\n\nconst adapter = getFetch();\n\nexport default adapter;\n","import utils from '../utils.js';\nimport httpAdapter from './http.js';\nimport xhrAdapter from './xhr.js';\nimport * as fetchAdapter from './fetch.js';\nimport AxiosError from '../core/AxiosError.js';\n\n/**\n * Known adapters mapping.\n * Provides environment-specific adapters for Axios:\n * - `http` for Node.js\n * - `xhr` for browsers\n * - `fetch` for fetch API-based requests\n *\n * @type {Object}\n */\nconst knownAdapters = {\n http: httpAdapter,\n xhr: xhrAdapter,\n fetch: {\n get: fetchAdapter.getFetch,\n },\n};\n\n// Assign adapter names for easier debugging and identification\nutils.forEach(knownAdapters, (fn, value) => {\n if (fn) {\n try {\n // Null-proto descriptors so a polluted Object.prototype.get cannot turn\n // these data descriptors into accessor descriptors on the way in.\n Object.defineProperty(fn, 'name', { __proto__: null, value });\n } catch (e) {\n // eslint-disable-next-line no-empty\n }\n Object.defineProperty(fn, 'adapterName', { __proto__: null, value });\n }\n});\n\n/**\n * Render a rejection reason string for unknown or unsupported adapters\n *\n * @param {string} reason\n * @returns {string}\n */\nconst renderReason = (reason) => `- ${reason}`;\n\n/**\n * Check if the adapter is resolved (function, null, or false)\n *\n * @param {Function|null|false} adapter\n * @returns {boolean}\n */\nconst isResolvedHandle = (adapter) =>\n utils.isFunction(adapter) || adapter === null || adapter === false;\n\n/**\n * Get the first suitable adapter from the provided list.\n * Tries each adapter in order until a supported one is found.\n * Throws an AxiosError if no adapter is suitable.\n *\n * @param {Array|string|Function} adapters - Adapter(s) by name or function.\n * @param {Object} config - Axios request configuration\n * @throws {AxiosError} If no suitable adapter is available\n * @returns {Function} The resolved adapter function\n */\nfunction getAdapter(adapters, config) {\n adapters = utils.isArray(adapters) ? adapters : [adapters];\n\n const { length } = adapters;\n let nameOrAdapter;\n let adapter;\n\n const rejectedReasons = {};\n\n for (let i = 0; i < length; i++) {\n nameOrAdapter = adapters[i];\n let id;\n\n adapter = nameOrAdapter;\n\n if (!isResolvedHandle(nameOrAdapter)) {\n adapter = knownAdapters[(id = String(nameOrAdapter)).toLowerCase()];\n\n if (adapter === undefined) {\n throw new AxiosError(`Unknown adapter '${id}'`);\n }\n }\n\n if (adapter && (utils.isFunction(adapter) || (adapter = adapter.get(config)))) {\n break;\n }\n\n rejectedReasons[id || '#' + i] = adapter;\n }\n\n if (!adapter) {\n const reasons = Object.entries(rejectedReasons).map(\n ([id, state]) =>\n `adapter ${id} ` +\n (state === false ? 'is not supported by the environment' : 'is not available in the build')\n );\n\n let s = length\n ? reasons.length > 1\n ? 'since :\\n' + reasons.map(renderReason).join('\\n')\n : ' ' + renderReason(reasons[0])\n : 'as no adapter specified';\n\n throw new AxiosError(\n `There is no suitable adapter to dispatch the request ` + s,\n AxiosError.ERR_NOT_SUPPORT\n );\n }\n\n return adapter;\n}\n\n/**\n * Exports Axios adapters and utility to resolve an adapter\n */\nexport default {\n /**\n * Resolve an adapter from a list of adapter names or functions.\n * @type {Function}\n */\n getAdapter,\n\n /**\n * Exposes all known adapters\n * @type {Object}\n */\n adapters: knownAdapters,\n};\n","// eslint-disable-next-line strict\nexport default null;\n","'use strict';\n\nimport transformData from './transformData.js';\nimport isCancel from '../cancel/isCancel.js';\nimport defaults from '../defaults/index.js';\nimport CanceledError from '../cancel/CanceledError.js';\nimport AxiosHeaders from '../core/AxiosHeaders.js';\nimport adapters from '../adapters/adapters.js';\n\n/**\n * Throws a `CanceledError` if cancellation has been requested.\n *\n * @param {Object} config The config that is to be used for the request\n *\n * @returns {void}\n */\nfunction throwIfCancellationRequested(config) {\n if (config.cancelToken) {\n config.cancelToken.throwIfRequested();\n }\n\n if (config.signal && config.signal.aborted) {\n throw new CanceledError(null, config);\n }\n}\n\n/**\n * Dispatch a request to the server using the configured adapter.\n *\n * @param {object} config The config that is to be used for the request\n *\n * @returns {Promise} The Promise to be fulfilled\n */\nexport default function dispatchRequest(config) {\n throwIfCancellationRequested(config);\n\n config.headers = AxiosHeaders.from(config.headers);\n\n // Transform request data\n config.data = transformData.call(config, config.transformRequest);\n\n if (['post', 'put', 'patch'].indexOf(config.method) !== -1) {\n config.headers.setContentType('application/x-www-form-urlencoded', false);\n }\n\n const adapter = adapters.getAdapter(config.adapter || defaults.adapter, config);\n\n return adapter(config).then(\n function onAdapterResolution(response) {\n throwIfCancellationRequested(config);\n\n // Expose the current response on config so that transformResponse can\n // attach it to any AxiosError it throws (e.g. on JSON parse failure).\n // We clean it up afterwards to avoid polluting the config object.\n config.response = response;\n try {\n response.data = transformData.call(config, config.transformResponse, response);\n } finally {\n delete config.response;\n }\n\n response.headers = AxiosHeaders.from(response.headers);\n\n return response;\n },\n function onAdapterRejection(reason) {\n if (!isCancel(reason)) {\n throwIfCancellationRequested(config);\n\n // Transform response data\n if (reason && reason.response) {\n config.response = reason.response;\n try {\n reason.response.data = transformData.call(\n config,\n config.transformResponse,\n reason.response\n );\n } finally {\n delete config.response;\n }\n reason.response.headers = AxiosHeaders.from(reason.response.headers);\n }\n }\n\n return Promise.reject(reason);\n }\n );\n}\n","'use strict';\n\nimport { VERSION } from '../env/data.js';\nimport AxiosError from '../core/AxiosError.js';\n\nconst validators = {};\n\n// eslint-disable-next-line func-names\n['object', 'boolean', 'number', 'function', 'string', 'symbol'].forEach((type, i) => {\n validators[type] = function validator(thing) {\n return typeof thing === type || 'a' + (i < 1 ? 'n ' : ' ') + type;\n };\n});\n\nconst deprecatedWarnings = {};\n\n/**\n * Transitional option validator\n *\n * @param {function|boolean?} validator - set to false if the transitional option has been removed\n * @param {string?} version - deprecated version / removed since version\n * @param {string?} message - some message with additional info\n *\n * @returns {function}\n */\nvalidators.transitional = function transitional(validator, version, message) {\n function formatMessage(opt, desc) {\n return (\n '[Axios v' +\n VERSION +\n \"] Transitional option '\" +\n opt +\n \"'\" +\n desc +\n (message ? '. ' + message : '')\n );\n }\n\n // eslint-disable-next-line func-names\n return (value, opt, opts) => {\n if (validator === false) {\n throw new AxiosError(\n formatMessage(opt, ' has been removed' + (version ? ' in ' + version : '')),\n AxiosError.ERR_DEPRECATED\n );\n }\n\n if (version && !deprecatedWarnings[opt]) {\n deprecatedWarnings[opt] = true;\n // eslint-disable-next-line no-console\n console.warn(\n formatMessage(\n opt,\n ' has been deprecated since v' + version + ' and will be removed in the near future'\n )\n );\n }\n\n return validator ? validator(value, opt, opts) : true;\n };\n};\n\nvalidators.spelling = function spelling(correctSpelling) {\n return (value, opt) => {\n // eslint-disable-next-line no-console\n console.warn(`${opt} is likely a misspelling of ${correctSpelling}`);\n return true;\n };\n};\n\n/**\n * Assert object's properties type\n *\n * @param {object} options\n * @param {object} schema\n * @param {boolean?} allowUnknown\n *\n * @returns {object}\n */\n\nfunction assertOptions(options, schema, allowUnknown) {\n if (typeof options !== 'object' || options === null) {\n throw new AxiosError('options must be an object', AxiosError.ERR_BAD_OPTION_VALUE);\n }\n const keys = Object.keys(options);\n let i = keys.length;\n while (i-- > 0) {\n const opt = keys[i];\n // Use hasOwnProperty so a polluted Object.prototype. cannot supply\n // a non-function validator and cause a TypeError.\n const validator = Object.prototype.hasOwnProperty.call(schema, opt) ? schema[opt] : undefined;\n if (validator) {\n const value = options[opt];\n const result = value === undefined || validator(value, opt, options);\n if (result !== true) {\n throw new AxiosError(\n 'option ' + opt + ' must be ' + result,\n AxiosError.ERR_BAD_OPTION_VALUE\n );\n }\n continue;\n }\n if (allowUnknown !== true) {\n throw new AxiosError('Unknown option ' + opt, AxiosError.ERR_BAD_OPTION);\n }\n }\n}\n\nexport default {\n assertOptions,\n validators,\n};\n","'use strict';\n\nimport utils from '../utils.js';\nimport buildURL from '../helpers/buildURL.js';\nimport InterceptorManager from './InterceptorManager.js';\nimport dispatchRequest from './dispatchRequest.js';\nimport mergeConfig from './mergeConfig.js';\nimport buildFullPath from './buildFullPath.js';\nimport validator from '../helpers/validator.js';\nimport AxiosHeaders from './AxiosHeaders.js';\nimport transitionalDefaults from '../defaults/transitional.js';\n\nconst validators = validator.validators;\n\n/**\n * Create a new instance of Axios\n *\n * @param {Object} instanceConfig The default config for the instance\n *\n * @return {Axios} A new instance of Axios\n */\nclass Axios {\n constructor(instanceConfig) {\n this.defaults = instanceConfig || {};\n this.interceptors = {\n request: new InterceptorManager(),\n response: new InterceptorManager(),\n };\n }\n\n /**\n * Dispatch a request\n *\n * @param {String|Object} configOrUrl The config specific for this request (merged with this.defaults)\n * @param {?Object} config\n *\n * @returns {Promise} The Promise to be fulfilled\n */\n async request(configOrUrl, config) {\n try {\n return await this._request(configOrUrl, config);\n } catch (err) {\n if (err instanceof Error) {\n let dummy = {};\n\n Error.captureStackTrace ? Error.captureStackTrace(dummy) : (dummy = new Error());\n\n // slice off the Error: ... line\n const stack = (() => {\n if (!dummy.stack) {\n return '';\n }\n\n const firstNewlineIndex = dummy.stack.indexOf('\\n');\n\n return firstNewlineIndex === -1 ? '' : dummy.stack.slice(firstNewlineIndex + 1);\n })();\n try {\n if (!err.stack) {\n err.stack = stack;\n // match without the 2 top stack lines\n } else if (stack) {\n const firstNewlineIndex = stack.indexOf('\\n');\n const secondNewlineIndex =\n firstNewlineIndex === -1 ? -1 : stack.indexOf('\\n', firstNewlineIndex + 1);\n const stackWithoutTwoTopLines =\n secondNewlineIndex === -1 ? '' : stack.slice(secondNewlineIndex + 1);\n\n if (!String(err.stack).endsWith(stackWithoutTwoTopLines)) {\n err.stack += '\\n' + stack;\n }\n }\n } catch (e) {\n // ignore the case where \"stack\" is an un-writable property\n }\n }\n\n throw err;\n }\n }\n\n _request(configOrUrl, config) {\n /*eslint no-param-reassign:0*/\n // Allow for axios('example/url'[, config]) a la fetch API\n if (typeof configOrUrl === 'string') {\n config = config || {};\n config.url = configOrUrl;\n } else {\n config = configOrUrl || {};\n }\n\n config = mergeConfig(this.defaults, config);\n\n const { transitional, paramsSerializer, headers } = config;\n\n if (transitional !== undefined) {\n validator.assertOptions(\n transitional,\n {\n silentJSONParsing: validators.transitional(validators.boolean),\n forcedJSONParsing: validators.transitional(validators.boolean),\n clarifyTimeoutError: validators.transitional(validators.boolean),\n legacyInterceptorReqResOrdering: validators.transitional(validators.boolean),\n advertiseZstdAcceptEncoding: validators.transitional(validators.boolean),\n validateStatusUndefinedResolves: validators.transitional(validators.boolean),\n },\n false\n );\n }\n\n if (paramsSerializer != null) {\n if (utils.isFunction(paramsSerializer)) {\n config.paramsSerializer = {\n serialize: paramsSerializer,\n };\n } else {\n validator.assertOptions(\n paramsSerializer,\n {\n encode: validators.function,\n serialize: validators.function,\n },\n true\n );\n }\n }\n\n // Set config.allowAbsoluteUrls\n if (config.allowAbsoluteUrls !== undefined) {\n // do nothing\n } else if (this.defaults.allowAbsoluteUrls !== undefined) {\n config.allowAbsoluteUrls = this.defaults.allowAbsoluteUrls;\n } else {\n config.allowAbsoluteUrls = true;\n }\n\n validator.assertOptions(\n config,\n {\n baseUrl: validators.spelling('baseURL'),\n withXsrfToken: validators.spelling('withXSRFToken'),\n },\n true\n );\n\n // Set config.method\n config.method = (config.method || this.defaults.method || 'get').toLowerCase();\n\n // Flatten headers\n let contextHeaders = headers && utils.merge(headers.common, headers[config.method]);\n\n headers &&\n utils.forEach(['delete', 'get', 'head', 'post', 'put', 'patch', 'query', 'common'], (method) => {\n delete headers[method];\n });\n\n config.headers = AxiosHeaders.concat(contextHeaders, headers);\n\n // filter out skipped interceptors\n const requestInterceptorChain = [];\n let synchronousRequestInterceptors = true;\n this.interceptors.request.forEach(function unshiftRequestInterceptors(interceptor) {\n if (typeof interceptor.runWhen === 'function' && interceptor.runWhen(config) === false) {\n return;\n }\n\n synchronousRequestInterceptors = synchronousRequestInterceptors && interceptor.synchronous;\n\n const transitional = config.transitional || transitionalDefaults;\n const legacyInterceptorReqResOrdering =\n transitional && transitional.legacyInterceptorReqResOrdering;\n\n if (legacyInterceptorReqResOrdering) {\n requestInterceptorChain.unshift(interceptor.fulfilled, interceptor.rejected);\n } else {\n requestInterceptorChain.push(interceptor.fulfilled, interceptor.rejected);\n }\n });\n\n const responseInterceptorChain = [];\n this.interceptors.response.forEach(function pushResponseInterceptors(interceptor) {\n responseInterceptorChain.push(interceptor.fulfilled, interceptor.rejected);\n });\n\n let promise;\n let i = 0;\n let len;\n\n if (!synchronousRequestInterceptors) {\n const chain = [dispatchRequest.bind(this), undefined];\n chain.unshift(...requestInterceptorChain);\n chain.push(...responseInterceptorChain);\n len = chain.length;\n\n promise = Promise.resolve(config);\n\n while (i < len) {\n promise = promise.then(chain[i++], chain[i++]);\n }\n\n return promise;\n }\n\n len = requestInterceptorChain.length;\n\n let newConfig = config;\n\n while (i < len) {\n const onFulfilled = requestInterceptorChain[i++];\n const onRejected = requestInterceptorChain[i++];\n try {\n newConfig = onFulfilled ? onFulfilled(newConfig) : newConfig;\n } catch (error) {\n if (!onRejected) {\n promise = Promise.reject(error);\n break;\n }\n\n try {\n const rejectedResult = onRejected.call(this, error);\n\n if (utils.isThenable(rejectedResult)) {\n promise = Promise.resolve(rejectedResult).then(() =>\n dispatchRequest.call(this, newConfig)\n );\n }\n } catch (rejectedError) {\n promise = Promise.reject(rejectedError);\n }\n\n break;\n }\n }\n\n if (!promise) {\n try {\n promise = dispatchRequest.call(this, newConfig);\n } catch (error) {\n promise = Promise.reject(error);\n }\n }\n\n i = 0;\n len = responseInterceptorChain.length;\n\n while (i < len) {\n promise = promise.then(responseInterceptorChain[i++], responseInterceptorChain[i++]);\n }\n\n return promise;\n }\n\n getUri(config) {\n config = mergeConfig(this.defaults, config);\n const fullPath = buildFullPath(config.baseURL, config.url, config.allowAbsoluteUrls, config);\n return buildURL(fullPath, config.params, config.paramsSerializer);\n }\n}\n\n// Provide aliases for supported request methods\nutils.forEach(['delete', 'get', 'head', 'options'], function forEachMethodNoData(method) {\n /*eslint func-names:0*/\n Axios.prototype[method] = function (url, config) {\n return this.request(\n mergeConfig(config || {}, {\n method,\n url,\n data: config && utils.hasOwnProp(config, 'data') ? config.data : undefined,\n })\n );\n };\n});\n\nutils.forEach(['post', 'put', 'patch', 'query'], function forEachMethodWithData(method) {\n function generateHTTPMethod(isForm) {\n return function httpMethod(url, data, config) {\n return this.request(\n mergeConfig(config || {}, {\n method,\n headers: isForm\n ? {\n 'Content-Type': 'multipart/form-data',\n }\n : {},\n url,\n data,\n })\n );\n };\n }\n\n Axios.prototype[method] = generateHTTPMethod();\n\n // QUERY is a safe/idempotent read method; multipart form bodies don't fit\n // its semantics, so no queryForm shorthand is generated.\n if (method !== 'query') {\n Axios.prototype[method + 'Form'] = generateHTTPMethod(true);\n }\n});\n\nexport default Axios;\n","'use strict';\n\nimport CanceledError from './CanceledError.js';\n\n/**\n * A `CancelToken` is an object that can be used to request cancellation of an operation.\n *\n * @param {Function} executor The executor function.\n *\n * @returns {CancelToken}\n */\nclass CancelToken {\n constructor(executor) {\n if (typeof executor !== 'function') {\n throw new TypeError('executor must be a function.');\n }\n\n let resolvePromise;\n\n this.promise = new Promise(function promiseExecutor(resolve) {\n resolvePromise = resolve;\n });\n\n const token = this;\n\n // eslint-disable-next-line func-names\n this.promise.then((cancel) => {\n if (!token._listeners) return;\n\n let i = token._listeners.length;\n\n while (i-- > 0) {\n token._listeners[i](cancel);\n }\n token._listeners = null;\n });\n\n // eslint-disable-next-line func-names\n this.promise.then = (onfulfilled) => {\n let _resolve;\n // eslint-disable-next-line func-names\n const promise = new Promise((resolve) => {\n token.subscribe(resolve);\n _resolve = resolve;\n }).then(onfulfilled);\n\n promise.cancel = function reject() {\n token.unsubscribe(_resolve);\n };\n\n return promise;\n };\n\n executor(function cancel(message, config, request) {\n if (token.reason) {\n // Cancellation has already been requested\n return;\n }\n\n token.reason = new CanceledError(message, config, request);\n resolvePromise(token.reason);\n });\n }\n\n /**\n * Throws a `CanceledError` if cancellation has been requested.\n */\n throwIfRequested() {\n if (this.reason) {\n throw this.reason;\n }\n }\n\n /**\n * Subscribe to the cancel signal\n */\n\n subscribe(listener) {\n if (this.reason) {\n listener(this.reason);\n return;\n }\n\n if (this._listeners) {\n this._listeners.push(listener);\n } else {\n this._listeners = [listener];\n }\n }\n\n /**\n * Unsubscribe from the cancel signal\n */\n\n unsubscribe(listener) {\n if (!this._listeners) {\n return;\n }\n const index = this._listeners.indexOf(listener);\n if (index !== -1) {\n this._listeners.splice(index, 1);\n }\n }\n\n toAbortSignal() {\n const controller = new AbortController();\n\n const abort = (err) => {\n controller.abort(err);\n };\n\n this.subscribe(abort);\n\n controller.signal.unsubscribe = () => this.unsubscribe(abort);\n\n return controller.signal;\n }\n\n /**\n * Returns an object that contains a new `CancelToken` and a function that, when called,\n * cancels the `CancelToken`.\n */\n static source() {\n let cancel;\n const token = new CancelToken(function executor(c) {\n cancel = c;\n });\n return {\n token,\n cancel,\n };\n }\n}\n\nexport default CancelToken;\n","const HttpStatusCode = {\n Continue: 100,\n SwitchingProtocols: 101,\n Processing: 102,\n EarlyHints: 103,\n Ok: 200,\n Created: 201,\n Accepted: 202,\n NonAuthoritativeInformation: 203,\n NoContent: 204,\n ResetContent: 205,\n PartialContent: 206,\n MultiStatus: 207,\n AlreadyReported: 208,\n ImUsed: 226,\n MultipleChoices: 300,\n MovedPermanently: 301,\n Found: 302,\n SeeOther: 303,\n NotModified: 304,\n UseProxy: 305,\n Unused: 306,\n TemporaryRedirect: 307,\n PermanentRedirect: 308,\n BadRequest: 400,\n Unauthorized: 401,\n PaymentRequired: 402,\n Forbidden: 403,\n NotFound: 404,\n MethodNotAllowed: 405,\n NotAcceptable: 406,\n ProxyAuthenticationRequired: 407,\n RequestTimeout: 408,\n Conflict: 409,\n Gone: 410,\n LengthRequired: 411,\n PreconditionFailed: 412,\n PayloadTooLarge: 413,\n UriTooLong: 414,\n UnsupportedMediaType: 415,\n RangeNotSatisfiable: 416,\n ExpectationFailed: 417,\n ImATeapot: 418,\n MisdirectedRequest: 421,\n UnprocessableEntity: 422,\n Locked: 423,\n FailedDependency: 424,\n TooEarly: 425,\n UpgradeRequired: 426,\n PreconditionRequired: 428,\n TooManyRequests: 429,\n RequestHeaderFieldsTooLarge: 431,\n UnavailableForLegalReasons: 451,\n InternalServerError: 500,\n NotImplemented: 501,\n BadGateway: 502,\n ServiceUnavailable: 503,\n GatewayTimeout: 504,\n HttpVersionNotSupported: 505,\n VariantAlsoNegotiates: 506,\n InsufficientStorage: 507,\n LoopDetected: 508,\n NotExtended: 510,\n NetworkAuthenticationRequired: 511,\n WebServerReturnsAnUnknownError: 520,\n WebServerIsDown: 521,\n ConnectionTimedOut: 522,\n OriginIsUnreachable: 523,\n TimeoutOccurred: 524,\n SslHandshakeFailed: 525,\n InvalidSslCertificate: 526,\n};\n\nObject.entries(HttpStatusCode).forEach(([key, value]) => {\n HttpStatusCode[value] = key;\n});\n\nexport default HttpStatusCode;\n","'use strict';\n\nimport utils from './utils.js';\nimport bind from './helpers/bind.js';\nimport Axios from './core/Axios.js';\nimport mergeConfig from './core/mergeConfig.js';\nimport defaults from './defaults/index.js';\nimport formDataToJSON from './helpers/formDataToJSON.js';\nimport CanceledError from './cancel/CanceledError.js';\nimport CancelToken from './cancel/CancelToken.js';\nimport isCancel from './cancel/isCancel.js';\nimport { VERSION } from './env/data.js';\nimport toFormData from './helpers/toFormData.js';\nimport AxiosError from './core/AxiosError.js';\nimport spread from './helpers/spread.js';\nimport isAxiosError from './helpers/isAxiosError.js';\nimport AxiosHeaders from './core/AxiosHeaders.js';\nimport adapters from './adapters/adapters.js';\nimport HttpStatusCode from './helpers/HttpStatusCode.js';\n\n/**\n * Create an instance of Axios\n *\n * @param {Object} defaultConfig The default config for the instance\n *\n * @returns {Axios} A new instance of Axios\n */\nfunction createInstance(defaultConfig) {\n const context = new Axios(defaultConfig);\n const instance = bind(Axios.prototype.request, context);\n\n // Copy axios.prototype to instance\n utils.extend(instance, Axios.prototype, context, { allOwnKeys: true });\n\n // Copy context to instance\n utils.extend(instance, context, null, { allOwnKeys: true });\n\n // Factory for creating new instances\n instance.create = function create(instanceConfig) {\n return createInstance(mergeConfig(defaultConfig, instanceConfig));\n };\n\n return instance;\n}\n\n// Create the default instance to be exported\nconst axios = createInstance(defaults);\n\n// Expose Axios class to allow class inheritance\naxios.Axios = Axios;\n\n// Expose Cancel & CancelToken\naxios.CanceledError = CanceledError;\naxios.CancelToken = CancelToken;\naxios.isCancel = isCancel;\naxios.VERSION = VERSION;\naxios.toFormData = toFormData;\n\n// Expose AxiosError class\naxios.AxiosError = AxiosError;\n\n// alias for CanceledError for backward compatibility\naxios.Cancel = axios.CanceledError;\n\n// Expose all/spread\naxios.all = function all(promises) {\n return Promise.all(promises);\n};\n\naxios.spread = spread;\n\n// Expose isAxiosError\naxios.isAxiosError = isAxiosError;\n\n// Expose mergeConfig\naxios.mergeConfig = mergeConfig;\n\naxios.AxiosHeaders = AxiosHeaders;\n\naxios.formToJSON = (thing) => formDataToJSON(utils.isHTMLForm(thing) ? new FormData(thing) : thing);\n\naxios.getAdapter = adapters.getAdapter;\n\naxios.HttpStatusCode = HttpStatusCode;\n\naxios.default = axios;\n\n// this module should only have a default export\nexport default axios;\n","'use strict';\n\n/**\n * Syntactic sugar for invoking a function and expanding an array for arguments.\n *\n * Common use case would be to use `Function.prototype.apply`.\n *\n * ```js\n * function f(x, y, z) {}\n * const args = [1, 2, 3];\n * f.apply(null, args);\n * ```\n *\n * With `spread` this example can be re-written.\n *\n * ```js\n * spread(function(x, y, z) {})([1, 2, 3]);\n * ```\n *\n * @param {Function} callback\n *\n * @returns {Function}\n */\nexport default function spread(callback) {\n return function wrap(arr) {\n return callback.apply(null, arr);\n };\n}\n","'use strict';\n\nimport utils from '../utils.js';\n\n/**\n * Determines whether the payload is an error thrown by Axios\n *\n * @param {*} payload The value to test\n *\n * @returns {boolean} True if the payload is an error thrown by Axios, otherwise false\n */\nexport default function isAxiosError(payload) {\n return utils.isObject(payload) && payload.isAxiosError === true;\n}\n"],"names":["bind","fn","thisArg","apply","arguments","cache","toString","Object","prototype","getPrototypeOf","iterator","Symbol","toStringTag","hasOwnProperty","obj","prop","call","hasOwnInPrototypeChain","thing","seen","indexOf","push","kindOf","create","str","slice","toLowerCase","kindOfTest","type","typeOfTest","_typeof","isArray","Array","isUndefined","isBuffer","val","constructor","isFunction","isArrayBuffer","isString","isNumber","isObject","isPlainObject","isDate","isFile","isBlob","isFileList","isSet","G","globalThis","self","window","global","FormDataCtor","FormData","undefined","isURLSearchParams","_map2","_slicedToArray","map","isReadableStream","isRequest","isResponse","isHeaders","forEach","i","l","_ref2$allOwnKeys","length","allOwnKeys","key","keys","getOwnPropertyNames","len","findKey","_key","_global","isContextDefined","context","TypedArray","isTypedArray","Uint8Array","isHTMLForm","propertyIsEnumerable","isRegExp","reduceDescriptors","reducer","descriptors","getOwnPropertyDescriptors","reducedDescriptors","descriptor","name","ret","defineProperties","setImmediateSupported","postMessageSupported","token","callbacks","isAsyncFn","_setImmediate","setImmediate","postMessage","concat","Math","random","addEventListener","_ref5","source","data","shift","cb","setTimeout","asap","queueMicrotask","process","nextTick","isIterable","utils$1","isFormData","proto","append","kind","isArrayBufferView","ArrayBuffer","isView","buffer","isBoolean","isEmptyObject","e","isReactNativeBlob","value","uri","isReactNative","formData","getParts","isStream","pipe","merge","_ref3","this","caseless","skipUndefined","result","assignValue","targetKey","existing","symbols","getOwnPropertySymbols","j","symbol","extend","a","b","defineProperty","__proto__","writable","enumerable","configurable","trim","replace","stripBOM","content","charCodeAt","inherits","superConstructor","props","assign","toFlatObject","sourceObj","destObj","filter","propFilter","merged","endsWith","searchString","position","String","lastIndex","toArray","arr","forEachEntry","_iterator","next","done","pair","matchAll","regExp","matches","exec","hasOwnProp","getSafeProp","freezeMethods","includes","set","Error","toObjectSet","arrayOrString","delimiter","define","split","toCamelCase","m","p1","p2","toUpperCase","noop","toFiniteNumber","defaultValue","Number","isFinite","isSpecCompliantForm","toJSONObject","visited","WeakSet","visit","has","target","add","_step","_iterator2","_createForOfIteratorHelper","s","n","reducedValue","err","f","isThenable","then","isSafeIterable","ignoreDuplicateOf","utils","INVALID_UNICODE_HEADER_VALUE_CHARS","RegExp","INVALID_BYTE_STRING_HEADER_VALUE_CHARS","sanitizeValue","invalidChars","item","start","end","code","trimSPorHTAB","toByteStringHeaderObject","headers","byteStringHeaders","toJSON","header","sanitizeByteStringHeaderValue","$internals","normalizeHeader","normalizeValue","sanitizeHeaderValue","parameterNameRE","trimOWS","matchHeaderValue","isHeaderNameFilter","test","AxiosHeaders","_createClass","_classCallCheck","valueOrRewrite","rewrite","setHeader","_value","_header","_rewrite","lHeader","setHeaders","rawHeaders","parsed","line","substring","hasKey","parseHeaders","dest","entry","TypeError","_toConsumableArray","parser","match","tokens","tokensRE","parseTokens","matcher","deleted","deleteHeader","format","normalized","w","char","formatHeader","_this$constructor","_len","targets","asStrings","join","entries","_ref","_ref2","get","parameters","quoted","escaped","parseParameter","part","equals","normalizedName","parameterValue","last","decoded","decodeQuotedString","parseParameters","first","computed","_len2","_key2","accessors","defineAccessor","accessorName","methodName","arg1","arg2","arg3","buildAccessors","accessor","mapped","headerValue","REDACTED","redactConfig","config","redactKeys","lowerKeys","Set","k","v","hasOwnOrPrototypeToJSON","pop","_i","_Object$entries","_Object$entries$_i","stringifySafely","AxiosError","_Error","message","request","response","_this","_callSuper","isAxiosError","status","_inherits","redact","serializedConfig","description","number","fileName","lineNumber","columnNumber","stack","error","customProps","errors","Boolean","aggregateErrorMessage","axiosError","_wrapNativeSuper","ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ECONNREFUSED","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL","ERR_FORM_DATA_DEPTH_EXCEEDED","isVisitable","removeBrackets","renderKey","path","dots","predicates","toFormData","options","metaTokens","indexes","option","visitor","defaultVisitor","_Blob","Blob","maxDepth","useBlob","convertValue","toISOString","throwIfMaxDepthExceeded","depth","Infinity","JSON","stringify","ancestors","currentValue","stringifyWithDepthLimit","some","isFlatArray","el","index","exposedHelpers","build","encode","charMap","encodeURIComponent","AxiosURLSearchParams","params","_pairs","buildURL","url","serializedParams","_options","serialize","_encode","serializeFn","hashmarkIndex","encoder","InterceptorManager","handlers","fulfilled","rejected","synchronous","runWhen","id","h","transitionalDefaults","silentJSONParsing","forcedJSONParsing","clarifyTimeoutError","legacyInterceptorReqResOrdering","advertiseZstdAcceptEncoding","validateStatusUndefinedResolves","platform$1","isBrowser","classes","URLSearchParams","protocols","hasBrowserEnv","document","_navigator","navigator","hasStandardBrowserEnv","product","hasStandardBrowserWebWorkerEnv","WorkerGlobalScope","importScripts","origin","location","href","platform","_objectSpread","throwIfDepthExceeded","formDataToJSON","buildPath","isNumericKey","isLast","arrayToObject","pattern","parsePropPath","own","defaults","transitional","adapter","transformRequest","contentType","getContentType","hasJSONContentType","isObjectPayload","setContentType","formSerializer","helpers","isNode","toURLEncodedForm","env","_FormData","rawValue","parse","transformResponse","responseType","JSONRequested","strictJSONParsing","from","timeout","xsrfCookieName","xsrfHeaderName","maxContentLength","maxBodyLength","validateStatus","common","Accept","transformData","fns","normalize","isCancel","__CANCEL__","method","CanceledError","_AxiosError","settle","resolve","reject","progressEventReducer","listener","isDownloadStream","freq","bytesNotified","_speedometer","samplesCount","min","firstSampleTS","bytes","timestamps","head","tail","chunkLength","now","Date","startedAt","bytesCount","passed","round","speedometer","lastArgs","timer","timestamp","threshold","invoke","args","clearTimeout","throttle","loaded","rawLoaded","total","lengthComputable","max","progressBytes","rate","_defineProperty","progress","estimated","event","progressEventDecorator","throttled","asyncDecorator","scheduler","isURLSameOrigin","isMSIE","URL","protocol","host","port","userAgent","cookies","write","expires","domain","secure","sameSite","cookie","toUTCString","read","eq","decodeURIComponent","remove","malformedHttpProtocol","httpProtocolControlCharacters","redactSensitiveURLParts","fragment","redactedURL","fragmentIndex","redactedURLWithoutFragment","separator","parameterName","assertValidHttpProtocolURL","normalizedURL","stripLeadingC0ControlOrSpace","normalizeURLForProtocolCheck","buildFullPath","baseURL","requestedURL","allowAbsoluteUrls","isRelativeUrl","relativeURL","combineURLs","headersToObject","mergeConfig","config1","config2","getMergedValue","mergeDeepProperties","valueFromConfig2","defaultToConfig2","mergeDirectKeys","mergeMap","paramsSerializer","timeoutMessage","withCredentials","withXSRFToken","onUploadProgress","onDownloadProgress","decompress","beforeRedirect","transport","httpAgent","httpsAgent","cancelToken","socketPath","allowedSocketPaths","responseEncoding","getOwnPropertyDescriptor","configValue","transitional2","transitional1","getMergedTransitionalOption","FORM_DATA_CONTENT_HEADERS","resolveConfig","newConfig","auth","username","password","btoa","_","hex","fromCharCode","parseInt","getHeaders","formHeaders","policy","setFormDataHeaders","xsrfValue","xhrAdapter","XMLHttpRequest","Promise","onCanceled","uploadThrottled","downloadThrottled","flushUpload","flushDownload","_config","requestData","requestHeaders","unsubscribe","signal","removeEventListener","onloadend","responseHeaders","getAllResponseHeaders","responseText","statusText","open","onreadystatechange","readyState","responseURL","startsWith","onabort","onerror","msg","ontimeout","timeoutErrorMessage","setRequestHeader","_progressEventReducer2","upload","_progressEventReducer4","cancel","abort","subscribe","aborted","send","composeSignals","signals","controller","AbortController","reason","once","streamChunk","_regenerator","chunk","chunkSize","pos","_context","byteLength","readBytes","_wrapAsyncGenerator","_callee","iterable","_iteratorAbruptCompletion","_didIteratorError","_iteratorError","_t","_context2","p","_asyncIterator","readStream","_awaitAsyncGenerator","d","_regeneratorValues","_asyncGeneratorDelegate","_x","_x2","_callee2","stream","reader","_yield$_awaitAsyncGen","_context3","asyncIterator","getReader","_x3","trackStream","onProgress","onFinish","_onFinish","ReadableStream","pull","_asyncToGenerator","_callee3","_yield$iterator$next","_done","loadedBytes","_t2","_context4","close","enqueue","highWaterMark","isHexDigit","charCode","isPercentEncodedByte","hexValue","isBase64Char","isBase64Whitespace","estimatePercentDecodedBase64Bytes","body","significant","padding","invalid","floor","estimateBase64BufferAllocation","remainder","base64Bytes","estimateDataURLDecodedBytes","estimateBase64","comma","meta","c","estimateDataURLBytes","VERSION","encodeUTF8","decodeURIComponentSafe","maybeWithAuthCredentials","protocolIndex","urlToCheck","factory","globalObject","TextEncoder","_env","Request","Response","envFetch","fetch","isFetchSupported","isRequestSupported","isResponseSupported","isReadableStreamSupported","encodeText","arrayBuffer","supportsRequestStream","duplexAccessed","duplex","hasContentType","supportsResponseStream","resolvers","res","getBodyLength","_request","size","resolveBodyLength","getContentLength","_x4","_ref4","_callee4","_resolveConfig","_resolveConfig$withCr","fetchOptions","hasMaxContentLength","hasMaxBodyLength","_fetch","composedSignal","requestContentLength","pendingBodyError","maxBodyLengthError","configAuth","parsedURL","urlUsername","urlPassword","outboundLength","mustEnforceStreamBody","trackRequestStream","contentTypeHeader","_ref6","flush","isCredentialsSupported","resolvedOptions","declaredLength","isStreamResponse","responseContentLength","_ref7","_ref8","_onProgress","_flush","onChunkProgress","responseData","materializedSize","canceledError","networkError","_t3","_t4","toAbortSignal","credentials","cause","_x5","seedCache","Map","getFetch","seed","seeds","knownAdapters","http","xhr","fetchAdapter","renderReason","isResolvedHandle","adapters","getAdapter","nameOrAdapter","rejectedReasons","reasons","state","throwIfCancellationRequested","throwIfRequested","dispatchRequest","validators","deprecatedWarnings","validator","version","formatMessage","opt","desc","opts","console","warn","spelling","correctSpelling","assertOptions","schema","allowUnknown","Axios","instanceConfig","interceptors","_request2","configOrUrl","dummy","firstNewlineIndex","secondNewlineIndex","stackWithoutTwoTopLines","captureStackTrace","baseUrl","withXsrfToken","contextHeaders","requestInterceptorChain","synchronousRequestInterceptors","interceptor","unshift","promise","responseInterceptorChain","chain","onFulfilled","onRejected","rejectedResult","rejectedError","generateHTTPMethod","isForm","CancelToken","executor","resolvePromise","_listeners","onfulfilled","_resolve","splice","HttpStatusCode","Continue","SwitchingProtocols","Processing","EarlyHints","Ok","Created","Accepted","NonAuthoritativeInformation","NoContent","ResetContent","PartialContent","MultiStatus","AlreadyReported","ImUsed","MultipleChoices","MovedPermanently","Found","SeeOther","NotModified","UseProxy","Unused","TemporaryRedirect","PermanentRedirect","BadRequest","Unauthorized","PaymentRequired","Forbidden","NotFound","MethodNotAllowed","NotAcceptable","ProxyAuthenticationRequired","RequestTimeout","Conflict","Gone","LengthRequired","PreconditionFailed","PayloadTooLarge","UriTooLong","UnsupportedMediaType","RangeNotSatisfiable","ExpectationFailed","ImATeapot","MisdirectedRequest","UnprocessableEntity","Locked","FailedDependency","TooEarly","UpgradeRequired","PreconditionRequired","TooManyRequests","RequestHeaderFieldsTooLarge","UnavailableForLegalReasons","InternalServerError","NotImplemented","BadGateway","ServiceUnavailable","GatewayTimeout","HttpVersionNotSupported","VariantAlsoNegotiates","InsufficientStorage","LoopDetected","NotExtended","NetworkAuthenticationRequired","WebServerReturnsAnUnknownError","WebServerIsDown","ConnectionTimedOut","OriginIsUnreachable","TimeoutOccurred","SslHandshakeFailed","InvalidSslCertificate","axios","createInstance","defaultConfig","instance","Cancel","all","promises","spread","callback","payload","formToJSON"],"mappings":";;;kgLASe,SAASA,EAAKC,EAAIC,GAC/B,OAAO,WACL,OAAOD,EAAGE,MAAMD,EAASE,UAC3B,CACF,mSCPA,IAuDiBC,EAvDTC,EAAaC,OAAOC,UAApBF,SACAG,EAAmBF,OAAnBE,eACAC,EAA0BC,OAA1BD,SAAUE,EAAgBD,OAAhBC,YAGZC,EACJ,WAAA,IAAGA,EAGHN,OAAOC,UAHJK,eAAc,OACjB,SAACC,EAAKC,GAAI,OACRF,EAAeG,KAAKF,EAAKC,EAAK,CAAA,CAFhC,GAiBIE,EAAyB,SAACC,EAAOH,GAIrC,IAHA,IAAID,EAAMI,EACJC,EAAO,GAEC,MAAPL,GAAeA,IAAQP,OAAOC,WAAW,CAC9C,IAA0B,IAAtBW,EAAKC,QAAQN,GACf,OAAO,EAIT,GAFAK,EAAKE,KAAKP,GAEND,EAAeC,EAAKC,GACtB,OAAO,EAETD,EAAML,EAAeK,EACvB,CACA,OAAO,CACT,EAgBMQ,GAAWjB,EAGdE,OAAOgB,OAAO,MAHU,SAACL,GAC1B,IAAMM,EAAMlB,EAASU,KAAKE,GAC1B,OAAOb,EAAMmB,KAASnB,EAAMmB,GAAOA,EAAIC,MAAM,MAAOC,cACtD,GAEMC,EAAa,SAACC,GAElB,OADAA,EAAOA,EAAKF,cACL,SAACR,GAAK,OAAKI,EAAOJ,KAAWU,CAAI,CAC1C,EAEMC,EAAa,SAACD,GAAI,OAAK,SAACV,GAAK,OAAKY,EAAOZ,KAAUU,CAAI,CAAA,EASrDG,EAAYC,MAAZD,QASFE,EAAcJ,EAAW,aAS/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C7BA,IAAMk4B,GAnBN,SAASC,EAAeC,GACtB,IAAM53B,EAAU,IAAIkxB,GAAM0G,GACpBC,EAAW38B,EAAKg2B,GAAMx1B,UAAU+U,QAASzQ,GAa/C,OAVAwJ,GAAMhF,OAAOqzB,EAAU3G,GAAMx1B,UAAWsE,EAAS,CAAET,YAAY,IAG/DiK,GAAMhF,OAAOqzB,EAAU73B,EAAS,KAAM,CAAET,YAAY,IAGpDs4B,EAASp7B,OAAS,SAAgB00B,GAChC,OAAOwG,EAAetX,GAAYuX,EAAezG,GACnD,EAEO0G,CACT,CAGcF,CAAenf,WAG7Bkf,GAAMxG,MAAQA,GAGdwG,GAAM9c,cAAgBA,GACtB8c,GAAM9E,YAAcA,GACpB8E,GAAMjd,SAAWA,GACjBid,GAAMtN,QAAUA,GAChBsN,GAAMvkB,WAAaA,GAGnBukB,GAAMpnB,WAAaA,GAGnBonB,GAAMI,OAASJ,GAAM9c,cAGrB8c,GAAMK,IAAM,SAAaC,GACvB,OAAO5U,QAAQ2U,IAAIC,EACrB,EAEAN,GAAMO,OC9CS,SAAgBC,GAC7B,OAAO,SAAc7xB,GACnB,OAAO6xB,EAAS78B,MAAM,KAAMgL,EAC9B,CACF,ED6CAqxB,GAAM7mB,aE7DS,SAAsBsnB,GACnC,OAAO3uB,GAAM7L,SAASw6B,KAAqC,IAAzBA,EAAQtnB,YAC5C,EF8DA6mB,GAAMrX,YAAcA,GAEpBqX,GAAMxsB,aAAeA,GAErBwsB,GAAMU,WAAa,SAACh8B,GAAK,OAAK4b,GAAexO,GAAMpJ,WAAWhE,GAAS,IAAIoC,SAASpC,GAASA,EAAM,EAEnGs7B,GAAM/H,WAAaD,GAASC,WAE5B+H,GAAMvE,eAAiBA,GAEvBuE,GAAK,QAAWA"} \ No newline at end of file diff --git a/server/node_modules/axios/dist/browser/axios.cjs b/server/node_modules/axios/dist/browser/axios.cjs deleted file mode 100644 index 156ab8c..0000000 --- a/server/node_modules/axios/dist/browser/axios.cjs +++ /dev/null @@ -1,5469 +0,0 @@ -/*! Axios v1.19.0 Copyright (c) 2026 Matt Zabriskie and contributors */ -'use strict'; - -/** - * Create a bound version of a function with a specified `this` context - * - * @param {Function} fn - The function to bind - * @param {*} thisArg - The value to be passed as the `this` parameter - * @returns {Function} A new function that will call the original function with the specified `this` context - */ -function bind(fn, thisArg) { - return function wrap() { - return fn.apply(thisArg, arguments); - }; -} - -// utils is a library of generic helper functions non-specific to axios - -const { toString } = Object.prototype; -const { getPrototypeOf } = Object; -const { iterator, toStringTag } = Symbol; - -/* Creating a function that will check if an object has a property. */ -const hasOwnProperty = ( - ({ hasOwnProperty }) => - (obj, prop) => - hasOwnProperty.call(obj, prop) -)(Object.prototype); - -/** - * Walk the prototype chain (excluding the shared Object.prototype) looking for - * an own `prop`. This distinguishes genuine own/inherited members — including - * class accessors and template prototypes — from members injected via - * Object.prototype pollution (e.g. `Object.prototype.username = '...'`), which - * live on Object.prototype itself and are therefore never matched. - * - * @param {*} thing The value whose chain to inspect - * @param {string|symbol} prop The property key to look for - * - * @returns {boolean} True when `prop` is owned below Object.prototype - */ -const hasOwnInPrototypeChain = (thing, prop) => { - let obj = thing; - const seen = []; - - while (obj != null && obj !== Object.prototype) { - if (seen.indexOf(obj) !== -1) { - return false; - } - seen.push(obj); - - if (hasOwnProperty(obj, prop)) { - return true; - } - obj = getPrototypeOf(obj); - } - return false; -}; - -/** - * Read `obj[prop]` only when it is safe from Object.prototype pollution. Own - * properties and members inherited from a non-Object.prototype source (a class - * instance or template object) are honored; a value reachable only through a - * polluted Object.prototype is ignored and `undefined` is returned. - * - * @param {*} obj The source object - * @param {string|symbol} prop The property key to read - * - * @returns {*} The resolved value, or undefined when unsafe/absent - */ -const getSafeProp = (obj, prop) => - obj != null && hasOwnInPrototypeChain(obj, prop) ? obj[prop] : undefined; - -const kindOf = ((cache) => (thing) => { - const str = toString.call(thing); - return cache[str] || (cache[str] = str.slice(8, -1).toLowerCase()); -})(Object.create(null)); - -const kindOfTest = (type) => { - type = type.toLowerCase(); - return (thing) => kindOf(thing) === type; -}; - -const typeOfTest = (type) => (thing) => typeof thing === type; - -/** - * Determine if a value is a non-null object - * - * @param {Object} val The value to test - * - * @returns {boolean} True if value is an Array, otherwise false - */ -const { isArray } = Array; - -/** - * Determine if a value is undefined - * - * @param {*} val The value to test - * - * @returns {boolean} True if the value is undefined, otherwise false - */ -const isUndefined = typeOfTest('undefined'); - -/** - * Determine if a value is a Buffer - * - * @param {*} val The value to test - * - * @returns {boolean} True if value is a Buffer, otherwise false - */ -function isBuffer(val) { - return ( - val !== null && - !isUndefined(val) && - val.constructor !== null && - !isUndefined(val.constructor) && - isFunction$1(val.constructor.isBuffer) && - val.constructor.isBuffer(val) - ); -} - -/** - * Determine if a value is an ArrayBuffer - * - * @param {*} val The value to test - * - * @returns {boolean} True if value is an ArrayBuffer, otherwise false - */ -const isArrayBuffer = kindOfTest('ArrayBuffer'); - -/** - * Determine if a value is a view on an ArrayBuffer - * - * @param {*} val The value to test - * - * @returns {boolean} True if value is a view on an ArrayBuffer, otherwise false - */ -function isArrayBufferView(val) { - let result; - if (typeof ArrayBuffer !== 'undefined' && ArrayBuffer.isView) { - result = ArrayBuffer.isView(val); - } else { - result = val && val.buffer && isArrayBuffer(val.buffer); - } - return result; -} - -/** - * Determine if a value is a String - * - * @param {*} val The value to test - * - * @returns {boolean} True if value is a String, otherwise false - */ -const isString = typeOfTest('string'); - -/** - * Determine if a value is a Function - * - * @param {*} val The value to test - * @returns {boolean} True if value is a Function, otherwise false - */ -const isFunction$1 = typeOfTest('function'); - -/** - * Determine if a value is a Number - * - * @param {*} val The value to test - * - * @returns {boolean} True if value is a Number, otherwise false - */ -const isNumber = typeOfTest('number'); - -/** - * Determine if a value is an Object - * - * @param {*} thing The value to test - * - * @returns {boolean} True if value is an Object, otherwise false - */ -const isObject = (thing) => thing !== null && typeof thing === 'object'; - -/** - * Determine if a value is a Boolean - * - * @param {*} thing The value to test - * @returns {boolean} True if value is a Boolean, otherwise false - */ -const isBoolean = (thing) => thing === true || thing === false; - -/** - * Determine if a value is a plain Object - * - * @param {*} val The value to test - * - * @returns {boolean} True if value is a plain Object, otherwise false - */ -const isPlainObject = (val) => { - if (!isObject(val)) { - return false; - } - - const prototype = getPrototypeOf(val); - return ( - (prototype === null || - prototype === Object.prototype || - getPrototypeOf(prototype) === null) && - // Treat any genuine (non-Object.prototype-polluted) Symbol.toStringTag or - // Symbol.iterator as evidence the value is a tagged/iterable type rather - // than a plain object, while ignoring keys injected onto Object.prototype. - !hasOwnInPrototypeChain(val, toStringTag) && - !hasOwnInPrototypeChain(val, iterator) - ); -}; - -/** - * Determine if a value is an empty object (safely handles Buffers) - * - * @param {*} val The value to test - * - * @returns {boolean} True if value is an empty object, otherwise false - */ -const isEmptyObject = (val) => { - // Early return for non-objects or Buffers to prevent RangeError - if (!isObject(val) || isBuffer(val)) { - return false; - } - - try { - return Object.keys(val).length === 0 && Object.getPrototypeOf(val) === Object.prototype; - } catch (e) { - // Fallback for any other objects that might cause RangeError with Object.keys() - return false; - } -}; - -/** - * Determine if a value is a Date - * - * @param {*} val The value to test - * - * @returns {boolean} True if value is a Date, otherwise false - */ -const isDate = kindOfTest('Date'); - -/** - * Determine if a value is a File - * - * @param {*} val The value to test - * - * @returns {boolean} True if value is a File, otherwise false - */ -const isFile = kindOfTest('File'); - -/** - * Determine if a value is a React Native Blob - * React Native "blob": an object with a `uri` attribute. Optionally, it can - * also have a `name` and `type` attribute to specify filename and content type - * - * @see https://github.com/facebook/react-native/blob/26684cf3adf4094eb6c405d345a75bf8c7c0bf88/Libraries/Network/FormData.js#L68-L71 - * - * @param {*} value The value to test - * - * @returns {boolean} True if value is a React Native Blob, otherwise false - */ -const isReactNativeBlob = (value) => { - return !!(value && typeof value.uri !== 'undefined'); -}; - -/** - * Determine if environment is React Native - * ReactNative `FormData` has a non-standard `getParts()` method - * - * @param {*} formData The formData to test - * - * @returns {boolean} True if environment is React Native, otherwise false - */ -const isReactNative = (formData) => formData && typeof formData.getParts !== 'undefined'; - -/** - * Determine if a value is a Blob - * - * @param {*} val The value to test - * - * @returns {boolean} True if value is a Blob, otherwise false - */ -const isBlob = kindOfTest('Blob'); - -/** - * Determine if a value is a FileList - * - * @param {*} val The value to test - * - * @returns {boolean} True if value is a FileList, otherwise false - */ -const isFileList = kindOfTest('FileList'); -const isSet = kindOfTest('Set'); - -/** - * Determine if a value is a Stream - * - * @param {*} val The value to test - * - * @returns {boolean} True if value is a Stream, otherwise false - */ -const isStream = (val) => isObject(val) && isFunction$1(val.pipe); - -/** - * Determine if a value is a FormData - * - * @param {*} thing The value to test - * - * @returns {boolean} True if value is an FormData, otherwise false - */ -function getGlobal() { - if (typeof globalThis !== 'undefined') return globalThis; - if (typeof self !== 'undefined') return self; - if (typeof window !== 'undefined') return window; - if (typeof global !== 'undefined') return global; - return {}; -} - -const G = getGlobal(); -const FormDataCtor = typeof G.FormData !== 'undefined' ? G.FormData : undefined; - -const isFormData = (thing) => { - if (!thing) return false; - if (FormDataCtor && thing instanceof FormDataCtor) return true; - // Reject plain objects inheriting directly from Object.prototype so prototype-pollution gadgets can't spoof FormData. - const proto = getPrototypeOf(thing); - if (!proto || proto === Object.prototype) return false; - if (!isFunction$1(thing.append)) return false; - const kind = kindOf(thing); - return ( - kind === 'formdata' || - // detect form-data instance - (kind === 'object' && isFunction$1(thing.toString) && thing.toString() === '[object FormData]') - ); -}; - -/** - * Determine if a value is a URLSearchParams object - * - * @param {*} val The value to test - * - * @returns {boolean} True if value is a URLSearchParams object, otherwise false - */ -const isURLSearchParams = kindOfTest('URLSearchParams'); - -const [isReadableStream, isRequest, isResponse, isHeaders] = [ - 'ReadableStream', - 'Request', - 'Response', - 'Headers', -].map(kindOfTest); - -/** - * Trim excess whitespace off the beginning and end of a string - * - * @param {String} str The String to trim - * - * @returns {String} The String freed of excess whitespace - */ -const trim = (str) => { - return str.trim ? str.trim() : str.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, ''); -}; -/** - * Iterate over an Array or an Object invoking a function for each item. - * - * If `obj` is an Array callback will be called passing - * the value, index, and complete array for each item. - * - * If 'obj' is an Object callback will be called passing - * the value, key, and complete object for each property. - * - * @param {Object|Array} obj The object to iterate - * @param {Function} fn The callback to invoke for each item - * - * @param {Object} [options] - * @param {Boolean} [options.allOwnKeys = false] - * @returns {any} - */ -function forEach(obj, fn, { allOwnKeys = false } = {}) { - // Don't bother if no value provided - if (obj === null || typeof obj === 'undefined') { - return; - } - - let i; - let l; - - // Force an array if not already something iterable - if (typeof obj !== 'object') { - /*eslint no-param-reassign:0*/ - obj = [obj]; - } - - if (isArray(obj)) { - // Iterate over array values - for (i = 0, l = obj.length; i < l; i++) { - fn.call(null, obj[i], i, obj); - } - } else { - // Buffer check - if (isBuffer(obj)) { - return; - } - - // Iterate over object keys - const keys = allOwnKeys ? Object.getOwnPropertyNames(obj) : Object.keys(obj); - const len = keys.length; - let key; - - for (i = 0; i < len; i++) { - key = keys[i]; - fn.call(null, obj[key], key, obj); - } - } -} - -/** - * Finds a key in an object, case-insensitive, returning the actual key name. - * Returns null if the object is a Buffer or if no match is found. - * - * @param {Object} obj - The object to search. - * @param {string} key - The key to find (case-insensitive). - * @returns {?string} The actual key name if found, otherwise null. - */ -function findKey(obj, key) { - if (isBuffer(obj)) { - return null; - } - - key = key.toLowerCase(); - const keys = Object.keys(obj); - let i = keys.length; - let _key; - while (i-- > 0) { - _key = keys[i]; - if (key === _key.toLowerCase()) { - return _key; - } - } - return null; -} - -const _global = (() => { - /*eslint no-undef:0*/ - if (typeof globalThis !== 'undefined') return globalThis; - return typeof self !== 'undefined' ? self : typeof window !== 'undefined' ? window : global; -})(); - -const isContextDefined = (context) => !isUndefined(context) && context !== _global; - -/** - * Accepts varargs expecting each argument to be an object, then - * immutably merges the properties of each object and returns result. - * - * When multiple objects contain the same key the later object in - * the arguments list will take precedence. - * - * Example: - * - * ```js - * const result = merge({foo: 123}, {foo: 456}); - * console.log(result.foo); // outputs 456 - * ``` - * - * @param {Object} obj1 Object to merge - * - * @returns {Object} Result of all merge properties - */ -function merge(...objs) { - const { caseless, skipUndefined } = (isContextDefined(this) && this) || {}; - const result = {}; - const assignValue = (val, key) => { - // Skip dangerous property names to prevent prototype pollution - if (key === '__proto__' || key === 'constructor' || key === 'prototype') { - return; - } - - // findKey lowercases the key, so caseless lookup only applies to strings — - // symbol keys are identity-matched. - const targetKey = (caseless && typeof key === 'string' && findKey(result, key)) || key; - // Read via own-prop only — a bare `result[targetKey]` walks the prototype - // chain, so a polluted Object.prototype value could surface here and get - // copied into the merged result. - const existing = hasOwnProperty(result, targetKey) ? result[targetKey] : undefined; - if (isPlainObject(existing) && isPlainObject(val)) { - result[targetKey] = merge(existing, val); - } else if (isPlainObject(val)) { - result[targetKey] = merge({}, val); - } else if (isArray(val)) { - result[targetKey] = val.slice(); - } else if (!skipUndefined || !isUndefined(val)) { - result[targetKey] = val; - } - }; - - for (let i = 0, l = objs.length; i < l; i++) { - const source = objs[i]; - if (!source || isBuffer(source)) { - continue; - } - - forEach(source, assignValue); - - if (typeof source !== 'object' || isArray(source)) { - continue; - } - - const symbols = Object.getOwnPropertySymbols(source); - for (let j = 0; j < symbols.length; j++) { - const symbol = symbols[j]; - if (propertyIsEnumerable.call(source, symbol)) { - assignValue(source[symbol], symbol); - } - } - } - return result; -} - -/** - * Extends object a by mutably adding to it the properties of object b. - * - * @param {Object} a The object to be extended - * @param {Object} b The object to copy properties from - * @param {Object} thisArg The object to bind function to - * - * @param {Object} [options] - * @param {Boolean} [options.allOwnKeys] - * @returns {Object} The resulting value of object a - */ -const extend = (a, b, thisArg, { allOwnKeys } = {}) => { - forEach( - b, - (val, key) => { - if (thisArg && isFunction$1(val)) { - Object.defineProperty(a, key, { - // Null-proto descriptor so a polluted Object.prototype.get cannot - // hijack defineProperty's accessor-vs-data resolution. - __proto__: null, - value: bind(val, thisArg), - writable: true, - enumerable: true, - configurable: true, - }); - } else { - Object.defineProperty(a, key, { - __proto__: null, - value: val, - writable: true, - enumerable: true, - configurable: true, - }); - } - }, - { allOwnKeys } - ); - return a; -}; - -/** - * Remove byte order marker. This catches EF BB BF (the UTF-8 BOM) - * - * @param {string} content with BOM - * - * @returns {string} content value without BOM - */ -const stripBOM = (content) => { - if (content.charCodeAt(0) === 0xfeff) { - content = content.slice(1); - } - return content; -}; - -/** - * Inherit the prototype methods from one constructor into another - * @param {function} constructor - * @param {function} superConstructor - * @param {object} [props] - * @param {object} [descriptors] - * - * @returns {void} - */ -const inherits = (constructor, superConstructor, props, descriptors) => { - constructor.prototype = Object.create(superConstructor.prototype, descriptors); - Object.defineProperty(constructor.prototype, 'constructor', { - __proto__: null, - value: constructor, - writable: true, - enumerable: false, - configurable: true, - }); - Object.defineProperty(constructor, 'super', { - __proto__: null, - value: superConstructor.prototype, - }); - props && Object.assign(constructor.prototype, props); -}; - -/** - * Resolve object with deep prototype chain to a flat object - * @param {Object} sourceObj source object - * @param {Object} [destObj] - * @param {Function|Boolean} [filter] - * @param {Function} [propFilter] - * - * @returns {Object} - */ -const toFlatObject = (sourceObj, destObj, filter, propFilter) => { - let props; - let i; - let prop; - const merged = {}; - - destObj = destObj || {}; - // eslint-disable-next-line no-eq-null,eqeqeq - if (sourceObj == null) return destObj; - - do { - props = Object.getOwnPropertyNames(sourceObj); - i = props.length; - while (i-- > 0) { - prop = props[i]; - if ((!propFilter || propFilter(prop, sourceObj, destObj)) && !merged[prop]) { - destObj[prop] = sourceObj[prop]; - merged[prop] = true; - } - } - sourceObj = filter !== false && getPrototypeOf(sourceObj); - } while (sourceObj && (!filter || filter(sourceObj, destObj)) && sourceObj !== Object.prototype); - - return destObj; -}; - -/** - * Determines whether a string ends with the characters of a specified string - * - * @param {String} str - * @param {String} searchString - * @param {Number} [position= 0] - * - * @returns {boolean} - */ -const endsWith = (str, searchString, position) => { - str = String(str); - if (position === undefined || position > str.length) { - position = str.length; - } - position -= searchString.length; - const lastIndex = str.indexOf(searchString, position); - return lastIndex !== -1 && lastIndex === position; -}; - -/** - * Returns new array from array like object or null if failed - * - * @param {*} [thing] - * - * @returns {?Array} - */ -const toArray = (thing) => { - if (!thing) return null; - if (isArray(thing)) return thing; - let i = thing.length; - if (!isNumber(i)) return null; - const arr = new Array(i); - while (i-- > 0) { - arr[i] = thing[i]; - } - return arr; -}; - -/** - * Checking if the Uint8Array exists and if it does, it returns a function that checks if the - * thing passed in is an instance of Uint8Array - * - * @param {TypedArray} - * - * @returns {Array} - */ -// eslint-disable-next-line func-names -const isTypedArray = ((TypedArray) => { - // eslint-disable-next-line func-names - return (thing) => { - return TypedArray && thing instanceof TypedArray; - }; -})(typeof Uint8Array !== 'undefined' && getPrototypeOf(Uint8Array)); - -/** - * For each entry in the object, call the function with the key and value. - * - * @param {Object} obj - The object to iterate over. - * @param {Function} fn - The function to call for each entry. - * - * @returns {void} - */ -const forEachEntry = (obj, fn) => { - const generator = obj && obj[iterator]; - - const _iterator = generator.call(obj); - - let result; - - while ((result = _iterator.next()) && !result.done) { - const pair = result.value; - fn.call(obj, pair[0], pair[1]); - } -}; - -/** - * It takes a regular expression and a string, and returns an array of all the matches - * - * @param {string} regExp - The regular expression to match against. - * @param {string} str - The string to search. - * - * @returns {Array} - */ -const matchAll = (regExp, str) => { - let matches; - const arr = []; - - while ((matches = regExp.exec(str)) !== null) { - arr.push(matches); - } - - return arr; -}; - -/* Checking if the kindOfTest function returns true when passed an HTMLFormElement. */ -const isHTMLForm = kindOfTest('HTMLFormElement'); - -const toCamelCase = (str) => { - return str.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g, function replacer(m, p1, p2) { - return p1.toUpperCase() + p2; - }); -}; - -const { propertyIsEnumerable } = Object.prototype; - -/** - * Determine if a value is a RegExp object - * - * @param {*} val The value to test - * - * @returns {boolean} True if value is a RegExp object, otherwise false - */ -const isRegExp = kindOfTest('RegExp'); - -const reduceDescriptors = (obj, reducer) => { - const descriptors = Object.getOwnPropertyDescriptors(obj); - const reducedDescriptors = {}; - - forEach(descriptors, (descriptor, name) => { - let ret; - if ((ret = reducer(descriptor, name, obj)) !== false) { - reducedDescriptors[name] = ret || descriptor; - } - }); - - Object.defineProperties(obj, reducedDescriptors); -}; - -/** - * Makes all methods read-only - * @param {Object} obj - */ - -const freezeMethods = (obj) => { - reduceDescriptors(obj, (descriptor, name) => { - // skip restricted props in strict mode - if (isFunction$1(obj) && ['arguments', 'caller', 'callee'].includes(name)) { - return false; - } - - const value = obj[name]; - - if (!isFunction$1(value)) return; - - descriptor.enumerable = false; - - if ('writable' in descriptor) { - descriptor.writable = false; - return; - } - - if (!descriptor.set) { - descriptor.set = () => { - throw Error("Can not rewrite read-only method '" + name + "'"); - }; - } - }); -}; - -/** - * Converts an array or a delimited string into an object set with values as keys and true as values. - * Useful for fast membership checks. - * - * @param {Array|string} arrayOrString - The array or string to convert. - * @param {string} delimiter - The delimiter to use if input is a string. - * @returns {Object} An object with keys from the array or string, values set to true. - */ -const toObjectSet = (arrayOrString, delimiter) => { - const obj = {}; - - const define = (arr) => { - arr.forEach((value) => { - obj[value] = true; - }); - }; - - isArray(arrayOrString) ? define(arrayOrString) : define(String(arrayOrString).split(delimiter)); - - return obj; -}; - -const noop = () => {}; - -const toFiniteNumber = (value, defaultValue) => { - return value != null && Number.isFinite((value = +value)) ? value : defaultValue; -}; - -/** - * If the thing is a FormData object, return true, otherwise return false. - * - * @param {unknown} thing - The thing to check. - * - * @returns {boolean} - */ -function isSpecCompliantForm(thing) { - return !!( - thing && - isFunction$1(thing.append) && - thing[toStringTag] === 'FormData' && - thing[iterator] - ); -} - -/** - * Recursively converts an object to a JSON-compatible object, handling circular references and Buffers. - * - * @param {Object} obj - The object to convert. - * @returns {Object} The JSON-compatible object. - */ -const toJSONObject = (obj) => { - const visited = new WeakSet(); - - const visit = (source) => { - if (isObject(source)) { - if (visited.has(source)) { - return; - } - - //Buffer check - if (isBuffer(source)) { - return source; - } - - if (!('toJSON' in source)) { - // add-on descent / delete-on-ascent: preserves path semantics, so DAG nodes serialise at every occurrence (see #7230). - visited.add(source); - - let target; - - if (isSet(source)) { - target = []; - for (const value of source) { - const reducedValue = visit(value); - !isUndefined(reducedValue) && target.push(reducedValue); - } - } else { - target = isArray(source) ? [] : {}; - - forEach(source, (value, key) => { - const reducedValue = visit(value); - !isUndefined(reducedValue) && (target[key] = reducedValue); - }); - } - - visited.delete(source); - - return target; - } - } - - return source; - }; - - return visit(obj); -}; - -/** - * Determines if a value is an async function. - * - * @param {*} thing - The value to test. - * @returns {boolean} True if value is an async function, otherwise false. - */ -const isAsyncFn = kindOfTest('AsyncFunction'); - -/** - * Determines if a value is thenable (has then and catch methods). - * - * @param {*} thing - The value to test. - * @returns {boolean} True if value is thenable, otherwise false. - */ -const isThenable = (thing) => - thing && - (isObject(thing) || isFunction$1(thing)) && - isFunction$1(thing.then) && - isFunction$1(thing.catch); - -// original code -// https://github.com/DigitalBrainJS/AxiosPromise/blob/16deab13710ec09779922131f3fa5954320f83ab/lib/utils.js#L11-L34 - -/** - * Provides a cross-platform setImmediate implementation. - * Uses native setImmediate if available, otherwise falls back to postMessage or setTimeout. - * - * @param {boolean} setImmediateSupported - Whether setImmediate is supported. - * @param {boolean} postMessageSupported - Whether postMessage is supported. - * @returns {Function} A function to schedule a callback asynchronously. - */ -const _setImmediate = ((setImmediateSupported, postMessageSupported) => { - if (setImmediateSupported) { - return setImmediate; - } - - return postMessageSupported - ? ((token, callbacks) => { - _global.addEventListener( - 'message', - ({ source, data }) => { - if (source === _global && data === token) { - callbacks.length && callbacks.shift()(); - } - }, - false - ); - - return (cb) => { - callbacks.push(cb); - _global.postMessage(token, '*'); - }; - })(`axios@${Math.random()}`, []) - : (cb) => setTimeout(cb); -})(typeof setImmediate === 'function', isFunction$1(_global.postMessage)); - -/** - * Schedules a microtask or asynchronous callback as soon as possible. - * Uses queueMicrotask if available, otherwise falls back to process.nextTick or _setImmediate. - * - * @type {Function} - */ -const asap = - typeof queueMicrotask !== 'undefined' - ? queueMicrotask.bind(_global) - : (typeof process !== 'undefined' && process.nextTick) || _setImmediate; - -// ********************* - -const isIterable = (thing) => thing != null && isFunction$1(thing[iterator]); - -/** - * Determine if a value is iterable via an iterator that is NOT sourced solely - * from a polluted Object.prototype. Use this instead of `isIterable` whenever - * the iterable comes from untrusted input (e.g. user-supplied header sources), - * so `Object.prototype[Symbol.iterator] = ...` cannot turn an ordinary object - * into an attacker-controlled entries iterator. - * - * @param {*} thing The value to test - * - * @returns {boolean} True if value has a non-polluted iterator - */ -const isSafeIterable = (thing) => - thing != null && hasOwnInPrototypeChain(thing, iterator) && isIterable(thing); - -var utils$1 = { - isArray, - isArrayBuffer, - isBuffer, - isFormData, - isArrayBufferView, - isString, - isNumber, - isBoolean, - isObject, - isPlainObject, - isEmptyObject, - isReadableStream, - isRequest, - isResponse, - isHeaders, - isUndefined, - isDate, - isFile, - isReactNativeBlob, - isReactNative, - isBlob, - isRegExp, - isFunction: isFunction$1, - isStream, - isURLSearchParams, - isTypedArray, - isFileList, - forEach, - merge, - extend, - trim, - stripBOM, - inherits, - toFlatObject, - kindOf, - kindOfTest, - endsWith, - toArray, - forEachEntry, - matchAll, - isHTMLForm, - hasOwnProperty, - hasOwnProp: hasOwnProperty, // an alias to avoid ESLint no-prototype-builtins detection - hasOwnInPrototypeChain, - getSafeProp, - reduceDescriptors, - freezeMethods, - toObjectSet, - toCamelCase, - noop, - toFiniteNumber, - findKey, - global: _global, - isContextDefined, - isSpecCompliantForm, - toJSONObject, - isAsyncFn, - isThenable, - setImmediate: _setImmediate, - asap, - isIterable, - isSafeIterable, -}; - -// RawAxiosHeaders whose duplicates are ignored by node -// c.f. https://nodejs.org/api/http.html#http_message_headers -const ignoreDuplicateOf = utils$1.toObjectSet([ - 'age', - 'authorization', - 'content-length', - 'content-type', - 'etag', - 'expires', - 'from', - 'host', - 'if-modified-since', - 'if-unmodified-since', - 'last-modified', - 'location', - 'max-forwards', - 'proxy-authorization', - 'referer', - 'retry-after', - 'user-agent', -]); - -/** - * Parse headers into an object - * - * ``` - * Date: Wed, 27 Aug 2014 08:58:49 GMT - * Content-Type: application/json - * Connection: keep-alive - * Transfer-Encoding: chunked - * ``` - * - * @param {String} rawHeaders Headers needing to be parsed - * - * @returns {Object} Headers parsed into an object - */ -var parseHeaders = (rawHeaders) => { - const parsed = {}; - let key; - let val; - let i; - - rawHeaders && - rawHeaders.split('\n').forEach(function parser(line) { - i = line.indexOf(':'); - key = line.substring(0, i).trim().toLowerCase(); - val = line.substring(i + 1).trim(); - - const hasKey = utils$1.hasOwnProp(parsed, key); - - if (!key || (hasKey && utils$1.hasOwnProp(ignoreDuplicateOf, key))) { - return; - } - - if (key === 'set-cookie') { - if (hasKey) { - parsed[key].push(val); - } else { - parsed[key] = [val]; - } - } else { - parsed[key] = hasKey ? parsed[key] + ', ' + val : val; - } - }); - - return parsed; -}; - -function trimSPorHTAB(str) { - let start = 0; - let end = str.length; - - while (start < end) { - const code = str.charCodeAt(start); - - if (code !== 0x09 && code !== 0x20) { - break; - } - - start += 1; - } - - while (end > start) { - const code = str.charCodeAt(end - 1); - - if (code !== 0x09 && code !== 0x20) { - break; - } - - end -= 1; - } - - return start === 0 && end === str.length ? str : str.slice(start, end); -} - -// The control-code ranges are intentional: header sanitization strips C0/DEL bytes. -// eslint-disable-next-line no-control-regex -const INVALID_UNICODE_HEADER_VALUE_CHARS = new RegExp('[\\u0000-\\u0008\\u000a-\\u001f\\u007f]+', 'g'); -// eslint-disable-next-line no-control-regex -const INVALID_BYTE_STRING_HEADER_VALUE_CHARS = new RegExp('[^\\u0009\\u0020-\\u007e\\u0080-\\u00ff]+', 'g'); - -function sanitizeValue(value, invalidChars) { - if (utils$1.isArray(value)) { - return value.map((item) => sanitizeValue(item, invalidChars)); - } - - return trimSPorHTAB(String(value).replace(invalidChars, '')); -} - -const sanitizeHeaderValue = (value) => - sanitizeValue(value, INVALID_UNICODE_HEADER_VALUE_CHARS); - -const sanitizeByteStringHeaderValue = (value) => - sanitizeValue(value, INVALID_BYTE_STRING_HEADER_VALUE_CHARS); - -function toByteStringHeaderObject(headers) { - const byteStringHeaders = Object.create(null); - - utils$1.forEach(headers.toJSON(), (value, header) => { - byteStringHeaders[header] = sanitizeByteStringHeaderValue(value); - }); - - return byteStringHeaders; -} - -const $internals = Symbol('internals'); - -function normalizeHeader(header) { - return header && String(header).trim().toLowerCase(); -} - -function normalizeValue(value) { - if (value === false || value == null) { - return value; - } - - return utils$1.isArray(value) ? value.map(normalizeValue) : sanitizeHeaderValue(String(value)); -} - -function parseTokens(str) { - const tokens = Object.create(null); - const tokensRE = /([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g; - let match; - - while ((match = tokensRE.exec(str))) { - tokens[match[1]] = match[2]; - } - - return tokens; -} - -const parameterNameRE = /^[!#$%&'*+\-.^_`|~0-9A-Za-z]+$/; - -function trimOWS(value) { - let start = 0; - let end = value.length; - - while (start < end) { - const code = value.charCodeAt(start); - - if (code !== 0x09 && code !== 0x20) { - break; - } - - start += 1; - } - - while (end > start) { - const code = value.charCodeAt(end - 1); - - if (code !== 0x09 && code !== 0x20) { - break; - } - - end -= 1; - } - - return start === 0 && end === value.length ? value : value.slice(start, end); -} - -function decodeQuotedString(value) { - const last = value.length - 1; - - if (last < 1 || value.charCodeAt(0) !== 0x22 || value.charCodeAt(last) !== 0x22) { - return value; - } - - let decoded = ''; - - for (let i = 1; i < last; i++) { - const code = value.charCodeAt(i); - - if (code === 0x22) { - return value; - } - - if (code === 0x5c) { - i += 1; - - if (i >= last) { - return value; - } - } - - decoded += value[i]; - } - - return decoded; -} - -function parseParameters(value) { - const parameters = Object.create(null); - const str = String(value); - let start = 0; - let quoted = false; - let escaped = false; - - function parseParameter(end) { - const part = trimOWS(str.slice(start, end)); - const equals = part.indexOf('='); - - if (equals < 1) { - return; - } - - const name = trimOWS(part.slice(0, equals)); - - if (!parameterNameRE.test(name)) { - return; - } - - const normalizedName = name.toLowerCase(); - - if ( - normalizedName === '__proto__' || - normalizedName === 'constructor' || - normalizedName === 'prototype' - ) { - return; - } - - const parameterValue = trimOWS(part.slice(equals + 1)); - parameters[normalizedName] = decodeQuotedString(parameterValue); - } - - for (let i = 0; i < str.length; i++) { - const code = str.charCodeAt(i); - - if (quoted) { - if (escaped) { - escaped = false; - } else if (code === 0x5c) { - escaped = true; - } else if (code === 0x22) { - quoted = false; - } - } else if (code === 0x22) { - quoted = true; - } else if (code === 0x2c || code === 0x3b) { - parseParameter(i); - start = i + 1; - } - } - - parseParameter(str.length); - - return parameters; -} - -const isValidHeaderName = (str) => /^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(str.trim()); - -function matchHeaderValue(context, value, header, filter, isHeaderNameFilter) { - if (utils$1.isFunction(filter)) { - return filter.call(this, value, header); - } - - if (isHeaderNameFilter) { - value = header; - } - - if (!utils$1.isString(value)) return; - - if (utils$1.isString(filter)) { - return value.indexOf(filter) !== -1; - } - - if (utils$1.isRegExp(filter)) { - return filter.test(value); - } -} - -function formatHeader(header) { - return header - .trim() - .toLowerCase() - .replace(/([a-z\d])(\w*)/g, (w, char, str) => { - return char.toUpperCase() + str; - }); -} - -function buildAccessors(obj, header) { - const accessorName = utils$1.toCamelCase(' ' + header); - - ['get', 'set', 'has'].forEach((methodName) => { - Object.defineProperty(obj, methodName + accessorName, { - // Null-proto descriptor so a polluted Object.prototype.get cannot turn - // this data descriptor into an accessor descriptor on the way in. - __proto__: null, - value: function (arg1, arg2, arg3) { - return this[methodName].call(this, header, arg1, arg2, arg3); - }, - configurable: true, - }); - }); -} - -class AxiosHeaders { - constructor(headers) { - headers && this.set(headers); - } - - set(header, valueOrRewrite, rewrite) { - const self = this; - - function setHeader(_value, _header, _rewrite) { - const lHeader = normalizeHeader(_header); - - if (!lHeader) { - return; - } - - const key = utils$1.findKey(self, lHeader); - - if ( - !key || - self[key] === undefined || - _rewrite === true || - (_rewrite === undefined && self[key] !== false) - ) { - self[key || _header] = normalizeValue(_value); - } - } - - const setHeaders = (headers, _rewrite) => - utils$1.forEach(headers, (_value, _header) => setHeader(_value, _header, _rewrite)); - - if (utils$1.isPlainObject(header) || header instanceof this.constructor) { - setHeaders(header, valueOrRewrite); - } else if (utils$1.isString(header) && (header = header.trim()) && !isValidHeaderName(header)) { - setHeaders(parseHeaders(header), valueOrRewrite); - } else if (utils$1.isObject(header) && utils$1.isSafeIterable(header)) { - let obj = Object.create(null), - dest, - key; - for (const entry of header) { - if (!utils$1.isArray(entry)) { - throw new TypeError('Object iterator must return a key-value pair'); - } - - key = entry[0]; - - if (utils$1.hasOwnProp(obj, key)) { - dest = obj[key]; - obj[key] = utils$1.isArray(dest) ? [...dest, entry[1]] : [dest, entry[1]]; - } else { - obj[key] = entry[1]; - } - } - - setHeaders(obj, valueOrRewrite); - } else { - header != null && setHeader(valueOrRewrite, header, rewrite); - } - - return this; - } - - get(header, parser) { - header = normalizeHeader(header); - - if (header) { - const key = utils$1.findKey(this, header); - - if (key) { - const value = this[key]; - - if (!parser) { - return value; - } - - if (parser === true) { - return parseTokens(value); - } - - if (utils$1.isFunction(parser)) { - return parser.call(this, value, key); - } - - if (utils$1.isRegExp(parser)) { - return parser.exec(value); - } - - throw new TypeError('parser must be boolean|regexp|function'); - } - } - } - - has(header, matcher) { - header = normalizeHeader(header); - - if (header) { - const key = utils$1.findKey(this, header); - - return !!( - key && - this[key] !== undefined && - (!matcher || matchHeaderValue(this, this[key], key, matcher)) - ); - } - - return false; - } - - delete(header, matcher) { - const self = this; - let deleted = false; - - function deleteHeader(_header) { - _header = normalizeHeader(_header); - - if (_header) { - const key = utils$1.findKey(self, _header); - - if (key && (!matcher || matchHeaderValue(self, self[key], key, matcher))) { - delete self[key]; - - deleted = true; - } - } - } - - if (utils$1.isArray(header)) { - header.forEach(deleteHeader); - } else { - deleteHeader(header); - } - - return deleted; - } - - clear(matcher) { - const keys = Object.keys(this); - let i = keys.length; - let deleted = false; - - while (i--) { - const key = keys[i]; - if (!matcher || matchHeaderValue(this, this[key], key, matcher, true)) { - delete this[key]; - deleted = true; - } - } - - return deleted; - } - - normalize(format) { - const self = this; - const headers = {}; - - utils$1.forEach(this, (value, header) => { - const key = utils$1.findKey(headers, header); - - if (key) { - self[key] = normalizeValue(value); - delete self[header]; - return; - } - - const normalized = format ? formatHeader(header) : String(header).trim(); - - if (normalized !== header) { - delete self[header]; - } - - self[normalized] = normalizeValue(value); - - headers[normalized] = true; - }); - - return this; - } - - concat(...targets) { - return this.constructor.concat(this, ...targets); - } - - toJSON(asStrings) { - const obj = Object.create(null); - - utils$1.forEach(this, (value, header) => { - value != null && - value !== false && - (obj[header] = asStrings && utils$1.isArray(value) ? value.join(', ') : value); - }); - - return obj; - } - - [Symbol.iterator]() { - return Object.entries(this.toJSON())[Symbol.iterator](); - } - - toString() { - return Object.entries(this.toJSON()) - .map(([header, value]) => header + ': ' + value) - .join('\n'); - } - - getSetCookie() { - const value = this.get('set-cookie'); - return utils$1.isArray(value) ? value : value == null || value === false ? [] : [value]; - } - - get [Symbol.toStringTag]() { - return 'AxiosHeaders'; - } - - static from(thing) { - return thing instanceof this ? thing : new this(thing); - } - - static parseParameters(value) { - return parseParameters(value); - } - - static concat(first, ...targets) { - const computed = new this(first); - - targets.forEach((target) => computed.set(target)); - - return computed; - } - - static accessor(header) { - const internals = - (this[$internals] = - this[$internals] = - { - accessors: {}, - }); - - const accessors = internals.accessors; - const prototype = this.prototype; - - function defineAccessor(_header) { - const lHeader = normalizeHeader(_header); - - if (!accessors[lHeader]) { - buildAccessors(prototype, _header); - accessors[lHeader] = true; - } - } - - utils$1.isArray(header) ? header.forEach(defineAccessor) : defineAccessor(header); - - return this; - } -} - -AxiosHeaders.accessor([ - 'Content-Type', - 'Content-Length', - 'Accept', - 'Accept-Encoding', - 'User-Agent', - 'Authorization', -]); - -// reserved names hotfix -utils$1.reduceDescriptors(AxiosHeaders.prototype, ({ value }, key) => { - let mapped = key[0].toUpperCase() + key.slice(1); // map `set` => `Set` - return { - get: () => value, - set(headerValue) { - this[mapped] = headerValue; - }, - }; -}); - -utils$1.freezeMethods(AxiosHeaders); - -const REDACTED = '[REDACTED ****]'; - -function hasOwnOrPrototypeToJSON(source) { - if (utils$1.hasOwnProp(source, 'toJSON')) { - return true; - } - - let prototype = Object.getPrototypeOf(source); - - while (prototype && prototype !== Object.prototype) { - if (utils$1.hasOwnProp(prototype, 'toJSON')) { - return true; - } - - prototype = Object.getPrototypeOf(prototype); - } - - return false; -} - -// Build a plain-object snapshot of `config` and replace the value of any key -// (case-insensitive) listed in `redactKeys` with REDACTED. Walks through arrays -// and AxiosHeaders, and short-circuits on circular references. -function redactConfig(config, redactKeys) { - const lowerKeys = new Set(redactKeys.map((k) => String(k).toLowerCase())); - const seen = []; - - const visit = (source) => { - if (source === null || typeof source !== 'object') return source; - if (utils$1.isBuffer(source)) return source; - if (seen.indexOf(source) !== -1) return undefined; - - if (source instanceof AxiosHeaders) { - source = source.toJSON(); - } - - seen.push(source); - - let result; - if (utils$1.isArray(source)) { - result = []; - source.forEach((v, i) => { - const reducedValue = visit(v); - if (!utils$1.isUndefined(reducedValue)) { - result[i] = reducedValue; - } - }); - } else { - if (!utils$1.isPlainObject(source) && hasOwnOrPrototypeToJSON(source)) { - seen.pop(); - return source; - } - - result = Object.create(null); - for (const [key, value] of Object.entries(source)) { - const reducedValue = lowerKeys.has(key.toLowerCase()) ? REDACTED : visit(value); - if (!utils$1.isUndefined(reducedValue)) { - result[key] = reducedValue; - } - } - } - - seen.pop(); - return result; - }; - - return visit(config); -} - -function stringifySafely$1(value) { - try { - return String(value); - } catch (err) { - return ''; - } -} - -function aggregateErrorMessage(error) { - const message = error.errors - .map((entry) => { - try { - return entry && entry.message ? stringifySafely$1(entry.message) : stringifySafely$1(entry); - } catch (err) { - return ''; - } - }) - .filter(Boolean) - .join('; '); - - return message || error.name || 'AggregateError'; -} - -class AxiosError extends Error { - static from(error, code, config, request, response, customProps) { - // `AggregateError` (thrown by Node on dual-stack/Happy-Eyeballs connection - // failures) has an empty `message`; its detail lives in `errors[]`. Without - // this, the wrapped error surfaces with a blank message (see #6721). - let message = error.message; - if (!message && utils$1.isArray(error.errors) && error.errors.length) { - message = aggregateErrorMessage(error); - } - - const axiosError = new AxiosError(message, code || error.code, config, request, response); - // Match native `Error` `cause` semantics: non-enumerable. The wrapped - // error often carries circular internals (sockets, requests, agents), so - // an enumerable `cause` makes structured loggers (pino/winston) and any - // own-property walk throw "Converting circular structure to JSON". - // Regression from #6982; see #7205. `__proto__: null` mirrors the - // `message` descriptor below (prototype-pollution-safe descriptor). - Object.defineProperty(axiosError, 'cause', { - __proto__: null, - value: error, - writable: true, - enumerable: false, - configurable: true, - }); - axiosError.name = error.name; - - // Preserve status from the original error if not already set from response - if (error.status != null && axiosError.status == null) { - axiosError.status = error.status; - } - - customProps && Object.assign(axiosError, customProps); - return axiosError; - } - - /** - * Create an Error with the specified message, config, error code, request and response. - * - * @param {string} message The error message. - * @param {string} [code] The error code (for example, 'ECONNABORTED'). - * @param {Object} [config] The config. - * @param {Object} [request] The request. - * @param {Object} [response] The response. - * - * @returns {Error} The created error. - */ - constructor(message, code, config, request, response) { - super(message); - - // Make message enumerable to maintain backward compatibility - // The native Error constructor sets message as non-enumerable, - // but axios < v1.13.3 had it as enumerable - Object.defineProperty(this, 'message', { - // Null-proto descriptor so a polluted Object.prototype.get cannot turn - // this data descriptor into an accessor descriptor on the way in. - __proto__: null, - value: message, - enumerable: true, - writable: true, - configurable: true, - }); - - this.name = 'AxiosError'; - this.isAxiosError = true; - code && (this.code = code); - config && (this.config = config); - request && (this.request = request); - if (response) { - this.response = response; - this.status = response.status; - } - } - - toJSON() { - // Opt-in redaction: when the request config carries a `redact` array, the - // value of any matching key (case-insensitive, at any depth) is replaced - // with REDACTED in the serialized snapshot. Undefined or empty leaves the - // existing serialization behavior unchanged. - const config = this.config; - const redactKeys = config && utils$1.hasOwnProp(config, 'redact') ? config.redact : undefined; - const serializedConfig = - utils$1.isArray(redactKeys) && redactKeys.length > 0 - ? redactConfig(config, redactKeys) - : utils$1.toJSONObject(config); - - return { - // Standard - message: this.message, - name: this.name, - // Microsoft - description: this.description, - number: this.number, - // Mozilla - fileName: this.fileName, - lineNumber: this.lineNumber, - columnNumber: this.columnNumber, - stack: this.stack, - // Axios - config: serializedConfig, - code: this.code, - status: this.status, - }; - } -} - -// This can be changed to static properties as soon as the parser options in .eslint.cjs are updated. -AxiosError.ERR_BAD_OPTION_VALUE = 'ERR_BAD_OPTION_VALUE'; -AxiosError.ERR_BAD_OPTION = 'ERR_BAD_OPTION'; -AxiosError.ECONNABORTED = 'ECONNABORTED'; -AxiosError.ETIMEDOUT = 'ETIMEDOUT'; -AxiosError.ECONNREFUSED = 'ECONNREFUSED'; -AxiosError.ERR_NETWORK = 'ERR_NETWORK'; -AxiosError.ERR_FR_TOO_MANY_REDIRECTS = 'ERR_FR_TOO_MANY_REDIRECTS'; -AxiosError.ERR_DEPRECATED = 'ERR_DEPRECATED'; -AxiosError.ERR_BAD_RESPONSE = 'ERR_BAD_RESPONSE'; -AxiosError.ERR_BAD_REQUEST = 'ERR_BAD_REQUEST'; -AxiosError.ERR_CANCELED = 'ERR_CANCELED'; -AxiosError.ERR_NOT_SUPPORT = 'ERR_NOT_SUPPORT'; -AxiosError.ERR_INVALID_URL = 'ERR_INVALID_URL'; -AxiosError.ERR_FORM_DATA_DEPTH_EXCEEDED = 'ERR_FORM_DATA_DEPTH_EXCEEDED'; - -// eslint-disable-next-line strict -var httpAdapter = null; - -// Default nesting limit shared with the inverse transform (formDataToJSON) so -// the FormData <-> JSON round-trip stays symmetric. -const DEFAULT_FORM_DATA_MAX_DEPTH = 100; - -/** - * Determines if the given thing is a array or js object. - * - * @param {string} thing - The object or array to be visited. - * - * @returns {boolean} - */ -function isVisitable(thing) { - return utils$1.isPlainObject(thing) || utils$1.isArray(thing); -} - -/** - * It removes the brackets from the end of a string - * - * @param {string} key - The key of the parameter. - * - * @returns {string} the key without the brackets. - */ -function removeBrackets(key) { - return utils$1.endsWith(key, '[]') ? key.slice(0, -2) : key; -} - -/** - * It takes a path, a key, and a boolean, and returns a string - * - * @param {string} path - The path to the current key. - * @param {string} key - The key of the current object being iterated over. - * @param {string} dots - If true, the key will be rendered with dots instead of brackets. - * - * @returns {string} The path to the current key. - */ -function renderKey(path, key, dots) { - if (!path) return key; - return path - .concat(key) - .map(function each(token, i) { - // eslint-disable-next-line no-param-reassign - token = removeBrackets(token); - return !dots && i ? '[' + token + ']' : token; - }) - .join(dots ? '.' : ''); -} - -/** - * If the array is an array and none of its elements are visitable, then it's a flat array. - * - * @param {Array} arr - The array to check - * - * @returns {boolean} - */ -function isFlatArray(arr) { - return utils$1.isArray(arr) && !arr.some(isVisitable); -} - -const predicates = utils$1.toFlatObject(utils$1, {}, null, function filter(prop) { - return /^is[A-Z]/.test(prop); -}); - -/** - * Convert a data object to FormData - * - * @param {Object} obj - * @param {?Object} [formData] - * @param {?Object} [options] - * @param {Function} [options.visitor] - * @param {Boolean} [options.metaTokens = true] - * @param {Boolean} [options.dots = false] - * @param {?Boolean} [options.indexes = false] - * - * @returns {Object} - **/ - -/** - * It converts an object into a FormData object - * - * @param {Object} obj - The object to convert to form data. - * @param {string} formData - The FormData object to append to. - * @param {Object} options - * - * @returns - */ -function toFormData(obj, formData, options) { - if (!utils$1.isObject(obj)) { - throw new TypeError('target must be an object'); - } - - // eslint-disable-next-line no-param-reassign - formData = formData || new (FormData)(); - - // eslint-disable-next-line no-param-reassign - options = utils$1.toFlatObject( - options, - { - metaTokens: true, - dots: false, - indexes: false, - }, - false, - function defined(option, source) { - // eslint-disable-next-line no-eq-null,eqeqeq - return !utils$1.isUndefined(source[option]); - } - ); - - const metaTokens = options.metaTokens; - // eslint-disable-next-line no-use-before-define - const visitor = options.visitor || defaultVisitor; - const dots = options.dots; - const indexes = options.indexes; - const _Blob = options.Blob || (typeof Blob !== 'undefined' && Blob); - const maxDepth = options.maxDepth === undefined ? DEFAULT_FORM_DATA_MAX_DEPTH : options.maxDepth; - const useBlob = _Blob && utils$1.isSpecCompliantForm(formData); - const stack = []; - - if (!utils$1.isFunction(visitor)) { - throw new TypeError('visitor must be a function'); - } - - function convertValue(value) { - if (value === null) return ''; - - if (utils$1.isDate(value)) { - return value.toISOString(); - } - - if (utils$1.isBoolean(value)) { - return value.toString(); - } - - if (!useBlob && utils$1.isBlob(value)) { - throw new AxiosError('Blob is not supported. Use a Buffer instead.'); - } - - if (utils$1.isArrayBuffer(value) || utils$1.isTypedArray(value)) { - if (useBlob && typeof _Blob === 'function') { - return new _Blob([value]); - } - throw new AxiosError('Blob is not supported. Use a Buffer instead.', AxiosError.ERR_NOT_SUPPORT); - } - - return value; - } - - function throwIfMaxDepthExceeded(depth) { - if (depth > maxDepth) { - throw new AxiosError( - 'Object is too deeply nested (' + depth + ' levels). Max depth: ' + maxDepth, - AxiosError.ERR_FORM_DATA_DEPTH_EXCEEDED - ); - } - } - - function stringifyWithDepthLimit(value, depth) { - if (maxDepth === Infinity) { - return JSON.stringify(value); - } - - const ancestors = []; - - return JSON.stringify(value, function limitDepth(_key, currentValue) { - if (!utils$1.isObject(currentValue)) { - return currentValue; - } - - while (ancestors.length && ancestors[ancestors.length - 1] !== this) { - ancestors.pop(); - } - - ancestors.push(currentValue); - throwIfMaxDepthExceeded(depth + ancestors.length - 1); - - return currentValue; - }); - } - - /** - * Default visitor. - * - * @param {*} value - * @param {String|Number} key - * @param {Array} path - * @this {FormData} - * - * @returns {boolean} return true to visit the each prop of the value recursively - */ - function defaultVisitor(value, key, path) { - let arr = value; - - if (utils$1.isReactNative(formData) && utils$1.isReactNativeBlob(value)) { - formData.append(renderKey(path, key, dots), convertValue(value)); - return false; - } - - if (value && !path && typeof value === 'object') { - if (utils$1.endsWith(key, '{}')) { - // eslint-disable-next-line no-param-reassign - key = metaTokens ? key : key.slice(0, -2); - // eslint-disable-next-line no-param-reassign - value = stringifyWithDepthLimit(value, 1); - } else if ( - (utils$1.isArray(value) && isFlatArray(value)) || - ((utils$1.isFileList(value) || utils$1.endsWith(key, '[]')) && (arr = utils$1.toArray(value))) - ) { - // eslint-disable-next-line no-param-reassign - key = removeBrackets(key); - - arr.forEach(function each(el, index) { - !(utils$1.isUndefined(el) || el === null) && - formData.append( - // eslint-disable-next-line no-nested-ternary - indexes === true - ? renderKey([key], index, dots) - : indexes === null - ? key - : key + '[]', - convertValue(el) - ); - }); - return false; - } - } - - if (isVisitable(value)) { - return true; - } - - formData.append(renderKey(path, key, dots), convertValue(value)); - - return false; - } - - const exposedHelpers = Object.assign(predicates, { - defaultVisitor, - convertValue, - isVisitable, - }); - - function build(value, path, depth = 0) { - if (utils$1.isUndefined(value)) return; - - throwIfMaxDepthExceeded(depth); - - if (stack.indexOf(value) !== -1) { - throw new Error('Circular reference detected in ' + path.join('.')); - } - - stack.push(value); - - utils$1.forEach(value, function each(el, key) { - const result = - !(utils$1.isUndefined(el) || el === null) && - visitor.call(formData, el, utils$1.isString(key) ? key.trim() : key, path, exposedHelpers); - - if (result === true) { - build(el, path ? path.concat(key) : [key], depth + 1); - } - }); - - stack.pop(); - } - - if (!utils$1.isObject(obj)) { - throw new TypeError('data must be an object'); - } - - build(obj); - - return formData; -} - -/** - * It encodes a string by replacing all characters that are not in the unreserved set with - * their percent-encoded equivalents - * - * @param {string} str - The string to encode. - * - * @returns {string} The encoded string. - */ -function encode$1(str) { - const charMap = { - '!': '%21', - "'": '%27', - '(': '%28', - ')': '%29', - '~': '%7E', - '%20': '+', - }; - return encodeURIComponent(str).replace(/[!'()~]|%20/g, function replacer(match) { - return charMap[match]; - }); -} - -/** - * It takes a params object and converts it to a FormData object - * - * @param {Object} params - The parameters to be converted to a FormData object. - * @param {Object} options - The options object passed to the Axios constructor. - * - * @returns {void} - */ -function AxiosURLSearchParams(params, options) { - this._pairs = []; - - params && toFormData(params, this, options); -} - -const prototype = AxiosURLSearchParams.prototype; - -prototype.append = function append(name, value) { - this._pairs.push([name, value]); -}; - -prototype.toString = function toString(encoder) { - const _encode = encoder - ? (value) => encoder.call(this, value, encode$1) - : encode$1; - - return this._pairs - .map(function each(pair) { - return _encode(pair[0]) + '=' + _encode(pair[1]); - }, '') - .join('&'); -}; - -/** - * It replaces URL-encoded forms of `:`, `$`, `,`, and spaces with - * their plain counterparts (`:`, `$`, `,`, `+`). - * - * @param {string} val The value to be encoded. - * - * @returns {string} The encoded value. - */ -function encode(val) { - return encodeURIComponent(val) - .replace(/%3A/gi, ':') - .replace(/%24/g, '$') - .replace(/%2C/gi, ',') - .replace(/%20/g, '+'); -} - -/** - * Build a URL by appending params to the end - * - * @param {string} url The base of the url (e.g., http://www.google.com) - * @param {object} [params] The params to be appended - * @param {?(object|Function)} options - * - * @returns {string} The formatted url - */ -function buildURL(url, params, options) { - if (!params) { - return url; - } - url = url || ''; - - const _options = utils$1.isFunction(options) - ? { - serialize: options, - } - : options; - - // Read serializer options pollution-safely: own properties and methods on a - // class/template prototype are honored, but values injected onto a polluted - // Object.prototype are ignored. - const _encode = utils$1.getSafeProp(_options, 'encode') || encode; - const serializeFn = utils$1.getSafeProp(_options, 'serialize'); - - let serializedParams; - - if (serializeFn) { - serializedParams = serializeFn(params, _options); - } else { - serializedParams = utils$1.isURLSearchParams(params) - ? params.toString() - : new AxiosURLSearchParams(params, _options).toString(_encode); - } - - if (serializedParams) { - const hashmarkIndex = url.indexOf('#'); - - if (hashmarkIndex !== -1) { - url = url.slice(0, hashmarkIndex); - } - url += (url.indexOf('?') === -1 ? '?' : '&') + serializedParams; - } - - return url; -} - -class InterceptorManager { - constructor() { - this.handlers = []; - } - - /** - * Add a new interceptor to the stack - * - * @param {Function} fulfilled The function to handle `then` for a `Promise` - * @param {Function} rejected The function to handle `reject` for a `Promise` - * @param {Object} options The options for the interceptor, synchronous and runWhen - * - * @return {Number} An ID used to remove interceptor later - */ - use(fulfilled, rejected, options) { - this.handlers.push({ - fulfilled, - rejected, - synchronous: options ? options.synchronous : false, - runWhen: options ? options.runWhen : null, - }); - return this.handlers.length - 1; - } - - /** - * Remove an interceptor from the stack - * - * @param {Number} id The ID that was returned by `use` - * - * @returns {void} - */ - eject(id) { - if (this.handlers[id]) { - this.handlers[id] = null; - } - } - - /** - * Clear all interceptors from the stack - * - * @returns {void} - */ - clear() { - if (this.handlers) { - this.handlers = []; - } - } - - /** - * Iterate over all the registered interceptors - * - * This method is particularly useful for skipping over any - * interceptors that may have become `null` calling `eject`. - * - * @param {Function} fn The function to call for each interceptor - * - * @returns {void} - */ - forEach(fn) { - utils$1.forEach(this.handlers, function forEachHandler(h) { - if (h !== null) { - fn(h); - } - }); - } -} - -var transitionalDefaults = { - silentJSONParsing: true, - forcedJSONParsing: true, - clarifyTimeoutError: false, - legacyInterceptorReqResOrdering: true, - advertiseZstdAcceptEncoding: false, - validateStatusUndefinedResolves: true, -}; - -var URLSearchParams$1 = typeof URLSearchParams !== 'undefined' ? URLSearchParams : AxiosURLSearchParams; - -var FormData$1 = typeof FormData !== 'undefined' ? FormData : null; - -var Blob$1 = typeof Blob !== 'undefined' ? Blob : null; - -var platform$1 = { - isBrowser: true, - classes: { - URLSearchParams: URLSearchParams$1, - FormData: FormData$1, - Blob: Blob$1, - }, - protocols: ['http', 'https', 'file', 'blob', 'url', 'data'], -}; - -const hasBrowserEnv = typeof window !== 'undefined' && typeof document !== 'undefined'; - -const _navigator = (typeof navigator === 'object' && navigator) || undefined; - -/** - * Determine if we're running in a standard browser environment - * - * This allows axios to run in a web worker, and react-native. - * Both environments support XMLHttpRequest, but not fully standard globals. - * - * web workers: - * typeof window -> undefined - * typeof document -> undefined - * - * react-native: - * navigator.product -> 'ReactNative' - * nativescript - * navigator.product -> 'NativeScript' or 'NS' - * - * @returns {boolean} - */ -const hasStandardBrowserEnv = - hasBrowserEnv && - (!_navigator || ['ReactNative', 'NativeScript', 'NS'].indexOf(_navigator.product) < 0); - -/** - * Determine if we're running in a standard browser webWorker environment - * - * Although the `isStandardBrowserEnv` method indicates that - * `allows axios to run in a web worker`, the WebWorker will still be - * filtered out due to its judgment standard - * `typeof window !== 'undefined' && typeof document !== 'undefined'`. - * This leads to a problem when axios post `FormData` in webWorker - */ -const hasStandardBrowserWebWorkerEnv = (() => { - return ( - typeof WorkerGlobalScope !== 'undefined' && - // eslint-disable-next-line no-undef - self instanceof WorkerGlobalScope && - typeof self.importScripts === 'function' - ); -})(); - -const origin = (hasBrowserEnv && window.location.href) || 'http://localhost'; - -var utils = /*#__PURE__*/Object.freeze({ - __proto__: null, - hasBrowserEnv: hasBrowserEnv, - hasStandardBrowserEnv: hasStandardBrowserEnv, - hasStandardBrowserWebWorkerEnv: hasStandardBrowserWebWorkerEnv, - navigator: _navigator, - origin: origin -}); - -var platform = { - ...utils, - ...platform$1, -}; - -function toURLEncodedForm(data, options) { - return toFormData(data, new platform.classes.URLSearchParams(), { - visitor: function (value, key, path, helpers) { - if (platform.isNode && utils$1.isBuffer(value)) { - this.append(key, value.toString('base64')); - return false; - } - - return helpers.defaultVisitor.apply(this, arguments); - }, - ...options, - }); -} - -const MAX_DEPTH = DEFAULT_FORM_DATA_MAX_DEPTH; - -function throwIfDepthExceeded(index) { - if (index > MAX_DEPTH) { - throw new AxiosError( - 'FormData field is too deeply nested (' + index + ' levels). Max depth: ' + MAX_DEPTH, - AxiosError.ERR_FORM_DATA_DEPTH_EXCEEDED - ); - } -} - -/** - * It takes a string like `foo[x][y][z]` and returns an array like `['foo', 'x', 'y', 'z'] - * - * @param {string} name - The name of the property to get. - * - * @returns An array of strings. - */ -function parsePropPath(name) { - // foo[x][y][z] -> ['foo', 'x', 'y', 'z'] - // foo.x.y.z -> ['foo', 'x', 'y', 'z'] - // A path is split on `.` and on `[...]` groups. A segment — whether written - // in dot notation or captured inside brackets — may contain any character - // except `.`, `[` and `]`, so a key like `user-name` or `user name` is kept - // literal instead of being split (#5402). `.`, `[` and `]` keep their existing - // meaning, e.g. `foo[bar.baz]` -> ['foo', 'bar', 'baz'] and `[]` is an array push. - // Excluding `[` from the bracket group also makes the match fail fast at the - // next `[`, so a malformed name cannot rescan to the end of the string from - // every unmatched `[` — parsing stays linear in the length of the name. - const path = []; - const pattern = /[^.[\]]+|\[([^.[\]]*)]/g; - let match; - - while ((match = pattern.exec(name)) !== null) { - throwIfDepthExceeded(path.length); - path.push(match[0] === '[]' ? '' : match[1] || match[0]); - } - - return path; -} - -/** - * Convert an array to an object. - * - * @param {Array} arr - The array to convert to an object. - * - * @returns An object with the same keys and values as the array. - */ -function arrayToObject(arr) { - const obj = {}; - const keys = Object.keys(arr); - let i; - const len = keys.length; - let key; - for (i = 0; i < len; i++) { - key = keys[i]; - obj[key] = arr[key]; - } - return obj; -} - -/** - * It takes a FormData object and returns a JavaScript object - * - * @param {string} formData The FormData object to convert to JSON. - * - * @returns {Object | null} The converted object. - */ -function formDataToJSON(formData) { - function buildPath(path, value, target, index) { - throwIfDepthExceeded(index); - - let name = path[index++]; - - if (name === '__proto__') return true; - - const isNumericKey = Number.isFinite(+name); - const isLast = index >= path.length; - name = !name && utils$1.isArray(target) ? target.length : name; - - if (isLast) { - if (utils$1.hasOwnProp(target, name)) { - target[name] = utils$1.isArray(target[name]) - ? target[name].concat(value) - : [target[name], value]; - } else { - target[name] = value; - } - - return !isNumericKey; - } - - if (!utils$1.hasOwnProp(target, name) || !utils$1.isObject(target[name])) { - target[name] = []; - } - - const result = buildPath(path, value, target[name], index); - - if (result && utils$1.isArray(target[name])) { - target[name] = arrayToObject(target[name]); - } - - return !isNumericKey; - } - - if (utils$1.isFormData(formData) && utils$1.isFunction(formData.entries)) { - const obj = {}; - - utils$1.forEachEntry(formData, (name, value) => { - buildPath(parsePropPath(name), value, obj, 0); - }); - - return obj; - } - - return null; -} - -const own = (obj, key) => (obj != null && utils$1.hasOwnProp(obj, key) ? obj[key] : undefined); - -/** - * It takes a string, tries to parse it, and if it fails, it returns the stringified version - * of the input - * - * @param {any} rawValue - The value to be stringified. - * @param {Function} parser - A function that parses a string into a JavaScript object. - * @param {Function} encoder - A function that takes a value and returns a string. - * - * @returns {string} A stringified version of the rawValue. - */ -function stringifySafely(rawValue, parser, encoder) { - if (utils$1.isString(rawValue)) { - try { - (parser || JSON.parse)(rawValue); - return utils$1.trim(rawValue); - } catch (e) { - if (e.name !== 'SyntaxError') { - throw e; - } - } - } - - return (encoder || JSON.stringify)(rawValue); -} - -const defaults = { - transitional: transitionalDefaults, - - adapter: ['xhr', 'http', 'fetch'], - - transformRequest: [ - function transformRequest(data, headers) { - const contentType = headers.getContentType() || ''; - const hasJSONContentType = contentType.indexOf('application/json') > -1; - const isObjectPayload = utils$1.isObject(data); - - if (isObjectPayload && utils$1.isHTMLForm(data)) { - data = new FormData(data); - } - - const isFormData = utils$1.isFormData(data); - - if (isFormData) { - return hasJSONContentType ? JSON.stringify(formDataToJSON(data)) : data; - } - - if ( - utils$1.isArrayBuffer(data) || - utils$1.isBuffer(data) || - utils$1.isStream(data) || - utils$1.isFile(data) || - utils$1.isBlob(data) || - utils$1.isReadableStream(data) - ) { - return data; - } - if (utils$1.isArrayBufferView(data)) { - return data.buffer; - } - if (utils$1.isURLSearchParams(data)) { - headers.setContentType('application/x-www-form-urlencoded;charset=utf-8', false); - return data.toString(); - } - - let isFileList; - - if (isObjectPayload) { - const formSerializer = own(this, 'formSerializer'); - if (contentType.indexOf('application/x-www-form-urlencoded') > -1) { - return toURLEncodedForm(data, formSerializer).toString(); - } - - if ( - (isFileList = utils$1.isFileList(data)) || - contentType.indexOf('multipart/form-data') > -1 - ) { - const env = own(this, 'env'); - const _FormData = env && env.FormData; - - return toFormData( - isFileList ? { 'files[]': data } : data, - _FormData && new _FormData(), - formSerializer - ); - } - } - - if (isObjectPayload || hasJSONContentType) { - headers.setContentType('application/json', false); - return stringifySafely(data); - } - - return data; - }, - ], - - transformResponse: [ - function transformResponse(data) { - const transitional = own(this, 'transitional') || defaults.transitional; - const forcedJSONParsing = transitional && transitional.forcedJSONParsing; - const responseType = own(this, 'responseType'); - const JSONRequested = responseType === 'json'; - - if (utils$1.isResponse(data) || utils$1.isReadableStream(data)) { - return data; - } - - if ( - data && - utils$1.isString(data) && - ((forcedJSONParsing && !responseType) || JSONRequested) - ) { - const silentJSONParsing = transitional && transitional.silentJSONParsing; - const strictJSONParsing = !silentJSONParsing && JSONRequested; - - try { - return JSON.parse(data, own(this, 'parseReviver')); - } catch (e) { - if (strictJSONParsing) { - if (e.name === 'SyntaxError') { - throw AxiosError.from(e, AxiosError.ERR_BAD_RESPONSE, this, null, own(this, 'response')); - } - throw e; - } - } - } - - return data; - }, - ], - - /** - * A timeout in milliseconds to abort a request. If set to 0 (default) a - * timeout is not created. - */ - timeout: 0, - - xsrfCookieName: 'XSRF-TOKEN', - xsrfHeaderName: 'X-XSRF-TOKEN', - - maxContentLength: -1, - maxBodyLength: -1, - - env: { - FormData: platform.classes.FormData, - Blob: platform.classes.Blob, - }, - - validateStatus: function validateStatus(status) { - return status >= 200 && status < 300; - }, - - headers: { - common: { - Accept: 'application/json, text/plain, */*', - 'Content-Type': undefined, - }, - }, -}; - -utils$1.forEach(['delete', 'get', 'head', 'post', 'put', 'patch', 'query'], (method) => { - defaults.headers[method] = {}; -}); - -/** - * Transform the data for a request or a response - * - * @param {Array|Function} fns A single function or Array of functions - * @param {?Object} response The response object - * - * @returns {*} The resulting transformed data - */ -function transformData(fns, response) { - const config = this || defaults; - const context = response || config; - const headers = AxiosHeaders.from(context.headers); - let data = context.data; - - utils$1.forEach(fns, function transform(fn) { - data = fn.call(config, data, headers.normalize(), response ? response.status : undefined); - }); - - headers.normalize(); - - return data; -} - -function isCancel(value) { - return !!(value && value.__CANCEL__); -} - -class CanceledError extends AxiosError { - /** - * A `CanceledError` is an object that is thrown when an operation is canceled. - * - * @param {string=} message The message. - * @param {Object=} config The config. - * @param {Object=} request The request. - * - * @returns {CanceledError} The created error. - */ - constructor(message, config, request) { - super(message == null ? 'canceled' : message, AxiosError.ERR_CANCELED, config, request); - this.name = 'CanceledError'; - this.__CANCEL__ = true; - } -} - -/** - * Resolve or reject a Promise based on response status. - * - * @param {Function} resolve A function that resolves the promise. - * @param {Function} reject A function that rejects the promise. - * @param {object} response The response. - * - * @returns {object} The response. - */ -function settle(resolve, reject, response) { - const validateStatus = response.config.validateStatus; - if (!response.status || !validateStatus || validateStatus(response.status)) { - resolve(response); - } else { - reject(new AxiosError( - 'Request failed with status code ' + response.status, - response.status >= 400 && response.status < 500 ? AxiosError.ERR_BAD_REQUEST : AxiosError.ERR_BAD_RESPONSE, - response.config, - response.request, - response - )); - } -} - -function parseProtocol(url) { - const match = /^([-+\w]{1,25}):(?:\/\/)?/.exec(url); - return (match && match[1]) || ''; -} - -/** - * Calculate data maxRate - * @param {Number} [samplesCount= 10] - * @param {Number} [min= 1000] - * @returns {Function} - */ -function speedometer(samplesCount, min) { - samplesCount = samplesCount || 10; - const bytes = new Array(samplesCount); - const timestamps = new Array(samplesCount); - let head = 0; - let tail = 0; - let firstSampleTS; - - min = min !== undefined ? min : 1000; - - return function push(chunkLength) { - const now = Date.now(); - - const startedAt = timestamps[tail]; - - if (!firstSampleTS) { - firstSampleTS = now; - } - - bytes[head] = chunkLength; - timestamps[head] = now; - - let i = tail; - let bytesCount = 0; - - while (i !== head) { - bytesCount += bytes[i++]; - i = i % samplesCount; - } - - head = (head + 1) % samplesCount; - - if (head === tail) { - tail = (tail + 1) % samplesCount; - } - - if (now - firstSampleTS < min) { - return; - } - - const passed = startedAt && now - startedAt; - - return passed ? Math.round((bytesCount * 1000) / passed) : undefined; - }; -} - -/** - * Throttle decorator - * @param {Function} fn - * @param {Number} freq - * @return {Function} - */ -function throttle(fn, freq) { - let timestamp = 0; - let threshold = 1000 / freq; - let lastArgs; - let timer; - - const invoke = (args, now = Date.now()) => { - timestamp = now; - lastArgs = null; - if (timer) { - clearTimeout(timer); - timer = null; - } - fn(...args); - }; - - const throttled = (...args) => { - const now = Date.now(); - const passed = now - timestamp; - if (passed >= threshold) { - invoke(args, now); - } else { - lastArgs = args; - if (!timer) { - timer = setTimeout(() => { - timer = null; - invoke(lastArgs); - }, threshold - passed); - } - } - }; - - const flush = () => lastArgs && invoke(lastArgs); - - return [throttled, flush]; -} - -const progressEventReducer = (listener, isDownloadStream, freq = 3) => { - let bytesNotified = 0; - const _speedometer = speedometer(50, 250); - - return throttle((e) => { - if (!e || typeof e.loaded !== 'number') { - return; - } - const rawLoaded = e.loaded; - const total = e.lengthComputable ? e.total : undefined; - const loaded = Math.max(0, total != null ? Math.min(rawLoaded, total) : rawLoaded); - const progressBytes = Math.max(0, loaded - bytesNotified); - const rate = _speedometer(progressBytes); - - bytesNotified = Math.max(bytesNotified, loaded); - - const data = { - loaded, - total, - progress: total ? loaded / total : undefined, - bytes: progressBytes, - rate: rate ? rate : undefined, - estimated: rate && total ? (total - loaded) / rate : undefined, - event: e, - lengthComputable: total != null, - [isDownloadStream ? 'download' : 'upload']: true, - }; - - listener(data); - }, freq); -}; - -const progressEventDecorator = (total, throttled) => { - const lengthComputable = total != null; - - return [ - (loaded) => - throttled[0]({ - lengthComputable, - total, - loaded, - }), - throttled[1], - ]; -}; - -const asyncDecorator = - (fn, scheduler = utils$1.asap) => - (...args) => - scheduler(() => fn(...args)); - -var isURLSameOrigin = platform.hasStandardBrowserEnv - ? ((origin, isMSIE) => (url) => { - url = new URL(url, platform.origin); - - return ( - origin.protocol === url.protocol && - origin.host === url.host && - (isMSIE || origin.port === url.port) - ); - })( - new URL(platform.origin), - platform.navigator && /(msie|trident)/i.test(platform.navigator.userAgent) - ) - : () => true; - -var cookies = platform.hasStandardBrowserEnv - ? // Standard browser envs support document.cookie - { - write(name, value, expires, path, domain, secure, sameSite) { - if (typeof document === 'undefined') return; - - const cookie = [`${name}=${encodeURIComponent(value)}`]; - - if (utils$1.isNumber(expires)) { - cookie.push(`expires=${new Date(expires).toUTCString()}`); - } - if (utils$1.isString(path)) { - cookie.push(`path=${path}`); - } - if (utils$1.isString(domain)) { - cookie.push(`domain=${domain}`); - } - if (secure === true) { - cookie.push('secure'); - } - if (utils$1.isString(sameSite)) { - cookie.push(`SameSite=${sameSite}`); - } - - document.cookie = cookie.join('; '); - }, - - read(name) { - if (typeof document === 'undefined') return null; - // Match name=value by splitting on the semicolon separator instead of building a - // RegExp from `name` — interpolating an unescaped string into a RegExp would let - // metacharacters (e.g. `.+?` in an attacker-influenced cookie name) cause ReDoS or - // match the wrong cookie. Browsers may serialize cookie pairs as either ";" or - // "; ", so ignore optional whitespace before each cookie name. - const cookies = document.cookie.split(';'); - for (let i = 0; i < cookies.length; i++) { - const cookie = cookies[i].replace(/^\s+/, ''); - const eq = cookie.indexOf('='); - if (eq !== -1 && cookie.slice(0, eq) === name) { - try { - return decodeURIComponent(cookie.slice(eq + 1)); - } catch (e) { - return cookie.slice(eq + 1); - } - } - } - return null; - }, - - remove(name) { - this.write(name, '', Date.now() - 86400000, '/'); - }, - } - : // Non-standard browser env (web workers, react-native) lack needed support. - { - write() {}, - read() { - return null; - }, - remove() {}, - }; - -/** - * Determines whether the specified URL is absolute - * - * @param {string} url The URL to test - * - * @returns {boolean} True if the specified URL is absolute, otherwise false - */ -function isAbsoluteURL(url) { - // A URL is considered absolute if it begins with "://" or "//" (protocol-relative URL). - // RFC 3986 defines scheme name as a sequence of characters beginning with a letter and followed - // by any combination of letters, digits, plus, period, or hyphen. - if (typeof url !== 'string') { - return false; - } - - return /^([a-z][a-z\d+\-.]*:)?\/\//i.test(url); -} - -/** - * Creates a new URL by combining the specified URLs - * - * @param {string} baseURL The base URL - * @param {string} relativeURL The relative URL - * - * @returns {string} The combined URL - */ -function combineURLs(baseURL, relativeURL) { - if (!relativeURL) { - return baseURL; - } - - let end = baseURL.length; - - while (end > 0 && baseURL.charCodeAt(end - 1) === 47) { - end--; - } - - return baseURL.slice(0, end) + '/' + relativeURL.replace(/^\/+/, ''); -} - -const malformedHttpProtocol = /^https?:(?!\/\/)/i; -const httpProtocolControlCharacters = /[\t\n\r]/g; - -function stripLeadingC0ControlOrSpace(url) { - let i = 0; - while (i < url.length && url.charCodeAt(i) <= 0x20) { - i++; - } - return url.slice(i); -} - -function normalizeURLForProtocolCheck(url) { - return stripLeadingC0ControlOrSpace(url).replace(httpProtocolControlCharacters, ''); -} - -// Redact the parts of a URL that can carry secrets before it is embedded in an -// error message. AxiosError.toJSON() serializes `message` verbatim and errors -// are commonly logged, while the opt-in `config.redact` model only cleans -// config keys — it cannot reach the message. Redact only the genuinely -// sensitive substrings — userinfo (credentials), query parameter values and -// fragment contents — with the same REDACTED marker the config redaction uses, -// while keeping the scheme, host, path and parameter names so the offending -// request stays accurately identifiable. -function redactFragment(fragment) { - if (!fragment) { - return fragment; - } - - return fragment.replace(/(^|&)([^=&]*=)?[^&]+/g, (match, separator, parameterName = '') => { - return `${separator}${parameterName}${REDACTED}`; - }); -} - -function redactSensitiveURLParts(url) { - const redactedURL = url.replace(/^(https?:\/{0,2})[^/?#]*@/i, `$1${REDACTED}@`); - const fragmentIndex = redactedURL.indexOf('#'); - const urlWithoutFragment = - fragmentIndex === -1 ? redactedURL : redactedURL.slice(0, fragmentIndex); - const redactedURLWithoutFragment = urlWithoutFragment.replace( - /([?&][^=&#]*=)[^&#]*/g, - `$1${REDACTED}` - ); - - if (fragmentIndex === -1) { - return redactedURLWithoutFragment; - } - - return `${redactedURLWithoutFragment}#${redactFragment(redactedURL.slice(fragmentIndex + 1))}`; -} - -function assertValidHttpProtocolURL(url, config) { - if (typeof url === 'string') { - const normalizedURL = normalizeURLForProtocolCheck(url); - if (malformedHttpProtocol.test(normalizedURL)) { - throw new AxiosError( - `Invalid URL ${JSON.stringify(redactSensitiveURLParts(normalizedURL))}: missing "//" after protocol`, - AxiosError.ERR_INVALID_URL, - config - ); - } - } -} - -/** - * Creates a new URL by combining the baseURL with the requestedURL, - * only when the requestedURL is not already an absolute URL. - * If the requestURL is absolute, this function returns the requestedURL untouched. - * - * @param {string} baseURL The base URL - * @param {string} requestedURL Absolute or relative URL to combine - * - * @returns {string} The combined full path - */ -function buildFullPath(baseURL, requestedURL, allowAbsoluteUrls, config) { - assertValidHttpProtocolURL(requestedURL, config); - let isRelativeUrl = !isAbsoluteURL(requestedURL); - if (baseURL && (isRelativeUrl || allowAbsoluteUrls === false)) { - assertValidHttpProtocolURL(baseURL, config); - return combineURLs(baseURL, requestedURL); - } - return requestedURL; -} - -const headersToObject = (thing) => (thing instanceof AxiosHeaders ? { ...thing } : thing); - -const ownEnumerableKeys = (thing) => { - if (Object.getOwnPropertySymbols && Object.getOwnPropertyDescriptor) { - return Object.keys(thing).concat( - Object.getOwnPropertySymbols(thing).filter( - (symbol) => Object.getOwnPropertyDescriptor(thing, symbol).enumerable - ) - ); - } - return Object.keys(thing); -}; - -/** - * Config-specific merge-function which creates a new config-object - * by merging two configuration objects together. - * - * @param {Object} config1 - * @param {Object} config2 - * - * @returns {Object} New object resulting from merging config2 to config1 - */ -function mergeConfig(config1, config2) { - // eslint-disable-next-line no-param-reassign - config1 = config1 || {}; - config2 = config2 || {}; - - // Use a null-prototype object so that downstream reads such as `config.auth` - // or `config.baseURL` cannot inherit polluted values from Object.prototype. - // `hasOwnProperty` is restored as a non-enumerable own slot to preserve - // ergonomics for user code that relies on it. - const config = Object.create(null); - Object.defineProperty(config, 'hasOwnProperty', { - // Null-proto descriptor so a polluted Object.prototype.get cannot turn - // this data descriptor into an accessor descriptor on the way in. - __proto__: null, - value: Object.prototype.hasOwnProperty, - enumerable: false, - writable: true, - configurable: true, - }); - - function getMergedValue(target, source, prop, caseless) { - if (utils$1.isPlainObject(target) && utils$1.isPlainObject(source)) { - return utils$1.merge.call({ caseless }, target, source); - } else if (utils$1.isPlainObject(source)) { - return utils$1.merge({}, source); - } else if (utils$1.isArray(source)) { - return source.slice(); - } - return source; - } - - function mergeDeepProperties(a, b, prop, caseless) { - if (!utils$1.isUndefined(b)) { - return getMergedValue(a, b, prop, caseless); - } else if (!utils$1.isUndefined(a)) { - return getMergedValue(undefined, a, prop, caseless); - } - } - - // eslint-disable-next-line consistent-return - function valueFromConfig2(a, b) { - if (!utils$1.isUndefined(b)) { - return getMergedValue(undefined, b); - } - } - - // eslint-disable-next-line consistent-return - function defaultToConfig2(a, b) { - if (!utils$1.isUndefined(b)) { - return getMergedValue(undefined, b); - } else if (!utils$1.isUndefined(a)) { - return getMergedValue(undefined, a); - } - } - - function getMergedTransitionalOption(prop) { - const transitional2 = utils$1.hasOwnProp(config2, 'transitional') - ? config2.transitional - : undefined; - - if (!utils$1.isUndefined(transitional2)) { - if (utils$1.isPlainObject(transitional2)) { - if (utils$1.hasOwnProp(transitional2, prop)) { - return transitional2[prop]; - } - } else { - return undefined; - } - } - - const transitional1 = utils$1.hasOwnProp(config1, 'transitional') - ? config1.transitional - : undefined; - - if (utils$1.isPlainObject(transitional1) && utils$1.hasOwnProp(transitional1, prop)) { - return transitional1[prop]; - } - - return undefined; - } - - // eslint-disable-next-line consistent-return - function mergeDirectKeys(a, b, prop) { - if (utils$1.hasOwnProp(config2, prop)) { - return getMergedValue(a, b); - } else if (utils$1.hasOwnProp(config1, prop)) { - return getMergedValue(undefined, a); - } - } - - const mergeMap = { - url: valueFromConfig2, - method: valueFromConfig2, - data: valueFromConfig2, - baseURL: defaultToConfig2, - transformRequest: defaultToConfig2, - transformResponse: defaultToConfig2, - paramsSerializer: defaultToConfig2, - timeout: defaultToConfig2, - timeoutMessage: defaultToConfig2, - withCredentials: defaultToConfig2, - withXSRFToken: defaultToConfig2, - adapter: defaultToConfig2, - responseType: defaultToConfig2, - xsrfCookieName: defaultToConfig2, - xsrfHeaderName: defaultToConfig2, - onUploadProgress: defaultToConfig2, - onDownloadProgress: defaultToConfig2, - decompress: defaultToConfig2, - maxContentLength: defaultToConfig2, - maxBodyLength: defaultToConfig2, - beforeRedirect: defaultToConfig2, - transport: defaultToConfig2, - httpAgent: defaultToConfig2, - httpsAgent: defaultToConfig2, - cancelToken: defaultToConfig2, - socketPath: defaultToConfig2, - allowedSocketPaths: defaultToConfig2, - responseEncoding: defaultToConfig2, - validateStatus: mergeDirectKeys, - headers: (a, b, prop) => - mergeDeepProperties(headersToObject(a), headersToObject(b), prop, true), - }; - - utils$1.forEach(ownEnumerableKeys({ ...config1, ...config2 }), function computeConfigValue(prop) { - if (prop === '__proto__' || prop === 'constructor' || prop === 'prototype') return; - const merge = utils$1.hasOwnProp(mergeMap, prop) ? mergeMap[prop] : mergeDeepProperties; - const a = utils$1.hasOwnProp(config1, prop) ? config1[prop] : undefined; - const b = utils$1.hasOwnProp(config2, prop) ? config2[prop] : undefined; - const configValue = merge(a, b, prop); - (utils$1.isUndefined(configValue) && merge !== mergeDirectKeys) || (config[prop] = configValue); - }); - - if ( - utils$1.hasOwnProp(config2, 'validateStatus') && - utils$1.isUndefined(config2.validateStatus) && - getMergedTransitionalOption('validateStatusUndefinedResolves') === false - ) { - if (utils$1.hasOwnProp(config1, 'validateStatus')) { - config.validateStatus = getMergedValue(undefined, config1.validateStatus); - } else { - delete config.validateStatus; - } - } - - return config; -} - -const FORM_DATA_CONTENT_HEADERS = ['content-type', 'content-length']; - -/** - * Apply the headers generated by a FormData implementation to the request headers, - * honoring the `formDataHeaderPolicy` option: with 'content-only', copy only the - * content-* headers; otherwise merge all of them. - * - * @param {AxiosHeaders} headers - the request headers to mutate - * @param {Object | null | undefined} formHeaders - headers produced by the FormData implementation - * @param {String} [policy] - the resolved `formDataHeaderPolicy` config value - * - * @returns {void} - */ -function setFormDataHeaders(headers, formHeaders, policy) { - if (policy !== 'content-only') { - headers.set(formHeaders); - return; - } - - Object.entries(formHeaders || {}).forEach(([key, val]) => { - if (FORM_DATA_CONTENT_HEADERS.includes(key.toLowerCase())) { - headers.set(key, val); - } - }); -} - -/** - * Encode a UTF-8 string to a Latin-1 byte string for use with btoa(). - * This is a modern replacement for the deprecated unescape(encodeURIComponent(str)) pattern. - * - * @param {string} str The string to encode - * - * @returns {string} UTF-8 bytes as a Latin-1 string - */ -const encodeUTF8$1 = (str) => - encodeURIComponent(str).replace(/%([0-9A-F]{2})/gi, (_, hex) => - String.fromCharCode(parseInt(hex, 16)) - ); - -function resolveConfig(config) { - const newConfig = mergeConfig({}, config); - - // Read only own properties to prevent prototype pollution gadgets - // (e.g. Object.prototype.baseURL = 'https://evil.com'). - const own = (key) => (utils$1.hasOwnProp(newConfig, key) ? newConfig[key] : undefined); - - const data = own('data'); - let withXSRFToken = own('withXSRFToken'); - const xsrfHeaderName = own('xsrfHeaderName'); - const xsrfCookieName = own('xsrfCookieName'); - let headers = own('headers'); - const auth = own('auth'); - const baseURL = own('baseURL'); - const allowAbsoluteUrls = own('allowAbsoluteUrls'); - const url = own('url'); - - newConfig.headers = headers = AxiosHeaders.from(headers); - - newConfig.url = buildURL( - buildFullPath(baseURL, url, allowAbsoluteUrls, newConfig), - own('params'), - own('paramsSerializer') - ); - - // HTTP basic authentication - if (auth) { - const username = utils$1.getSafeProp(auth, 'username') || ''; - const password = utils$1.getSafeProp(auth, 'password') || ''; - - try { - headers.set( - 'Authorization', - 'Basic ' + btoa(username + ':' + (password ? encodeUTF8$1(password) : '')) - ); - } catch (e) { - throw AxiosError.from(e, AxiosError.ERR_BAD_OPTION_VALUE, config); - } - } - - if (utils$1.isFormData(data)) { - if ( - platform.hasStandardBrowserEnv || - platform.hasStandardBrowserWebWorkerEnv || - utils$1.isReactNative(data) - ) { - headers.setContentType(undefined); // browser/web worker/RN handles it - } else if (utils$1.isFunction(data.getHeaders)) { - // Node.js FormData (like form-data package) - setFormDataHeaders(headers, data.getHeaders(), own('formDataHeaderPolicy')); - } - } - - // Add xsrf header - // This is only done if running in a standard browser environment. - // Specifically not if we're in a web worker, or react-native. - - if (platform.hasStandardBrowserEnv) { - if (utils$1.isFunction(withXSRFToken)) { - withXSRFToken = withXSRFToken(newConfig); - } - - // Strict boolean check — prevents proto-pollution gadgets (e.g. Object.prototype.withXSRFToken = 1) - // and misconfigurations (e.g. "false") from short-circuiting the same-origin check and leaking - // the XSRF token cross-origin. - const shouldSendXSRF = - withXSRFToken === true || (withXSRFToken == null && isURLSameOrigin(newConfig.url)); - - if (shouldSendXSRF) { - const xsrfValue = xsrfHeaderName && xsrfCookieName && cookies.read(xsrfCookieName); - - if (xsrfValue) { - headers.set(xsrfHeaderName, xsrfValue); - } - } - } - - return newConfig; -} - -const isXHRAdapterSupported = typeof XMLHttpRequest !== 'undefined'; - -var xhrAdapter = isXHRAdapterSupported && - function (config) { - return new Promise(function dispatchXhrRequest(resolve, reject) { - const _config = resolveConfig(config); - let requestData = _config.data; - const requestHeaders = AxiosHeaders.from(_config.headers).normalize(); - let { responseType, onUploadProgress, onDownloadProgress } = _config; - let onCanceled; - let uploadThrottled, downloadThrottled; - let flushUpload, flushDownload; - - function done() { - flushUpload && flushUpload(); // flush events - flushDownload && flushDownload(); // flush events - - _config.cancelToken && _config.cancelToken.unsubscribe(onCanceled); - - _config.signal && _config.signal.removeEventListener('abort', onCanceled); - } - - let request = new XMLHttpRequest(); - - request.open(_config.method.toUpperCase(), _config.url, true); - - // Set the request timeout in MS - request.timeout = _config.timeout; - - function onloadend() { - if (!request) { - return; - } - // Prepare the response - const responseHeaders = AxiosHeaders.from( - 'getAllResponseHeaders' in request && request.getAllResponseHeaders() - ); - const responseData = - !responseType || responseType === 'text' || responseType === 'json' - ? request.responseText - : request.response; - const response = { - data: responseData, - status: request.status, - statusText: request.statusText, - headers: responseHeaders, - config, - request, - }; - - settle( - function _resolve(value) { - resolve(value); - done(); - }, - function _reject(err) { - reject(err); - done(); - }, - response - ); - - // Clean up request - request = null; - } - - if ('onloadend' in request) { - // Use onloadend if available - request.onloadend = onloadend; - } else { - // Listen for ready state to emulate onloadend - request.onreadystatechange = function handleLoad() { - if (!request || request.readyState !== 4) { - return; - } - - // The request errored out and we didn't get a response, this will be - // handled by onerror instead - // With one exception: request that using file: protocol, most browsers - // will return status as 0 even though it's a successful request - if ( - request.status === 0 && - !(request.responseURL && request.responseURL.startsWith('file:')) - ) { - return; - } - // readystate handler is calling before onerror or ontimeout handlers, - // so we should call onloadend on the next 'tick' - setTimeout(onloadend); - }; - } - - // Handle browser request cancellation (as opposed to a manual cancellation) - request.onabort = function handleAbort() { - if (!request) { - return; - } - - reject(new AxiosError('Request aborted', AxiosError.ECONNABORTED, config, request)); - done(); - - // Clean up request - request = null; - }; - - // Handle low level network errors - request.onerror = function handleError(event) { - // Browsers deliver a ProgressEvent in XHR onerror - // (message may be empty; when present, surface it) - // See https://developer.mozilla.org/docs/Web/API/XMLHttpRequest/error_event - const msg = event && event.message ? event.message : 'Network Error'; - const err = new AxiosError(msg, AxiosError.ERR_NETWORK, config, request); - // attach the underlying event for consumers who want details - err.event = event || null; - reject(err); - done(); - request = null; - }; - - // Handle timeout - request.ontimeout = function handleTimeout() { - let timeoutErrorMessage = _config.timeout - ? 'timeout of ' + _config.timeout + 'ms exceeded' - : 'timeout exceeded'; - const transitional = _config.transitional || transitionalDefaults; - if (_config.timeoutErrorMessage) { - timeoutErrorMessage = _config.timeoutErrorMessage; - } - reject( - new AxiosError( - timeoutErrorMessage, - transitional.clarifyTimeoutError ? AxiosError.ETIMEDOUT : AxiosError.ECONNABORTED, - config, - request - ) - ); - done(); - - // Clean up request - request = null; - }; - - // Remove Content-Type if data is undefined - requestData === undefined && requestHeaders.setContentType(null); - - // Add headers to the request - if ('setRequestHeader' in request) { - utils$1.forEach(toByteStringHeaderObject(requestHeaders), function setRequestHeader(val, key) { - request.setRequestHeader(key, val); - }); - } - - // Add withCredentials to request if needed - if (!utils$1.isUndefined(_config.withCredentials)) { - request.withCredentials = !!_config.withCredentials; - } - - // Add responseType to request if needed - if (responseType && responseType !== 'json') { - request.responseType = _config.responseType; - } - - // Handle progress if needed - if (onDownloadProgress) { - [downloadThrottled, flushDownload] = progressEventReducer(onDownloadProgress, true); - request.addEventListener('progress', downloadThrottled); - } - - // Not all browsers support upload events - if (onUploadProgress && request.upload) { - [uploadThrottled, flushUpload] = progressEventReducer(onUploadProgress); - - request.upload.addEventListener('progress', uploadThrottled); - - request.upload.addEventListener('loadend', flushUpload); - } - - if (_config.cancelToken || _config.signal) { - // Handle cancellation - // eslint-disable-next-line func-names - onCanceled = (cancel) => { - if (!request) { - return; - } - reject(!cancel || cancel.type ? new CanceledError(null, config, request) : cancel); - request.abort(); - done(); - request = null; - }; - - _config.cancelToken && _config.cancelToken.subscribe(onCanceled); - if (_config.signal) { - _config.signal.aborted - ? onCanceled() - : _config.signal.addEventListener('abort', onCanceled); - } - } - - const protocol = parseProtocol(_config.url); - - if (protocol && !platform.protocols.includes(protocol)) { - reject( - new AxiosError( - 'Unsupported protocol ' + protocol + ':', - AxiosError.ERR_BAD_REQUEST, - config - ) - ); - done(); - return; - } - - // Send the request - request.send(requestData || null); - }); - }; - -const composeSignals = (signals, timeout) => { - signals = signals ? signals.filter(Boolean) : []; - - if (!timeout && !signals.length) { - return; - } - - const controller = new AbortController(); - - let aborted = false; - - const onabort = function (reason) { - if (!aborted) { - aborted = true; - unsubscribe(); - const err = reason instanceof Error ? reason : this.reason; - controller.abort( - err instanceof AxiosError - ? err - : new CanceledError(err instanceof Error ? err.message : err) - ); - } - }; - - let timer = - timeout && - setTimeout(() => { - timer = null; - onabort(new AxiosError(`timeout of ${timeout}ms exceeded`, AxiosError.ETIMEDOUT)); - }, timeout); - - const unsubscribe = () => { - if (!signals) { return; } - timer && clearTimeout(timer); - timer = null; - signals.forEach((signal) => { - signal.unsubscribe - ? signal.unsubscribe(onabort) - : signal.removeEventListener('abort', onabort); - }); - signals = null; - }; - - signals.forEach((signal) => { - if (aborted) { - return; - } - - if (signal.aborted) { - onabort.call(signal); - return; - } - - signal.addEventListener('abort', onabort, { once: true }); - }); - - const { signal } = controller; - - signal.unsubscribe = () => utils$1.asap(unsubscribe); - - return signal; -}; - -const streamChunk = function* (chunk, chunkSize) { - let len = chunk.byteLength; - - if (len < chunkSize) { - yield chunk; - return; - } - - let pos = 0; - let end; - - while (pos < len) { - end = pos + chunkSize; - yield chunk.slice(pos, end); - pos = end; - } -}; - -const readBytes = async function* (iterable, chunkSize) { - for await (const chunk of readStream(iterable)) { - yield* streamChunk(chunk, chunkSize); - } -}; - -const readStream = async function* (stream) { - if (stream[Symbol.asyncIterator]) { - yield* stream; - return; - } - - const reader = stream.getReader(); - try { - for (;;) { - const { done, value } = await reader.read(); - if (done) { - break; - } - yield value; - } - } finally { - await reader.cancel(); - } -}; - -const trackStream = (stream, chunkSize, onProgress, onFinish) => { - const iterator = readBytes(stream, chunkSize); - - let bytes = 0; - let done; - let _onFinish = (e) => { - if (!done) { - done = true; - onFinish && onFinish(e); - } - }; - - return new ReadableStream( - { - async pull(controller) { - try { - const { done, value } = await iterator.next(); - - if (done) { - _onFinish(); - controller.close(); - return; - } - - let len = value.byteLength; - if (onProgress) { - let loadedBytes = (bytes += len); - onProgress(loadedBytes); - } - controller.enqueue(new Uint8Array(value)); - } catch (err) { - _onFinish(err); - throw err; - } - }, - cancel(reason) { - _onFinish(reason); - return iterator.return(); - }, - }, - { - highWaterMark: 2, - } - ); -}; - -/** - * Estimate data: URL byte lengths *without* allocating large buffers. - * - Fetch percent-decodes a base64 body before decoding it. - * - Node's Buffer.from(body, 'base64') sizes its backing allocation from the - * raw body, including ignored characters and content after padding. - * - Non-base64 data is percent-decoded and then encoded as UTF-8. - */ -const isHexDigit = (charCode) => - (charCode >= 48 && charCode <= 57) || - (charCode >= 65 && charCode <= 70) || - (charCode >= 97 && charCode <= 102); - -const isPercentEncodedByte = (str, i, len) => - i + 2 < len && isHexDigit(str.charCodeAt(i + 1)) && isHexDigit(str.charCodeAt(i + 2)); - -const hexValue = (charCode) => (charCode <= 57 ? charCode - 48 : (charCode & 0xdf) - 55); - -const isBase64Char = (charCode) => - (charCode >= 65 && charCode <= 90) || // A-Z - (charCode >= 97 && charCode <= 122) || // a-z - (charCode >= 48 && charCode <= 57) || // 0-9 - charCode === 43 || // + - charCode === 47 || // / - charCode === 45 || // - (base64url) - charCode === 95; // _ (base64url) - -const isBase64Whitespace = (charCode) => - charCode === 9 || charCode === 10 || charCode === 12 || charCode === 13 || charCode === 32; - -const base64Bytes = (significant) => { - const groups = Math.floor(significant / 4); - const remainder = significant % 4; - return groups * 3 + (remainder === 2 ? 1 : remainder === 3 ? 2 : 0); -}; - -// Buffer.byteLength(body, 'base64') uses the raw string length as an allocation -// upper bound even when Buffer.from later ignores characters or stops at '='. -const estimateBase64BufferAllocation = (body) => { - const len = body.length; - let padding = 0; - - if (len > 0 && body.charCodeAt(len - 1) === 61 /* '=' */) { - padding++; - - if (len > 1 && body.charCodeAt(len - 2) === 61 /* '=' */) { - padding++; - } - } - - return Math.floor(((len - padding) * 3) / 4); -}; - -const estimatePercentDecodedBase64Bytes = (body) => { - const len = body.length; - let significant = 0; - let padding = 0; - let invalid = false; - - for (let i = 0; i < len; i++) { - let code = body.charCodeAt(i); - - if (code === 37 /* '%' */ && isPercentEncodedByte(body, i, len)) { - code = hexValue(body.charCodeAt(i + 1)) * 16 + hexValue(body.charCodeAt(i + 2)); - i += 2; - } - - if (isBase64Whitespace(code)) { - continue; - } - - if (code === 61 /* '=' */) { - padding++; - continue; - } - - if (!isBase64Char(code) || padding > 0) { - invalid = true; - continue; - } - - significant++; - } - - // Fetch rejects malformed forgiving-base64 input. Returning the raw-size - // allocation bound keeps that invalid input from becoming a pre-check bypass. - if ( - invalid || - padding > 2 || - (padding > 0 && (significant + padding) % 4 !== 0) || - significant % 4 === 1 - ) { - return estimateBase64BufferAllocation(body); - } - - return base64Bytes(significant); -}; - -const estimateDataURLBytes = (url, estimateBase64) => { - if (!url || typeof url !== 'string') return 0; - if (!url.startsWith('data:')) return 0; - - const comma = url.indexOf(','); - if (comma < 0) return 0; - - const meta = url.slice(5, comma); - const body = url.slice(comma + 1); - const isBase64 = /;base64/i.test(meta); - - if (isBase64) { - return estimateBase64(body); - } - - // Compute UTF-8 byte length directly from UTF-16 code units without allocating - // a byte buffer (TextEncoder.encode would defeat the DoS guard on large bodies). - // Valid %XX triplets count as one decoded byte; this matches the bytes that - // decodeURIComponent(body) would produce before Buffer re-encodes the string. - let bytes = 0; - for (let i = 0, len = body.length; i < len; i++) { - const c = body.charCodeAt(i); - if (c === 37 /* '%' */ && isPercentEncodedByte(body, i, len)) { - bytes += 1; - i += 2; - } else if (c < 0x80) { - bytes += 1; - } else if (c < 0x800) { - bytes += 2; - } else if (c >= 0xd800 && c <= 0xdbff && i + 1 < len) { - const next = body.charCodeAt(i + 1); - if (next >= 0xdc00 && next <= 0xdfff) { - bytes += 4; - i++; - } else { - bytes += 3; - } - } else { - bytes += 3; - } - } - return bytes; -}; - -/** - * Estimate the percent-decoded payload size used by Fetch data: URLs. - * - * @param {string} url - * @returns {number} - */ -function estimateDataURLDecodedBytes(url) { - // Fetch removes URL fragments before processing a data: URL. - const fragmentIndex = typeof url === 'string' ? url.indexOf('#') : -1; - - return estimateDataURLBytes( - fragmentIndex === -1 ? url : url.slice(0, fragmentIndex), - estimatePercentDecodedBase64Bytes - ); -} - -const VERSION = "1.19.0"; - -const DEFAULT_CHUNK_SIZE = 64 * 1024; - -const { isFunction } = utils$1; - -/** - * Encode a UTF-8 string to a Latin-1 byte string for use with btoa(). - * This is a modern replacement for the deprecated unescape(encodeURIComponent(str)) pattern. - * - * @param {string} str The string to encode - * - * @returns {string} UTF-8 bytes as a Latin-1 string - */ -const encodeUTF8 = (str) => - encodeURIComponent(str).replace(/%([0-9A-F]{2})/gi, (_, hex) => - String.fromCharCode(parseInt(hex, 16)) - ); - -// Node's WHATWG URL parser returns `username` and `password` percent-encoded. -// Decode before composing the `auth` option so credentials such as -// `my%40email.com:pass` are sent as `my@email.com:pass`. Falls back to the -// original value for malformed input so a bad encoding never throws. -const decodeURIComponentSafe = (value) => { - if (!utils$1.isString(value)) { - return value; - } - - try { - return decodeURIComponent(value); - } catch (error) { - return value; - } -}; - -const test = (fn, ...args) => { - try { - return !!fn(...args); - } catch (e) { - return false; - } -}; - -const maybeWithAuthCredentials = (url) => { - const protocolIndex = url.indexOf('://'); - let urlToCheck = url; - if (protocolIndex !== -1) { - urlToCheck = urlToCheck.slice(protocolIndex + 3); - } - return urlToCheck.includes('@') || urlToCheck.includes(':'); -}; - -const factory = (env) => { - const globalObject = - utils$1.global !== undefined && utils$1.global !== null - ? utils$1.global - : globalThis; - const { ReadableStream, TextEncoder } = globalObject; - - env = utils$1.merge.call( - { - skipUndefined: true, - }, - { - Request: globalObject.Request, - Response: globalObject.Response, - }, - env - ); - - const { fetch: envFetch, Request, Response } = env; - const isFetchSupported = envFetch ? isFunction(envFetch) : typeof fetch === 'function'; - const isRequestSupported = isFunction(Request); - const isResponseSupported = isFunction(Response); - - if (!isFetchSupported) { - return false; - } - - const isReadableStreamSupported = isFetchSupported && isFunction(ReadableStream); - - const encodeText = - isFetchSupported && - (typeof TextEncoder === 'function' - ? ( - (encoder) => (str) => - encoder.encode(str) - )(new TextEncoder()) - : async (str) => new Uint8Array(await new Request(str).arrayBuffer())); - - const supportsRequestStream = - isRequestSupported && - isReadableStreamSupported && - test(() => { - let duplexAccessed = false; - - const request = new Request(platform.origin, { - body: new ReadableStream(), - method: 'POST', - get duplex() { - duplexAccessed = true; - return 'half'; - }, - }); - - const hasContentType = request.headers.has('Content-Type'); - - if (request.body != null) { - request.body.cancel(); - } - - return duplexAccessed && !hasContentType; - }); - - const supportsResponseStream = - isResponseSupported && - isReadableStreamSupported && - test(() => utils$1.isReadableStream(new Response('').body)); - - const resolvers = { - stream: supportsResponseStream && ((res) => res.body), - }; - - isFetchSupported && - (() => { - ['text', 'arrayBuffer', 'blob', 'formData', 'stream'].forEach((type) => { - !resolvers[type] && - (resolvers[type] = (res, config) => { - let method = res && res[type]; - - if (method) { - return method.call(res); - } - - throw new AxiosError( - `Response type '${type}' is not supported`, - AxiosError.ERR_NOT_SUPPORT, - config - ); - }); - }); - })(); - - const getBodyLength = async (body) => { - if (body == null) { - return 0; - } - - if (utils$1.isBlob(body)) { - return body.size; - } - - if (utils$1.isSpecCompliantForm(body)) { - const _request = new Request(platform.origin, { - method: 'POST', - body, - }); - return (await _request.arrayBuffer()).byteLength; - } - - if (utils$1.isArrayBufferView(body) || utils$1.isArrayBuffer(body)) { - return body.byteLength; - } - - if (utils$1.isURLSearchParams(body)) { - body = body + ''; - } - - if (utils$1.isString(body)) { - return (await encodeText(body)).byteLength; - } - }; - - const resolveBodyLength = async (headers, body) => { - const length = utils$1.toFiniteNumber(headers.getContentLength()); - - return length == null ? getBodyLength(body) : length; - }; - - return async (config) => { - let { - url, - method, - data, - signal, - cancelToken, - timeout, - onDownloadProgress, - onUploadProgress, - responseType, - headers, - withCredentials = 'same-origin', - fetchOptions, - maxContentLength, - maxBodyLength, - } = resolveConfig(config); - - const hasMaxContentLength = utils$1.isNumber(maxContentLength) && maxContentLength > -1; - const hasMaxBodyLength = utils$1.isNumber(maxBodyLength) && maxBodyLength > -1; - const own = (key) => (utils$1.hasOwnProp(config, key) ? config[key] : undefined); - - let _fetch = envFetch || fetch; - - responseType = responseType ? (responseType + '').toLowerCase() : 'text'; - - let composedSignal = composeSignals( - [signal, cancelToken && cancelToken.toAbortSignal()], - timeout - ); - - let request = null; - - const unsubscribe = - composedSignal && - composedSignal.unsubscribe && - (() => { - composedSignal.unsubscribe(); - }); - - let requestContentLength; - - // AxiosError we raise while the request body is being streamed. Captured - // by identity so the catch block can surface it directly, regardless of - // how the runtime wraps the resulting fetch rejection (undici exposes it - // as `err.cause`; some browsers drop the original error entirely). - let pendingBodyError = null; - - const maxBodyLengthError = () => - new AxiosError( - 'Request body larger than maxBodyLength limit', - AxiosError.ERR_BAD_REQUEST, - config, - request - ); - - try { - // HTTP basic authentication - let auth = undefined; - const configAuth = own('auth'); - - if (configAuth) { - const username = utils$1.getSafeProp(configAuth, 'username') || ''; - const password = utils$1.getSafeProp(configAuth, 'password') || ''; - auth = { - username, - password - }; - } - - if (maybeWithAuthCredentials(url)) { - const parsedURL = new URL(url, platform.origin); - - if (!auth && (parsedURL.username || parsedURL.password)) { - const urlUsername = decodeURIComponentSafe(parsedURL.username); - const urlPassword = decodeURIComponentSafe(parsedURL.password); - auth = { - username: urlUsername, - password: urlPassword - }; - } - - if (parsedURL.username || parsedURL.password) { - parsedURL.username = ''; - parsedURL.password = ''; - url = parsedURL.href; - } - } - - if (auth) { - headers.delete('authorization'); - headers.set( - 'Authorization', - 'Basic ' + btoa(encodeUTF8((auth.username || '') + ':' + (auth.password || ''))) - ); - } - - // Enforce maxContentLength for data: URLs up-front so we never materialize - // an oversized payload. The HTTP adapter applies the same check (see http.js - // "if (protocol === 'data:')" branch). - if (hasMaxContentLength && typeof url === 'string' && url.startsWith('data:')) { - const estimated = estimateDataURLDecodedBytes(url); - if (estimated > maxContentLength) { - throw new AxiosError( - 'maxContentLength size of ' + maxContentLength + ' exceeded', - AxiosError.ERR_BAD_RESPONSE, - config, - request - ); - } - } - - // Enforce maxBodyLength against known-size bodies before dispatch using - // the body's *actual* size — never a caller-declared Content-Length, - // which could under-report to slip an oversized body past the check. - // Unknown-size streams return undefined here and are counted per-chunk - // below as fetch consumes them. - if (hasMaxBodyLength && method !== 'get' && method !== 'head') { - const outboundLength = await getBodyLength(data); - if (typeof outboundLength === 'number' && isFinite(outboundLength)) { - requestContentLength = outboundLength; - if (outboundLength > maxBodyLength) { - throw maxBodyLengthError(); - } - } - } - - // A streamed body under maxBodyLength must be counted as fetch consumes - // it; its size is never trusted from a caller-declared Content-Length. - const mustEnforceStreamBody = - hasMaxBodyLength && (utils$1.isReadableStream(data) || utils$1.isStream(data)); - - const trackRequestStream = (stream, onProgress, flush) => - trackStream( - stream, - DEFAULT_CHUNK_SIZE, - (loadedBytes) => { - if (hasMaxBodyLength && loadedBytes > maxBodyLength) { - throw (pendingBodyError = maxBodyLengthError()); - } - onProgress && onProgress(loadedBytes); - }, - flush - ); - - if ( - supportsRequestStream && - method !== 'get' && - method !== 'head' && - (onUploadProgress || mustEnforceStreamBody) - ) { - requestContentLength = - requestContentLength == null ? await resolveBodyLength(headers, data) : requestContentLength; - - // A declared length of 0 is only trusted to skip the wrap when we are - // not enforcing a stream limit (which must not rely on that header). - if (requestContentLength !== 0 || mustEnforceStreamBody) { - let _request = new Request(url, { - method: 'POST', - body: data, - duplex: 'half', - }); - - let contentTypeHeader; - - if (utils$1.isFormData(data) && (contentTypeHeader = _request.headers.get('content-type'))) { - headers.setContentType(contentTypeHeader); - } - - if (_request.body) { - const [onProgress, flush] = - (onUploadProgress && - progressEventDecorator( - requestContentLength, - progressEventReducer(asyncDecorator(onUploadProgress)) - )) || - []; - - data = trackRequestStream(_request.body, onProgress, flush); - } - } - } else if ( - mustEnforceStreamBody && - !isRequestSupported && - isReadableStreamSupported && - method !== 'get' && - method !== 'head' - ) { - data = trackRequestStream(data); - } else if ( - mustEnforceStreamBody && - isRequestSupported && - !supportsRequestStream && - method !== 'get' && - method !== 'head' - ) { - throw new AxiosError( - 'Stream request bodies are not supported by the current fetch implementation', - AxiosError.ERR_NOT_SUPPORT, - config, - request - ); - } - - if (!utils$1.isString(withCredentials)) { - withCredentials = withCredentials ? 'include' : 'omit'; - } - - // Cloudflare Workers throws when credentials are defined - // see https://github.com/cloudflare/workerd/issues/902 - const isCredentialsSupported = isRequestSupported && 'credentials' in Request.prototype; - - // If data is FormData and Content-Type is multipart/form-data without boundary, - // delete it so fetch can set it correctly with the boundary - if (utils$1.isFormData(data)) { - const contentType = headers.getContentType(); - if ( - contentType && - /^multipart\/form-data/i.test(contentType) && - !/boundary=/i.test(contentType) - ) { - headers.delete('content-type'); - } - } - - // Set User-Agent header if not already set (fetch defaults to 'node' in Node.js) - headers.set('User-Agent', 'axios/' + VERSION, false); - - const resolvedOptions = { - ...fetchOptions, - signal: composedSignal, - method: method.toUpperCase(), - headers: toByteStringHeaderObject(headers.normalize()), - body: data, - duplex: 'half', - credentials: isCredentialsSupported ? withCredentials : undefined, - }; - - request = isRequestSupported && new Request(url, resolvedOptions); - - let response = await (isRequestSupported - ? _fetch(request, fetchOptions) - : _fetch(url, resolvedOptions)); - - const responseHeaders = AxiosHeaders.from(response.headers); - - // Cheap pre-check: if the server honestly declares a content-length that - // already exceeds the cap, reject before we start streaming. - if (hasMaxContentLength) { - const declaredLength = utils$1.toFiniteNumber(responseHeaders.getContentLength()); - if (declaredLength != null && declaredLength > maxContentLength) { - throw new AxiosError( - 'maxContentLength size of ' + maxContentLength + ' exceeded', - AxiosError.ERR_BAD_RESPONSE, - config, - request - ); - } - } - - const isStreamResponse = - supportsResponseStream && (responseType === 'stream' || responseType === 'response'); - - if ( - supportsResponseStream && - response.body && - (onDownloadProgress || hasMaxContentLength || (isStreamResponse && unsubscribe)) - ) { - const options = {}; - - ['status', 'statusText', 'headers'].forEach((prop) => { - options[prop] = response[prop]; - }); - - const responseContentLength = utils$1.toFiniteNumber(responseHeaders.getContentLength()); - - const [onProgress, flush] = - (onDownloadProgress && - progressEventDecorator( - responseContentLength, - progressEventReducer(asyncDecorator(onDownloadProgress), true) - )) || - []; - - let bytesRead = 0; - const onChunkProgress = (loadedBytes) => { - if (hasMaxContentLength) { - bytesRead = loadedBytes; - if (bytesRead > maxContentLength) { - throw new AxiosError( - 'maxContentLength size of ' + maxContentLength + ' exceeded', - AxiosError.ERR_BAD_RESPONSE, - config, - request - ); - } - } - onProgress && onProgress(loadedBytes); - }; - - response = new Response( - trackStream(response.body, DEFAULT_CHUNK_SIZE, onChunkProgress, () => { - flush && flush(); - unsubscribe && unsubscribe(); - }), - options - ); - } - - responseType = responseType || 'text'; - - let responseData = await resolvers[utils$1.findKey(resolvers, responseType) || 'text']( - response, - config - ); - - // Fallback enforcement for environments without ReadableStream support - // (legacy runtimes). Detect materialized size from typed output; skip - // streams/Response passthrough since the user will read those themselves. - if (hasMaxContentLength && !supportsResponseStream && !isStreamResponse) { - let materializedSize; - if (responseData != null) { - if (typeof responseData.byteLength === 'number') { - materializedSize = responseData.byteLength; - } else if (typeof responseData.size === 'number') { - materializedSize = responseData.size; - } else if (typeof responseData === 'string') { - materializedSize = - typeof TextEncoder === 'function' - ? new TextEncoder().encode(responseData).byteLength - : responseData.length; - } - } - if (typeof materializedSize === 'number' && materializedSize > maxContentLength) { - throw new AxiosError( - 'maxContentLength size of ' + maxContentLength + ' exceeded', - AxiosError.ERR_BAD_RESPONSE, - config, - request - ); - } - } - - !isStreamResponse && unsubscribe && unsubscribe(); - - return await new Promise((resolve, reject) => { - settle(resolve, reject, { - data: responseData, - headers: AxiosHeaders.from(response.headers), - status: response.status, - statusText: response.statusText, - config, - request, - }); - }); - } catch (err) { - unsubscribe && unsubscribe(); - - // Safari can surface fetch aborts as a DOMException-like object whose - // branded getters throw. Prefer our composed signal reason before reading - // the caught error, preserving timeout vs cancellation semantics. - if (composedSignal && composedSignal.aborted && composedSignal.reason instanceof AxiosError) { - const canceledError = composedSignal.reason; - canceledError.config = config; - request && (canceledError.request = request); - if (err !== canceledError) { - // Non-enumerable to match native Error `cause` semantics so loggers - // don't recurse into circular fetch internals (see #7205). - Object.defineProperty(canceledError, 'cause', { - __proto__: null, - value: err, - writable: true, - enumerable: false, - configurable: true, - }); - } - throw canceledError; - } - - // Surface a maxBodyLength violation we raised while the request body was - // being streamed. Matching by identity (rather than reading - // `err.cause.isAxiosError`) keeps the error deterministic across runtimes - // and avoids both prototype-pollution reads and mis-attributing a foreign - // AxiosError that merely happened to land in `err.cause`. - if (pendingBodyError) { - request && !pendingBodyError.request && (pendingBodyError.request = request); - throw pendingBodyError; - } - - // Re-throw AxiosErrors we raised synchronously (data: URL / content-length - // pre-checks, response size enforcement) without re-wrapping them. - if (err instanceof AxiosError) { - request && !err.request && (err.request = request); - throw err; - } - - if (err && err.name === 'TypeError' && /Load failed|fetch/i.test(err.message)) { - const networkError = new AxiosError( - 'Network Error', - AxiosError.ERR_NETWORK, - config, - request, - err && err.response - ); - // Non-enumerable to match native Error `cause` semantics so loggers - // don't recurse into circular fetch internals (see #7205). - Object.defineProperty(networkError, 'cause', { - __proto__: null, - value: err.cause || err, - writable: true, - enumerable: false, - configurable: true, - }); - throw networkError; - } - - throw AxiosError.from(err, err && err.code, config, request, err && err.response); - } - }; -}; - -const seedCache = new Map(); - -const getFetch = (config) => { - let env = (config && config.env) || {}; - const { fetch, Request, Response } = env; - const seeds = [Request, Response, fetch]; - - let len = seeds.length, - i = len, - seed, - target, - map = seedCache; - - while (i--) { - seed = seeds[i]; - target = map.get(seed); - - target === undefined && map.set(seed, (target = i ? new Map() : factory(env))); - - map = target; - } - - return target; -}; - -getFetch(); - -/** - * Known adapters mapping. - * Provides environment-specific adapters for Axios: - * - `http` for Node.js - * - `xhr` for browsers - * - `fetch` for fetch API-based requests - * - * @type {Object} - */ -const knownAdapters = { - http: httpAdapter, - xhr: xhrAdapter, - fetch: { - get: getFetch, - }, -}; - -// Assign adapter names for easier debugging and identification -utils$1.forEach(knownAdapters, (fn, value) => { - if (fn) { - try { - // Null-proto descriptors so a polluted Object.prototype.get cannot turn - // these data descriptors into accessor descriptors on the way in. - Object.defineProperty(fn, 'name', { __proto__: null, value }); - } catch (e) { - // eslint-disable-next-line no-empty - } - Object.defineProperty(fn, 'adapterName', { __proto__: null, value }); - } -}); - -/** - * Render a rejection reason string for unknown or unsupported adapters - * - * @param {string} reason - * @returns {string} - */ -const renderReason = (reason) => `- ${reason}`; - -/** - * Check if the adapter is resolved (function, null, or false) - * - * @param {Function|null|false} adapter - * @returns {boolean} - */ -const isResolvedHandle = (adapter) => - utils$1.isFunction(adapter) || adapter === null || adapter === false; - -/** - * Get the first suitable adapter from the provided list. - * Tries each adapter in order until a supported one is found. - * Throws an AxiosError if no adapter is suitable. - * - * @param {Array|string|Function} adapters - Adapter(s) by name or function. - * @param {Object} config - Axios request configuration - * @throws {AxiosError} If no suitable adapter is available - * @returns {Function} The resolved adapter function - */ -function getAdapter(adapters, config) { - adapters = utils$1.isArray(adapters) ? adapters : [adapters]; - - const { length } = adapters; - let nameOrAdapter; - let adapter; - - const rejectedReasons = {}; - - for (let i = 0; i < length; i++) { - nameOrAdapter = adapters[i]; - let id; - - adapter = nameOrAdapter; - - if (!isResolvedHandle(nameOrAdapter)) { - adapter = knownAdapters[(id = String(nameOrAdapter)).toLowerCase()]; - - if (adapter === undefined) { - throw new AxiosError(`Unknown adapter '${id}'`); - } - } - - if (adapter && (utils$1.isFunction(adapter) || (adapter = adapter.get(config)))) { - break; - } - - rejectedReasons[id || '#' + i] = adapter; - } - - if (!adapter) { - const reasons = Object.entries(rejectedReasons).map( - ([id, state]) => - `adapter ${id} ` + - (state === false ? 'is not supported by the environment' : 'is not available in the build') - ); - - let s = length - ? reasons.length > 1 - ? 'since :\n' + reasons.map(renderReason).join('\n') - : ' ' + renderReason(reasons[0]) - : 'as no adapter specified'; - - throw new AxiosError( - `There is no suitable adapter to dispatch the request ` + s, - AxiosError.ERR_NOT_SUPPORT - ); - } - - return adapter; -} - -/** - * Exports Axios adapters and utility to resolve an adapter - */ -var adapters = { - /** - * Resolve an adapter from a list of adapter names or functions. - * @type {Function} - */ - getAdapter, - - /** - * Exposes all known adapters - * @type {Object} - */ - adapters: knownAdapters, -}; - -/** - * Throws a `CanceledError` if cancellation has been requested. - * - * @param {Object} config The config that is to be used for the request - * - * @returns {void} - */ -function throwIfCancellationRequested(config) { - if (config.cancelToken) { - config.cancelToken.throwIfRequested(); - } - - if (config.signal && config.signal.aborted) { - throw new CanceledError(null, config); - } -} - -/** - * Dispatch a request to the server using the configured adapter. - * - * @param {object} config The config that is to be used for the request - * - * @returns {Promise} The Promise to be fulfilled - */ -function dispatchRequest(config) { - throwIfCancellationRequested(config); - - config.headers = AxiosHeaders.from(config.headers); - - // Transform request data - config.data = transformData.call(config, config.transformRequest); - - if (['post', 'put', 'patch'].indexOf(config.method) !== -1) { - config.headers.setContentType('application/x-www-form-urlencoded', false); - } - - const adapter = adapters.getAdapter(config.adapter || defaults.adapter, config); - - return adapter(config).then( - function onAdapterResolution(response) { - throwIfCancellationRequested(config); - - // Expose the current response on config so that transformResponse can - // attach it to any AxiosError it throws (e.g. on JSON parse failure). - // We clean it up afterwards to avoid polluting the config object. - config.response = response; - try { - response.data = transformData.call(config, config.transformResponse, response); - } finally { - delete config.response; - } - - response.headers = AxiosHeaders.from(response.headers); - - return response; - }, - function onAdapterRejection(reason) { - if (!isCancel(reason)) { - throwIfCancellationRequested(config); - - // Transform response data - if (reason && reason.response) { - config.response = reason.response; - try { - reason.response.data = transformData.call( - config, - config.transformResponse, - reason.response - ); - } finally { - delete config.response; - } - reason.response.headers = AxiosHeaders.from(reason.response.headers); - } - } - - return Promise.reject(reason); - } - ); -} - -const validators$1 = {}; - -// eslint-disable-next-line func-names -['object', 'boolean', 'number', 'function', 'string', 'symbol'].forEach((type, i) => { - validators$1[type] = function validator(thing) { - return typeof thing === type || 'a' + (i < 1 ? 'n ' : ' ') + type; - }; -}); - -const deprecatedWarnings = {}; - -/** - * Transitional option validator - * - * @param {function|boolean?} validator - set to false if the transitional option has been removed - * @param {string?} version - deprecated version / removed since version - * @param {string?} message - some message with additional info - * - * @returns {function} - */ -validators$1.transitional = function transitional(validator, version, message) { - function formatMessage(opt, desc) { - return ( - '[Axios v' + - VERSION + - "] Transitional option '" + - opt + - "'" + - desc + - (message ? '. ' + message : '') - ); - } - - // eslint-disable-next-line func-names - return (value, opt, opts) => { - if (validator === false) { - throw new AxiosError( - formatMessage(opt, ' has been removed' + (version ? ' in ' + version : '')), - AxiosError.ERR_DEPRECATED - ); - } - - if (version && !deprecatedWarnings[opt]) { - deprecatedWarnings[opt] = true; - // eslint-disable-next-line no-console - console.warn( - formatMessage( - opt, - ' has been deprecated since v' + version + ' and will be removed in the near future' - ) - ); - } - - return validator ? validator(value, opt, opts) : true; - }; -}; - -validators$1.spelling = function spelling(correctSpelling) { - return (value, opt) => { - // eslint-disable-next-line no-console - console.warn(`${opt} is likely a misspelling of ${correctSpelling}`); - return true; - }; -}; - -/** - * Assert object's properties type - * - * @param {object} options - * @param {object} schema - * @param {boolean?} allowUnknown - * - * @returns {object} - */ - -function assertOptions(options, schema, allowUnknown) { - if (typeof options !== 'object' || options === null) { - throw new AxiosError('options must be an object', AxiosError.ERR_BAD_OPTION_VALUE); - } - const keys = Object.keys(options); - let i = keys.length; - while (i-- > 0) { - const opt = keys[i]; - // Use hasOwnProperty so a polluted Object.prototype. cannot supply - // a non-function validator and cause a TypeError. - const validator = Object.prototype.hasOwnProperty.call(schema, opt) ? schema[opt] : undefined; - if (validator) { - const value = options[opt]; - const result = value === undefined || validator(value, opt, options); - if (result !== true) { - throw new AxiosError( - 'option ' + opt + ' must be ' + result, - AxiosError.ERR_BAD_OPTION_VALUE - ); - } - continue; - } - if (allowUnknown !== true) { - throw new AxiosError('Unknown option ' + opt, AxiosError.ERR_BAD_OPTION); - } - } -} - -var validator = { - assertOptions, - validators: validators$1, -}; - -const validators = validator.validators; - -/** - * Create a new instance of Axios - * - * @param {Object} instanceConfig The default config for the instance - * - * @return {Axios} A new instance of Axios - */ -class Axios { - constructor(instanceConfig) { - this.defaults = instanceConfig || {}; - this.interceptors = { - request: new InterceptorManager(), - response: new InterceptorManager(), - }; - } - - /** - * Dispatch a request - * - * @param {String|Object} configOrUrl The config specific for this request (merged with this.defaults) - * @param {?Object} config - * - * @returns {Promise} The Promise to be fulfilled - */ - async request(configOrUrl, config) { - try { - return await this._request(configOrUrl, config); - } catch (err) { - if (err instanceof Error) { - let dummy = {}; - - Error.captureStackTrace ? Error.captureStackTrace(dummy) : (dummy = new Error()); - - // slice off the Error: ... line - const stack = (() => { - if (!dummy.stack) { - return ''; - } - - const firstNewlineIndex = dummy.stack.indexOf('\n'); - - return firstNewlineIndex === -1 ? '' : dummy.stack.slice(firstNewlineIndex + 1); - })(); - try { - if (!err.stack) { - err.stack = stack; - // match without the 2 top stack lines - } else if (stack) { - const firstNewlineIndex = stack.indexOf('\n'); - const secondNewlineIndex = - firstNewlineIndex === -1 ? -1 : stack.indexOf('\n', firstNewlineIndex + 1); - const stackWithoutTwoTopLines = - secondNewlineIndex === -1 ? '' : stack.slice(secondNewlineIndex + 1); - - if (!String(err.stack).endsWith(stackWithoutTwoTopLines)) { - err.stack += '\n' + stack; - } - } - } catch (e) { - // ignore the case where "stack" is an un-writable property - } - } - - throw err; - } - } - - _request(configOrUrl, config) { - /*eslint no-param-reassign:0*/ - // Allow for axios('example/url'[, config]) a la fetch API - if (typeof configOrUrl === 'string') { - config = config || {}; - config.url = configOrUrl; - } else { - config = configOrUrl || {}; - } - - config = mergeConfig(this.defaults, config); - - const { transitional, paramsSerializer, headers } = config; - - if (transitional !== undefined) { - validator.assertOptions( - transitional, - { - silentJSONParsing: validators.transitional(validators.boolean), - forcedJSONParsing: validators.transitional(validators.boolean), - clarifyTimeoutError: validators.transitional(validators.boolean), - legacyInterceptorReqResOrdering: validators.transitional(validators.boolean), - advertiseZstdAcceptEncoding: validators.transitional(validators.boolean), - validateStatusUndefinedResolves: validators.transitional(validators.boolean), - }, - false - ); - } - - if (paramsSerializer != null) { - if (utils$1.isFunction(paramsSerializer)) { - config.paramsSerializer = { - serialize: paramsSerializer, - }; - } else { - validator.assertOptions( - paramsSerializer, - { - encode: validators.function, - serialize: validators.function, - }, - true - ); - } - } - - // Set config.allowAbsoluteUrls - if (config.allowAbsoluteUrls !== undefined) ; else if (this.defaults.allowAbsoluteUrls !== undefined) { - config.allowAbsoluteUrls = this.defaults.allowAbsoluteUrls; - } else { - config.allowAbsoluteUrls = true; - } - - validator.assertOptions( - config, - { - baseUrl: validators.spelling('baseURL'), - withXsrfToken: validators.spelling('withXSRFToken'), - }, - true - ); - - // Set config.method - config.method = (config.method || this.defaults.method || 'get').toLowerCase(); - - // Flatten headers - let contextHeaders = headers && utils$1.merge(headers.common, headers[config.method]); - - headers && - utils$1.forEach(['delete', 'get', 'head', 'post', 'put', 'patch', 'query', 'common'], (method) => { - delete headers[method]; - }); - - config.headers = AxiosHeaders.concat(contextHeaders, headers); - - // filter out skipped interceptors - const requestInterceptorChain = []; - let synchronousRequestInterceptors = true; - this.interceptors.request.forEach(function unshiftRequestInterceptors(interceptor) { - if (typeof interceptor.runWhen === 'function' && interceptor.runWhen(config) === false) { - return; - } - - synchronousRequestInterceptors = synchronousRequestInterceptors && interceptor.synchronous; - - const transitional = config.transitional || transitionalDefaults; - const legacyInterceptorReqResOrdering = - transitional && transitional.legacyInterceptorReqResOrdering; - - if (legacyInterceptorReqResOrdering) { - requestInterceptorChain.unshift(interceptor.fulfilled, interceptor.rejected); - } else { - requestInterceptorChain.push(interceptor.fulfilled, interceptor.rejected); - } - }); - - const responseInterceptorChain = []; - this.interceptors.response.forEach(function pushResponseInterceptors(interceptor) { - responseInterceptorChain.push(interceptor.fulfilled, interceptor.rejected); - }); - - let promise; - let i = 0; - let len; - - if (!synchronousRequestInterceptors) { - const chain = [dispatchRequest.bind(this), undefined]; - chain.unshift(...requestInterceptorChain); - chain.push(...responseInterceptorChain); - len = chain.length; - - promise = Promise.resolve(config); - - while (i < len) { - promise = promise.then(chain[i++], chain[i++]); - } - - return promise; - } - - len = requestInterceptorChain.length; - - let newConfig = config; - - while (i < len) { - const onFulfilled = requestInterceptorChain[i++]; - const onRejected = requestInterceptorChain[i++]; - try { - newConfig = onFulfilled ? onFulfilled(newConfig) : newConfig; - } catch (error) { - if (!onRejected) { - promise = Promise.reject(error); - break; - } - - try { - const rejectedResult = onRejected.call(this, error); - - if (utils$1.isThenable(rejectedResult)) { - promise = Promise.resolve(rejectedResult).then(() => - dispatchRequest.call(this, newConfig) - ); - } - } catch (rejectedError) { - promise = Promise.reject(rejectedError); - } - - break; - } - } - - if (!promise) { - try { - promise = dispatchRequest.call(this, newConfig); - } catch (error) { - promise = Promise.reject(error); - } - } - - i = 0; - len = responseInterceptorChain.length; - - while (i < len) { - promise = promise.then(responseInterceptorChain[i++], responseInterceptorChain[i++]); - } - - return promise; - } - - getUri(config) { - config = mergeConfig(this.defaults, config); - const fullPath = buildFullPath(config.baseURL, config.url, config.allowAbsoluteUrls, config); - return buildURL(fullPath, config.params, config.paramsSerializer); - } -} - -// Provide aliases for supported request methods -utils$1.forEach(['delete', 'get', 'head', 'options'], function forEachMethodNoData(method) { - /*eslint func-names:0*/ - Axios.prototype[method] = function (url, config) { - return this.request( - mergeConfig(config || {}, { - method, - url, - data: config && utils$1.hasOwnProp(config, 'data') ? config.data : undefined, - }) - ); - }; -}); - -utils$1.forEach(['post', 'put', 'patch', 'query'], function forEachMethodWithData(method) { - function generateHTTPMethod(isForm) { - return function httpMethod(url, data, config) { - return this.request( - mergeConfig(config || {}, { - method, - headers: isForm - ? { - 'Content-Type': 'multipart/form-data', - } - : {}, - url, - data, - }) - ); - }; - } - - Axios.prototype[method] = generateHTTPMethod(); - - // QUERY is a safe/idempotent read method; multipart form bodies don't fit - // its semantics, so no queryForm shorthand is generated. - if (method !== 'query') { - Axios.prototype[method + 'Form'] = generateHTTPMethod(true); - } -}); - -/** - * A `CancelToken` is an object that can be used to request cancellation of an operation. - * - * @param {Function} executor The executor function. - * - * @returns {CancelToken} - */ -class CancelToken { - constructor(executor) { - if (typeof executor !== 'function') { - throw new TypeError('executor must be a function.'); - } - - let resolvePromise; - - this.promise = new Promise(function promiseExecutor(resolve) { - resolvePromise = resolve; - }); - - const token = this; - - // eslint-disable-next-line func-names - this.promise.then((cancel) => { - if (!token._listeners) return; - - let i = token._listeners.length; - - while (i-- > 0) { - token._listeners[i](cancel); - } - token._listeners = null; - }); - - // eslint-disable-next-line func-names - this.promise.then = (onfulfilled) => { - let _resolve; - // eslint-disable-next-line func-names - const promise = new Promise((resolve) => { - token.subscribe(resolve); - _resolve = resolve; - }).then(onfulfilled); - - promise.cancel = function reject() { - token.unsubscribe(_resolve); - }; - - return promise; - }; - - executor(function cancel(message, config, request) { - if (token.reason) { - // Cancellation has already been requested - return; - } - - token.reason = new CanceledError(message, config, request); - resolvePromise(token.reason); - }); - } - - /** - * Throws a `CanceledError` if cancellation has been requested. - */ - throwIfRequested() { - if (this.reason) { - throw this.reason; - } - } - - /** - * Subscribe to the cancel signal - */ - - subscribe(listener) { - if (this.reason) { - listener(this.reason); - return; - } - - if (this._listeners) { - this._listeners.push(listener); - } else { - this._listeners = [listener]; - } - } - - /** - * Unsubscribe from the cancel signal - */ - - unsubscribe(listener) { - if (!this._listeners) { - return; - } - const index = this._listeners.indexOf(listener); - if (index !== -1) { - this._listeners.splice(index, 1); - } - } - - toAbortSignal() { - const controller = new AbortController(); - - const abort = (err) => { - controller.abort(err); - }; - - this.subscribe(abort); - - controller.signal.unsubscribe = () => this.unsubscribe(abort); - - return controller.signal; - } - - /** - * Returns an object that contains a new `CancelToken` and a function that, when called, - * cancels the `CancelToken`. - */ - static source() { - let cancel; - const token = new CancelToken(function executor(c) { - cancel = c; - }); - return { - token, - cancel, - }; - } -} - -/** - * Syntactic sugar for invoking a function and expanding an array for arguments. - * - * Common use case would be to use `Function.prototype.apply`. - * - * ```js - * function f(x, y, z) {} - * const args = [1, 2, 3]; - * f.apply(null, args); - * ``` - * - * With `spread` this example can be re-written. - * - * ```js - * spread(function(x, y, z) {})([1, 2, 3]); - * ``` - * - * @param {Function} callback - * - * @returns {Function} - */ -function spread(callback) { - return function wrap(arr) { - return callback.apply(null, arr); - }; -} - -/** - * Determines whether the payload is an error thrown by Axios - * - * @param {*} payload The value to test - * - * @returns {boolean} True if the payload is an error thrown by Axios, otherwise false - */ -function isAxiosError(payload) { - return utils$1.isObject(payload) && payload.isAxiosError === true; -} - -const HttpStatusCode = { - Continue: 100, - SwitchingProtocols: 101, - Processing: 102, - EarlyHints: 103, - Ok: 200, - Created: 201, - Accepted: 202, - NonAuthoritativeInformation: 203, - NoContent: 204, - ResetContent: 205, - PartialContent: 206, - MultiStatus: 207, - AlreadyReported: 208, - ImUsed: 226, - MultipleChoices: 300, - MovedPermanently: 301, - Found: 302, - SeeOther: 303, - NotModified: 304, - UseProxy: 305, - Unused: 306, - TemporaryRedirect: 307, - PermanentRedirect: 308, - BadRequest: 400, - Unauthorized: 401, - PaymentRequired: 402, - Forbidden: 403, - NotFound: 404, - MethodNotAllowed: 405, - NotAcceptable: 406, - ProxyAuthenticationRequired: 407, - RequestTimeout: 408, - Conflict: 409, - Gone: 410, - LengthRequired: 411, - PreconditionFailed: 412, - PayloadTooLarge: 413, - UriTooLong: 414, - UnsupportedMediaType: 415, - RangeNotSatisfiable: 416, - ExpectationFailed: 417, - ImATeapot: 418, - MisdirectedRequest: 421, - UnprocessableEntity: 422, - Locked: 423, - FailedDependency: 424, - TooEarly: 425, - UpgradeRequired: 426, - PreconditionRequired: 428, - TooManyRequests: 429, - RequestHeaderFieldsTooLarge: 431, - UnavailableForLegalReasons: 451, - InternalServerError: 500, - NotImplemented: 501, - BadGateway: 502, - ServiceUnavailable: 503, - GatewayTimeout: 504, - HttpVersionNotSupported: 505, - VariantAlsoNegotiates: 506, - InsufficientStorage: 507, - LoopDetected: 508, - NotExtended: 510, - NetworkAuthenticationRequired: 511, - WebServerReturnsAnUnknownError: 520, - WebServerIsDown: 521, - ConnectionTimedOut: 522, - OriginIsUnreachable: 523, - TimeoutOccurred: 524, - SslHandshakeFailed: 525, - InvalidSslCertificate: 526, -}; - -Object.entries(HttpStatusCode).forEach(([key, value]) => { - HttpStatusCode[value] = key; -}); - -/** - * Create an instance of Axios - * - * @param {Object} defaultConfig The default config for the instance - * - * @returns {Axios} A new instance of Axios - */ -function createInstance(defaultConfig) { - const context = new Axios(defaultConfig); - const instance = bind(Axios.prototype.request, context); - - // Copy axios.prototype to instance - utils$1.extend(instance, Axios.prototype, context, { allOwnKeys: true }); - - // Copy context to instance - utils$1.extend(instance, context, null, { allOwnKeys: true }); - - // Factory for creating new instances - instance.create = function create(instanceConfig) { - return createInstance(mergeConfig(defaultConfig, instanceConfig)); - }; - - return instance; -} - -// Create the default instance to be exported -const axios = createInstance(defaults); - -// Expose Axios class to allow class inheritance -axios.Axios = Axios; - -// Expose Cancel & CancelToken -axios.CanceledError = CanceledError; -axios.CancelToken = CancelToken; -axios.isCancel = isCancel; -axios.VERSION = VERSION; -axios.toFormData = toFormData; - -// Expose AxiosError class -axios.AxiosError = AxiosError; - -// alias for CanceledError for backward compatibility -axios.Cancel = axios.CanceledError; - -// Expose all/spread -axios.all = function all(promises) { - return Promise.all(promises); -}; - -axios.spread = spread; - -// Expose isAxiosError -axios.isAxiosError = isAxiosError; - -// Expose mergeConfig -axios.mergeConfig = mergeConfig; - -axios.AxiosHeaders = AxiosHeaders; - -axios.formToJSON = (thing) => formDataToJSON(utils$1.isHTMLForm(thing) ? new FormData(thing) : thing); - -axios.getAdapter = adapters.getAdapter; - -axios.HttpStatusCode = HttpStatusCode; - -axios.default = axios; - -module.exports = axios; diff --git a/server/node_modules/axios/dist/esm/axios.js b/server/node_modules/axios/dist/esm/axios.js deleted file mode 100644 index ae637cd..0000000 --- a/server/node_modules/axios/dist/esm/axios.js +++ /dev/null @@ -1,5490 +0,0 @@ -/*! Axios v1.19.0 Copyright (c) 2026 Matt Zabriskie and contributors */ -/** - * Create a bound version of a function with a specified `this` context - * - * @param {Function} fn - The function to bind - * @param {*} thisArg - The value to be passed as the `this` parameter - * @returns {Function} A new function that will call the original function with the specified `this` context - */ -function bind(fn, thisArg) { - return function wrap() { - return fn.apply(thisArg, arguments); - }; -} - -// utils is a library of generic helper functions non-specific to axios - -const { toString } = Object.prototype; -const { getPrototypeOf } = Object; -const { iterator, toStringTag } = Symbol; - -/* Creating a function that will check if an object has a property. */ -const hasOwnProperty = ( - ({ hasOwnProperty }) => - (obj, prop) => - hasOwnProperty.call(obj, prop) -)(Object.prototype); - -/** - * Walk the prototype chain (excluding the shared Object.prototype) looking for - * an own `prop`. This distinguishes genuine own/inherited members — including - * class accessors and template prototypes — from members injected via - * Object.prototype pollution (e.g. `Object.prototype.username = '...'`), which - * live on Object.prototype itself and are therefore never matched. - * - * @param {*} thing The value whose chain to inspect - * @param {string|symbol} prop The property key to look for - * - * @returns {boolean} True when `prop` is owned below Object.prototype - */ -const hasOwnInPrototypeChain = (thing, prop) => { - let obj = thing; - const seen = []; - - while (obj != null && obj !== Object.prototype) { - if (seen.indexOf(obj) !== -1) { - return false; - } - seen.push(obj); - - if (hasOwnProperty(obj, prop)) { - return true; - } - obj = getPrototypeOf(obj); - } - return false; -}; - -/** - * Read `obj[prop]` only when it is safe from Object.prototype pollution. Own - * properties and members inherited from a non-Object.prototype source (a class - * instance or template object) are honored; a value reachable only through a - * polluted Object.prototype is ignored and `undefined` is returned. - * - * @param {*} obj The source object - * @param {string|symbol} prop The property key to read - * - * @returns {*} The resolved value, or undefined when unsafe/absent - */ -const getSafeProp = (obj, prop) => - obj != null && hasOwnInPrototypeChain(obj, prop) ? obj[prop] : undefined; - -const kindOf = ((cache) => (thing) => { - const str = toString.call(thing); - return cache[str] || (cache[str] = str.slice(8, -1).toLowerCase()); -})(Object.create(null)); - -const kindOfTest = (type) => { - type = type.toLowerCase(); - return (thing) => kindOf(thing) === type; -}; - -const typeOfTest = (type) => (thing) => typeof thing === type; - -/** - * Determine if a value is a non-null object - * - * @param {Object} val The value to test - * - * @returns {boolean} True if value is an Array, otherwise false - */ -const { isArray } = Array; - -/** - * Determine if a value is undefined - * - * @param {*} val The value to test - * - * @returns {boolean} True if the value is undefined, otherwise false - */ -const isUndefined = typeOfTest('undefined'); - -/** - * Determine if a value is a Buffer - * - * @param {*} val The value to test - * - * @returns {boolean} True if value is a Buffer, otherwise false - */ -function isBuffer(val) { - return ( - val !== null && - !isUndefined(val) && - val.constructor !== null && - !isUndefined(val.constructor) && - isFunction$1(val.constructor.isBuffer) && - val.constructor.isBuffer(val) - ); -} - -/** - * Determine if a value is an ArrayBuffer - * - * @param {*} val The value to test - * - * @returns {boolean} True if value is an ArrayBuffer, otherwise false - */ -const isArrayBuffer = kindOfTest('ArrayBuffer'); - -/** - * Determine if a value is a view on an ArrayBuffer - * - * @param {*} val The value to test - * - * @returns {boolean} True if value is a view on an ArrayBuffer, otherwise false - */ -function isArrayBufferView(val) { - let result; - if (typeof ArrayBuffer !== 'undefined' && ArrayBuffer.isView) { - result = ArrayBuffer.isView(val); - } else { - result = val && val.buffer && isArrayBuffer(val.buffer); - } - return result; -} - -/** - * Determine if a value is a String - * - * @param {*} val The value to test - * - * @returns {boolean} True if value is a String, otherwise false - */ -const isString = typeOfTest('string'); - -/** - * Determine if a value is a Function - * - * @param {*} val The value to test - * @returns {boolean} True if value is a Function, otherwise false - */ -const isFunction$1 = typeOfTest('function'); - -/** - * Determine if a value is a Number - * - * @param {*} val The value to test - * - * @returns {boolean} True if value is a Number, otherwise false - */ -const isNumber = typeOfTest('number'); - -/** - * Determine if a value is an Object - * - * @param {*} thing The value to test - * - * @returns {boolean} True if value is an Object, otherwise false - */ -const isObject = (thing) => thing !== null && typeof thing === 'object'; - -/** - * Determine if a value is a Boolean - * - * @param {*} thing The value to test - * @returns {boolean} True if value is a Boolean, otherwise false - */ -const isBoolean = (thing) => thing === true || thing === false; - -/** - * Determine if a value is a plain Object - * - * @param {*} val The value to test - * - * @returns {boolean} True if value is a plain Object, otherwise false - */ -const isPlainObject = (val) => { - if (!isObject(val)) { - return false; - } - - const prototype = getPrototypeOf(val); - return ( - (prototype === null || - prototype === Object.prototype || - getPrototypeOf(prototype) === null) && - // Treat any genuine (non-Object.prototype-polluted) Symbol.toStringTag or - // Symbol.iterator as evidence the value is a tagged/iterable type rather - // than a plain object, while ignoring keys injected onto Object.prototype. - !hasOwnInPrototypeChain(val, toStringTag) && - !hasOwnInPrototypeChain(val, iterator) - ); -}; - -/** - * Determine if a value is an empty object (safely handles Buffers) - * - * @param {*} val The value to test - * - * @returns {boolean} True if value is an empty object, otherwise false - */ -const isEmptyObject = (val) => { - // Early return for non-objects or Buffers to prevent RangeError - if (!isObject(val) || isBuffer(val)) { - return false; - } - - try { - return Object.keys(val).length === 0 && Object.getPrototypeOf(val) === Object.prototype; - } catch (e) { - // Fallback for any other objects that might cause RangeError with Object.keys() - return false; - } -}; - -/** - * Determine if a value is a Date - * - * @param {*} val The value to test - * - * @returns {boolean} True if value is a Date, otherwise false - */ -const isDate = kindOfTest('Date'); - -/** - * Determine if a value is a File - * - * @param {*} val The value to test - * - * @returns {boolean} True if value is a File, otherwise false - */ -const isFile = kindOfTest('File'); - -/** - * Determine if a value is a React Native Blob - * React Native "blob": an object with a `uri` attribute. Optionally, it can - * also have a `name` and `type` attribute to specify filename and content type - * - * @see https://github.com/facebook/react-native/blob/26684cf3adf4094eb6c405d345a75bf8c7c0bf88/Libraries/Network/FormData.js#L68-L71 - * - * @param {*} value The value to test - * - * @returns {boolean} True if value is a React Native Blob, otherwise false - */ -const isReactNativeBlob = (value) => { - return !!(value && typeof value.uri !== 'undefined'); -}; - -/** - * Determine if environment is React Native - * ReactNative `FormData` has a non-standard `getParts()` method - * - * @param {*} formData The formData to test - * - * @returns {boolean} True if environment is React Native, otherwise false - */ -const isReactNative = (formData) => formData && typeof formData.getParts !== 'undefined'; - -/** - * Determine if a value is a Blob - * - * @param {*} val The value to test - * - * @returns {boolean} True if value is a Blob, otherwise false - */ -const isBlob = kindOfTest('Blob'); - -/** - * Determine if a value is a FileList - * - * @param {*} val The value to test - * - * @returns {boolean} True if value is a FileList, otherwise false - */ -const isFileList = kindOfTest('FileList'); -const isSet = kindOfTest('Set'); - -/** - * Determine if a value is a Stream - * - * @param {*} val The value to test - * - * @returns {boolean} True if value is a Stream, otherwise false - */ -const isStream = (val) => isObject(val) && isFunction$1(val.pipe); - -/** - * Determine if a value is a FormData - * - * @param {*} thing The value to test - * - * @returns {boolean} True if value is an FormData, otherwise false - */ -function getGlobal() { - if (typeof globalThis !== 'undefined') return globalThis; - if (typeof self !== 'undefined') return self; - if (typeof window !== 'undefined') return window; - if (typeof global !== 'undefined') return global; - return {}; -} - -const G = getGlobal(); -const FormDataCtor = typeof G.FormData !== 'undefined' ? G.FormData : undefined; - -const isFormData = (thing) => { - if (!thing) return false; - if (FormDataCtor && thing instanceof FormDataCtor) return true; - // Reject plain objects inheriting directly from Object.prototype so prototype-pollution gadgets can't spoof FormData. - const proto = getPrototypeOf(thing); - if (!proto || proto === Object.prototype) return false; - if (!isFunction$1(thing.append)) return false; - const kind = kindOf(thing); - return ( - kind === 'formdata' || - // detect form-data instance - (kind === 'object' && isFunction$1(thing.toString) && thing.toString() === '[object FormData]') - ); -}; - -/** - * Determine if a value is a URLSearchParams object - * - * @param {*} val The value to test - * - * @returns {boolean} True if value is a URLSearchParams object, otherwise false - */ -const isURLSearchParams = kindOfTest('URLSearchParams'); - -const [isReadableStream, isRequest, isResponse, isHeaders] = [ - 'ReadableStream', - 'Request', - 'Response', - 'Headers', -].map(kindOfTest); - -/** - * Trim excess whitespace off the beginning and end of a string - * - * @param {String} str The String to trim - * - * @returns {String} The String freed of excess whitespace - */ -const trim = (str) => { - return str.trim ? str.trim() : str.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, ''); -}; -/** - * Iterate over an Array or an Object invoking a function for each item. - * - * If `obj` is an Array callback will be called passing - * the value, index, and complete array for each item. - * - * If 'obj' is an Object callback will be called passing - * the value, key, and complete object for each property. - * - * @param {Object|Array} obj The object to iterate - * @param {Function} fn The callback to invoke for each item - * - * @param {Object} [options] - * @param {Boolean} [options.allOwnKeys = false] - * @returns {any} - */ -function forEach(obj, fn, { allOwnKeys = false } = {}) { - // Don't bother if no value provided - if (obj === null || typeof obj === 'undefined') { - return; - } - - let i; - let l; - - // Force an array if not already something iterable - if (typeof obj !== 'object') { - /*eslint no-param-reassign:0*/ - obj = [obj]; - } - - if (isArray(obj)) { - // Iterate over array values - for (i = 0, l = obj.length; i < l; i++) { - fn.call(null, obj[i], i, obj); - } - } else { - // Buffer check - if (isBuffer(obj)) { - return; - } - - // Iterate over object keys - const keys = allOwnKeys ? Object.getOwnPropertyNames(obj) : Object.keys(obj); - const len = keys.length; - let key; - - for (i = 0; i < len; i++) { - key = keys[i]; - fn.call(null, obj[key], key, obj); - } - } -} - -/** - * Finds a key in an object, case-insensitive, returning the actual key name. - * Returns null if the object is a Buffer or if no match is found. - * - * @param {Object} obj - The object to search. - * @param {string} key - The key to find (case-insensitive). - * @returns {?string} The actual key name if found, otherwise null. - */ -function findKey(obj, key) { - if (isBuffer(obj)) { - return null; - } - - key = key.toLowerCase(); - const keys = Object.keys(obj); - let i = keys.length; - let _key; - while (i-- > 0) { - _key = keys[i]; - if (key === _key.toLowerCase()) { - return _key; - } - } - return null; -} - -const _global = (() => { - /*eslint no-undef:0*/ - if (typeof globalThis !== 'undefined') return globalThis; - return typeof self !== 'undefined' ? self : typeof window !== 'undefined' ? window : global; -})(); - -const isContextDefined = (context) => !isUndefined(context) && context !== _global; - -/** - * Accepts varargs expecting each argument to be an object, then - * immutably merges the properties of each object and returns result. - * - * When multiple objects contain the same key the later object in - * the arguments list will take precedence. - * - * Example: - * - * ```js - * const result = merge({foo: 123}, {foo: 456}); - * console.log(result.foo); // outputs 456 - * ``` - * - * @param {Object} obj1 Object to merge - * - * @returns {Object} Result of all merge properties - */ -function merge(...objs) { - const { caseless, skipUndefined } = (isContextDefined(this) && this) || {}; - const result = {}; - const assignValue = (val, key) => { - // Skip dangerous property names to prevent prototype pollution - if (key === '__proto__' || key === 'constructor' || key === 'prototype') { - return; - } - - // findKey lowercases the key, so caseless lookup only applies to strings — - // symbol keys are identity-matched. - const targetKey = (caseless && typeof key === 'string' && findKey(result, key)) || key; - // Read via own-prop only — a bare `result[targetKey]` walks the prototype - // chain, so a polluted Object.prototype value could surface here and get - // copied into the merged result. - const existing = hasOwnProperty(result, targetKey) ? result[targetKey] : undefined; - if (isPlainObject(existing) && isPlainObject(val)) { - result[targetKey] = merge(existing, val); - } else if (isPlainObject(val)) { - result[targetKey] = merge({}, val); - } else if (isArray(val)) { - result[targetKey] = val.slice(); - } else if (!skipUndefined || !isUndefined(val)) { - result[targetKey] = val; - } - }; - - for (let i = 0, l = objs.length; i < l; i++) { - const source = objs[i]; - if (!source || isBuffer(source)) { - continue; - } - - forEach(source, assignValue); - - if (typeof source !== 'object' || isArray(source)) { - continue; - } - - const symbols = Object.getOwnPropertySymbols(source); - for (let j = 0; j < symbols.length; j++) { - const symbol = symbols[j]; - if (propertyIsEnumerable.call(source, symbol)) { - assignValue(source[symbol], symbol); - } - } - } - return result; -} - -/** - * Extends object a by mutably adding to it the properties of object b. - * - * @param {Object} a The object to be extended - * @param {Object} b The object to copy properties from - * @param {Object} thisArg The object to bind function to - * - * @param {Object} [options] - * @param {Boolean} [options.allOwnKeys] - * @returns {Object} The resulting value of object a - */ -const extend = (a, b, thisArg, { allOwnKeys } = {}) => { - forEach( - b, - (val, key) => { - if (thisArg && isFunction$1(val)) { - Object.defineProperty(a, key, { - // Null-proto descriptor so a polluted Object.prototype.get cannot - // hijack defineProperty's accessor-vs-data resolution. - __proto__: null, - value: bind(val, thisArg), - writable: true, - enumerable: true, - configurable: true, - }); - } else { - Object.defineProperty(a, key, { - __proto__: null, - value: val, - writable: true, - enumerable: true, - configurable: true, - }); - } - }, - { allOwnKeys } - ); - return a; -}; - -/** - * Remove byte order marker. This catches EF BB BF (the UTF-8 BOM) - * - * @param {string} content with BOM - * - * @returns {string} content value without BOM - */ -const stripBOM = (content) => { - if (content.charCodeAt(0) === 0xfeff) { - content = content.slice(1); - } - return content; -}; - -/** - * Inherit the prototype methods from one constructor into another - * @param {function} constructor - * @param {function} superConstructor - * @param {object} [props] - * @param {object} [descriptors] - * - * @returns {void} - */ -const inherits = (constructor, superConstructor, props, descriptors) => { - constructor.prototype = Object.create(superConstructor.prototype, descriptors); - Object.defineProperty(constructor.prototype, 'constructor', { - __proto__: null, - value: constructor, - writable: true, - enumerable: false, - configurable: true, - }); - Object.defineProperty(constructor, 'super', { - __proto__: null, - value: superConstructor.prototype, - }); - props && Object.assign(constructor.prototype, props); -}; - -/** - * Resolve object with deep prototype chain to a flat object - * @param {Object} sourceObj source object - * @param {Object} [destObj] - * @param {Function|Boolean} [filter] - * @param {Function} [propFilter] - * - * @returns {Object} - */ -const toFlatObject = (sourceObj, destObj, filter, propFilter) => { - let props; - let i; - let prop; - const merged = {}; - - destObj = destObj || {}; - // eslint-disable-next-line no-eq-null,eqeqeq - if (sourceObj == null) return destObj; - - do { - props = Object.getOwnPropertyNames(sourceObj); - i = props.length; - while (i-- > 0) { - prop = props[i]; - if ((!propFilter || propFilter(prop, sourceObj, destObj)) && !merged[prop]) { - destObj[prop] = sourceObj[prop]; - merged[prop] = true; - } - } - sourceObj = filter !== false && getPrototypeOf(sourceObj); - } while (sourceObj && (!filter || filter(sourceObj, destObj)) && sourceObj !== Object.prototype); - - return destObj; -}; - -/** - * Determines whether a string ends with the characters of a specified string - * - * @param {String} str - * @param {String} searchString - * @param {Number} [position= 0] - * - * @returns {boolean} - */ -const endsWith = (str, searchString, position) => { - str = String(str); - if (position === undefined || position > str.length) { - position = str.length; - } - position -= searchString.length; - const lastIndex = str.indexOf(searchString, position); - return lastIndex !== -1 && lastIndex === position; -}; - -/** - * Returns new array from array like object or null if failed - * - * @param {*} [thing] - * - * @returns {?Array} - */ -const toArray = (thing) => { - if (!thing) return null; - if (isArray(thing)) return thing; - let i = thing.length; - if (!isNumber(i)) return null; - const arr = new Array(i); - while (i-- > 0) { - arr[i] = thing[i]; - } - return arr; -}; - -/** - * Checking if the Uint8Array exists and if it does, it returns a function that checks if the - * thing passed in is an instance of Uint8Array - * - * @param {TypedArray} - * - * @returns {Array} - */ -// eslint-disable-next-line func-names -const isTypedArray = ((TypedArray) => { - // eslint-disable-next-line func-names - return (thing) => { - return TypedArray && thing instanceof TypedArray; - }; -})(typeof Uint8Array !== 'undefined' && getPrototypeOf(Uint8Array)); - -/** - * For each entry in the object, call the function with the key and value. - * - * @param {Object} obj - The object to iterate over. - * @param {Function} fn - The function to call for each entry. - * - * @returns {void} - */ -const forEachEntry = (obj, fn) => { - const generator = obj && obj[iterator]; - - const _iterator = generator.call(obj); - - let result; - - while ((result = _iterator.next()) && !result.done) { - const pair = result.value; - fn.call(obj, pair[0], pair[1]); - } -}; - -/** - * It takes a regular expression and a string, and returns an array of all the matches - * - * @param {string} regExp - The regular expression to match against. - * @param {string} str - The string to search. - * - * @returns {Array} - */ -const matchAll = (regExp, str) => { - let matches; - const arr = []; - - while ((matches = regExp.exec(str)) !== null) { - arr.push(matches); - } - - return arr; -}; - -/* Checking if the kindOfTest function returns true when passed an HTMLFormElement. */ -const isHTMLForm = kindOfTest('HTMLFormElement'); - -const toCamelCase = (str) => { - return str.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g, function replacer(m, p1, p2) { - return p1.toUpperCase() + p2; - }); -}; - -const { propertyIsEnumerable } = Object.prototype; - -/** - * Determine if a value is a RegExp object - * - * @param {*} val The value to test - * - * @returns {boolean} True if value is a RegExp object, otherwise false - */ -const isRegExp = kindOfTest('RegExp'); - -const reduceDescriptors = (obj, reducer) => { - const descriptors = Object.getOwnPropertyDescriptors(obj); - const reducedDescriptors = {}; - - forEach(descriptors, (descriptor, name) => { - let ret; - if ((ret = reducer(descriptor, name, obj)) !== false) { - reducedDescriptors[name] = ret || descriptor; - } - }); - - Object.defineProperties(obj, reducedDescriptors); -}; - -/** - * Makes all methods read-only - * @param {Object} obj - */ - -const freezeMethods = (obj) => { - reduceDescriptors(obj, (descriptor, name) => { - // skip restricted props in strict mode - if (isFunction$1(obj) && ['arguments', 'caller', 'callee'].includes(name)) { - return false; - } - - const value = obj[name]; - - if (!isFunction$1(value)) return; - - descriptor.enumerable = false; - - if ('writable' in descriptor) { - descriptor.writable = false; - return; - } - - if (!descriptor.set) { - descriptor.set = () => { - throw Error("Can not rewrite read-only method '" + name + "'"); - }; - } - }); -}; - -/** - * Converts an array or a delimited string into an object set with values as keys and true as values. - * Useful for fast membership checks. - * - * @param {Array|string} arrayOrString - The array or string to convert. - * @param {string} delimiter - The delimiter to use if input is a string. - * @returns {Object} An object with keys from the array or string, values set to true. - */ -const toObjectSet = (arrayOrString, delimiter) => { - const obj = {}; - - const define = (arr) => { - arr.forEach((value) => { - obj[value] = true; - }); - }; - - isArray(arrayOrString) ? define(arrayOrString) : define(String(arrayOrString).split(delimiter)); - - return obj; -}; - -const noop = () => {}; - -const toFiniteNumber = (value, defaultValue) => { - return value != null && Number.isFinite((value = +value)) ? value : defaultValue; -}; - -/** - * If the thing is a FormData object, return true, otherwise return false. - * - * @param {unknown} thing - The thing to check. - * - * @returns {boolean} - */ -function isSpecCompliantForm(thing) { - return !!( - thing && - isFunction$1(thing.append) && - thing[toStringTag] === 'FormData' && - thing[iterator] - ); -} - -/** - * Recursively converts an object to a JSON-compatible object, handling circular references and Buffers. - * - * @param {Object} obj - The object to convert. - * @returns {Object} The JSON-compatible object. - */ -const toJSONObject = (obj) => { - const visited = new WeakSet(); - - const visit = (source) => { - if (isObject(source)) { - if (visited.has(source)) { - return; - } - - //Buffer check - if (isBuffer(source)) { - return source; - } - - if (!('toJSON' in source)) { - // add-on descent / delete-on-ascent: preserves path semantics, so DAG nodes serialise at every occurrence (see #7230). - visited.add(source); - - let target; - - if (isSet(source)) { - target = []; - for (const value of source) { - const reducedValue = visit(value); - !isUndefined(reducedValue) && target.push(reducedValue); - } - } else { - target = isArray(source) ? [] : {}; - - forEach(source, (value, key) => { - const reducedValue = visit(value); - !isUndefined(reducedValue) && (target[key] = reducedValue); - }); - } - - visited.delete(source); - - return target; - } - } - - return source; - }; - - return visit(obj); -}; - -/** - * Determines if a value is an async function. - * - * @param {*} thing - The value to test. - * @returns {boolean} True if value is an async function, otherwise false. - */ -const isAsyncFn = kindOfTest('AsyncFunction'); - -/** - * Determines if a value is thenable (has then and catch methods). - * - * @param {*} thing - The value to test. - * @returns {boolean} True if value is thenable, otherwise false. - */ -const isThenable = (thing) => - thing && - (isObject(thing) || isFunction$1(thing)) && - isFunction$1(thing.then) && - isFunction$1(thing.catch); - -// original code -// https://github.com/DigitalBrainJS/AxiosPromise/blob/16deab13710ec09779922131f3fa5954320f83ab/lib/utils.js#L11-L34 - -/** - * Provides a cross-platform setImmediate implementation. - * Uses native setImmediate if available, otherwise falls back to postMessage or setTimeout. - * - * @param {boolean} setImmediateSupported - Whether setImmediate is supported. - * @param {boolean} postMessageSupported - Whether postMessage is supported. - * @returns {Function} A function to schedule a callback asynchronously. - */ -const _setImmediate = ((setImmediateSupported, postMessageSupported) => { - if (setImmediateSupported) { - return setImmediate; - } - - return postMessageSupported - ? ((token, callbacks) => { - _global.addEventListener( - 'message', - ({ source, data }) => { - if (source === _global && data === token) { - callbacks.length && callbacks.shift()(); - } - }, - false - ); - - return (cb) => { - callbacks.push(cb); - _global.postMessage(token, '*'); - }; - })(`axios@${Math.random()}`, []) - : (cb) => setTimeout(cb); -})(typeof setImmediate === 'function', isFunction$1(_global.postMessage)); - -/** - * Schedules a microtask or asynchronous callback as soon as possible. - * Uses queueMicrotask if available, otherwise falls back to process.nextTick or _setImmediate. - * - * @type {Function} - */ -const asap = - typeof queueMicrotask !== 'undefined' - ? queueMicrotask.bind(_global) - : (typeof process !== 'undefined' && process.nextTick) || _setImmediate; - -// ********************* - -const isIterable = (thing) => thing != null && isFunction$1(thing[iterator]); - -/** - * Determine if a value is iterable via an iterator that is NOT sourced solely - * from a polluted Object.prototype. Use this instead of `isIterable` whenever - * the iterable comes from untrusted input (e.g. user-supplied header sources), - * so `Object.prototype[Symbol.iterator] = ...` cannot turn an ordinary object - * into an attacker-controlled entries iterator. - * - * @param {*} thing The value to test - * - * @returns {boolean} True if value has a non-polluted iterator - */ -const isSafeIterable = (thing) => - thing != null && hasOwnInPrototypeChain(thing, iterator) && isIterable(thing); - -var utils$1 = { - isArray, - isArrayBuffer, - isBuffer, - isFormData, - isArrayBufferView, - isString, - isNumber, - isBoolean, - isObject, - isPlainObject, - isEmptyObject, - isReadableStream, - isRequest, - isResponse, - isHeaders, - isUndefined, - isDate, - isFile, - isReactNativeBlob, - isReactNative, - isBlob, - isRegExp, - isFunction: isFunction$1, - isStream, - isURLSearchParams, - isTypedArray, - isFileList, - forEach, - merge, - extend, - trim, - stripBOM, - inherits, - toFlatObject, - kindOf, - kindOfTest, - endsWith, - toArray, - forEachEntry, - matchAll, - isHTMLForm, - hasOwnProperty, - hasOwnProp: hasOwnProperty, // an alias to avoid ESLint no-prototype-builtins detection - hasOwnInPrototypeChain, - getSafeProp, - reduceDescriptors, - freezeMethods, - toObjectSet, - toCamelCase, - noop, - toFiniteNumber, - findKey, - global: _global, - isContextDefined, - isSpecCompliantForm, - toJSONObject, - isAsyncFn, - isThenable, - setImmediate: _setImmediate, - asap, - isIterable, - isSafeIterable, -}; - -// RawAxiosHeaders whose duplicates are ignored by node -// c.f. https://nodejs.org/api/http.html#http_message_headers -const ignoreDuplicateOf = utils$1.toObjectSet([ - 'age', - 'authorization', - 'content-length', - 'content-type', - 'etag', - 'expires', - 'from', - 'host', - 'if-modified-since', - 'if-unmodified-since', - 'last-modified', - 'location', - 'max-forwards', - 'proxy-authorization', - 'referer', - 'retry-after', - 'user-agent', -]); - -/** - * Parse headers into an object - * - * ``` - * Date: Wed, 27 Aug 2014 08:58:49 GMT - * Content-Type: application/json - * Connection: keep-alive - * Transfer-Encoding: chunked - * ``` - * - * @param {String} rawHeaders Headers needing to be parsed - * - * @returns {Object} Headers parsed into an object - */ -var parseHeaders = (rawHeaders) => { - const parsed = {}; - let key; - let val; - let i; - - rawHeaders && - rawHeaders.split('\n').forEach(function parser(line) { - i = line.indexOf(':'); - key = line.substring(0, i).trim().toLowerCase(); - val = line.substring(i + 1).trim(); - - const hasKey = utils$1.hasOwnProp(parsed, key); - - if (!key || (hasKey && utils$1.hasOwnProp(ignoreDuplicateOf, key))) { - return; - } - - if (key === 'set-cookie') { - if (hasKey) { - parsed[key].push(val); - } else { - parsed[key] = [val]; - } - } else { - parsed[key] = hasKey ? parsed[key] + ', ' + val : val; - } - }); - - return parsed; -}; - -function trimSPorHTAB(str) { - let start = 0; - let end = str.length; - - while (start < end) { - const code = str.charCodeAt(start); - - if (code !== 0x09 && code !== 0x20) { - break; - } - - start += 1; - } - - while (end > start) { - const code = str.charCodeAt(end - 1); - - if (code !== 0x09 && code !== 0x20) { - break; - } - - end -= 1; - } - - return start === 0 && end === str.length ? str : str.slice(start, end); -} - -// The control-code ranges are intentional: header sanitization strips C0/DEL bytes. -// eslint-disable-next-line no-control-regex -const INVALID_UNICODE_HEADER_VALUE_CHARS = new RegExp('[\\u0000-\\u0008\\u000a-\\u001f\\u007f]+', 'g'); -// eslint-disable-next-line no-control-regex -const INVALID_BYTE_STRING_HEADER_VALUE_CHARS = new RegExp('[^\\u0009\\u0020-\\u007e\\u0080-\\u00ff]+', 'g'); - -function sanitizeValue(value, invalidChars) { - if (utils$1.isArray(value)) { - return value.map((item) => sanitizeValue(item, invalidChars)); - } - - return trimSPorHTAB(String(value).replace(invalidChars, '')); -} - -const sanitizeHeaderValue = (value) => - sanitizeValue(value, INVALID_UNICODE_HEADER_VALUE_CHARS); - -const sanitizeByteStringHeaderValue = (value) => - sanitizeValue(value, INVALID_BYTE_STRING_HEADER_VALUE_CHARS); - -function toByteStringHeaderObject(headers) { - const byteStringHeaders = Object.create(null); - - utils$1.forEach(headers.toJSON(), (value, header) => { - byteStringHeaders[header] = sanitizeByteStringHeaderValue(value); - }); - - return byteStringHeaders; -} - -const $internals = Symbol('internals'); - -function normalizeHeader(header) { - return header && String(header).trim().toLowerCase(); -} - -function normalizeValue(value) { - if (value === false || value == null) { - return value; - } - - return utils$1.isArray(value) ? value.map(normalizeValue) : sanitizeHeaderValue(String(value)); -} - -function parseTokens(str) { - const tokens = Object.create(null); - const tokensRE = /([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g; - let match; - - while ((match = tokensRE.exec(str))) { - tokens[match[1]] = match[2]; - } - - return tokens; -} - -const parameterNameRE = /^[!#$%&'*+\-.^_`|~0-9A-Za-z]+$/; - -function trimOWS(value) { - let start = 0; - let end = value.length; - - while (start < end) { - const code = value.charCodeAt(start); - - if (code !== 0x09 && code !== 0x20) { - break; - } - - start += 1; - } - - while (end > start) { - const code = value.charCodeAt(end - 1); - - if (code !== 0x09 && code !== 0x20) { - break; - } - - end -= 1; - } - - return start === 0 && end === value.length ? value : value.slice(start, end); -} - -function decodeQuotedString(value) { - const last = value.length - 1; - - if (last < 1 || value.charCodeAt(0) !== 0x22 || value.charCodeAt(last) !== 0x22) { - return value; - } - - let decoded = ''; - - for (let i = 1; i < last; i++) { - const code = value.charCodeAt(i); - - if (code === 0x22) { - return value; - } - - if (code === 0x5c) { - i += 1; - - if (i >= last) { - return value; - } - } - - decoded += value[i]; - } - - return decoded; -} - -function parseParameters(value) { - const parameters = Object.create(null); - const str = String(value); - let start = 0; - let quoted = false; - let escaped = false; - - function parseParameter(end) { - const part = trimOWS(str.slice(start, end)); - const equals = part.indexOf('='); - - if (equals < 1) { - return; - } - - const name = trimOWS(part.slice(0, equals)); - - if (!parameterNameRE.test(name)) { - return; - } - - const normalizedName = name.toLowerCase(); - - if ( - normalizedName === '__proto__' || - normalizedName === 'constructor' || - normalizedName === 'prototype' - ) { - return; - } - - const parameterValue = trimOWS(part.slice(equals + 1)); - parameters[normalizedName] = decodeQuotedString(parameterValue); - } - - for (let i = 0; i < str.length; i++) { - const code = str.charCodeAt(i); - - if (quoted) { - if (escaped) { - escaped = false; - } else if (code === 0x5c) { - escaped = true; - } else if (code === 0x22) { - quoted = false; - } - } else if (code === 0x22) { - quoted = true; - } else if (code === 0x2c || code === 0x3b) { - parseParameter(i); - start = i + 1; - } - } - - parseParameter(str.length); - - return parameters; -} - -const isValidHeaderName = (str) => /^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(str.trim()); - -function matchHeaderValue(context, value, header, filter, isHeaderNameFilter) { - if (utils$1.isFunction(filter)) { - return filter.call(this, value, header); - } - - if (isHeaderNameFilter) { - value = header; - } - - if (!utils$1.isString(value)) return; - - if (utils$1.isString(filter)) { - return value.indexOf(filter) !== -1; - } - - if (utils$1.isRegExp(filter)) { - return filter.test(value); - } -} - -function formatHeader(header) { - return header - .trim() - .toLowerCase() - .replace(/([a-z\d])(\w*)/g, (w, char, str) => { - return char.toUpperCase() + str; - }); -} - -function buildAccessors(obj, header) { - const accessorName = utils$1.toCamelCase(' ' + header); - - ['get', 'set', 'has'].forEach((methodName) => { - Object.defineProperty(obj, methodName + accessorName, { - // Null-proto descriptor so a polluted Object.prototype.get cannot turn - // this data descriptor into an accessor descriptor on the way in. - __proto__: null, - value: function (arg1, arg2, arg3) { - return this[methodName].call(this, header, arg1, arg2, arg3); - }, - configurable: true, - }); - }); -} - -let AxiosHeaders$1 = class AxiosHeaders { - constructor(headers) { - headers && this.set(headers); - } - - set(header, valueOrRewrite, rewrite) { - const self = this; - - function setHeader(_value, _header, _rewrite) { - const lHeader = normalizeHeader(_header); - - if (!lHeader) { - return; - } - - const key = utils$1.findKey(self, lHeader); - - if ( - !key || - self[key] === undefined || - _rewrite === true || - (_rewrite === undefined && self[key] !== false) - ) { - self[key || _header] = normalizeValue(_value); - } - } - - const setHeaders = (headers, _rewrite) => - utils$1.forEach(headers, (_value, _header) => setHeader(_value, _header, _rewrite)); - - if (utils$1.isPlainObject(header) || header instanceof this.constructor) { - setHeaders(header, valueOrRewrite); - } else if (utils$1.isString(header) && (header = header.trim()) && !isValidHeaderName(header)) { - setHeaders(parseHeaders(header), valueOrRewrite); - } else if (utils$1.isObject(header) && utils$1.isSafeIterable(header)) { - let obj = Object.create(null), - dest, - key; - for (const entry of header) { - if (!utils$1.isArray(entry)) { - throw new TypeError('Object iterator must return a key-value pair'); - } - - key = entry[0]; - - if (utils$1.hasOwnProp(obj, key)) { - dest = obj[key]; - obj[key] = utils$1.isArray(dest) ? [...dest, entry[1]] : [dest, entry[1]]; - } else { - obj[key] = entry[1]; - } - } - - setHeaders(obj, valueOrRewrite); - } else { - header != null && setHeader(valueOrRewrite, header, rewrite); - } - - return this; - } - - get(header, parser) { - header = normalizeHeader(header); - - if (header) { - const key = utils$1.findKey(this, header); - - if (key) { - const value = this[key]; - - if (!parser) { - return value; - } - - if (parser === true) { - return parseTokens(value); - } - - if (utils$1.isFunction(parser)) { - return parser.call(this, value, key); - } - - if (utils$1.isRegExp(parser)) { - return parser.exec(value); - } - - throw new TypeError('parser must be boolean|regexp|function'); - } - } - } - - has(header, matcher) { - header = normalizeHeader(header); - - if (header) { - const key = utils$1.findKey(this, header); - - return !!( - key && - this[key] !== undefined && - (!matcher || matchHeaderValue(this, this[key], key, matcher)) - ); - } - - return false; - } - - delete(header, matcher) { - const self = this; - let deleted = false; - - function deleteHeader(_header) { - _header = normalizeHeader(_header); - - if (_header) { - const key = utils$1.findKey(self, _header); - - if (key && (!matcher || matchHeaderValue(self, self[key], key, matcher))) { - delete self[key]; - - deleted = true; - } - } - } - - if (utils$1.isArray(header)) { - header.forEach(deleteHeader); - } else { - deleteHeader(header); - } - - return deleted; - } - - clear(matcher) { - const keys = Object.keys(this); - let i = keys.length; - let deleted = false; - - while (i--) { - const key = keys[i]; - if (!matcher || matchHeaderValue(this, this[key], key, matcher, true)) { - delete this[key]; - deleted = true; - } - } - - return deleted; - } - - normalize(format) { - const self = this; - const headers = {}; - - utils$1.forEach(this, (value, header) => { - const key = utils$1.findKey(headers, header); - - if (key) { - self[key] = normalizeValue(value); - delete self[header]; - return; - } - - const normalized = format ? formatHeader(header) : String(header).trim(); - - if (normalized !== header) { - delete self[header]; - } - - self[normalized] = normalizeValue(value); - - headers[normalized] = true; - }); - - return this; - } - - concat(...targets) { - return this.constructor.concat(this, ...targets); - } - - toJSON(asStrings) { - const obj = Object.create(null); - - utils$1.forEach(this, (value, header) => { - value != null && - value !== false && - (obj[header] = asStrings && utils$1.isArray(value) ? value.join(', ') : value); - }); - - return obj; - } - - [Symbol.iterator]() { - return Object.entries(this.toJSON())[Symbol.iterator](); - } - - toString() { - return Object.entries(this.toJSON()) - .map(([header, value]) => header + ': ' + value) - .join('\n'); - } - - getSetCookie() { - const value = this.get('set-cookie'); - return utils$1.isArray(value) ? value : value == null || value === false ? [] : [value]; - } - - get [Symbol.toStringTag]() { - return 'AxiosHeaders'; - } - - static from(thing) { - return thing instanceof this ? thing : new this(thing); - } - - static parseParameters(value) { - return parseParameters(value); - } - - static concat(first, ...targets) { - const computed = new this(first); - - targets.forEach((target) => computed.set(target)); - - return computed; - } - - static accessor(header) { - const internals = - (this[$internals] = - this[$internals] = - { - accessors: {}, - }); - - const accessors = internals.accessors; - const prototype = this.prototype; - - function defineAccessor(_header) { - const lHeader = normalizeHeader(_header); - - if (!accessors[lHeader]) { - buildAccessors(prototype, _header); - accessors[lHeader] = true; - } - } - - utils$1.isArray(header) ? header.forEach(defineAccessor) : defineAccessor(header); - - return this; - } -}; - -AxiosHeaders$1.accessor([ - 'Content-Type', - 'Content-Length', - 'Accept', - 'Accept-Encoding', - 'User-Agent', - 'Authorization', -]); - -// reserved names hotfix -utils$1.reduceDescriptors(AxiosHeaders$1.prototype, ({ value }, key) => { - let mapped = key[0].toUpperCase() + key.slice(1); // map `set` => `Set` - return { - get: () => value, - set(headerValue) { - this[mapped] = headerValue; - }, - }; -}); - -utils$1.freezeMethods(AxiosHeaders$1); - -const REDACTED = '[REDACTED ****]'; - -function hasOwnOrPrototypeToJSON(source) { - if (utils$1.hasOwnProp(source, 'toJSON')) { - return true; - } - - let prototype = Object.getPrototypeOf(source); - - while (prototype && prototype !== Object.prototype) { - if (utils$1.hasOwnProp(prototype, 'toJSON')) { - return true; - } - - prototype = Object.getPrototypeOf(prototype); - } - - return false; -} - -// Build a plain-object snapshot of `config` and replace the value of any key -// (case-insensitive) listed in `redactKeys` with REDACTED. Walks through arrays -// and AxiosHeaders, and short-circuits on circular references. -function redactConfig(config, redactKeys) { - const lowerKeys = new Set(redactKeys.map((k) => String(k).toLowerCase())); - const seen = []; - - const visit = (source) => { - if (source === null || typeof source !== 'object') return source; - if (utils$1.isBuffer(source)) return source; - if (seen.indexOf(source) !== -1) return undefined; - - if (source instanceof AxiosHeaders$1) { - source = source.toJSON(); - } - - seen.push(source); - - let result; - if (utils$1.isArray(source)) { - result = []; - source.forEach((v, i) => { - const reducedValue = visit(v); - if (!utils$1.isUndefined(reducedValue)) { - result[i] = reducedValue; - } - }); - } else { - if (!utils$1.isPlainObject(source) && hasOwnOrPrototypeToJSON(source)) { - seen.pop(); - return source; - } - - result = Object.create(null); - for (const [key, value] of Object.entries(source)) { - const reducedValue = lowerKeys.has(key.toLowerCase()) ? REDACTED : visit(value); - if (!utils$1.isUndefined(reducedValue)) { - result[key] = reducedValue; - } - } - } - - seen.pop(); - return result; - }; - - return visit(config); -} - -function stringifySafely$1(value) { - try { - return String(value); - } catch (err) { - return ''; - } -} - -function aggregateErrorMessage(error) { - const message = error.errors - .map((entry) => { - try { - return entry && entry.message ? stringifySafely$1(entry.message) : stringifySafely$1(entry); - } catch (err) { - return ''; - } - }) - .filter(Boolean) - .join('; '); - - return message || error.name || 'AggregateError'; -} - -let AxiosError$1 = class AxiosError extends Error { - static from(error, code, config, request, response, customProps) { - // `AggregateError` (thrown by Node on dual-stack/Happy-Eyeballs connection - // failures) has an empty `message`; its detail lives in `errors[]`. Without - // this, the wrapped error surfaces with a blank message (see #6721). - let message = error.message; - if (!message && utils$1.isArray(error.errors) && error.errors.length) { - message = aggregateErrorMessage(error); - } - - const axiosError = new AxiosError(message, code || error.code, config, request, response); - // Match native `Error` `cause` semantics: non-enumerable. The wrapped - // error often carries circular internals (sockets, requests, agents), so - // an enumerable `cause` makes structured loggers (pino/winston) and any - // own-property walk throw "Converting circular structure to JSON". - // Regression from #6982; see #7205. `__proto__: null` mirrors the - // `message` descriptor below (prototype-pollution-safe descriptor). - Object.defineProperty(axiosError, 'cause', { - __proto__: null, - value: error, - writable: true, - enumerable: false, - configurable: true, - }); - axiosError.name = error.name; - - // Preserve status from the original error if not already set from response - if (error.status != null && axiosError.status == null) { - axiosError.status = error.status; - } - - customProps && Object.assign(axiosError, customProps); - return axiosError; - } - - /** - * Create an Error with the specified message, config, error code, request and response. - * - * @param {string} message The error message. - * @param {string} [code] The error code (for example, 'ECONNABORTED'). - * @param {Object} [config] The config. - * @param {Object} [request] The request. - * @param {Object} [response] The response. - * - * @returns {Error} The created error. - */ - constructor(message, code, config, request, response) { - super(message); - - // Make message enumerable to maintain backward compatibility - // The native Error constructor sets message as non-enumerable, - // but axios < v1.13.3 had it as enumerable - Object.defineProperty(this, 'message', { - // Null-proto descriptor so a polluted Object.prototype.get cannot turn - // this data descriptor into an accessor descriptor on the way in. - __proto__: null, - value: message, - enumerable: true, - writable: true, - configurable: true, - }); - - this.name = 'AxiosError'; - this.isAxiosError = true; - code && (this.code = code); - config && (this.config = config); - request && (this.request = request); - if (response) { - this.response = response; - this.status = response.status; - } - } - - toJSON() { - // Opt-in redaction: when the request config carries a `redact` array, the - // value of any matching key (case-insensitive, at any depth) is replaced - // with REDACTED in the serialized snapshot. Undefined or empty leaves the - // existing serialization behavior unchanged. - const config = this.config; - const redactKeys = config && utils$1.hasOwnProp(config, 'redact') ? config.redact : undefined; - const serializedConfig = - utils$1.isArray(redactKeys) && redactKeys.length > 0 - ? redactConfig(config, redactKeys) - : utils$1.toJSONObject(config); - - return { - // Standard - message: this.message, - name: this.name, - // Microsoft - description: this.description, - number: this.number, - // Mozilla - fileName: this.fileName, - lineNumber: this.lineNumber, - columnNumber: this.columnNumber, - stack: this.stack, - // Axios - config: serializedConfig, - code: this.code, - status: this.status, - }; - } -}; - -// This can be changed to static properties as soon as the parser options in .eslint.cjs are updated. -AxiosError$1.ERR_BAD_OPTION_VALUE = 'ERR_BAD_OPTION_VALUE'; -AxiosError$1.ERR_BAD_OPTION = 'ERR_BAD_OPTION'; -AxiosError$1.ECONNABORTED = 'ECONNABORTED'; -AxiosError$1.ETIMEDOUT = 'ETIMEDOUT'; -AxiosError$1.ECONNREFUSED = 'ECONNREFUSED'; -AxiosError$1.ERR_NETWORK = 'ERR_NETWORK'; -AxiosError$1.ERR_FR_TOO_MANY_REDIRECTS = 'ERR_FR_TOO_MANY_REDIRECTS'; -AxiosError$1.ERR_DEPRECATED = 'ERR_DEPRECATED'; -AxiosError$1.ERR_BAD_RESPONSE = 'ERR_BAD_RESPONSE'; -AxiosError$1.ERR_BAD_REQUEST = 'ERR_BAD_REQUEST'; -AxiosError$1.ERR_CANCELED = 'ERR_CANCELED'; -AxiosError$1.ERR_NOT_SUPPORT = 'ERR_NOT_SUPPORT'; -AxiosError$1.ERR_INVALID_URL = 'ERR_INVALID_URL'; -AxiosError$1.ERR_FORM_DATA_DEPTH_EXCEEDED = 'ERR_FORM_DATA_DEPTH_EXCEEDED'; - -// eslint-disable-next-line strict -var httpAdapter = null; - -// Default nesting limit shared with the inverse transform (formDataToJSON) so -// the FormData <-> JSON round-trip stays symmetric. -const DEFAULT_FORM_DATA_MAX_DEPTH = 100; - -/** - * Determines if the given thing is a array or js object. - * - * @param {string} thing - The object or array to be visited. - * - * @returns {boolean} - */ -function isVisitable(thing) { - return utils$1.isPlainObject(thing) || utils$1.isArray(thing); -} - -/** - * It removes the brackets from the end of a string - * - * @param {string} key - The key of the parameter. - * - * @returns {string} the key without the brackets. - */ -function removeBrackets(key) { - return utils$1.endsWith(key, '[]') ? key.slice(0, -2) : key; -} - -/** - * It takes a path, a key, and a boolean, and returns a string - * - * @param {string} path - The path to the current key. - * @param {string} key - The key of the current object being iterated over. - * @param {string} dots - If true, the key will be rendered with dots instead of brackets. - * - * @returns {string} The path to the current key. - */ -function renderKey(path, key, dots) { - if (!path) return key; - return path - .concat(key) - .map(function each(token, i) { - // eslint-disable-next-line no-param-reassign - token = removeBrackets(token); - return !dots && i ? '[' + token + ']' : token; - }) - .join(dots ? '.' : ''); -} - -/** - * If the array is an array and none of its elements are visitable, then it's a flat array. - * - * @param {Array} arr - The array to check - * - * @returns {boolean} - */ -function isFlatArray(arr) { - return utils$1.isArray(arr) && !arr.some(isVisitable); -} - -const predicates = utils$1.toFlatObject(utils$1, {}, null, function filter(prop) { - return /^is[A-Z]/.test(prop); -}); - -/** - * Convert a data object to FormData - * - * @param {Object} obj - * @param {?Object} [formData] - * @param {?Object} [options] - * @param {Function} [options.visitor] - * @param {Boolean} [options.metaTokens = true] - * @param {Boolean} [options.dots = false] - * @param {?Boolean} [options.indexes = false] - * - * @returns {Object} - **/ - -/** - * It converts an object into a FormData object - * - * @param {Object} obj - The object to convert to form data. - * @param {string} formData - The FormData object to append to. - * @param {Object} options - * - * @returns - */ -function toFormData$1(obj, formData, options) { - if (!utils$1.isObject(obj)) { - throw new TypeError('target must be an object'); - } - - // eslint-disable-next-line no-param-reassign - formData = formData || new (FormData)(); - - // eslint-disable-next-line no-param-reassign - options = utils$1.toFlatObject( - options, - { - metaTokens: true, - dots: false, - indexes: false, - }, - false, - function defined(option, source) { - // eslint-disable-next-line no-eq-null,eqeqeq - return !utils$1.isUndefined(source[option]); - } - ); - - const metaTokens = options.metaTokens; - // eslint-disable-next-line no-use-before-define - const visitor = options.visitor || defaultVisitor; - const dots = options.dots; - const indexes = options.indexes; - const _Blob = options.Blob || (typeof Blob !== 'undefined' && Blob); - const maxDepth = options.maxDepth === undefined ? DEFAULT_FORM_DATA_MAX_DEPTH : options.maxDepth; - const useBlob = _Blob && utils$1.isSpecCompliantForm(formData); - const stack = []; - - if (!utils$1.isFunction(visitor)) { - throw new TypeError('visitor must be a function'); - } - - function convertValue(value) { - if (value === null) return ''; - - if (utils$1.isDate(value)) { - return value.toISOString(); - } - - if (utils$1.isBoolean(value)) { - return value.toString(); - } - - if (!useBlob && utils$1.isBlob(value)) { - throw new AxiosError$1('Blob is not supported. Use a Buffer instead.'); - } - - if (utils$1.isArrayBuffer(value) || utils$1.isTypedArray(value)) { - if (useBlob && typeof _Blob === 'function') { - return new _Blob([value]); - } - throw new AxiosError$1('Blob is not supported. Use a Buffer instead.', AxiosError$1.ERR_NOT_SUPPORT); - } - - return value; - } - - function throwIfMaxDepthExceeded(depth) { - if (depth > maxDepth) { - throw new AxiosError$1( - 'Object is too deeply nested (' + depth + ' levels). Max depth: ' + maxDepth, - AxiosError$1.ERR_FORM_DATA_DEPTH_EXCEEDED - ); - } - } - - function stringifyWithDepthLimit(value, depth) { - if (maxDepth === Infinity) { - return JSON.stringify(value); - } - - const ancestors = []; - - return JSON.stringify(value, function limitDepth(_key, currentValue) { - if (!utils$1.isObject(currentValue)) { - return currentValue; - } - - while (ancestors.length && ancestors[ancestors.length - 1] !== this) { - ancestors.pop(); - } - - ancestors.push(currentValue); - throwIfMaxDepthExceeded(depth + ancestors.length - 1); - - return currentValue; - }); - } - - /** - * Default visitor. - * - * @param {*} value - * @param {String|Number} key - * @param {Array} path - * @this {FormData} - * - * @returns {boolean} return true to visit the each prop of the value recursively - */ - function defaultVisitor(value, key, path) { - let arr = value; - - if (utils$1.isReactNative(formData) && utils$1.isReactNativeBlob(value)) { - formData.append(renderKey(path, key, dots), convertValue(value)); - return false; - } - - if (value && !path && typeof value === 'object') { - if (utils$1.endsWith(key, '{}')) { - // eslint-disable-next-line no-param-reassign - key = metaTokens ? key : key.slice(0, -2); - // eslint-disable-next-line no-param-reassign - value = stringifyWithDepthLimit(value, 1); - } else if ( - (utils$1.isArray(value) && isFlatArray(value)) || - ((utils$1.isFileList(value) || utils$1.endsWith(key, '[]')) && (arr = utils$1.toArray(value))) - ) { - // eslint-disable-next-line no-param-reassign - key = removeBrackets(key); - - arr.forEach(function each(el, index) { - !(utils$1.isUndefined(el) || el === null) && - formData.append( - // eslint-disable-next-line no-nested-ternary - indexes === true - ? renderKey([key], index, dots) - : indexes === null - ? key - : key + '[]', - convertValue(el) - ); - }); - return false; - } - } - - if (isVisitable(value)) { - return true; - } - - formData.append(renderKey(path, key, dots), convertValue(value)); - - return false; - } - - const exposedHelpers = Object.assign(predicates, { - defaultVisitor, - convertValue, - isVisitable, - }); - - function build(value, path, depth = 0) { - if (utils$1.isUndefined(value)) return; - - throwIfMaxDepthExceeded(depth); - - if (stack.indexOf(value) !== -1) { - throw new Error('Circular reference detected in ' + path.join('.')); - } - - stack.push(value); - - utils$1.forEach(value, function each(el, key) { - const result = - !(utils$1.isUndefined(el) || el === null) && - visitor.call(formData, el, utils$1.isString(key) ? key.trim() : key, path, exposedHelpers); - - if (result === true) { - build(el, path ? path.concat(key) : [key], depth + 1); - } - }); - - stack.pop(); - } - - if (!utils$1.isObject(obj)) { - throw new TypeError('data must be an object'); - } - - build(obj); - - return formData; -} - -/** - * It encodes a string by replacing all characters that are not in the unreserved set with - * their percent-encoded equivalents - * - * @param {string} str - The string to encode. - * - * @returns {string} The encoded string. - */ -function encode$1(str) { - const charMap = { - '!': '%21', - "'": '%27', - '(': '%28', - ')': '%29', - '~': '%7E', - '%20': '+', - }; - return encodeURIComponent(str).replace(/[!'()~]|%20/g, function replacer(match) { - return charMap[match]; - }); -} - -/** - * It takes a params object and converts it to a FormData object - * - * @param {Object} params - The parameters to be converted to a FormData object. - * @param {Object} options - The options object passed to the Axios constructor. - * - * @returns {void} - */ -function AxiosURLSearchParams(params, options) { - this._pairs = []; - - params && toFormData$1(params, this, options); -} - -const prototype = AxiosURLSearchParams.prototype; - -prototype.append = function append(name, value) { - this._pairs.push([name, value]); -}; - -prototype.toString = function toString(encoder) { - const _encode = encoder - ? (value) => encoder.call(this, value, encode$1) - : encode$1; - - return this._pairs - .map(function each(pair) { - return _encode(pair[0]) + '=' + _encode(pair[1]); - }, '') - .join('&'); -}; - -/** - * It replaces URL-encoded forms of `:`, `$`, `,`, and spaces with - * their plain counterparts (`:`, `$`, `,`, `+`). - * - * @param {string} val The value to be encoded. - * - * @returns {string} The encoded value. - */ -function encode(val) { - return encodeURIComponent(val) - .replace(/%3A/gi, ':') - .replace(/%24/g, '$') - .replace(/%2C/gi, ',') - .replace(/%20/g, '+'); -} - -/** - * Build a URL by appending params to the end - * - * @param {string} url The base of the url (e.g., http://www.google.com) - * @param {object} [params] The params to be appended - * @param {?(object|Function)} options - * - * @returns {string} The formatted url - */ -function buildURL(url, params, options) { - if (!params) { - return url; - } - url = url || ''; - - const _options = utils$1.isFunction(options) - ? { - serialize: options, - } - : options; - - // Read serializer options pollution-safely: own properties and methods on a - // class/template prototype are honored, but values injected onto a polluted - // Object.prototype are ignored. - const _encode = utils$1.getSafeProp(_options, 'encode') || encode; - const serializeFn = utils$1.getSafeProp(_options, 'serialize'); - - let serializedParams; - - if (serializeFn) { - serializedParams = serializeFn(params, _options); - } else { - serializedParams = utils$1.isURLSearchParams(params) - ? params.toString() - : new AxiosURLSearchParams(params, _options).toString(_encode); - } - - if (serializedParams) { - const hashmarkIndex = url.indexOf('#'); - - if (hashmarkIndex !== -1) { - url = url.slice(0, hashmarkIndex); - } - url += (url.indexOf('?') === -1 ? '?' : '&') + serializedParams; - } - - return url; -} - -class InterceptorManager { - constructor() { - this.handlers = []; - } - - /** - * Add a new interceptor to the stack - * - * @param {Function} fulfilled The function to handle `then` for a `Promise` - * @param {Function} rejected The function to handle `reject` for a `Promise` - * @param {Object} options The options for the interceptor, synchronous and runWhen - * - * @return {Number} An ID used to remove interceptor later - */ - use(fulfilled, rejected, options) { - this.handlers.push({ - fulfilled, - rejected, - synchronous: options ? options.synchronous : false, - runWhen: options ? options.runWhen : null, - }); - return this.handlers.length - 1; - } - - /** - * Remove an interceptor from the stack - * - * @param {Number} id The ID that was returned by `use` - * - * @returns {void} - */ - eject(id) { - if (this.handlers[id]) { - this.handlers[id] = null; - } - } - - /** - * Clear all interceptors from the stack - * - * @returns {void} - */ - clear() { - if (this.handlers) { - this.handlers = []; - } - } - - /** - * Iterate over all the registered interceptors - * - * This method is particularly useful for skipping over any - * interceptors that may have become `null` calling `eject`. - * - * @param {Function} fn The function to call for each interceptor - * - * @returns {void} - */ - forEach(fn) { - utils$1.forEach(this.handlers, function forEachHandler(h) { - if (h !== null) { - fn(h); - } - }); - } -} - -var transitionalDefaults = { - silentJSONParsing: true, - forcedJSONParsing: true, - clarifyTimeoutError: false, - legacyInterceptorReqResOrdering: true, - advertiseZstdAcceptEncoding: false, - validateStatusUndefinedResolves: true, -}; - -var URLSearchParams$1 = typeof URLSearchParams !== 'undefined' ? URLSearchParams : AxiosURLSearchParams; - -var FormData$1 = typeof FormData !== 'undefined' ? FormData : null; - -var Blob$1 = typeof Blob !== 'undefined' ? Blob : null; - -var platform$1 = { - isBrowser: true, - classes: { - URLSearchParams: URLSearchParams$1, - FormData: FormData$1, - Blob: Blob$1, - }, - protocols: ['http', 'https', 'file', 'blob', 'url', 'data'], -}; - -const hasBrowserEnv = typeof window !== 'undefined' && typeof document !== 'undefined'; - -const _navigator = (typeof navigator === 'object' && navigator) || undefined; - -/** - * Determine if we're running in a standard browser environment - * - * This allows axios to run in a web worker, and react-native. - * Both environments support XMLHttpRequest, but not fully standard globals. - * - * web workers: - * typeof window -> undefined - * typeof document -> undefined - * - * react-native: - * navigator.product -> 'ReactNative' - * nativescript - * navigator.product -> 'NativeScript' or 'NS' - * - * @returns {boolean} - */ -const hasStandardBrowserEnv = - hasBrowserEnv && - (!_navigator || ['ReactNative', 'NativeScript', 'NS'].indexOf(_navigator.product) < 0); - -/** - * Determine if we're running in a standard browser webWorker environment - * - * Although the `isStandardBrowserEnv` method indicates that - * `allows axios to run in a web worker`, the WebWorker will still be - * filtered out due to its judgment standard - * `typeof window !== 'undefined' && typeof document !== 'undefined'`. - * This leads to a problem when axios post `FormData` in webWorker - */ -const hasStandardBrowserWebWorkerEnv = (() => { - return ( - typeof WorkerGlobalScope !== 'undefined' && - // eslint-disable-next-line no-undef - self instanceof WorkerGlobalScope && - typeof self.importScripts === 'function' - ); -})(); - -const origin = (hasBrowserEnv && window.location.href) || 'http://localhost'; - -var utils = /*#__PURE__*/Object.freeze({ - __proto__: null, - hasBrowserEnv: hasBrowserEnv, - hasStandardBrowserEnv: hasStandardBrowserEnv, - hasStandardBrowserWebWorkerEnv: hasStandardBrowserWebWorkerEnv, - navigator: _navigator, - origin: origin -}); - -var platform = { - ...utils, - ...platform$1, -}; - -function toURLEncodedForm(data, options) { - return toFormData$1(data, new platform.classes.URLSearchParams(), { - visitor: function (value, key, path, helpers) { - if (platform.isNode && utils$1.isBuffer(value)) { - this.append(key, value.toString('base64')); - return false; - } - - return helpers.defaultVisitor.apply(this, arguments); - }, - ...options, - }); -} - -const MAX_DEPTH = DEFAULT_FORM_DATA_MAX_DEPTH; - -function throwIfDepthExceeded(index) { - if (index > MAX_DEPTH) { - throw new AxiosError$1( - 'FormData field is too deeply nested (' + index + ' levels). Max depth: ' + MAX_DEPTH, - AxiosError$1.ERR_FORM_DATA_DEPTH_EXCEEDED - ); - } -} - -/** - * It takes a string like `foo[x][y][z]` and returns an array like `['foo', 'x', 'y', 'z'] - * - * @param {string} name - The name of the property to get. - * - * @returns An array of strings. - */ -function parsePropPath(name) { - // foo[x][y][z] -> ['foo', 'x', 'y', 'z'] - // foo.x.y.z -> ['foo', 'x', 'y', 'z'] - // A path is split on `.` and on `[...]` groups. A segment — whether written - // in dot notation or captured inside brackets — may contain any character - // except `.`, `[` and `]`, so a key like `user-name` or `user name` is kept - // literal instead of being split (#5402). `.`, `[` and `]` keep their existing - // meaning, e.g. `foo[bar.baz]` -> ['foo', 'bar', 'baz'] and `[]` is an array push. - // Excluding `[` from the bracket group also makes the match fail fast at the - // next `[`, so a malformed name cannot rescan to the end of the string from - // every unmatched `[` — parsing stays linear in the length of the name. - const path = []; - const pattern = /[^.[\]]+|\[([^.[\]]*)]/g; - let match; - - while ((match = pattern.exec(name)) !== null) { - throwIfDepthExceeded(path.length); - path.push(match[0] === '[]' ? '' : match[1] || match[0]); - } - - return path; -} - -/** - * Convert an array to an object. - * - * @param {Array} arr - The array to convert to an object. - * - * @returns An object with the same keys and values as the array. - */ -function arrayToObject(arr) { - const obj = {}; - const keys = Object.keys(arr); - let i; - const len = keys.length; - let key; - for (i = 0; i < len; i++) { - key = keys[i]; - obj[key] = arr[key]; - } - return obj; -} - -/** - * It takes a FormData object and returns a JavaScript object - * - * @param {string} formData The FormData object to convert to JSON. - * - * @returns {Object | null} The converted object. - */ -function formDataToJSON(formData) { - function buildPath(path, value, target, index) { - throwIfDepthExceeded(index); - - let name = path[index++]; - - if (name === '__proto__') return true; - - const isNumericKey = Number.isFinite(+name); - const isLast = index >= path.length; - name = !name && utils$1.isArray(target) ? target.length : name; - - if (isLast) { - if (utils$1.hasOwnProp(target, name)) { - target[name] = utils$1.isArray(target[name]) - ? target[name].concat(value) - : [target[name], value]; - } else { - target[name] = value; - } - - return !isNumericKey; - } - - if (!utils$1.hasOwnProp(target, name) || !utils$1.isObject(target[name])) { - target[name] = []; - } - - const result = buildPath(path, value, target[name], index); - - if (result && utils$1.isArray(target[name])) { - target[name] = arrayToObject(target[name]); - } - - return !isNumericKey; - } - - if (utils$1.isFormData(formData) && utils$1.isFunction(formData.entries)) { - const obj = {}; - - utils$1.forEachEntry(formData, (name, value) => { - buildPath(parsePropPath(name), value, obj, 0); - }); - - return obj; - } - - return null; -} - -const own = (obj, key) => (obj != null && utils$1.hasOwnProp(obj, key) ? obj[key] : undefined); - -/** - * It takes a string, tries to parse it, and if it fails, it returns the stringified version - * of the input - * - * @param {any} rawValue - The value to be stringified. - * @param {Function} parser - A function that parses a string into a JavaScript object. - * @param {Function} encoder - A function that takes a value and returns a string. - * - * @returns {string} A stringified version of the rawValue. - */ -function stringifySafely(rawValue, parser, encoder) { - if (utils$1.isString(rawValue)) { - try { - (parser || JSON.parse)(rawValue); - return utils$1.trim(rawValue); - } catch (e) { - if (e.name !== 'SyntaxError') { - throw e; - } - } - } - - return (encoder || JSON.stringify)(rawValue); -} - -const defaults = { - transitional: transitionalDefaults, - - adapter: ['xhr', 'http', 'fetch'], - - transformRequest: [ - function transformRequest(data, headers) { - const contentType = headers.getContentType() || ''; - const hasJSONContentType = contentType.indexOf('application/json') > -1; - const isObjectPayload = utils$1.isObject(data); - - if (isObjectPayload && utils$1.isHTMLForm(data)) { - data = new FormData(data); - } - - const isFormData = utils$1.isFormData(data); - - if (isFormData) { - return hasJSONContentType ? JSON.stringify(formDataToJSON(data)) : data; - } - - if ( - utils$1.isArrayBuffer(data) || - utils$1.isBuffer(data) || - utils$1.isStream(data) || - utils$1.isFile(data) || - utils$1.isBlob(data) || - utils$1.isReadableStream(data) - ) { - return data; - } - if (utils$1.isArrayBufferView(data)) { - return data.buffer; - } - if (utils$1.isURLSearchParams(data)) { - headers.setContentType('application/x-www-form-urlencoded;charset=utf-8', false); - return data.toString(); - } - - let isFileList; - - if (isObjectPayload) { - const formSerializer = own(this, 'formSerializer'); - if (contentType.indexOf('application/x-www-form-urlencoded') > -1) { - return toURLEncodedForm(data, formSerializer).toString(); - } - - if ( - (isFileList = utils$1.isFileList(data)) || - contentType.indexOf('multipart/form-data') > -1 - ) { - const env = own(this, 'env'); - const _FormData = env && env.FormData; - - return toFormData$1( - isFileList ? { 'files[]': data } : data, - _FormData && new _FormData(), - formSerializer - ); - } - } - - if (isObjectPayload || hasJSONContentType) { - headers.setContentType('application/json', false); - return stringifySafely(data); - } - - return data; - }, - ], - - transformResponse: [ - function transformResponse(data) { - const transitional = own(this, 'transitional') || defaults.transitional; - const forcedJSONParsing = transitional && transitional.forcedJSONParsing; - const responseType = own(this, 'responseType'); - const JSONRequested = responseType === 'json'; - - if (utils$1.isResponse(data) || utils$1.isReadableStream(data)) { - return data; - } - - if ( - data && - utils$1.isString(data) && - ((forcedJSONParsing && !responseType) || JSONRequested) - ) { - const silentJSONParsing = transitional && transitional.silentJSONParsing; - const strictJSONParsing = !silentJSONParsing && JSONRequested; - - try { - return JSON.parse(data, own(this, 'parseReviver')); - } catch (e) { - if (strictJSONParsing) { - if (e.name === 'SyntaxError') { - throw AxiosError$1.from(e, AxiosError$1.ERR_BAD_RESPONSE, this, null, own(this, 'response')); - } - throw e; - } - } - } - - return data; - }, - ], - - /** - * A timeout in milliseconds to abort a request. If set to 0 (default) a - * timeout is not created. - */ - timeout: 0, - - xsrfCookieName: 'XSRF-TOKEN', - xsrfHeaderName: 'X-XSRF-TOKEN', - - maxContentLength: -1, - maxBodyLength: -1, - - env: { - FormData: platform.classes.FormData, - Blob: platform.classes.Blob, - }, - - validateStatus: function validateStatus(status) { - return status >= 200 && status < 300; - }, - - headers: { - common: { - Accept: 'application/json, text/plain, */*', - 'Content-Type': undefined, - }, - }, -}; - -utils$1.forEach(['delete', 'get', 'head', 'post', 'put', 'patch', 'query'], (method) => { - defaults.headers[method] = {}; -}); - -/** - * Transform the data for a request or a response - * - * @param {Array|Function} fns A single function or Array of functions - * @param {?Object} response The response object - * - * @returns {*} The resulting transformed data - */ -function transformData(fns, response) { - const config = this || defaults; - const context = response || config; - const headers = AxiosHeaders$1.from(context.headers); - let data = context.data; - - utils$1.forEach(fns, function transform(fn) { - data = fn.call(config, data, headers.normalize(), response ? response.status : undefined); - }); - - headers.normalize(); - - return data; -} - -function isCancel$1(value) { - return !!(value && value.__CANCEL__); -} - -let CanceledError$1 = class CanceledError extends AxiosError$1 { - /** - * A `CanceledError` is an object that is thrown when an operation is canceled. - * - * @param {string=} message The message. - * @param {Object=} config The config. - * @param {Object=} request The request. - * - * @returns {CanceledError} The created error. - */ - constructor(message, config, request) { - super(message == null ? 'canceled' : message, AxiosError$1.ERR_CANCELED, config, request); - this.name = 'CanceledError'; - this.__CANCEL__ = true; - } -}; - -/** - * Resolve or reject a Promise based on response status. - * - * @param {Function} resolve A function that resolves the promise. - * @param {Function} reject A function that rejects the promise. - * @param {object} response The response. - * - * @returns {object} The response. - */ -function settle(resolve, reject, response) { - const validateStatus = response.config.validateStatus; - if (!response.status || !validateStatus || validateStatus(response.status)) { - resolve(response); - } else { - reject(new AxiosError$1( - 'Request failed with status code ' + response.status, - response.status >= 400 && response.status < 500 ? AxiosError$1.ERR_BAD_REQUEST : AxiosError$1.ERR_BAD_RESPONSE, - response.config, - response.request, - response - )); - } -} - -function parseProtocol(url) { - const match = /^([-+\w]{1,25}):(?:\/\/)?/.exec(url); - return (match && match[1]) || ''; -} - -/** - * Calculate data maxRate - * @param {Number} [samplesCount= 10] - * @param {Number} [min= 1000] - * @returns {Function} - */ -function speedometer(samplesCount, min) { - samplesCount = samplesCount || 10; - const bytes = new Array(samplesCount); - const timestamps = new Array(samplesCount); - let head = 0; - let tail = 0; - let firstSampleTS; - - min = min !== undefined ? min : 1000; - - return function push(chunkLength) { - const now = Date.now(); - - const startedAt = timestamps[tail]; - - if (!firstSampleTS) { - firstSampleTS = now; - } - - bytes[head] = chunkLength; - timestamps[head] = now; - - let i = tail; - let bytesCount = 0; - - while (i !== head) { - bytesCount += bytes[i++]; - i = i % samplesCount; - } - - head = (head + 1) % samplesCount; - - if (head === tail) { - tail = (tail + 1) % samplesCount; - } - - if (now - firstSampleTS < min) { - return; - } - - const passed = startedAt && now - startedAt; - - return passed ? Math.round((bytesCount * 1000) / passed) : undefined; - }; -} - -/** - * Throttle decorator - * @param {Function} fn - * @param {Number} freq - * @return {Function} - */ -function throttle(fn, freq) { - let timestamp = 0; - let threshold = 1000 / freq; - let lastArgs; - let timer; - - const invoke = (args, now = Date.now()) => { - timestamp = now; - lastArgs = null; - if (timer) { - clearTimeout(timer); - timer = null; - } - fn(...args); - }; - - const throttled = (...args) => { - const now = Date.now(); - const passed = now - timestamp; - if (passed >= threshold) { - invoke(args, now); - } else { - lastArgs = args; - if (!timer) { - timer = setTimeout(() => { - timer = null; - invoke(lastArgs); - }, threshold - passed); - } - } - }; - - const flush = () => lastArgs && invoke(lastArgs); - - return [throttled, flush]; -} - -const progressEventReducer = (listener, isDownloadStream, freq = 3) => { - let bytesNotified = 0; - const _speedometer = speedometer(50, 250); - - return throttle((e) => { - if (!e || typeof e.loaded !== 'number') { - return; - } - const rawLoaded = e.loaded; - const total = e.lengthComputable ? e.total : undefined; - const loaded = Math.max(0, total != null ? Math.min(rawLoaded, total) : rawLoaded); - const progressBytes = Math.max(0, loaded - bytesNotified); - const rate = _speedometer(progressBytes); - - bytesNotified = Math.max(bytesNotified, loaded); - - const data = { - loaded, - total, - progress: total ? loaded / total : undefined, - bytes: progressBytes, - rate: rate ? rate : undefined, - estimated: rate && total ? (total - loaded) / rate : undefined, - event: e, - lengthComputable: total != null, - [isDownloadStream ? 'download' : 'upload']: true, - }; - - listener(data); - }, freq); -}; - -const progressEventDecorator = (total, throttled) => { - const lengthComputable = total != null; - - return [ - (loaded) => - throttled[0]({ - lengthComputable, - total, - loaded, - }), - throttled[1], - ]; -}; - -const asyncDecorator = - (fn, scheduler = utils$1.asap) => - (...args) => - scheduler(() => fn(...args)); - -var isURLSameOrigin = platform.hasStandardBrowserEnv - ? ((origin, isMSIE) => (url) => { - url = new URL(url, platform.origin); - - return ( - origin.protocol === url.protocol && - origin.host === url.host && - (isMSIE || origin.port === url.port) - ); - })( - new URL(platform.origin), - platform.navigator && /(msie|trident)/i.test(platform.navigator.userAgent) - ) - : () => true; - -var cookies = platform.hasStandardBrowserEnv - ? // Standard browser envs support document.cookie - { - write(name, value, expires, path, domain, secure, sameSite) { - if (typeof document === 'undefined') return; - - const cookie = [`${name}=${encodeURIComponent(value)}`]; - - if (utils$1.isNumber(expires)) { - cookie.push(`expires=${new Date(expires).toUTCString()}`); - } - if (utils$1.isString(path)) { - cookie.push(`path=${path}`); - } - if (utils$1.isString(domain)) { - cookie.push(`domain=${domain}`); - } - if (secure === true) { - cookie.push('secure'); - } - if (utils$1.isString(sameSite)) { - cookie.push(`SameSite=${sameSite}`); - } - - document.cookie = cookie.join('; '); - }, - - read(name) { - if (typeof document === 'undefined') return null; - // Match name=value by splitting on the semicolon separator instead of building a - // RegExp from `name` — interpolating an unescaped string into a RegExp would let - // metacharacters (e.g. `.+?` in an attacker-influenced cookie name) cause ReDoS or - // match the wrong cookie. Browsers may serialize cookie pairs as either ";" or - // "; ", so ignore optional whitespace before each cookie name. - const cookies = document.cookie.split(';'); - for (let i = 0; i < cookies.length; i++) { - const cookie = cookies[i].replace(/^\s+/, ''); - const eq = cookie.indexOf('='); - if (eq !== -1 && cookie.slice(0, eq) === name) { - try { - return decodeURIComponent(cookie.slice(eq + 1)); - } catch (e) { - return cookie.slice(eq + 1); - } - } - } - return null; - }, - - remove(name) { - this.write(name, '', Date.now() - 86400000, '/'); - }, - } - : // Non-standard browser env (web workers, react-native) lack needed support. - { - write() {}, - read() { - return null; - }, - remove() {}, - }; - -/** - * Determines whether the specified URL is absolute - * - * @param {string} url The URL to test - * - * @returns {boolean} True if the specified URL is absolute, otherwise false - */ -function isAbsoluteURL(url) { - // A URL is considered absolute if it begins with "://" or "//" (protocol-relative URL). - // RFC 3986 defines scheme name as a sequence of characters beginning with a letter and followed - // by any combination of letters, digits, plus, period, or hyphen. - if (typeof url !== 'string') { - return false; - } - - return /^([a-z][a-z\d+\-.]*:)?\/\//i.test(url); -} - -/** - * Creates a new URL by combining the specified URLs - * - * @param {string} baseURL The base URL - * @param {string} relativeURL The relative URL - * - * @returns {string} The combined URL - */ -function combineURLs(baseURL, relativeURL) { - if (!relativeURL) { - return baseURL; - } - - let end = baseURL.length; - - while (end > 0 && baseURL.charCodeAt(end - 1) === 47) { - end--; - } - - return baseURL.slice(0, end) + '/' + relativeURL.replace(/^\/+/, ''); -} - -const malformedHttpProtocol = /^https?:(?!\/\/)/i; -const httpProtocolControlCharacters = /[\t\n\r]/g; - -function stripLeadingC0ControlOrSpace(url) { - let i = 0; - while (i < url.length && url.charCodeAt(i) <= 0x20) { - i++; - } - return url.slice(i); -} - -function normalizeURLForProtocolCheck(url) { - return stripLeadingC0ControlOrSpace(url).replace(httpProtocolControlCharacters, ''); -} - -// Redact the parts of a URL that can carry secrets before it is embedded in an -// error message. AxiosError.toJSON() serializes `message` verbatim and errors -// are commonly logged, while the opt-in `config.redact` model only cleans -// config keys — it cannot reach the message. Redact only the genuinely -// sensitive substrings — userinfo (credentials), query parameter values and -// fragment contents — with the same REDACTED marker the config redaction uses, -// while keeping the scheme, host, path and parameter names so the offending -// request stays accurately identifiable. -function redactFragment(fragment) { - if (!fragment) { - return fragment; - } - - return fragment.replace(/(^|&)([^=&]*=)?[^&]+/g, (match, separator, parameterName = '') => { - return `${separator}${parameterName}${REDACTED}`; - }); -} - -function redactSensitiveURLParts(url) { - const redactedURL = url.replace(/^(https?:\/{0,2})[^/?#]*@/i, `$1${REDACTED}@`); - const fragmentIndex = redactedURL.indexOf('#'); - const urlWithoutFragment = - fragmentIndex === -1 ? redactedURL : redactedURL.slice(0, fragmentIndex); - const redactedURLWithoutFragment = urlWithoutFragment.replace( - /([?&][^=&#]*=)[^&#]*/g, - `$1${REDACTED}` - ); - - if (fragmentIndex === -1) { - return redactedURLWithoutFragment; - } - - return `${redactedURLWithoutFragment}#${redactFragment(redactedURL.slice(fragmentIndex + 1))}`; -} - -function assertValidHttpProtocolURL(url, config) { - if (typeof url === 'string') { - const normalizedURL = normalizeURLForProtocolCheck(url); - if (malformedHttpProtocol.test(normalizedURL)) { - throw new AxiosError$1( - `Invalid URL ${JSON.stringify(redactSensitiveURLParts(normalizedURL))}: missing "//" after protocol`, - AxiosError$1.ERR_INVALID_URL, - config - ); - } - } -} - -/** - * Creates a new URL by combining the baseURL with the requestedURL, - * only when the requestedURL is not already an absolute URL. - * If the requestURL is absolute, this function returns the requestedURL untouched. - * - * @param {string} baseURL The base URL - * @param {string} requestedURL Absolute or relative URL to combine - * - * @returns {string} The combined full path - */ -function buildFullPath(baseURL, requestedURL, allowAbsoluteUrls, config) { - assertValidHttpProtocolURL(requestedURL, config); - let isRelativeUrl = !isAbsoluteURL(requestedURL); - if (baseURL && (isRelativeUrl || allowAbsoluteUrls === false)) { - assertValidHttpProtocolURL(baseURL, config); - return combineURLs(baseURL, requestedURL); - } - return requestedURL; -} - -const headersToObject = (thing) => (thing instanceof AxiosHeaders$1 ? { ...thing } : thing); - -const ownEnumerableKeys = (thing) => { - if (Object.getOwnPropertySymbols && Object.getOwnPropertyDescriptor) { - return Object.keys(thing).concat( - Object.getOwnPropertySymbols(thing).filter( - (symbol) => Object.getOwnPropertyDescriptor(thing, symbol).enumerable - ) - ); - } - return Object.keys(thing); -}; - -/** - * Config-specific merge-function which creates a new config-object - * by merging two configuration objects together. - * - * @param {Object} config1 - * @param {Object} config2 - * - * @returns {Object} New object resulting from merging config2 to config1 - */ -function mergeConfig$1(config1, config2) { - // eslint-disable-next-line no-param-reassign - config1 = config1 || {}; - config2 = config2 || {}; - - // Use a null-prototype object so that downstream reads such as `config.auth` - // or `config.baseURL` cannot inherit polluted values from Object.prototype. - // `hasOwnProperty` is restored as a non-enumerable own slot to preserve - // ergonomics for user code that relies on it. - const config = Object.create(null); - Object.defineProperty(config, 'hasOwnProperty', { - // Null-proto descriptor so a polluted Object.prototype.get cannot turn - // this data descriptor into an accessor descriptor on the way in. - __proto__: null, - value: Object.prototype.hasOwnProperty, - enumerable: false, - writable: true, - configurable: true, - }); - - function getMergedValue(target, source, prop, caseless) { - if (utils$1.isPlainObject(target) && utils$1.isPlainObject(source)) { - return utils$1.merge.call({ caseless }, target, source); - } else if (utils$1.isPlainObject(source)) { - return utils$1.merge({}, source); - } else if (utils$1.isArray(source)) { - return source.slice(); - } - return source; - } - - function mergeDeepProperties(a, b, prop, caseless) { - if (!utils$1.isUndefined(b)) { - return getMergedValue(a, b, prop, caseless); - } else if (!utils$1.isUndefined(a)) { - return getMergedValue(undefined, a, prop, caseless); - } - } - - // eslint-disable-next-line consistent-return - function valueFromConfig2(a, b) { - if (!utils$1.isUndefined(b)) { - return getMergedValue(undefined, b); - } - } - - // eslint-disable-next-line consistent-return - function defaultToConfig2(a, b) { - if (!utils$1.isUndefined(b)) { - return getMergedValue(undefined, b); - } else if (!utils$1.isUndefined(a)) { - return getMergedValue(undefined, a); - } - } - - function getMergedTransitionalOption(prop) { - const transitional2 = utils$1.hasOwnProp(config2, 'transitional') - ? config2.transitional - : undefined; - - if (!utils$1.isUndefined(transitional2)) { - if (utils$1.isPlainObject(transitional2)) { - if (utils$1.hasOwnProp(transitional2, prop)) { - return transitional2[prop]; - } - } else { - return undefined; - } - } - - const transitional1 = utils$1.hasOwnProp(config1, 'transitional') - ? config1.transitional - : undefined; - - if (utils$1.isPlainObject(transitional1) && utils$1.hasOwnProp(transitional1, prop)) { - return transitional1[prop]; - } - - return undefined; - } - - // eslint-disable-next-line consistent-return - function mergeDirectKeys(a, b, prop) { - if (utils$1.hasOwnProp(config2, prop)) { - return getMergedValue(a, b); - } else if (utils$1.hasOwnProp(config1, prop)) { - return getMergedValue(undefined, a); - } - } - - const mergeMap = { - url: valueFromConfig2, - method: valueFromConfig2, - data: valueFromConfig2, - baseURL: defaultToConfig2, - transformRequest: defaultToConfig2, - transformResponse: defaultToConfig2, - paramsSerializer: defaultToConfig2, - timeout: defaultToConfig2, - timeoutMessage: defaultToConfig2, - withCredentials: defaultToConfig2, - withXSRFToken: defaultToConfig2, - adapter: defaultToConfig2, - responseType: defaultToConfig2, - xsrfCookieName: defaultToConfig2, - xsrfHeaderName: defaultToConfig2, - onUploadProgress: defaultToConfig2, - onDownloadProgress: defaultToConfig2, - decompress: defaultToConfig2, - maxContentLength: defaultToConfig2, - maxBodyLength: defaultToConfig2, - beforeRedirect: defaultToConfig2, - transport: defaultToConfig2, - httpAgent: defaultToConfig2, - httpsAgent: defaultToConfig2, - cancelToken: defaultToConfig2, - socketPath: defaultToConfig2, - allowedSocketPaths: defaultToConfig2, - responseEncoding: defaultToConfig2, - validateStatus: mergeDirectKeys, - headers: (a, b, prop) => - mergeDeepProperties(headersToObject(a), headersToObject(b), prop, true), - }; - - utils$1.forEach(ownEnumerableKeys({ ...config1, ...config2 }), function computeConfigValue(prop) { - if (prop === '__proto__' || prop === 'constructor' || prop === 'prototype') return; - const merge = utils$1.hasOwnProp(mergeMap, prop) ? mergeMap[prop] : mergeDeepProperties; - const a = utils$1.hasOwnProp(config1, prop) ? config1[prop] : undefined; - const b = utils$1.hasOwnProp(config2, prop) ? config2[prop] : undefined; - const configValue = merge(a, b, prop); - (utils$1.isUndefined(configValue) && merge !== mergeDirectKeys) || (config[prop] = configValue); - }); - - if ( - utils$1.hasOwnProp(config2, 'validateStatus') && - utils$1.isUndefined(config2.validateStatus) && - getMergedTransitionalOption('validateStatusUndefinedResolves') === false - ) { - if (utils$1.hasOwnProp(config1, 'validateStatus')) { - config.validateStatus = getMergedValue(undefined, config1.validateStatus); - } else { - delete config.validateStatus; - } - } - - return config; -} - -const FORM_DATA_CONTENT_HEADERS = ['content-type', 'content-length']; - -/** - * Apply the headers generated by a FormData implementation to the request headers, - * honoring the `formDataHeaderPolicy` option: with 'content-only', copy only the - * content-* headers; otherwise merge all of them. - * - * @param {AxiosHeaders} headers - the request headers to mutate - * @param {Object | null | undefined} formHeaders - headers produced by the FormData implementation - * @param {String} [policy] - the resolved `formDataHeaderPolicy` config value - * - * @returns {void} - */ -function setFormDataHeaders(headers, formHeaders, policy) { - if (policy !== 'content-only') { - headers.set(formHeaders); - return; - } - - Object.entries(formHeaders || {}).forEach(([key, val]) => { - if (FORM_DATA_CONTENT_HEADERS.includes(key.toLowerCase())) { - headers.set(key, val); - } - }); -} - -/** - * Encode a UTF-8 string to a Latin-1 byte string for use with btoa(). - * This is a modern replacement for the deprecated unescape(encodeURIComponent(str)) pattern. - * - * @param {string} str The string to encode - * - * @returns {string} UTF-8 bytes as a Latin-1 string - */ -const encodeUTF8$1 = (str) => - encodeURIComponent(str).replace(/%([0-9A-F]{2})/gi, (_, hex) => - String.fromCharCode(parseInt(hex, 16)) - ); - -function resolveConfig(config) { - const newConfig = mergeConfig$1({}, config); - - // Read only own properties to prevent prototype pollution gadgets - // (e.g. Object.prototype.baseURL = 'https://evil.com'). - const own = (key) => (utils$1.hasOwnProp(newConfig, key) ? newConfig[key] : undefined); - - const data = own('data'); - let withXSRFToken = own('withXSRFToken'); - const xsrfHeaderName = own('xsrfHeaderName'); - const xsrfCookieName = own('xsrfCookieName'); - let headers = own('headers'); - const auth = own('auth'); - const baseURL = own('baseURL'); - const allowAbsoluteUrls = own('allowAbsoluteUrls'); - const url = own('url'); - - newConfig.headers = headers = AxiosHeaders$1.from(headers); - - newConfig.url = buildURL( - buildFullPath(baseURL, url, allowAbsoluteUrls, newConfig), - own('params'), - own('paramsSerializer') - ); - - // HTTP basic authentication - if (auth) { - const username = utils$1.getSafeProp(auth, 'username') || ''; - const password = utils$1.getSafeProp(auth, 'password') || ''; - - try { - headers.set( - 'Authorization', - 'Basic ' + btoa(username + ':' + (password ? encodeUTF8$1(password) : '')) - ); - } catch (e) { - throw AxiosError$1.from(e, AxiosError$1.ERR_BAD_OPTION_VALUE, config); - } - } - - if (utils$1.isFormData(data)) { - if ( - platform.hasStandardBrowserEnv || - platform.hasStandardBrowserWebWorkerEnv || - utils$1.isReactNative(data) - ) { - headers.setContentType(undefined); // browser/web worker/RN handles it - } else if (utils$1.isFunction(data.getHeaders)) { - // Node.js FormData (like form-data package) - setFormDataHeaders(headers, data.getHeaders(), own('formDataHeaderPolicy')); - } - } - - // Add xsrf header - // This is only done if running in a standard browser environment. - // Specifically not if we're in a web worker, or react-native. - - if (platform.hasStandardBrowserEnv) { - if (utils$1.isFunction(withXSRFToken)) { - withXSRFToken = withXSRFToken(newConfig); - } - - // Strict boolean check — prevents proto-pollution gadgets (e.g. Object.prototype.withXSRFToken = 1) - // and misconfigurations (e.g. "false") from short-circuiting the same-origin check and leaking - // the XSRF token cross-origin. - const shouldSendXSRF = - withXSRFToken === true || (withXSRFToken == null && isURLSameOrigin(newConfig.url)); - - if (shouldSendXSRF) { - const xsrfValue = xsrfHeaderName && xsrfCookieName && cookies.read(xsrfCookieName); - - if (xsrfValue) { - headers.set(xsrfHeaderName, xsrfValue); - } - } - } - - return newConfig; -} - -const isXHRAdapterSupported = typeof XMLHttpRequest !== 'undefined'; - -var xhrAdapter = isXHRAdapterSupported && - function (config) { - return new Promise(function dispatchXhrRequest(resolve, reject) { - const _config = resolveConfig(config); - let requestData = _config.data; - const requestHeaders = AxiosHeaders$1.from(_config.headers).normalize(); - let { responseType, onUploadProgress, onDownloadProgress } = _config; - let onCanceled; - let uploadThrottled, downloadThrottled; - let flushUpload, flushDownload; - - function done() { - flushUpload && flushUpload(); // flush events - flushDownload && flushDownload(); // flush events - - _config.cancelToken && _config.cancelToken.unsubscribe(onCanceled); - - _config.signal && _config.signal.removeEventListener('abort', onCanceled); - } - - let request = new XMLHttpRequest(); - - request.open(_config.method.toUpperCase(), _config.url, true); - - // Set the request timeout in MS - request.timeout = _config.timeout; - - function onloadend() { - if (!request) { - return; - } - // Prepare the response - const responseHeaders = AxiosHeaders$1.from( - 'getAllResponseHeaders' in request && request.getAllResponseHeaders() - ); - const responseData = - !responseType || responseType === 'text' || responseType === 'json' - ? request.responseText - : request.response; - const response = { - data: responseData, - status: request.status, - statusText: request.statusText, - headers: responseHeaders, - config, - request, - }; - - settle( - function _resolve(value) { - resolve(value); - done(); - }, - function _reject(err) { - reject(err); - done(); - }, - response - ); - - // Clean up request - request = null; - } - - if ('onloadend' in request) { - // Use onloadend if available - request.onloadend = onloadend; - } else { - // Listen for ready state to emulate onloadend - request.onreadystatechange = function handleLoad() { - if (!request || request.readyState !== 4) { - return; - } - - // The request errored out and we didn't get a response, this will be - // handled by onerror instead - // With one exception: request that using file: protocol, most browsers - // will return status as 0 even though it's a successful request - if ( - request.status === 0 && - !(request.responseURL && request.responseURL.startsWith('file:')) - ) { - return; - } - // readystate handler is calling before onerror or ontimeout handlers, - // so we should call onloadend on the next 'tick' - setTimeout(onloadend); - }; - } - - // Handle browser request cancellation (as opposed to a manual cancellation) - request.onabort = function handleAbort() { - if (!request) { - return; - } - - reject(new AxiosError$1('Request aborted', AxiosError$1.ECONNABORTED, config, request)); - done(); - - // Clean up request - request = null; - }; - - // Handle low level network errors - request.onerror = function handleError(event) { - // Browsers deliver a ProgressEvent in XHR onerror - // (message may be empty; when present, surface it) - // See https://developer.mozilla.org/docs/Web/API/XMLHttpRequest/error_event - const msg = event && event.message ? event.message : 'Network Error'; - const err = new AxiosError$1(msg, AxiosError$1.ERR_NETWORK, config, request); - // attach the underlying event for consumers who want details - err.event = event || null; - reject(err); - done(); - request = null; - }; - - // Handle timeout - request.ontimeout = function handleTimeout() { - let timeoutErrorMessage = _config.timeout - ? 'timeout of ' + _config.timeout + 'ms exceeded' - : 'timeout exceeded'; - const transitional = _config.transitional || transitionalDefaults; - if (_config.timeoutErrorMessage) { - timeoutErrorMessage = _config.timeoutErrorMessage; - } - reject( - new AxiosError$1( - timeoutErrorMessage, - transitional.clarifyTimeoutError ? AxiosError$1.ETIMEDOUT : AxiosError$1.ECONNABORTED, - config, - request - ) - ); - done(); - - // Clean up request - request = null; - }; - - // Remove Content-Type if data is undefined - requestData === undefined && requestHeaders.setContentType(null); - - // Add headers to the request - if ('setRequestHeader' in request) { - utils$1.forEach(toByteStringHeaderObject(requestHeaders), function setRequestHeader(val, key) { - request.setRequestHeader(key, val); - }); - } - - // Add withCredentials to request if needed - if (!utils$1.isUndefined(_config.withCredentials)) { - request.withCredentials = !!_config.withCredentials; - } - - // Add responseType to request if needed - if (responseType && responseType !== 'json') { - request.responseType = _config.responseType; - } - - // Handle progress if needed - if (onDownloadProgress) { - [downloadThrottled, flushDownload] = progressEventReducer(onDownloadProgress, true); - request.addEventListener('progress', downloadThrottled); - } - - // Not all browsers support upload events - if (onUploadProgress && request.upload) { - [uploadThrottled, flushUpload] = progressEventReducer(onUploadProgress); - - request.upload.addEventListener('progress', uploadThrottled); - - request.upload.addEventListener('loadend', flushUpload); - } - - if (_config.cancelToken || _config.signal) { - // Handle cancellation - // eslint-disable-next-line func-names - onCanceled = (cancel) => { - if (!request) { - return; - } - reject(!cancel || cancel.type ? new CanceledError$1(null, config, request) : cancel); - request.abort(); - done(); - request = null; - }; - - _config.cancelToken && _config.cancelToken.subscribe(onCanceled); - if (_config.signal) { - _config.signal.aborted - ? onCanceled() - : _config.signal.addEventListener('abort', onCanceled); - } - } - - const protocol = parseProtocol(_config.url); - - if (protocol && !platform.protocols.includes(protocol)) { - reject( - new AxiosError$1( - 'Unsupported protocol ' + protocol + ':', - AxiosError$1.ERR_BAD_REQUEST, - config - ) - ); - done(); - return; - } - - // Send the request - request.send(requestData || null); - }); - }; - -const composeSignals = (signals, timeout) => { - signals = signals ? signals.filter(Boolean) : []; - - if (!timeout && !signals.length) { - return; - } - - const controller = new AbortController(); - - let aborted = false; - - const onabort = function (reason) { - if (!aborted) { - aborted = true; - unsubscribe(); - const err = reason instanceof Error ? reason : this.reason; - controller.abort( - err instanceof AxiosError$1 - ? err - : new CanceledError$1(err instanceof Error ? err.message : err) - ); - } - }; - - let timer = - timeout && - setTimeout(() => { - timer = null; - onabort(new AxiosError$1(`timeout of ${timeout}ms exceeded`, AxiosError$1.ETIMEDOUT)); - }, timeout); - - const unsubscribe = () => { - if (!signals) { return; } - timer && clearTimeout(timer); - timer = null; - signals.forEach((signal) => { - signal.unsubscribe - ? signal.unsubscribe(onabort) - : signal.removeEventListener('abort', onabort); - }); - signals = null; - }; - - signals.forEach((signal) => { - if (aborted) { - return; - } - - if (signal.aborted) { - onabort.call(signal); - return; - } - - signal.addEventListener('abort', onabort, { once: true }); - }); - - const { signal } = controller; - - signal.unsubscribe = () => utils$1.asap(unsubscribe); - - return signal; -}; - -const streamChunk = function* (chunk, chunkSize) { - let len = chunk.byteLength; - - if (len < chunkSize) { - yield chunk; - return; - } - - let pos = 0; - let end; - - while (pos < len) { - end = pos + chunkSize; - yield chunk.slice(pos, end); - pos = end; - } -}; - -const readBytes = async function* (iterable, chunkSize) { - for await (const chunk of readStream(iterable)) { - yield* streamChunk(chunk, chunkSize); - } -}; - -const readStream = async function* (stream) { - if (stream[Symbol.asyncIterator]) { - yield* stream; - return; - } - - const reader = stream.getReader(); - try { - for (;;) { - const { done, value } = await reader.read(); - if (done) { - break; - } - yield value; - } - } finally { - await reader.cancel(); - } -}; - -const trackStream = (stream, chunkSize, onProgress, onFinish) => { - const iterator = readBytes(stream, chunkSize); - - let bytes = 0; - let done; - let _onFinish = (e) => { - if (!done) { - done = true; - onFinish && onFinish(e); - } - }; - - return new ReadableStream( - { - async pull(controller) { - try { - const { done, value } = await iterator.next(); - - if (done) { - _onFinish(); - controller.close(); - return; - } - - let len = value.byteLength; - if (onProgress) { - let loadedBytes = (bytes += len); - onProgress(loadedBytes); - } - controller.enqueue(new Uint8Array(value)); - } catch (err) { - _onFinish(err); - throw err; - } - }, - cancel(reason) { - _onFinish(reason); - return iterator.return(); - }, - }, - { - highWaterMark: 2, - } - ); -}; - -/** - * Estimate data: URL byte lengths *without* allocating large buffers. - * - Fetch percent-decodes a base64 body before decoding it. - * - Node's Buffer.from(body, 'base64') sizes its backing allocation from the - * raw body, including ignored characters and content after padding. - * - Non-base64 data is percent-decoded and then encoded as UTF-8. - */ -const isHexDigit = (charCode) => - (charCode >= 48 && charCode <= 57) || - (charCode >= 65 && charCode <= 70) || - (charCode >= 97 && charCode <= 102); - -const isPercentEncodedByte = (str, i, len) => - i + 2 < len && isHexDigit(str.charCodeAt(i + 1)) && isHexDigit(str.charCodeAt(i + 2)); - -const hexValue = (charCode) => (charCode <= 57 ? charCode - 48 : (charCode & 0xdf) - 55); - -const isBase64Char = (charCode) => - (charCode >= 65 && charCode <= 90) || // A-Z - (charCode >= 97 && charCode <= 122) || // a-z - (charCode >= 48 && charCode <= 57) || // 0-9 - charCode === 43 || // + - charCode === 47 || // / - charCode === 45 || // - (base64url) - charCode === 95; // _ (base64url) - -const isBase64Whitespace = (charCode) => - charCode === 9 || charCode === 10 || charCode === 12 || charCode === 13 || charCode === 32; - -const base64Bytes = (significant) => { - const groups = Math.floor(significant / 4); - const remainder = significant % 4; - return groups * 3 + (remainder === 2 ? 1 : remainder === 3 ? 2 : 0); -}; - -// Buffer.byteLength(body, 'base64') uses the raw string length as an allocation -// upper bound even when Buffer.from later ignores characters or stops at '='. -const estimateBase64BufferAllocation = (body) => { - const len = body.length; - let padding = 0; - - if (len > 0 && body.charCodeAt(len - 1) === 61 /* '=' */) { - padding++; - - if (len > 1 && body.charCodeAt(len - 2) === 61 /* '=' */) { - padding++; - } - } - - return Math.floor(((len - padding) * 3) / 4); -}; - -const estimatePercentDecodedBase64Bytes = (body) => { - const len = body.length; - let significant = 0; - let padding = 0; - let invalid = false; - - for (let i = 0; i < len; i++) { - let code = body.charCodeAt(i); - - if (code === 37 /* '%' */ && isPercentEncodedByte(body, i, len)) { - code = hexValue(body.charCodeAt(i + 1)) * 16 + hexValue(body.charCodeAt(i + 2)); - i += 2; - } - - if (isBase64Whitespace(code)) { - continue; - } - - if (code === 61 /* '=' */) { - padding++; - continue; - } - - if (!isBase64Char(code) || padding > 0) { - invalid = true; - continue; - } - - significant++; - } - - // Fetch rejects malformed forgiving-base64 input. Returning the raw-size - // allocation bound keeps that invalid input from becoming a pre-check bypass. - if ( - invalid || - padding > 2 || - (padding > 0 && (significant + padding) % 4 !== 0) || - significant % 4 === 1 - ) { - return estimateBase64BufferAllocation(body); - } - - return base64Bytes(significant); -}; - -const estimateDataURLBytes = (url, estimateBase64) => { - if (!url || typeof url !== 'string') return 0; - if (!url.startsWith('data:')) return 0; - - const comma = url.indexOf(','); - if (comma < 0) return 0; - - const meta = url.slice(5, comma); - const body = url.slice(comma + 1); - const isBase64 = /;base64/i.test(meta); - - if (isBase64) { - return estimateBase64(body); - } - - // Compute UTF-8 byte length directly from UTF-16 code units without allocating - // a byte buffer (TextEncoder.encode would defeat the DoS guard on large bodies). - // Valid %XX triplets count as one decoded byte; this matches the bytes that - // decodeURIComponent(body) would produce before Buffer re-encodes the string. - let bytes = 0; - for (let i = 0, len = body.length; i < len; i++) { - const c = body.charCodeAt(i); - if (c === 37 /* '%' */ && isPercentEncodedByte(body, i, len)) { - bytes += 1; - i += 2; - } else if (c < 0x80) { - bytes += 1; - } else if (c < 0x800) { - bytes += 2; - } else if (c >= 0xd800 && c <= 0xdbff && i + 1 < len) { - const next = body.charCodeAt(i + 1); - if (next >= 0xdc00 && next <= 0xdfff) { - bytes += 4; - i++; - } else { - bytes += 3; - } - } else { - bytes += 3; - } - } - return bytes; -}; - -/** - * Estimate the percent-decoded payload size used by Fetch data: URLs. - * - * @param {string} url - * @returns {number} - */ -function estimateDataURLDecodedBytes(url) { - // Fetch removes URL fragments before processing a data: URL. - const fragmentIndex = typeof url === 'string' ? url.indexOf('#') : -1; - - return estimateDataURLBytes( - fragmentIndex === -1 ? url : url.slice(0, fragmentIndex), - estimatePercentDecodedBase64Bytes - ); -} - -const VERSION$1 = "1.19.0"; - -const DEFAULT_CHUNK_SIZE = 64 * 1024; - -const { isFunction } = utils$1; - -/** - * Encode a UTF-8 string to a Latin-1 byte string for use with btoa(). - * This is a modern replacement for the deprecated unescape(encodeURIComponent(str)) pattern. - * - * @param {string} str The string to encode - * - * @returns {string} UTF-8 bytes as a Latin-1 string - */ -const encodeUTF8 = (str) => - encodeURIComponent(str).replace(/%([0-9A-F]{2})/gi, (_, hex) => - String.fromCharCode(parseInt(hex, 16)) - ); - -// Node's WHATWG URL parser returns `username` and `password` percent-encoded. -// Decode before composing the `auth` option so credentials such as -// `my%40email.com:pass` are sent as `my@email.com:pass`. Falls back to the -// original value for malformed input so a bad encoding never throws. -const decodeURIComponentSafe = (value) => { - if (!utils$1.isString(value)) { - return value; - } - - try { - return decodeURIComponent(value); - } catch (error) { - return value; - } -}; - -const test = (fn, ...args) => { - try { - return !!fn(...args); - } catch (e) { - return false; - } -}; - -const maybeWithAuthCredentials = (url) => { - const protocolIndex = url.indexOf('://'); - let urlToCheck = url; - if (protocolIndex !== -1) { - urlToCheck = urlToCheck.slice(protocolIndex + 3); - } - return urlToCheck.includes('@') || urlToCheck.includes(':'); -}; - -const factory = (env) => { - const globalObject = - utils$1.global !== undefined && utils$1.global !== null - ? utils$1.global - : globalThis; - const { ReadableStream, TextEncoder } = globalObject; - - env = utils$1.merge.call( - { - skipUndefined: true, - }, - { - Request: globalObject.Request, - Response: globalObject.Response, - }, - env - ); - - const { fetch: envFetch, Request, Response } = env; - const isFetchSupported = envFetch ? isFunction(envFetch) : typeof fetch === 'function'; - const isRequestSupported = isFunction(Request); - const isResponseSupported = isFunction(Response); - - if (!isFetchSupported) { - return false; - } - - const isReadableStreamSupported = isFetchSupported && isFunction(ReadableStream); - - const encodeText = - isFetchSupported && - (typeof TextEncoder === 'function' - ? ( - (encoder) => (str) => - encoder.encode(str) - )(new TextEncoder()) - : async (str) => new Uint8Array(await new Request(str).arrayBuffer())); - - const supportsRequestStream = - isRequestSupported && - isReadableStreamSupported && - test(() => { - let duplexAccessed = false; - - const request = new Request(platform.origin, { - body: new ReadableStream(), - method: 'POST', - get duplex() { - duplexAccessed = true; - return 'half'; - }, - }); - - const hasContentType = request.headers.has('Content-Type'); - - if (request.body != null) { - request.body.cancel(); - } - - return duplexAccessed && !hasContentType; - }); - - const supportsResponseStream = - isResponseSupported && - isReadableStreamSupported && - test(() => utils$1.isReadableStream(new Response('').body)); - - const resolvers = { - stream: supportsResponseStream && ((res) => res.body), - }; - - isFetchSupported && - (() => { - ['text', 'arrayBuffer', 'blob', 'formData', 'stream'].forEach((type) => { - !resolvers[type] && - (resolvers[type] = (res, config) => { - let method = res && res[type]; - - if (method) { - return method.call(res); - } - - throw new AxiosError$1( - `Response type '${type}' is not supported`, - AxiosError$1.ERR_NOT_SUPPORT, - config - ); - }); - }); - })(); - - const getBodyLength = async (body) => { - if (body == null) { - return 0; - } - - if (utils$1.isBlob(body)) { - return body.size; - } - - if (utils$1.isSpecCompliantForm(body)) { - const _request = new Request(platform.origin, { - method: 'POST', - body, - }); - return (await _request.arrayBuffer()).byteLength; - } - - if (utils$1.isArrayBufferView(body) || utils$1.isArrayBuffer(body)) { - return body.byteLength; - } - - if (utils$1.isURLSearchParams(body)) { - body = body + ''; - } - - if (utils$1.isString(body)) { - return (await encodeText(body)).byteLength; - } - }; - - const resolveBodyLength = async (headers, body) => { - const length = utils$1.toFiniteNumber(headers.getContentLength()); - - return length == null ? getBodyLength(body) : length; - }; - - return async (config) => { - let { - url, - method, - data, - signal, - cancelToken, - timeout, - onDownloadProgress, - onUploadProgress, - responseType, - headers, - withCredentials = 'same-origin', - fetchOptions, - maxContentLength, - maxBodyLength, - } = resolveConfig(config); - - const hasMaxContentLength = utils$1.isNumber(maxContentLength) && maxContentLength > -1; - const hasMaxBodyLength = utils$1.isNumber(maxBodyLength) && maxBodyLength > -1; - const own = (key) => (utils$1.hasOwnProp(config, key) ? config[key] : undefined); - - let _fetch = envFetch || fetch; - - responseType = responseType ? (responseType + '').toLowerCase() : 'text'; - - let composedSignal = composeSignals( - [signal, cancelToken && cancelToken.toAbortSignal()], - timeout - ); - - let request = null; - - const unsubscribe = - composedSignal && - composedSignal.unsubscribe && - (() => { - composedSignal.unsubscribe(); - }); - - let requestContentLength; - - // AxiosError we raise while the request body is being streamed. Captured - // by identity so the catch block can surface it directly, regardless of - // how the runtime wraps the resulting fetch rejection (undici exposes it - // as `err.cause`; some browsers drop the original error entirely). - let pendingBodyError = null; - - const maxBodyLengthError = () => - new AxiosError$1( - 'Request body larger than maxBodyLength limit', - AxiosError$1.ERR_BAD_REQUEST, - config, - request - ); - - try { - // HTTP basic authentication - let auth = undefined; - const configAuth = own('auth'); - - if (configAuth) { - const username = utils$1.getSafeProp(configAuth, 'username') || ''; - const password = utils$1.getSafeProp(configAuth, 'password') || ''; - auth = { - username, - password - }; - } - - if (maybeWithAuthCredentials(url)) { - const parsedURL = new URL(url, platform.origin); - - if (!auth && (parsedURL.username || parsedURL.password)) { - const urlUsername = decodeURIComponentSafe(parsedURL.username); - const urlPassword = decodeURIComponentSafe(parsedURL.password); - auth = { - username: urlUsername, - password: urlPassword - }; - } - - if (parsedURL.username || parsedURL.password) { - parsedURL.username = ''; - parsedURL.password = ''; - url = parsedURL.href; - } - } - - if (auth) { - headers.delete('authorization'); - headers.set( - 'Authorization', - 'Basic ' + btoa(encodeUTF8((auth.username || '') + ':' + (auth.password || ''))) - ); - } - - // Enforce maxContentLength for data: URLs up-front so we never materialize - // an oversized payload. The HTTP adapter applies the same check (see http.js - // "if (protocol === 'data:')" branch). - if (hasMaxContentLength && typeof url === 'string' && url.startsWith('data:')) { - const estimated = estimateDataURLDecodedBytes(url); - if (estimated > maxContentLength) { - throw new AxiosError$1( - 'maxContentLength size of ' + maxContentLength + ' exceeded', - AxiosError$1.ERR_BAD_RESPONSE, - config, - request - ); - } - } - - // Enforce maxBodyLength against known-size bodies before dispatch using - // the body's *actual* size — never a caller-declared Content-Length, - // which could under-report to slip an oversized body past the check. - // Unknown-size streams return undefined here and are counted per-chunk - // below as fetch consumes them. - if (hasMaxBodyLength && method !== 'get' && method !== 'head') { - const outboundLength = await getBodyLength(data); - if (typeof outboundLength === 'number' && isFinite(outboundLength)) { - requestContentLength = outboundLength; - if (outboundLength > maxBodyLength) { - throw maxBodyLengthError(); - } - } - } - - // A streamed body under maxBodyLength must be counted as fetch consumes - // it; its size is never trusted from a caller-declared Content-Length. - const mustEnforceStreamBody = - hasMaxBodyLength && (utils$1.isReadableStream(data) || utils$1.isStream(data)); - - const trackRequestStream = (stream, onProgress, flush) => - trackStream( - stream, - DEFAULT_CHUNK_SIZE, - (loadedBytes) => { - if (hasMaxBodyLength && loadedBytes > maxBodyLength) { - throw (pendingBodyError = maxBodyLengthError()); - } - onProgress && onProgress(loadedBytes); - }, - flush - ); - - if ( - supportsRequestStream && - method !== 'get' && - method !== 'head' && - (onUploadProgress || mustEnforceStreamBody) - ) { - requestContentLength = - requestContentLength == null ? await resolveBodyLength(headers, data) : requestContentLength; - - // A declared length of 0 is only trusted to skip the wrap when we are - // not enforcing a stream limit (which must not rely on that header). - if (requestContentLength !== 0 || mustEnforceStreamBody) { - let _request = new Request(url, { - method: 'POST', - body: data, - duplex: 'half', - }); - - let contentTypeHeader; - - if (utils$1.isFormData(data) && (contentTypeHeader = _request.headers.get('content-type'))) { - headers.setContentType(contentTypeHeader); - } - - if (_request.body) { - const [onProgress, flush] = - (onUploadProgress && - progressEventDecorator( - requestContentLength, - progressEventReducer(asyncDecorator(onUploadProgress)) - )) || - []; - - data = trackRequestStream(_request.body, onProgress, flush); - } - } - } else if ( - mustEnforceStreamBody && - !isRequestSupported && - isReadableStreamSupported && - method !== 'get' && - method !== 'head' - ) { - data = trackRequestStream(data); - } else if ( - mustEnforceStreamBody && - isRequestSupported && - !supportsRequestStream && - method !== 'get' && - method !== 'head' - ) { - throw new AxiosError$1( - 'Stream request bodies are not supported by the current fetch implementation', - AxiosError$1.ERR_NOT_SUPPORT, - config, - request - ); - } - - if (!utils$1.isString(withCredentials)) { - withCredentials = withCredentials ? 'include' : 'omit'; - } - - // Cloudflare Workers throws when credentials are defined - // see https://github.com/cloudflare/workerd/issues/902 - const isCredentialsSupported = isRequestSupported && 'credentials' in Request.prototype; - - // If data is FormData and Content-Type is multipart/form-data without boundary, - // delete it so fetch can set it correctly with the boundary - if (utils$1.isFormData(data)) { - const contentType = headers.getContentType(); - if ( - contentType && - /^multipart\/form-data/i.test(contentType) && - !/boundary=/i.test(contentType) - ) { - headers.delete('content-type'); - } - } - - // Set User-Agent header if not already set (fetch defaults to 'node' in Node.js) - headers.set('User-Agent', 'axios/' + VERSION$1, false); - - const resolvedOptions = { - ...fetchOptions, - signal: composedSignal, - method: method.toUpperCase(), - headers: toByteStringHeaderObject(headers.normalize()), - body: data, - duplex: 'half', - credentials: isCredentialsSupported ? withCredentials : undefined, - }; - - request = isRequestSupported && new Request(url, resolvedOptions); - - let response = await (isRequestSupported - ? _fetch(request, fetchOptions) - : _fetch(url, resolvedOptions)); - - const responseHeaders = AxiosHeaders$1.from(response.headers); - - // Cheap pre-check: if the server honestly declares a content-length that - // already exceeds the cap, reject before we start streaming. - if (hasMaxContentLength) { - const declaredLength = utils$1.toFiniteNumber(responseHeaders.getContentLength()); - if (declaredLength != null && declaredLength > maxContentLength) { - throw new AxiosError$1( - 'maxContentLength size of ' + maxContentLength + ' exceeded', - AxiosError$1.ERR_BAD_RESPONSE, - config, - request - ); - } - } - - const isStreamResponse = - supportsResponseStream && (responseType === 'stream' || responseType === 'response'); - - if ( - supportsResponseStream && - response.body && - (onDownloadProgress || hasMaxContentLength || (isStreamResponse && unsubscribe)) - ) { - const options = {}; - - ['status', 'statusText', 'headers'].forEach((prop) => { - options[prop] = response[prop]; - }); - - const responseContentLength = utils$1.toFiniteNumber(responseHeaders.getContentLength()); - - const [onProgress, flush] = - (onDownloadProgress && - progressEventDecorator( - responseContentLength, - progressEventReducer(asyncDecorator(onDownloadProgress), true) - )) || - []; - - let bytesRead = 0; - const onChunkProgress = (loadedBytes) => { - if (hasMaxContentLength) { - bytesRead = loadedBytes; - if (bytesRead > maxContentLength) { - throw new AxiosError$1( - 'maxContentLength size of ' + maxContentLength + ' exceeded', - AxiosError$1.ERR_BAD_RESPONSE, - config, - request - ); - } - } - onProgress && onProgress(loadedBytes); - }; - - response = new Response( - trackStream(response.body, DEFAULT_CHUNK_SIZE, onChunkProgress, () => { - flush && flush(); - unsubscribe && unsubscribe(); - }), - options - ); - } - - responseType = responseType || 'text'; - - let responseData = await resolvers[utils$1.findKey(resolvers, responseType) || 'text']( - response, - config - ); - - // Fallback enforcement for environments without ReadableStream support - // (legacy runtimes). Detect materialized size from typed output; skip - // streams/Response passthrough since the user will read those themselves. - if (hasMaxContentLength && !supportsResponseStream && !isStreamResponse) { - let materializedSize; - if (responseData != null) { - if (typeof responseData.byteLength === 'number') { - materializedSize = responseData.byteLength; - } else if (typeof responseData.size === 'number') { - materializedSize = responseData.size; - } else if (typeof responseData === 'string') { - materializedSize = - typeof TextEncoder === 'function' - ? new TextEncoder().encode(responseData).byteLength - : responseData.length; - } - } - if (typeof materializedSize === 'number' && materializedSize > maxContentLength) { - throw new AxiosError$1( - 'maxContentLength size of ' + maxContentLength + ' exceeded', - AxiosError$1.ERR_BAD_RESPONSE, - config, - request - ); - } - } - - !isStreamResponse && unsubscribe && unsubscribe(); - - return await new Promise((resolve, reject) => { - settle(resolve, reject, { - data: responseData, - headers: AxiosHeaders$1.from(response.headers), - status: response.status, - statusText: response.statusText, - config, - request, - }); - }); - } catch (err) { - unsubscribe && unsubscribe(); - - // Safari can surface fetch aborts as a DOMException-like object whose - // branded getters throw. Prefer our composed signal reason before reading - // the caught error, preserving timeout vs cancellation semantics. - if (composedSignal && composedSignal.aborted && composedSignal.reason instanceof AxiosError$1) { - const canceledError = composedSignal.reason; - canceledError.config = config; - request && (canceledError.request = request); - if (err !== canceledError) { - // Non-enumerable to match native Error `cause` semantics so loggers - // don't recurse into circular fetch internals (see #7205). - Object.defineProperty(canceledError, 'cause', { - __proto__: null, - value: err, - writable: true, - enumerable: false, - configurable: true, - }); - } - throw canceledError; - } - - // Surface a maxBodyLength violation we raised while the request body was - // being streamed. Matching by identity (rather than reading - // `err.cause.isAxiosError`) keeps the error deterministic across runtimes - // and avoids both prototype-pollution reads and mis-attributing a foreign - // AxiosError that merely happened to land in `err.cause`. - if (pendingBodyError) { - request && !pendingBodyError.request && (pendingBodyError.request = request); - throw pendingBodyError; - } - - // Re-throw AxiosErrors we raised synchronously (data: URL / content-length - // pre-checks, response size enforcement) without re-wrapping them. - if (err instanceof AxiosError$1) { - request && !err.request && (err.request = request); - throw err; - } - - if (err && err.name === 'TypeError' && /Load failed|fetch/i.test(err.message)) { - const networkError = new AxiosError$1( - 'Network Error', - AxiosError$1.ERR_NETWORK, - config, - request, - err && err.response - ); - // Non-enumerable to match native Error `cause` semantics so loggers - // don't recurse into circular fetch internals (see #7205). - Object.defineProperty(networkError, 'cause', { - __proto__: null, - value: err.cause || err, - writable: true, - enumerable: false, - configurable: true, - }); - throw networkError; - } - - throw AxiosError$1.from(err, err && err.code, config, request, err && err.response); - } - }; -}; - -const seedCache = new Map(); - -const getFetch = (config) => { - let env = (config && config.env) || {}; - const { fetch, Request, Response } = env; - const seeds = [Request, Response, fetch]; - - let len = seeds.length, - i = len, - seed, - target, - map = seedCache; - - while (i--) { - seed = seeds[i]; - target = map.get(seed); - - target === undefined && map.set(seed, (target = i ? new Map() : factory(env))); - - map = target; - } - - return target; -}; - -getFetch(); - -/** - * Known adapters mapping. - * Provides environment-specific adapters for Axios: - * - `http` for Node.js - * - `xhr` for browsers - * - `fetch` for fetch API-based requests - * - * @type {Object} - */ -const knownAdapters = { - http: httpAdapter, - xhr: xhrAdapter, - fetch: { - get: getFetch, - }, -}; - -// Assign adapter names for easier debugging and identification -utils$1.forEach(knownAdapters, (fn, value) => { - if (fn) { - try { - // Null-proto descriptors so a polluted Object.prototype.get cannot turn - // these data descriptors into accessor descriptors on the way in. - Object.defineProperty(fn, 'name', { __proto__: null, value }); - } catch (e) { - // eslint-disable-next-line no-empty - } - Object.defineProperty(fn, 'adapterName', { __proto__: null, value }); - } -}); - -/** - * Render a rejection reason string for unknown or unsupported adapters - * - * @param {string} reason - * @returns {string} - */ -const renderReason = (reason) => `- ${reason}`; - -/** - * Check if the adapter is resolved (function, null, or false) - * - * @param {Function|null|false} adapter - * @returns {boolean} - */ -const isResolvedHandle = (adapter) => - utils$1.isFunction(adapter) || adapter === null || adapter === false; - -/** - * Get the first suitable adapter from the provided list. - * Tries each adapter in order until a supported one is found. - * Throws an AxiosError if no adapter is suitable. - * - * @param {Array|string|Function} adapters - Adapter(s) by name or function. - * @param {Object} config - Axios request configuration - * @throws {AxiosError} If no suitable adapter is available - * @returns {Function} The resolved adapter function - */ -function getAdapter$1(adapters, config) { - adapters = utils$1.isArray(adapters) ? adapters : [adapters]; - - const { length } = adapters; - let nameOrAdapter; - let adapter; - - const rejectedReasons = {}; - - for (let i = 0; i < length; i++) { - nameOrAdapter = adapters[i]; - let id; - - adapter = nameOrAdapter; - - if (!isResolvedHandle(nameOrAdapter)) { - adapter = knownAdapters[(id = String(nameOrAdapter)).toLowerCase()]; - - if (adapter === undefined) { - throw new AxiosError$1(`Unknown adapter '${id}'`); - } - } - - if (adapter && (utils$1.isFunction(adapter) || (adapter = adapter.get(config)))) { - break; - } - - rejectedReasons[id || '#' + i] = adapter; - } - - if (!adapter) { - const reasons = Object.entries(rejectedReasons).map( - ([id, state]) => - `adapter ${id} ` + - (state === false ? 'is not supported by the environment' : 'is not available in the build') - ); - - let s = length - ? reasons.length > 1 - ? 'since :\n' + reasons.map(renderReason).join('\n') - : ' ' + renderReason(reasons[0]) - : 'as no adapter specified'; - - throw new AxiosError$1( - `There is no suitable adapter to dispatch the request ` + s, - AxiosError$1.ERR_NOT_SUPPORT - ); - } - - return adapter; -} - -/** - * Exports Axios adapters and utility to resolve an adapter - */ -var adapters = { - /** - * Resolve an adapter from a list of adapter names or functions. - * @type {Function} - */ - getAdapter: getAdapter$1, - - /** - * Exposes all known adapters - * @type {Object} - */ - adapters: knownAdapters, -}; - -/** - * Throws a `CanceledError` if cancellation has been requested. - * - * @param {Object} config The config that is to be used for the request - * - * @returns {void} - */ -function throwIfCancellationRequested(config) { - if (config.cancelToken) { - config.cancelToken.throwIfRequested(); - } - - if (config.signal && config.signal.aborted) { - throw new CanceledError$1(null, config); - } -} - -/** - * Dispatch a request to the server using the configured adapter. - * - * @param {object} config The config that is to be used for the request - * - * @returns {Promise} The Promise to be fulfilled - */ -function dispatchRequest(config) { - throwIfCancellationRequested(config); - - config.headers = AxiosHeaders$1.from(config.headers); - - // Transform request data - config.data = transformData.call(config, config.transformRequest); - - if (['post', 'put', 'patch'].indexOf(config.method) !== -1) { - config.headers.setContentType('application/x-www-form-urlencoded', false); - } - - const adapter = adapters.getAdapter(config.adapter || defaults.adapter, config); - - return adapter(config).then( - function onAdapterResolution(response) { - throwIfCancellationRequested(config); - - // Expose the current response on config so that transformResponse can - // attach it to any AxiosError it throws (e.g. on JSON parse failure). - // We clean it up afterwards to avoid polluting the config object. - config.response = response; - try { - response.data = transformData.call(config, config.transformResponse, response); - } finally { - delete config.response; - } - - response.headers = AxiosHeaders$1.from(response.headers); - - return response; - }, - function onAdapterRejection(reason) { - if (!isCancel$1(reason)) { - throwIfCancellationRequested(config); - - // Transform response data - if (reason && reason.response) { - config.response = reason.response; - try { - reason.response.data = transformData.call( - config, - config.transformResponse, - reason.response - ); - } finally { - delete config.response; - } - reason.response.headers = AxiosHeaders$1.from(reason.response.headers); - } - } - - return Promise.reject(reason); - } - ); -} - -const validators$1 = {}; - -// eslint-disable-next-line func-names -['object', 'boolean', 'number', 'function', 'string', 'symbol'].forEach((type, i) => { - validators$1[type] = function validator(thing) { - return typeof thing === type || 'a' + (i < 1 ? 'n ' : ' ') + type; - }; -}); - -const deprecatedWarnings = {}; - -/** - * Transitional option validator - * - * @param {function|boolean?} validator - set to false if the transitional option has been removed - * @param {string?} version - deprecated version / removed since version - * @param {string?} message - some message with additional info - * - * @returns {function} - */ -validators$1.transitional = function transitional(validator, version, message) { - function formatMessage(opt, desc) { - return ( - '[Axios v' + - VERSION$1 + - "] Transitional option '" + - opt + - "'" + - desc + - (message ? '. ' + message : '') - ); - } - - // eslint-disable-next-line func-names - return (value, opt, opts) => { - if (validator === false) { - throw new AxiosError$1( - formatMessage(opt, ' has been removed' + (version ? ' in ' + version : '')), - AxiosError$1.ERR_DEPRECATED - ); - } - - if (version && !deprecatedWarnings[opt]) { - deprecatedWarnings[opt] = true; - // eslint-disable-next-line no-console - console.warn( - formatMessage( - opt, - ' has been deprecated since v' + version + ' and will be removed in the near future' - ) - ); - } - - return validator ? validator(value, opt, opts) : true; - }; -}; - -validators$1.spelling = function spelling(correctSpelling) { - return (value, opt) => { - // eslint-disable-next-line no-console - console.warn(`${opt} is likely a misspelling of ${correctSpelling}`); - return true; - }; -}; - -/** - * Assert object's properties type - * - * @param {object} options - * @param {object} schema - * @param {boolean?} allowUnknown - * - * @returns {object} - */ - -function assertOptions(options, schema, allowUnknown) { - if (typeof options !== 'object' || options === null) { - throw new AxiosError$1('options must be an object', AxiosError$1.ERR_BAD_OPTION_VALUE); - } - const keys = Object.keys(options); - let i = keys.length; - while (i-- > 0) { - const opt = keys[i]; - // Use hasOwnProperty so a polluted Object.prototype. cannot supply - // a non-function validator and cause a TypeError. - const validator = Object.prototype.hasOwnProperty.call(schema, opt) ? schema[opt] : undefined; - if (validator) { - const value = options[opt]; - const result = value === undefined || validator(value, opt, options); - if (result !== true) { - throw new AxiosError$1( - 'option ' + opt + ' must be ' + result, - AxiosError$1.ERR_BAD_OPTION_VALUE - ); - } - continue; - } - if (allowUnknown !== true) { - throw new AxiosError$1('Unknown option ' + opt, AxiosError$1.ERR_BAD_OPTION); - } - } -} - -var validator = { - assertOptions, - validators: validators$1, -}; - -const validators = validator.validators; - -/** - * Create a new instance of Axios - * - * @param {Object} instanceConfig The default config for the instance - * - * @return {Axios} A new instance of Axios - */ -let Axios$1 = class Axios { - constructor(instanceConfig) { - this.defaults = instanceConfig || {}; - this.interceptors = { - request: new InterceptorManager(), - response: new InterceptorManager(), - }; - } - - /** - * Dispatch a request - * - * @param {String|Object} configOrUrl The config specific for this request (merged with this.defaults) - * @param {?Object} config - * - * @returns {Promise} The Promise to be fulfilled - */ - async request(configOrUrl, config) { - try { - return await this._request(configOrUrl, config); - } catch (err) { - if (err instanceof Error) { - let dummy = {}; - - Error.captureStackTrace ? Error.captureStackTrace(dummy) : (dummy = new Error()); - - // slice off the Error: ... line - const stack = (() => { - if (!dummy.stack) { - return ''; - } - - const firstNewlineIndex = dummy.stack.indexOf('\n'); - - return firstNewlineIndex === -1 ? '' : dummy.stack.slice(firstNewlineIndex + 1); - })(); - try { - if (!err.stack) { - err.stack = stack; - // match without the 2 top stack lines - } else if (stack) { - const firstNewlineIndex = stack.indexOf('\n'); - const secondNewlineIndex = - firstNewlineIndex === -1 ? -1 : stack.indexOf('\n', firstNewlineIndex + 1); - const stackWithoutTwoTopLines = - secondNewlineIndex === -1 ? '' : stack.slice(secondNewlineIndex + 1); - - if (!String(err.stack).endsWith(stackWithoutTwoTopLines)) { - err.stack += '\n' + stack; - } - } - } catch (e) { - // ignore the case where "stack" is an un-writable property - } - } - - throw err; - } - } - - _request(configOrUrl, config) { - /*eslint no-param-reassign:0*/ - // Allow for axios('example/url'[, config]) a la fetch API - if (typeof configOrUrl === 'string') { - config = config || {}; - config.url = configOrUrl; - } else { - config = configOrUrl || {}; - } - - config = mergeConfig$1(this.defaults, config); - - const { transitional, paramsSerializer, headers } = config; - - if (transitional !== undefined) { - validator.assertOptions( - transitional, - { - silentJSONParsing: validators.transitional(validators.boolean), - forcedJSONParsing: validators.transitional(validators.boolean), - clarifyTimeoutError: validators.transitional(validators.boolean), - legacyInterceptorReqResOrdering: validators.transitional(validators.boolean), - advertiseZstdAcceptEncoding: validators.transitional(validators.boolean), - validateStatusUndefinedResolves: validators.transitional(validators.boolean), - }, - false - ); - } - - if (paramsSerializer != null) { - if (utils$1.isFunction(paramsSerializer)) { - config.paramsSerializer = { - serialize: paramsSerializer, - }; - } else { - validator.assertOptions( - paramsSerializer, - { - encode: validators.function, - serialize: validators.function, - }, - true - ); - } - } - - // Set config.allowAbsoluteUrls - if (config.allowAbsoluteUrls !== undefined) ; else if (this.defaults.allowAbsoluteUrls !== undefined) { - config.allowAbsoluteUrls = this.defaults.allowAbsoluteUrls; - } else { - config.allowAbsoluteUrls = true; - } - - validator.assertOptions( - config, - { - baseUrl: validators.spelling('baseURL'), - withXsrfToken: validators.spelling('withXSRFToken'), - }, - true - ); - - // Set config.method - config.method = (config.method || this.defaults.method || 'get').toLowerCase(); - - // Flatten headers - let contextHeaders = headers && utils$1.merge(headers.common, headers[config.method]); - - headers && - utils$1.forEach(['delete', 'get', 'head', 'post', 'put', 'patch', 'query', 'common'], (method) => { - delete headers[method]; - }); - - config.headers = AxiosHeaders$1.concat(contextHeaders, headers); - - // filter out skipped interceptors - const requestInterceptorChain = []; - let synchronousRequestInterceptors = true; - this.interceptors.request.forEach(function unshiftRequestInterceptors(interceptor) { - if (typeof interceptor.runWhen === 'function' && interceptor.runWhen(config) === false) { - return; - } - - synchronousRequestInterceptors = synchronousRequestInterceptors && interceptor.synchronous; - - const transitional = config.transitional || transitionalDefaults; - const legacyInterceptorReqResOrdering = - transitional && transitional.legacyInterceptorReqResOrdering; - - if (legacyInterceptorReqResOrdering) { - requestInterceptorChain.unshift(interceptor.fulfilled, interceptor.rejected); - } else { - requestInterceptorChain.push(interceptor.fulfilled, interceptor.rejected); - } - }); - - const responseInterceptorChain = []; - this.interceptors.response.forEach(function pushResponseInterceptors(interceptor) { - responseInterceptorChain.push(interceptor.fulfilled, interceptor.rejected); - }); - - let promise; - let i = 0; - let len; - - if (!synchronousRequestInterceptors) { - const chain = [dispatchRequest.bind(this), undefined]; - chain.unshift(...requestInterceptorChain); - chain.push(...responseInterceptorChain); - len = chain.length; - - promise = Promise.resolve(config); - - while (i < len) { - promise = promise.then(chain[i++], chain[i++]); - } - - return promise; - } - - len = requestInterceptorChain.length; - - let newConfig = config; - - while (i < len) { - const onFulfilled = requestInterceptorChain[i++]; - const onRejected = requestInterceptorChain[i++]; - try { - newConfig = onFulfilled ? onFulfilled(newConfig) : newConfig; - } catch (error) { - if (!onRejected) { - promise = Promise.reject(error); - break; - } - - try { - const rejectedResult = onRejected.call(this, error); - - if (utils$1.isThenable(rejectedResult)) { - promise = Promise.resolve(rejectedResult).then(() => - dispatchRequest.call(this, newConfig) - ); - } - } catch (rejectedError) { - promise = Promise.reject(rejectedError); - } - - break; - } - } - - if (!promise) { - try { - promise = dispatchRequest.call(this, newConfig); - } catch (error) { - promise = Promise.reject(error); - } - } - - i = 0; - len = responseInterceptorChain.length; - - while (i < len) { - promise = promise.then(responseInterceptorChain[i++], responseInterceptorChain[i++]); - } - - return promise; - } - - getUri(config) { - config = mergeConfig$1(this.defaults, config); - const fullPath = buildFullPath(config.baseURL, config.url, config.allowAbsoluteUrls, config); - return buildURL(fullPath, config.params, config.paramsSerializer); - } -}; - -// Provide aliases for supported request methods -utils$1.forEach(['delete', 'get', 'head', 'options'], function forEachMethodNoData(method) { - /*eslint func-names:0*/ - Axios$1.prototype[method] = function (url, config) { - return this.request( - mergeConfig$1(config || {}, { - method, - url, - data: config && utils$1.hasOwnProp(config, 'data') ? config.data : undefined, - }) - ); - }; -}); - -utils$1.forEach(['post', 'put', 'patch', 'query'], function forEachMethodWithData(method) { - function generateHTTPMethod(isForm) { - return function httpMethod(url, data, config) { - return this.request( - mergeConfig$1(config || {}, { - method, - headers: isForm - ? { - 'Content-Type': 'multipart/form-data', - } - : {}, - url, - data, - }) - ); - }; - } - - Axios$1.prototype[method] = generateHTTPMethod(); - - // QUERY is a safe/idempotent read method; multipart form bodies don't fit - // its semantics, so no queryForm shorthand is generated. - if (method !== 'query') { - Axios$1.prototype[method + 'Form'] = generateHTTPMethod(true); - } -}); - -/** - * A `CancelToken` is an object that can be used to request cancellation of an operation. - * - * @param {Function} executor The executor function. - * - * @returns {CancelToken} - */ -let CancelToken$1 = class CancelToken { - constructor(executor) { - if (typeof executor !== 'function') { - throw new TypeError('executor must be a function.'); - } - - let resolvePromise; - - this.promise = new Promise(function promiseExecutor(resolve) { - resolvePromise = resolve; - }); - - const token = this; - - // eslint-disable-next-line func-names - this.promise.then((cancel) => { - if (!token._listeners) return; - - let i = token._listeners.length; - - while (i-- > 0) { - token._listeners[i](cancel); - } - token._listeners = null; - }); - - // eslint-disable-next-line func-names - this.promise.then = (onfulfilled) => { - let _resolve; - // eslint-disable-next-line func-names - const promise = new Promise((resolve) => { - token.subscribe(resolve); - _resolve = resolve; - }).then(onfulfilled); - - promise.cancel = function reject() { - token.unsubscribe(_resolve); - }; - - return promise; - }; - - executor(function cancel(message, config, request) { - if (token.reason) { - // Cancellation has already been requested - return; - } - - token.reason = new CanceledError$1(message, config, request); - resolvePromise(token.reason); - }); - } - - /** - * Throws a `CanceledError` if cancellation has been requested. - */ - throwIfRequested() { - if (this.reason) { - throw this.reason; - } - } - - /** - * Subscribe to the cancel signal - */ - - subscribe(listener) { - if (this.reason) { - listener(this.reason); - return; - } - - if (this._listeners) { - this._listeners.push(listener); - } else { - this._listeners = [listener]; - } - } - - /** - * Unsubscribe from the cancel signal - */ - - unsubscribe(listener) { - if (!this._listeners) { - return; - } - const index = this._listeners.indexOf(listener); - if (index !== -1) { - this._listeners.splice(index, 1); - } - } - - toAbortSignal() { - const controller = new AbortController(); - - const abort = (err) => { - controller.abort(err); - }; - - this.subscribe(abort); - - controller.signal.unsubscribe = () => this.unsubscribe(abort); - - return controller.signal; - } - - /** - * Returns an object that contains a new `CancelToken` and a function that, when called, - * cancels the `CancelToken`. - */ - static source() { - let cancel; - const token = new CancelToken(function executor(c) { - cancel = c; - }); - return { - token, - cancel, - }; - } -}; - -/** - * Syntactic sugar for invoking a function and expanding an array for arguments. - * - * Common use case would be to use `Function.prototype.apply`. - * - * ```js - * function f(x, y, z) {} - * const args = [1, 2, 3]; - * f.apply(null, args); - * ``` - * - * With `spread` this example can be re-written. - * - * ```js - * spread(function(x, y, z) {})([1, 2, 3]); - * ``` - * - * @param {Function} callback - * - * @returns {Function} - */ -function spread$1(callback) { - return function wrap(arr) { - return callback.apply(null, arr); - }; -} - -/** - * Determines whether the payload is an error thrown by Axios - * - * @param {*} payload The value to test - * - * @returns {boolean} True if the payload is an error thrown by Axios, otherwise false - */ -function isAxiosError$1(payload) { - return utils$1.isObject(payload) && payload.isAxiosError === true; -} - -const HttpStatusCode$1 = { - Continue: 100, - SwitchingProtocols: 101, - Processing: 102, - EarlyHints: 103, - Ok: 200, - Created: 201, - Accepted: 202, - NonAuthoritativeInformation: 203, - NoContent: 204, - ResetContent: 205, - PartialContent: 206, - MultiStatus: 207, - AlreadyReported: 208, - ImUsed: 226, - MultipleChoices: 300, - MovedPermanently: 301, - Found: 302, - SeeOther: 303, - NotModified: 304, - UseProxy: 305, - Unused: 306, - TemporaryRedirect: 307, - PermanentRedirect: 308, - BadRequest: 400, - Unauthorized: 401, - PaymentRequired: 402, - Forbidden: 403, - NotFound: 404, - MethodNotAllowed: 405, - NotAcceptable: 406, - ProxyAuthenticationRequired: 407, - RequestTimeout: 408, - Conflict: 409, - Gone: 410, - LengthRequired: 411, - PreconditionFailed: 412, - PayloadTooLarge: 413, - UriTooLong: 414, - UnsupportedMediaType: 415, - RangeNotSatisfiable: 416, - ExpectationFailed: 417, - ImATeapot: 418, - MisdirectedRequest: 421, - UnprocessableEntity: 422, - Locked: 423, - FailedDependency: 424, - TooEarly: 425, - UpgradeRequired: 426, - PreconditionRequired: 428, - TooManyRequests: 429, - RequestHeaderFieldsTooLarge: 431, - UnavailableForLegalReasons: 451, - InternalServerError: 500, - NotImplemented: 501, - BadGateway: 502, - ServiceUnavailable: 503, - GatewayTimeout: 504, - HttpVersionNotSupported: 505, - VariantAlsoNegotiates: 506, - InsufficientStorage: 507, - LoopDetected: 508, - NotExtended: 510, - NetworkAuthenticationRequired: 511, - WebServerReturnsAnUnknownError: 520, - WebServerIsDown: 521, - ConnectionTimedOut: 522, - OriginIsUnreachable: 523, - TimeoutOccurred: 524, - SslHandshakeFailed: 525, - InvalidSslCertificate: 526, -}; - -Object.entries(HttpStatusCode$1).forEach(([key, value]) => { - HttpStatusCode$1[value] = key; -}); - -/** - * Create an instance of Axios - * - * @param {Object} defaultConfig The default config for the instance - * - * @returns {Axios} A new instance of Axios - */ -function createInstance(defaultConfig) { - const context = new Axios$1(defaultConfig); - const instance = bind(Axios$1.prototype.request, context); - - // Copy axios.prototype to instance - utils$1.extend(instance, Axios$1.prototype, context, { allOwnKeys: true }); - - // Copy context to instance - utils$1.extend(instance, context, null, { allOwnKeys: true }); - - // Factory for creating new instances - instance.create = function create(instanceConfig) { - return createInstance(mergeConfig$1(defaultConfig, instanceConfig)); - }; - - return instance; -} - -// Create the default instance to be exported -const axios = createInstance(defaults); - -// Expose Axios class to allow class inheritance -axios.Axios = Axios$1; - -// Expose Cancel & CancelToken -axios.CanceledError = CanceledError$1; -axios.CancelToken = CancelToken$1; -axios.isCancel = isCancel$1; -axios.VERSION = VERSION$1; -axios.toFormData = toFormData$1; - -// Expose AxiosError class -axios.AxiosError = AxiosError$1; - -// alias for CanceledError for backward compatibility -axios.Cancel = axios.CanceledError; - -// Expose all/spread -axios.all = function all(promises) { - return Promise.all(promises); -}; - -axios.spread = spread$1; - -// Expose isAxiosError -axios.isAxiosError = isAxiosError$1; - -// Expose mergeConfig -axios.mergeConfig = mergeConfig$1; - -axios.AxiosHeaders = AxiosHeaders$1; - -axios.formToJSON = (thing) => formDataToJSON(utils$1.isHTMLForm(thing) ? new FormData(thing) : thing); - -axios.getAdapter = adapters.getAdapter; - -axios.HttpStatusCode = HttpStatusCode$1; - -axios.default = axios; - -// This module is intended to unwrap Axios default export as named. -// Keep top-level export same with static properties -// so that it can keep same with es module or cjs -const { - Axios, - AxiosError, - CanceledError, - isCancel, - CancelToken, - VERSION, - all, - Cancel, - isAxiosError, - spread, - toFormData, - AxiosHeaders, - HttpStatusCode, - formToJSON, - getAdapter, - mergeConfig, - create, -} = axios; - -export { Axios, AxiosError, AxiosHeaders, Cancel, CancelToken, CanceledError, HttpStatusCode, VERSION, all, create, axios as default, formToJSON, getAdapter, isAxiosError, isCancel, mergeConfig, spread, toFormData }; diff --git a/server/node_modules/axios/dist/esm/axios.min.js b/server/node_modules/axios/dist/esm/axios.min.js deleted file mode 100644 index 99f00c3..0000000 --- a/server/node_modules/axios/dist/esm/axios.min.js +++ /dev/null @@ -1,3 +0,0 @@ -/*! Axios v1.19.0 Copyright (c) 2026 Matt Zabriskie and contributors */ -function e(e,t){return function(){return e.apply(t,arguments)}}const{toString:t}=Object.prototype,{getPrototypeOf:n}=Object,{iterator:r,toStringTag:o}=Symbol,s=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),i=(e,t)=>{let r=e;const o=[];for(;null!=r&&r!==Object.prototype;){if(-1!==o.indexOf(r))return!1;if(o.push(r),s(r,t))return!0;r=n(r)}return!1},a=(c=Object.create(null),e=>{const n=t.call(e);return c[n]||(c[n]=n.slice(8,-1).toLowerCase())});var c;const l=e=>(e=e.toLowerCase(),t=>a(t)===e),u=e=>t=>typeof t===e,{isArray:f}=Array,d=u("undefined");function p(e){return null!==e&&!d(e)&&null!==e.constructor&&!d(e.constructor)&&g(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const h=l("ArrayBuffer");const m=u("string"),g=u("function"),b=u("number"),y=e=>null!==e&&"object"==typeof e,w=e=>{if(!y(e))return!1;const t=n(e);return!(null!==t&&t!==Object.prototype&&null!==n(t)||i(e,o)||i(e,r))},O=l("Date"),E=l("File"),R=l("Blob"),S=l("FileList"),_=l("Set");const A="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:"undefined"!=typeof global?global:{},v=void 0!==A.FormData?A.FormData:void 0,P=l("URLSearchParams"),[T,C,x,j]=["ReadableStream","Request","Response","Headers"].map(l);function N(e,t,{allOwnKeys:n=!1}={}){if(null==e)return;let r,o;if("object"!=typeof e&&(e=[e]),f(e))for(r=0,o=e.length;r0;)if(r=n[o],t===r.toLowerCase())return r;return null}const D="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:global,L=e=>!d(e)&&e!==D;const F=(B="undefined"!=typeof Uint8Array&&n(Uint8Array),e=>B&&e instanceof B);var B;const k=l("HTMLFormElement"),{propertyIsEnumerable:q}=Object.prototype,I=l("RegExp"),M=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),r={};N(n,(n,o)=>{let s;!1!==(s=t(n,o,e))&&(r[o]=s||n)}),Object.defineProperties(e,r)};const z=l("AsyncFunction"),H=($="function"==typeof setImmediate,J=g(D.postMessage),$?setImmediate:J?(W=`axios@${Math.random()}`,V=[],D.addEventListener("message",({source:e,data:t})=>{e===D&&t===W&&V.length&&V.shift()()},!1),e=>{V.push(e),D.postMessage(W,"*")}):e=>setTimeout(e));var $,J,W,V;const K="undefined"!=typeof queueMicrotask?queueMicrotask.bind(D):"undefined"!=typeof process&&process.nextTick||H,X=e=>null!=e&&g(e[r]);var G={isArray:f,isArrayBuffer:h,isBuffer:p,isFormData:e=>{if(!e)return!1;if(v&&e instanceof v)return!0;const t=n(e);if(!t||t===Object.prototype)return!1;if(!g(e.append))return!1;const r=a(e);return"formdata"===r||"object"===r&&g(e.toString)&&"[object FormData]"===e.toString()},isArrayBufferView:function(e){let t;return t="undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&h(e.buffer),t},isString:m,isNumber:b,isBoolean:e=>!0===e||!1===e,isObject:y,isPlainObject:w,isEmptyObject:e=>{if(!y(e)||p(e))return!1;try{return 0===Object.keys(e).length&&Object.getPrototypeOf(e)===Object.prototype}catch(e){return!1}},isReadableStream:T,isRequest:C,isResponse:x,isHeaders:j,isUndefined:d,isDate:O,isFile:E,isReactNativeBlob:e=>!(!e||void 0===e.uri),isReactNative:e=>e&&void 0!==e.getParts,isBlob:R,isRegExp:I,isFunction:g,isStream:e=>y(e)&&g(e.pipe),isURLSearchParams:P,isTypedArray:F,isFileList:S,forEach:N,merge:function e(...t){const{caseless:n,skipUndefined:r}=L(this)&&this||{},o={},i=(t,i)=>{if("__proto__"===i||"constructor"===i||"prototype"===i)return;const a=n&&"string"==typeof i&&U(o,i)||i,c=s(o,a)?o[a]:void 0;w(c)&&w(t)?o[a]=e(c,t):w(t)?o[a]=e({},t):f(t)?o[a]=t.slice():r&&d(t)||(o[a]=t)};for(let e=0,n=t.length;e(N(n,(n,o)=>{r&&g(n)?Object.defineProperty(t,o,{__proto__:null,value:e(n,r),writable:!0,enumerable:!0,configurable:!0}):Object.defineProperty(t,o,{__proto__:null,value:n,writable:!0,enumerable:!0,configurable:!0})},{allOwnKeys:o}),t),trim:e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,""),stripBOM:e=>(65279===e.charCodeAt(0)&&(e=e.slice(1)),e),inherits:(e,t,n,r)=>{e.prototype=Object.create(t.prototype,r),Object.defineProperty(e.prototype,"constructor",{__proto__:null,value:e,writable:!0,enumerable:!1,configurable:!0}),Object.defineProperty(e,"super",{__proto__:null,value:t.prototype}),n&&Object.assign(e.prototype,n)},toFlatObject:(e,t,r,o)=>{let s,i,a;const c={};if(t=t||{},null==e)return t;do{for(s=Object.getOwnPropertyNames(e),i=s.length;i-- >0;)a=s[i],o&&!o(a,e,t)||c[a]||(t[a]=e[a],c[a]=!0);e=!1!==r&&n(e)}while(e&&(!r||r(e,t))&&e!==Object.prototype);return t},kindOf:a,kindOfTest:l,endsWith:(e,t,n)=>{e=String(e),(void 0===n||n>e.length)&&(n=e.length),n-=t.length;const r=e.indexOf(t,n);return-1!==r&&r===n},toArray:e=>{if(!e)return null;if(f(e))return e;let t=e.length;if(!b(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},forEachEntry:(e,t)=>{const n=(e&&e[r]).call(e);let o;for(;(o=n.next())&&!o.done;){const n=o.value;t.call(e,n[0],n[1])}},matchAll:(e,t)=>{let n;const r=[];for(;null!==(n=e.exec(t));)r.push(n);return r},isHTMLForm:k,hasOwnProperty:s,hasOwnProp:s,hasOwnInPrototypeChain:i,getSafeProp:(e,t)=>null!=e&&i(e,t)?e[t]:void 0,reduceDescriptors:M,freezeMethods:e=>{M(e,(t,n)=>{if(g(e)&&["arguments","caller","callee"].includes(n))return!1;const r=e[n];g(r)&&(t.enumerable=!1,"writable"in t?t.writable=!1:t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")}))})},toObjectSet:(e,t)=>{const n={},r=e=>{e.forEach(e=>{n[e]=!0})};return f(e)?r(e):r(String(e).split(t)),n},toCamelCase:e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(e,t,n){return t.toUpperCase()+n}),noop:()=>{},toFiniteNumber:(e,t)=>null!=e&&Number.isFinite(e=+e)?e:t,findKey:U,global:D,isContextDefined:L,isSpecCompliantForm:function(e){return!!(e&&g(e.append)&&"FormData"===e[o]&&e[r])},toJSONObject:e=>{const t=new WeakSet,n=e=>{if(y(e)){if(t.has(e))return;if(p(e))return e;if(!("toJSON"in e)){let r;if(t.add(e),_(e)){r=[];for(const t of e){const e=n(t);!d(e)&&r.push(e)}}else r=f(e)?[]:{},N(e,(e,t)=>{const o=n(e);!d(o)&&(r[t]=o)});return t.delete(e),r}}return e};return n(e)},isAsyncFn:z,isThenable:e=>e&&(y(e)||g(e))&&g(e.then)&&g(e.catch),setImmediate:H,asap:K,isIterable:X,isSafeIterable:e=>null!=e&&i(e,r)&&X(e)};const Q=G.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]);const Z=new RegExp("[\\u0000-\\u0008\\u000a-\\u001f\\u007f]+","g"),Y=new RegExp("[^\\u0009\\u0020-\\u007e\\u0080-\\u00ff]+","g");function ee(e,t){return G.isArray(e)?e.map(e=>ee(e,t)):function(e){let t=0,n=e.length;for(;tt;){const t=e.charCodeAt(n-1);if(9!==t&&32!==t)break;n-=1}return 0===t&&n===e.length?e:e.slice(t,n)}(String(e).replace(t,""))}function te(e){const t=Object.create(null);return G.forEach(e.toJSON(),(e,n)=>{t[n]=(e=>ee(e,Y))(e)}),t}const ne=Symbol("internals");function re(e){return e&&String(e).trim().toLowerCase()}function oe(e){return!1===e||null==e?e:G.isArray(e)?e.map(oe):(e=>ee(e,Z))(String(e))}const se=/^[!#$%&'*+\-.^_`|~0-9A-Za-z]+$/;function ie(e){let t=0,n=e.length;for(;tt;){const t=e.charCodeAt(n-1);if(9!==t&&32!==t)break;n-=1}return 0===t&&n===e.length?e:e.slice(t,n)}function ae(e,t,n,r,o){return G.isFunction(r)?r.call(this,t,n):(o&&(t=n),G.isString(t)?G.isString(r)?-1!==t.indexOf(r):G.isRegExp(r)?r.test(t):void 0:void 0)}let ce=class{constructor(e){e&&this.set(e)}set(e,t,n){const r=this;function o(e,t,n){const o=re(t);if(!o)return;const s=G.findKey(r,o);(!s||void 0===r[s]||!0===n||void 0===n&&!1!==r[s])&&(r[s||t]=oe(e))}const s=(e,t)=>G.forEach(e,(e,n)=>o(e,n,t));if(G.isPlainObject(e)||e instanceof this.constructor)s(e,t);else if(G.isString(e)&&(e=e.trim())&&!/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim()))s((e=>{const t={};let n,r,o;return e&&e.split("\n").forEach(function(e){o=e.indexOf(":"),n=e.substring(0,o).trim().toLowerCase(),r=e.substring(o+1).trim();const s=G.hasOwnProp(t,n);!n||s&&G.hasOwnProp(Q,n)||("set-cookie"===n?s?t[n].push(r):t[n]=[r]:t[n]=s?t[n]+", "+r:r)}),t})(e),t);else if(G.isObject(e)&&G.isSafeIterable(e)){let n,r,o=Object.create(null);for(const t of e){if(!G.isArray(t))throw new TypeError("Object iterator must return a key-value pair");r=t[0],G.hasOwnProp(o,r)?(n=o[r],o[r]=G.isArray(n)?[...n,t[1]]:[n,t[1]]):o[r]=t[1]}s(o,t)}else null!=e&&o(t,e,n);return this}get(e,t){if(e=re(e)){const n=G.findKey(this,e);if(n){const e=this[n];if(!t)return e;if(!0===t)return function(e){const t=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let r;for(;r=n.exec(e);)t[r[1]]=r[2];return t}(e);if(G.isFunction(t))return t.call(this,e,n);if(G.isRegExp(t))return t.exec(e);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,t){if(e=re(e)){const n=G.findKey(this,e);return!(!n||void 0===this[n]||t&&!ae(0,this[n],n,t))}return!1}delete(e,t){const n=this;let r=!1;function o(e){if(e=re(e)){const o=G.findKey(n,e);!o||t&&!ae(0,n[o],o,t)||(delete n[o],r=!0)}}return G.isArray(e)?e.forEach(o):o(e),r}clear(e){const t=Object.keys(this);let n=t.length,r=!1;for(;n--;){const o=t[n];e&&!ae(0,this[o],o,e,!0)||(delete this[o],r=!0)}return r}normalize(e){const t=this,n={};return G.forEach(this,(r,o)=>{const s=G.findKey(n,o);if(s)return t[s]=oe(r),void delete t[o];const i=e?function(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(e,t,n)=>t.toUpperCase()+n)}(o):String(o).trim();i!==o&&delete t[o],t[i]=oe(r),n[i]=!0}),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){const t=Object.create(null);return G.forEach(this,(n,r)=>{null!=n&&!1!==n&&(t[r]=e&&G.isArray(n)?n.join(", "):n)}),t}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([e,t])=>e+": "+t).join("\n")}getSetCookie(){const e=this.get("set-cookie");return G.isArray(e)?e:null==e||!1===e?[]:[e]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static parseParameters(e){return function(e){const t=Object.create(null),n=String(e);let r=0,o=!1,s=!1;function i(e){const o=ie(n.slice(r,e)),s=o.indexOf("=");if(s<1)return;const i=ie(o.slice(0,s));if(!se.test(i))return;const a=i.toLowerCase();if("__proto__"===a||"constructor"===a||"prototype"===a)return;const c=ie(o.slice(s+1));t[a]=function(e){const t=e.length-1;if(t<1||34!==e.charCodeAt(0)||34!==e.charCodeAt(t))return e;let n="";for(let r=1;r=t))return e;n+=e[r]}return n}(c)}for(let e=0;en.set(e)),n}static accessor(e){const t=(this[ne]=this[ne]={accessors:{}}).accessors,n=this.prototype;function r(e){const r=re(e);t[r]||(!function(e,t){const n=G.toCamelCase(" "+t);["get","set","has"].forEach(r=>{Object.defineProperty(e,r+n,{__proto__:null,value:function(e,n,o){return this[r].call(this,t,e,n,o)},configurable:!0})})}(n,e),t[r]=!0)}return G.isArray(e)?e.forEach(r):r(e),this}};ce.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),G.reduceDescriptors(ce.prototype,({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(e){this[n]=e}}}),G.freezeMethods(ce);const le="[REDACTED ****]";function ue(e,t){const n=new Set(t.map(e=>String(e).toLowerCase())),r=[],o=e=>{if(null===e||"object"!=typeof e)return e;if(G.isBuffer(e))return e;if(-1!==r.indexOf(e))return;let t;if(e instanceof ce&&(e=e.toJSON()),r.push(e),G.isArray(e))t=[],e.forEach((e,n)=>{const r=o(e);G.isUndefined(r)||(t[n]=r)});else{if(!G.isPlainObject(e)&&function(e){if(G.hasOwnProp(e,"toJSON"))return!0;let t=Object.getPrototypeOf(e);for(;t&&t!==Object.prototype;){if(G.hasOwnProp(t,"toJSON"))return!0;t=Object.getPrototypeOf(t)}return!1}(e))return r.pop(),e;t=Object.create(null);for(const[r,s]of Object.entries(e)){const e=n.has(r.toLowerCase())?le:o(s);G.isUndefined(e)||(t[r]=e)}}return r.pop(),t};return o(e)}function fe(e){try{return String(e)}catch(e){return""}}let de=class e extends Error{static from(t,n,r,o,s,i){let a=t.message;!a&&G.isArray(t.errors)&&t.errors.length&&(a=function(e){return e.errors.map(e=>{try{return e&&e.message?fe(e.message):fe(e)}catch(e){return""}}).filter(Boolean).join("; ")||e.name||"AggregateError"}(t));const c=new e(a,n||t.code,r,o,s);return Object.defineProperty(c,"cause",{__proto__:null,value:t,writable:!0,enumerable:!1,configurable:!0}),c.name=t.name,null!=t.status&&null==c.status&&(c.status=t.status),i&&Object.assign(c,i),c}constructor(e,t,n,r,o){super(e),Object.defineProperty(this,"message",{__proto__:null,value:e,enumerable:!0,writable:!0,configurable:!0}),this.name="AxiosError",this.isAxiosError=!0,t&&(this.code=t),n&&(this.config=n),r&&(this.request=r),o&&(this.response=o,this.status=o.status)}toJSON(){const e=this.config,t=e&&G.hasOwnProp(e,"redact")?e.redact:void 0,n=G.isArray(t)&&t.length>0?ue(e,t):G.toJSONObject(e);return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:n,code:this.code,status:this.status}}};de.ERR_BAD_OPTION_VALUE="ERR_BAD_OPTION_VALUE",de.ERR_BAD_OPTION="ERR_BAD_OPTION",de.ECONNABORTED="ECONNABORTED",de.ETIMEDOUT="ETIMEDOUT",de.ECONNREFUSED="ECONNREFUSED",de.ERR_NETWORK="ERR_NETWORK",de.ERR_FR_TOO_MANY_REDIRECTS="ERR_FR_TOO_MANY_REDIRECTS",de.ERR_DEPRECATED="ERR_DEPRECATED",de.ERR_BAD_RESPONSE="ERR_BAD_RESPONSE",de.ERR_BAD_REQUEST="ERR_BAD_REQUEST",de.ERR_CANCELED="ERR_CANCELED",de.ERR_NOT_SUPPORT="ERR_NOT_SUPPORT",de.ERR_INVALID_URL="ERR_INVALID_URL",de.ERR_FORM_DATA_DEPTH_EXCEEDED="ERR_FORM_DATA_DEPTH_EXCEEDED";function pe(e){return G.isPlainObject(e)||G.isArray(e)}function he(e){return G.endsWith(e,"[]")?e.slice(0,-2):e}function me(e,t,n){return e?e.concat(t).map(function(e,t){return e=he(e),!n&&t?"["+e+"]":e}).join(n?".":""):t}const ge=G.toFlatObject(G,{},null,function(e){return/^is[A-Z]/.test(e)});function be(e,t,n){if(!G.isObject(e))throw new TypeError("target must be an object");t=t||new FormData;const r=(n=G.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(e,t){return!G.isUndefined(t[e])})).metaTokens,o=n.visitor||p,s=n.dots,i=n.indexes,a=n.Blob||"undefined"!=typeof Blob&&Blob,c=void 0===n.maxDepth?100:n.maxDepth,l=a&&G.isSpecCompliantForm(t),u=[];if(!G.isFunction(o))throw new TypeError("visitor must be a function");function f(e){if(null===e)return"";if(G.isDate(e))return e.toISOString();if(G.isBoolean(e))return e.toString();if(!l&&G.isBlob(e))throw new de("Blob is not supported. Use a Buffer instead.");if(G.isArrayBuffer(e)||G.isTypedArray(e)){if(l&&"function"==typeof a)return new a([e]);throw new de("Blob is not supported. Use a Buffer instead.",de.ERR_NOT_SUPPORT)}return e}function d(e){if(e>c)throw new de("Object is too deeply nested ("+e+" levels). Max depth: "+c,de.ERR_FORM_DATA_DEPTH_EXCEEDED)}function p(e,n,o){let a=e;if(G.isReactNative(t)&&G.isReactNativeBlob(e))return t.append(me(o,n,s),f(e)),!1;if(e&&!o&&"object"==typeof e)if(G.endsWith(n,"{}"))n=r?n:n.slice(0,-2),e=function(e,t){if(c===1/0)return JSON.stringify(e);const n=[];return JSON.stringify(e,function(e,r){if(!G.isObject(r))return r;for(;n.length&&n[n.length-1]!==this;)n.pop();return n.push(r),d(t+n.length-1),r})}(e,1);else if(G.isArray(e)&&function(e){return G.isArray(e)&&!e.some(pe)}(e)||(G.isFileList(e)||G.endsWith(n,"[]"))&&(a=G.toArray(e)))return n=he(n),a.forEach(function(e,r){!G.isUndefined(e)&&null!==e&&t.append(!0===i?me([n],r,s):null===i?n:n+"[]",f(e))}),!1;return!!pe(e)||(t.append(me(o,n,s),f(e)),!1)}const h=Object.assign(ge,{defaultVisitor:p,convertValue:f,isVisitable:pe});if(!G.isObject(e))throw new TypeError("data must be an object");return function e(n,r,s=0){if(!G.isUndefined(n)){if(d(s),-1!==u.indexOf(n))throw new Error("Circular reference detected in "+r.join("."));u.push(n),G.forEach(n,function(n,i){!0===(!(G.isUndefined(n)||null===n)&&o.call(t,n,G.isString(i)?i.trim():i,r,h))&&e(n,r?r.concat(i):[i],s+1)}),u.pop()}}(e),t}function ye(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+"};return encodeURIComponent(e).replace(/[!'()~]|%20/g,function(e){return t[e]})}function we(e,t){this._pairs=[],e&&be(e,this,t)}const Oe=we.prototype;function Ee(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function Re(e,t,n){if(!t)return e;e=e||"";const r=G.isFunction(n)?{serialize:n}:n,o=G.getSafeProp(r,"encode")||Ee,s=G.getSafeProp(r,"serialize");let i;if(i=s?s(t,r):G.isURLSearchParams(t)?t.toString():new we(t,r).toString(o),i){const t=e.indexOf("#");-1!==t&&(e=e.slice(0,t)),e+=(-1===e.indexOf("?")?"?":"&")+i}return e}Oe.append=function(e,t){this._pairs.push([e,t])},Oe.toString=function(e){const t=e?t=>e.call(this,t,ye):ye;return this._pairs.map(function(e){return t(e[0])+"="+t(e[1])},"").join("&")};class Se{constructor(){this.handlers=[]}use(e,t,n){return this.handlers.push({fulfilled:e,rejected:t,synchronous:!!n&&n.synchronous,runWhen:n?n.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(e){G.forEach(this.handlers,function(t){null!==t&&e(t)})}}var _e={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1,legacyInterceptorReqResOrdering:!0,advertiseZstdAcceptEncoding:!1,validateStatusUndefinedResolves:!0},Ae={isBrowser:!0,classes:{URLSearchParams:"undefined"!=typeof URLSearchParams?URLSearchParams:we,FormData:"undefined"!=typeof FormData?FormData:null,Blob:"undefined"!=typeof Blob?Blob:null},protocols:["http","https","file","blob","url","data"]};const ve="undefined"!=typeof window&&"undefined"!=typeof document,Pe="object"==typeof navigator&&navigator||void 0,Te=ve&&(!Pe||["ReactNative","NativeScript","NS"].indexOf(Pe.product)<0),Ce="undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&"function"==typeof self.importScripts,xe=ve&&window.location.href||"http://localhost";var je={...Object.freeze({__proto__:null,hasBrowserEnv:ve,hasStandardBrowserEnv:Te,hasStandardBrowserWebWorkerEnv:Ce,navigator:Pe,origin:xe}),...Ae};function Ne(e){if(e>100)throw new de("FormData field is too deeply nested ("+e+" levels). Max depth: 100",de.ERR_FORM_DATA_DEPTH_EXCEEDED)}function Ue(e){function t(e,n,r,o){Ne(o);let s=e[o++];if("__proto__"===s)return!0;const i=Number.isFinite(+s),a=o>=e.length;if(s=!s&&G.isArray(r)?r.length:s,a)return G.hasOwnProp(r,s)?r[s]=G.isArray(r[s])?r[s].concat(n):[r[s],n]:r[s]=n,!i;G.hasOwnProp(r,s)&&G.isObject(r[s])||(r[s]=[]);return t(e,n,r[s],o)&&G.isArray(r[s])&&(r[s]=function(e){const t={},n=Object.keys(e);let r;const o=n.length;let s;for(r=0;r{t(function(e){const t=[],n=/[^.[\]]+|\[([^.[\]]*)]/g;let r;for(;null!==(r=n.exec(e));)Ne(t.length),t.push("[]"===r[0]?"":r[1]||r[0]);return t}(e),r,n,0)}),n}return null}const De=(e,t)=>null!=e&&G.hasOwnProp(e,t)?e[t]:void 0;const Le={transitional:_e,adapter:["xhr","http","fetch"],transformRequest:[function(e,t){const n=t.getContentType()||"",r=n.indexOf("application/json")>-1,o=G.isObject(e);o&&G.isHTMLForm(e)&&(e=new FormData(e));if(G.isFormData(e))return r?JSON.stringify(Ue(e)):e;if(G.isArrayBuffer(e)||G.isBuffer(e)||G.isStream(e)||G.isFile(e)||G.isBlob(e)||G.isReadableStream(e))return e;if(G.isArrayBufferView(e))return e.buffer;if(G.isURLSearchParams(e))return t.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let s;if(o){const t=De(this,"formSerializer");if(n.indexOf("application/x-www-form-urlencoded")>-1)return function(e,t){return be(e,new je.classes.URLSearchParams,{visitor:function(e,t,n,r){return je.isNode&&G.isBuffer(e)?(this.append(t,e.toString("base64")),!1):r.defaultVisitor.apply(this,arguments)},...t})}(e,t).toString();if((s=G.isFileList(e))||n.indexOf("multipart/form-data")>-1){const n=De(this,"env"),r=n&&n.FormData;return be(s?{"files[]":e}:e,r&&new r,t)}}return o||r?(t.setContentType("application/json",!1),function(e,t,n){if(G.isString(e))try{return(t||JSON.parse)(e),G.trim(e)}catch(e){if("SyntaxError"!==e.name)throw e}return(n||JSON.stringify)(e)}(e)):e}],transformResponse:[function(e){const t=De(this,"transitional")||Le.transitional,n=t&&t.forcedJSONParsing,r=De(this,"responseType"),o="json"===r;if(G.isResponse(e)||G.isReadableStream(e))return e;if(e&&G.isString(e)&&(n&&!r||o)){const n=!(t&&t.silentJSONParsing)&&o;try{return JSON.parse(e,De(this,"parseReviver"))}catch(e){if(n){if("SyntaxError"===e.name)throw de.from(e,de.ERR_BAD_RESPONSE,this,null,De(this,"response"));throw e}}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:je.classes.FormData,Blob:je.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};function Fe(e,t){const n=this||Le,r=t||n,o=ce.from(r.headers);let s=r.data;return G.forEach(e,function(e){s=e.call(n,s,o.normalize(),t?t.status:void 0)}),o.normalize(),s}function Be(e){return!(!e||!e.__CANCEL__)}G.forEach(["delete","get","head","post","put","patch","query"],e=>{Le.headers[e]={}});let ke=class extends de{constructor(e,t,n){super(null==e?"canceled":e,de.ERR_CANCELED,t,n),this.name="CanceledError",this.__CANCEL__=!0}};function qe(e,t,n){const r=n.config.validateStatus;n.status&&r&&!r(n.status)?t(new de("Request failed with status code "+n.status,n.status>=400&&n.status<500?de.ERR_BAD_REQUEST:de.ERR_BAD_RESPONSE,n.config,n.request,n)):e(n)}const Ie=(e,t,n=3)=>{let r=0;const o=function(e,t){e=e||10;const n=new Array(e),r=new Array(e);let o,s=0,i=0;return t=void 0!==t?t:1e3,function(a){const c=Date.now(),l=r[i];o||(o=c),n[s]=a,r[s]=c;let u=i,f=0;for(;u!==s;)f+=n[u++],u%=e;if(s=(s+1)%e,s===i&&(i=(i+1)%e),c-o{o=s,n=null,r&&(clearTimeout(r),r=null),e(...t)};return[(...e)=>{const t=Date.now(),a=t-o;a>=s?i(e,t):(n=e,r||(r=setTimeout(()=>{r=null,i(n)},s-a)))},()=>n&&i(n)]}(n=>{if(!n||"number"!=typeof n.loaded)return;const s=n.loaded,i=n.lengthComputable?n.total:void 0,a=Math.max(0,null!=i?Math.min(s,i):s),c=Math.max(0,a-r),l=o(c);r=Math.max(r,a);e({loaded:a,total:i,progress:i?a/i:void 0,bytes:c,rate:l||void 0,estimated:l&&i?(i-a)/l:void 0,event:n,lengthComputable:null!=i,[t?"download":"upload"]:!0})},n)},Me=(e,t)=>{const n=null!=e;return[r=>t[0]({lengthComputable:n,total:e,loaded:r}),t[1]]},ze=(e,t=G.asap)=>(...n)=>t(()=>e(...n));var He=je.hasStandardBrowserEnv?((e,t)=>n=>(n=new URL(n,je.origin),e.protocol===n.protocol&&e.host===n.host&&(t||e.port===n.port)))(new URL(je.origin),je.navigator&&/(msie|trident)/i.test(je.navigator.userAgent)):()=>!0,$e=je.hasStandardBrowserEnv?{write(e,t,n,r,o,s,i){if("undefined"==typeof document)return;const a=[`${e}=${encodeURIComponent(t)}`];G.isNumber(n)&&a.push(`expires=${new Date(n).toUTCString()}`),G.isString(r)&&a.push(`path=${r}`),G.isString(o)&&a.push(`domain=${o}`),!0===s&&a.push("secure"),G.isString(i)&&a.push(`SameSite=${i}`),document.cookie=a.join("; ")},read(e){if("undefined"==typeof document)return null;const t=document.cookie.split(";");for(let n=0;nnull,remove(){}};const Je=/^https?:(?!\/\/)/i,We=/[\t\n\r]/g;function Ve(e){const t=e.replace(/^(https?:\/{0,2})[^/?#]*@/i,`$1${le}@`),n=t.indexOf("#"),r=(-1===n?t:t.slice(0,n)).replace(/([?&][^=&#]*=)[^&#]*/g,`$1${le}`);return-1===n?r:`${r}#${o=t.slice(n+1),o?o.replace(/(^|&)([^=&]*=)?[^&]+/g,(e,t,n="")=>`${t}${n}${le}`):o}`;var o}function Ke(e,t){if("string"==typeof e){const n=function(e){return function(e){let t=0;for(;t0&&47===e.charCodeAt(n-1);)n--;return e.slice(0,n)+"/"+t.replace(/^\/+/,"")}(e,t)):t}const Ge=e=>e instanceof ce?{...e}:e;function Qe(e,t){e=e||{},t=t||{};const n=Object.create(null);function r(e,t,n,r){return G.isPlainObject(e)&&G.isPlainObject(t)?G.merge.call({caseless:r},e,t):G.isPlainObject(t)?G.merge({},t):G.isArray(t)?t.slice():t}function o(e,t,n,o){return G.isUndefined(t)?G.isUndefined(e)?void 0:r(void 0,e,0,o):r(e,t,0,o)}function s(e,t){if(!G.isUndefined(t))return r(void 0,t)}function i(e,t){return G.isUndefined(t)?G.isUndefined(e)?void 0:r(void 0,e):r(void 0,t)}function a(n,o,s){return G.hasOwnProp(t,s)?r(n,o):G.hasOwnProp(e,s)?r(void 0,n):void 0}Object.defineProperty(n,"hasOwnProperty",{__proto__:null,value:Object.prototype.hasOwnProperty,enumerable:!1,writable:!0,configurable:!0});const c={url:s,method:s,data:s,baseURL:i,transformRequest:i,transformResponse:i,paramsSerializer:i,timeout:i,timeoutMessage:i,withCredentials:i,withXSRFToken:i,adapter:i,responseType:i,xsrfCookieName:i,xsrfHeaderName:i,onUploadProgress:i,onDownloadProgress:i,decompress:i,maxContentLength:i,maxBodyLength:i,beforeRedirect:i,transport:i,httpAgent:i,httpsAgent:i,cancelToken:i,socketPath:i,allowedSocketPaths:i,responseEncoding:i,validateStatus:a,headers:(e,t,n)=>o(Ge(e),Ge(t),0,!0)};var l;return G.forEach((l={...e,...t},Object.getOwnPropertySymbols&&Object.getOwnPropertyDescriptor?Object.keys(l).concat(Object.getOwnPropertySymbols(l).filter(e=>Object.getOwnPropertyDescriptor(l,e).enumerable)):Object.keys(l)),function(r){if("__proto__"===r||"constructor"===r||"prototype"===r)return;const s=G.hasOwnProp(c,r)?c[r]:o,i=s(G.hasOwnProp(e,r)?e[r]:void 0,G.hasOwnProp(t,r)?t[r]:void 0,r);G.isUndefined(i)&&s!==a||(n[r]=i)}),G.hasOwnProp(t,"validateStatus")&&G.isUndefined(t.validateStatus)&&!1===function(n){const r=G.hasOwnProp(t,"transitional")?t.transitional:void 0;if(!G.isUndefined(r)){if(!G.isPlainObject(r))return;if(G.hasOwnProp(r,n))return r[n]}const o=G.hasOwnProp(e,"transitional")?e.transitional:void 0;if(G.isPlainObject(o)&&G.hasOwnProp(o,n))return o[n]}("validateStatusUndefinedResolves")&&(G.hasOwnProp(e,"validateStatus")?n.validateStatus=r(void 0,e.validateStatus):delete n.validateStatus),n}const Ze=["content-type","content-length"];function Ye(e){const t=Qe({},e),n=e=>G.hasOwnProp(t,e)?t[e]:void 0,r=n("data");let o=n("withXSRFToken");const s=n("xsrfHeaderName"),i=n("xsrfCookieName");let a=n("headers");const c=n("auth"),l=n("baseURL"),u=n("allowAbsoluteUrls"),f=n("url");if(t.headers=a=ce.from(a),t.url=Re(Xe(l,f,u,t),n("params"),n("paramsSerializer")),c){const t=G.getSafeProp(c,"username")||"",n=G.getSafeProp(c,"password")||"";try{a.set("Authorization","Basic "+btoa(t+":"+(n?encodeURIComponent(n).replace(/%([0-9A-F]{2})/gi,(e,t)=>String.fromCharCode(parseInt(t,16))):"")))}catch(t){throw de.from(t,de.ERR_BAD_OPTION_VALUE,e)}}if(G.isFormData(r)&&(je.hasStandardBrowserEnv||je.hasStandardBrowserWebWorkerEnv||G.isReactNative(r)?a.setContentType(void 0):G.isFunction(r.getHeaders)&&function(e,t,n){"content-only"===n?Object.entries(t||{}).forEach(([t,n])=>{Ze.includes(t.toLowerCase())&&e.set(t,n)}):e.set(t)}(a,r.getHeaders(),n("formDataHeaderPolicy"))),je.hasStandardBrowserEnv){G.isFunction(o)&&(o=o(t));if(!0===o||null==o&&He(t.url)){const e=s&&i&&$e.read(i);e&&a.set(s,e)}}return t}var et="undefined"!=typeof XMLHttpRequest&&function(e){return new Promise(function(t,n){const r=Ye(e);let o=r.data;const s=ce.from(r.headers).normalize();let i,a,c,l,u,{responseType:f,onUploadProgress:d,onDownloadProgress:p}=r;function h(){l&&l(),u&&u(),r.cancelToken&&r.cancelToken.unsubscribe(i),r.signal&&r.signal.removeEventListener("abort",i)}let m=new XMLHttpRequest;function g(){if(!m)return;const r=ce.from("getAllResponseHeaders"in m&&m.getAllResponseHeaders());qe(function(e){t(e),h()},function(e){n(e),h()},{data:f&&"text"!==f&&"json"!==f?m.response:m.responseText,status:m.status,statusText:m.statusText,headers:r,config:e,request:m}),m=null}m.open(r.method.toUpperCase(),r.url,!0),m.timeout=r.timeout,"onloadend"in m?m.onloadend=g:m.onreadystatechange=function(){m&&4===m.readyState&&(0!==m.status||m.responseURL&&m.responseURL.startsWith("file:"))&&setTimeout(g)},m.onabort=function(){m&&(n(new de("Request aborted",de.ECONNABORTED,e,m)),h(),m=null)},m.onerror=function(t){const r=t&&t.message?t.message:"Network Error",o=new de(r,de.ERR_NETWORK,e,m);o.event=t||null,n(o),h(),m=null},m.ontimeout=function(){let t=r.timeout?"timeout of "+r.timeout+"ms exceeded":"timeout exceeded";const o=r.transitional||_e;r.timeoutErrorMessage&&(t=r.timeoutErrorMessage),n(new de(t,o.clarifyTimeoutError?de.ETIMEDOUT:de.ECONNABORTED,e,m)),h(),m=null},void 0===o&&s.setContentType(null),"setRequestHeader"in m&&G.forEach(te(s),function(e,t){m.setRequestHeader(t,e)}),G.isUndefined(r.withCredentials)||(m.withCredentials=!!r.withCredentials),f&&"json"!==f&&(m.responseType=r.responseType),p&&([c,u]=Ie(p,!0),m.addEventListener("progress",c)),d&&m.upload&&([a,l]=Ie(d),m.upload.addEventListener("progress",a),m.upload.addEventListener("loadend",l)),(r.cancelToken||r.signal)&&(i=t=>{m&&(n(!t||t.type?new ke(null,e,m):t),m.abort(),h(),m=null)},r.cancelToken&&r.cancelToken.subscribe(i),r.signal&&(r.signal.aborted?i():r.signal.addEventListener("abort",i)));const b=function(e){const t=/^([-+\w]{1,25}):(?:\/\/)?/.exec(e);return t&&t[1]||""}(r.url);if(b&&!je.protocols.includes(b))return n(new de("Unsupported protocol "+b+":",de.ERR_BAD_REQUEST,e)),void h();m.send(o||null)})};const tt=(e,t)=>{if(e=e?e.filter(Boolean):[],!t&&!e.length)return;const n=new AbortController;let r=!1;const o=function(e){if(!r){r=!0,i();const t=e instanceof Error?e:this.reason;n.abort(t instanceof de?t:new ke(t instanceof Error?t.message:t))}};let s=t&&setTimeout(()=>{s=null,o(new de(`timeout of ${t}ms exceeded`,de.ETIMEDOUT))},t);const i=()=>{e&&(s&&clearTimeout(s),s=null,e.forEach(e=>{e.unsubscribe?e.unsubscribe(o):e.removeEventListener("abort",o)}),e=null)};e.forEach(e=>{r||(e.aborted?o.call(e):e.addEventListener("abort",o,{once:!0}))});const{signal:a}=n;return a.unsubscribe=()=>G.asap(i),a},nt=function*(e,t){let n=e.byteLength;if(n{const o=async function*(e,t){for await(const n of rt(e))yield*nt(n,t)}(e,t);let s,i=0,a=e=>{s||(s=!0,r&&r(e))};return new ReadableStream({async pull(e){try{const{done:t,value:r}=await o.next();if(t)return a(),void e.close();let s=r.byteLength;if(n){let e=i+=s;n(e)}e.enqueue(new Uint8Array(r))}catch(e){throw a(e),e}},cancel:e=>(a(e),o.return())},{highWaterMark:2})},st=e=>e>=48&&e<=57||e>=65&&e<=70||e>=97&&e<=102,it=(e,t,n)=>t+2e<=57?e-48:(223&e)-55,ct=e=>e>=65&&e<=90||e>=97&&e<=122||e>=48&&e<=57||43===e||47===e||45===e||95===e,lt=e=>9===e||10===e||12===e||13===e||32===e,ut=e=>{const t=e.length;let n=0,r=0,o=!1;for(let s=0;s0?o=!0:n++:r++)}return o||r>2||r>0&&(n+r)%4!=0||n%4==1?(e=>{const t=e.length;let n=0;return t>0&&61===e.charCodeAt(t-1)&&(n++,t>1&&61===e.charCodeAt(t-2)&&n++),Math.floor(3*(t-n)/4)})(e):(e=>{const t=e%4;return 3*Math.floor(e/4)+(2===t?1:3===t?2:0)})(n)};function ft(e){const t="string"==typeof e?e.indexOf("#"):-1;return((e,t)=>{if(!e||"string"!=typeof e)return 0;if(!e.startsWith("data:"))return 0;const n=e.indexOf(",");if(n<0)return 0;const r=e.slice(5,n),o=e.slice(n+1);if(/;base64/i.test(r))return t(o);let s=0;for(let e=0,t=o.length;e=55296&&n<=56319&&e+1=56320&&t<=57343?(s+=4,e++):s+=3}else s+=3}return s})(-1===t?e:e.slice(0,t),ut)}const dt="1.19.0",{isFunction:pt}=G,ht=e=>{if(!G.isString(e))return e;try{return decodeURIComponent(e)}catch(t){return e}},mt=(e,...t)=>{try{return!!e(...t)}catch(e){return!1}},gt=e=>{const t=void 0!==G.global&&null!==G.global?G.global:globalThis,{ReadableStream:n,TextEncoder:r}=t;e=G.merge.call({skipUndefined:!0},{Request:t.Request,Response:t.Response},e);const{fetch:o,Request:s,Response:i}=e,a=o?pt(o):"function"==typeof fetch,c=pt(s),l=pt(i);if(!a)return!1;const u=a&&pt(n),f=a&&("function"==typeof r?(d=new r,e=>d.encode(e)):async e=>new Uint8Array(await new s(e).arrayBuffer()));var d;const p=c&&u&&mt(()=>{let e=!1;const t=new s(je.origin,{body:new n,method:"POST",get duplex(){return e=!0,"half"}}),r=t.headers.has("Content-Type");return null!=t.body&&t.body.cancel(),e&&!r}),h=l&&u&&mt(()=>G.isReadableStream(new i("").body)),m={stream:h&&(e=>e.body)};a&&["text","arrayBuffer","blob","formData","stream"].forEach(e=>{!m[e]&&(m[e]=(t,n)=>{let r=t&&t[e];if(r)return r.call(t);throw new de(`Response type '${e}' is not supported`,de.ERR_NOT_SUPPORT,n)})});const g=async e=>{if(null==e)return 0;if(G.isBlob(e))return e.size;if(G.isSpecCompliantForm(e)){const t=new s(je.origin,{method:"POST",body:e});return(await t.arrayBuffer()).byteLength}return G.isArrayBufferView(e)||G.isArrayBuffer(e)?e.byteLength:(G.isURLSearchParams(e)&&(e+=""),G.isString(e)?(await f(e)).byteLength:void 0)};return async e=>{let{url:t,method:n,data:a,signal:l,cancelToken:f,timeout:d,onDownloadProgress:b,onUploadProgress:y,responseType:w,headers:O,withCredentials:E="same-origin",fetchOptions:R,maxContentLength:S,maxBodyLength:_}=Ye(e);const A=G.isNumber(S)&&S>-1,v=G.isNumber(_)&&_>-1;let P=o||fetch;w=w?(w+"").toLowerCase():"text";let T=tt([l,f&&f.toAbortSignal()],d),C=null;const x=T&&T.unsubscribe&&(()=>{T.unsubscribe()});let j,N=null;const U=()=>new de("Request body larger than maxBodyLength limit",de.ERR_BAD_REQUEST,e,C);try{let o;const l=(L="auth",G.hasOwnProp(e,L)?e[L]:void 0);if(l){const e=G.getSafeProp(l,"username")||"";o={username:e,password:G.getSafeProp(l,"password")||""}}if((e=>{const t=e.indexOf("://");let n=e;return-1!==t&&(n=n.slice(t+3)),n.includes("@")||n.includes(":")})(t)){const e=new URL(t,je.origin);if(!o&&(e.username||e.password)){const t=ht(e.username);o={username:t,password:ht(e.password)}}(e.username||e.password)&&(e.username="",e.password="",t=e.href)}if(o&&(O.delete("authorization"),O.set("Authorization","Basic "+btoa((D=(o.username||"")+":"+(o.password||""),encodeURIComponent(D).replace(/%([0-9A-F]{2})/gi,(e,t)=>String.fromCharCode(parseInt(t,16))))))),A&&"string"==typeof t&&t.startsWith("data:")){if(ft(t)>S)throw new de("maxContentLength size of "+S+" exceeded",de.ERR_BAD_RESPONSE,e,C)}if(v&&"get"!==n&&"head"!==n){const e=await g(a);if("number"==typeof e&&isFinite(e)&&(j=e,e>_))throw U()}const f=v&&(G.isReadableStream(a)||G.isStream(a)),d=(e,t,n)=>ot(e,65536,e=>{if(v&&e>_)throw N=U();t&&t(e)},n);if(p&&"get"!==n&&"head"!==n&&(y||f)){if(j=null==j?await(async(e,t)=>{const n=G.toFiniteNumber(e.getContentLength());return null==n?g(t):n})(O,a):j,0!==j||f){let e,n=new s(t,{method:"POST",body:a,duplex:"half"});if(G.isFormData(a)&&(e=n.headers.get("content-type"))&&O.setContentType(e),n.body){const[e,t]=y&&Me(j,Ie(ze(y)))||[];a=d(n.body,e,t)}}}else if(f&&!c&&u&&"get"!==n&&"head"!==n)a=d(a);else if(f&&c&&!p&&"get"!==n&&"head"!==n)throw new de("Stream request bodies are not supported by the current fetch implementation",de.ERR_NOT_SUPPORT,e,C);G.isString(E)||(E=E?"include":"omit");const F=c&&"credentials"in s.prototype;if(G.isFormData(a)){const e=O.getContentType();e&&/^multipart\/form-data/i.test(e)&&!/boundary=/i.test(e)&&O.delete("content-type")}O.set("User-Agent","axios/"+dt,!1);const B={...R,signal:T,method:n.toUpperCase(),headers:te(O.normalize()),body:a,duplex:"half",credentials:F?E:void 0};C=c&&new s(t,B);let k=await(c?P(C,R):P(t,B));const q=ce.from(k.headers);if(A){const t=G.toFiniteNumber(q.getContentLength());if(null!=t&&t>S)throw new de("maxContentLength size of "+S+" exceeded",de.ERR_BAD_RESPONSE,e,C)}const I=h&&("stream"===w||"response"===w);if(h&&k.body&&(b||A||I&&x)){const t={};["status","statusText","headers"].forEach(e=>{t[e]=k[e]});const n=G.toFiniteNumber(q.getContentLength()),[r,o]=b&&Me(n,Ie(ze(b),!0))||[];let s=0;const a=t=>{if(A&&(s=t,s>S))throw new de("maxContentLength size of "+S+" exceeded",de.ERR_BAD_RESPONSE,e,C);r&&r(t)};k=new i(ot(k.body,65536,a,()=>{o&&o(),x&&x()}),t)}w=w||"text";let M=await m[G.findKey(m,w)||"text"](k,e);if(A&&!h&&!I){let t;if(null!=M&&("number"==typeof M.byteLength?t=M.byteLength:"number"==typeof M.size?t=M.size:"string"==typeof M&&(t="function"==typeof r?(new r).encode(M).byteLength:M.length)),"number"==typeof t&&t>S)throw new de("maxContentLength size of "+S+" exceeded",de.ERR_BAD_RESPONSE,e,C)}return!I&&x&&x(),await new Promise((t,n)=>{qe(t,n,{data:M,headers:ce.from(k.headers),status:k.status,statusText:k.statusText,config:e,request:C})})}catch(t){if(x&&x(),T&&T.aborted&&T.reason instanceof de){const n=T.reason;throw n.config=e,C&&(n.request=C),t!==n&&Object.defineProperty(n,"cause",{__proto__:null,value:t,writable:!0,enumerable:!1,configurable:!0}),n}if(N)throw C&&!N.request&&(N.request=C),N;if(t instanceof de)throw C&&!t.request&&(t.request=C),t;if(t&&"TypeError"===t.name&&/Load failed|fetch/i.test(t.message)){const n=new de("Network Error",de.ERR_NETWORK,e,C,t&&t.response);throw Object.defineProperty(n,"cause",{__proto__:null,value:t.cause||t,writable:!0,enumerable:!1,configurable:!0}),n}throw de.from(t,t&&t.code,e,C,t&&t.response)}var D,L}},bt=new Map,yt=e=>{let t=e&&e.env||{};const{fetch:n,Request:r,Response:o}=t,s=[r,o,n];let i,a,c=s.length,l=bt;for(;c--;)i=s[c],a=l.get(i),void 0===a&&l.set(i,a=c?new Map:gt(t)),l=a;return a};yt();const wt={http:null,xhr:et,fetch:{get:yt}};G.forEach(wt,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{__proto__:null,value:t})}catch(e){}Object.defineProperty(e,"adapterName",{__proto__:null,value:t})}});const Ot=e=>`- ${e}`,Et=e=>G.isFunction(e)||null===e||!1===e;var Rt={getAdapter:function(e,t){e=G.isArray(e)?e:[e];const{length:n}=e;let r,o;const s={};for(let i=0;i`adapter ${e} `+(!1===t?"is not supported by the environment":"is not available in the build"));let t=n?e.length>1?"since :\n"+e.map(Ot).join("\n"):" "+Ot(e[0]):"as no adapter specified";throw new de("There is no suitable adapter to dispatch the request "+t,de.ERR_NOT_SUPPORT)}return o},adapters:wt};function St(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new ke(null,e)}function _t(e){St(e),e.headers=ce.from(e.headers),e.data=Fe.call(e,e.transformRequest),-1!==["post","put","patch"].indexOf(e.method)&&e.headers.setContentType("application/x-www-form-urlencoded",!1);return Rt.getAdapter(e.adapter||Le.adapter,e)(e).then(function(t){St(e),e.response=t;try{t.data=Fe.call(e,e.transformResponse,t)}finally{delete e.response}return t.headers=ce.from(t.headers),t},function(t){if(!Be(t)&&(St(e),t&&t.response)){e.response=t.response;try{t.response.data=Fe.call(e,e.transformResponse,t.response)}finally{delete e.response}t.response.headers=ce.from(t.response.headers)}return Promise.reject(t)})}const At={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{At[e]=function(n){return typeof n===e||"a"+(t<1?"n ":" ")+e}});const vt={};At.transitional=function(e,t,n){function r(e,t){return"[Axios v"+dt+"] Transitional option '"+e+"'"+t+(n?". "+n:"")}return(n,o,s)=>{if(!1===e)throw new de(r(o," has been removed"+(t?" in "+t:"")),de.ERR_DEPRECATED);return t&&!vt[o]&&(vt[o]=!0,console.warn(r(o," has been deprecated since v"+t+" and will be removed in the near future"))),!e||e(n,o,s)}},At.spelling=function(e){return(t,n)=>(console.warn(`${n} is likely a misspelling of ${e}`),!0)};var Pt={assertOptions:function(e,t,n){if("object"!=typeof e||null===e)throw new de("options must be an object",de.ERR_BAD_OPTION_VALUE);const r=Object.keys(e);let o=r.length;for(;o-- >0;){const s=r[o],i=Object.prototype.hasOwnProperty.call(t,s)?t[s]:void 0;if(i){const t=e[s],n=void 0===t||i(t,s,e);if(!0!==n)throw new de("option "+s+" must be "+n,de.ERR_BAD_OPTION_VALUE);continue}if(!0!==n)throw new de("Unknown option "+s,de.ERR_BAD_OPTION)}},validators:At};const Tt=Pt.validators;let Ct=class{constructor(e){this.defaults=e||{},this.interceptors={request:new Se,response:new Se}}async request(e,t){try{return await this._request(e,t)}catch(e){if(e instanceof Error){let t={};Error.captureStackTrace?Error.captureStackTrace(t):t=new Error;const n=(()=>{if(!t.stack)return"";const e=t.stack.indexOf("\n");return-1===e?"":t.stack.slice(e+1)})();try{if(e.stack){if(n){const t=n.indexOf("\n"),r=-1===t?-1:n.indexOf("\n",t+1),o=-1===r?"":n.slice(r+1);String(e.stack).endsWith(o)||(e.stack+="\n"+n)}}else e.stack=n}catch(e){}}throw e}}_request(e,t){"string"==typeof e?(t=t||{}).url=e:t=e||{},t=Qe(this.defaults,t);const{transitional:n,paramsSerializer:r,headers:o}=t;void 0!==n&&Pt.assertOptions(n,{silentJSONParsing:Tt.transitional(Tt.boolean),forcedJSONParsing:Tt.transitional(Tt.boolean),clarifyTimeoutError:Tt.transitional(Tt.boolean),legacyInterceptorReqResOrdering:Tt.transitional(Tt.boolean),advertiseZstdAcceptEncoding:Tt.transitional(Tt.boolean),validateStatusUndefinedResolves:Tt.transitional(Tt.boolean)},!1),null!=r&&(G.isFunction(r)?t.paramsSerializer={serialize:r}:Pt.assertOptions(r,{encode:Tt.function,serialize:Tt.function},!0)),void 0!==t.allowAbsoluteUrls||(void 0!==this.defaults.allowAbsoluteUrls?t.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:t.allowAbsoluteUrls=!0),Pt.assertOptions(t,{baseUrl:Tt.spelling("baseURL"),withXsrfToken:Tt.spelling("withXSRFToken")},!0),t.method=(t.method||this.defaults.method||"get").toLowerCase();let s=o&&G.merge(o.common,o[t.method]);o&&G.forEach(["delete","get","head","post","put","patch","query","common"],e=>{delete o[e]}),t.headers=ce.concat(s,o);const i=[];let a=!0;this.interceptors.request.forEach(function(e){if("function"==typeof e.runWhen&&!1===e.runWhen(t))return;a=a&&e.synchronous;const n=t.transitional||_e;n&&n.legacyInterceptorReqResOrdering?i.unshift(e.fulfilled,e.rejected):i.push(e.fulfilled,e.rejected)});const c=[];let l;this.interceptors.response.forEach(function(e){c.push(e.fulfilled,e.rejected)});let u,f=0;if(!a){const e=[_t.bind(this),void 0];for(e.unshift(...i),e.push(...c),u=e.length,l=Promise.resolve(t);f_t.call(this,d)))}catch(e){l=Promise.reject(e)}break}}if(!l)try{l=_t.call(this,d)}catch(e){l=Promise.reject(e)}for(f=0,u=c.length;f{xt[t]=e});const jt=function t(n){const r=new Ct(n),o=e(Ct.prototype.request,r);return G.extend(o,Ct.prototype,r,{allOwnKeys:!0}),G.extend(o,r,null,{allOwnKeys:!0}),o.create=function(e){return t(Qe(n,e))},o}(Le);jt.Axios=Ct,jt.CanceledError=ke,jt.CancelToken=class e{constructor(e){if("function"!=typeof e)throw new TypeError("executor must be a function.");let t;this.promise=new Promise(function(e){t=e});const n=this;this.promise.then(e=>{if(!n._listeners)return;let t=n._listeners.length;for(;t-- >0;)n._listeners[t](e);n._listeners=null}),this.promise.then=e=>{let t;const r=new Promise(e=>{n.subscribe(e),t=e}).then(e);return r.cancel=function(){n.unsubscribe(t)},r},e(function(e,r,o){n.reason||(n.reason=new ke(e,r,o),t(n.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){this.reason?e(this.reason):this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;const t=this._listeners.indexOf(e);-1!==t&&this._listeners.splice(t,1)}toAbortSignal(){const e=new AbortController,t=t=>{e.abort(t)};return this.subscribe(t),e.signal.unsubscribe=()=>this.unsubscribe(t),e.signal}static source(){let t;return{token:new e(function(e){t=e}),cancel:t}}},jt.isCancel=Be,jt.VERSION=dt,jt.toFormData=be,jt.AxiosError=de,jt.Cancel=jt.CanceledError,jt.all=function(e){return Promise.all(e)},jt.spread=function(e){return function(t){return e.apply(null,t)}},jt.isAxiosError=function(e){return G.isObject(e)&&!0===e.isAxiosError},jt.mergeConfig=Qe,jt.AxiosHeaders=ce,jt.formToJSON=e=>Ue(G.isHTMLForm(e)?new FormData(e):e),jt.getAdapter=Rt.getAdapter,jt.HttpStatusCode=xt,jt.default=jt;const{Axios:Nt,AxiosError:Ut,CanceledError:Dt,isCancel:Lt,CancelToken:Ft,VERSION:Bt,all:kt,Cancel:qt,isAxiosError:It,spread:Mt,toFormData:zt,AxiosHeaders:Ht,HttpStatusCode:$t,formToJSON:Jt,getAdapter:Wt,mergeConfig:Vt,create:Kt}=jt;export{Nt as Axios,Ut as AxiosError,Ht as AxiosHeaders,qt as Cancel,Ft as CancelToken,Dt as CanceledError,$t as HttpStatusCode,Bt as VERSION,kt as all,Kt as create,jt as default,Jt as formToJSON,Wt as getAdapter,It as isAxiosError,Lt as isCancel,Vt as mergeConfig,Mt as spread,zt as toFormData}; -//# sourceMappingURL=axios.min.js.map diff --git a/server/node_modules/axios/dist/esm/axios.min.js.map b/server/node_modules/axios/dist/esm/axios.min.js.map deleted file mode 100644 index 7412bb0..0000000 --- a/server/node_modules/axios/dist/esm/axios.min.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"axios.min.js","sources":["../../lib/helpers/bind.js","../../lib/utils.js","../../lib/helpers/parseHeaders.js","../../lib/helpers/sanitizeHeaderValue.js","../../lib/core/AxiosHeaders.js","../../lib/core/AxiosError.js","../../lib/helpers/toFormData.js","../../lib/helpers/AxiosURLSearchParams.js","../../lib/helpers/buildURL.js","../../lib/core/InterceptorManager.js","../../lib/defaults/transitional.js","../../lib/platform/browser/index.js","../../lib/platform/browser/classes/URLSearchParams.js","../../lib/platform/browser/classes/FormData.js","../../lib/platform/browser/classes/Blob.js","../../lib/platform/common/utils.js","../../lib/platform/index.js","../../lib/helpers/formDataToJSON.js","../../lib/defaults/index.js","../../lib/helpers/toURLEncodedForm.js","../../lib/core/transformData.js","../../lib/cancel/isCancel.js","../../lib/cancel/CanceledError.js","../../lib/core/settle.js","../../lib/helpers/progressEventReducer.js","../../lib/helpers/speedometer.js","../../lib/helpers/throttle.js","../../lib/helpers/isURLSameOrigin.js","../../lib/helpers/cookies.js","../../lib/core/buildFullPath.js","../../lib/helpers/isAbsoluteURL.js","../../lib/helpers/combineURLs.js","../../lib/core/mergeConfig.js","../../lib/core/setFormDataHeaders.js","../../lib/helpers/resolveConfig.js","../../lib/adapters/xhr.js","../../lib/helpers/parseProtocol.js","../../lib/helpers/composeSignals.js","../../lib/helpers/trackStream.js","../../lib/helpers/estimateDataURLDecodedBytes.js","../../lib/env/data.js","../../lib/adapters/fetch.js","../../lib/adapters/adapters.js","../../lib/helpers/null.js","../../lib/core/dispatchRequest.js","../../lib/helpers/validator.js","../../lib/core/Axios.js","../../lib/helpers/HttpStatusCode.js","../../lib/axios.js","../../lib/cancel/CancelToken.js","../../lib/helpers/spread.js","../../lib/helpers/isAxiosError.js","../../index.js"],"sourcesContent":["'use strict';\n\n/**\n * Create a bound version of a function with a specified `this` context\n *\n * @param {Function} fn - The function to bind\n * @param {*} thisArg - The value to be passed as the `this` parameter\n * @returns {Function} A new function that will call the original function with the specified `this` context\n */\nexport default function bind(fn, thisArg) {\n return function wrap() {\n return fn.apply(thisArg, arguments);\n };\n}\n","'use strict';\n\nimport bind from './helpers/bind.js';\n\n// utils is a library of generic helper functions non-specific to axios\n\nconst { toString } = Object.prototype;\nconst { getPrototypeOf } = Object;\nconst { iterator, toStringTag } = Symbol;\n\n/* Creating a function that will check if an object has a property. */\nconst hasOwnProperty = (\n ({ hasOwnProperty }) =>\n (obj, prop) =>\n hasOwnProperty.call(obj, prop)\n)(Object.prototype);\n\n/**\n * Walk the prototype chain (excluding the shared Object.prototype) looking for\n * an own `prop`. This distinguishes genuine own/inherited members — including\n * class accessors and template prototypes — from members injected via\n * Object.prototype pollution (e.g. `Object.prototype.username = '...'`), which\n * live on Object.prototype itself and are therefore never matched.\n *\n * @param {*} thing The value whose chain to inspect\n * @param {string|symbol} prop The property key to look for\n *\n * @returns {boolean} True when `prop` is owned below Object.prototype\n */\nconst hasOwnInPrototypeChain = (thing, prop) => {\n let obj = thing;\n const seen = [];\n\n while (obj != null && obj !== Object.prototype) {\n if (seen.indexOf(obj) !== -1) {\n return false;\n }\n seen.push(obj);\n\n if (hasOwnProperty(obj, prop)) {\n return true;\n }\n obj = getPrototypeOf(obj);\n }\n return false;\n};\n\n/**\n * Read `obj[prop]` only when it is safe from Object.prototype pollution. Own\n * properties and members inherited from a non-Object.prototype source (a class\n * instance or template object) are honored; a value reachable only through a\n * polluted Object.prototype is ignored and `undefined` is returned.\n *\n * @param {*} obj The source object\n * @param {string|symbol} prop The property key to read\n *\n * @returns {*} The resolved value, or undefined when unsafe/absent\n */\nconst getSafeProp = (obj, prop) =>\n obj != null && hasOwnInPrototypeChain(obj, prop) ? obj[prop] : undefined;\n\nconst kindOf = ((cache) => (thing) => {\n const str = toString.call(thing);\n return cache[str] || (cache[str] = str.slice(8, -1).toLowerCase());\n})(Object.create(null));\n\nconst kindOfTest = (type) => {\n type = type.toLowerCase();\n return (thing) => kindOf(thing) === type;\n};\n\nconst typeOfTest = (type) => (thing) => typeof thing === type;\n\n/**\n * Determine if a value is a non-null object\n *\n * @param {Object} val The value to test\n *\n * @returns {boolean} True if value is an Array, otherwise false\n */\nconst { isArray } = Array;\n\n/**\n * Determine if a value is undefined\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if the value is undefined, otherwise false\n */\nconst isUndefined = typeOfTest('undefined');\n\n/**\n * Determine if a value is a Buffer\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a Buffer, otherwise false\n */\nfunction isBuffer(val) {\n return (\n val !== null &&\n !isUndefined(val) &&\n val.constructor !== null &&\n !isUndefined(val.constructor) &&\n isFunction(val.constructor.isBuffer) &&\n val.constructor.isBuffer(val)\n );\n}\n\n/**\n * Determine if a value is an ArrayBuffer\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is an ArrayBuffer, otherwise false\n */\nconst isArrayBuffer = kindOfTest('ArrayBuffer');\n\n/**\n * Determine if a value is a view on an ArrayBuffer\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a view on an ArrayBuffer, otherwise false\n */\nfunction isArrayBufferView(val) {\n let result;\n if (typeof ArrayBuffer !== 'undefined' && ArrayBuffer.isView) {\n result = ArrayBuffer.isView(val);\n } else {\n result = val && val.buffer && isArrayBuffer(val.buffer);\n }\n return result;\n}\n\n/**\n * Determine if a value is a String\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a String, otherwise false\n */\nconst isString = typeOfTest('string');\n\n/**\n * Determine if a value is a Function\n *\n * @param {*} val The value to test\n * @returns {boolean} True if value is a Function, otherwise false\n */\nconst isFunction = typeOfTest('function');\n\n/**\n * Determine if a value is a Number\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a Number, otherwise false\n */\nconst isNumber = typeOfTest('number');\n\n/**\n * Determine if a value is an Object\n *\n * @param {*} thing The value to test\n *\n * @returns {boolean} True if value is an Object, otherwise false\n */\nconst isObject = (thing) => thing !== null && typeof thing === 'object';\n\n/**\n * Determine if a value is a Boolean\n *\n * @param {*} thing The value to test\n * @returns {boolean} True if value is a Boolean, otherwise false\n */\nconst isBoolean = (thing) => thing === true || thing === false;\n\n/**\n * Determine if a value is a plain Object\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a plain Object, otherwise false\n */\nconst isPlainObject = (val) => {\n if (!isObject(val)) {\n return false;\n }\n\n const prototype = getPrototypeOf(val);\n return (\n (prototype === null ||\n prototype === Object.prototype ||\n getPrototypeOf(prototype) === null) &&\n // Treat any genuine (non-Object.prototype-polluted) Symbol.toStringTag or\n // Symbol.iterator as evidence the value is a tagged/iterable type rather\n // than a plain object, while ignoring keys injected onto Object.prototype.\n !hasOwnInPrototypeChain(val, toStringTag) &&\n !hasOwnInPrototypeChain(val, iterator)\n );\n};\n\n/**\n * Determine if a value is an empty object (safely handles Buffers)\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is an empty object, otherwise false\n */\nconst isEmptyObject = (val) => {\n // Early return for non-objects or Buffers to prevent RangeError\n if (!isObject(val) || isBuffer(val)) {\n return false;\n }\n\n try {\n return Object.keys(val).length === 0 && Object.getPrototypeOf(val) === Object.prototype;\n } catch (e) {\n // Fallback for any other objects that might cause RangeError with Object.keys()\n return false;\n }\n};\n\n/**\n * Determine if a value is a Date\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a Date, otherwise false\n */\nconst isDate = kindOfTest('Date');\n\n/**\n * Determine if a value is a File\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a File, otherwise false\n */\nconst isFile = kindOfTest('File');\n\n/**\n * Determine if a value is a React Native Blob\n * React Native \"blob\": an object with a `uri` attribute. Optionally, it can\n * also have a `name` and `type` attribute to specify filename and content type\n *\n * @see https://github.com/facebook/react-native/blob/26684cf3adf4094eb6c405d345a75bf8c7c0bf88/Libraries/Network/FormData.js#L68-L71\n *\n * @param {*} value The value to test\n *\n * @returns {boolean} True if value is a React Native Blob, otherwise false\n */\nconst isReactNativeBlob = (value) => {\n return !!(value && typeof value.uri !== 'undefined');\n};\n\n/**\n * Determine if environment is React Native\n * ReactNative `FormData` has a non-standard `getParts()` method\n *\n * @param {*} formData The formData to test\n *\n * @returns {boolean} True if environment is React Native, otherwise false\n */\nconst isReactNative = (formData) => formData && typeof formData.getParts !== 'undefined';\n\n/**\n * Determine if a value is a Blob\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a Blob, otherwise false\n */\nconst isBlob = kindOfTest('Blob');\n\n/**\n * Determine if a value is a FileList\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a FileList, otherwise false\n */\nconst isFileList = kindOfTest('FileList');\nconst isSet = kindOfTest('Set');\n\n/**\n * Determine if a value is a Stream\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a Stream, otherwise false\n */\nconst isStream = (val) => isObject(val) && isFunction(val.pipe);\n\n/**\n * Determine if a value is a FormData\n *\n * @param {*} thing The value to test\n *\n * @returns {boolean} True if value is an FormData, otherwise false\n */\nfunction getGlobal() {\n if (typeof globalThis !== 'undefined') return globalThis;\n if (typeof self !== 'undefined') return self;\n if (typeof window !== 'undefined') return window;\n if (typeof global !== 'undefined') return global;\n return {};\n}\n\nconst G = getGlobal();\nconst FormDataCtor = typeof G.FormData !== 'undefined' ? G.FormData : undefined;\n\nconst isFormData = (thing) => {\n if (!thing) return false;\n if (FormDataCtor && thing instanceof FormDataCtor) return true;\n // Reject plain objects inheriting directly from Object.prototype so prototype-pollution gadgets can't spoof FormData.\n const proto = getPrototypeOf(thing);\n if (!proto || proto === Object.prototype) return false;\n if (!isFunction(thing.append)) return false;\n const kind = kindOf(thing);\n return (\n kind === 'formdata' ||\n // detect form-data instance\n (kind === 'object' && isFunction(thing.toString) && thing.toString() === '[object FormData]')\n );\n};\n\n/**\n * Determine if a value is a URLSearchParams object\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a URLSearchParams object, otherwise false\n */\nconst isURLSearchParams = kindOfTest('URLSearchParams');\n\nconst [isReadableStream, isRequest, isResponse, isHeaders] = [\n 'ReadableStream',\n 'Request',\n 'Response',\n 'Headers',\n].map(kindOfTest);\n\n/**\n * Trim excess whitespace off the beginning and end of a string\n *\n * @param {String} str The String to trim\n *\n * @returns {String} The String freed of excess whitespace\n */\nconst trim = (str) => {\n return str.trim ? str.trim() : str.replace(/^[\\s\\uFEFF\\xA0]+|[\\s\\uFEFF\\xA0]+$/g, '');\n};\n/**\n * Iterate over an Array or an Object invoking a function for each item.\n *\n * If `obj` is an Array callback will be called passing\n * the value, index, and complete array for each item.\n *\n * If 'obj' is an Object callback will be called passing\n * the value, key, and complete object for each property.\n *\n * @param {Object|Array} obj The object to iterate\n * @param {Function} fn The callback to invoke for each item\n *\n * @param {Object} [options]\n * @param {Boolean} [options.allOwnKeys = false]\n * @returns {any}\n */\nfunction forEach(obj, fn, { allOwnKeys = false } = {}) {\n // Don't bother if no value provided\n if (obj === null || typeof obj === 'undefined') {\n return;\n }\n\n let i;\n let l;\n\n // Force an array if not already something iterable\n if (typeof obj !== 'object') {\n /*eslint no-param-reassign:0*/\n obj = [obj];\n }\n\n if (isArray(obj)) {\n // Iterate over array values\n for (i = 0, l = obj.length; i < l; i++) {\n fn.call(null, obj[i], i, obj);\n }\n } else {\n // Buffer check\n if (isBuffer(obj)) {\n return;\n }\n\n // Iterate over object keys\n const keys = allOwnKeys ? Object.getOwnPropertyNames(obj) : Object.keys(obj);\n const len = keys.length;\n let key;\n\n for (i = 0; i < len; i++) {\n key = keys[i];\n fn.call(null, obj[key], key, obj);\n }\n }\n}\n\n/**\n * Finds a key in an object, case-insensitive, returning the actual key name.\n * Returns null if the object is a Buffer or if no match is found.\n *\n * @param {Object} obj - The object to search.\n * @param {string} key - The key to find (case-insensitive).\n * @returns {?string} The actual key name if found, otherwise null.\n */\nfunction findKey(obj, key) {\n if (isBuffer(obj)) {\n return null;\n }\n\n key = key.toLowerCase();\n const keys = Object.keys(obj);\n let i = keys.length;\n let _key;\n while (i-- > 0) {\n _key = keys[i];\n if (key === _key.toLowerCase()) {\n return _key;\n }\n }\n return null;\n}\n\nconst _global = (() => {\n /*eslint no-undef:0*/\n if (typeof globalThis !== 'undefined') return globalThis;\n return typeof self !== 'undefined' ? self : typeof window !== 'undefined' ? window : global;\n})();\n\nconst isContextDefined = (context) => !isUndefined(context) && context !== _global;\n\n/**\n * Accepts varargs expecting each argument to be an object, then\n * immutably merges the properties of each object and returns result.\n *\n * When multiple objects contain the same key the later object in\n * the arguments list will take precedence.\n *\n * Example:\n *\n * ```js\n * const result = merge({foo: 123}, {foo: 456});\n * console.log(result.foo); // outputs 456\n * ```\n *\n * @param {Object} obj1 Object to merge\n *\n * @returns {Object} Result of all merge properties\n */\nfunction merge(...objs) {\n const { caseless, skipUndefined } = (isContextDefined(this) && this) || {};\n const result = {};\n const assignValue = (val, key) => {\n // Skip dangerous property names to prevent prototype pollution\n if (key === '__proto__' || key === 'constructor' || key === 'prototype') {\n return;\n }\n\n // findKey lowercases the key, so caseless lookup only applies to strings —\n // symbol keys are identity-matched.\n const targetKey = (caseless && typeof key === 'string' && findKey(result, key)) || key;\n // Read via own-prop only — a bare `result[targetKey]` walks the prototype\n // chain, so a polluted Object.prototype value could surface here and get\n // copied into the merged result.\n const existing = hasOwnProperty(result, targetKey) ? result[targetKey] : undefined;\n if (isPlainObject(existing) && isPlainObject(val)) {\n result[targetKey] = merge(existing, val);\n } else if (isPlainObject(val)) {\n result[targetKey] = merge({}, val);\n } else if (isArray(val)) {\n result[targetKey] = val.slice();\n } else if (!skipUndefined || !isUndefined(val)) {\n result[targetKey] = val;\n }\n };\n\n for (let i = 0, l = objs.length; i < l; i++) {\n const source = objs[i];\n if (!source || isBuffer(source)) {\n continue;\n }\n\n forEach(source, assignValue);\n\n if (typeof source !== 'object' || isArray(source)) {\n continue;\n }\n\n const symbols = Object.getOwnPropertySymbols(source);\n for (let j = 0; j < symbols.length; j++) {\n const symbol = symbols[j];\n if (propertyIsEnumerable.call(source, symbol)) {\n assignValue(source[symbol], symbol);\n }\n }\n }\n return result;\n}\n\n/**\n * Extends object a by mutably adding to it the properties of object b.\n *\n * @param {Object} a The object to be extended\n * @param {Object} b The object to copy properties from\n * @param {Object} thisArg The object to bind function to\n *\n * @param {Object} [options]\n * @param {Boolean} [options.allOwnKeys]\n * @returns {Object} The resulting value of object a\n */\nconst extend = (a, b, thisArg, { allOwnKeys } = {}) => {\n forEach(\n b,\n (val, key) => {\n if (thisArg && isFunction(val)) {\n Object.defineProperty(a, key, {\n // Null-proto descriptor so a polluted Object.prototype.get cannot\n // hijack defineProperty's accessor-vs-data resolution.\n __proto__: null,\n value: bind(val, thisArg),\n writable: true,\n enumerable: true,\n configurable: true,\n });\n } else {\n Object.defineProperty(a, key, {\n __proto__: null,\n value: val,\n writable: true,\n enumerable: true,\n configurable: true,\n });\n }\n },\n { allOwnKeys }\n );\n return a;\n};\n\n/**\n * Remove byte order marker. This catches EF BB BF (the UTF-8 BOM)\n *\n * @param {string} content with BOM\n *\n * @returns {string} content value without BOM\n */\nconst stripBOM = (content) => {\n if (content.charCodeAt(0) === 0xfeff) {\n content = content.slice(1);\n }\n return content;\n};\n\n/**\n * Inherit the prototype methods from one constructor into another\n * @param {function} constructor\n * @param {function} superConstructor\n * @param {object} [props]\n * @param {object} [descriptors]\n *\n * @returns {void}\n */\nconst inherits = (constructor, superConstructor, props, descriptors) => {\n constructor.prototype = Object.create(superConstructor.prototype, descriptors);\n Object.defineProperty(constructor.prototype, 'constructor', {\n __proto__: null,\n value: constructor,\n writable: true,\n enumerable: false,\n configurable: true,\n });\n Object.defineProperty(constructor, 'super', {\n __proto__: null,\n value: superConstructor.prototype,\n });\n props && Object.assign(constructor.prototype, props);\n};\n\n/**\n * Resolve object with deep prototype chain to a flat object\n * @param {Object} sourceObj source object\n * @param {Object} [destObj]\n * @param {Function|Boolean} [filter]\n * @param {Function} [propFilter]\n *\n * @returns {Object}\n */\nconst toFlatObject = (sourceObj, destObj, filter, propFilter) => {\n let props;\n let i;\n let prop;\n const merged = {};\n\n destObj = destObj || {};\n // eslint-disable-next-line no-eq-null,eqeqeq\n if (sourceObj == null) return destObj;\n\n do {\n props = Object.getOwnPropertyNames(sourceObj);\n i = props.length;\n while (i-- > 0) {\n prop = props[i];\n if ((!propFilter || propFilter(prop, sourceObj, destObj)) && !merged[prop]) {\n destObj[prop] = sourceObj[prop];\n merged[prop] = true;\n }\n }\n sourceObj = filter !== false && getPrototypeOf(sourceObj);\n } while (sourceObj && (!filter || filter(sourceObj, destObj)) && sourceObj !== Object.prototype);\n\n return destObj;\n};\n\n/**\n * Determines whether a string ends with the characters of a specified string\n *\n * @param {String} str\n * @param {String} searchString\n * @param {Number} [position= 0]\n *\n * @returns {boolean}\n */\nconst endsWith = (str, searchString, position) => {\n str = String(str);\n if (position === undefined || position > str.length) {\n position = str.length;\n }\n position -= searchString.length;\n const lastIndex = str.indexOf(searchString, position);\n return lastIndex !== -1 && lastIndex === position;\n};\n\n/**\n * Returns new array from array like object or null if failed\n *\n * @param {*} [thing]\n *\n * @returns {?Array}\n */\nconst toArray = (thing) => {\n if (!thing) return null;\n if (isArray(thing)) return thing;\n let i = thing.length;\n if (!isNumber(i)) return null;\n const arr = new Array(i);\n while (i-- > 0) {\n arr[i] = thing[i];\n }\n return arr;\n};\n\n/**\n * Checking if the Uint8Array exists and if it does, it returns a function that checks if the\n * thing passed in is an instance of Uint8Array\n *\n * @param {TypedArray}\n *\n * @returns {Array}\n */\n// eslint-disable-next-line func-names\nconst isTypedArray = ((TypedArray) => {\n // eslint-disable-next-line func-names\n return (thing) => {\n return TypedArray && thing instanceof TypedArray;\n };\n})(typeof Uint8Array !== 'undefined' && getPrototypeOf(Uint8Array));\n\n/**\n * For each entry in the object, call the function with the key and value.\n *\n * @param {Object} obj - The object to iterate over.\n * @param {Function} fn - The function to call for each entry.\n *\n * @returns {void}\n */\nconst forEachEntry = (obj, fn) => {\n const generator = obj && obj[iterator];\n\n const _iterator = generator.call(obj);\n\n let result;\n\n while ((result = _iterator.next()) && !result.done) {\n const pair = result.value;\n fn.call(obj, pair[0], pair[1]);\n }\n};\n\n/**\n * It takes a regular expression and a string, and returns an array of all the matches\n *\n * @param {string} regExp - The regular expression to match against.\n * @param {string} str - The string to search.\n *\n * @returns {Array}\n */\nconst matchAll = (regExp, str) => {\n let matches;\n const arr = [];\n\n while ((matches = regExp.exec(str)) !== null) {\n arr.push(matches);\n }\n\n return arr;\n};\n\n/* Checking if the kindOfTest function returns true when passed an HTMLFormElement. */\nconst isHTMLForm = kindOfTest('HTMLFormElement');\n\nconst toCamelCase = (str) => {\n return str.toLowerCase().replace(/[-_\\s]([a-z\\d])(\\w*)/g, function replacer(m, p1, p2) {\n return p1.toUpperCase() + p2;\n });\n};\n\nconst { propertyIsEnumerable } = Object.prototype;\n\n/**\n * Determine if a value is a RegExp object\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a RegExp object, otherwise false\n */\nconst isRegExp = kindOfTest('RegExp');\n\nconst reduceDescriptors = (obj, reducer) => {\n const descriptors = Object.getOwnPropertyDescriptors(obj);\n const reducedDescriptors = {};\n\n forEach(descriptors, (descriptor, name) => {\n let ret;\n if ((ret = reducer(descriptor, name, obj)) !== false) {\n reducedDescriptors[name] = ret || descriptor;\n }\n });\n\n Object.defineProperties(obj, reducedDescriptors);\n};\n\n/**\n * Makes all methods read-only\n * @param {Object} obj\n */\n\nconst freezeMethods = (obj) => {\n reduceDescriptors(obj, (descriptor, name) => {\n // skip restricted props in strict mode\n if (isFunction(obj) && ['arguments', 'caller', 'callee'].includes(name)) {\n return false;\n }\n\n const value = obj[name];\n\n if (!isFunction(value)) return;\n\n descriptor.enumerable = false;\n\n if ('writable' in descriptor) {\n descriptor.writable = false;\n return;\n }\n\n if (!descriptor.set) {\n descriptor.set = () => {\n throw Error(\"Can not rewrite read-only method '\" + name + \"'\");\n };\n }\n });\n};\n\n/**\n * Converts an array or a delimited string into an object set with values as keys and true as values.\n * Useful for fast membership checks.\n *\n * @param {Array|string} arrayOrString - The array or string to convert.\n * @param {string} delimiter - The delimiter to use if input is a string.\n * @returns {Object} An object with keys from the array or string, values set to true.\n */\nconst toObjectSet = (arrayOrString, delimiter) => {\n const obj = {};\n\n const define = (arr) => {\n arr.forEach((value) => {\n obj[value] = true;\n });\n };\n\n isArray(arrayOrString) ? define(arrayOrString) : define(String(arrayOrString).split(delimiter));\n\n return obj;\n};\n\nconst noop = () => {};\n\nconst toFiniteNumber = (value, defaultValue) => {\n return value != null && Number.isFinite((value = +value)) ? value : defaultValue;\n};\n\n/**\n * If the thing is a FormData object, return true, otherwise return false.\n *\n * @param {unknown} thing - The thing to check.\n *\n * @returns {boolean}\n */\nfunction isSpecCompliantForm(thing) {\n return !!(\n thing &&\n isFunction(thing.append) &&\n thing[toStringTag] === 'FormData' &&\n thing[iterator]\n );\n}\n\n/**\n * Recursively converts an object to a JSON-compatible object, handling circular references and Buffers.\n *\n * @param {Object} obj - The object to convert.\n * @returns {Object} The JSON-compatible object.\n */\nconst toJSONObject = (obj) => {\n const visited = new WeakSet();\n\n const visit = (source) => {\n if (isObject(source)) {\n if (visited.has(source)) {\n return;\n }\n\n //Buffer check\n if (isBuffer(source)) {\n return source;\n }\n\n if (!('toJSON' in source)) {\n // add-on descent / delete-on-ascent: preserves path semantics, so DAG nodes serialise at every occurrence (see #7230).\n visited.add(source);\n\n let target;\n\n if (isSet(source)) {\n target = [];\n for (const value of source) {\n const reducedValue = visit(value);\n !isUndefined(reducedValue) && target.push(reducedValue);\n }\n } else {\n target = isArray(source) ? [] : {};\n\n forEach(source, (value, key) => {\n const reducedValue = visit(value);\n !isUndefined(reducedValue) && (target[key] = reducedValue);\n });\n }\n\n visited.delete(source);\n\n return target;\n }\n }\n\n return source;\n };\n\n return visit(obj);\n};\n\n/**\n * Determines if a value is an async function.\n *\n * @param {*} thing - The value to test.\n * @returns {boolean} True if value is an async function, otherwise false.\n */\nconst isAsyncFn = kindOfTest('AsyncFunction');\n\n/**\n * Determines if a value is thenable (has then and catch methods).\n *\n * @param {*} thing - The value to test.\n * @returns {boolean} True if value is thenable, otherwise false.\n */\nconst isThenable = (thing) =>\n thing &&\n (isObject(thing) || isFunction(thing)) &&\n isFunction(thing.then) &&\n isFunction(thing.catch);\n\n// original code\n// https://github.com/DigitalBrainJS/AxiosPromise/blob/16deab13710ec09779922131f3fa5954320f83ab/lib/utils.js#L11-L34\n\n/**\n * Provides a cross-platform setImmediate implementation.\n * Uses native setImmediate if available, otherwise falls back to postMessage or setTimeout.\n *\n * @param {boolean} setImmediateSupported - Whether setImmediate is supported.\n * @param {boolean} postMessageSupported - Whether postMessage is supported.\n * @returns {Function} A function to schedule a callback asynchronously.\n */\nconst _setImmediate = ((setImmediateSupported, postMessageSupported) => {\n if (setImmediateSupported) {\n return setImmediate;\n }\n\n return postMessageSupported\n ? ((token, callbacks) => {\n _global.addEventListener(\n 'message',\n ({ source, data }) => {\n if (source === _global && data === token) {\n callbacks.length && callbacks.shift()();\n }\n },\n false\n );\n\n return (cb) => {\n callbacks.push(cb);\n _global.postMessage(token, '*');\n };\n })(`axios@${Math.random()}`, [])\n : (cb) => setTimeout(cb);\n})(typeof setImmediate === 'function', isFunction(_global.postMessage));\n\n/**\n * Schedules a microtask or asynchronous callback as soon as possible.\n * Uses queueMicrotask if available, otherwise falls back to process.nextTick or _setImmediate.\n *\n * @type {Function}\n */\nconst asap =\n typeof queueMicrotask !== 'undefined'\n ? queueMicrotask.bind(_global)\n : (typeof process !== 'undefined' && process.nextTick) || _setImmediate;\n\n// *********************\n\nconst isIterable = (thing) => thing != null && isFunction(thing[iterator]);\n\n/**\n * Determine if a value is iterable via an iterator that is NOT sourced solely\n * from a polluted Object.prototype. Use this instead of `isIterable` whenever\n * the iterable comes from untrusted input (e.g. user-supplied header sources),\n * so `Object.prototype[Symbol.iterator] = ...` cannot turn an ordinary object\n * into an attacker-controlled entries iterator.\n *\n * @param {*} thing The value to test\n *\n * @returns {boolean} True if value has a non-polluted iterator\n */\nconst isSafeIterable = (thing) =>\n thing != null && hasOwnInPrototypeChain(thing, iterator) && isIterable(thing);\n\nexport default {\n isArray,\n isArrayBuffer,\n isBuffer,\n isFormData,\n isArrayBufferView,\n isString,\n isNumber,\n isBoolean,\n isObject,\n isPlainObject,\n isEmptyObject,\n isReadableStream,\n isRequest,\n isResponse,\n isHeaders,\n isUndefined,\n isDate,\n isFile,\n isReactNativeBlob,\n isReactNative,\n isBlob,\n isRegExp,\n isFunction,\n isStream,\n isURLSearchParams,\n isTypedArray,\n isFileList,\n forEach,\n merge,\n extend,\n trim,\n stripBOM,\n inherits,\n toFlatObject,\n kindOf,\n kindOfTest,\n endsWith,\n toArray,\n forEachEntry,\n matchAll,\n isHTMLForm,\n hasOwnProperty,\n hasOwnProp: hasOwnProperty, // an alias to avoid ESLint no-prototype-builtins detection\n hasOwnInPrototypeChain,\n getSafeProp,\n reduceDescriptors,\n freezeMethods,\n toObjectSet,\n toCamelCase,\n noop,\n toFiniteNumber,\n findKey,\n global: _global,\n isContextDefined,\n isSpecCompliantForm,\n toJSONObject,\n isAsyncFn,\n isThenable,\n setImmediate: _setImmediate,\n asap,\n isIterable,\n isSafeIterable,\n};\n","'use strict';\n\nimport utils from '../utils.js';\n\n// RawAxiosHeaders whose duplicates are ignored by node\n// c.f. https://nodejs.org/api/http.html#http_message_headers\nconst ignoreDuplicateOf = utils.toObjectSet([\n 'age',\n 'authorization',\n 'content-length',\n 'content-type',\n 'etag',\n 'expires',\n 'from',\n 'host',\n 'if-modified-since',\n 'if-unmodified-since',\n 'last-modified',\n 'location',\n 'max-forwards',\n 'proxy-authorization',\n 'referer',\n 'retry-after',\n 'user-agent',\n]);\n\n/**\n * Parse headers into an object\n *\n * ```\n * Date: Wed, 27 Aug 2014 08:58:49 GMT\n * Content-Type: application/json\n * Connection: keep-alive\n * Transfer-Encoding: chunked\n * ```\n *\n * @param {String} rawHeaders Headers needing to be parsed\n *\n * @returns {Object} Headers parsed into an object\n */\nexport default (rawHeaders) => {\n const parsed = {};\n let key;\n let val;\n let i;\n\n rawHeaders &&\n rawHeaders.split('\\n').forEach(function parser(line) {\n i = line.indexOf(':');\n key = line.substring(0, i).trim().toLowerCase();\n val = line.substring(i + 1).trim();\n\n const hasKey = utils.hasOwnProp(parsed, key);\n\n if (!key || (hasKey && utils.hasOwnProp(ignoreDuplicateOf, key))) {\n return;\n }\n\n if (key === 'set-cookie') {\n if (hasKey) {\n parsed[key].push(val);\n } else {\n parsed[key] = [val];\n }\n } else {\n parsed[key] = hasKey ? parsed[key] + ', ' + val : val;\n }\n });\n\n return parsed;\n};\n","'use strict';\n\nimport utils from '../utils.js';\n\nfunction trimSPorHTAB(str) {\n let start = 0;\n let end = str.length;\n\n while (start < end) {\n const code = str.charCodeAt(start);\n\n if (code !== 0x09 && code !== 0x20) {\n break;\n }\n\n start += 1;\n }\n\n while (end > start) {\n const code = str.charCodeAt(end - 1);\n\n if (code !== 0x09 && code !== 0x20) {\n break;\n }\n\n end -= 1;\n }\n\n return start === 0 && end === str.length ? str : str.slice(start, end);\n}\n\n// The control-code ranges are intentional: header sanitization strips C0/DEL bytes.\n// eslint-disable-next-line no-control-regex\nconst INVALID_UNICODE_HEADER_VALUE_CHARS = new RegExp('[\\\\u0000-\\\\u0008\\\\u000a-\\\\u001f\\\\u007f]+', 'g');\n// eslint-disable-next-line no-control-regex\nconst INVALID_BYTE_STRING_HEADER_VALUE_CHARS = new RegExp('[^\\\\u0009\\\\u0020-\\\\u007e\\\\u0080-\\\\u00ff]+', 'g');\n\nfunction sanitizeValue(value, invalidChars) {\n if (utils.isArray(value)) {\n return value.map((item) => sanitizeValue(item, invalidChars));\n }\n\n return trimSPorHTAB(String(value).replace(invalidChars, ''));\n}\n\nexport const sanitizeHeaderValue = (value) =>\n sanitizeValue(value, INVALID_UNICODE_HEADER_VALUE_CHARS);\n\nexport const sanitizeByteStringHeaderValue = (value) =>\n sanitizeValue(value, INVALID_BYTE_STRING_HEADER_VALUE_CHARS);\n\nexport function toByteStringHeaderObject(headers) {\n const byteStringHeaders = Object.create(null);\n\n utils.forEach(headers.toJSON(), (value, header) => {\n byteStringHeaders[header] = sanitizeByteStringHeaderValue(value);\n });\n\n return byteStringHeaders;\n}\n","'use strict';\n\nimport utils from '../utils.js';\nimport parseHeaders from '../helpers/parseHeaders.js';\nimport { sanitizeHeaderValue } from '../helpers/sanitizeHeaderValue.js';\n\nconst $internals = Symbol('internals');\n\nfunction normalizeHeader(header) {\n return header && String(header).trim().toLowerCase();\n}\n\nfunction normalizeValue(value) {\n if (value === false || value == null) {\n return value;\n }\n\n return utils.isArray(value) ? value.map(normalizeValue) : sanitizeHeaderValue(String(value));\n}\n\nfunction parseTokens(str) {\n const tokens = Object.create(null);\n const tokensRE = /([^\\s,;=]+)\\s*(?:=\\s*([^,;]+))?/g;\n let match;\n\n while ((match = tokensRE.exec(str))) {\n tokens[match[1]] = match[2];\n }\n\n return tokens;\n}\n\nconst parameterNameRE = /^[!#$%&'*+\\-.^_`|~0-9A-Za-z]+$/;\n\nfunction trimOWS(value) {\n let start = 0;\n let end = value.length;\n\n while (start < end) {\n const code = value.charCodeAt(start);\n\n if (code !== 0x09 && code !== 0x20) {\n break;\n }\n\n start += 1;\n }\n\n while (end > start) {\n const code = value.charCodeAt(end - 1);\n\n if (code !== 0x09 && code !== 0x20) {\n break;\n }\n\n end -= 1;\n }\n\n return start === 0 && end === value.length ? value : value.slice(start, end);\n}\n\nfunction decodeQuotedString(value) {\n const last = value.length - 1;\n\n if (last < 1 || value.charCodeAt(0) !== 0x22 || value.charCodeAt(last) !== 0x22) {\n return value;\n }\n\n let decoded = '';\n\n for (let i = 1; i < last; i++) {\n const code = value.charCodeAt(i);\n\n if (code === 0x22) {\n return value;\n }\n\n if (code === 0x5c) {\n i += 1;\n\n if (i >= last) {\n return value;\n }\n }\n\n decoded += value[i];\n }\n\n return decoded;\n}\n\nfunction parseParameters(value) {\n const parameters = Object.create(null);\n const str = String(value);\n let start = 0;\n let quoted = false;\n let escaped = false;\n\n function parseParameter(end) {\n const part = trimOWS(str.slice(start, end));\n const equals = part.indexOf('=');\n\n if (equals < 1) {\n return;\n }\n\n const name = trimOWS(part.slice(0, equals));\n\n if (!parameterNameRE.test(name)) {\n return;\n }\n\n const normalizedName = name.toLowerCase();\n\n if (\n normalizedName === '__proto__' ||\n normalizedName === 'constructor' ||\n normalizedName === 'prototype'\n ) {\n return;\n }\n\n const parameterValue = trimOWS(part.slice(equals + 1));\n parameters[normalizedName] = decodeQuotedString(parameterValue);\n }\n\n for (let i = 0; i < str.length; i++) {\n const code = str.charCodeAt(i);\n\n if (quoted) {\n if (escaped) {\n escaped = false;\n } else if (code === 0x5c) {\n escaped = true;\n } else if (code === 0x22) {\n quoted = false;\n }\n } else if (code === 0x22) {\n quoted = true;\n } else if (code === 0x2c || code === 0x3b) {\n parseParameter(i);\n start = i + 1;\n }\n }\n\n parseParameter(str.length);\n\n return parameters;\n}\n\nconst isValidHeaderName = (str) => /^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(str.trim());\n\nfunction matchHeaderValue(context, value, header, filter, isHeaderNameFilter) {\n if (utils.isFunction(filter)) {\n return filter.call(this, value, header);\n }\n\n if (isHeaderNameFilter) {\n value = header;\n }\n\n if (!utils.isString(value)) return;\n\n if (utils.isString(filter)) {\n return value.indexOf(filter) !== -1;\n }\n\n if (utils.isRegExp(filter)) {\n return filter.test(value);\n }\n}\n\nfunction formatHeader(header) {\n return header\n .trim()\n .toLowerCase()\n .replace(/([a-z\\d])(\\w*)/g, (w, char, str) => {\n return char.toUpperCase() + str;\n });\n}\n\nfunction buildAccessors(obj, header) {\n const accessorName = utils.toCamelCase(' ' + header);\n\n ['get', 'set', 'has'].forEach((methodName) => {\n Object.defineProperty(obj, methodName + accessorName, {\n // Null-proto descriptor so a polluted Object.prototype.get cannot turn\n // this data descriptor into an accessor descriptor on the way in.\n __proto__: null,\n value: function (arg1, arg2, arg3) {\n return this[methodName].call(this, header, arg1, arg2, arg3);\n },\n configurable: true,\n });\n });\n}\n\nclass AxiosHeaders {\n constructor(headers) {\n headers && this.set(headers);\n }\n\n set(header, valueOrRewrite, rewrite) {\n const self = this;\n\n function setHeader(_value, _header, _rewrite) {\n const lHeader = normalizeHeader(_header);\n\n if (!lHeader) {\n return;\n }\n\n const key = utils.findKey(self, lHeader);\n\n if (\n !key ||\n self[key] === undefined ||\n _rewrite === true ||\n (_rewrite === undefined && self[key] !== false)\n ) {\n self[key || _header] = normalizeValue(_value);\n }\n }\n\n const setHeaders = (headers, _rewrite) =>\n utils.forEach(headers, (_value, _header) => setHeader(_value, _header, _rewrite));\n\n if (utils.isPlainObject(header) || header instanceof this.constructor) {\n setHeaders(header, valueOrRewrite);\n } else if (utils.isString(header) && (header = header.trim()) && !isValidHeaderName(header)) {\n setHeaders(parseHeaders(header), valueOrRewrite);\n } else if (utils.isObject(header) && utils.isSafeIterable(header)) {\n let obj = Object.create(null),\n dest,\n key;\n for (const entry of header) {\n if (!utils.isArray(entry)) {\n throw new TypeError('Object iterator must return a key-value pair');\n }\n\n key = entry[0];\n\n if (utils.hasOwnProp(obj, key)) {\n dest = obj[key];\n obj[key] = utils.isArray(dest) ? [...dest, entry[1]] : [dest, entry[1]];\n } else {\n obj[key] = entry[1];\n }\n }\n\n setHeaders(obj, valueOrRewrite);\n } else {\n header != null && setHeader(valueOrRewrite, header, rewrite);\n }\n\n return this;\n }\n\n get(header, parser) {\n header = normalizeHeader(header);\n\n if (header) {\n const key = utils.findKey(this, header);\n\n if (key) {\n const value = this[key];\n\n if (!parser) {\n return value;\n }\n\n if (parser === true) {\n return parseTokens(value);\n }\n\n if (utils.isFunction(parser)) {\n return parser.call(this, value, key);\n }\n\n if (utils.isRegExp(parser)) {\n return parser.exec(value);\n }\n\n throw new TypeError('parser must be boolean|regexp|function');\n }\n }\n }\n\n has(header, matcher) {\n header = normalizeHeader(header);\n\n if (header) {\n const key = utils.findKey(this, header);\n\n return !!(\n key &&\n this[key] !== undefined &&\n (!matcher || matchHeaderValue(this, this[key], key, matcher))\n );\n }\n\n return false;\n }\n\n delete(header, matcher) {\n const self = this;\n let deleted = false;\n\n function deleteHeader(_header) {\n _header = normalizeHeader(_header);\n\n if (_header) {\n const key = utils.findKey(self, _header);\n\n if (key && (!matcher || matchHeaderValue(self, self[key], key, matcher))) {\n delete self[key];\n\n deleted = true;\n }\n }\n }\n\n if (utils.isArray(header)) {\n header.forEach(deleteHeader);\n } else {\n deleteHeader(header);\n }\n\n return deleted;\n }\n\n clear(matcher) {\n const keys = Object.keys(this);\n let i = keys.length;\n let deleted = false;\n\n while (i--) {\n const key = keys[i];\n if (!matcher || matchHeaderValue(this, this[key], key, matcher, true)) {\n delete this[key];\n deleted = true;\n }\n }\n\n return deleted;\n }\n\n normalize(format) {\n const self = this;\n const headers = {};\n\n utils.forEach(this, (value, header) => {\n const key = utils.findKey(headers, header);\n\n if (key) {\n self[key] = normalizeValue(value);\n delete self[header];\n return;\n }\n\n const normalized = format ? formatHeader(header) : String(header).trim();\n\n if (normalized !== header) {\n delete self[header];\n }\n\n self[normalized] = normalizeValue(value);\n\n headers[normalized] = true;\n });\n\n return this;\n }\n\n concat(...targets) {\n return this.constructor.concat(this, ...targets);\n }\n\n toJSON(asStrings) {\n const obj = Object.create(null);\n\n utils.forEach(this, (value, header) => {\n value != null &&\n value !== false &&\n (obj[header] = asStrings && utils.isArray(value) ? value.join(', ') : value);\n });\n\n return obj;\n }\n\n [Symbol.iterator]() {\n return Object.entries(this.toJSON())[Symbol.iterator]();\n }\n\n toString() {\n return Object.entries(this.toJSON())\n .map(([header, value]) => header + ': ' + value)\n .join('\\n');\n }\n\n getSetCookie() {\n const value = this.get('set-cookie');\n return utils.isArray(value) ? value : value == null || value === false ? [] : [value];\n }\n\n get [Symbol.toStringTag]() {\n return 'AxiosHeaders';\n }\n\n static from(thing) {\n return thing instanceof this ? thing : new this(thing);\n }\n\n static parseParameters(value) {\n return parseParameters(value);\n }\n\n static concat(first, ...targets) {\n const computed = new this(first);\n\n targets.forEach((target) => computed.set(target));\n\n return computed;\n }\n\n static accessor(header) {\n const internals =\n (this[$internals] =\n this[$internals] =\n {\n accessors: {},\n });\n\n const accessors = internals.accessors;\n const prototype = this.prototype;\n\n function defineAccessor(_header) {\n const lHeader = normalizeHeader(_header);\n\n if (!accessors[lHeader]) {\n buildAccessors(prototype, _header);\n accessors[lHeader] = true;\n }\n }\n\n utils.isArray(header) ? header.forEach(defineAccessor) : defineAccessor(header);\n\n return this;\n }\n}\n\nAxiosHeaders.accessor([\n 'Content-Type',\n 'Content-Length',\n 'Accept',\n 'Accept-Encoding',\n 'User-Agent',\n 'Authorization',\n]);\n\n// reserved names hotfix\nutils.reduceDescriptors(AxiosHeaders.prototype, ({ value }, key) => {\n let mapped = key[0].toUpperCase() + key.slice(1); // map `set` => `Set`\n return {\n get: () => value,\n set(headerValue) {\n this[mapped] = headerValue;\n },\n };\n});\n\nutils.freezeMethods(AxiosHeaders);\n\nexport default AxiosHeaders;\n","'use strict';\n\nimport utils from '../utils.js';\nimport AxiosHeaders from './AxiosHeaders.js';\n\nexport const REDACTED = '[REDACTED ****]';\n\nfunction hasOwnOrPrototypeToJSON(source) {\n if (utils.hasOwnProp(source, 'toJSON')) {\n return true;\n }\n\n let prototype = Object.getPrototypeOf(source);\n\n while (prototype && prototype !== Object.prototype) {\n if (utils.hasOwnProp(prototype, 'toJSON')) {\n return true;\n }\n\n prototype = Object.getPrototypeOf(prototype);\n }\n\n return false;\n}\n\n// Build a plain-object snapshot of `config` and replace the value of any key\n// (case-insensitive) listed in `redactKeys` with REDACTED. Walks through arrays\n// and AxiosHeaders, and short-circuits on circular references.\nfunction redactConfig(config, redactKeys) {\n const lowerKeys = new Set(redactKeys.map((k) => String(k).toLowerCase()));\n const seen = [];\n\n const visit = (source) => {\n if (source === null || typeof source !== 'object') return source;\n if (utils.isBuffer(source)) return source;\n if (seen.indexOf(source) !== -1) return undefined;\n\n if (source instanceof AxiosHeaders) {\n source = source.toJSON();\n }\n\n seen.push(source);\n\n let result;\n if (utils.isArray(source)) {\n result = [];\n source.forEach((v, i) => {\n const reducedValue = visit(v);\n if (!utils.isUndefined(reducedValue)) {\n result[i] = reducedValue;\n }\n });\n } else {\n if (!utils.isPlainObject(source) && hasOwnOrPrototypeToJSON(source)) {\n seen.pop();\n return source;\n }\n\n result = Object.create(null);\n for (const [key, value] of Object.entries(source)) {\n const reducedValue = lowerKeys.has(key.toLowerCase()) ? REDACTED : visit(value);\n if (!utils.isUndefined(reducedValue)) {\n result[key] = reducedValue;\n }\n }\n }\n\n seen.pop();\n return result;\n };\n\n return visit(config);\n}\n\nfunction stringifySafely(value) {\n try {\n return String(value);\n } catch (err) {\n return '';\n }\n}\n\nfunction aggregateErrorMessage(error) {\n const message = error.errors\n .map((entry) => {\n try {\n return entry && entry.message ? stringifySafely(entry.message) : stringifySafely(entry);\n } catch (err) {\n return '';\n }\n })\n .filter(Boolean)\n .join('; ');\n\n return message || error.name || 'AggregateError';\n}\n\nclass AxiosError extends Error {\n static from(error, code, config, request, response, customProps) {\n // `AggregateError` (thrown by Node on dual-stack/Happy-Eyeballs connection\n // failures) has an empty `message`; its detail lives in `errors[]`. Without\n // this, the wrapped error surfaces with a blank message (see #6721).\n let message = error.message;\n if (!message && utils.isArray(error.errors) && error.errors.length) {\n message = aggregateErrorMessage(error);\n }\n\n const axiosError = new AxiosError(message, code || error.code, config, request, response);\n // Match native `Error` `cause` semantics: non-enumerable. The wrapped\n // error often carries circular internals (sockets, requests, agents), so\n // an enumerable `cause` makes structured loggers (pino/winston) and any\n // own-property walk throw \"Converting circular structure to JSON\".\n // Regression from #6982; see #7205. `__proto__: null` mirrors the\n // `message` descriptor below (prototype-pollution-safe descriptor).\n Object.defineProperty(axiosError, 'cause', {\n __proto__: null,\n value: error,\n writable: true,\n enumerable: false,\n configurable: true,\n });\n axiosError.name = error.name;\n\n // Preserve status from the original error if not already set from response\n if (error.status != null && axiosError.status == null) {\n axiosError.status = error.status;\n }\n\n customProps && Object.assign(axiosError, customProps);\n return axiosError;\n }\n\n /**\n * Create an Error with the specified message, config, error code, request and response.\n *\n * @param {string} message The error message.\n * @param {string} [code] The error code (for example, 'ECONNABORTED').\n * @param {Object} [config] The config.\n * @param {Object} [request] The request.\n * @param {Object} [response] The response.\n *\n * @returns {Error} The created error.\n */\n constructor(message, code, config, request, response) {\n super(message);\n\n // Make message enumerable to maintain backward compatibility\n // The native Error constructor sets message as non-enumerable,\n // but axios < v1.13.3 had it as enumerable\n Object.defineProperty(this, 'message', {\n // Null-proto descriptor so a polluted Object.prototype.get cannot turn\n // this data descriptor into an accessor descriptor on the way in.\n __proto__: null,\n value: message,\n enumerable: true,\n writable: true,\n configurable: true,\n });\n\n this.name = 'AxiosError';\n this.isAxiosError = true;\n code && (this.code = code);\n config && (this.config = config);\n request && (this.request = request);\n if (response) {\n this.response = response;\n this.status = response.status;\n }\n }\n\n toJSON() {\n // Opt-in redaction: when the request config carries a `redact` array, the\n // value of any matching key (case-insensitive, at any depth) is replaced\n // with REDACTED in the serialized snapshot. Undefined or empty leaves the\n // existing serialization behavior unchanged.\n const config = this.config;\n const redactKeys = config && utils.hasOwnProp(config, 'redact') ? config.redact : undefined;\n const serializedConfig =\n utils.isArray(redactKeys) && redactKeys.length > 0\n ? redactConfig(config, redactKeys)\n : utils.toJSONObject(config);\n\n return {\n // Standard\n message: this.message,\n name: this.name,\n // Microsoft\n description: this.description,\n number: this.number,\n // Mozilla\n fileName: this.fileName,\n lineNumber: this.lineNumber,\n columnNumber: this.columnNumber,\n stack: this.stack,\n // Axios\n config: serializedConfig,\n code: this.code,\n status: this.status,\n };\n }\n}\n\n// This can be changed to static properties as soon as the parser options in .eslint.cjs are updated.\nAxiosError.ERR_BAD_OPTION_VALUE = 'ERR_BAD_OPTION_VALUE';\nAxiosError.ERR_BAD_OPTION = 'ERR_BAD_OPTION';\nAxiosError.ECONNABORTED = 'ECONNABORTED';\nAxiosError.ETIMEDOUT = 'ETIMEDOUT';\nAxiosError.ECONNREFUSED = 'ECONNREFUSED';\nAxiosError.ERR_NETWORK = 'ERR_NETWORK';\nAxiosError.ERR_FR_TOO_MANY_REDIRECTS = 'ERR_FR_TOO_MANY_REDIRECTS';\nAxiosError.ERR_DEPRECATED = 'ERR_DEPRECATED';\nAxiosError.ERR_BAD_RESPONSE = 'ERR_BAD_RESPONSE';\nAxiosError.ERR_BAD_REQUEST = 'ERR_BAD_REQUEST';\nAxiosError.ERR_CANCELED = 'ERR_CANCELED';\nAxiosError.ERR_NOT_SUPPORT = 'ERR_NOT_SUPPORT';\nAxiosError.ERR_INVALID_URL = 'ERR_INVALID_URL';\nAxiosError.ERR_FORM_DATA_DEPTH_EXCEEDED = 'ERR_FORM_DATA_DEPTH_EXCEEDED';\n\nexport default AxiosError;\n","'use strict';\n\nimport utils from '../utils.js';\nimport AxiosError from '../core/AxiosError.js';\n// temporary hotfix to avoid circular references until AxiosURLSearchParams is refactored\nimport PlatformFormData from '../platform/node/classes/FormData.js';\nimport PlatformBuffer from '../platform/node/classes/Buffer.js';\n\n// Default nesting limit shared with the inverse transform (formDataToJSON) so\n// the FormData <-> JSON round-trip stays symmetric.\nexport const DEFAULT_FORM_DATA_MAX_DEPTH = 100;\n\n/**\n * Determines if the given thing is a array or js object.\n *\n * @param {string} thing - The object or array to be visited.\n *\n * @returns {boolean}\n */\nfunction isVisitable(thing) {\n return utils.isPlainObject(thing) || utils.isArray(thing);\n}\n\n/**\n * It removes the brackets from the end of a string\n *\n * @param {string} key - The key of the parameter.\n *\n * @returns {string} the key without the brackets.\n */\nfunction removeBrackets(key) {\n return utils.endsWith(key, '[]') ? key.slice(0, -2) : key;\n}\n\n/**\n * It takes a path, a key, and a boolean, and returns a string\n *\n * @param {string} path - The path to the current key.\n * @param {string} key - The key of the current object being iterated over.\n * @param {string} dots - If true, the key will be rendered with dots instead of brackets.\n *\n * @returns {string} The path to the current key.\n */\nfunction renderKey(path, key, dots) {\n if (!path) return key;\n return path\n .concat(key)\n .map(function each(token, i) {\n // eslint-disable-next-line no-param-reassign\n token = removeBrackets(token);\n return !dots && i ? '[' + token + ']' : token;\n })\n .join(dots ? '.' : '');\n}\n\n/**\n * If the array is an array and none of its elements are visitable, then it's a flat array.\n *\n * @param {Array} arr - The array to check\n *\n * @returns {boolean}\n */\nfunction isFlatArray(arr) {\n return utils.isArray(arr) && !arr.some(isVisitable);\n}\n\nconst predicates = utils.toFlatObject(utils, {}, null, function filter(prop) {\n return /^is[A-Z]/.test(prop);\n});\n\n/**\n * Convert a data object to FormData\n *\n * @param {Object} obj\n * @param {?Object} [formData]\n * @param {?Object} [options]\n * @param {Function} [options.visitor]\n * @param {Boolean} [options.metaTokens = true]\n * @param {Boolean} [options.dots = false]\n * @param {?Boolean} [options.indexes = false]\n *\n * @returns {Object}\n **/\n\n/**\n * It converts an object into a FormData object\n *\n * @param {Object} obj - The object to convert to form data.\n * @param {string} formData - The FormData object to append to.\n * @param {Object} options\n *\n * @returns\n */\nfunction toFormData(obj, formData, options) {\n if (!utils.isObject(obj)) {\n throw new TypeError('target must be an object');\n }\n\n // eslint-disable-next-line no-param-reassign\n formData = formData || new (PlatformFormData || FormData)();\n\n // eslint-disable-next-line no-param-reassign\n options = utils.toFlatObject(\n options,\n {\n metaTokens: true,\n dots: false,\n indexes: false,\n },\n false,\n function defined(option, source) {\n // eslint-disable-next-line no-eq-null,eqeqeq\n return !utils.isUndefined(source[option]);\n }\n );\n\n const metaTokens = options.metaTokens;\n // eslint-disable-next-line no-use-before-define\n const visitor = options.visitor || defaultVisitor;\n const dots = options.dots;\n const indexes = options.indexes;\n const _Blob = options.Blob || (typeof Blob !== 'undefined' && Blob);\n const maxDepth = options.maxDepth === undefined ? DEFAULT_FORM_DATA_MAX_DEPTH : options.maxDepth;\n const useBlob = _Blob && utils.isSpecCompliantForm(formData);\n const stack = [];\n\n if (!utils.isFunction(visitor)) {\n throw new TypeError('visitor must be a function');\n }\n\n function convertValue(value) {\n if (value === null) return '';\n\n if (utils.isDate(value)) {\n return value.toISOString();\n }\n\n if (utils.isBoolean(value)) {\n return value.toString();\n }\n\n if (!useBlob && utils.isBlob(value)) {\n throw new AxiosError('Blob is not supported. Use a Buffer instead.');\n }\n\n if (utils.isArrayBuffer(value) || utils.isTypedArray(value)) {\n if (useBlob && typeof _Blob === 'function') {\n return new _Blob([value]);\n }\n if (PlatformBuffer && PlatformBuffer.isBufferAvailable()) {\n return PlatformBuffer.from(value);\n }\n throw new AxiosError('Blob is not supported. Use a Buffer instead.', AxiosError.ERR_NOT_SUPPORT);\n }\n\n return value;\n }\n\n function throwIfMaxDepthExceeded(depth) {\n if (depth > maxDepth) {\n throw new AxiosError(\n 'Object is too deeply nested (' + depth + ' levels). Max depth: ' + maxDepth,\n AxiosError.ERR_FORM_DATA_DEPTH_EXCEEDED\n );\n }\n }\n\n function stringifyWithDepthLimit(value, depth) {\n if (maxDepth === Infinity) {\n return JSON.stringify(value);\n }\n\n const ancestors = [];\n\n return JSON.stringify(value, function limitDepth(_key, currentValue) {\n if (!utils.isObject(currentValue)) {\n return currentValue;\n }\n\n while (ancestors.length && ancestors[ancestors.length - 1] !== this) {\n ancestors.pop();\n }\n\n ancestors.push(currentValue);\n throwIfMaxDepthExceeded(depth + ancestors.length - 1);\n\n return currentValue;\n });\n }\n\n /**\n * Default visitor.\n *\n * @param {*} value\n * @param {String|Number} key\n * @param {Array} path\n * @this {FormData}\n *\n * @returns {boolean} return true to visit the each prop of the value recursively\n */\n function defaultVisitor(value, key, path) {\n let arr = value;\n\n if (utils.isReactNative(formData) && utils.isReactNativeBlob(value)) {\n formData.append(renderKey(path, key, dots), convertValue(value));\n return false;\n }\n\n if (value && !path && typeof value === 'object') {\n if (utils.endsWith(key, '{}')) {\n // eslint-disable-next-line no-param-reassign\n key = metaTokens ? key : key.slice(0, -2);\n // eslint-disable-next-line no-param-reassign\n value = stringifyWithDepthLimit(value, 1);\n } else if (\n (utils.isArray(value) && isFlatArray(value)) ||\n ((utils.isFileList(value) || utils.endsWith(key, '[]')) && (arr = utils.toArray(value)))\n ) {\n // eslint-disable-next-line no-param-reassign\n key = removeBrackets(key);\n\n arr.forEach(function each(el, index) {\n !(utils.isUndefined(el) || el === null) &&\n formData.append(\n // eslint-disable-next-line no-nested-ternary\n indexes === true\n ? renderKey([key], index, dots)\n : indexes === null\n ? key\n : key + '[]',\n convertValue(el)\n );\n });\n return false;\n }\n }\n\n if (isVisitable(value)) {\n return true;\n }\n\n formData.append(renderKey(path, key, dots), convertValue(value));\n\n return false;\n }\n\n const exposedHelpers = Object.assign(predicates, {\n defaultVisitor,\n convertValue,\n isVisitable,\n });\n\n function build(value, path, depth = 0) {\n if (utils.isUndefined(value)) return;\n\n throwIfMaxDepthExceeded(depth);\n\n if (stack.indexOf(value) !== -1) {\n throw new Error('Circular reference detected in ' + path.join('.'));\n }\n\n stack.push(value);\n\n utils.forEach(value, function each(el, key) {\n const result =\n !(utils.isUndefined(el) || el === null) &&\n visitor.call(formData, el, utils.isString(key) ? key.trim() : key, path, exposedHelpers);\n\n if (result === true) {\n build(el, path ? path.concat(key) : [key], depth + 1);\n }\n });\n\n stack.pop();\n }\n\n if (!utils.isObject(obj)) {\n throw new TypeError('data must be an object');\n }\n\n build(obj);\n\n return formData;\n}\n\nexport default toFormData;\n","'use strict';\n\nimport toFormData from './toFormData.js';\n\n/**\n * It encodes a string by replacing all characters that are not in the unreserved set with\n * their percent-encoded equivalents\n *\n * @param {string} str - The string to encode.\n *\n * @returns {string} The encoded string.\n */\nfunction encode(str) {\n const charMap = {\n '!': '%21',\n \"'\": '%27',\n '(': '%28',\n ')': '%29',\n '~': '%7E',\n '%20': '+',\n };\n return encodeURIComponent(str).replace(/[!'()~]|%20/g, function replacer(match) {\n return charMap[match];\n });\n}\n\n/**\n * It takes a params object and converts it to a FormData object\n *\n * @param {Object} params - The parameters to be converted to a FormData object.\n * @param {Object} options - The options object passed to the Axios constructor.\n *\n * @returns {void}\n */\nfunction AxiosURLSearchParams(params, options) {\n this._pairs = [];\n\n params && toFormData(params, this, options);\n}\n\nconst prototype = AxiosURLSearchParams.prototype;\n\nprototype.append = function append(name, value) {\n this._pairs.push([name, value]);\n};\n\nprototype.toString = function toString(encoder) {\n const _encode = encoder\n ? (value) => encoder.call(this, value, encode)\n : encode;\n\n return this._pairs\n .map(function each(pair) {\n return _encode(pair[0]) + '=' + _encode(pair[1]);\n }, '')\n .join('&');\n};\n\nexport default AxiosURLSearchParams;\n","'use strict';\n\nimport utils from '../utils.js';\nimport AxiosURLSearchParams from './AxiosURLSearchParams.js';\n\n/**\n * It replaces URL-encoded forms of `:`, `$`, `,`, and spaces with\n * their plain counterparts (`:`, `$`, `,`, `+`).\n *\n * @param {string} val The value to be encoded.\n *\n * @returns {string} The encoded value.\n */\nexport function encode(val) {\n return encodeURIComponent(val)\n .replace(/%3A/gi, ':')\n .replace(/%24/g, '$')\n .replace(/%2C/gi, ',')\n .replace(/%20/g, '+');\n}\n\n/**\n * Build a URL by appending params to the end\n *\n * @param {string} url The base of the url (e.g., http://www.google.com)\n * @param {object} [params] The params to be appended\n * @param {?(object|Function)} options\n *\n * @returns {string} The formatted url\n */\nexport default function buildURL(url, params, options) {\n if (!params) {\n return url;\n }\n url = url || '';\n\n const _options = utils.isFunction(options)\n ? {\n serialize: options,\n }\n : options;\n\n // Read serializer options pollution-safely: own properties and methods on a\n // class/template prototype are honored, but values injected onto a polluted\n // Object.prototype are ignored.\n const _encode = utils.getSafeProp(_options, 'encode') || encode;\n const serializeFn = utils.getSafeProp(_options, 'serialize');\n\n let serializedParams;\n\n if (serializeFn) {\n serializedParams = serializeFn(params, _options);\n } else {\n serializedParams = utils.isURLSearchParams(params)\n ? params.toString()\n : new AxiosURLSearchParams(params, _options).toString(_encode);\n }\n\n if (serializedParams) {\n const hashmarkIndex = url.indexOf('#');\n\n if (hashmarkIndex !== -1) {\n url = url.slice(0, hashmarkIndex);\n }\n url += (url.indexOf('?') === -1 ? '?' : '&') + serializedParams;\n }\n\n return url;\n}\n","'use strict';\n\nimport utils from '../utils.js';\n\nclass InterceptorManager {\n constructor() {\n this.handlers = [];\n }\n\n /**\n * Add a new interceptor to the stack\n *\n * @param {Function} fulfilled The function to handle `then` for a `Promise`\n * @param {Function} rejected The function to handle `reject` for a `Promise`\n * @param {Object} options The options for the interceptor, synchronous and runWhen\n *\n * @return {Number} An ID used to remove interceptor later\n */\n use(fulfilled, rejected, options) {\n this.handlers.push({\n fulfilled,\n rejected,\n synchronous: options ? options.synchronous : false,\n runWhen: options ? options.runWhen : null,\n });\n return this.handlers.length - 1;\n }\n\n /**\n * Remove an interceptor from the stack\n *\n * @param {Number} id The ID that was returned by `use`\n *\n * @returns {void}\n */\n eject(id) {\n if (this.handlers[id]) {\n this.handlers[id] = null;\n }\n }\n\n /**\n * Clear all interceptors from the stack\n *\n * @returns {void}\n */\n clear() {\n if (this.handlers) {\n this.handlers = [];\n }\n }\n\n /**\n * Iterate over all the registered interceptors\n *\n * This method is particularly useful for skipping over any\n * interceptors that may have become `null` calling `eject`.\n *\n * @param {Function} fn The function to call for each interceptor\n *\n * @returns {void}\n */\n forEach(fn) {\n utils.forEach(this.handlers, function forEachHandler(h) {\n if (h !== null) {\n fn(h);\n }\n });\n }\n}\n\nexport default InterceptorManager;\n","'use strict';\n\nexport default {\n silentJSONParsing: true,\n forcedJSONParsing: true,\n clarifyTimeoutError: false,\n legacyInterceptorReqResOrdering: true,\n advertiseZstdAcceptEncoding: false,\n validateStatusUndefinedResolves: true,\n};\n","import URLSearchParams from './classes/URLSearchParams.js';\nimport FormData from './classes/FormData.js';\nimport Blob from './classes/Blob.js';\n\nexport default {\n isBrowser: true,\n classes: {\n URLSearchParams,\n FormData,\n Blob,\n },\n protocols: ['http', 'https', 'file', 'blob', 'url', 'data'],\n};\n","'use strict';\n\nimport AxiosURLSearchParams from '../../../helpers/AxiosURLSearchParams.js';\nexport default typeof URLSearchParams !== 'undefined' ? URLSearchParams : AxiosURLSearchParams;\n","'use strict';\n\nexport default typeof FormData !== 'undefined' ? FormData : null;\n","'use strict';\n\nexport default typeof Blob !== 'undefined' ? Blob : null;\n","const hasBrowserEnv = typeof window !== 'undefined' && typeof document !== 'undefined';\n\nconst _navigator = (typeof navigator === 'object' && navigator) || undefined;\n\n/**\n * Determine if we're running in a standard browser environment\n *\n * This allows axios to run in a web worker, and react-native.\n * Both environments support XMLHttpRequest, but not fully standard globals.\n *\n * web workers:\n * typeof window -> undefined\n * typeof document -> undefined\n *\n * react-native:\n * navigator.product -> 'ReactNative'\n * nativescript\n * navigator.product -> 'NativeScript' or 'NS'\n *\n * @returns {boolean}\n */\nconst hasStandardBrowserEnv =\n hasBrowserEnv &&\n (!_navigator || ['ReactNative', 'NativeScript', 'NS'].indexOf(_navigator.product) < 0);\n\n/**\n * Determine if we're running in a standard browser webWorker environment\n *\n * Although the `isStandardBrowserEnv` method indicates that\n * `allows axios to run in a web worker`, the WebWorker will still be\n * filtered out due to its judgment standard\n * `typeof window !== 'undefined' && typeof document !== 'undefined'`.\n * This leads to a problem when axios post `FormData` in webWorker\n */\nconst hasStandardBrowserWebWorkerEnv = (() => {\n return (\n typeof WorkerGlobalScope !== 'undefined' &&\n // eslint-disable-next-line no-undef\n self instanceof WorkerGlobalScope &&\n typeof self.importScripts === 'function'\n );\n})();\n\nconst origin = (hasBrowserEnv && window.location.href) || 'http://localhost';\n\nexport {\n hasBrowserEnv,\n hasStandardBrowserWebWorkerEnv,\n hasStandardBrowserEnv,\n _navigator as navigator,\n origin,\n};\n","import platform from './node/index.js';\nimport * as utils from './common/utils.js';\n\nexport default {\n ...utils,\n ...platform,\n};\n","'use strict';\n\nimport utils from '../utils.js';\nimport AxiosError from '../core/AxiosError.js';\nimport { DEFAULT_FORM_DATA_MAX_DEPTH } from './toFormData.js';\n\nconst MAX_DEPTH = DEFAULT_FORM_DATA_MAX_DEPTH;\n\nfunction throwIfDepthExceeded(index) {\n if (index > MAX_DEPTH) {\n throw new AxiosError(\n 'FormData field is too deeply nested (' + index + ' levels). Max depth: ' + MAX_DEPTH,\n AxiosError.ERR_FORM_DATA_DEPTH_EXCEEDED\n );\n }\n}\n\n/**\n * It takes a string like `foo[x][y][z]` and returns an array like `['foo', 'x', 'y', 'z']\n *\n * @param {string} name - The name of the property to get.\n *\n * @returns An array of strings.\n */\nfunction parsePropPath(name) {\n // foo[x][y][z] -> ['foo', 'x', 'y', 'z']\n // foo.x.y.z -> ['foo', 'x', 'y', 'z']\n // A path is split on `.` and on `[...]` groups. A segment — whether written\n // in dot notation or captured inside brackets — may contain any character\n // except `.`, `[` and `]`, so a key like `user-name` or `user name` is kept\n // literal instead of being split (#5402). `.`, `[` and `]` keep their existing\n // meaning, e.g. `foo[bar.baz]` -> ['foo', 'bar', 'baz'] and `[]` is an array push.\n // Excluding `[` from the bracket group also makes the match fail fast at the\n // next `[`, so a malformed name cannot rescan to the end of the string from\n // every unmatched `[` — parsing stays linear in the length of the name.\n const path = [];\n const pattern = /[^.[\\]]+|\\[([^.[\\]]*)]/g;\n let match;\n\n while ((match = pattern.exec(name)) !== null) {\n throwIfDepthExceeded(path.length);\n path.push(match[0] === '[]' ? '' : match[1] || match[0]);\n }\n\n return path;\n}\n\n/**\n * Convert an array to an object.\n *\n * @param {Array} arr - The array to convert to an object.\n *\n * @returns An object with the same keys and values as the array.\n */\nfunction arrayToObject(arr) {\n const obj = {};\n const keys = Object.keys(arr);\n let i;\n const len = keys.length;\n let key;\n for (i = 0; i < len; i++) {\n key = keys[i];\n obj[key] = arr[key];\n }\n return obj;\n}\n\n/**\n * It takes a FormData object and returns a JavaScript object\n *\n * @param {string} formData The FormData object to convert to JSON.\n *\n * @returns {Object | null} The converted object.\n */\nfunction formDataToJSON(formData) {\n function buildPath(path, value, target, index) {\n throwIfDepthExceeded(index);\n\n let name = path[index++];\n\n if (name === '__proto__') return true;\n\n const isNumericKey = Number.isFinite(+name);\n const isLast = index >= path.length;\n name = !name && utils.isArray(target) ? target.length : name;\n\n if (isLast) {\n if (utils.hasOwnProp(target, name)) {\n target[name] = utils.isArray(target[name])\n ? target[name].concat(value)\n : [target[name], value];\n } else {\n target[name] = value;\n }\n\n return !isNumericKey;\n }\n\n if (!utils.hasOwnProp(target, name) || !utils.isObject(target[name])) {\n target[name] = [];\n }\n\n const result = buildPath(path, value, target[name], index);\n\n if (result && utils.isArray(target[name])) {\n target[name] = arrayToObject(target[name]);\n }\n\n return !isNumericKey;\n }\n\n if (utils.isFormData(formData) && utils.isFunction(formData.entries)) {\n const obj = {};\n\n utils.forEachEntry(formData, (name, value) => {\n buildPath(parsePropPath(name), value, obj, 0);\n });\n\n return obj;\n }\n\n return null;\n}\n\nexport default formDataToJSON;\n","'use strict';\n\nimport utils from '../utils.js';\nimport AxiosError from '../core/AxiosError.js';\nimport transitionalDefaults from './transitional.js';\nimport toFormData from '../helpers/toFormData.js';\nimport toURLEncodedForm from '../helpers/toURLEncodedForm.js';\nimport platform from '../platform/index.js';\nimport formDataToJSON from '../helpers/formDataToJSON.js';\n\nconst own = (obj, key) => (obj != null && utils.hasOwnProp(obj, key) ? obj[key] : undefined);\n\n/**\n * It takes a string, tries to parse it, and if it fails, it returns the stringified version\n * of the input\n *\n * @param {any} rawValue - The value to be stringified.\n * @param {Function} parser - A function that parses a string into a JavaScript object.\n * @param {Function} encoder - A function that takes a value and returns a string.\n *\n * @returns {string} A stringified version of the rawValue.\n */\nfunction stringifySafely(rawValue, parser, encoder) {\n if (utils.isString(rawValue)) {\n try {\n (parser || JSON.parse)(rawValue);\n return utils.trim(rawValue);\n } catch (e) {\n if (e.name !== 'SyntaxError') {\n throw e;\n }\n }\n }\n\n return (encoder || JSON.stringify)(rawValue);\n}\n\nconst defaults = {\n transitional: transitionalDefaults,\n\n adapter: ['xhr', 'http', 'fetch'],\n\n transformRequest: [\n function transformRequest(data, headers) {\n const contentType = headers.getContentType() || '';\n const hasJSONContentType = contentType.indexOf('application/json') > -1;\n const isObjectPayload = utils.isObject(data);\n\n if (isObjectPayload && utils.isHTMLForm(data)) {\n data = new FormData(data);\n }\n\n const isFormData = utils.isFormData(data);\n\n if (isFormData) {\n return hasJSONContentType ? JSON.stringify(formDataToJSON(data)) : data;\n }\n\n if (\n utils.isArrayBuffer(data) ||\n utils.isBuffer(data) ||\n utils.isStream(data) ||\n utils.isFile(data) ||\n utils.isBlob(data) ||\n utils.isReadableStream(data)\n ) {\n return data;\n }\n if (utils.isArrayBufferView(data)) {\n return data.buffer;\n }\n if (utils.isURLSearchParams(data)) {\n headers.setContentType('application/x-www-form-urlencoded;charset=utf-8', false);\n return data.toString();\n }\n\n let isFileList;\n\n if (isObjectPayload) {\n const formSerializer = own(this, 'formSerializer');\n if (contentType.indexOf('application/x-www-form-urlencoded') > -1) {\n return toURLEncodedForm(data, formSerializer).toString();\n }\n\n if (\n (isFileList = utils.isFileList(data)) ||\n contentType.indexOf('multipart/form-data') > -1\n ) {\n const env = own(this, 'env');\n const _FormData = env && env.FormData;\n\n return toFormData(\n isFileList ? { 'files[]': data } : data,\n _FormData && new _FormData(),\n formSerializer\n );\n }\n }\n\n if (isObjectPayload || hasJSONContentType) {\n headers.setContentType('application/json', false);\n return stringifySafely(data);\n }\n\n return data;\n },\n ],\n\n transformResponse: [\n function transformResponse(data) {\n const transitional = own(this, 'transitional') || defaults.transitional;\n const forcedJSONParsing = transitional && transitional.forcedJSONParsing;\n const responseType = own(this, 'responseType');\n const JSONRequested = responseType === 'json';\n\n if (utils.isResponse(data) || utils.isReadableStream(data)) {\n return data;\n }\n\n if (\n data &&\n utils.isString(data) &&\n ((forcedJSONParsing && !responseType) || JSONRequested)\n ) {\n const silentJSONParsing = transitional && transitional.silentJSONParsing;\n const strictJSONParsing = !silentJSONParsing && JSONRequested;\n\n try {\n return JSON.parse(data, own(this, 'parseReviver'));\n } catch (e) {\n if (strictJSONParsing) {\n if (e.name === 'SyntaxError') {\n throw AxiosError.from(e, AxiosError.ERR_BAD_RESPONSE, this, null, own(this, 'response'));\n }\n throw e;\n }\n }\n }\n\n return data;\n },\n ],\n\n /**\n * A timeout in milliseconds to abort a request. If set to 0 (default) a\n * timeout is not created.\n */\n timeout: 0,\n\n xsrfCookieName: 'XSRF-TOKEN',\n xsrfHeaderName: 'X-XSRF-TOKEN',\n\n maxContentLength: -1,\n maxBodyLength: -1,\n\n env: {\n FormData: platform.classes.FormData,\n Blob: platform.classes.Blob,\n },\n\n validateStatus: function validateStatus(status) {\n return status >= 200 && status < 300;\n },\n\n headers: {\n common: {\n Accept: 'application/json, text/plain, */*',\n 'Content-Type': undefined,\n },\n },\n};\n\nutils.forEach(['delete', 'get', 'head', 'post', 'put', 'patch', 'query'], (method) => {\n defaults.headers[method] = {};\n});\n\nexport default defaults;\n","'use strict';\n\nimport utils from '../utils.js';\nimport toFormData from './toFormData.js';\nimport platform from '../platform/index.js';\n\nexport default function toURLEncodedForm(data, options) {\n return toFormData(data, new platform.classes.URLSearchParams(), {\n visitor: function (value, key, path, helpers) {\n if (platform.isNode && utils.isBuffer(value)) {\n this.append(key, value.toString('base64'));\n return false;\n }\n\n return helpers.defaultVisitor.apply(this, arguments);\n },\n ...options,\n });\n}\n","'use strict';\n\nimport utils from '../utils.js';\nimport defaults from '../defaults/index.js';\nimport AxiosHeaders from '../core/AxiosHeaders.js';\n\n/**\n * Transform the data for a request or a response\n *\n * @param {Array|Function} fns A single function or Array of functions\n * @param {?Object} response The response object\n *\n * @returns {*} The resulting transformed data\n */\nexport default function transformData(fns, response) {\n const config = this || defaults;\n const context = response || config;\n const headers = AxiosHeaders.from(context.headers);\n let data = context.data;\n\n utils.forEach(fns, function transform(fn) {\n data = fn.call(config, data, headers.normalize(), response ? response.status : undefined);\n });\n\n headers.normalize();\n\n return data;\n}\n","'use strict';\n\nexport default function isCancel(value) {\n return !!(value && value.__CANCEL__);\n}\n","'use strict';\n\nimport AxiosError from '../core/AxiosError.js';\n\nclass CanceledError extends AxiosError {\n /**\n * A `CanceledError` is an object that is thrown when an operation is canceled.\n *\n * @param {string=} message The message.\n * @param {Object=} config The config.\n * @param {Object=} request The request.\n *\n * @returns {CanceledError} The created error.\n */\n constructor(message, config, request) {\n super(message == null ? 'canceled' : message, AxiosError.ERR_CANCELED, config, request);\n this.name = 'CanceledError';\n this.__CANCEL__ = true;\n }\n}\n\nexport default CanceledError;\n","'use strict';\n\nimport AxiosError from './AxiosError.js';\n\n/**\n * Resolve or reject a Promise based on response status.\n *\n * @param {Function} resolve A function that resolves the promise.\n * @param {Function} reject A function that rejects the promise.\n * @param {object} response The response.\n *\n * @returns {object} The response.\n */\nexport default function settle(resolve, reject, response) {\n const validateStatus = response.config.validateStatus;\n if (!response.status || !validateStatus || validateStatus(response.status)) {\n resolve(response);\n } else {\n reject(new AxiosError(\n 'Request failed with status code ' + response.status,\n response.status >= 400 && response.status < 500 ? AxiosError.ERR_BAD_REQUEST : AxiosError.ERR_BAD_RESPONSE,\n response.config,\n response.request,\n response\n ));\n }\n}\n","import speedometer from './speedometer.js';\nimport throttle from './throttle.js';\nimport utils from '../utils.js';\n\nexport const progressEventReducer = (listener, isDownloadStream, freq = 3) => {\n let bytesNotified = 0;\n const _speedometer = speedometer(50, 250);\n\n return throttle((e) => {\n if (!e || typeof e.loaded !== 'number') {\n return;\n }\n const rawLoaded = e.loaded;\n const total = e.lengthComputable ? e.total : undefined;\n const loaded = Math.max(0, total != null ? Math.min(rawLoaded, total) : rawLoaded);\n const progressBytes = Math.max(0, loaded - bytesNotified);\n const rate = _speedometer(progressBytes);\n\n bytesNotified = Math.max(bytesNotified, loaded);\n\n const data = {\n loaded,\n total,\n progress: total ? loaded / total : undefined,\n bytes: progressBytes,\n rate: rate ? rate : undefined,\n estimated: rate && total ? (total - loaded) / rate : undefined,\n event: e,\n lengthComputable: total != null,\n [isDownloadStream ? 'download' : 'upload']: true,\n };\n\n listener(data);\n }, freq);\n};\n\nexport const progressEventDecorator = (total, throttled) => {\n const lengthComputable = total != null;\n\n return [\n (loaded) =>\n throttled[0]({\n lengthComputable,\n total,\n loaded,\n }),\n throttled[1],\n ];\n};\n\nexport const asyncDecorator =\n (fn, scheduler = utils.asap) =>\n (...args) =>\n scheduler(() => fn(...args));\n","'use strict';\n\n/**\n * Calculate data maxRate\n * @param {Number} [samplesCount= 10]\n * @param {Number} [min= 1000]\n * @returns {Function}\n */\nfunction speedometer(samplesCount, min) {\n samplesCount = samplesCount || 10;\n const bytes = new Array(samplesCount);\n const timestamps = new Array(samplesCount);\n let head = 0;\n let tail = 0;\n let firstSampleTS;\n\n min = min !== undefined ? min : 1000;\n\n return function push(chunkLength) {\n const now = Date.now();\n\n const startedAt = timestamps[tail];\n\n if (!firstSampleTS) {\n firstSampleTS = now;\n }\n\n bytes[head] = chunkLength;\n timestamps[head] = now;\n\n let i = tail;\n let bytesCount = 0;\n\n while (i !== head) {\n bytesCount += bytes[i++];\n i = i % samplesCount;\n }\n\n head = (head + 1) % samplesCount;\n\n if (head === tail) {\n tail = (tail + 1) % samplesCount;\n }\n\n if (now - firstSampleTS < min) {\n return;\n }\n\n const passed = startedAt && now - startedAt;\n\n return passed ? Math.round((bytesCount * 1000) / passed) : undefined;\n };\n}\n\nexport default speedometer;\n","/**\n * Throttle decorator\n * @param {Function} fn\n * @param {Number} freq\n * @return {Function}\n */\nfunction throttle(fn, freq) {\n let timestamp = 0;\n let threshold = 1000 / freq;\n let lastArgs;\n let timer;\n\n const invoke = (args, now = Date.now()) => {\n timestamp = now;\n lastArgs = null;\n if (timer) {\n clearTimeout(timer);\n timer = null;\n }\n fn(...args);\n };\n\n const throttled = (...args) => {\n const now = Date.now();\n const passed = now - timestamp;\n if (passed >= threshold) {\n invoke(args, now);\n } else {\n lastArgs = args;\n if (!timer) {\n timer = setTimeout(() => {\n timer = null;\n invoke(lastArgs);\n }, threshold - passed);\n }\n }\n };\n\n const flush = () => lastArgs && invoke(lastArgs);\n\n return [throttled, flush];\n}\n\nexport default throttle;\n","import platform from '../platform/index.js';\n\nexport default platform.hasStandardBrowserEnv\n ? ((origin, isMSIE) => (url) => {\n url = new URL(url, platform.origin);\n\n return (\n origin.protocol === url.protocol &&\n origin.host === url.host &&\n (isMSIE || origin.port === url.port)\n );\n })(\n new URL(platform.origin),\n platform.navigator && /(msie|trident)/i.test(platform.navigator.userAgent)\n )\n : () => true;\n","import utils from '../utils.js';\nimport platform from '../platform/index.js';\n\nexport default platform.hasStandardBrowserEnv\n ? // Standard browser envs support document.cookie\n {\n write(name, value, expires, path, domain, secure, sameSite) {\n if (typeof document === 'undefined') return;\n\n const cookie = [`${name}=${encodeURIComponent(value)}`];\n\n if (utils.isNumber(expires)) {\n cookie.push(`expires=${new Date(expires).toUTCString()}`);\n }\n if (utils.isString(path)) {\n cookie.push(`path=${path}`);\n }\n if (utils.isString(domain)) {\n cookie.push(`domain=${domain}`);\n }\n if (secure === true) {\n cookie.push('secure');\n }\n if (utils.isString(sameSite)) {\n cookie.push(`SameSite=${sameSite}`);\n }\n\n document.cookie = cookie.join('; ');\n },\n\n read(name) {\n if (typeof document === 'undefined') return null;\n // Match name=value by splitting on the semicolon separator instead of building a\n // RegExp from `name` — interpolating an unescaped string into a RegExp would let\n // metacharacters (e.g. `.+?` in an attacker-influenced cookie name) cause ReDoS or\n // match the wrong cookie. Browsers may serialize cookie pairs as either \";\" or\n // \"; \", so ignore optional whitespace before each cookie name.\n const cookies = document.cookie.split(';');\n for (let i = 0; i < cookies.length; i++) {\n const cookie = cookies[i].replace(/^\\s+/, '');\n const eq = cookie.indexOf('=');\n if (eq !== -1 && cookie.slice(0, eq) === name) {\n try {\n return decodeURIComponent(cookie.slice(eq + 1));\n } catch (e) {\n return cookie.slice(eq + 1);\n }\n }\n }\n return null;\n },\n\n remove(name) {\n this.write(name, '', Date.now() - 86400000, '/');\n },\n }\n : // Non-standard browser env (web workers, react-native) lack needed support.\n {\n write() {},\n read() {\n return null;\n },\n remove() {},\n };\n","'use strict';\n\nimport AxiosError, { REDACTED } from './AxiosError.js';\nimport isAbsoluteURL from '../helpers/isAbsoluteURL.js';\nimport combineURLs from '../helpers/combineURLs.js';\n\nconst malformedHttpProtocol = /^https?:(?!\\/\\/)/i;\nconst httpProtocolControlCharacters = /[\\t\\n\\r]/g;\n\nfunction stripLeadingC0ControlOrSpace(url) {\n let i = 0;\n while (i < url.length && url.charCodeAt(i) <= 0x20) {\n i++;\n }\n return url.slice(i);\n}\n\nfunction normalizeURLForProtocolCheck(url) {\n return stripLeadingC0ControlOrSpace(url).replace(httpProtocolControlCharacters, '');\n}\n\n// Redact the parts of a URL that can carry secrets before it is embedded in an\n// error message. AxiosError.toJSON() serializes `message` verbatim and errors\n// are commonly logged, while the opt-in `config.redact` model only cleans\n// config keys — it cannot reach the message. Redact only the genuinely\n// sensitive substrings — userinfo (credentials), query parameter values and\n// fragment contents — with the same REDACTED marker the config redaction uses,\n// while keeping the scheme, host, path and parameter names so the offending\n// request stays accurately identifiable.\nfunction redactFragment(fragment) {\n if (!fragment) {\n return fragment;\n }\n\n return fragment.replace(/(^|&)([^=&]*=)?[^&]+/g, (match, separator, parameterName = '') => {\n return `${separator}${parameterName}${REDACTED}`;\n });\n}\n\nfunction redactSensitiveURLParts(url) {\n const redactedURL = url.replace(/^(https?:\\/{0,2})[^/?#]*@/i, `$1${REDACTED}@`);\n const fragmentIndex = redactedURL.indexOf('#');\n const urlWithoutFragment =\n fragmentIndex === -1 ? redactedURL : redactedURL.slice(0, fragmentIndex);\n const redactedURLWithoutFragment = urlWithoutFragment.replace(\n /([?&][^=&#]*=)[^&#]*/g,\n `$1${REDACTED}`\n );\n\n if (fragmentIndex === -1) {\n return redactedURLWithoutFragment;\n }\n\n return `${redactedURLWithoutFragment}#${redactFragment(redactedURL.slice(fragmentIndex + 1))}`;\n}\n\nfunction assertValidHttpProtocolURL(url, config) {\n if (typeof url === 'string') {\n const normalizedURL = normalizeURLForProtocolCheck(url);\n if (malformedHttpProtocol.test(normalizedURL)) {\n throw new AxiosError(\n `Invalid URL ${JSON.stringify(redactSensitiveURLParts(normalizedURL))}: missing \"//\" after protocol`,\n AxiosError.ERR_INVALID_URL,\n config\n );\n }\n }\n}\n\n/**\n * Creates a new URL by combining the baseURL with the requestedURL,\n * only when the requestedURL is not already an absolute URL.\n * If the requestURL is absolute, this function returns the requestedURL untouched.\n *\n * @param {string} baseURL The base URL\n * @param {string} requestedURL Absolute or relative URL to combine\n *\n * @returns {string} The combined full path\n */\nexport default function buildFullPath(baseURL, requestedURL, allowAbsoluteUrls, config) {\n assertValidHttpProtocolURL(requestedURL, config);\n let isRelativeUrl = !isAbsoluteURL(requestedURL);\n if (baseURL && (isRelativeUrl || allowAbsoluteUrls === false)) {\n assertValidHttpProtocolURL(baseURL, config);\n return combineURLs(baseURL, requestedURL);\n }\n return requestedURL;\n}\n","'use strict';\n\n/**\n * Determines whether the specified URL is absolute\n *\n * @param {string} url The URL to test\n *\n * @returns {boolean} True if the specified URL is absolute, otherwise false\n */\nexport default function isAbsoluteURL(url) {\n // A URL is considered absolute if it begins with \"://\" or \"//\" (protocol-relative URL).\n // RFC 3986 defines scheme name as a sequence of characters beginning with a letter and followed\n // by any combination of letters, digits, plus, period, or hyphen.\n if (typeof url !== 'string') {\n return false;\n }\n\n return /^([a-z][a-z\\d+\\-.]*:)?\\/\\//i.test(url);\n}\n","'use strict';\n\n/**\n * Creates a new URL by combining the specified URLs\n *\n * @param {string} baseURL The base URL\n * @param {string} relativeURL The relative URL\n *\n * @returns {string} The combined URL\n */\nexport default function combineURLs(baseURL, relativeURL) {\n if (!relativeURL) {\n return baseURL;\n }\n\n let end = baseURL.length;\n\n while (end > 0 && baseURL.charCodeAt(end - 1) === 47) {\n end--;\n }\n\n return baseURL.slice(0, end) + '/' + relativeURL.replace(/^\\/+/, '');\n}\n","'use strict';\n\nimport utils from '../utils.js';\nimport AxiosHeaders from './AxiosHeaders.js';\n\nconst headersToObject = (thing) => (thing instanceof AxiosHeaders ? { ...thing } : thing);\n\nconst ownEnumerableKeys = (thing) => {\n if (Object.getOwnPropertySymbols && Object.getOwnPropertyDescriptor) {\n return Object.keys(thing).concat(\n Object.getOwnPropertySymbols(thing).filter(\n (symbol) => Object.getOwnPropertyDescriptor(thing, symbol).enumerable\n )\n );\n }\n return Object.keys(thing);\n};\n\n/**\n * Config-specific merge-function which creates a new config-object\n * by merging two configuration objects together.\n *\n * @param {Object} config1\n * @param {Object} config2\n *\n * @returns {Object} New object resulting from merging config2 to config1\n */\nexport default function mergeConfig(config1, config2) {\n // eslint-disable-next-line no-param-reassign\n config1 = config1 || {};\n config2 = config2 || {};\n\n // Use a null-prototype object so that downstream reads such as `config.auth`\n // or `config.baseURL` cannot inherit polluted values from Object.prototype.\n // `hasOwnProperty` is restored as a non-enumerable own slot to preserve\n // ergonomics for user code that relies on it.\n const config = Object.create(null);\n Object.defineProperty(config, 'hasOwnProperty', {\n // Null-proto descriptor so a polluted Object.prototype.get cannot turn\n // this data descriptor into an accessor descriptor on the way in.\n __proto__: null,\n value: Object.prototype.hasOwnProperty,\n enumerable: false,\n writable: true,\n configurable: true,\n });\n\n function getMergedValue(target, source, prop, caseless) {\n if (utils.isPlainObject(target) && utils.isPlainObject(source)) {\n return utils.merge.call({ caseless }, target, source);\n } else if (utils.isPlainObject(source)) {\n return utils.merge({}, source);\n } else if (utils.isArray(source)) {\n return source.slice();\n }\n return source;\n }\n\n function mergeDeepProperties(a, b, prop, caseless) {\n if (!utils.isUndefined(b)) {\n return getMergedValue(a, b, prop, caseless);\n } else if (!utils.isUndefined(a)) {\n return getMergedValue(undefined, a, prop, caseless);\n }\n }\n\n // eslint-disable-next-line consistent-return\n function valueFromConfig2(a, b) {\n if (!utils.isUndefined(b)) {\n return getMergedValue(undefined, b);\n }\n }\n\n // eslint-disable-next-line consistent-return\n function defaultToConfig2(a, b) {\n if (!utils.isUndefined(b)) {\n return getMergedValue(undefined, b);\n } else if (!utils.isUndefined(a)) {\n return getMergedValue(undefined, a);\n }\n }\n\n function getMergedTransitionalOption(prop) {\n const transitional2 = utils.hasOwnProp(config2, 'transitional')\n ? config2.transitional\n : undefined;\n\n if (!utils.isUndefined(transitional2)) {\n if (utils.isPlainObject(transitional2)) {\n if (utils.hasOwnProp(transitional2, prop)) {\n return transitional2[prop];\n }\n } else {\n return undefined;\n }\n }\n\n const transitional1 = utils.hasOwnProp(config1, 'transitional')\n ? config1.transitional\n : undefined;\n\n if (utils.isPlainObject(transitional1) && utils.hasOwnProp(transitional1, prop)) {\n return transitional1[prop];\n }\n\n return undefined;\n }\n\n // eslint-disable-next-line consistent-return\n function mergeDirectKeys(a, b, prop) {\n if (utils.hasOwnProp(config2, prop)) {\n return getMergedValue(a, b);\n } else if (utils.hasOwnProp(config1, prop)) {\n return getMergedValue(undefined, a);\n }\n }\n\n const mergeMap = {\n url: valueFromConfig2,\n method: valueFromConfig2,\n data: valueFromConfig2,\n baseURL: defaultToConfig2,\n transformRequest: defaultToConfig2,\n transformResponse: defaultToConfig2,\n paramsSerializer: defaultToConfig2,\n timeout: defaultToConfig2,\n timeoutMessage: defaultToConfig2,\n withCredentials: defaultToConfig2,\n withXSRFToken: defaultToConfig2,\n adapter: defaultToConfig2,\n responseType: defaultToConfig2,\n xsrfCookieName: defaultToConfig2,\n xsrfHeaderName: defaultToConfig2,\n onUploadProgress: defaultToConfig2,\n onDownloadProgress: defaultToConfig2,\n decompress: defaultToConfig2,\n maxContentLength: defaultToConfig2,\n maxBodyLength: defaultToConfig2,\n beforeRedirect: defaultToConfig2,\n transport: defaultToConfig2,\n httpAgent: defaultToConfig2,\n httpsAgent: defaultToConfig2,\n cancelToken: defaultToConfig2,\n socketPath: defaultToConfig2,\n allowedSocketPaths: defaultToConfig2,\n responseEncoding: defaultToConfig2,\n validateStatus: mergeDirectKeys,\n headers: (a, b, prop) =>\n mergeDeepProperties(headersToObject(a), headersToObject(b), prop, true),\n };\n\n utils.forEach(ownEnumerableKeys({ ...config1, ...config2 }), function computeConfigValue(prop) {\n if (prop === '__proto__' || prop === 'constructor' || prop === 'prototype') return;\n const merge = utils.hasOwnProp(mergeMap, prop) ? mergeMap[prop] : mergeDeepProperties;\n const a = utils.hasOwnProp(config1, prop) ? config1[prop] : undefined;\n const b = utils.hasOwnProp(config2, prop) ? config2[prop] : undefined;\n const configValue = merge(a, b, prop);\n (utils.isUndefined(configValue) && merge !== mergeDirectKeys) || (config[prop] = configValue);\n });\n\n if (\n utils.hasOwnProp(config2, 'validateStatus') &&\n utils.isUndefined(config2.validateStatus) &&\n getMergedTransitionalOption('validateStatusUndefinedResolves') === false\n ) {\n if (utils.hasOwnProp(config1, 'validateStatus')) {\n config.validateStatus = getMergedValue(undefined, config1.validateStatus);\n } else {\n delete config.validateStatus;\n }\n }\n\n return config;\n}\n","'use strict';\n\nconst FORM_DATA_CONTENT_HEADERS = ['content-type', 'content-length'];\n\n/**\n * Apply the headers generated by a FormData implementation to the request headers,\n * honoring the `formDataHeaderPolicy` option: with 'content-only', copy only the\n * content-* headers; otherwise merge all of them.\n *\n * @param {AxiosHeaders} headers - the request headers to mutate\n * @param {Object | null | undefined} formHeaders - headers produced by the FormData implementation\n * @param {String} [policy] - the resolved `formDataHeaderPolicy` config value\n *\n * @returns {void}\n */\nexport default function setFormDataHeaders(headers, formHeaders, policy) {\n if (policy !== 'content-only') {\n headers.set(formHeaders);\n return;\n }\n\n Object.entries(formHeaders || {}).forEach(([key, val]) => {\n if (FORM_DATA_CONTENT_HEADERS.includes(key.toLowerCase())) {\n headers.set(key, val);\n }\n });\n}\n","import platform from '../platform/index.js';\nimport utils from '../utils.js';\nimport AxiosError from '../core/AxiosError.js';\nimport isURLSameOrigin from './isURLSameOrigin.js';\nimport cookies from './cookies.js';\nimport buildFullPath from '../core/buildFullPath.js';\nimport mergeConfig from '../core/mergeConfig.js';\nimport AxiosHeaders from '../core/AxiosHeaders.js';\nimport setFormDataHeaders from '../core/setFormDataHeaders.js';\nimport buildURL from './buildURL.js';\n\n/**\n * Encode a UTF-8 string to a Latin-1 byte string for use with btoa().\n * This is a modern replacement for the deprecated unescape(encodeURIComponent(str)) pattern.\n *\n * @param {string} str The string to encode\n *\n * @returns {string} UTF-8 bytes as a Latin-1 string\n */\nconst encodeUTF8 = (str) =>\n encodeURIComponent(str).replace(/%([0-9A-F]{2})/gi, (_, hex) =>\n String.fromCharCode(parseInt(hex, 16))\n );\n\nfunction resolveConfig(config) {\n const newConfig = mergeConfig({}, config);\n\n // Read only own properties to prevent prototype pollution gadgets\n // (e.g. Object.prototype.baseURL = 'https://evil.com').\n const own = (key) => (utils.hasOwnProp(newConfig, key) ? newConfig[key] : undefined);\n\n const data = own('data');\n let withXSRFToken = own('withXSRFToken');\n const xsrfHeaderName = own('xsrfHeaderName');\n const xsrfCookieName = own('xsrfCookieName');\n let headers = own('headers');\n const auth = own('auth');\n const baseURL = own('baseURL');\n const allowAbsoluteUrls = own('allowAbsoluteUrls');\n const url = own('url');\n\n newConfig.headers = headers = AxiosHeaders.from(headers);\n\n newConfig.url = buildURL(\n buildFullPath(baseURL, url, allowAbsoluteUrls, newConfig),\n own('params'),\n own('paramsSerializer')\n );\n\n // HTTP basic authentication\n if (auth) {\n const username = utils.getSafeProp(auth, 'username') || '';\n const password = utils.getSafeProp(auth, 'password') || '';\n\n try {\n headers.set(\n 'Authorization',\n 'Basic ' + btoa(username + ':' + (password ? encodeUTF8(password) : ''))\n );\n } catch (e) {\n throw AxiosError.from(e, AxiosError.ERR_BAD_OPTION_VALUE, config);\n }\n }\n\n if (utils.isFormData(data)) {\n if (\n platform.hasStandardBrowserEnv ||\n platform.hasStandardBrowserWebWorkerEnv ||\n utils.isReactNative(data)\n ) {\n headers.setContentType(undefined); // browser/web worker/RN handles it\n } else if (utils.isFunction(data.getHeaders)) {\n // Node.js FormData (like form-data package)\n setFormDataHeaders(headers, data.getHeaders(), own('formDataHeaderPolicy'));\n }\n }\n\n // Add xsrf header\n // This is only done if running in a standard browser environment.\n // Specifically not if we're in a web worker, or react-native.\n\n if (platform.hasStandardBrowserEnv) {\n if (utils.isFunction(withXSRFToken)) {\n withXSRFToken = withXSRFToken(newConfig);\n }\n\n // Strict boolean check — prevents proto-pollution gadgets (e.g. Object.prototype.withXSRFToken = 1)\n // and misconfigurations (e.g. \"false\") from short-circuiting the same-origin check and leaking\n // the XSRF token cross-origin.\n const shouldSendXSRF =\n withXSRFToken === true || (withXSRFToken == null && isURLSameOrigin(newConfig.url));\n\n if (shouldSendXSRF) {\n const xsrfValue = xsrfHeaderName && xsrfCookieName && cookies.read(xsrfCookieName);\n\n if (xsrfValue) {\n headers.set(xsrfHeaderName, xsrfValue);\n }\n }\n }\n\n return newConfig;\n}\n\nexport default resolveConfig;\n","import utils from '../utils.js';\nimport settle from '../core/settle.js';\nimport transitionalDefaults from '../defaults/transitional.js';\nimport AxiosError from '../core/AxiosError.js';\nimport CanceledError from '../cancel/CanceledError.js';\nimport parseProtocol from '../helpers/parseProtocol.js';\nimport platform from '../platform/index.js';\nimport AxiosHeaders from '../core/AxiosHeaders.js';\nimport { progressEventReducer } from '../helpers/progressEventReducer.js';\nimport resolveConfig from '../helpers/resolveConfig.js';\nimport { toByteStringHeaderObject } from '../helpers/sanitizeHeaderValue.js';\n\nconst isXHRAdapterSupported = typeof XMLHttpRequest !== 'undefined';\n\nexport default isXHRAdapterSupported &&\n function (config) {\n return new Promise(function dispatchXhrRequest(resolve, reject) {\n const _config = resolveConfig(config);\n let requestData = _config.data;\n const requestHeaders = AxiosHeaders.from(_config.headers).normalize();\n let { responseType, onUploadProgress, onDownloadProgress } = _config;\n let onCanceled;\n let uploadThrottled, downloadThrottled;\n let flushUpload, flushDownload;\n\n function done() {\n flushUpload && flushUpload(); // flush events\n flushDownload && flushDownload(); // flush events\n\n _config.cancelToken && _config.cancelToken.unsubscribe(onCanceled);\n\n _config.signal && _config.signal.removeEventListener('abort', onCanceled);\n }\n\n let request = new XMLHttpRequest();\n\n request.open(_config.method.toUpperCase(), _config.url, true);\n\n // Set the request timeout in MS\n request.timeout = _config.timeout;\n\n function onloadend() {\n if (!request) {\n return;\n }\n // Prepare the response\n const responseHeaders = AxiosHeaders.from(\n 'getAllResponseHeaders' in request && request.getAllResponseHeaders()\n );\n const responseData =\n !responseType || responseType === 'text' || responseType === 'json'\n ? request.responseText\n : request.response;\n const response = {\n data: responseData,\n status: request.status,\n statusText: request.statusText,\n headers: responseHeaders,\n config,\n request,\n };\n\n settle(\n function _resolve(value) {\n resolve(value);\n done();\n },\n function _reject(err) {\n reject(err);\n done();\n },\n response\n );\n\n // Clean up request\n request = null;\n }\n\n if ('onloadend' in request) {\n // Use onloadend if available\n request.onloadend = onloadend;\n } else {\n // Listen for ready state to emulate onloadend\n request.onreadystatechange = function handleLoad() {\n if (!request || request.readyState !== 4) {\n return;\n }\n\n // The request errored out and we didn't get a response, this will be\n // handled by onerror instead\n // With one exception: request that using file: protocol, most browsers\n // will return status as 0 even though it's a successful request\n if (\n request.status === 0 &&\n !(request.responseURL && request.responseURL.startsWith('file:'))\n ) {\n return;\n }\n // readystate handler is calling before onerror or ontimeout handlers,\n // so we should call onloadend on the next 'tick'\n setTimeout(onloadend);\n };\n }\n\n // Handle browser request cancellation (as opposed to a manual cancellation)\n request.onabort = function handleAbort() {\n if (!request) {\n return;\n }\n\n reject(new AxiosError('Request aborted', AxiosError.ECONNABORTED, config, request));\n done();\n\n // Clean up request\n request = null;\n };\n\n // Handle low level network errors\n request.onerror = function handleError(event) {\n // Browsers deliver a ProgressEvent in XHR onerror\n // (message may be empty; when present, surface it)\n // See https://developer.mozilla.org/docs/Web/API/XMLHttpRequest/error_event\n const msg = event && event.message ? event.message : 'Network Error';\n const err = new AxiosError(msg, AxiosError.ERR_NETWORK, config, request);\n // attach the underlying event for consumers who want details\n err.event = event || null;\n reject(err);\n done();\n request = null;\n };\n\n // Handle timeout\n request.ontimeout = function handleTimeout() {\n let timeoutErrorMessage = _config.timeout\n ? 'timeout of ' + _config.timeout + 'ms exceeded'\n : 'timeout exceeded';\n const transitional = _config.transitional || transitionalDefaults;\n if (_config.timeoutErrorMessage) {\n timeoutErrorMessage = _config.timeoutErrorMessage;\n }\n reject(\n new AxiosError(\n timeoutErrorMessage,\n transitional.clarifyTimeoutError ? AxiosError.ETIMEDOUT : AxiosError.ECONNABORTED,\n config,\n request\n )\n );\n done();\n\n // Clean up request\n request = null;\n };\n\n // Remove Content-Type if data is undefined\n requestData === undefined && requestHeaders.setContentType(null);\n\n // Add headers to the request\n if ('setRequestHeader' in request) {\n utils.forEach(toByteStringHeaderObject(requestHeaders), function setRequestHeader(val, key) {\n request.setRequestHeader(key, val);\n });\n }\n\n // Add withCredentials to request if needed\n if (!utils.isUndefined(_config.withCredentials)) {\n request.withCredentials = !!_config.withCredentials;\n }\n\n // Add responseType to request if needed\n if (responseType && responseType !== 'json') {\n request.responseType = _config.responseType;\n }\n\n // Handle progress if needed\n if (onDownloadProgress) {\n [downloadThrottled, flushDownload] = progressEventReducer(onDownloadProgress, true);\n request.addEventListener('progress', downloadThrottled);\n }\n\n // Not all browsers support upload events\n if (onUploadProgress && request.upload) {\n [uploadThrottled, flushUpload] = progressEventReducer(onUploadProgress);\n\n request.upload.addEventListener('progress', uploadThrottled);\n\n request.upload.addEventListener('loadend', flushUpload);\n }\n\n if (_config.cancelToken || _config.signal) {\n // Handle cancellation\n // eslint-disable-next-line func-names\n onCanceled = (cancel) => {\n if (!request) {\n return;\n }\n reject(!cancel || cancel.type ? new CanceledError(null, config, request) : cancel);\n request.abort();\n done();\n request = null;\n };\n\n _config.cancelToken && _config.cancelToken.subscribe(onCanceled);\n if (_config.signal) {\n _config.signal.aborted\n ? onCanceled()\n : _config.signal.addEventListener('abort', onCanceled);\n }\n }\n\n const protocol = parseProtocol(_config.url);\n\n if (protocol && !platform.protocols.includes(protocol)) {\n reject(\n new AxiosError(\n 'Unsupported protocol ' + protocol + ':',\n AxiosError.ERR_BAD_REQUEST,\n config\n )\n );\n done();\n return;\n }\n\n // Send the request\n request.send(requestData || null);\n });\n };\n","'use strict';\n\nexport default function parseProtocol(url) {\n const match = /^([-+\\w]{1,25}):(?:\\/\\/)?/.exec(url);\n return (match && match[1]) || '';\n}\n","import CanceledError from '../cancel/CanceledError.js';\nimport AxiosError from '../core/AxiosError.js';\nimport utils from '../utils.js';\n\nconst composeSignals = (signals, timeout) => {\n signals = signals ? signals.filter(Boolean) : [];\n\n if (!timeout && !signals.length) {\n return;\n }\n\n const controller = new AbortController();\n\n let aborted = false;\n\n const onabort = function (reason) {\n if (!aborted) {\n aborted = true;\n unsubscribe();\n const err = reason instanceof Error ? reason : this.reason;\n controller.abort(\n err instanceof AxiosError\n ? err\n : new CanceledError(err instanceof Error ? err.message : err)\n );\n }\n };\n\n let timer =\n timeout &&\n setTimeout(() => {\n timer = null;\n onabort(new AxiosError(`timeout of ${timeout}ms exceeded`, AxiosError.ETIMEDOUT));\n }, timeout);\n\n const unsubscribe = () => {\n if (!signals) { return; }\n timer && clearTimeout(timer);\n timer = null;\n signals.forEach((signal) => {\n signal.unsubscribe\n ? signal.unsubscribe(onabort)\n : signal.removeEventListener('abort', onabort);\n });\n signals = null;\n };\n\n signals.forEach((signal) => {\n if (aborted) {\n return;\n }\n\n if (signal.aborted) {\n onabort.call(signal);\n return;\n }\n\n signal.addEventListener('abort', onabort, { once: true });\n });\n\n const { signal } = controller;\n\n signal.unsubscribe = () => utils.asap(unsubscribe);\n\n return signal;\n};\n\nexport default composeSignals;\n","export const streamChunk = function* (chunk, chunkSize) {\n let len = chunk.byteLength;\n\n if (!chunkSize || len < chunkSize) {\n yield chunk;\n return;\n }\n\n let pos = 0;\n let end;\n\n while (pos < len) {\n end = pos + chunkSize;\n yield chunk.slice(pos, end);\n pos = end;\n }\n};\n\nexport const readBytes = async function* (iterable, chunkSize) {\n for await (const chunk of readStream(iterable)) {\n yield* streamChunk(chunk, chunkSize);\n }\n};\n\nconst readStream = async function* (stream) {\n if (stream[Symbol.asyncIterator]) {\n yield* stream;\n return;\n }\n\n const reader = stream.getReader();\n try {\n for (;;) {\n const { done, value } = await reader.read();\n if (done) {\n break;\n }\n yield value;\n }\n } finally {\n await reader.cancel();\n }\n};\n\nexport const trackStream = (stream, chunkSize, onProgress, onFinish) => {\n const iterator = readBytes(stream, chunkSize);\n\n let bytes = 0;\n let done;\n let _onFinish = (e) => {\n if (!done) {\n done = true;\n onFinish && onFinish(e);\n }\n };\n\n return new ReadableStream(\n {\n async pull(controller) {\n try {\n const { done, value } = await iterator.next();\n\n if (done) {\n _onFinish();\n controller.close();\n return;\n }\n\n let len = value.byteLength;\n if (onProgress) {\n let loadedBytes = (bytes += len);\n onProgress(loadedBytes);\n }\n controller.enqueue(new Uint8Array(value));\n } catch (err) {\n _onFinish(err);\n throw err;\n }\n },\n cancel(reason) {\n _onFinish(reason);\n return iterator.return();\n },\n },\n {\n highWaterMark: 2,\n }\n );\n};\n","/**\n * Estimate data: URL byte lengths *without* allocating large buffers.\n * - Fetch percent-decodes a base64 body before decoding it.\n * - Node's Buffer.from(body, 'base64') sizes its backing allocation from the\n * raw body, including ignored characters and content after padding.\n * - Non-base64 data is percent-decoded and then encoded as UTF-8.\n */\nconst isHexDigit = (charCode) =>\n (charCode >= 48 && charCode <= 57) ||\n (charCode >= 65 && charCode <= 70) ||\n (charCode >= 97 && charCode <= 102);\n\nconst isPercentEncodedByte = (str, i, len) =>\n i + 2 < len && isHexDigit(str.charCodeAt(i + 1)) && isHexDigit(str.charCodeAt(i + 2));\n\nconst hexValue = (charCode) => (charCode <= 57 ? charCode - 48 : (charCode & 0xdf) - 55);\n\nconst isBase64Char = (charCode) =>\n (charCode >= 65 && charCode <= 90) || // A-Z\n (charCode >= 97 && charCode <= 122) || // a-z\n (charCode >= 48 && charCode <= 57) || // 0-9\n charCode === 43 || // +\n charCode === 47 || // /\n charCode === 45 || // - (base64url)\n charCode === 95; // _ (base64url)\n\nconst isBase64Whitespace = (charCode) =>\n charCode === 9 || charCode === 10 || charCode === 12 || charCode === 13 || charCode === 32;\n\nconst base64Bytes = (significant) => {\n const groups = Math.floor(significant / 4);\n const remainder = significant % 4;\n return groups * 3 + (remainder === 2 ? 1 : remainder === 3 ? 2 : 0);\n};\n\n// Buffer.byteLength(body, 'base64') uses the raw string length as an allocation\n// upper bound even when Buffer.from later ignores characters or stops at '='.\nconst estimateBase64BufferAllocation = (body) => {\n const len = body.length;\n let padding = 0;\n\n if (len > 0 && body.charCodeAt(len - 1) === 61 /* '=' */) {\n padding++;\n\n if (len > 1 && body.charCodeAt(len - 2) === 61 /* '=' */) {\n padding++;\n }\n }\n\n return Math.floor(((len - padding) * 3) / 4);\n};\n\nconst estimatePercentDecodedBase64Bytes = (body) => {\n const len = body.length;\n let significant = 0;\n let padding = 0;\n let invalid = false;\n\n for (let i = 0; i < len; i++) {\n let code = body.charCodeAt(i);\n\n if (code === 37 /* '%' */ && isPercentEncodedByte(body, i, len)) {\n code = hexValue(body.charCodeAt(i + 1)) * 16 + hexValue(body.charCodeAt(i + 2));\n i += 2;\n }\n\n if (isBase64Whitespace(code)) {\n continue;\n }\n\n if (code === 61 /* '=' */) {\n padding++;\n continue;\n }\n\n if (!isBase64Char(code) || padding > 0) {\n invalid = true;\n continue;\n }\n\n significant++;\n }\n\n // Fetch rejects malformed forgiving-base64 input. Returning the raw-size\n // allocation bound keeps that invalid input from becoming a pre-check bypass.\n if (\n invalid ||\n padding > 2 ||\n (padding > 0 && (significant + padding) % 4 !== 0) ||\n significant % 4 === 1\n ) {\n return estimateBase64BufferAllocation(body);\n }\n\n return base64Bytes(significant);\n};\n\nconst estimateDataURLBytes = (url, estimateBase64) => {\n if (!url || typeof url !== 'string') return 0;\n if (!url.startsWith('data:')) return 0;\n\n const comma = url.indexOf(',');\n if (comma < 0) return 0;\n\n const meta = url.slice(5, comma);\n const body = url.slice(comma + 1);\n const isBase64 = /;base64/i.test(meta);\n\n if (isBase64) {\n return estimateBase64(body);\n }\n\n // Compute UTF-8 byte length directly from UTF-16 code units without allocating\n // a byte buffer (TextEncoder.encode would defeat the DoS guard on large bodies).\n // Valid %XX triplets count as one decoded byte; this matches the bytes that\n // decodeURIComponent(body) would produce before Buffer re-encodes the string.\n let bytes = 0;\n for (let i = 0, len = body.length; i < len; i++) {\n const c = body.charCodeAt(i);\n if (c === 37 /* '%' */ && isPercentEncodedByte(body, i, len)) {\n bytes += 1;\n i += 2;\n } else if (c < 0x80) {\n bytes += 1;\n } else if (c < 0x800) {\n bytes += 2;\n } else if (c >= 0xd800 && c <= 0xdbff && i + 1 < len) {\n const next = body.charCodeAt(i + 1);\n if (next >= 0xdc00 && next <= 0xdfff) {\n bytes += 4;\n i++;\n } else {\n bytes += 3;\n }\n } else {\n bytes += 3;\n }\n }\n return bytes;\n};\n\n/**\n * Estimate the percent-decoded payload size used by Fetch data: URLs.\n *\n * @param {string} url\n * @returns {number}\n */\nexport default function estimateDataURLDecodedBytes(url) {\n // Fetch removes URL fragments before processing a data: URL.\n const fragmentIndex = typeof url === 'string' ? url.indexOf('#') : -1;\n\n return estimateDataURLBytes(\n fragmentIndex === -1 ? url : url.slice(0, fragmentIndex),\n estimatePercentDecodedBase64Bytes\n );\n}\n\n/**\n * Estimate the Buffer backing allocation used by Node's raw base64 decoder.\n *\n * @param {string} url\n * @returns {number}\n */\nexport function estimateDataURLBufferAllocation(url) {\n return estimateDataURLBytes(url, estimateBase64BufferAllocation);\n}\n","export const VERSION = \"1.19.0\";","import platform from '../platform/index.js';\nimport utils from '../utils.js';\nimport AxiosError from '../core/AxiosError.js';\nimport composeSignals from '../helpers/composeSignals.js';\nimport { trackStream } from '../helpers/trackStream.js';\nimport AxiosHeaders from '../core/AxiosHeaders.js';\nimport {\n progressEventReducer,\n progressEventDecorator,\n asyncDecorator,\n} from '../helpers/progressEventReducer.js';\nimport resolveConfig from '../helpers/resolveConfig.js';\nimport settle from '../core/settle.js';\nimport estimateDataURLDecodedBytes from '../helpers/estimateDataURLDecodedBytes.js';\nimport { VERSION } from '../env/data.js';\nimport { toByteStringHeaderObject } from '../helpers/sanitizeHeaderValue.js';\n\nconst DEFAULT_CHUNK_SIZE = 64 * 1024;\n\nconst { isFunction } = utils;\n\n/**\n * Encode a UTF-8 string to a Latin-1 byte string for use with btoa().\n * This is a modern replacement for the deprecated unescape(encodeURIComponent(str)) pattern.\n *\n * @param {string} str The string to encode\n *\n * @returns {string} UTF-8 bytes as a Latin-1 string\n */\nconst encodeUTF8 = (str) =>\n encodeURIComponent(str).replace(/%([0-9A-F]{2})/gi, (_, hex) =>\n String.fromCharCode(parseInt(hex, 16))\n );\n\n// Node's WHATWG URL parser returns `username` and `password` percent-encoded.\n// Decode before composing the `auth` option so credentials such as\n// `my%40email.com:pass` are sent as `my@email.com:pass`. Falls back to the\n// original value for malformed input so a bad encoding never throws.\nconst decodeURIComponentSafe = (value) => {\n if (!utils.isString(value)) {\n return value;\n }\n\n try {\n return decodeURIComponent(value);\n } catch (error) {\n return value;\n }\n};\n\nconst test = (fn, ...args) => {\n try {\n return !!fn(...args);\n } catch (e) {\n return false;\n }\n};\n\nconst maybeWithAuthCredentials = (url) => {\n const protocolIndex = url.indexOf('://');\n let urlToCheck = url;\n if (protocolIndex !== -1) {\n urlToCheck = urlToCheck.slice(protocolIndex + 3);\n }\n return urlToCheck.includes('@') || urlToCheck.includes(':');\n};\n\nconst factory = (env) => {\n const globalObject =\n utils.global !== undefined && utils.global !== null\n ? utils.global\n : globalThis;\n const { ReadableStream, TextEncoder } = globalObject;\n\n env = utils.merge.call(\n {\n skipUndefined: true,\n },\n {\n Request: globalObject.Request,\n Response: globalObject.Response,\n },\n env\n );\n\n const { fetch: envFetch, Request, Response } = env;\n const isFetchSupported = envFetch ? isFunction(envFetch) : typeof fetch === 'function';\n const isRequestSupported = isFunction(Request);\n const isResponseSupported = isFunction(Response);\n\n if (!isFetchSupported) {\n return false;\n }\n\n const isReadableStreamSupported = isFetchSupported && isFunction(ReadableStream);\n\n const encodeText =\n isFetchSupported &&\n (typeof TextEncoder === 'function'\n ? (\n (encoder) => (str) =>\n encoder.encode(str)\n )(new TextEncoder())\n : async (str) => new Uint8Array(await new Request(str).arrayBuffer()));\n\n const supportsRequestStream =\n isRequestSupported &&\n isReadableStreamSupported &&\n test(() => {\n let duplexAccessed = false;\n\n const request = new Request(platform.origin, {\n body: new ReadableStream(),\n method: 'POST',\n get duplex() {\n duplexAccessed = true;\n return 'half';\n },\n });\n\n const hasContentType = request.headers.has('Content-Type');\n\n if (request.body != null) {\n request.body.cancel();\n }\n\n return duplexAccessed && !hasContentType;\n });\n\n const supportsResponseStream =\n isResponseSupported &&\n isReadableStreamSupported &&\n test(() => utils.isReadableStream(new Response('').body));\n\n const resolvers = {\n stream: supportsResponseStream && ((res) => res.body),\n };\n\n isFetchSupported &&\n (() => {\n ['text', 'arrayBuffer', 'blob', 'formData', 'stream'].forEach((type) => {\n !resolvers[type] &&\n (resolvers[type] = (res, config) => {\n let method = res && res[type];\n\n if (method) {\n return method.call(res);\n }\n\n throw new AxiosError(\n `Response type '${type}' is not supported`,\n AxiosError.ERR_NOT_SUPPORT,\n config\n );\n });\n });\n })();\n\n const getBodyLength = async (body) => {\n if (body == null) {\n return 0;\n }\n\n if (utils.isBlob(body)) {\n return body.size;\n }\n\n if (utils.isSpecCompliantForm(body)) {\n const _request = new Request(platform.origin, {\n method: 'POST',\n body,\n });\n return (await _request.arrayBuffer()).byteLength;\n }\n\n if (utils.isArrayBufferView(body) || utils.isArrayBuffer(body)) {\n return body.byteLength;\n }\n\n if (utils.isURLSearchParams(body)) {\n body = body + '';\n }\n\n if (utils.isString(body)) {\n return (await encodeText(body)).byteLength;\n }\n };\n\n const resolveBodyLength = async (headers, body) => {\n const length = utils.toFiniteNumber(headers.getContentLength());\n\n return length == null ? getBodyLength(body) : length;\n };\n\n return async (config) => {\n let {\n url,\n method,\n data,\n signal,\n cancelToken,\n timeout,\n onDownloadProgress,\n onUploadProgress,\n responseType,\n headers,\n withCredentials = 'same-origin',\n fetchOptions,\n maxContentLength,\n maxBodyLength,\n } = resolveConfig(config);\n\n const hasMaxContentLength = utils.isNumber(maxContentLength) && maxContentLength > -1;\n const hasMaxBodyLength = utils.isNumber(maxBodyLength) && maxBodyLength > -1;\n const own = (key) => (utils.hasOwnProp(config, key) ? config[key] : undefined);\n\n let _fetch = envFetch || fetch;\n\n responseType = responseType ? (responseType + '').toLowerCase() : 'text';\n\n let composedSignal = composeSignals(\n [signal, cancelToken && cancelToken.toAbortSignal()],\n timeout\n );\n\n let request = null;\n\n const unsubscribe =\n composedSignal &&\n composedSignal.unsubscribe &&\n (() => {\n composedSignal.unsubscribe();\n });\n\n let requestContentLength;\n\n // AxiosError we raise while the request body is being streamed. Captured\n // by identity so the catch block can surface it directly, regardless of\n // how the runtime wraps the resulting fetch rejection (undici exposes it\n // as `err.cause`; some browsers drop the original error entirely).\n let pendingBodyError = null;\n\n const maxBodyLengthError = () =>\n new AxiosError(\n 'Request body larger than maxBodyLength limit',\n AxiosError.ERR_BAD_REQUEST,\n config,\n request\n );\n\n try {\n // HTTP basic authentication\n let auth = undefined;\n const configAuth = own('auth');\n\n if (configAuth) {\n const username = utils.getSafeProp(configAuth, 'username') || '';\n const password = utils.getSafeProp(configAuth, 'password') || '';\n auth = {\n username,\n password\n };\n }\n\n if (maybeWithAuthCredentials(url)) {\n const parsedURL = new URL(url, platform.origin);\n\n if (!auth && (parsedURL.username || parsedURL.password)) {\n const urlUsername = decodeURIComponentSafe(parsedURL.username);\n const urlPassword = decodeURIComponentSafe(parsedURL.password);\n auth = {\n username: urlUsername,\n password: urlPassword\n };\n }\n\n if (parsedURL.username || parsedURL.password) {\n parsedURL.username = '';\n parsedURL.password = '';\n url = parsedURL.href;\n }\n }\n\n if (auth) {\n headers.delete('authorization');\n headers.set(\n 'Authorization',\n 'Basic ' + btoa(encodeUTF8((auth.username || '') + ':' + (auth.password || '')))\n );\n }\n\n // Enforce maxContentLength for data: URLs up-front so we never materialize\n // an oversized payload. The HTTP adapter applies the same check (see http.js\n // \"if (protocol === 'data:')\" branch).\n if (hasMaxContentLength && typeof url === 'string' && url.startsWith('data:')) {\n const estimated = estimateDataURLDecodedBytes(url);\n if (estimated > maxContentLength) {\n throw new AxiosError(\n 'maxContentLength size of ' + maxContentLength + ' exceeded',\n AxiosError.ERR_BAD_RESPONSE,\n config,\n request\n );\n }\n }\n\n // Enforce maxBodyLength against known-size bodies before dispatch using\n // the body's *actual* size — never a caller-declared Content-Length,\n // which could under-report to slip an oversized body past the check.\n // Unknown-size streams return undefined here and are counted per-chunk\n // below as fetch consumes them.\n if (hasMaxBodyLength && method !== 'get' && method !== 'head') {\n const outboundLength = await getBodyLength(data);\n if (typeof outboundLength === 'number' && isFinite(outboundLength)) {\n requestContentLength = outboundLength;\n if (outboundLength > maxBodyLength) {\n throw maxBodyLengthError();\n }\n }\n }\n\n // A streamed body under maxBodyLength must be counted as fetch consumes\n // it; its size is never trusted from a caller-declared Content-Length.\n const mustEnforceStreamBody =\n hasMaxBodyLength && (utils.isReadableStream(data) || utils.isStream(data));\n\n const trackRequestStream = (stream, onProgress, flush) =>\n trackStream(\n stream,\n DEFAULT_CHUNK_SIZE,\n (loadedBytes) => {\n if (hasMaxBodyLength && loadedBytes > maxBodyLength) {\n throw (pendingBodyError = maxBodyLengthError());\n }\n onProgress && onProgress(loadedBytes);\n },\n flush\n );\n\n if (\n supportsRequestStream &&\n method !== 'get' &&\n method !== 'head' &&\n (onUploadProgress || mustEnforceStreamBody)\n ) {\n requestContentLength =\n requestContentLength == null ? await resolveBodyLength(headers, data) : requestContentLength;\n\n // A declared length of 0 is only trusted to skip the wrap when we are\n // not enforcing a stream limit (which must not rely on that header).\n if (requestContentLength !== 0 || mustEnforceStreamBody) {\n let _request = new Request(url, {\n method: 'POST',\n body: data,\n duplex: 'half',\n });\n\n let contentTypeHeader;\n\n if (utils.isFormData(data) && (contentTypeHeader = _request.headers.get('content-type'))) {\n headers.setContentType(contentTypeHeader);\n }\n\n if (_request.body) {\n const [onProgress, flush] =\n (onUploadProgress &&\n progressEventDecorator(\n requestContentLength,\n progressEventReducer(asyncDecorator(onUploadProgress))\n )) ||\n [];\n\n data = trackRequestStream(_request.body, onProgress, flush);\n }\n }\n } else if (\n mustEnforceStreamBody &&\n !isRequestSupported &&\n isReadableStreamSupported &&\n method !== 'get' &&\n method !== 'head'\n ) {\n data = trackRequestStream(data);\n } else if (\n mustEnforceStreamBody &&\n isRequestSupported &&\n !supportsRequestStream &&\n method !== 'get' &&\n method !== 'head'\n ) {\n throw new AxiosError(\n 'Stream request bodies are not supported by the current fetch implementation',\n AxiosError.ERR_NOT_SUPPORT,\n config,\n request\n );\n }\n\n if (!utils.isString(withCredentials)) {\n withCredentials = withCredentials ? 'include' : 'omit';\n }\n\n // Cloudflare Workers throws when credentials are defined\n // see https://github.com/cloudflare/workerd/issues/902\n const isCredentialsSupported = isRequestSupported && 'credentials' in Request.prototype;\n\n // If data is FormData and Content-Type is multipart/form-data without boundary,\n // delete it so fetch can set it correctly with the boundary\n if (utils.isFormData(data)) {\n const contentType = headers.getContentType();\n if (\n contentType &&\n /^multipart\\/form-data/i.test(contentType) &&\n !/boundary=/i.test(contentType)\n ) {\n headers.delete('content-type');\n }\n }\n\n // Set User-Agent header if not already set (fetch defaults to 'node' in Node.js)\n headers.set('User-Agent', 'axios/' + VERSION, false);\n\n const resolvedOptions = {\n ...fetchOptions,\n signal: composedSignal,\n method: method.toUpperCase(),\n headers: toByteStringHeaderObject(headers.normalize()),\n body: data,\n duplex: 'half',\n credentials: isCredentialsSupported ? withCredentials : undefined,\n };\n\n request = isRequestSupported && new Request(url, resolvedOptions);\n\n let response = await (isRequestSupported\n ? _fetch(request, fetchOptions)\n : _fetch(url, resolvedOptions));\n\n const responseHeaders = AxiosHeaders.from(response.headers);\n\n // Cheap pre-check: if the server honestly declares a content-length that\n // already exceeds the cap, reject before we start streaming.\n if (hasMaxContentLength) {\n const declaredLength = utils.toFiniteNumber(responseHeaders.getContentLength());\n if (declaredLength != null && declaredLength > maxContentLength) {\n throw new AxiosError(\n 'maxContentLength size of ' + maxContentLength + ' exceeded',\n AxiosError.ERR_BAD_RESPONSE,\n config,\n request\n );\n }\n }\n\n const isStreamResponse =\n supportsResponseStream && (responseType === 'stream' || responseType === 'response');\n\n if (\n supportsResponseStream &&\n response.body &&\n (onDownloadProgress || hasMaxContentLength || (isStreamResponse && unsubscribe))\n ) {\n const options = {};\n\n ['status', 'statusText', 'headers'].forEach((prop) => {\n options[prop] = response[prop];\n });\n\n const responseContentLength = utils.toFiniteNumber(responseHeaders.getContentLength());\n\n const [onProgress, flush] =\n (onDownloadProgress &&\n progressEventDecorator(\n responseContentLength,\n progressEventReducer(asyncDecorator(onDownloadProgress), true)\n )) ||\n [];\n\n let bytesRead = 0;\n const onChunkProgress = (loadedBytes) => {\n if (hasMaxContentLength) {\n bytesRead = loadedBytes;\n if (bytesRead > maxContentLength) {\n throw new AxiosError(\n 'maxContentLength size of ' + maxContentLength + ' exceeded',\n AxiosError.ERR_BAD_RESPONSE,\n config,\n request\n );\n }\n }\n onProgress && onProgress(loadedBytes);\n };\n\n response = new Response(\n trackStream(response.body, DEFAULT_CHUNK_SIZE, onChunkProgress, () => {\n flush && flush();\n unsubscribe && unsubscribe();\n }),\n options\n );\n }\n\n responseType = responseType || 'text';\n\n let responseData = await resolvers[utils.findKey(resolvers, responseType) || 'text'](\n response,\n config\n );\n\n // Fallback enforcement for environments without ReadableStream support\n // (legacy runtimes). Detect materialized size from typed output; skip\n // streams/Response passthrough since the user will read those themselves.\n if (hasMaxContentLength && !supportsResponseStream && !isStreamResponse) {\n let materializedSize;\n if (responseData != null) {\n if (typeof responseData.byteLength === 'number') {\n materializedSize = responseData.byteLength;\n } else if (typeof responseData.size === 'number') {\n materializedSize = responseData.size;\n } else if (typeof responseData === 'string') {\n materializedSize =\n typeof TextEncoder === 'function'\n ? new TextEncoder().encode(responseData).byteLength\n : responseData.length;\n }\n }\n if (typeof materializedSize === 'number' && materializedSize > maxContentLength) {\n throw new AxiosError(\n 'maxContentLength size of ' + maxContentLength + ' exceeded',\n AxiosError.ERR_BAD_RESPONSE,\n config,\n request\n );\n }\n }\n\n !isStreamResponse && unsubscribe && unsubscribe();\n\n return await new Promise((resolve, reject) => {\n settle(resolve, reject, {\n data: responseData,\n headers: AxiosHeaders.from(response.headers),\n status: response.status,\n statusText: response.statusText,\n config,\n request,\n });\n });\n } catch (err) {\n unsubscribe && unsubscribe();\n\n // Safari can surface fetch aborts as a DOMException-like object whose\n // branded getters throw. Prefer our composed signal reason before reading\n // the caught error, preserving timeout vs cancellation semantics.\n if (composedSignal && composedSignal.aborted && composedSignal.reason instanceof AxiosError) {\n const canceledError = composedSignal.reason;\n canceledError.config = config;\n request && (canceledError.request = request);\n if (err !== canceledError) {\n // Non-enumerable to match native Error `cause` semantics so loggers\n // don't recurse into circular fetch internals (see #7205).\n Object.defineProperty(canceledError, 'cause', {\n __proto__: null,\n value: err,\n writable: true,\n enumerable: false,\n configurable: true,\n });\n }\n throw canceledError;\n }\n\n // Surface a maxBodyLength violation we raised while the request body was\n // being streamed. Matching by identity (rather than reading\n // `err.cause.isAxiosError`) keeps the error deterministic across runtimes\n // and avoids both prototype-pollution reads and mis-attributing a foreign\n // AxiosError that merely happened to land in `err.cause`.\n if (pendingBodyError) {\n request && !pendingBodyError.request && (pendingBodyError.request = request);\n throw pendingBodyError;\n }\n\n // Re-throw AxiosErrors we raised synchronously (data: URL / content-length\n // pre-checks, response size enforcement) without re-wrapping them.\n if (err instanceof AxiosError) {\n request && !err.request && (err.request = request);\n throw err;\n }\n\n if (err && err.name === 'TypeError' && /Load failed|fetch/i.test(err.message)) {\n const networkError = new AxiosError(\n 'Network Error',\n AxiosError.ERR_NETWORK,\n config,\n request,\n err && err.response\n );\n // Non-enumerable to match native Error `cause` semantics so loggers\n // don't recurse into circular fetch internals (see #7205).\n Object.defineProperty(networkError, 'cause', {\n __proto__: null,\n value: err.cause || err,\n writable: true,\n enumerable: false,\n configurable: true,\n });\n throw networkError;\n }\n\n throw AxiosError.from(err, err && err.code, config, request, err && err.response);\n }\n };\n};\n\nconst seedCache = new Map();\n\nexport const getFetch = (config) => {\n let env = (config && config.env) || {};\n const { fetch, Request, Response } = env;\n const seeds = [Request, Response, fetch];\n\n let len = seeds.length,\n i = len,\n seed,\n target,\n map = seedCache;\n\n while (i--) {\n seed = seeds[i];\n target = map.get(seed);\n\n target === undefined && map.set(seed, (target = i ? new Map() : factory(env)));\n\n map = target;\n }\n\n return target;\n};\n\nconst adapter = getFetch();\n\nexport default adapter;\n","import utils from '../utils.js';\nimport httpAdapter from './http.js';\nimport xhrAdapter from './xhr.js';\nimport * as fetchAdapter from './fetch.js';\nimport AxiosError from '../core/AxiosError.js';\n\n/**\n * Known adapters mapping.\n * Provides environment-specific adapters for Axios:\n * - `http` for Node.js\n * - `xhr` for browsers\n * - `fetch` for fetch API-based requests\n *\n * @type {Object}\n */\nconst knownAdapters = {\n http: httpAdapter,\n xhr: xhrAdapter,\n fetch: {\n get: fetchAdapter.getFetch,\n },\n};\n\n// Assign adapter names for easier debugging and identification\nutils.forEach(knownAdapters, (fn, value) => {\n if (fn) {\n try {\n // Null-proto descriptors so a polluted Object.prototype.get cannot turn\n // these data descriptors into accessor descriptors on the way in.\n Object.defineProperty(fn, 'name', { __proto__: null, value });\n } catch (e) {\n // eslint-disable-next-line no-empty\n }\n Object.defineProperty(fn, 'adapterName', { __proto__: null, value });\n }\n});\n\n/**\n * Render a rejection reason string for unknown or unsupported adapters\n *\n * @param {string} reason\n * @returns {string}\n */\nconst renderReason = (reason) => `- ${reason}`;\n\n/**\n * Check if the adapter is resolved (function, null, or false)\n *\n * @param {Function|null|false} adapter\n * @returns {boolean}\n */\nconst isResolvedHandle = (adapter) =>\n utils.isFunction(adapter) || adapter === null || adapter === false;\n\n/**\n * Get the first suitable adapter from the provided list.\n * Tries each adapter in order until a supported one is found.\n * Throws an AxiosError if no adapter is suitable.\n *\n * @param {Array|string|Function} adapters - Adapter(s) by name or function.\n * @param {Object} config - Axios request configuration\n * @throws {AxiosError} If no suitable adapter is available\n * @returns {Function} The resolved adapter function\n */\nfunction getAdapter(adapters, config) {\n adapters = utils.isArray(adapters) ? adapters : [adapters];\n\n const { length } = adapters;\n let nameOrAdapter;\n let adapter;\n\n const rejectedReasons = {};\n\n for (let i = 0; i < length; i++) {\n nameOrAdapter = adapters[i];\n let id;\n\n adapter = nameOrAdapter;\n\n if (!isResolvedHandle(nameOrAdapter)) {\n adapter = knownAdapters[(id = String(nameOrAdapter)).toLowerCase()];\n\n if (adapter === undefined) {\n throw new AxiosError(`Unknown adapter '${id}'`);\n }\n }\n\n if (adapter && (utils.isFunction(adapter) || (adapter = adapter.get(config)))) {\n break;\n }\n\n rejectedReasons[id || '#' + i] = adapter;\n }\n\n if (!adapter) {\n const reasons = Object.entries(rejectedReasons).map(\n ([id, state]) =>\n `adapter ${id} ` +\n (state === false ? 'is not supported by the environment' : 'is not available in the build')\n );\n\n let s = length\n ? reasons.length > 1\n ? 'since :\\n' + reasons.map(renderReason).join('\\n')\n : ' ' + renderReason(reasons[0])\n : 'as no adapter specified';\n\n throw new AxiosError(\n `There is no suitable adapter to dispatch the request ` + s,\n AxiosError.ERR_NOT_SUPPORT\n );\n }\n\n return adapter;\n}\n\n/**\n * Exports Axios adapters and utility to resolve an adapter\n */\nexport default {\n /**\n * Resolve an adapter from a list of adapter names or functions.\n * @type {Function}\n */\n getAdapter,\n\n /**\n * Exposes all known adapters\n * @type {Object}\n */\n adapters: knownAdapters,\n};\n","// eslint-disable-next-line strict\nexport default null;\n","'use strict';\n\nimport transformData from './transformData.js';\nimport isCancel from '../cancel/isCancel.js';\nimport defaults from '../defaults/index.js';\nimport CanceledError from '../cancel/CanceledError.js';\nimport AxiosHeaders from '../core/AxiosHeaders.js';\nimport adapters from '../adapters/adapters.js';\n\n/**\n * Throws a `CanceledError` if cancellation has been requested.\n *\n * @param {Object} config The config that is to be used for the request\n *\n * @returns {void}\n */\nfunction throwIfCancellationRequested(config) {\n if (config.cancelToken) {\n config.cancelToken.throwIfRequested();\n }\n\n if (config.signal && config.signal.aborted) {\n throw new CanceledError(null, config);\n }\n}\n\n/**\n * Dispatch a request to the server using the configured adapter.\n *\n * @param {object} config The config that is to be used for the request\n *\n * @returns {Promise} The Promise to be fulfilled\n */\nexport default function dispatchRequest(config) {\n throwIfCancellationRequested(config);\n\n config.headers = AxiosHeaders.from(config.headers);\n\n // Transform request data\n config.data = transformData.call(config, config.transformRequest);\n\n if (['post', 'put', 'patch'].indexOf(config.method) !== -1) {\n config.headers.setContentType('application/x-www-form-urlencoded', false);\n }\n\n const adapter = adapters.getAdapter(config.adapter || defaults.adapter, config);\n\n return adapter(config).then(\n function onAdapterResolution(response) {\n throwIfCancellationRequested(config);\n\n // Expose the current response on config so that transformResponse can\n // attach it to any AxiosError it throws (e.g. on JSON parse failure).\n // We clean it up afterwards to avoid polluting the config object.\n config.response = response;\n try {\n response.data = transformData.call(config, config.transformResponse, response);\n } finally {\n delete config.response;\n }\n\n response.headers = AxiosHeaders.from(response.headers);\n\n return response;\n },\n function onAdapterRejection(reason) {\n if (!isCancel(reason)) {\n throwIfCancellationRequested(config);\n\n // Transform response data\n if (reason && reason.response) {\n config.response = reason.response;\n try {\n reason.response.data = transformData.call(\n config,\n config.transformResponse,\n reason.response\n );\n } finally {\n delete config.response;\n }\n reason.response.headers = AxiosHeaders.from(reason.response.headers);\n }\n }\n\n return Promise.reject(reason);\n }\n );\n}\n","'use strict';\n\nimport { VERSION } from '../env/data.js';\nimport AxiosError from '../core/AxiosError.js';\n\nconst validators = {};\n\n// eslint-disable-next-line func-names\n['object', 'boolean', 'number', 'function', 'string', 'symbol'].forEach((type, i) => {\n validators[type] = function validator(thing) {\n return typeof thing === type || 'a' + (i < 1 ? 'n ' : ' ') + type;\n };\n});\n\nconst deprecatedWarnings = {};\n\n/**\n * Transitional option validator\n *\n * @param {function|boolean?} validator - set to false if the transitional option has been removed\n * @param {string?} version - deprecated version / removed since version\n * @param {string?} message - some message with additional info\n *\n * @returns {function}\n */\nvalidators.transitional = function transitional(validator, version, message) {\n function formatMessage(opt, desc) {\n return (\n '[Axios v' +\n VERSION +\n \"] Transitional option '\" +\n opt +\n \"'\" +\n desc +\n (message ? '. ' + message : '')\n );\n }\n\n // eslint-disable-next-line func-names\n return (value, opt, opts) => {\n if (validator === false) {\n throw new AxiosError(\n formatMessage(opt, ' has been removed' + (version ? ' in ' + version : '')),\n AxiosError.ERR_DEPRECATED\n );\n }\n\n if (version && !deprecatedWarnings[opt]) {\n deprecatedWarnings[opt] = true;\n // eslint-disable-next-line no-console\n console.warn(\n formatMessage(\n opt,\n ' has been deprecated since v' + version + ' and will be removed in the near future'\n )\n );\n }\n\n return validator ? validator(value, opt, opts) : true;\n };\n};\n\nvalidators.spelling = function spelling(correctSpelling) {\n return (value, opt) => {\n // eslint-disable-next-line no-console\n console.warn(`${opt} is likely a misspelling of ${correctSpelling}`);\n return true;\n };\n};\n\n/**\n * Assert object's properties type\n *\n * @param {object} options\n * @param {object} schema\n * @param {boolean?} allowUnknown\n *\n * @returns {object}\n */\n\nfunction assertOptions(options, schema, allowUnknown) {\n if (typeof options !== 'object' || options === null) {\n throw new AxiosError('options must be an object', AxiosError.ERR_BAD_OPTION_VALUE);\n }\n const keys = Object.keys(options);\n let i = keys.length;\n while (i-- > 0) {\n const opt = keys[i];\n // Use hasOwnProperty so a polluted Object.prototype. cannot supply\n // a non-function validator and cause a TypeError.\n const validator = Object.prototype.hasOwnProperty.call(schema, opt) ? schema[opt] : undefined;\n if (validator) {\n const value = options[opt];\n const result = value === undefined || validator(value, opt, options);\n if (result !== true) {\n throw new AxiosError(\n 'option ' + opt + ' must be ' + result,\n AxiosError.ERR_BAD_OPTION_VALUE\n );\n }\n continue;\n }\n if (allowUnknown !== true) {\n throw new AxiosError('Unknown option ' + opt, AxiosError.ERR_BAD_OPTION);\n }\n }\n}\n\nexport default {\n assertOptions,\n validators,\n};\n","'use strict';\n\nimport utils from '../utils.js';\nimport buildURL from '../helpers/buildURL.js';\nimport InterceptorManager from './InterceptorManager.js';\nimport dispatchRequest from './dispatchRequest.js';\nimport mergeConfig from './mergeConfig.js';\nimport buildFullPath from './buildFullPath.js';\nimport validator from '../helpers/validator.js';\nimport AxiosHeaders from './AxiosHeaders.js';\nimport transitionalDefaults from '../defaults/transitional.js';\n\nconst validators = validator.validators;\n\n/**\n * Create a new instance of Axios\n *\n * @param {Object} instanceConfig The default config for the instance\n *\n * @return {Axios} A new instance of Axios\n */\nclass Axios {\n constructor(instanceConfig) {\n this.defaults = instanceConfig || {};\n this.interceptors = {\n request: new InterceptorManager(),\n response: new InterceptorManager(),\n };\n }\n\n /**\n * Dispatch a request\n *\n * @param {String|Object} configOrUrl The config specific for this request (merged with this.defaults)\n * @param {?Object} config\n *\n * @returns {Promise} The Promise to be fulfilled\n */\n async request(configOrUrl, config) {\n try {\n return await this._request(configOrUrl, config);\n } catch (err) {\n if (err instanceof Error) {\n let dummy = {};\n\n Error.captureStackTrace ? Error.captureStackTrace(dummy) : (dummy = new Error());\n\n // slice off the Error: ... line\n const stack = (() => {\n if (!dummy.stack) {\n return '';\n }\n\n const firstNewlineIndex = dummy.stack.indexOf('\\n');\n\n return firstNewlineIndex === -1 ? '' : dummy.stack.slice(firstNewlineIndex + 1);\n })();\n try {\n if (!err.stack) {\n err.stack = stack;\n // match without the 2 top stack lines\n } else if (stack) {\n const firstNewlineIndex = stack.indexOf('\\n');\n const secondNewlineIndex =\n firstNewlineIndex === -1 ? -1 : stack.indexOf('\\n', firstNewlineIndex + 1);\n const stackWithoutTwoTopLines =\n secondNewlineIndex === -1 ? '' : stack.slice(secondNewlineIndex + 1);\n\n if (!String(err.stack).endsWith(stackWithoutTwoTopLines)) {\n err.stack += '\\n' + stack;\n }\n }\n } catch (e) {\n // ignore the case where \"stack\" is an un-writable property\n }\n }\n\n throw err;\n }\n }\n\n _request(configOrUrl, config) {\n /*eslint no-param-reassign:0*/\n // Allow for axios('example/url'[, config]) a la fetch API\n if (typeof configOrUrl === 'string') {\n config = config || {};\n config.url = configOrUrl;\n } else {\n config = configOrUrl || {};\n }\n\n config = mergeConfig(this.defaults, config);\n\n const { transitional, paramsSerializer, headers } = config;\n\n if (transitional !== undefined) {\n validator.assertOptions(\n transitional,\n {\n silentJSONParsing: validators.transitional(validators.boolean),\n forcedJSONParsing: validators.transitional(validators.boolean),\n clarifyTimeoutError: validators.transitional(validators.boolean),\n legacyInterceptorReqResOrdering: validators.transitional(validators.boolean),\n advertiseZstdAcceptEncoding: validators.transitional(validators.boolean),\n validateStatusUndefinedResolves: validators.transitional(validators.boolean),\n },\n false\n );\n }\n\n if (paramsSerializer != null) {\n if (utils.isFunction(paramsSerializer)) {\n config.paramsSerializer = {\n serialize: paramsSerializer,\n };\n } else {\n validator.assertOptions(\n paramsSerializer,\n {\n encode: validators.function,\n serialize: validators.function,\n },\n true\n );\n }\n }\n\n // Set config.allowAbsoluteUrls\n if (config.allowAbsoluteUrls !== undefined) {\n // do nothing\n } else if (this.defaults.allowAbsoluteUrls !== undefined) {\n config.allowAbsoluteUrls = this.defaults.allowAbsoluteUrls;\n } else {\n config.allowAbsoluteUrls = true;\n }\n\n validator.assertOptions(\n config,\n {\n baseUrl: validators.spelling('baseURL'),\n withXsrfToken: validators.spelling('withXSRFToken'),\n },\n true\n );\n\n // Set config.method\n config.method = (config.method || this.defaults.method || 'get').toLowerCase();\n\n // Flatten headers\n let contextHeaders = headers && utils.merge(headers.common, headers[config.method]);\n\n headers &&\n utils.forEach(['delete', 'get', 'head', 'post', 'put', 'patch', 'query', 'common'], (method) => {\n delete headers[method];\n });\n\n config.headers = AxiosHeaders.concat(contextHeaders, headers);\n\n // filter out skipped interceptors\n const requestInterceptorChain = [];\n let synchronousRequestInterceptors = true;\n this.interceptors.request.forEach(function unshiftRequestInterceptors(interceptor) {\n if (typeof interceptor.runWhen === 'function' && interceptor.runWhen(config) === false) {\n return;\n }\n\n synchronousRequestInterceptors = synchronousRequestInterceptors && interceptor.synchronous;\n\n const transitional = config.transitional || transitionalDefaults;\n const legacyInterceptorReqResOrdering =\n transitional && transitional.legacyInterceptorReqResOrdering;\n\n if (legacyInterceptorReqResOrdering) {\n requestInterceptorChain.unshift(interceptor.fulfilled, interceptor.rejected);\n } else {\n requestInterceptorChain.push(interceptor.fulfilled, interceptor.rejected);\n }\n });\n\n const responseInterceptorChain = [];\n this.interceptors.response.forEach(function pushResponseInterceptors(interceptor) {\n responseInterceptorChain.push(interceptor.fulfilled, interceptor.rejected);\n });\n\n let promise;\n let i = 0;\n let len;\n\n if (!synchronousRequestInterceptors) {\n const chain = [dispatchRequest.bind(this), undefined];\n chain.unshift(...requestInterceptorChain);\n chain.push(...responseInterceptorChain);\n len = chain.length;\n\n promise = Promise.resolve(config);\n\n while (i < len) {\n promise = promise.then(chain[i++], chain[i++]);\n }\n\n return promise;\n }\n\n len = requestInterceptorChain.length;\n\n let newConfig = config;\n\n while (i < len) {\n const onFulfilled = requestInterceptorChain[i++];\n const onRejected = requestInterceptorChain[i++];\n try {\n newConfig = onFulfilled ? onFulfilled(newConfig) : newConfig;\n } catch (error) {\n if (!onRejected) {\n promise = Promise.reject(error);\n break;\n }\n\n try {\n const rejectedResult = onRejected.call(this, error);\n\n if (utils.isThenable(rejectedResult)) {\n promise = Promise.resolve(rejectedResult).then(() =>\n dispatchRequest.call(this, newConfig)\n );\n }\n } catch (rejectedError) {\n promise = Promise.reject(rejectedError);\n }\n\n break;\n }\n }\n\n if (!promise) {\n try {\n promise = dispatchRequest.call(this, newConfig);\n } catch (error) {\n promise = Promise.reject(error);\n }\n }\n\n i = 0;\n len = responseInterceptorChain.length;\n\n while (i < len) {\n promise = promise.then(responseInterceptorChain[i++], responseInterceptorChain[i++]);\n }\n\n return promise;\n }\n\n getUri(config) {\n config = mergeConfig(this.defaults, config);\n const fullPath = buildFullPath(config.baseURL, config.url, config.allowAbsoluteUrls, config);\n return buildURL(fullPath, config.params, config.paramsSerializer);\n }\n}\n\n// Provide aliases for supported request methods\nutils.forEach(['delete', 'get', 'head', 'options'], function forEachMethodNoData(method) {\n /*eslint func-names:0*/\n Axios.prototype[method] = function (url, config) {\n return this.request(\n mergeConfig(config || {}, {\n method,\n url,\n data: config && utils.hasOwnProp(config, 'data') ? config.data : undefined,\n })\n );\n };\n});\n\nutils.forEach(['post', 'put', 'patch', 'query'], function forEachMethodWithData(method) {\n function generateHTTPMethod(isForm) {\n return function httpMethod(url, data, config) {\n return this.request(\n mergeConfig(config || {}, {\n method,\n headers: isForm\n ? {\n 'Content-Type': 'multipart/form-data',\n }\n : {},\n url,\n data,\n })\n );\n };\n }\n\n Axios.prototype[method] = generateHTTPMethod();\n\n // QUERY is a safe/idempotent read method; multipart form bodies don't fit\n // its semantics, so no queryForm shorthand is generated.\n if (method !== 'query') {\n Axios.prototype[method + 'Form'] = generateHTTPMethod(true);\n }\n});\n\nexport default Axios;\n","const HttpStatusCode = {\n Continue: 100,\n SwitchingProtocols: 101,\n Processing: 102,\n EarlyHints: 103,\n Ok: 200,\n Created: 201,\n Accepted: 202,\n NonAuthoritativeInformation: 203,\n NoContent: 204,\n ResetContent: 205,\n PartialContent: 206,\n MultiStatus: 207,\n AlreadyReported: 208,\n ImUsed: 226,\n MultipleChoices: 300,\n MovedPermanently: 301,\n Found: 302,\n SeeOther: 303,\n NotModified: 304,\n UseProxy: 305,\n Unused: 306,\n TemporaryRedirect: 307,\n PermanentRedirect: 308,\n BadRequest: 400,\n Unauthorized: 401,\n PaymentRequired: 402,\n Forbidden: 403,\n NotFound: 404,\n MethodNotAllowed: 405,\n NotAcceptable: 406,\n ProxyAuthenticationRequired: 407,\n RequestTimeout: 408,\n Conflict: 409,\n Gone: 410,\n LengthRequired: 411,\n PreconditionFailed: 412,\n PayloadTooLarge: 413,\n UriTooLong: 414,\n UnsupportedMediaType: 415,\n RangeNotSatisfiable: 416,\n ExpectationFailed: 417,\n ImATeapot: 418,\n MisdirectedRequest: 421,\n UnprocessableEntity: 422,\n Locked: 423,\n FailedDependency: 424,\n TooEarly: 425,\n UpgradeRequired: 426,\n PreconditionRequired: 428,\n TooManyRequests: 429,\n RequestHeaderFieldsTooLarge: 431,\n UnavailableForLegalReasons: 451,\n InternalServerError: 500,\n NotImplemented: 501,\n BadGateway: 502,\n ServiceUnavailable: 503,\n GatewayTimeout: 504,\n HttpVersionNotSupported: 505,\n VariantAlsoNegotiates: 506,\n InsufficientStorage: 507,\n LoopDetected: 508,\n NotExtended: 510,\n NetworkAuthenticationRequired: 511,\n WebServerReturnsAnUnknownError: 520,\n WebServerIsDown: 521,\n ConnectionTimedOut: 522,\n OriginIsUnreachable: 523,\n TimeoutOccurred: 524,\n SslHandshakeFailed: 525,\n InvalidSslCertificate: 526,\n};\n\nObject.entries(HttpStatusCode).forEach(([key, value]) => {\n HttpStatusCode[value] = key;\n});\n\nexport default HttpStatusCode;\n","'use strict';\n\nimport utils from './utils.js';\nimport bind from './helpers/bind.js';\nimport Axios from './core/Axios.js';\nimport mergeConfig from './core/mergeConfig.js';\nimport defaults from './defaults/index.js';\nimport formDataToJSON from './helpers/formDataToJSON.js';\nimport CanceledError from './cancel/CanceledError.js';\nimport CancelToken from './cancel/CancelToken.js';\nimport isCancel from './cancel/isCancel.js';\nimport { VERSION } from './env/data.js';\nimport toFormData from './helpers/toFormData.js';\nimport AxiosError from './core/AxiosError.js';\nimport spread from './helpers/spread.js';\nimport isAxiosError from './helpers/isAxiosError.js';\nimport AxiosHeaders from './core/AxiosHeaders.js';\nimport adapters from './adapters/adapters.js';\nimport HttpStatusCode from './helpers/HttpStatusCode.js';\n\n/**\n * Create an instance of Axios\n *\n * @param {Object} defaultConfig The default config for the instance\n *\n * @returns {Axios} A new instance of Axios\n */\nfunction createInstance(defaultConfig) {\n const context = new Axios(defaultConfig);\n const instance = bind(Axios.prototype.request, context);\n\n // Copy axios.prototype to instance\n utils.extend(instance, Axios.prototype, context, { allOwnKeys: true });\n\n // Copy context to instance\n utils.extend(instance, context, null, { allOwnKeys: true });\n\n // Factory for creating new instances\n instance.create = function create(instanceConfig) {\n return createInstance(mergeConfig(defaultConfig, instanceConfig));\n };\n\n return instance;\n}\n\n// Create the default instance to be exported\nconst axios = createInstance(defaults);\n\n// Expose Axios class to allow class inheritance\naxios.Axios = Axios;\n\n// Expose Cancel & CancelToken\naxios.CanceledError = CanceledError;\naxios.CancelToken = CancelToken;\naxios.isCancel = isCancel;\naxios.VERSION = VERSION;\naxios.toFormData = toFormData;\n\n// Expose AxiosError class\naxios.AxiosError = AxiosError;\n\n// alias for CanceledError for backward compatibility\naxios.Cancel = axios.CanceledError;\n\n// Expose all/spread\naxios.all = function all(promises) {\n return Promise.all(promises);\n};\n\naxios.spread = spread;\n\n// Expose isAxiosError\naxios.isAxiosError = isAxiosError;\n\n// Expose mergeConfig\naxios.mergeConfig = mergeConfig;\n\naxios.AxiosHeaders = AxiosHeaders;\n\naxios.formToJSON = (thing) => formDataToJSON(utils.isHTMLForm(thing) ? new FormData(thing) : thing);\n\naxios.getAdapter = adapters.getAdapter;\n\naxios.HttpStatusCode = HttpStatusCode;\n\naxios.default = axios;\n\n// this module should only have a default export\nexport default axios;\n","'use strict';\n\nimport CanceledError from './CanceledError.js';\n\n/**\n * A `CancelToken` is an object that can be used to request cancellation of an operation.\n *\n * @param {Function} executor The executor function.\n *\n * @returns {CancelToken}\n */\nclass CancelToken {\n constructor(executor) {\n if (typeof executor !== 'function') {\n throw new TypeError('executor must be a function.');\n }\n\n let resolvePromise;\n\n this.promise = new Promise(function promiseExecutor(resolve) {\n resolvePromise = resolve;\n });\n\n const token = this;\n\n // eslint-disable-next-line func-names\n this.promise.then((cancel) => {\n if (!token._listeners) return;\n\n let i = token._listeners.length;\n\n while (i-- > 0) {\n token._listeners[i](cancel);\n }\n token._listeners = null;\n });\n\n // eslint-disable-next-line func-names\n this.promise.then = (onfulfilled) => {\n let _resolve;\n // eslint-disable-next-line func-names\n const promise = new Promise((resolve) => {\n token.subscribe(resolve);\n _resolve = resolve;\n }).then(onfulfilled);\n\n promise.cancel = function reject() {\n token.unsubscribe(_resolve);\n };\n\n return promise;\n };\n\n executor(function cancel(message, config, request) {\n if (token.reason) {\n // Cancellation has already been requested\n return;\n }\n\n token.reason = new CanceledError(message, config, request);\n resolvePromise(token.reason);\n });\n }\n\n /**\n * Throws a `CanceledError` if cancellation has been requested.\n */\n throwIfRequested() {\n if (this.reason) {\n throw this.reason;\n }\n }\n\n /**\n * Subscribe to the cancel signal\n */\n\n subscribe(listener) {\n if (this.reason) {\n listener(this.reason);\n return;\n }\n\n if (this._listeners) {\n this._listeners.push(listener);\n } else {\n this._listeners = [listener];\n }\n }\n\n /**\n * Unsubscribe from the cancel signal\n */\n\n unsubscribe(listener) {\n if (!this._listeners) {\n return;\n }\n const index = this._listeners.indexOf(listener);\n if (index !== -1) {\n this._listeners.splice(index, 1);\n }\n }\n\n toAbortSignal() {\n const controller = new AbortController();\n\n const abort = (err) => {\n controller.abort(err);\n };\n\n this.subscribe(abort);\n\n controller.signal.unsubscribe = () => this.unsubscribe(abort);\n\n return controller.signal;\n }\n\n /**\n * Returns an object that contains a new `CancelToken` and a function that, when called,\n * cancels the `CancelToken`.\n */\n static source() {\n let cancel;\n const token = new CancelToken(function executor(c) {\n cancel = c;\n });\n return {\n token,\n cancel,\n };\n }\n}\n\nexport default CancelToken;\n","'use strict';\n\n/**\n * Syntactic sugar for invoking a function and expanding an array for arguments.\n *\n * Common use case would be to use `Function.prototype.apply`.\n *\n * ```js\n * function f(x, y, z) {}\n * const args = [1, 2, 3];\n * f.apply(null, args);\n * ```\n *\n * With `spread` this example can be re-written.\n *\n * ```js\n * spread(function(x, y, z) {})([1, 2, 3]);\n * ```\n *\n * @param {Function} callback\n *\n * @returns {Function}\n */\nexport default function spread(callback) {\n return function wrap(arr) {\n return callback.apply(null, arr);\n };\n}\n","'use strict';\n\nimport utils from '../utils.js';\n\n/**\n * Determines whether the payload is an error thrown by Axios\n *\n * @param {*} payload The value to test\n *\n * @returns {boolean} True if the payload is an error thrown by Axios, otherwise false\n */\nexport default function isAxiosError(payload) {\n return utils.isObject(payload) && payload.isAxiosError === true;\n}\n","import axios from './lib/axios.js';\n\n// This module is intended to unwrap Axios default export as named.\n// Keep top-level export same with static properties\n// so that it can keep same with es module or cjs\nconst {\n Axios,\n AxiosError,\n CanceledError,\n isCancel,\n CancelToken,\n VERSION,\n all,\n Cancel,\n isAxiosError,\n spread,\n toFormData,\n AxiosHeaders,\n HttpStatusCode,\n formToJSON,\n getAdapter,\n mergeConfig,\n create,\n} = axios;\n\nexport {\n axios as default,\n create,\n Axios,\n AxiosError,\n CanceledError,\n isCancel,\n CancelToken,\n VERSION,\n all,\n Cancel,\n isAxiosError,\n spread,\n toFormData,\n AxiosHeaders,\n HttpStatusCode,\n formToJSON,\n getAdapter,\n mergeConfig,\n};\n"],"names":["bind","fn","thisArg","apply","arguments","toString","Object","prototype","getPrototypeOf","iterator","toStringTag","Symbol","hasOwnProperty","obj","prop","call","hasOwnInPrototypeChain","thing","seen","indexOf","push","kindOf","cache","create","str","slice","toLowerCase","kindOfTest","type","typeOfTest","isArray","Array","isUndefined","isBuffer","val","constructor","isFunction","isArrayBuffer","isString","isNumber","isObject","isPlainObject","isDate","isFile","isBlob","isFileList","isSet","G","globalThis","self","window","global","FormDataCtor","FormData","undefined","isURLSearchParams","isReadableStream","isRequest","isResponse","isHeaders","map","forEach","allOwnKeys","i","l","length","keys","getOwnPropertyNames","len","key","findKey","_key","_global","isContextDefined","context","isTypedArray","TypedArray","Uint8Array","isHTMLForm","propertyIsEnumerable","isRegExp","reduceDescriptors","reducer","descriptors","getOwnPropertyDescriptors","reducedDescriptors","descriptor","name","ret","defineProperties","isAsyncFn","_setImmediate","setImmediateSupported","setImmediate","postMessageSupported","postMessage","token","Math","random","callbacks","addEventListener","source","data","shift","cb","setTimeout","asap","queueMicrotask","process","nextTick","isIterable","utils$1","isFormData","proto","append","kind","isArrayBufferView","result","ArrayBuffer","isView","buffer","isBoolean","isEmptyObject","e","isReactNativeBlob","value","uri","isReactNative","formData","getParts","isStream","pipe","merge","objs","caseless","skipUndefined","this","assignValue","targetKey","existing","symbols","getOwnPropertySymbols","j","symbol","extend","a","b","defineProperty","__proto__","writable","enumerable","configurable","trim","replace","stripBOM","content","charCodeAt","inherits","superConstructor","props","assign","toFlatObject","sourceObj","destObj","filter","propFilter","merged","endsWith","searchString","position","String","lastIndex","toArray","arr","forEachEntry","_iterator","next","done","pair","matchAll","regExp","matches","exec","hasOwnProp","getSafeProp","freezeMethods","includes","set","Error","toObjectSet","arrayOrString","delimiter","define","split","toCamelCase","m","p1","p2","toUpperCase","noop","toFiniteNumber","defaultValue","Number","isFinite","isSpecCompliantForm","toJSONObject","visited","WeakSet","visit","has","target","add","reducedValue","delete","isThenable","then","catch","isSafeIterable","ignoreDuplicateOf","utils","INVALID_UNICODE_HEADER_VALUE_CHARS","RegExp","INVALID_BYTE_STRING_HEADER_VALUE_CHARS","sanitizeValue","invalidChars","item","start","end","code","trimSPorHTAB","toByteStringHeaderObject","headers","byteStringHeaders","toJSON","header","sanitizeByteStringHeaderValue","$internals","normalizeHeader","normalizeValue","sanitizeHeaderValue","parameterNameRE","trimOWS","matchHeaderValue","isHeaderNameFilter","test","AxiosHeaders$1","valueOrRewrite","rewrite","setHeader","_value","_header","_rewrite","lHeader","setHeaders","rawHeaders","parsed","line","substring","hasKey","parseHeaders","dest","entry","TypeError","get","parser","tokens","tokensRE","match","parseTokens","matcher","deleted","deleteHeader","clear","normalize","format","normalized","w","char","formatHeader","concat","targets","asStrings","join","entries","getSetCookie","from","parseParameters","parameters","quoted","escaped","parseParameter","part","equals","normalizedName","parameterValue","last","decoded","decodeQuotedString","first","computed","accessor","accessors","defineAccessor","accessorName","methodName","arg1","arg2","arg3","buildAccessors","AxiosHeaders","mapped","headerValue","REDACTED","redactConfig","config","redactKeys","lowerKeys","Set","k","v","hasOwnOrPrototypeToJSON","pop","stringifySafely","err","AxiosError","error","request","response","customProps","message","errors","Boolean","aggregateErrorMessage","axiosError","status","super","isAxiosError","redact","serializedConfig","description","number","fileName","lineNumber","columnNumber","stack","ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ECONNREFUSED","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL","ERR_FORM_DATA_DEPTH_EXCEEDED","isVisitable","removeBrackets","renderKey","path","dots","predicates","toFormData","options","metaTokens","indexes","option","visitor","defaultVisitor","_Blob","Blob","maxDepth","useBlob","convertValue","toISOString","throwIfMaxDepthExceeded","depth","Infinity","JSON","stringify","ancestors","currentValue","stringifyWithDepthLimit","some","isFlatArray","el","index","exposedHelpers","build","encode","charMap","encodeURIComponent","AxiosURLSearchParams","params","_pairs","buildURL","url","_options","serialize","_encode","serializeFn","serializedParams","hashmarkIndex","encoder","InterceptorManager","handlers","use","fulfilled","rejected","synchronous","runWhen","eject","id","h","transitionalDefaults","silentJSONParsing","forcedJSONParsing","clarifyTimeoutError","legacyInterceptorReqResOrdering","advertiseZstdAcceptEncoding","validateStatusUndefinedResolves","platform$1","isBrowser","classes","URLSearchParams","protocols","hasBrowserEnv","document","_navigator","navigator","hasStandardBrowserEnv","product","hasStandardBrowserWebWorkerEnv","WorkerGlobalScope","importScripts","origin","location","href","platform","throwIfDepthExceeded","formDataToJSON","buildPath","isNumericKey","isLast","arrayToObject","pattern","parsePropPath","own","defaults","transitional","adapter","transformRequest","contentType","getContentType","hasJSONContentType","isObjectPayload","setContentType","formSerializer","helpers","isNode","toURLEncodedForm","env","_FormData","rawValue","parse","transformResponse","responseType","JSONRequested","strictJSONParsing","timeout","xsrfCookieName","xsrfHeaderName","maxContentLength","maxBodyLength","validateStatus","common","Accept","transformData","fns","isCancel","__CANCEL__","method","settle","resolve","reject","progressEventReducer","listener","isDownloadStream","freq","bytesNotified","_speedometer","samplesCount","min","bytes","timestamps","firstSampleTS","head","tail","chunkLength","now","Date","startedAt","bytesCount","passed","round","speedometer","lastArgs","timer","timestamp","threshold","invoke","args","clearTimeout","throttle","loaded","rawLoaded","total","lengthComputable","max","progressBytes","rate","progress","estimated","event","progressEventDecorator","throttled","asyncDecorator","scheduler","isURLSameOrigin","isMSIE","URL","protocol","host","port","userAgent","cookies","write","expires","domain","secure","sameSite","cookie","toUTCString","read","eq","decodeURIComponent","remove","malformedHttpProtocol","httpProtocolControlCharacters","redactSensitiveURLParts","redactedURL","fragmentIndex","redactedURLWithoutFragment","fragment","separator","parameterName","assertValidHttpProtocolURL","normalizedURL","stripLeadingC0ControlOrSpace","normalizeURLForProtocolCheck","buildFullPath","baseURL","requestedURL","allowAbsoluteUrls","isRelativeUrl","relativeURL","combineURLs","headersToObject","mergeConfig","config1","config2","getMergedValue","mergeDeepProperties","valueFromConfig2","defaultToConfig2","mergeDirectKeys","mergeMap","paramsSerializer","timeoutMessage","withCredentials","withXSRFToken","onUploadProgress","onDownloadProgress","decompress","beforeRedirect","transport","httpAgent","httpsAgent","cancelToken","socketPath","allowedSocketPaths","responseEncoding","getOwnPropertyDescriptor","configValue","transitional2","transitional1","getMergedTransitionalOption","FORM_DATA_CONTENT_HEADERS","resolveConfig","newConfig","auth","username","password","btoa","_","hex","fromCharCode","parseInt","getHeaders","formHeaders","policy","setFormDataHeaders","xsrfValue","xhrAdapter","XMLHttpRequest","Promise","_config","requestData","requestHeaders","onCanceled","uploadThrottled","downloadThrottled","flushUpload","flushDownload","unsubscribe","signal","removeEventListener","onloadend","responseHeaders","getAllResponseHeaders","responseText","statusText","open","onreadystatechange","readyState","responseURL","startsWith","onabort","onerror","msg","ontimeout","timeoutErrorMessage","setRequestHeader","upload","cancel","CanceledError","abort","subscribe","aborted","parseProtocol","send","composeSignals","signals","controller","AbortController","reason","once","streamChunk","chunk","chunkSize","byteLength","pos","readStream","async","stream","asyncIterator","reader","getReader","trackStream","onProgress","onFinish","iterable","readBytes","_onFinish","ReadableStream","pull","close","loadedBytes","enqueue","return","highWaterMark","isHexDigit","charCode","isPercentEncodedByte","hexValue","isBase64Char","isBase64Whitespace","estimatePercentDecodedBase64Bytes","body","significant","padding","invalid","floor","estimateBase64BufferAllocation","remainder","base64Bytes","estimateDataURLDecodedBytes","estimateBase64","comma","meta","c","estimateDataURLBytes","VERSION","decodeURIComponentSafe","factory","globalObject","TextEncoder","Request","Response","fetch","envFetch","isFetchSupported","isRequestSupported","isResponseSupported","isReadableStreamSupported","encodeText","arrayBuffer","supportsRequestStream","duplexAccessed","duplex","hasContentType","supportsResponseStream","resolvers","res","getBodyLength","size","_request","fetchOptions","hasMaxContentLength","hasMaxBodyLength","_fetch","composedSignal","toAbortSignal","requestContentLength","pendingBodyError","maxBodyLengthError","configAuth","protocolIndex","urlToCheck","maybeWithAuthCredentials","parsedURL","urlUsername","outboundLength","mustEnforceStreamBody","trackRequestStream","flush","getContentLength","resolveBodyLength","contentTypeHeader","isCredentialsSupported","resolvedOptions","credentials","declaredLength","isStreamResponse","responseContentLength","bytesRead","onChunkProgress","responseData","materializedSize","canceledError","networkError","cause","seedCache","Map","getFetch","seeds","seed","knownAdapters","http","xhr","fetchAdapter.getFetch","renderReason","isResolvedHandle","adapters","getAdapter","nameOrAdapter","rejectedReasons","reasons","state","s","throwIfCancellationRequested","throwIfRequested","dispatchRequest","validators","deprecatedWarnings","validator","version","formatMessage","opt","desc","opts","console","warn","spelling","correctSpelling","assertOptions","schema","allowUnknown","Axios$1","instanceConfig","interceptors","configOrUrl","dummy","captureStackTrace","firstNewlineIndex","secondNewlineIndex","stackWithoutTwoTopLines","boolean","function","baseUrl","withXsrfToken","contextHeaders","requestInterceptorChain","synchronousRequestInterceptors","interceptor","unshift","responseInterceptorChain","promise","chain","onFulfilled","onRejected","rejectedResult","rejectedError","getUri","Axios","generateHTTPMethod","isForm","HttpStatusCode","Continue","SwitchingProtocols","Processing","EarlyHints","Ok","Created","Accepted","NonAuthoritativeInformation","NoContent","ResetContent","PartialContent","MultiStatus","AlreadyReported","ImUsed","MultipleChoices","MovedPermanently","Found","SeeOther","NotModified","UseProxy","Unused","TemporaryRedirect","PermanentRedirect","BadRequest","Unauthorized","PaymentRequired","Forbidden","NotFound","MethodNotAllowed","NotAcceptable","ProxyAuthenticationRequired","RequestTimeout","Conflict","Gone","LengthRequired","PreconditionFailed","PayloadTooLarge","UriTooLong","UnsupportedMediaType","RangeNotSatisfiable","ExpectationFailed","ImATeapot","MisdirectedRequest","UnprocessableEntity","Locked","FailedDependency","TooEarly","UpgradeRequired","PreconditionRequired","TooManyRequests","RequestHeaderFieldsTooLarge","UnavailableForLegalReasons","InternalServerError","NotImplemented","BadGateway","ServiceUnavailable","GatewayTimeout","HttpVersionNotSupported","VariantAlsoNegotiates","InsufficientStorage","LoopDetected","NotExtended","NetworkAuthenticationRequired","WebServerReturnsAnUnknownError","WebServerIsDown","ConnectionTimedOut","OriginIsUnreachable","TimeoutOccurred","SslHandshakeFailed","InvalidSslCertificate","axios","createInstance","defaultConfig","instance","CancelToken","executor","resolvePromise","_listeners","onfulfilled","_resolve","splice","Cancel","all","promises","spread","callback","payload","formToJSON","default"],"mappings":";AASe,SAASA,EAAKC,EAAIC,GAC/B,OAAO,WACL,OAAOD,EAAGE,MAAMD,EAASE,UAC3B,CACF,CCPA,MAAMC,SAAEA,GAAaC,OAAOC,WACtBC,eAAEA,GAAmBF,QACrBG,SAAEA,EAAQC,YAAEA,GAAgBC,OAG5BC,EAAiB,GAClBA,oBACH,CAACC,EAAKC,IACJF,EAAeG,KAAKF,EAAKC,GAHN,CAIrBR,OAAOC,WAcHS,EAAyB,CAACC,EAAOH,KACrC,IAAID,EAAMI,EACV,MAAMC,EAAO,GAEb,KAAc,MAAPL,GAAeA,IAAQP,OAAOC,WAAW,CAC9C,IAA0B,IAAtBW,EAAKC,QAAQN,GACf,OAAO,EAIT,GAFAK,EAAKE,KAAKP,GAEND,EAAeC,EAAKC,GACtB,OAAO,EAETD,EAAML,EAAeK,EACvB,CACA,OAAO,GAiBHQ,GAAWC,EAGdhB,OAAOiB,OAAO,MAHWN,IAC1B,MAAMO,EAAMnB,EAASU,KAAKE,GAC1B,OAAOK,EAAME,KAASF,EAAME,GAAOA,EAAIC,MAAM,MAAOC,iBAFvC,IAAEJ,EAKjB,MAAMK,EAAcC,IAClBA,EAAOA,EAAKF,cACJT,GAAUI,EAAOJ,KAAWW,GAGhCC,EAAcD,GAA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EAAStU,IACb6U,EAAWP,MAAMtU,IAOnB,OAJA3L,KAAKkgB,UAAUD,GAEfO,EAAW5B,OAAOD,YAAc,IAAM3e,KAAK2e,YAAYsB,GAEhDO,EAAW5B,MACpB,CAMA,aAAO/gB,GACL,IAAIkiB,EAIJ,MAAO,CACLviB,MAJY,IAAIyyB,EAAY,SAAkB1M,GAC9CxD,EAASwD,CACX,GAGExD,SAEJ,GD7EF8P,GAAMna,SAAWA,GACjBma,GAAMpM,QAAUA,GAChBoM,GAAMxhB,WAAaA,GAGnBwhB,GAAMjkB,WAAaA,GAGnBikB,GAAMW,OAASX,GAAM7P,cAGrB6P,GAAMY,IAAM,SAAaC,GACvB,OAAOxS,QAAQuS,IAAIC,EACrB,EAEAb,GAAMc,OE9CS,SAAgBC,GAC7B,OAAO,SAAcvuB,GACnB,OAAOuuB,EAASj5B,MAAM,KAAM0K,EAC9B,CACF,EF6CAwtB,GAAMrjB,aG7DS,SAAsBqkB,GACnC,OAAO1rB,EAAMnL,SAAS62B,KAAqC,IAAzBA,EAAQrkB,YAC5C,EH8DAqjB,GAAM1U,YAAcA,GAEpB0U,GAAMhlB,aAAeA,GAErBglB,GAAMiB,WAAcr4B,GAAU0a,GAAehO,EAAM7I,WAAW7D,GAAS,IAAIoC,SAASpC,GAASA,GAE7Fo3B,GAAM5H,WAAaD,GAASC,WAE5B4H,GAAMvE,eAAiBA,GAEvBuE,GAAMkB,QAAUlB,GIhFX,MAAC1E,MACJA,GAAKvf,WACLA,GAAUoU,cACVA,GAAatK,SACbA,GAAQua,YACRA,GAAWxM,QACXA,GAAOgN,IACPA,GAAGD,OACHA,GAAMhkB,aACNA,GAAYmkB,OACZA,GAAMtiB,WACNA,GAAUxD,aACVA,GAAYygB,eACZA,GAAcwF,WACdA,GAAU7I,WACVA,GAAU9M,YACVA,GAAWpiB,OACXA,IACE82B"} \ No newline at end of file diff --git a/server/node_modules/axios/dist/node/axios.cjs b/server/node_modules/axios/dist/node/axios.cjs deleted file mode 100644 index 687cb17..0000000 --- a/server/node_modules/axios/dist/node/axios.cjs +++ /dev/null @@ -1,6356 +0,0 @@ -/*! Axios v1.19.0 Copyright (c) 2026 Matt Zabriskie and contributors */ -'use strict'; - -var FormData$1 = require('form-data'); -var crypto = require('crypto'); -var url = require('url'); -var HttpsProxyAgent = require('https-proxy-agent'); -var http = require('http'); -var https = require('https'); -var http2 = require('http2'); -var util = require('util'); -var path = require('path'); -var followRedirects = require('follow-redirects'); -var zlib = require('zlib'); -var stream = require('stream'); -var events = require('events'); - -/** - * Create a bound version of a function with a specified `this` context - * - * @param {Function} fn - The function to bind - * @param {*} thisArg - The value to be passed as the `this` parameter - * @returns {Function} A new function that will call the original function with the specified `this` context - */ -function bind(fn, thisArg) { - return function wrap() { - return fn.apply(thisArg, arguments); - }; -} - -// utils is a library of generic helper functions non-specific to axios - -const { - toString -} = Object.prototype; -const { - getPrototypeOf -} = Object; -const { - iterator, - toStringTag -} = Symbol; - -/* Creating a function that will check if an object has a property. */ -const hasOwnProperty = (({ - hasOwnProperty -}) => (obj, prop) => hasOwnProperty.call(obj, prop))(Object.prototype); - -/** - * Walk the prototype chain (excluding the shared Object.prototype) looking for - * an own `prop`. This distinguishes genuine own/inherited members — including - * class accessors and template prototypes — from members injected via - * Object.prototype pollution (e.g. `Object.prototype.username = '...'`), which - * live on Object.prototype itself and are therefore never matched. - * - * @param {*} thing The value whose chain to inspect - * @param {string|symbol} prop The property key to look for - * - * @returns {boolean} True when `prop` is owned below Object.prototype - */ -const hasOwnInPrototypeChain = (thing, prop) => { - let obj = thing; - const seen = []; - while (obj != null && obj !== Object.prototype) { - if (seen.indexOf(obj) !== -1) { - return false; - } - seen.push(obj); - if (hasOwnProperty(obj, prop)) { - return true; - } - obj = getPrototypeOf(obj); - } - return false; -}; - -/** - * Read `obj[prop]` only when it is safe from Object.prototype pollution. Own - * properties and members inherited from a non-Object.prototype source (a class - * instance or template object) are honored; a value reachable only through a - * polluted Object.prototype is ignored and `undefined` is returned. - * - * @param {*} obj The source object - * @param {string|symbol} prop The property key to read - * - * @returns {*} The resolved value, or undefined when unsafe/absent - */ -const getSafeProp = (obj, prop) => obj != null && hasOwnInPrototypeChain(obj, prop) ? obj[prop] : undefined; -const kindOf = (cache => thing => { - const str = toString.call(thing); - return cache[str] || (cache[str] = str.slice(8, -1).toLowerCase()); -})(Object.create(null)); -const kindOfTest = type => { - type = type.toLowerCase(); - return thing => kindOf(thing) === type; -}; -const typeOfTest = type => thing => typeof thing === type; - -/** - * Determine if a value is a non-null object - * - * @param {Object} val The value to test - * - * @returns {boolean} True if value is an Array, otherwise false - */ -const { - isArray -} = Array; - -/** - * Determine if a value is undefined - * - * @param {*} val The value to test - * - * @returns {boolean} True if the value is undefined, otherwise false - */ -const isUndefined = typeOfTest('undefined'); - -/** - * Determine if a value is a Buffer - * - * @param {*} val The value to test - * - * @returns {boolean} True if value is a Buffer, otherwise false - */ -function isBuffer(val) { - return val !== null && !isUndefined(val) && val.constructor !== null && !isUndefined(val.constructor) && isFunction$1(val.constructor.isBuffer) && val.constructor.isBuffer(val); -} - -/** - * Determine if a value is an ArrayBuffer - * - * @param {*} val The value to test - * - * @returns {boolean} True if value is an ArrayBuffer, otherwise false - */ -const isArrayBuffer = kindOfTest('ArrayBuffer'); - -/** - * Determine if a value is a view on an ArrayBuffer - * - * @param {*} val The value to test - * - * @returns {boolean} True if value is a view on an ArrayBuffer, otherwise false - */ -function isArrayBufferView(val) { - let result; - if (typeof ArrayBuffer !== 'undefined' && ArrayBuffer.isView) { - result = ArrayBuffer.isView(val); - } else { - result = val && val.buffer && isArrayBuffer(val.buffer); - } - return result; -} - -/** - * Determine if a value is a String - * - * @param {*} val The value to test - * - * @returns {boolean} True if value is a String, otherwise false - */ -const isString = typeOfTest('string'); - -/** - * Determine if a value is a Function - * - * @param {*} val The value to test - * @returns {boolean} True if value is a Function, otherwise false - */ -const isFunction$1 = typeOfTest('function'); - -/** - * Determine if a value is a Number - * - * @param {*} val The value to test - * - * @returns {boolean} True if value is a Number, otherwise false - */ -const isNumber = typeOfTest('number'); - -/** - * Determine if a value is an Object - * - * @param {*} thing The value to test - * - * @returns {boolean} True if value is an Object, otherwise false - */ -const isObject = thing => thing !== null && typeof thing === 'object'; - -/** - * Determine if a value is a Boolean - * - * @param {*} thing The value to test - * @returns {boolean} True if value is a Boolean, otherwise false - */ -const isBoolean = thing => thing === true || thing === false; - -/** - * Determine if a value is a plain Object - * - * @param {*} val The value to test - * - * @returns {boolean} True if value is a plain Object, otherwise false - */ -const isPlainObject = val => { - if (!isObject(val)) { - return false; - } - const prototype = getPrototypeOf(val); - return (prototype === null || prototype === Object.prototype || getPrototypeOf(prototype) === null) && - // Treat any genuine (non-Object.prototype-polluted) Symbol.toStringTag or - // Symbol.iterator as evidence the value is a tagged/iterable type rather - // than a plain object, while ignoring keys injected onto Object.prototype. - !hasOwnInPrototypeChain(val, toStringTag) && !hasOwnInPrototypeChain(val, iterator); -}; - -/** - * Determine if a value is an empty object (safely handles Buffers) - * - * @param {*} val The value to test - * - * @returns {boolean} True if value is an empty object, otherwise false - */ -const isEmptyObject = val => { - // Early return for non-objects or Buffers to prevent RangeError - if (!isObject(val) || isBuffer(val)) { - return false; - } - try { - return Object.keys(val).length === 0 && Object.getPrototypeOf(val) === Object.prototype; - } catch (e) { - // Fallback for any other objects that might cause RangeError with Object.keys() - return false; - } -}; - -/** - * Determine if a value is a Date - * - * @param {*} val The value to test - * - * @returns {boolean} True if value is a Date, otherwise false - */ -const isDate = kindOfTest('Date'); - -/** - * Determine if a value is a File - * - * @param {*} val The value to test - * - * @returns {boolean} True if value is a File, otherwise false - */ -const isFile = kindOfTest('File'); - -/** - * Determine if a value is a React Native Blob - * React Native "blob": an object with a `uri` attribute. Optionally, it can - * also have a `name` and `type` attribute to specify filename and content type - * - * @see https://github.com/facebook/react-native/blob/26684cf3adf4094eb6c405d345a75bf8c7c0bf88/Libraries/Network/FormData.js#L68-L71 - * - * @param {*} value The value to test - * - * @returns {boolean} True if value is a React Native Blob, otherwise false - */ -const isReactNativeBlob = value => { - return !!(value && typeof value.uri !== 'undefined'); -}; - -/** - * Determine if environment is React Native - * ReactNative `FormData` has a non-standard `getParts()` method - * - * @param {*} formData The formData to test - * - * @returns {boolean} True if environment is React Native, otherwise false - */ -const isReactNative = formData => formData && typeof formData.getParts !== 'undefined'; - -/** - * Determine if a value is a Blob - * - * @param {*} val The value to test - * - * @returns {boolean} True if value is a Blob, otherwise false - */ -const isBlob = kindOfTest('Blob'); - -/** - * Determine if a value is a FileList - * - * @param {*} val The value to test - * - * @returns {boolean} True if value is a FileList, otherwise false - */ -const isFileList = kindOfTest('FileList'); -const isSet = kindOfTest('Set'); - -/** - * Determine if a value is a Stream - * - * @param {*} val The value to test - * - * @returns {boolean} True if value is a Stream, otherwise false - */ -const isStream = val => isObject(val) && isFunction$1(val.pipe); - -/** - * Determine if a value is a FormData - * - * @param {*} thing The value to test - * - * @returns {boolean} True if value is an FormData, otherwise false - */ -function getGlobal() { - if (typeof globalThis !== 'undefined') return globalThis; - if (typeof self !== 'undefined') return self; - if (typeof window !== 'undefined') return window; - if (typeof global !== 'undefined') return global; - return {}; -} -const G = getGlobal(); -const FormDataCtor = typeof G.FormData !== 'undefined' ? G.FormData : undefined; -const isFormData = thing => { - if (!thing) return false; - if (FormDataCtor && thing instanceof FormDataCtor) return true; - // Reject plain objects inheriting directly from Object.prototype so prototype-pollution gadgets can't spoof FormData. - const proto = getPrototypeOf(thing); - if (!proto || proto === Object.prototype) return false; - if (!isFunction$1(thing.append)) return false; - const kind = kindOf(thing); - return kind === 'formdata' || - // detect form-data instance - kind === 'object' && isFunction$1(thing.toString) && thing.toString() === '[object FormData]'; -}; - -/** - * Determine if a value is a URLSearchParams object - * - * @param {*} val The value to test - * - * @returns {boolean} True if value is a URLSearchParams object, otherwise false - */ -const isURLSearchParams = kindOfTest('URLSearchParams'); -const [isReadableStream, isRequest, isResponse, isHeaders] = ['ReadableStream', 'Request', 'Response', 'Headers'].map(kindOfTest); - -/** - * Trim excess whitespace off the beginning and end of a string - * - * @param {String} str The String to trim - * - * @returns {String} The String freed of excess whitespace - */ -const trim = str => { - return str.trim ? str.trim() : str.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, ''); -}; -/** - * Iterate over an Array or an Object invoking a function for each item. - * - * If `obj` is an Array callback will be called passing - * the value, index, and complete array for each item. - * - * If 'obj' is an Object callback will be called passing - * the value, key, and complete object for each property. - * - * @param {Object|Array} obj The object to iterate - * @param {Function} fn The callback to invoke for each item - * - * @param {Object} [options] - * @param {Boolean} [options.allOwnKeys = false] - * @returns {any} - */ -function forEach(obj, fn, { - allOwnKeys = false -} = {}) { - // Don't bother if no value provided - if (obj === null || typeof obj === 'undefined') { - return; - } - let i; - let l; - - // Force an array if not already something iterable - if (typeof obj !== 'object') { - /*eslint no-param-reassign:0*/ - obj = [obj]; - } - if (isArray(obj)) { - // Iterate over array values - for (i = 0, l = obj.length; i < l; i++) { - fn.call(null, obj[i], i, obj); - } - } else { - // Buffer check - if (isBuffer(obj)) { - return; - } - - // Iterate over object keys - const keys = allOwnKeys ? Object.getOwnPropertyNames(obj) : Object.keys(obj); - const len = keys.length; - let key; - for (i = 0; i < len; i++) { - key = keys[i]; - fn.call(null, obj[key], key, obj); - } - } -} - -/** - * Finds a key in an object, case-insensitive, returning the actual key name. - * Returns null if the object is a Buffer or if no match is found. - * - * @param {Object} obj - The object to search. - * @param {string} key - The key to find (case-insensitive). - * @returns {?string} The actual key name if found, otherwise null. - */ -function findKey(obj, key) { - if (isBuffer(obj)) { - return null; - } - key = key.toLowerCase(); - const keys = Object.keys(obj); - let i = keys.length; - let _key; - while (i-- > 0) { - _key = keys[i]; - if (key === _key.toLowerCase()) { - return _key; - } - } - return null; -} -const _global = (() => { - /*eslint no-undef:0*/ - if (typeof globalThis !== 'undefined') return globalThis; - return typeof self !== 'undefined' ? self : typeof window !== 'undefined' ? window : global; -})(); -const isContextDefined = context => !isUndefined(context) && context !== _global; - -/** - * Accepts varargs expecting each argument to be an object, then - * immutably merges the properties of each object and returns result. - * - * When multiple objects contain the same key the later object in - * the arguments list will take precedence. - * - * Example: - * - * ```js - * const result = merge({foo: 123}, {foo: 456}); - * console.log(result.foo); // outputs 456 - * ``` - * - * @param {Object} obj1 Object to merge - * - * @returns {Object} Result of all merge properties - */ -function merge(...objs) { - const { - caseless, - skipUndefined - } = isContextDefined(this) && this || {}; - const result = {}; - const assignValue = (val, key) => { - // Skip dangerous property names to prevent prototype pollution - if (key === '__proto__' || key === 'constructor' || key === 'prototype') { - return; - } - - // findKey lowercases the key, so caseless lookup only applies to strings — - // symbol keys are identity-matched. - const targetKey = caseless && typeof key === 'string' && findKey(result, key) || key; - // Read via own-prop only — a bare `result[targetKey]` walks the prototype - // chain, so a polluted Object.prototype value could surface here and get - // copied into the merged result. - const existing = hasOwnProperty(result, targetKey) ? result[targetKey] : undefined; - if (isPlainObject(existing) && isPlainObject(val)) { - result[targetKey] = merge(existing, val); - } else if (isPlainObject(val)) { - result[targetKey] = merge({}, val); - } else if (isArray(val)) { - result[targetKey] = val.slice(); - } else if (!skipUndefined || !isUndefined(val)) { - result[targetKey] = val; - } - }; - for (let i = 0, l = objs.length; i < l; i++) { - const source = objs[i]; - if (!source || isBuffer(source)) { - continue; - } - forEach(source, assignValue); - if (typeof source !== 'object' || isArray(source)) { - continue; - } - const symbols = Object.getOwnPropertySymbols(source); - for (let j = 0; j < symbols.length; j++) { - const symbol = symbols[j]; - if (propertyIsEnumerable.call(source, symbol)) { - assignValue(source[symbol], symbol); - } - } - } - return result; -} - -/** - * Extends object a by mutably adding to it the properties of object b. - * - * @param {Object} a The object to be extended - * @param {Object} b The object to copy properties from - * @param {Object} thisArg The object to bind function to - * - * @param {Object} [options] - * @param {Boolean} [options.allOwnKeys] - * @returns {Object} The resulting value of object a - */ -const extend = (a, b, thisArg, { - allOwnKeys -} = {}) => { - forEach(b, (val, key) => { - if (thisArg && isFunction$1(val)) { - Object.defineProperty(a, key, { - // Null-proto descriptor so a polluted Object.prototype.get cannot - // hijack defineProperty's accessor-vs-data resolution. - __proto__: null, - value: bind(val, thisArg), - writable: true, - enumerable: true, - configurable: true - }); - } else { - Object.defineProperty(a, key, { - __proto__: null, - value: val, - writable: true, - enumerable: true, - configurable: true - }); - } - }, { - allOwnKeys - }); - return a; -}; - -/** - * Remove byte order marker. This catches EF BB BF (the UTF-8 BOM) - * - * @param {string} content with BOM - * - * @returns {string} content value without BOM - */ -const stripBOM = content => { - if (content.charCodeAt(0) === 0xfeff) { - content = content.slice(1); - } - return content; -}; - -/** - * Inherit the prototype methods from one constructor into another - * @param {function} constructor - * @param {function} superConstructor - * @param {object} [props] - * @param {object} [descriptors] - * - * @returns {void} - */ -const inherits = (constructor, superConstructor, props, descriptors) => { - constructor.prototype = Object.create(superConstructor.prototype, descriptors); - Object.defineProperty(constructor.prototype, 'constructor', { - __proto__: null, - value: constructor, - writable: true, - enumerable: false, - configurable: true - }); - Object.defineProperty(constructor, 'super', { - __proto__: null, - value: superConstructor.prototype - }); - props && Object.assign(constructor.prototype, props); -}; - -/** - * Resolve object with deep prototype chain to a flat object - * @param {Object} sourceObj source object - * @param {Object} [destObj] - * @param {Function|Boolean} [filter] - * @param {Function} [propFilter] - * - * @returns {Object} - */ -const toFlatObject = (sourceObj, destObj, filter, propFilter) => { - let props; - let i; - let prop; - const merged = {}; - destObj = destObj || {}; - // eslint-disable-next-line no-eq-null,eqeqeq - if (sourceObj == null) return destObj; - do { - props = Object.getOwnPropertyNames(sourceObj); - i = props.length; - while (i-- > 0) { - prop = props[i]; - if ((!propFilter || propFilter(prop, sourceObj, destObj)) && !merged[prop]) { - destObj[prop] = sourceObj[prop]; - merged[prop] = true; - } - } - sourceObj = filter !== false && getPrototypeOf(sourceObj); - } while (sourceObj && (!filter || filter(sourceObj, destObj)) && sourceObj !== Object.prototype); - return destObj; -}; - -/** - * Determines whether a string ends with the characters of a specified string - * - * @param {String} str - * @param {String} searchString - * @param {Number} [position= 0] - * - * @returns {boolean} - */ -const endsWith = (str, searchString, position) => { - str = String(str); - if (position === undefined || position > str.length) { - position = str.length; - } - position -= searchString.length; - const lastIndex = str.indexOf(searchString, position); - return lastIndex !== -1 && lastIndex === position; -}; - -/** - * Returns new array from array like object or null if failed - * - * @param {*} [thing] - * - * @returns {?Array} - */ -const toArray = thing => { - if (!thing) return null; - if (isArray(thing)) return thing; - let i = thing.length; - if (!isNumber(i)) return null; - const arr = new Array(i); - while (i-- > 0) { - arr[i] = thing[i]; - } - return arr; -}; - -/** - * Checking if the Uint8Array exists and if it does, it returns a function that checks if the - * thing passed in is an instance of Uint8Array - * - * @param {TypedArray} - * - * @returns {Array} - */ -// eslint-disable-next-line func-names -const isTypedArray = (TypedArray => { - // eslint-disable-next-line func-names - return thing => { - return TypedArray && thing instanceof TypedArray; - }; -})(typeof Uint8Array !== 'undefined' && getPrototypeOf(Uint8Array)); - -/** - * For each entry in the object, call the function with the key and value. - * - * @param {Object} obj - The object to iterate over. - * @param {Function} fn - The function to call for each entry. - * - * @returns {void} - */ -const forEachEntry = (obj, fn) => { - const generator = obj && obj[iterator]; - const _iterator = generator.call(obj); - let result; - while ((result = _iterator.next()) && !result.done) { - const pair = result.value; - fn.call(obj, pair[0], pair[1]); - } -}; - -/** - * It takes a regular expression and a string, and returns an array of all the matches - * - * @param {string} regExp - The regular expression to match against. - * @param {string} str - The string to search. - * - * @returns {Array} - */ -const matchAll = (regExp, str) => { - let matches; - const arr = []; - while ((matches = regExp.exec(str)) !== null) { - arr.push(matches); - } - return arr; -}; - -/* Checking if the kindOfTest function returns true when passed an HTMLFormElement. */ -const isHTMLForm = kindOfTest('HTMLFormElement'); -const toCamelCase = str => { - return str.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g, function replacer(m, p1, p2) { - return p1.toUpperCase() + p2; - }); -}; -const { - propertyIsEnumerable -} = Object.prototype; - -/** - * Determine if a value is a RegExp object - * - * @param {*} val The value to test - * - * @returns {boolean} True if value is a RegExp object, otherwise false - */ -const isRegExp = kindOfTest('RegExp'); -const reduceDescriptors = (obj, reducer) => { - const descriptors = Object.getOwnPropertyDescriptors(obj); - const reducedDescriptors = {}; - forEach(descriptors, (descriptor, name) => { - let ret; - if ((ret = reducer(descriptor, name, obj)) !== false) { - reducedDescriptors[name] = ret || descriptor; - } - }); - Object.defineProperties(obj, reducedDescriptors); -}; - -/** - * Makes all methods read-only - * @param {Object} obj - */ - -const freezeMethods = obj => { - reduceDescriptors(obj, (descriptor, name) => { - // skip restricted props in strict mode - if (isFunction$1(obj) && ['arguments', 'caller', 'callee'].includes(name)) { - return false; - } - const value = obj[name]; - if (!isFunction$1(value)) return; - descriptor.enumerable = false; - if ('writable' in descriptor) { - descriptor.writable = false; - return; - } - if (!descriptor.set) { - descriptor.set = () => { - throw Error("Can not rewrite read-only method '" + name + "'"); - }; - } - }); -}; - -/** - * Converts an array or a delimited string into an object set with values as keys and true as values. - * Useful for fast membership checks. - * - * @param {Array|string} arrayOrString - The array or string to convert. - * @param {string} delimiter - The delimiter to use if input is a string. - * @returns {Object} An object with keys from the array or string, values set to true. - */ -const toObjectSet = (arrayOrString, delimiter) => { - const obj = {}; - const define = arr => { - arr.forEach(value => { - obj[value] = true; - }); - }; - isArray(arrayOrString) ? define(arrayOrString) : define(String(arrayOrString).split(delimiter)); - return obj; -}; -const noop = () => {}; -const toFiniteNumber = (value, defaultValue) => { - return value != null && Number.isFinite(value = +value) ? value : defaultValue; -}; - -/** - * If the thing is a FormData object, return true, otherwise return false. - * - * @param {unknown} thing - The thing to check. - * - * @returns {boolean} - */ -function isSpecCompliantForm(thing) { - return !!(thing && isFunction$1(thing.append) && thing[toStringTag] === 'FormData' && thing[iterator]); -} - -/** - * Recursively converts an object to a JSON-compatible object, handling circular references and Buffers. - * - * @param {Object} obj - The object to convert. - * @returns {Object} The JSON-compatible object. - */ -const toJSONObject = obj => { - const visited = new WeakSet(); - const visit = source => { - if (isObject(source)) { - if (visited.has(source)) { - return; - } - - //Buffer check - if (isBuffer(source)) { - return source; - } - if (!('toJSON' in source)) { - // add-on descent / delete-on-ascent: preserves path semantics, so DAG nodes serialise at every occurrence (see #7230). - visited.add(source); - let target; - if (isSet(source)) { - target = []; - for (const value of source) { - const reducedValue = visit(value); - !isUndefined(reducedValue) && target.push(reducedValue); - } - } else { - target = isArray(source) ? [] : {}; - forEach(source, (value, key) => { - const reducedValue = visit(value); - !isUndefined(reducedValue) && (target[key] = reducedValue); - }); - } - visited.delete(source); - return target; - } - } - return source; - }; - return visit(obj); -}; - -/** - * Determines if a value is an async function. - * - * @param {*} thing - The value to test. - * @returns {boolean} True if value is an async function, otherwise false. - */ -const isAsyncFn = kindOfTest('AsyncFunction'); - -/** - * Determines if a value is thenable (has then and catch methods). - * - * @param {*} thing - The value to test. - * @returns {boolean} True if value is thenable, otherwise false. - */ -const isThenable = thing => thing && (isObject(thing) || isFunction$1(thing)) && isFunction$1(thing.then) && isFunction$1(thing.catch); - -// original code -// https://github.com/DigitalBrainJS/AxiosPromise/blob/16deab13710ec09779922131f3fa5954320f83ab/lib/utils.js#L11-L34 - -/** - * Provides a cross-platform setImmediate implementation. - * Uses native setImmediate if available, otherwise falls back to postMessage or setTimeout. - * - * @param {boolean} setImmediateSupported - Whether setImmediate is supported. - * @param {boolean} postMessageSupported - Whether postMessage is supported. - * @returns {Function} A function to schedule a callback asynchronously. - */ -const _setImmediate = ((setImmediateSupported, postMessageSupported) => { - if (setImmediateSupported) { - return setImmediate; - } - return postMessageSupported ? ((token, callbacks) => { - _global.addEventListener('message', ({ - source, - data - }) => { - if (source === _global && data === token) { - callbacks.length && callbacks.shift()(); - } - }, false); - return cb => { - callbacks.push(cb); - _global.postMessage(token, '*'); - }; - })(`axios@${Math.random()}`, []) : cb => setTimeout(cb); -})(typeof setImmediate === 'function', isFunction$1(_global.postMessage)); - -/** - * Schedules a microtask or asynchronous callback as soon as possible. - * Uses queueMicrotask if available, otherwise falls back to process.nextTick or _setImmediate. - * - * @type {Function} - */ -const asap = typeof queueMicrotask !== 'undefined' ? queueMicrotask.bind(_global) : typeof process !== 'undefined' && process.nextTick || _setImmediate; - -// ********************* - -const isIterable = thing => thing != null && isFunction$1(thing[iterator]); - -/** - * Determine if a value is iterable via an iterator that is NOT sourced solely - * from a polluted Object.prototype. Use this instead of `isIterable` whenever - * the iterable comes from untrusted input (e.g. user-supplied header sources), - * so `Object.prototype[Symbol.iterator] = ...` cannot turn an ordinary object - * into an attacker-controlled entries iterator. - * - * @param {*} thing The value to test - * - * @returns {boolean} True if value has a non-polluted iterator - */ -const isSafeIterable = thing => thing != null && hasOwnInPrototypeChain(thing, iterator) && isIterable(thing); -var utils$1 = { - isArray, - isArrayBuffer, - isBuffer, - isFormData, - isArrayBufferView, - isString, - isNumber, - isBoolean, - isObject, - isPlainObject, - isEmptyObject, - isReadableStream, - isRequest, - isResponse, - isHeaders, - isUndefined, - isDate, - isFile, - isReactNativeBlob, - isReactNative, - isBlob, - isRegExp, - isFunction: isFunction$1, - isStream, - isURLSearchParams, - isTypedArray, - isFileList, - forEach, - merge, - extend, - trim, - stripBOM, - inherits, - toFlatObject, - kindOf, - kindOfTest, - endsWith, - toArray, - forEachEntry, - matchAll, - isHTMLForm, - hasOwnProperty, - hasOwnProp: hasOwnProperty, - // an alias to avoid ESLint no-prototype-builtins detection - hasOwnInPrototypeChain, - getSafeProp, - reduceDescriptors, - freezeMethods, - toObjectSet, - toCamelCase, - noop, - toFiniteNumber, - findKey, - global: _global, - isContextDefined, - isSpecCompliantForm, - toJSONObject, - isAsyncFn, - isThenable, - setImmediate: _setImmediate, - asap, - isIterable, - isSafeIterable -}; - -// RawAxiosHeaders whose duplicates are ignored by node -// c.f. https://nodejs.org/api/http.html#http_message_headers -const ignoreDuplicateOf = utils$1.toObjectSet(['age', 'authorization', 'content-length', 'content-type', 'etag', 'expires', 'from', 'host', 'if-modified-since', 'if-unmodified-since', 'last-modified', 'location', 'max-forwards', 'proxy-authorization', 'referer', 'retry-after', 'user-agent']); - -/** - * Parse headers into an object - * - * ``` - * Date: Wed, 27 Aug 2014 08:58:49 GMT - * Content-Type: application/json - * Connection: keep-alive - * Transfer-Encoding: chunked - * ``` - * - * @param {String} rawHeaders Headers needing to be parsed - * - * @returns {Object} Headers parsed into an object - */ -var parseHeaders = rawHeaders => { - const parsed = {}; - let key; - let val; - let i; - rawHeaders && rawHeaders.split('\n').forEach(function parser(line) { - i = line.indexOf(':'); - key = line.substring(0, i).trim().toLowerCase(); - val = line.substring(i + 1).trim(); - const hasKey = utils$1.hasOwnProp(parsed, key); - if (!key || hasKey && utils$1.hasOwnProp(ignoreDuplicateOf, key)) { - return; - } - if (key === 'set-cookie') { - if (hasKey) { - parsed[key].push(val); - } else { - parsed[key] = [val]; - } - } else { - parsed[key] = hasKey ? parsed[key] + ', ' + val : val; - } - }); - return parsed; -}; - -function trimSPorHTAB(str) { - let start = 0; - let end = str.length; - while (start < end) { - const code = str.charCodeAt(start); - if (code !== 0x09 && code !== 0x20) { - break; - } - start += 1; - } - while (end > start) { - const code = str.charCodeAt(end - 1); - if (code !== 0x09 && code !== 0x20) { - break; - } - end -= 1; - } - return start === 0 && end === str.length ? str : str.slice(start, end); -} - -// The control-code ranges are intentional: header sanitization strips C0/DEL bytes. -// eslint-disable-next-line no-control-regex -const INVALID_UNICODE_HEADER_VALUE_CHARS = new RegExp('[\\u0000-\\u0008\\u000a-\\u001f\\u007f]+', 'g'); -// eslint-disable-next-line no-control-regex -const INVALID_BYTE_STRING_HEADER_VALUE_CHARS = new RegExp('[^\\u0009\\u0020-\\u007e\\u0080-\\u00ff]+', 'g'); -function sanitizeValue(value, invalidChars) { - if (utils$1.isArray(value)) { - return value.map(item => sanitizeValue(item, invalidChars)); - } - return trimSPorHTAB(String(value).replace(invalidChars, '')); -} -const sanitizeHeaderValue = value => sanitizeValue(value, INVALID_UNICODE_HEADER_VALUE_CHARS); -const sanitizeByteStringHeaderValue = value => sanitizeValue(value, INVALID_BYTE_STRING_HEADER_VALUE_CHARS); -function toByteStringHeaderObject(headers) { - const byteStringHeaders = Object.create(null); - utils$1.forEach(headers.toJSON(), (value, header) => { - byteStringHeaders[header] = sanitizeByteStringHeaderValue(value); - }); - return byteStringHeaders; -} - -const $internals = Symbol('internals'); -function normalizeHeader(header) { - return header && String(header).trim().toLowerCase(); -} -function normalizeValue(value) { - if (value === false || value == null) { - return value; - } - return utils$1.isArray(value) ? value.map(normalizeValue) : sanitizeHeaderValue(String(value)); -} -function parseTokens(str) { - const tokens = Object.create(null); - const tokensRE = /([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g; - let match; - while (match = tokensRE.exec(str)) { - tokens[match[1]] = match[2]; - } - return tokens; -} -const parameterNameRE = /^[!#$%&'*+\-.^_`|~0-9A-Za-z]+$/; -function trimOWS(value) { - let start = 0; - let end = value.length; - while (start < end) { - const code = value.charCodeAt(start); - if (code !== 0x09 && code !== 0x20) { - break; - } - start += 1; - } - while (end > start) { - const code = value.charCodeAt(end - 1); - if (code !== 0x09 && code !== 0x20) { - break; - } - end -= 1; - } - return start === 0 && end === value.length ? value : value.slice(start, end); -} -function decodeQuotedString(value) { - const last = value.length - 1; - if (last < 1 || value.charCodeAt(0) !== 0x22 || value.charCodeAt(last) !== 0x22) { - return value; - } - let decoded = ''; - for (let i = 1; i < last; i++) { - const code = value.charCodeAt(i); - if (code === 0x22) { - return value; - } - if (code === 0x5c) { - i += 1; - if (i >= last) { - return value; - } - } - decoded += value[i]; - } - return decoded; -} -function parseParameters(value) { - const parameters = Object.create(null); - const str = String(value); - let start = 0; - let quoted = false; - let escaped = false; - function parseParameter(end) { - const part = trimOWS(str.slice(start, end)); - const equals = part.indexOf('='); - if (equals < 1) { - return; - } - const name = trimOWS(part.slice(0, equals)); - if (!parameterNameRE.test(name)) { - return; - } - const normalizedName = name.toLowerCase(); - if (normalizedName === '__proto__' || normalizedName === 'constructor' || normalizedName === 'prototype') { - return; - } - const parameterValue = trimOWS(part.slice(equals + 1)); - parameters[normalizedName] = decodeQuotedString(parameterValue); - } - for (let i = 0; i < str.length; i++) { - const code = str.charCodeAt(i); - if (quoted) { - if (escaped) { - escaped = false; - } else if (code === 0x5c) { - escaped = true; - } else if (code === 0x22) { - quoted = false; - } - } else if (code === 0x22) { - quoted = true; - } else if (code === 0x2c || code === 0x3b) { - parseParameter(i); - start = i + 1; - } - } - parseParameter(str.length); - return parameters; -} -const isValidHeaderName = str => /^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(str.trim()); -function matchHeaderValue(context, value, header, filter, isHeaderNameFilter) { - if (utils$1.isFunction(filter)) { - return filter.call(this, value, header); - } - if (isHeaderNameFilter) { - value = header; - } - if (!utils$1.isString(value)) return; - if (utils$1.isString(filter)) { - return value.indexOf(filter) !== -1; - } - if (utils$1.isRegExp(filter)) { - return filter.test(value); - } -} -function formatHeader(header) { - return header.trim().toLowerCase().replace(/([a-z\d])(\w*)/g, (w, char, str) => { - return char.toUpperCase() + str; - }); -} -function buildAccessors(obj, header) { - const accessorName = utils$1.toCamelCase(' ' + header); - ['get', 'set', 'has'].forEach(methodName => { - Object.defineProperty(obj, methodName + accessorName, { - // Null-proto descriptor so a polluted Object.prototype.get cannot turn - // this data descriptor into an accessor descriptor on the way in. - __proto__: null, - value: function (arg1, arg2, arg3) { - return this[methodName].call(this, header, arg1, arg2, arg3); - }, - configurable: true - }); - }); -} -class AxiosHeaders { - constructor(headers) { - headers && this.set(headers); - } - set(header, valueOrRewrite, rewrite) { - const self = this; - function setHeader(_value, _header, _rewrite) { - const lHeader = normalizeHeader(_header); - if (!lHeader) { - return; - } - const key = utils$1.findKey(self, lHeader); - if (!key || self[key] === undefined || _rewrite === true || _rewrite === undefined && self[key] !== false) { - self[key || _header] = normalizeValue(_value); - } - } - const setHeaders = (headers, _rewrite) => utils$1.forEach(headers, (_value, _header) => setHeader(_value, _header, _rewrite)); - if (utils$1.isPlainObject(header) || header instanceof this.constructor) { - setHeaders(header, valueOrRewrite); - } else if (utils$1.isString(header) && (header = header.trim()) && !isValidHeaderName(header)) { - setHeaders(parseHeaders(header), valueOrRewrite); - } else if (utils$1.isObject(header) && utils$1.isSafeIterable(header)) { - let obj = Object.create(null), - dest, - key; - for (const entry of header) { - if (!utils$1.isArray(entry)) { - throw new TypeError('Object iterator must return a key-value pair'); - } - key = entry[0]; - if (utils$1.hasOwnProp(obj, key)) { - dest = obj[key]; - obj[key] = utils$1.isArray(dest) ? [...dest, entry[1]] : [dest, entry[1]]; - } else { - obj[key] = entry[1]; - } - } - setHeaders(obj, valueOrRewrite); - } else { - header != null && setHeader(valueOrRewrite, header, rewrite); - } - return this; - } - get(header, parser) { - header = normalizeHeader(header); - if (header) { - const key = utils$1.findKey(this, header); - if (key) { - const value = this[key]; - if (!parser) { - return value; - } - if (parser === true) { - return parseTokens(value); - } - if (utils$1.isFunction(parser)) { - return parser.call(this, value, key); - } - if (utils$1.isRegExp(parser)) { - return parser.exec(value); - } - throw new TypeError('parser must be boolean|regexp|function'); - } - } - } - has(header, matcher) { - header = normalizeHeader(header); - if (header) { - const key = utils$1.findKey(this, header); - return !!(key && this[key] !== undefined && (!matcher || matchHeaderValue(this, this[key], key, matcher))); - } - return false; - } - delete(header, matcher) { - const self = this; - let deleted = false; - function deleteHeader(_header) { - _header = normalizeHeader(_header); - if (_header) { - const key = utils$1.findKey(self, _header); - if (key && (!matcher || matchHeaderValue(self, self[key], key, matcher))) { - delete self[key]; - deleted = true; - } - } - } - if (utils$1.isArray(header)) { - header.forEach(deleteHeader); - } else { - deleteHeader(header); - } - return deleted; - } - clear(matcher) { - const keys = Object.keys(this); - let i = keys.length; - let deleted = false; - while (i--) { - const key = keys[i]; - if (!matcher || matchHeaderValue(this, this[key], key, matcher, true)) { - delete this[key]; - deleted = true; - } - } - return deleted; - } - normalize(format) { - const self = this; - const headers = {}; - utils$1.forEach(this, (value, header) => { - const key = utils$1.findKey(headers, header); - if (key) { - self[key] = normalizeValue(value); - delete self[header]; - return; - } - const normalized = format ? formatHeader(header) : String(header).trim(); - if (normalized !== header) { - delete self[header]; - } - self[normalized] = normalizeValue(value); - headers[normalized] = true; - }); - return this; - } - concat(...targets) { - return this.constructor.concat(this, ...targets); - } - toJSON(asStrings) { - const obj = Object.create(null); - utils$1.forEach(this, (value, header) => { - value != null && value !== false && (obj[header] = asStrings && utils$1.isArray(value) ? value.join(', ') : value); - }); - return obj; - } - [Symbol.iterator]() { - return Object.entries(this.toJSON())[Symbol.iterator](); - } - toString() { - return Object.entries(this.toJSON()).map(([header, value]) => header + ': ' + value).join('\n'); - } - getSetCookie() { - const value = this.get('set-cookie'); - return utils$1.isArray(value) ? value : value == null || value === false ? [] : [value]; - } - get [Symbol.toStringTag]() { - return 'AxiosHeaders'; - } - static from(thing) { - return thing instanceof this ? thing : new this(thing); - } - static parseParameters(value) { - return parseParameters(value); - } - static concat(first, ...targets) { - const computed = new this(first); - targets.forEach(target => computed.set(target)); - return computed; - } - static accessor(header) { - const internals = this[$internals] = this[$internals] = { - accessors: {} - }; - const accessors = internals.accessors; - const prototype = this.prototype; - function defineAccessor(_header) { - const lHeader = normalizeHeader(_header); - if (!accessors[lHeader]) { - buildAccessors(prototype, _header); - accessors[lHeader] = true; - } - } - utils$1.isArray(header) ? header.forEach(defineAccessor) : defineAccessor(header); - return this; - } -} -AxiosHeaders.accessor(['Content-Type', 'Content-Length', 'Accept', 'Accept-Encoding', 'User-Agent', 'Authorization']); - -// reserved names hotfix -utils$1.reduceDescriptors(AxiosHeaders.prototype, ({ - value -}, key) => { - let mapped = key[0].toUpperCase() + key.slice(1); // map `set` => `Set` - return { - get: () => value, - set(headerValue) { - this[mapped] = headerValue; - } - }; -}); -utils$1.freezeMethods(AxiosHeaders); - -const REDACTED = '[REDACTED ****]'; -function hasOwnOrPrototypeToJSON(source) { - if (utils$1.hasOwnProp(source, 'toJSON')) { - return true; - } - let prototype = Object.getPrototypeOf(source); - while (prototype && prototype !== Object.prototype) { - if (utils$1.hasOwnProp(prototype, 'toJSON')) { - return true; - } - prototype = Object.getPrototypeOf(prototype); - } - return false; -} - -// Build a plain-object snapshot of `config` and replace the value of any key -// (case-insensitive) listed in `redactKeys` with REDACTED. Walks through arrays -// and AxiosHeaders, and short-circuits on circular references. -function redactConfig(config, redactKeys) { - const lowerKeys = new Set(redactKeys.map(k => String(k).toLowerCase())); - const seen = []; - const visit = source => { - if (source === null || typeof source !== 'object') return source; - if (utils$1.isBuffer(source)) return source; - if (seen.indexOf(source) !== -1) return undefined; - if (source instanceof AxiosHeaders) { - source = source.toJSON(); - } - seen.push(source); - let result; - if (utils$1.isArray(source)) { - result = []; - source.forEach((v, i) => { - const reducedValue = visit(v); - if (!utils$1.isUndefined(reducedValue)) { - result[i] = reducedValue; - } - }); - } else { - if (!utils$1.isPlainObject(source) && hasOwnOrPrototypeToJSON(source)) { - seen.pop(); - return source; - } - result = Object.create(null); - for (const [key, value] of Object.entries(source)) { - const reducedValue = lowerKeys.has(key.toLowerCase()) ? REDACTED : visit(value); - if (!utils$1.isUndefined(reducedValue)) { - result[key] = reducedValue; - } - } - } - seen.pop(); - return result; - }; - return visit(config); -} -function stringifySafely$1(value) { - try { - return String(value); - } catch (err) { - return ''; - } -} -function aggregateErrorMessage(error) { - const message = error.errors.map(entry => { - try { - return entry && entry.message ? stringifySafely$1(entry.message) : stringifySafely$1(entry); - } catch (err) { - return ''; - } - }).filter(Boolean).join('; '); - return message || error.name || 'AggregateError'; -} -class AxiosError extends Error { - static from(error, code, config, request, response, customProps) { - // `AggregateError` (thrown by Node on dual-stack/Happy-Eyeballs connection - // failures) has an empty `message`; its detail lives in `errors[]`. Without - // this, the wrapped error surfaces with a blank message (see #6721). - let message = error.message; - if (!message && utils$1.isArray(error.errors) && error.errors.length) { - message = aggregateErrorMessage(error); - } - const axiosError = new AxiosError(message, code || error.code, config, request, response); - // Match native `Error` `cause` semantics: non-enumerable. The wrapped - // error often carries circular internals (sockets, requests, agents), so - // an enumerable `cause` makes structured loggers (pino/winston) and any - // own-property walk throw "Converting circular structure to JSON". - // Regression from #6982; see #7205. `__proto__: null` mirrors the - // `message` descriptor below (prototype-pollution-safe descriptor). - Object.defineProperty(axiosError, 'cause', { - __proto__: null, - value: error, - writable: true, - enumerable: false, - configurable: true - }); - axiosError.name = error.name; - - // Preserve status from the original error if not already set from response - if (error.status != null && axiosError.status == null) { - axiosError.status = error.status; - } - customProps && Object.assign(axiosError, customProps); - return axiosError; - } - - /** - * Create an Error with the specified message, config, error code, request and response. - * - * @param {string} message The error message. - * @param {string} [code] The error code (for example, 'ECONNABORTED'). - * @param {Object} [config] The config. - * @param {Object} [request] The request. - * @param {Object} [response] The response. - * - * @returns {Error} The created error. - */ - constructor(message, code, config, request, response) { - super(message); - - // Make message enumerable to maintain backward compatibility - // The native Error constructor sets message as non-enumerable, - // but axios < v1.13.3 had it as enumerable - Object.defineProperty(this, 'message', { - // Null-proto descriptor so a polluted Object.prototype.get cannot turn - // this data descriptor into an accessor descriptor on the way in. - __proto__: null, - value: message, - enumerable: true, - writable: true, - configurable: true - }); - this.name = 'AxiosError'; - this.isAxiosError = true; - code && (this.code = code); - config && (this.config = config); - request && (this.request = request); - if (response) { - this.response = response; - this.status = response.status; - } - } - toJSON() { - // Opt-in redaction: when the request config carries a `redact` array, the - // value of any matching key (case-insensitive, at any depth) is replaced - // with REDACTED in the serialized snapshot. Undefined or empty leaves the - // existing serialization behavior unchanged. - const config = this.config; - const redactKeys = config && utils$1.hasOwnProp(config, 'redact') ? config.redact : undefined; - const serializedConfig = utils$1.isArray(redactKeys) && redactKeys.length > 0 ? redactConfig(config, redactKeys) : utils$1.toJSONObject(config); - return { - // Standard - message: this.message, - name: this.name, - // Microsoft - description: this.description, - number: this.number, - // Mozilla - fileName: this.fileName, - lineNumber: this.lineNumber, - columnNumber: this.columnNumber, - stack: this.stack, - // Axios - config: serializedConfig, - code: this.code, - status: this.status - }; - } -} - -// This can be changed to static properties as soon as the parser options in .eslint.cjs are updated. -AxiosError.ERR_BAD_OPTION_VALUE = 'ERR_BAD_OPTION_VALUE'; -AxiosError.ERR_BAD_OPTION = 'ERR_BAD_OPTION'; -AxiosError.ECONNABORTED = 'ECONNABORTED'; -AxiosError.ETIMEDOUT = 'ETIMEDOUT'; -AxiosError.ECONNREFUSED = 'ECONNREFUSED'; -AxiosError.ERR_NETWORK = 'ERR_NETWORK'; -AxiosError.ERR_FR_TOO_MANY_REDIRECTS = 'ERR_FR_TOO_MANY_REDIRECTS'; -AxiosError.ERR_DEPRECATED = 'ERR_DEPRECATED'; -AxiosError.ERR_BAD_RESPONSE = 'ERR_BAD_RESPONSE'; -AxiosError.ERR_BAD_REQUEST = 'ERR_BAD_REQUEST'; -AxiosError.ERR_CANCELED = 'ERR_CANCELED'; -AxiosError.ERR_NOT_SUPPORT = 'ERR_NOT_SUPPORT'; -AxiosError.ERR_INVALID_URL = 'ERR_INVALID_URL'; -AxiosError.ERR_FORM_DATA_DEPTH_EXCEEDED = 'ERR_FORM_DATA_DEPTH_EXCEEDED'; - -var PlatformBuffer = { - isBufferAvailable() { - return typeof Buffer !== 'undefined'; - }, - from(value) { - return Buffer.from(value); - } -}; - -// Default nesting limit shared with the inverse transform (formDataToJSON) so -// the FormData <-> JSON round-trip stays symmetric. -const DEFAULT_FORM_DATA_MAX_DEPTH = 100; - -/** - * Determines if the given thing is a array or js object. - * - * @param {string} thing - The object or array to be visited. - * - * @returns {boolean} - */ -function isVisitable(thing) { - return utils$1.isPlainObject(thing) || utils$1.isArray(thing); -} - -/** - * It removes the brackets from the end of a string - * - * @param {string} key - The key of the parameter. - * - * @returns {string} the key without the brackets. - */ -function removeBrackets(key) { - return utils$1.endsWith(key, '[]') ? key.slice(0, -2) : key; -} - -/** - * It takes a path, a key, and a boolean, and returns a string - * - * @param {string} path - The path to the current key. - * @param {string} key - The key of the current object being iterated over. - * @param {string} dots - If true, the key will be rendered with dots instead of brackets. - * - * @returns {string} The path to the current key. - */ -function renderKey(path, key, dots) { - if (!path) return key; - return path.concat(key).map(function each(token, i) { - // eslint-disable-next-line no-param-reassign - token = removeBrackets(token); - return !dots && i ? '[' + token + ']' : token; - }).join(dots ? '.' : ''); -} - -/** - * If the array is an array and none of its elements are visitable, then it's a flat array. - * - * @param {Array} arr - The array to check - * - * @returns {boolean} - */ -function isFlatArray(arr) { - return utils$1.isArray(arr) && !arr.some(isVisitable); -} -const predicates = utils$1.toFlatObject(utils$1, {}, null, function filter(prop) { - return /^is[A-Z]/.test(prop); -}); - -/** - * Convert a data object to FormData - * - * @param {Object} obj - * @param {?Object} [formData] - * @param {?Object} [options] - * @param {Function} [options.visitor] - * @param {Boolean} [options.metaTokens = true] - * @param {Boolean} [options.dots = false] - * @param {?Boolean} [options.indexes = false] - * - * @returns {Object} - **/ - -/** - * It converts an object into a FormData object - * - * @param {Object} obj - The object to convert to form data. - * @param {string} formData - The FormData object to append to. - * @param {Object} options - * - * @returns - */ -function toFormData(obj, formData, options) { - if (!utils$1.isObject(obj)) { - throw new TypeError('target must be an object'); - } - - // eslint-disable-next-line no-param-reassign - formData = formData || new (FormData$1 || FormData)(); - - // eslint-disable-next-line no-param-reassign - options = utils$1.toFlatObject(options, { - metaTokens: true, - dots: false, - indexes: false - }, false, function defined(option, source) { - // eslint-disable-next-line no-eq-null,eqeqeq - return !utils$1.isUndefined(source[option]); - }); - const metaTokens = options.metaTokens; - // eslint-disable-next-line no-use-before-define - const visitor = options.visitor || defaultVisitor; - const dots = options.dots; - const indexes = options.indexes; - const _Blob = options.Blob || typeof Blob !== 'undefined' && Blob; - const maxDepth = options.maxDepth === undefined ? DEFAULT_FORM_DATA_MAX_DEPTH : options.maxDepth; - const useBlob = _Blob && utils$1.isSpecCompliantForm(formData); - const stack = []; - if (!utils$1.isFunction(visitor)) { - throw new TypeError('visitor must be a function'); - } - function convertValue(value) { - if (value === null) return ''; - if (utils$1.isDate(value)) { - return value.toISOString(); - } - if (utils$1.isBoolean(value)) { - return value.toString(); - } - if (!useBlob && utils$1.isBlob(value)) { - throw new AxiosError('Blob is not supported. Use a Buffer instead.'); - } - if (utils$1.isArrayBuffer(value) || utils$1.isTypedArray(value)) { - if (useBlob && typeof _Blob === 'function') { - return new _Blob([value]); - } - if (PlatformBuffer && PlatformBuffer.isBufferAvailable()) { - return PlatformBuffer.from(value); - } - throw new AxiosError('Blob is not supported. Use a Buffer instead.', AxiosError.ERR_NOT_SUPPORT); - } - return value; - } - function throwIfMaxDepthExceeded(depth) { - if (depth > maxDepth) { - throw new AxiosError('Object is too deeply nested (' + depth + ' levels). Max depth: ' + maxDepth, AxiosError.ERR_FORM_DATA_DEPTH_EXCEEDED); - } - } - function stringifyWithDepthLimit(value, depth) { - if (maxDepth === Infinity) { - return JSON.stringify(value); - } - const ancestors = []; - return JSON.stringify(value, function limitDepth(_key, currentValue) { - if (!utils$1.isObject(currentValue)) { - return currentValue; - } - while (ancestors.length && ancestors[ancestors.length - 1] !== this) { - ancestors.pop(); - } - ancestors.push(currentValue); - throwIfMaxDepthExceeded(depth + ancestors.length - 1); - return currentValue; - }); - } - - /** - * Default visitor. - * - * @param {*} value - * @param {String|Number} key - * @param {Array} path - * @this {FormData} - * - * @returns {boolean} return true to visit the each prop of the value recursively - */ - function defaultVisitor(value, key, path) { - let arr = value; - if (utils$1.isReactNative(formData) && utils$1.isReactNativeBlob(value)) { - formData.append(renderKey(path, key, dots), convertValue(value)); - return false; - } - if (value && !path && typeof value === 'object') { - if (utils$1.endsWith(key, '{}')) { - // eslint-disable-next-line no-param-reassign - key = metaTokens ? key : key.slice(0, -2); - // eslint-disable-next-line no-param-reassign - value = stringifyWithDepthLimit(value, 1); - } else if (utils$1.isArray(value) && isFlatArray(value) || (utils$1.isFileList(value) || utils$1.endsWith(key, '[]')) && (arr = utils$1.toArray(value))) { - // eslint-disable-next-line no-param-reassign - key = removeBrackets(key); - arr.forEach(function each(el, index) { - !(utils$1.isUndefined(el) || el === null) && formData.append( - // eslint-disable-next-line no-nested-ternary - indexes === true ? renderKey([key], index, dots) : indexes === null ? key : key + '[]', convertValue(el)); - }); - return false; - } - } - if (isVisitable(value)) { - return true; - } - formData.append(renderKey(path, key, dots), convertValue(value)); - return false; - } - const exposedHelpers = Object.assign(predicates, { - defaultVisitor, - convertValue, - isVisitable - }); - function build(value, path, depth = 0) { - if (utils$1.isUndefined(value)) return; - throwIfMaxDepthExceeded(depth); - if (stack.indexOf(value) !== -1) { - throw new Error('Circular reference detected in ' + path.join('.')); - } - stack.push(value); - utils$1.forEach(value, function each(el, key) { - const result = !(utils$1.isUndefined(el) || el === null) && visitor.call(formData, el, utils$1.isString(key) ? key.trim() : key, path, exposedHelpers); - if (result === true) { - build(el, path ? path.concat(key) : [key], depth + 1); - } - }); - stack.pop(); - } - if (!utils$1.isObject(obj)) { - throw new TypeError('data must be an object'); - } - build(obj); - return formData; -} - -/** - * It encodes a string by replacing all characters that are not in the unreserved set with - * their percent-encoded equivalents - * - * @param {string} str - The string to encode. - * - * @returns {string} The encoded string. - */ -function encode$1(str) { - const charMap = { - '!': '%21', - "'": '%27', - '(': '%28', - ')': '%29', - '~': '%7E', - '%20': '+' - }; - return encodeURIComponent(str).replace(/[!'()~]|%20/g, function replacer(match) { - return charMap[match]; - }); -} - -/** - * It takes a params object and converts it to a FormData object - * - * @param {Object} params - The parameters to be converted to a FormData object. - * @param {Object} options - The options object passed to the Axios constructor. - * - * @returns {void} - */ -function AxiosURLSearchParams(params, options) { - this._pairs = []; - params && toFormData(params, this, options); -} -const prototype = AxiosURLSearchParams.prototype; -prototype.append = function append(name, value) { - this._pairs.push([name, value]); -}; -prototype.toString = function toString(encoder) { - const _encode = encoder ? value => encoder.call(this, value, encode$1) : encode$1; - return this._pairs.map(function each(pair) { - return _encode(pair[0]) + '=' + _encode(pair[1]); - }, '').join('&'); -}; - -/** - * It replaces URL-encoded forms of `:`, `$`, `,`, and spaces with - * their plain counterparts (`:`, `$`, `,`, `+`). - * - * @param {string} val The value to be encoded. - * - * @returns {string} The encoded value. - */ -function encode(val) { - return encodeURIComponent(val).replace(/%3A/gi, ':').replace(/%24/g, '$').replace(/%2C/gi, ',').replace(/%20/g, '+'); -} - -/** - * Build a URL by appending params to the end - * - * @param {string} url The base of the url (e.g., http://www.google.com) - * @param {object} [params] The params to be appended - * @param {?(object|Function)} options - * - * @returns {string} The formatted url - */ -function buildURL(url, params, options) { - if (!params) { - return url; - } - url = url || ''; - const _options = utils$1.isFunction(options) ? { - serialize: options - } : options; - - // Read serializer options pollution-safely: own properties and methods on a - // class/template prototype are honored, but values injected onto a polluted - // Object.prototype are ignored. - const _encode = utils$1.getSafeProp(_options, 'encode') || encode; - const serializeFn = utils$1.getSafeProp(_options, 'serialize'); - let serializedParams; - if (serializeFn) { - serializedParams = serializeFn(params, _options); - } else { - serializedParams = utils$1.isURLSearchParams(params) ? params.toString() : new AxiosURLSearchParams(params, _options).toString(_encode); - } - if (serializedParams) { - const hashmarkIndex = url.indexOf('#'); - if (hashmarkIndex !== -1) { - url = url.slice(0, hashmarkIndex); - } - url += (url.indexOf('?') === -1 ? '?' : '&') + serializedParams; - } - return url; -} - -class InterceptorManager { - constructor() { - this.handlers = []; - } - - /** - * Add a new interceptor to the stack - * - * @param {Function} fulfilled The function to handle `then` for a `Promise` - * @param {Function} rejected The function to handle `reject` for a `Promise` - * @param {Object} options The options for the interceptor, synchronous and runWhen - * - * @return {Number} An ID used to remove interceptor later - */ - use(fulfilled, rejected, options) { - this.handlers.push({ - fulfilled, - rejected, - synchronous: options ? options.synchronous : false, - runWhen: options ? options.runWhen : null - }); - return this.handlers.length - 1; - } - - /** - * Remove an interceptor from the stack - * - * @param {Number} id The ID that was returned by `use` - * - * @returns {void} - */ - eject(id) { - if (this.handlers[id]) { - this.handlers[id] = null; - } - } - - /** - * Clear all interceptors from the stack - * - * @returns {void} - */ - clear() { - if (this.handlers) { - this.handlers = []; - } - } - - /** - * Iterate over all the registered interceptors - * - * This method is particularly useful for skipping over any - * interceptors that may have become `null` calling `eject`. - * - * @param {Function} fn The function to call for each interceptor - * - * @returns {void} - */ - forEach(fn) { - utils$1.forEach(this.handlers, function forEachHandler(h) { - if (h !== null) { - fn(h); - } - }); - } -} - -var transitionalDefaults = { - silentJSONParsing: true, - forcedJSONParsing: true, - clarifyTimeoutError: false, - legacyInterceptorReqResOrdering: true, - advertiseZstdAcceptEncoding: false, - validateStatusUndefinedResolves: true -}; - -var URLSearchParams = url.URLSearchParams; - -const ALPHA = 'abcdefghijklmnopqrstuvwxyz'; -const DIGIT = '0123456789'; -const ALPHABET = { - DIGIT, - ALPHA, - ALPHA_DIGIT: ALPHA + ALPHA.toUpperCase() + DIGIT -}; -const generateString = (size = 16, alphabet = ALPHABET.ALPHA_DIGIT) => { - let str = ''; - const { - length - } = alphabet; - const randomValues = new Uint32Array(size); - crypto.randomFillSync(randomValues); - for (let i = 0; i < size; i++) { - str += alphabet[randomValues[i] % length]; - } - return str; -}; -var platform$1 = { - isNode: true, - classes: { - URLSearchParams, - FormData: FormData$1, - Blob: typeof Blob !== 'undefined' && Blob || null - }, - ALPHABET, - generateString, - protocols: ['http', 'https', 'file', 'data'] -}; - -const hasBrowserEnv = typeof window !== 'undefined' && typeof document !== 'undefined'; -const _navigator = typeof navigator === 'object' && navigator || undefined; - -/** - * Determine if we're running in a standard browser environment - * - * This allows axios to run in a web worker, and react-native. - * Both environments support XMLHttpRequest, but not fully standard globals. - * - * web workers: - * typeof window -> undefined - * typeof document -> undefined - * - * react-native: - * navigator.product -> 'ReactNative' - * nativescript - * navigator.product -> 'NativeScript' or 'NS' - * - * @returns {boolean} - */ -const hasStandardBrowserEnv = hasBrowserEnv && (!_navigator || ['ReactNative', 'NativeScript', 'NS'].indexOf(_navigator.product) < 0); - -/** - * Determine if we're running in a standard browser webWorker environment - * - * Although the `isStandardBrowserEnv` method indicates that - * `allows axios to run in a web worker`, the WebWorker will still be - * filtered out due to its judgment standard - * `typeof window !== 'undefined' && typeof document !== 'undefined'`. - * This leads to a problem when axios post `FormData` in webWorker - */ -const hasStandardBrowserWebWorkerEnv = (() => { - return typeof WorkerGlobalScope !== 'undefined' && - // eslint-disable-next-line no-undef - self instanceof WorkerGlobalScope && typeof self.importScripts === 'function'; -})(); -const origin = hasBrowserEnv && window.location.href || 'http://localhost'; - -var utils = /*#__PURE__*/Object.freeze({ - __proto__: null, - hasBrowserEnv: hasBrowserEnv, - hasStandardBrowserEnv: hasStandardBrowserEnv, - hasStandardBrowserWebWorkerEnv: hasStandardBrowserWebWorkerEnv, - navigator: _navigator, - origin: origin -}); - -var platform = { - ...utils, - ...platform$1 -}; - -function toURLEncodedForm(data, options) { - return toFormData(data, new platform.classes.URLSearchParams(), { - visitor: function (value, key, path, helpers) { - if (platform.isNode && utils$1.isBuffer(value)) { - this.append(key, value.toString('base64')); - return false; - } - return helpers.defaultVisitor.apply(this, arguments); - }, - ...options - }); -} - -const MAX_DEPTH = DEFAULT_FORM_DATA_MAX_DEPTH; -function throwIfDepthExceeded(index) { - if (index > MAX_DEPTH) { - throw new AxiosError('FormData field is too deeply nested (' + index + ' levels). Max depth: ' + MAX_DEPTH, AxiosError.ERR_FORM_DATA_DEPTH_EXCEEDED); - } -} - -/** - * It takes a string like `foo[x][y][z]` and returns an array like `['foo', 'x', 'y', 'z'] - * - * @param {string} name - The name of the property to get. - * - * @returns An array of strings. - */ -function parsePropPath(name) { - // foo[x][y][z] -> ['foo', 'x', 'y', 'z'] - // foo.x.y.z -> ['foo', 'x', 'y', 'z'] - // A path is split on `.` and on `[...]` groups. A segment — whether written - // in dot notation or captured inside brackets — may contain any character - // except `.`, `[` and `]`, so a key like `user-name` or `user name` is kept - // literal instead of being split (#5402). `.`, `[` and `]` keep their existing - // meaning, e.g. `foo[bar.baz]` -> ['foo', 'bar', 'baz'] and `[]` is an array push. - // Excluding `[` from the bracket group also makes the match fail fast at the - // next `[`, so a malformed name cannot rescan to the end of the string from - // every unmatched `[` — parsing stays linear in the length of the name. - const path = []; - const pattern = /[^.[\]]+|\[([^.[\]]*)]/g; - let match; - while ((match = pattern.exec(name)) !== null) { - throwIfDepthExceeded(path.length); - path.push(match[0] === '[]' ? '' : match[1] || match[0]); - } - return path; -} - -/** - * Convert an array to an object. - * - * @param {Array} arr - The array to convert to an object. - * - * @returns An object with the same keys and values as the array. - */ -function arrayToObject(arr) { - const obj = {}; - const keys = Object.keys(arr); - let i; - const len = keys.length; - let key; - for (i = 0; i < len; i++) { - key = keys[i]; - obj[key] = arr[key]; - } - return obj; -} - -/** - * It takes a FormData object and returns a JavaScript object - * - * @param {string} formData The FormData object to convert to JSON. - * - * @returns {Object | null} The converted object. - */ -function formDataToJSON(formData) { - function buildPath(path, value, target, index) { - throwIfDepthExceeded(index); - let name = path[index++]; - if (name === '__proto__') return true; - const isNumericKey = Number.isFinite(+name); - const isLast = index >= path.length; - name = !name && utils$1.isArray(target) ? target.length : name; - if (isLast) { - if (utils$1.hasOwnProp(target, name)) { - target[name] = utils$1.isArray(target[name]) ? target[name].concat(value) : [target[name], value]; - } else { - target[name] = value; - } - return !isNumericKey; - } - if (!utils$1.hasOwnProp(target, name) || !utils$1.isObject(target[name])) { - target[name] = []; - } - const result = buildPath(path, value, target[name], index); - if (result && utils$1.isArray(target[name])) { - target[name] = arrayToObject(target[name]); - } - return !isNumericKey; - } - if (utils$1.isFormData(formData) && utils$1.isFunction(formData.entries)) { - const obj = {}; - utils$1.forEachEntry(formData, (name, value) => { - buildPath(parsePropPath(name), value, obj, 0); - }); - return obj; - } - return null; -} - -const own = (obj, key) => obj != null && utils$1.hasOwnProp(obj, key) ? obj[key] : undefined; - -/** - * It takes a string, tries to parse it, and if it fails, it returns the stringified version - * of the input - * - * @param {any} rawValue - The value to be stringified. - * @param {Function} parser - A function that parses a string into a JavaScript object. - * @param {Function} encoder - A function that takes a value and returns a string. - * - * @returns {string} A stringified version of the rawValue. - */ -function stringifySafely(rawValue, parser, encoder) { - if (utils$1.isString(rawValue)) { - try { - (parser || JSON.parse)(rawValue); - return utils$1.trim(rawValue); - } catch (e) { - if (e.name !== 'SyntaxError') { - throw e; - } - } - } - return (encoder || JSON.stringify)(rawValue); -} -const defaults = { - transitional: transitionalDefaults, - adapter: ['xhr', 'http', 'fetch'], - transformRequest: [function transformRequest(data, headers) { - const contentType = headers.getContentType() || ''; - const hasJSONContentType = contentType.indexOf('application/json') > -1; - const isObjectPayload = utils$1.isObject(data); - if (isObjectPayload && utils$1.isHTMLForm(data)) { - data = new FormData(data); - } - const isFormData = utils$1.isFormData(data); - if (isFormData) { - return hasJSONContentType ? JSON.stringify(formDataToJSON(data)) : data; - } - if (utils$1.isArrayBuffer(data) || utils$1.isBuffer(data) || utils$1.isStream(data) || utils$1.isFile(data) || utils$1.isBlob(data) || utils$1.isReadableStream(data)) { - return data; - } - if (utils$1.isArrayBufferView(data)) { - return data.buffer; - } - if (utils$1.isURLSearchParams(data)) { - headers.setContentType('application/x-www-form-urlencoded;charset=utf-8', false); - return data.toString(); - } - let isFileList; - if (isObjectPayload) { - const formSerializer = own(this, 'formSerializer'); - if (contentType.indexOf('application/x-www-form-urlencoded') > -1) { - return toURLEncodedForm(data, formSerializer).toString(); - } - if ((isFileList = utils$1.isFileList(data)) || contentType.indexOf('multipart/form-data') > -1) { - const env = own(this, 'env'); - const _FormData = env && env.FormData; - return toFormData(isFileList ? { - 'files[]': data - } : data, _FormData && new _FormData(), formSerializer); - } - } - if (isObjectPayload || hasJSONContentType) { - headers.setContentType('application/json', false); - return stringifySafely(data); - } - return data; - }], - transformResponse: [function transformResponse(data) { - const transitional = own(this, 'transitional') || defaults.transitional; - const forcedJSONParsing = transitional && transitional.forcedJSONParsing; - const responseType = own(this, 'responseType'); - const JSONRequested = responseType === 'json'; - if (utils$1.isResponse(data) || utils$1.isReadableStream(data)) { - return data; - } - if (data && utils$1.isString(data) && (forcedJSONParsing && !responseType || JSONRequested)) { - const silentJSONParsing = transitional && transitional.silentJSONParsing; - const strictJSONParsing = !silentJSONParsing && JSONRequested; - try { - return JSON.parse(data, own(this, 'parseReviver')); - } catch (e) { - if (strictJSONParsing) { - if (e.name === 'SyntaxError') { - throw AxiosError.from(e, AxiosError.ERR_BAD_RESPONSE, this, null, own(this, 'response')); - } - throw e; - } - } - } - return data; - }], - /** - * A timeout in milliseconds to abort a request. If set to 0 (default) a - * timeout is not created. - */ - timeout: 0, - xsrfCookieName: 'XSRF-TOKEN', - xsrfHeaderName: 'X-XSRF-TOKEN', - maxContentLength: -1, - maxBodyLength: -1, - env: { - FormData: platform.classes.FormData, - Blob: platform.classes.Blob - }, - validateStatus: function validateStatus(status) { - return status >= 200 && status < 300; - }, - headers: { - common: { - Accept: 'application/json, text/plain, */*', - 'Content-Type': undefined - } - } -}; -utils$1.forEach(['delete', 'get', 'head', 'post', 'put', 'patch', 'query'], method => { - defaults.headers[method] = {}; -}); - -/** - * Transform the data for a request or a response - * - * @param {Array|Function} fns A single function or Array of functions - * @param {?Object} response The response object - * - * @returns {*} The resulting transformed data - */ -function transformData(fns, response) { - const config = this || defaults; - const context = response || config; - const headers = AxiosHeaders.from(context.headers); - let data = context.data; - utils$1.forEach(fns, function transform(fn) { - data = fn.call(config, data, headers.normalize(), response ? response.status : undefined); - }); - headers.normalize(); - return data; -} - -function isCancel(value) { - return !!(value && value.__CANCEL__); -} - -class CanceledError extends AxiosError { - /** - * A `CanceledError` is an object that is thrown when an operation is canceled. - * - * @param {string=} message The message. - * @param {Object=} config The config. - * @param {Object=} request The request. - * - * @returns {CanceledError} The created error. - */ - constructor(message, config, request) { - super(message == null ? 'canceled' : message, AxiosError.ERR_CANCELED, config, request); - this.name = 'CanceledError'; - this.__CANCEL__ = true; - } -} - -/** - * Resolve or reject a Promise based on response status. - * - * @param {Function} resolve A function that resolves the promise. - * @param {Function} reject A function that rejects the promise. - * @param {object} response The response. - * - * @returns {object} The response. - */ -function settle(resolve, reject, response) { - const validateStatus = response.config.validateStatus; - if (!response.status || !validateStatus || validateStatus(response.status)) { - resolve(response); - } else { - reject(new AxiosError('Request failed with status code ' + response.status, response.status >= 400 && response.status < 500 ? AxiosError.ERR_BAD_REQUEST : AxiosError.ERR_BAD_RESPONSE, response.config, response.request, response)); - } -} - -/** - * Determines whether the specified URL is absolute - * - * @param {string} url The URL to test - * - * @returns {boolean} True if the specified URL is absolute, otherwise false - */ -function isAbsoluteURL(url) { - // A URL is considered absolute if it begins with "://" or "//" (protocol-relative URL). - // RFC 3986 defines scheme name as a sequence of characters beginning with a letter and followed - // by any combination of letters, digits, plus, period, or hyphen. - if (typeof url !== 'string') { - return false; - } - return /^([a-z][a-z\d+\-.]*:)?\/\//i.test(url); -} - -/** - * Creates a new URL by combining the specified URLs - * - * @param {string} baseURL The base URL - * @param {string} relativeURL The relative URL - * - * @returns {string} The combined URL - */ -function combineURLs(baseURL, relativeURL) { - if (!relativeURL) { - return baseURL; - } - let end = baseURL.length; - while (end > 0 && baseURL.charCodeAt(end - 1) === 47) { - end--; - } - return baseURL.slice(0, end) + '/' + relativeURL.replace(/^\/+/, ''); -} - -const malformedHttpProtocol = /^https?:(?!\/\/)/i; -const httpProtocolControlCharacters = /[\t\n\r]/g; -function stripLeadingC0ControlOrSpace(url) { - let i = 0; - while (i < url.length && url.charCodeAt(i) <= 0x20) { - i++; - } - return url.slice(i); -} -function normalizeURLForProtocolCheck(url) { - return stripLeadingC0ControlOrSpace(url).replace(httpProtocolControlCharacters, ''); -} - -// Redact the parts of a URL that can carry secrets before it is embedded in an -// error message. AxiosError.toJSON() serializes `message` verbatim and errors -// are commonly logged, while the opt-in `config.redact` model only cleans -// config keys — it cannot reach the message. Redact only the genuinely -// sensitive substrings — userinfo (credentials), query parameter values and -// fragment contents — with the same REDACTED marker the config redaction uses, -// while keeping the scheme, host, path and parameter names so the offending -// request stays accurately identifiable. -function redactFragment(fragment) { - if (!fragment) { - return fragment; - } - return fragment.replace(/(^|&)([^=&]*=)?[^&]+/g, (match, separator, parameterName = '') => { - return `${separator}${parameterName}${REDACTED}`; - }); -} -function redactSensitiveURLParts(url) { - const redactedURL = url.replace(/^(https?:\/{0,2})[^/?#]*@/i, `$1${REDACTED}@`); - const fragmentIndex = redactedURL.indexOf('#'); - const urlWithoutFragment = fragmentIndex === -1 ? redactedURL : redactedURL.slice(0, fragmentIndex); - const redactedURLWithoutFragment = urlWithoutFragment.replace(/([?&][^=&#]*=)[^&#]*/g, `$1${REDACTED}`); - if (fragmentIndex === -1) { - return redactedURLWithoutFragment; - } - return `${redactedURLWithoutFragment}#${redactFragment(redactedURL.slice(fragmentIndex + 1))}`; -} -function assertValidHttpProtocolURL(url, config) { - if (typeof url === 'string') { - const normalizedURL = normalizeURLForProtocolCheck(url); - if (malformedHttpProtocol.test(normalizedURL)) { - throw new AxiosError(`Invalid URL ${JSON.stringify(redactSensitiveURLParts(normalizedURL))}: missing "//" after protocol`, AxiosError.ERR_INVALID_URL, config); - } - } -} - -/** - * Creates a new URL by combining the baseURL with the requestedURL, - * only when the requestedURL is not already an absolute URL. - * If the requestURL is absolute, this function returns the requestedURL untouched. - * - * @param {string} baseURL The base URL - * @param {string} requestedURL Absolute or relative URL to combine - * - * @returns {string} The combined full path - */ -function buildFullPath(baseURL, requestedURL, allowAbsoluteUrls, config) { - assertValidHttpProtocolURL(requestedURL, config); - let isRelativeUrl = !isAbsoluteURL(requestedURL); - if (baseURL && (isRelativeUrl || allowAbsoluteUrls === false)) { - assertValidHttpProtocolURL(baseURL, config); - return combineURLs(baseURL, requestedURL); - } - return requestedURL; -} - -var DEFAULT_PORTS$1 = { - ftp: 21, - gopher: 70, - http: 80, - https: 443, - ws: 80, - wss: 443 -}; -function parseUrl(urlString) { - try { - return new URL(urlString); - } catch { - return null; - } -} - -/** - * @param {string|object|URL} url - The URL as a string or URL instance, or a - * compatible object (such as the result from legacy url.parse). - * @return {string} The URL of the proxy that should handle the request to the - * given URL. If no proxy is set, this will be an empty string. - */ -function getProxyForUrl(url) { - var parsedUrl = (typeof url === 'string' ? parseUrl(url) : url) || {}; - var proto = parsedUrl.protocol; - var hostname = parsedUrl.host; - var port = parsedUrl.port; - if (typeof hostname !== 'string' || !hostname || typeof proto !== 'string') { - return ''; // Don't proxy URLs without a valid scheme or host. - } - proto = proto.split(':', 1)[0]; - // Stripping ports in this way instead of using parsedUrl.hostname to make - // sure that the brackets around IPv6 addresses are kept. - hostname = hostname.replace(/:\d*$/, ''); - port = parseInt(port) || DEFAULT_PORTS$1[proto] || 0; - if (!shouldProxy(hostname, port)) { - return ''; // Don't proxy URLs that match NO_PROXY. - } - var proxy = getEnv(proto + '_proxy') || getEnv('all_proxy'); - if (proxy && proxy.indexOf('://') === -1) { - // Missing scheme in proxy, default to the requested URL's scheme. - proxy = proto + '://' + proxy; - } - return proxy; -} - -/** - * Determines whether a given URL should be proxied. - * - * @param {string} hostname - The host name of the URL. - * @param {number} port - The effective port of the URL. - * @returns {boolean} Whether the given URL should be proxied. - * @private - */ -function shouldProxy(hostname, port) { - var NO_PROXY = getEnv('no_proxy').toLowerCase(); - if (!NO_PROXY) { - return true; // Always proxy if NO_PROXY is not set. - } - if (NO_PROXY === '*') { - return false; // Never proxy if wildcard is set. - } - return NO_PROXY.split(/[,\s]/).every(function (proxy) { - if (!proxy) { - return true; // Skip zero-length hosts. - } - var parsedProxy = proxy.match(/^(.+):(\d+)$/); - var parsedProxyHostname = parsedProxy ? parsedProxy[1] : proxy; - var parsedProxyPort = parsedProxy ? parseInt(parsedProxy[2]) : 0; - if (parsedProxyPort && parsedProxyPort !== port) { - return true; // Skip if ports don't match. - } - if (!/^[.*]/.test(parsedProxyHostname)) { - // No wildcards, so stop proxying if there is an exact match. - return hostname !== parsedProxyHostname; - } - if (parsedProxyHostname.charAt(0) === '*') { - // Remove leading wildcard. - parsedProxyHostname = parsedProxyHostname.slice(1); - } - // Stop proxying if the hostname ends with the no_proxy host. - return !hostname.endsWith(parsedProxyHostname); - }); -} - -/** - * Get the value for an environment variable. - * - * @param {string} key - The name of the environment variable. - * @return {string} The value of the environment variable. - * @private - */ -function getEnv(key) { - return process.env[key.toLowerCase()] || process.env[key.toUpperCase()] || ''; -} - -const VERSION = "1.19.0"; - -function parseProtocol(url) { - const match = /^([-+\w]{1,25}):(?:\/\/)?/.exec(url); - return match && match[1] || ''; -} - -// RFC 2397: data:[][;base64], -// mediatype = type/subtype followed by optional ;name=value parameters -const DATA_URL_PATTERN = /^([^,;]+\/[^,;]+)?((?:;[^,;=]+=[^,;]+)*)(;base64)?,([\s\S]*)$/; - -/** - * Parse data uri to a Buffer or Blob - * - * @param {String} uri - * @param {?Boolean} asBlob - * @param {?Object} options - * @param {?Function} options.Blob - * - * @returns {Buffer|Blob} - */ -function fromDataURI(uri, asBlob, options) { - const _Blob = options && options.Blob || platform.classes.Blob; - const protocol = parseProtocol(uri); - if (asBlob === undefined && _Blob) { - asBlob = true; - } - if (protocol === 'data') { - uri = protocol.length ? uri.slice(protocol.length + 1) : uri; - const match = DATA_URL_PATTERN.exec(uri); - if (!match) { - throw new AxiosError('Invalid URL', AxiosError.ERR_INVALID_URL); - } - const type = match[1]; - const params = match[2]; - const encoding = match[3] ? 'base64' : 'utf8'; - const body = match[4]; - - // RFC 2397 section 3: default mediatype is text/plain;charset=US-ASCII - // Bare `data:,` leaves mime undefined; Blob normalises that to "" per spec. - let mime = ''; - if (type) { - mime = params ? type + params : type; - } else if (params) { - mime = 'text/plain' + params; - } - const buffer = encoding === 'base64' ? Buffer.from(body, 'base64') : Buffer.from(decodeURIComponent(body), encoding); - if (asBlob) { - if (!_Blob) { - throw new AxiosError('Blob is not supported', AxiosError.ERR_NOT_SUPPORT); - } - return new _Blob([buffer], { - type: mime - }); - } - return buffer; - } - throw new AxiosError('Unsupported protocol ' + protocol, AxiosError.ERR_NOT_SUPPORT); -} - -const FORM_DATA_CONTENT_HEADERS = ['content-type', 'content-length']; - -/** - * Apply the headers generated by a FormData implementation to the request headers, - * honoring the `formDataHeaderPolicy` option: with 'content-only', copy only the - * content-* headers; otherwise merge all of them. - * - * @param {AxiosHeaders} headers - the request headers to mutate - * @param {Object | null | undefined} formHeaders - headers produced by the FormData implementation - * @param {String} [policy] - the resolved `formDataHeaderPolicy` config value - * - * @returns {void} - */ -function setFormDataHeaders(headers, formHeaders, policy) { - if (policy !== 'content-only') { - headers.set(formHeaders); - return; - } - Object.entries(formHeaders || {}).forEach(([key, val]) => { - if (FORM_DATA_CONTENT_HEADERS.includes(key.toLowerCase())) { - headers.set(key, val); - } - }); -} - -const kInternals = Symbol('internals'); -class AxiosTransformStream extends stream.Transform { - constructor(options) { - options = utils$1.toFlatObject(options, { - maxRate: 0, - chunkSize: 64 * 1024, - minChunkSize: 100, - timeWindow: 500, - ticksRate: 2, - samplesCount: 15 - }, null, (prop, source) => { - return !utils$1.isUndefined(source[prop]); - }); - super({ - readableHighWaterMark: options.chunkSize - }); - const internals = this[kInternals] = { - timeWindow: options.timeWindow, - chunkSize: options.chunkSize, - maxRate: options.maxRate, - minChunkSize: options.minChunkSize, - bytesSeen: 0, - isCaptured: false, - notifiedBytesLoaded: 0, - ts: Date.now(), - bytes: 0, - onReadCallback: null - }; - this.on('newListener', event => { - if (event === 'progress') { - if (!internals.isCaptured) { - internals.isCaptured = true; - } - } - }); - } - _read(size) { - const internals = this[kInternals]; - if (internals.onReadCallback) { - internals.onReadCallback(); - } - return super._read(size); - } - _transform(chunk, encoding, callback) { - const internals = this[kInternals]; - const maxRate = internals.maxRate; - const readableHighWaterMark = this.readableHighWaterMark; - const timeWindow = internals.timeWindow; - const divider = 1000 / timeWindow; - const bytesThreshold = maxRate / divider; - const minChunkSize = internals.minChunkSize !== false ? Math.max(internals.minChunkSize, bytesThreshold * 0.01) : 0; - const pushChunk = (_chunk, _callback) => { - const bytes = Buffer.byteLength(_chunk); - internals.bytesSeen += bytes; - internals.bytes += bytes; - internals.isCaptured && this.emit('progress', internals.bytesSeen); - if (this.push(_chunk)) { - process.nextTick(_callback); - } else { - internals.onReadCallback = () => { - internals.onReadCallback = null; - process.nextTick(_callback); - }; - } - }; - const transformChunk = (_chunk, _callback) => { - const chunkSize = Buffer.byteLength(_chunk); - let chunkRemainder = null; - let maxChunkSize = readableHighWaterMark; - let bytesLeft; - let passed = 0; - if (maxRate) { - const now = Date.now(); - if (!internals.ts || (passed = now - internals.ts) >= timeWindow) { - internals.ts = now; - bytesLeft = bytesThreshold - internals.bytes; - internals.bytes = bytesLeft < 0 ? -bytesLeft : 0; - passed = 0; - } - bytesLeft = bytesThreshold - internals.bytes; - } - if (maxRate) { - if (bytesLeft <= 0) { - // next time window - return setTimeout(() => { - _callback(null, _chunk); - }, timeWindow - passed); - } - if (bytesLeft < maxChunkSize) { - maxChunkSize = bytesLeft; - } - } - if (maxChunkSize && chunkSize > maxChunkSize && chunkSize - maxChunkSize > minChunkSize) { - chunkRemainder = _chunk.subarray(maxChunkSize); - _chunk = _chunk.subarray(0, maxChunkSize); - } - pushChunk(_chunk, chunkRemainder ? () => { - process.nextTick(_callback, null, chunkRemainder); - } : _callback); - }; - transformChunk(chunk, function transformNextChunk(err, _chunk) { - if (err) { - return callback(err); - } - if (_chunk) { - transformChunk(_chunk, transformNextChunk); - } else { - callback(null); - } - }); - } -} - -const { - asyncIterator -} = Symbol; -const readBlob = async function* (blob) { - if (blob.stream) { - yield* blob.stream(); - } else if (blob.arrayBuffer) { - yield await blob.arrayBuffer(); - } else if (blob[asyncIterator]) { - yield* blob[asyncIterator](); - } else { - yield blob; - } -}; - -const BOUNDARY_ALPHABET = platform.ALPHABET.ALPHA_DIGIT + '-_'; -const textEncoder = typeof TextEncoder === 'function' ? new TextEncoder() : new util.TextEncoder(); -const CRLF = '\r\n'; -const CRLF_BYTES = textEncoder.encode(CRLF); -const CRLF_BYTES_COUNT = 2; -class FormDataPart { - constructor(name, value) { - const { - escapeName - } = this.constructor; - const isStringValue = utils$1.isString(value); - let headers = `Content-Disposition: form-data; name="${escapeName(name)}"${!isStringValue && value.name ? `; filename="${escapeName(value.name)}"` : ''}${CRLF}`; - if (isStringValue) { - value = textEncoder.encode(String(value).replace(/\r?\n|\r\n?/g, CRLF)); - } else { - const safeType = String(value.type || 'application/octet-stream').replace(/[\r\n]/g, ''); - headers += `Content-Type: ${safeType}${CRLF}`; - } - this.headers = textEncoder.encode(headers + CRLF); - this.contentLength = isStringValue ? value.byteLength : value.size; - this.size = this.headers.byteLength + this.contentLength + CRLF_BYTES_COUNT; - this.name = name; - this.value = value; - } - async *encode() { - yield this.headers; - const { - value - } = this; - if (utils$1.isTypedArray(value)) { - yield value; - } else { - yield* readBlob(value); - } - yield CRLF_BYTES; - } - static escapeName(name) { - return String(name).replace(/[\r\n"]/g, match => ({ - '\r': '%0D', - '\n': '%0A', - '"': '%22' - })[match]); - } -} -const formDataToStream = (form, headersHandler, options) => { - const { - tag = 'form-data-boundary', - size = 25, - boundary = tag + '-' + platform.generateString(size, BOUNDARY_ALPHABET) - } = options || {}; - if (!utils$1.isFormData(form)) { - throw new TypeError('FormData instance required'); - } - if (boundary.length < 1 || boundary.length > 70) { - throw new Error('boundary must be 1-70 characters long'); - } - const boundaryBytes = textEncoder.encode('--' + boundary + CRLF); - const footerBytes = textEncoder.encode('--' + boundary + '--' + CRLF); - let contentLength = footerBytes.byteLength; - const parts = Array.from(form.entries()).map(([name, value]) => { - const part = new FormDataPart(name, value); - contentLength += part.size; - return part; - }); - contentLength += boundaryBytes.byteLength * parts.length; - contentLength = utils$1.toFiniteNumber(contentLength); - const computedHeaders = { - 'Content-Type': `multipart/form-data; boundary=${boundary}` - }; - if (Number.isFinite(contentLength)) { - computedHeaders['Content-Length'] = contentLength; - } - headersHandler && headersHandler(computedHeaders); - return stream.Readable.from(async function* () { - for (const part of parts) { - yield boundaryBytes; - yield* part.encode(); - } - yield footerBytes; - }()); -}; - -class ZlibHeaderTransformStream extends stream.Transform { - __transform(chunk, encoding, callback) { - this.push(chunk); - callback(); - } - _transform(chunk, encoding, callback) { - if (chunk.length !== 0) { - this._transform = this.__transform; - - // Add Default Compression headers if no zlib headers are present - if (chunk[0] !== 120) { - // Hex: 78 - const header = Buffer.alloc(2); - header[0] = 120; // Hex: 78 - header[1] = 156; // Hex: 9C - this.push(header, encoding); - } - } - this.__transform(chunk, encoding, callback); - } -} - -class Http2Sessions { - constructor() { - this.sessions = Object.create(null); - } - getSession(authority, options) { - options = Object.assign({ - sessionTimeout: 1000 - }, options); - let authoritySessions = this.sessions[authority]; - if (authoritySessions) { - let len = authoritySessions.length; - for (let i = 0; i < len; i++) { - const [sessionHandle, sessionOptions] = authoritySessions[i]; - if (!sessionHandle.destroyed && !sessionHandle.closed && util.isDeepStrictEqual(sessionOptions, options)) { - return sessionHandle; - } - } - } - const session = http2.connect(authority, options); - let removed; - let timer; - const removeSession = () => { - if (removed) { - return; - } - removed = true; - if (timer) { - clearTimeout(timer); - timer = null; - } - let entries = authoritySessions, - len = entries.length, - i = len; - while (i--) { - if (entries[i][0] === session) { - if (len === 1) { - delete this.sessions[authority]; - } else { - entries.splice(i, 1); - } - if (!session.closed) { - session.close(); - } - return; - } - } - }; - const originalRequestFn = session.request; - const { - sessionTimeout - } = options; - if (sessionTimeout != null) { - let streamsCount = 0; - session.request = function () { - const stream = originalRequestFn.apply(this, arguments); - streamsCount++; - if (timer) { - clearTimeout(timer); - timer = null; - } - stream.once('close', () => { - if (! --streamsCount) { - timer = setTimeout(() => { - timer = null; - removeSession(); - }, sessionTimeout); - } - }); - return stream; - }; - } - session.once('close', removeSession); - let entry = [session, options]; - authoritySessions ? authoritySessions.push(entry) : authoritySessions = this.sessions[authority] = [entry]; - return session; - } -} - -const callbackify = (fn, reducer) => { - return utils$1.isAsyncFn(fn) ? function (...args) { - const cb = args.pop(); - fn.apply(this, args).then(value => { - try { - reducer ? cb(null, ...reducer(value)) : cb(null, value); - } catch (err) { - cb(err); - } - }, cb); - } : fn; -}; - -const LOOPBACK_HOSTNAMES = new Set(['localhost', '0.0.0.0']); -const isIPv4Loopback = host => { - const parts = host.split('.'); - if (parts.length !== 4) return false; - if (parts[0] !== '127') return false; - return parts.every(p => /^\d+$/.test(p) && Number(p) >= 0 && Number(p) <= 255); -}; - -/** - * Canonicalize an IPv4 address written in shorthand, octal, or hex form into - * dotted-decimal. IPv6 addresses and non-IP strings are returned unchanged so - * the existing IPv4-mapped IPv6 unmap path and the isLoopback path can still - * see them. - * - * Shorthand expansion mirrors Node's URL parser: literal parts fill from the - * left, the final part fills the remaining octets from the right with - * zero-padding on the left. - * 127.1 -> 127.0.0.1 - * 127.0.1 -> 127.0.0.1 - * 1.2.3 -> 1.2.0.3 - * - * Each octet is parsed with an explicit base: 16 for `0x`/`0X` prefix, 8 for - * zero-prefixed multi-digit all-`0-7` parts, 10 otherwise. Zero-prefixed - * decimal-looking parts that contain `8` or `9` are rejected to match Node's - * URL parser, and the comparison layer falls through to non-bypass if either - * side rejects the form (fail-safe). - * - * Returns the input unchanged on any parse failure, out-of-range octet, or - * unusual shape (1-part, 5+ parts) so the comparison layer fails closed. - */ -const parseIPv4Octet = text => { - if (/^0[xX][0-9a-fA-F]+$/.test(text)) { - const n = parseInt(text.slice(2), 16); - return Number.isFinite(n) ? n : null; - } - if (text.length > 1 && /^0[0-7]+$/.test(text)) { - const n = parseInt(text, 8); - return Number.isFinite(n) ? n : null; - } - if (text.length > 1 && /^0[0-9]+$/.test(text)) { - return null; - } - if (/^[0-9]+$/.test(text)) { - const n = parseInt(text, 10); - return Number.isFinite(n) ? n : null; - } - return null; -}; -const normalizeIPAddress = host => { - if (typeof host !== 'string' || !host || host.indexOf(':') !== -1) { - return host; - } - let h = host; - if (h.charAt(0) === '[' && h.charAt(h.length - 1) === ']') { - h = h.slice(1, -1); - } - h = h.replace(/\.+$/, ''); - - // Allowed characters for any IPv4 shape: digits, dot, 'x', 'X', hex digits. - if (!/^[0-9.xXa-fA-F]+$/.test(h)) return host; - const parts = h.split('.'); - - // No part may be empty (e.g. "127..0.1" or "127.0.0."). Trailing dots are - // already stripped above; this guards against the empty-middle case. - if (parts.some(p => p === '')) return host; - if (parts.length === 4) { - // Full IPv4 form: each part is an octet. - const octets = parts.map(parseIPv4Octet); - if (octets.some(n => n === null || n < 0 || n > 255)) return host; - return octets.join('.'); - } - if (parts.length > 4) { - return host; - } - - // Shorthand: 1..3 parts. Node's URL parser treats a 1-part input as a 32-bit - // integer split into octets, which has surprising semantics (e.g. "127" -> - // "0.0.0.127"). Reject 1-part inputs to keep the helper predictable: the - // fail-safe returns the input unchanged and the comparison layer falls - // through to non-bypass. - if (parts.length === 1) return host; - - // 2..3 parts: literal parts fill from the left, tail fills remaining octets - // from the right with zero-padding. - const literalOctets = parts.slice(0, -1); - const tail = parts[parts.length - 1]; - const tailSlots = 4 - literalOctets.length; - - // Tail is parsed as a full IPv4 number (hex/octal/decimal) and packed - // low-byte-right into the remaining octets, matching Node's URL parser. - // e.g. 127.65535 (tail 0xFFFF into 3 slots) -> 127.0.255.255; - // 127.0x00ff (tail 0xFF into 3 slots) -> 127.0.0.255; - // 127.0.65535 (tail 0xFFFF into 2 slots) -> 127.0.255.255. - const tailValue = parseIPv4Octet(tail); - if (tailValue === null) return host; - const maxTail = (1 << 8 * tailSlots) - 1; - if (tailValue < 0 || tailValue > maxTail) return host; - const tailOctets = new Array(tailSlots).fill(0); - for (let i = tailSlots - 1, v = tailValue; i >= 0; i--, v >>= 8) { - tailOctets[i] = v & 0xff; - } - const literal = literalOctets.map(parseIPv4Octet); - if (literal.some(n => n === null || n < 0 || n > 255)) return host; - return [...literal, ...tailOctets].join('.'); -}; -const isIPv6ZeroGroup = group => /^0{1,4}$/.test(group); - -// The unspecified address (IPv4 0.0.0.0 / IPv6 ::) resolves to the local host -// for outbound connections, so treat it as loopback-equivalent for NO_PROXY -// matching. 0.0.0.0 is covered by LOOPBACK_HOSTNAMES; this handles compressed -// and full IPv6 all-zero forms so both families bypass symmetrically. -const isIPv6Unspecified = host => { - if (host === '::') return true; - const compressionIndex = host.indexOf('::'); - if (compressionIndex !== -1) { - if (compressionIndex !== host.lastIndexOf('::')) return false; - const left = host.slice(0, compressionIndex); - const right = host.slice(compressionIndex + 2); - const leftGroups = left ? left.split(':') : []; - const rightGroups = right ? right.split(':') : []; - const explicitGroups = leftGroups.length + rightGroups.length; - return explicitGroups < 8 && leftGroups.every(isIPv6ZeroGroup) && rightGroups.every(isIPv6ZeroGroup); - } - const groups = host.split(':'); - return groups.length === 8 && groups.every(isIPv6ZeroGroup); -}; -const isIPv6Loopback = host => { - // Collapse all-zero groups: any form of ::1 / 0:0:...:0:1 - // First, strip any leading "::" by normalising with Set lookup of common forms, - // then fall back to structural check. - if (host === '::1') return true; - - // Check IPv4-mapped IPv6 loopback: ::ffff: or ::ffff: - // Node's URL parser normalises ::ffff:127.0.0.1 → ::ffff:7f00:1 - const v4MappedDotted = host.match(/^::ffff:(\d+\.\d+\.\d+\.\d+)$/i); - if (v4MappedDotted) return isIPv4Loopback(v4MappedDotted[1]); - const v4MappedHex = host.match(/^::ffff:([0-9a-f]{1,4}):([0-9a-f]{1,4})$/i); - if (v4MappedHex) { - const high = parseInt(v4MappedHex[1], 16); - // High 16 bits must start with 127 (0x7f) — i.e. 0x7f00..0x7fff - return high >= 0x7f00 && high <= 0x7fff; - } - - // Full-form ::1 variants: any number of zero groups followed by trailing 1 - // e.g. 0:0:0:0:0:0:0:1, 0000:...:0001 - const groups = host.split(':'); - if (groups.length === 8) { - for (let i = 0; i < 7; i++) { - if (!/^0+$/.test(groups[i])) return false; - } - return /^0*1$/.test(groups[7]); - } - return false; -}; -const isLoopback = host => { - if (!host) return false; - if (LOOPBACK_HOSTNAMES.has(host)) return true; - if (isIPv4Loopback(host)) return true; - if (isIPv6Unspecified(host)) return true; - return isIPv6Loopback(host); -}; -const DEFAULT_PORTS = { - http: 80, - https: 443, - ws: 80, - wss: 443, - ftp: 21 -}; -const parseNoProxyEntry = entry => { - let entryHost = entry; - let entryPort = 0; - if (entryHost.charAt(0) === '[') { - const bracketIndex = entryHost.indexOf(']'); - if (bracketIndex !== -1) { - const host = entryHost.slice(1, bracketIndex); - const rest = entryHost.slice(bracketIndex + 1); - if (rest.charAt(0) === ':' && /^\d+$/.test(rest.slice(1))) { - entryPort = Number.parseInt(rest.slice(1), 10); - } - return [host, entryPort]; - } - } - const firstColon = entryHost.indexOf(':'); - const lastColon = entryHost.lastIndexOf(':'); - if (firstColon !== -1 && firstColon === lastColon && /^\d+$/.test(entryHost.slice(lastColon + 1))) { - entryPort = Number.parseInt(entryHost.slice(lastColon + 1), 10); - entryHost = entryHost.slice(0, lastColon); - } - return [entryHost, entryPort]; -}; - -// Convert IPv4-mapped IPv6 (::ffff:0:0/96 prefix) to IPv4 dotted form so both -// sides of a NO_PROXY comparison see the same canonical address. Without this, -// `NO_PROXY=192.168.1.5` would not match a request to `http://[::ffff:192.168.1.5]/` -// (Node's URL parser normalises that to `[::ffff:c0a8:105]`), and vice-versa, -// allowing the proxy-bypass policy to be circumvented by using the alternate -// representation. Returns the input unchanged when not IPv4-mapped. -const IPV4_MAPPED_DOTTED_RE = /^(?:::|(?:0{1,4}:){1,4}:|(?:0{1,4}:){5})ffff:(\d+\.\d+\.\d+\.\d+)$/i; -const IPV4_MAPPED_HEX_RE = /^(?:::|(?:0{1,4}:){1,4}:|(?:0{1,4}:){5})ffff:([0-9a-f]{1,4}):([0-9a-f]{1,4})$/i; -const unmapIPv4MappedIPv6 = host => { - if (typeof host !== 'string' || host.indexOf(':') === -1) return host; - const dotted = host.match(IPV4_MAPPED_DOTTED_RE); - if (dotted) return dotted[1]; - const hex = host.match(IPV4_MAPPED_HEX_RE); - if (hex) { - const high = parseInt(hex[1], 16); - const low = parseInt(hex[2], 16); - return `${high >> 8}.${high & 0xff}.${low >> 8}.${low & 0xff}`; - } - return host; -}; -const normalizeNoProxyHost = hostname => { - if (!hostname) { - return hostname; - } - if (hostname.charAt(0) === '[' && hostname.charAt(hostname.length - 1) === ']') { - hostname = hostname.slice(1, -1); - } - const trimmed = hostname.replace(/\.+$/, ''); - - // IPv4 shorthand/octal/hex → dotted-decimal; helper is a no-op for inputs - // containing ':' (IPv6 and IPv4-mapped IPv6) so we fall through to unmap. - const ipv4 = normalizeIPAddress(trimmed); - if (ipv4 !== trimmed) { - return ipv4; - } - return unmapIPv4MappedIPv6(trimmed); -}; -function shouldBypassProxy(location) { - let parsed; - try { - parsed = new URL(location); - } catch (_err) { - return false; - } - const noProxy = (process.env.no_proxy || process.env.NO_PROXY || '').toLowerCase(); - if (!noProxy) { - return false; - } - if (noProxy === '*') { - return true; - } - const port = Number.parseInt(parsed.port, 10) || DEFAULT_PORTS[parsed.protocol.split(':', 1)[0]] || 0; - const hostname = normalizeNoProxyHost(parsed.hostname.toLowerCase()); - return noProxy.split(/[\s,]+/).some(entry => { - if (!entry) { - return false; - } - if (entry === '*') { - return true; - } - let [entryHost, entryPort] = parseNoProxyEntry(entry); - entryHost = normalizeNoProxyHost(entryHost); - if (!entryHost) { - return false; - } - if (entryPort && entryPort !== port) { - return false; - } - if (entryHost.charAt(0) === '*') { - entryHost = entryHost.slice(1); - } - if (entryHost.charAt(0) === '.') { - return hostname.endsWith(entryHost); - } - return hostname === entryHost || isLoopback(hostname) && isLoopback(entryHost); - }); -} - -/** - * Calculate data maxRate - * @param {Number} [samplesCount= 10] - * @param {Number} [min= 1000] - * @returns {Function} - */ -function speedometer(samplesCount, min) { - samplesCount = samplesCount || 10; - const bytes = new Array(samplesCount); - const timestamps = new Array(samplesCount); - let head = 0; - let tail = 0; - let firstSampleTS; - min = min !== undefined ? min : 1000; - return function push(chunkLength) { - const now = Date.now(); - const startedAt = timestamps[tail]; - if (!firstSampleTS) { - firstSampleTS = now; - } - bytes[head] = chunkLength; - timestamps[head] = now; - let i = tail; - let bytesCount = 0; - while (i !== head) { - bytesCount += bytes[i++]; - i = i % samplesCount; - } - head = (head + 1) % samplesCount; - if (head === tail) { - tail = (tail + 1) % samplesCount; - } - if (now - firstSampleTS < min) { - return; - } - const passed = startedAt && now - startedAt; - return passed ? Math.round(bytesCount * 1000 / passed) : undefined; - }; -} - -/** - * Throttle decorator - * @param {Function} fn - * @param {Number} freq - * @return {Function} - */ -function throttle(fn, freq) { - let timestamp = 0; - let threshold = 1000 / freq; - let lastArgs; - let timer; - const invoke = (args, now = Date.now()) => { - timestamp = now; - lastArgs = null; - if (timer) { - clearTimeout(timer); - timer = null; - } - fn(...args); - }; - const throttled = (...args) => { - const now = Date.now(); - const passed = now - timestamp; - if (passed >= threshold) { - invoke(args, now); - } else { - lastArgs = args; - if (!timer) { - timer = setTimeout(() => { - timer = null; - invoke(lastArgs); - }, threshold - passed); - } - } - }; - const flush = () => lastArgs && invoke(lastArgs); - return [throttled, flush]; -} - -const progressEventReducer = (listener, isDownloadStream, freq = 3) => { - let bytesNotified = 0; - const _speedometer = speedometer(50, 250); - return throttle(e => { - if (!e || typeof e.loaded !== 'number') { - return; - } - const rawLoaded = e.loaded; - const total = e.lengthComputable ? e.total : undefined; - const loaded = Math.max(0, total != null ? Math.min(rawLoaded, total) : rawLoaded); - const progressBytes = Math.max(0, loaded - bytesNotified); - const rate = _speedometer(progressBytes); - bytesNotified = Math.max(bytesNotified, loaded); - const data = { - loaded, - total, - progress: total ? loaded / total : undefined, - bytes: progressBytes, - rate: rate ? rate : undefined, - estimated: rate && total ? (total - loaded) / rate : undefined, - event: e, - lengthComputable: total != null, - [isDownloadStream ? 'download' : 'upload']: true - }; - listener(data); - }, freq); -}; -const progressEventDecorator = (total, throttled) => { - const lengthComputable = total != null; - return [loaded => throttled[0]({ - lengthComputable, - total, - loaded - }), throttled[1]]; -}; -const asyncDecorator = (fn, scheduler = utils$1.asap) => (...args) => scheduler(() => fn(...args)); - -/** - * Estimate data: URL byte lengths *without* allocating large buffers. - * - Fetch percent-decodes a base64 body before decoding it. - * - Node's Buffer.from(body, 'base64') sizes its backing allocation from the - * raw body, including ignored characters and content after padding. - * - Non-base64 data is percent-decoded and then encoded as UTF-8. - */ -const isHexDigit = charCode => charCode >= 48 && charCode <= 57 || charCode >= 65 && charCode <= 70 || charCode >= 97 && charCode <= 102; -const isPercentEncodedByte = (str, i, len) => i + 2 < len && isHexDigit(str.charCodeAt(i + 1)) && isHexDigit(str.charCodeAt(i + 2)); -const hexValue = charCode => charCode <= 57 ? charCode - 48 : (charCode & 0xdf) - 55; -const isBase64Char = charCode => charCode >= 65 && charCode <= 90 || -// A-Z -charCode >= 97 && charCode <= 122 || -// a-z -charCode >= 48 && charCode <= 57 || -// 0-9 -charCode === 43 || -// + -charCode === 47 || -// / -charCode === 45 || -// - (base64url) -charCode === 95; // _ (base64url) - -const isBase64Whitespace = charCode => charCode === 9 || charCode === 10 || charCode === 12 || charCode === 13 || charCode === 32; -const base64Bytes = significant => { - const groups = Math.floor(significant / 4); - const remainder = significant % 4; - return groups * 3 + (remainder === 2 ? 1 : remainder === 3 ? 2 : 0); -}; - -// Buffer.byteLength(body, 'base64') uses the raw string length as an allocation -// upper bound even when Buffer.from later ignores characters or stops at '='. -const estimateBase64BufferAllocation = body => { - const len = body.length; - let padding = 0; - if (len > 0 && body.charCodeAt(len - 1) === 61 /* '=' */) { - padding++; - if (len > 1 && body.charCodeAt(len - 2) === 61 /* '=' */) { - padding++; - } - } - return Math.floor((len - padding) * 3 / 4); -}; -const estimatePercentDecodedBase64Bytes = body => { - const len = body.length; - let significant = 0; - let padding = 0; - let invalid = false; - for (let i = 0; i < len; i++) { - let code = body.charCodeAt(i); - if (code === 37 /* '%' */ && isPercentEncodedByte(body, i, len)) { - code = hexValue(body.charCodeAt(i + 1)) * 16 + hexValue(body.charCodeAt(i + 2)); - i += 2; - } - if (isBase64Whitespace(code)) { - continue; - } - if (code === 61 /* '=' */) { - padding++; - continue; - } - if (!isBase64Char(code) || padding > 0) { - invalid = true; - continue; - } - significant++; - } - - // Fetch rejects malformed forgiving-base64 input. Returning the raw-size - // allocation bound keeps that invalid input from becoming a pre-check bypass. - if (invalid || padding > 2 || padding > 0 && (significant + padding) % 4 !== 0 || significant % 4 === 1) { - return estimateBase64BufferAllocation(body); - } - return base64Bytes(significant); -}; -const estimateDataURLBytes = (url, estimateBase64) => { - if (!url || typeof url !== 'string') return 0; - if (!url.startsWith('data:')) return 0; - const comma = url.indexOf(','); - if (comma < 0) return 0; - const meta = url.slice(5, comma); - const body = url.slice(comma + 1); - const isBase64 = /;base64/i.test(meta); - if (isBase64) { - return estimateBase64(body); - } - - // Compute UTF-8 byte length directly from UTF-16 code units without allocating - // a byte buffer (TextEncoder.encode would defeat the DoS guard on large bodies). - // Valid %XX triplets count as one decoded byte; this matches the bytes that - // decodeURIComponent(body) would produce before Buffer re-encodes the string. - let bytes = 0; - for (let i = 0, len = body.length; i < len; i++) { - const c = body.charCodeAt(i); - if (c === 37 /* '%' */ && isPercentEncodedByte(body, i, len)) { - bytes += 1; - i += 2; - } else if (c < 0x80) { - bytes += 1; - } else if (c < 0x800) { - bytes += 2; - } else if (c >= 0xd800 && c <= 0xdbff && i + 1 < len) { - const next = body.charCodeAt(i + 1); - if (next >= 0xdc00 && next <= 0xdfff) { - bytes += 4; - i++; - } else { - bytes += 3; - } - } else { - bytes += 3; - } - } - return bytes; -}; - -/** - * Estimate the percent-decoded payload size used by Fetch data: URLs. - * - * @param {string} url - * @returns {number} - */ -function estimateDataURLDecodedBytes(url) { - // Fetch removes URL fragments before processing a data: URL. - const fragmentIndex = typeof url === 'string' ? url.indexOf('#') : -1; - return estimateDataURLBytes(fragmentIndex === -1 ? url : url.slice(0, fragmentIndex), estimatePercentDecodedBase64Bytes); -} - -/** - * Estimate the Buffer backing allocation used by Node's raw base64 decoder. - * - * @param {string} url - * @returns {number} - */ -function estimateDataURLBufferAllocation(url) { - return estimateDataURLBytes(url, estimateBase64BufferAllocation); -} - -const zlibOptions = { - flush: zlib.constants.Z_SYNC_FLUSH, - finishFlush: zlib.constants.Z_SYNC_FLUSH -}; -const brotliOptions = { - flush: zlib.constants.BROTLI_OPERATION_FLUSH, - finishFlush: zlib.constants.BROTLI_OPERATION_FLUSH -}; -const zstdOptions = { - flush: zlib.constants.ZSTD_e_flush, - finishFlush: zlib.constants.ZSTD_e_flush -}; -const isBrotliSupported = utils$1.isFunction(zlib.createBrotliDecompress); -const isZstdSupported = utils$1.isFunction(zlib.createZstdDecompress); -const ACCEPT_ENCODING = 'gzip, compress, deflate' + (isBrotliSupported ? ', br' : ''); -const ACCEPT_ENCODING_WITH_ZSTD = ACCEPT_ENCODING + (isZstdSupported ? ', zstd' : ''); -const scheduleProgress = typeof process !== 'undefined' && process.nextTick ? process.nextTick.bind(process) : utils$1.asap; -const { - http: httpFollow, - https: httpsFollow -} = followRedirects; -const isHttps = /https:?/; - -// Symbols used to bind a single 'error' listener to a pooled socket and track -// the request currently owning that socket across keep-alive reuse (issue #10780). -const kAxiosSocketListener = Symbol('axios.http.socketListener'); -const kAxiosCurrentReq = Symbol('axios.http.currentReq'); - -// Tags HttpsProxyAgent instances installed by setProxy() so the redirect path -// can strip them without clobbering a user-supplied agent that happens to be -// an HttpsProxyAgent. -const kAxiosInstalledTunnel = Symbol('axios.http.installedTunnel'); - -// Cache of CONNECT-tunneling agents keyed by proxy config so repeat requests -// through the same proxy reuse a single agent (and its socket pool). The -// keyspace is bounded by the set of distinct proxy configs the process uses, -// so unbounded growth is not a concern in practice. -const tunnelingAgentCache = new Map(); -const tunnelingAgentCacheUser = new WeakMap(); -// Minimum minor versions where Node's HTTP Agent supports native proxyEnv -// handling. Checking the selected agent below also covers startup modes such -// as NODE_OPTIONS=--use-env-proxy and --no-use-env-proxy precedence. -const NODE_NATIVE_ENV_PROXY_SUPPORT = { - 22: 21, - 24: 5 -}; -function isNodeNativeEnvProxySupported(nodeVersion = process.versions && process.versions.node) { - if (!nodeVersion) { - return false; - } - const [major, minor] = nodeVersion.split('.').map(part => Number(part)); - if (!Number.isInteger(major) || !Number.isInteger(minor)) { - return false; - } - if (major > 24) { - return true; - } - return NODE_NATIVE_ENV_PROXY_SUPPORT[major] != null && minor >= NODE_NATIVE_ENV_PROXY_SUPPORT[major]; -} -function isNodeEnvProxyEnabled(agent, nodeVersion = process.versions && process.versions.node) { - if (!isNodeNativeEnvProxySupported(nodeVersion)) { - return false; - } - const agentOptions = agent && agent.options; - return Boolean(agentOptions && utils$1.hasOwnProp(agentOptions, 'proxyEnv') && agentOptions.proxyEnv != null); -} -function getProxyEnvAgent(options, configHttpAgent, configHttpsAgent) { - return isHttps.test(options.protocol) ? configHttpsAgent || https.globalAgent : configHttpAgent || http.globalAgent; -} -function getTunnelingAgent(agentOptions, userHttpsAgent) { - const key = agentOptions.protocol + '//' + agentOptions.hostname + ':' + (agentOptions.port || '') + '#' + (agentOptions.auth || ''); - const cache = userHttpsAgent ? tunnelingAgentCacheUser.get(userHttpsAgent) || tunnelingAgentCacheUser.set(userHttpsAgent, new Map()).get(userHttpsAgent) : tunnelingAgentCache; - let agent = cache.get(key); - if (agent) return agent; - // Forward the user's TLS options (custom CA, rejectUnauthorized, client cert, - // etc.) into the tunneling agent so they apply to the origin TLS upgrade - // performed after CONNECT. Our proxy fields take precedence on conflict. - const merged = userHttpsAgent && userHttpsAgent.options ? { - ...userHttpsAgent.options, - ...agentOptions - } : agentOptions; - agent = new HttpsProxyAgent(merged); - if (userHttpsAgent && userHttpsAgent.options) { - const originTLSOptions = { - ...userHttpsAgent.options - }; - const callback = agent.callback; - agent.callback = function axiosTunnelingAgentCallback(req, opts) { - // HttpsProxyAgent v5 reads callback opts for the post-CONNECT origin TLS upgrade. - return callback.call(this, req, { - ...originTLSOptions, - ...opts - }); - }; - } - agent[kAxiosInstalledTunnel] = true; - cache.set(key, agent); - return agent; -} -const supportedProtocols = platform.protocols.map(protocol => { - return protocol + ':'; -}); - -// Node's WHATWG URL parser returns `username` and `password` percent-encoded. -// Decode before composing the `auth` option so credentials such as -// `my%40email.com:pass` are sent as `my@email.com:pass`. Falls back to the -// original value for malformed input so a bad encoding never throws. -const decodeURIComponentSafe$1 = value => { - if (!utils$1.isString(value)) { - return value; - } - try { - return decodeURIComponent(value); - } catch (error) { - return value; - } -}; -const flushOnFinish = (stream, [throttled, flush]) => { - stream.on('end', flush).on('error', flush); - return throttled; -}; -const http2Sessions = new Http2Sessions(); - -/** - * If the proxy, auth, sensitive header, or config beforeRedirects functions are defined, - * call them with the options object. - * - * @param {Object} options - The options object that was passed to the request. - * - * @returns {Object} - */ -function dispatchBeforeRedirect(options, responseDetails, requestDetails) { - if (options.beforeRedirects.proxy) { - options.beforeRedirects.proxy(options); - } - if (options.beforeRedirects.auth) { - options.beforeRedirects.auth(options); - } - if (options.beforeRedirects.sensitiveHeaders) { - options.beforeRedirects.sensitiveHeaders(options, requestDetails); - } - if (options.beforeRedirects.config) { - options.beforeRedirects.config(options, responseDetails, requestDetails); - } -} -function stripMatchingHeaders(headers, sensitiveSet) { - if (!headers) { - return; - } - Object.keys(headers).forEach(header => { - if (sensitiveSet.has(header.toLowerCase())) { - delete headers[header]; - } - }); -} -function isSameOriginRedirect(redirectOptions, requestDetails) { - if (!requestDetails) { - return false; - } - try { - return new URL(requestDetails.url).origin === new URL(redirectOptions.href).origin; - } catch (e) { - // If origin comparison fails, treat the redirect as unsafe. - return false; - } -} - -/** - * If the proxy or config afterRedirects functions are defined, call them with the options - * - * @param {http.ClientRequestArgs} options - * @param {AxiosProxyConfig} configProxy configuration from Axios options object - * @param {string} location - * - * @returns {http.ClientRequestArgs} - */ -function setProxy(options, configProxy, location, isRedirect, configHttpsAgent, configHttpAgent) { - let proxy = configProxy; - const proxyEnvAgent = getProxyEnvAgent(options, configHttpAgent, configHttpsAgent); - if (!proxy && proxy !== false && !isNodeEnvProxyEnabled(proxyEnvAgent)) { - const proxyUrl = getProxyForUrl(location); - if (proxyUrl) { - if (!shouldBypassProxy(location)) { - proxy = new URL(proxyUrl); - } - } - } - // On redirect re-invocation, strip any stale Proxy-Authorization header carried - // over from the prior request (e.g. new target no longer uses a proxy, or uses - // a different proxy). Skip on the initial request so user-supplied headers are - // preserved. Header names are case-insensitive, so remove every case variant. - if (isRedirect && options.headers) { - for (const name of Object.keys(options.headers)) { - if (name.toLowerCase() === 'proxy-authorization') { - delete options.headers[name]; - } - } - } - // Strip any tunneling agent we installed for the previous hop so a redirect - // that drops the proxy or crosses an HTTPS↔HTTP boundary doesn't reuse a - // stale one. Match on our Symbol marker so a user-supplied HttpsProxyAgent - // (which won't carry the marker) is left alone. - if (isRedirect && options.agent && options.agent[kAxiosInstalledTunnel]) { - options.agent = undefined; - } - if (proxy) { - // Read proxy fields without traversing the prototype chain. URL instances expose - // username/password/hostname/host/port/protocol via getters on URL.prototype (so - // direct reads are shielded), but plain object proxies — and the `auth` field - // (which URL does not expose) — must be guarded so a polluted Object.prototype - // (e.g. Object.prototype.auth = { username, password }) cannot inject - // attacker-controlled credentials into the Proxy-Authorization header or - // redirect proxying to an attacker-controlled host. - const isProxyURL = proxy instanceof URL; - const readProxyField = key => isProxyURL || utils$1.hasOwnProp(proxy, key) ? proxy[key] : undefined; - const proxyUsername = readProxyField('username'); - const proxyPassword = readProxyField('password'); - let proxyAuth = utils$1.hasOwnProp(proxy, 'auth') ? proxy.auth : undefined; - - // Basic proxy authorization - if (proxyUsername) { - proxyAuth = (proxyUsername || '') + ':' + (proxyPassword || ''); - } - if (proxyAuth) { - // Support proxy auth object form. Read sub-fields via own-prop checks so a - // plain object inheriting from polluted Object.prototype cannot leak creds. - const authIsObject = typeof proxyAuth === 'object'; - const authUsername = authIsObject && utils$1.hasOwnProp(proxyAuth, 'username') ? proxyAuth.username : undefined; - const authPassword = authIsObject && utils$1.hasOwnProp(proxyAuth, 'password') ? proxyAuth.password : undefined; - const validProxyAuth = Boolean(authUsername || authPassword); - if (validProxyAuth) { - proxyAuth = (authUsername || '') + ':' + (authPassword || ''); - } else if (authIsObject) { - throw new AxiosError('Invalid proxy authorization', AxiosError.ERR_BAD_OPTION, { - proxy - }); - } - } - const targetIsHttps = isHttps.test(options.protocol); - if (targetIsHttps) { - // CONNECT-tunneling path for HTTPS targets. Preserves end-to-end TLS to - // the origin so the proxy cannot inspect the URL, headers, or body — the - // behavior already promised by THREATMODEL.md (T-R9). HttpsProxyAgent - // sends Proxy-Authorization on the CONNECT request only, never on the - // wrapped TLS request, which is why we don't stamp it onto - // options.headers here. If the user already supplied an HttpsProxyAgent, - // they own tunneling end-to-end and we leave them alone; otherwise we - // install our own tunneling agent and forward their TLS options (if any) - // so a custom httpsAgent for cert pinning / rejectUnauthorized still - // applies to the origin TLS upgrade. - if (!(configHttpsAgent instanceof HttpsProxyAgent)) { - const proxyHost = readProxyField('hostname') || readProxyField('host'); - const proxyPort = readProxyField('port'); - const rawProxyProtocol = readProxyField('protocol'); - const normalizedProtocol = rawProxyProtocol ? rawProxyProtocol.includes(':') ? rawProxyProtocol : `${rawProxyProtocol}:` : 'http:'; - // Bracket IPv6 literals for URL parsing; URL.hostname strips the - // brackets again on read so the agent receives the raw form. - const proxyHostForURL = proxyHost && proxyHost.includes(':') && !proxyHost.startsWith('[') ? `[${proxyHost}]` : proxyHost; - const proxyURL = new URL(`${normalizedProtocol}//${proxyHostForURL}${proxyPort ? ':' + proxyPort : ''}`); - const agentOptions = { - protocol: proxyURL.protocol, - hostname: proxyURL.hostname.replace(/^\[|\]$/g, ''), - port: proxyURL.port, - auth: proxyAuth && typeof proxyAuth === 'string' ? proxyAuth : undefined - }; - if (proxyURL.protocol === 'https:') { - agentOptions.ALPNProtocols = ['http/1.1']; - } - const tunnelingAgent = getTunnelingAgent(agentOptions, configHttpsAgent); - // Set both: `options.agent` is consumed by the native https.request path - // (maxRedirects === 0); `options.agents.https` is consumed by - // follow-redirects, which ignores `options.agent` when `options.agents` - // is present. - options.agent = tunnelingAgent; - if (options.agents) { - options.agents.https = tunnelingAgent; - } - } - } else { - // Forward-proxy mode for plaintext HTTP targets. The request line carries - // the absolute URL and the proxy sees everything — acceptable for plain - // HTTP since the wire was already plaintext. - if (proxyAuth) { - const base64 = Buffer.from(proxyAuth, 'utf8').toString('base64'); - options.headers['Proxy-Authorization'] = 'Basic ' + base64; - } - - // Preserve a user-supplied Host header (case-insensitive) so callers can override - // the value forwarded to the proxy; otherwise default to the request URL's host. - let hasUserHostHeader = false; - for (const name of Object.keys(options.headers)) { - if (name.toLowerCase() === 'host') { - hasUserHostHeader = true; - break; - } - } - if (!hasUserHostHeader) { - options.headers.host = options.hostname + (options.port ? ':' + options.port : ''); - } - const proxyHost = readProxyField('hostname') || readProxyField('host'); - options.hostname = proxyHost; - // Replace 'host' since options is not a URL object - options.host = proxyHost; - options.port = readProxyField('port'); - options.path = location; - const proxyProtocol = readProxyField('protocol'); - if (proxyProtocol) { - options.protocol = proxyProtocol.includes(':') ? proxyProtocol : `${proxyProtocol}:`; - } - } - } - options.beforeRedirects.proxy = function beforeRedirect(redirectOptions) { - // Configure proxy for redirected request, passing the original config proxy to apply - // the exact same logic as if the redirected request was performed by axios directly. - setProxy(redirectOptions, configProxy, redirectOptions.href, true, configHttpsAgent, configHttpAgent); - }; -} -const isHttpAdapterSupported = typeof process !== 'undefined' && utils$1.kindOf(process) === 'process'; - -// temporary hotfix - -const wrapAsync = asyncExecutor => { - return new Promise((resolve, reject) => { - let onDone; - let isDone; - const done = (value, isRejected) => { - if (isDone) return; - isDone = true; - onDone && onDone(value, isRejected); - }; - const _resolve = value => { - done(value); - resolve(value); - }; - const _reject = reason => { - done(reason, true); - reject(reason); - }; - asyncExecutor(_resolve, _reject, onDoneHandler => onDone = onDoneHandler).catch(_reject); - }); -}; -const resolveFamily = ({ - address, - family -}) => { - if (!utils$1.isString(address)) { - throw TypeError('address must be a string'); - } - return { - address, - family: family || (address.indexOf('.') < 0 ? 6 : 4) - }; -}; -const buildAddressEntry = (address, family) => resolveFamily(utils$1.isObject(address) ? address : { - address, - family -}); -const http2Transport = { - request(options, cb) { - const authority = options.protocol + '//' + options.hostname + ':' + (options.port || (options.protocol === 'https:' ? 443 : 80)); - const { - http2Options, - headers - } = options; - const session = http2Sessions.getSession(authority, http2Options); - const { - HTTP2_HEADER_SCHEME, - HTTP2_HEADER_METHOD, - HTTP2_HEADER_PATH, - HTTP2_HEADER_STATUS - } = http2.constants; - const http2Headers = { - [HTTP2_HEADER_SCHEME]: options.protocol.replace(':', ''), - [HTTP2_HEADER_METHOD]: options.method, - [HTTP2_HEADER_PATH]: options.path - }; - utils$1.forEach(headers, (header, name) => { - name.charAt(0) !== ':' && (http2Headers[name] = header); - }); - const req = session.request(http2Headers); - req.once('response', responseHeaders => { - const response = req; //duplex - - responseHeaders = Object.assign({}, responseHeaders); - const status = responseHeaders[HTTP2_HEADER_STATUS]; - delete responseHeaders[HTTP2_HEADER_STATUS]; - response.headers = responseHeaders; - response.statusCode = +status; - cb(response); - }); - return req; - } -}; - -/*eslint consistent-return:0*/ -var httpAdapter = isHttpAdapterSupported && function httpAdapter(config) { - return wrapAsync(async function dispatchHttpRequest(resolve, reject, onDone) { - // Read config pollution-safely: own properties and members inherited from - // a non-Object.prototype source (e.g. an Object.create(defaults) template) - // are honored, but values injected onto a polluted Object.prototype are - // ignored. All behavior-affecting reads in this adapter go through own() - // so the protection boundary stays consistent. - const own = key => utils$1.getSafeProp(config, key); - const transitional = own('transitional') || transitionalDefaults; - let data = own('data'); - let lookup = own('lookup'); - let family = own('family'); - let httpVersion = own('httpVersion'); - if (httpVersion === undefined) httpVersion = 1; - let http2Options = own('http2Options'); - const httpAgent = own('httpAgent'); - const httpsAgent = own('httpsAgent'); - const configProxy = own('proxy'); - const responseType = own('responseType'); - const responseEncoding = own('responseEncoding'); - const socketPath = own('socketPath'); - const method = own('method').toUpperCase(); - const maxRedirects = own('maxRedirects'); - const maxBodyLength = own('maxBodyLength'); - const maxContentLength = own('maxContentLength'); - const decompress = own('decompress'); - let isDone; - let rejected = false; - let req; - let connectPhaseTimer; - httpVersion = +httpVersion; - if (Number.isNaN(httpVersion)) { - throw TypeError(`Invalid protocol version: '${config.httpVersion}' is not a number`); - } - if (httpVersion !== 1 && httpVersion !== 2) { - throw TypeError(`Unsupported protocol version '${httpVersion}'`); - } - const isHttp2 = httpVersion === 2; - if (lookup) { - const _lookup = callbackify(lookup, value => utils$1.isArray(value) ? value : [value]); - // hotfix to support opt.all option which is required for node 20.x - lookup = (hostname, opt, cb) => { - _lookup(hostname, opt, (err, arg0, arg1) => { - if (err) { - return cb(err); - } - const addresses = utils$1.isArray(arg0) ? arg0.map(addr => buildAddressEntry(addr)) : [buildAddressEntry(arg0, arg1)]; - opt.all ? cb(err, addresses) : cb(err, addresses[0].address, addresses[0].family); - }); - }; - } - const abortEmitter = new events.EventEmitter(); - function abort(reason) { - try { - abortEmitter.emit('abort', !reason || reason.type ? new CanceledError(null, config, req) : reason); - } catch (err) { - // ignore emit errors - } - } - function clearConnectPhaseTimer() { - if (connectPhaseTimer) { - clearTimeout(connectPhaseTimer); - connectPhaseTimer = null; - } - } - function createTimeoutError() { - const configTimeout = own('timeout'); - let timeoutErrorMessage = configTimeout ? 'timeout of ' + configTimeout + 'ms exceeded' : 'timeout exceeded'; - const configTimeoutErrorMessage = own('timeoutErrorMessage'); - if (configTimeoutErrorMessage) { - timeoutErrorMessage = configTimeoutErrorMessage; - } - return new AxiosError(timeoutErrorMessage, transitional.clarifyTimeoutError ? AxiosError.ETIMEDOUT : AxiosError.ECONNABORTED, config, req); - } - abortEmitter.once('abort', reject); - const onFinished = () => { - clearConnectPhaseTimer(); - if (config.cancelToken) { - config.cancelToken.unsubscribe(abort); - } - if (config.signal) { - config.signal.removeEventListener('abort', abort); - } - abortEmitter.removeAllListeners(); - }; - if (config.cancelToken || config.signal) { - config.cancelToken && config.cancelToken.subscribe(abort); - if (config.signal) { - config.signal.aborted ? abort() : config.signal.addEventListener('abort', abort); - } - } - onDone((response, isRejected) => { - isDone = true; - clearConnectPhaseTimer(); - if (isRejected) { - rejected = true; - onFinished(); - return; - } - const { - data - } = response; - if (data instanceof stream.Readable || data instanceof stream.Duplex) { - const offListeners = stream.finished(data, () => { - offListeners(); - onFinished(); - }); - } else { - onFinished(); - } - }); - - // Parse url - const fullPath = buildFullPath(own('baseURL'), own('url'), own('allowAbsoluteUrls'), config); - // Unix-socket requests (own socketPath) commonly pass a path-only url - // like '/foo'; supply a synthetic base so new URL() can still parse it. - // Use the own-property value (not config.socketPath) so a polluted - // prototype cannot influence URL base selection. - const urlBase = socketPath ? 'http://localhost' : platform.hasBrowserEnv ? platform.origin : undefined; - const parsed = new URL(fullPath, urlBase); - const protocol = parsed.protocol || supportedProtocols[0]; - if (protocol === 'data:') { - // Apply the same semantics as HTTP: only enforce if a finite, non-negative cap is set. - if (maxContentLength > -1) { - // Use the exact string passed to fromDataURI (the configured url); fall back to fullPath if needed. - const dataUrl = String(own('url') || fullPath || ''); - const estimated = estimateDataURLBufferAllocation(dataUrl); - if (estimated > maxContentLength) { - return reject(new AxiosError('maxContentLength size of ' + maxContentLength + ' exceeded', AxiosError.ERR_BAD_RESPONSE, config)); - } - } - let convertedData; - if (method !== 'GET') { - return settle(resolve, reject, { - status: 405, - statusText: 'method not allowed', - headers: {}, - config - }); - } - try { - convertedData = fromDataURI(own('url'), responseType === 'blob', { - Blob: config.env && config.env.Blob - }); - } catch (err) { - throw AxiosError.from(err, AxiosError.ERR_BAD_REQUEST, config); - } - if (responseType === 'text') { - convertedData = convertedData.toString(responseEncoding); - if (!responseEncoding || responseEncoding === 'utf8') { - convertedData = utils$1.stripBOM(convertedData); - } - } else if (responseType === 'stream') { - convertedData = stream.Readable.from(convertedData); - } - return settle(resolve, reject, { - data: convertedData, - status: 200, - statusText: 'OK', - headers: new AxiosHeaders(), - config - }); - } - if (supportedProtocols.indexOf(protocol) === -1) { - return reject(new AxiosError('Unsupported protocol ' + protocol, AxiosError.ERR_BAD_REQUEST, config)); - } - const headers = AxiosHeaders.from(config.headers).normalize(); - - // Set User-Agent (required by some servers) - // See https://github.com/axios/axios/issues/69 - // User-Agent is specified; handle case where no UA header is desired - // Only set header if it hasn't been set in config - headers.set('User-Agent', 'axios/' + VERSION, false); - const { - onUploadProgress, - onDownloadProgress - } = config; - const maxRate = config.maxRate; - let maxUploadRate = undefined; - let maxDownloadRate = undefined; - - // support for spec compliant FormData objects - if (utils$1.isSpecCompliantForm(data)) { - const userBoundary = headers.getContentType(/boundary=([-_\w\d]{10,70})/i); - data = formDataToStream(data, formHeaders => { - headers.set(formHeaders); - }, { - tag: `axios-${VERSION}-boundary`, - boundary: userBoundary && userBoundary[1] || undefined - }); - // support for https://www.npmjs.com/package/form-data api - } else if (utils$1.isFormData(data) && utils$1.isFunction(data.getHeaders) && data.getHeaders !== Object.prototype.getHeaders) { - setFormDataHeaders(headers, data.getHeaders(), own('formDataHeaderPolicy')); - if (!headers.hasContentLength()) { - try { - const knownLength = await util.promisify(data.getLength).call(data); - Number.isFinite(knownLength) && knownLength >= 0 && headers.setContentLength(knownLength); - /*eslint no-empty:0*/ - } catch (e) {} - } - } else if (utils$1.isBlob(data) || utils$1.isFile(data)) { - data.size && headers.setContentType(data.type || 'application/octet-stream'); - headers.setContentLength(data.size || 0); - data = stream.Readable.from(readBlob(data)); - } else if (data && !utils$1.isStream(data)) { - if (Buffer.isBuffer(data)) ; else if (utils$1.isArrayBuffer(data)) { - data = Buffer.from(new Uint8Array(data)); - } else if (utils$1.isString(data)) { - data = Buffer.from(data, 'utf-8'); - } else { - return reject(new AxiosError('Data after transformation must be a string, an ArrayBuffer, a Buffer, or a Stream', AxiosError.ERR_BAD_REQUEST, config)); - } - - // Add Content-Length header if data exists - headers.setContentLength(data.length, false); - if (maxBodyLength > -1 && data.length > maxBodyLength) { - return reject(new AxiosError('Request body larger than maxBodyLength limit', AxiosError.ERR_BAD_REQUEST, config)); - } - } - const contentLength = utils$1.toFiniteNumber(headers.getContentLength()); - if (utils$1.isArray(maxRate)) { - maxUploadRate = maxRate[0]; - maxDownloadRate = maxRate[1]; - } else { - maxUploadRate = maxDownloadRate = maxRate; - } - if (data && (onUploadProgress || maxUploadRate)) { - if (!utils$1.isStream(data)) { - data = stream.Readable.from(data, { - objectMode: false - }); - } - data = stream.pipeline([data, new AxiosTransformStream({ - maxRate: utils$1.toFiniteNumber(maxUploadRate) - })], utils$1.noop); - onUploadProgress && data.on('progress', flushOnFinish(data, progressEventDecorator(contentLength, progressEventReducer(asyncDecorator(onUploadProgress, scheduleProgress), false, 3)))); - } - - // HTTP basic authentication - let auth = undefined; - const configAuth = own('auth'); - if (configAuth) { - const username = utils$1.getSafeProp(configAuth, 'username') || ''; - const password = utils$1.getSafeProp(configAuth, 'password') || ''; - auth = username + ':' + password; - } - if (!auth && (parsed.username || parsed.password)) { - const urlUsername = decodeURIComponentSafe$1(parsed.username); - const urlPassword = decodeURIComponentSafe$1(parsed.password); - auth = urlUsername + ':' + urlPassword; - } - auth && headers.delete('authorization'); - let path$1; - try { - path$1 = buildURL(parsed.pathname + parsed.search, own('params'), own('paramsSerializer')).replace(/^\?/, ''); - } catch (err) { - return reject(AxiosError.from(err, AxiosError.ERR_BAD_REQUEST, config, null, null, { - url: own('url'), - exists: true - })); - } - headers.set('Accept-Encoding', utils$1.hasOwnProp(transitional, 'advertiseZstdAcceptEncoding') && transitional.advertiseZstdAcceptEncoding === true ? ACCEPT_ENCODING_WITH_ZSTD : ACCEPT_ENCODING, false); - - // Null-prototype to block prototype pollution gadgets on properties read - // directly by Node's http.request (e.g. insecureHTTPParser, lookup). - const options = Object.assign(Object.create(null), { - path: path$1, - method: method, - headers: toByteStringHeaderObject(headers), - agents: { - http: httpAgent, - https: httpsAgent - }, - auth, - protocol, - family, - beforeRedirect: dispatchBeforeRedirect, - beforeRedirects: Object.create(null), - http2Options - }); - - // cacheable-lookup integration hotfix - !utils$1.isUndefined(lookup) && (options.lookup = lookup); - if (socketPath) { - if (typeof socketPath !== 'string') { - return reject(new AxiosError('socketPath must be a string', AxiosError.ERR_BAD_OPTION_VALUE, config)); - } - const allowedSocketPaths = own('allowedSocketPaths'); - if (allowedSocketPaths != null) { - const allowed = Array.isArray(allowedSocketPaths) ? allowedSocketPaths : [allowedSocketPaths]; - const resolvedSocket = path.resolve(socketPath); - const isAllowed = allowed.some(entry => typeof entry === 'string' && path.resolve(entry) === resolvedSocket); - if (!isAllowed) { - return reject(new AxiosError(`socketPath "${socketPath}" is not permitted by allowedSocketPaths`, AxiosError.ERR_BAD_OPTION_VALUE, config)); - } - } - options.socketPath = socketPath; - } else { - options.hostname = parsed.hostname.startsWith('[') ? parsed.hostname.slice(1, -1) : parsed.hostname; - options.port = parsed.port; - setProxy(options, configProxy, protocol + '//' + parsed.hostname + (parsed.port ? ':' + parsed.port : '') + options.path, false, httpsAgent, httpAgent); - } - let transport; - let isNativeTransport = false; - // True only for the follow-redirects transport, which applies - // options.maxBodyLength itself. Every other transport (http2, native - // http/https, a user-supplied custom transport) needs the explicit - // byte-counting pipeline below to enforce maxBodyLength on streamed uploads. - let transportEnforcesMaxBodyLength = false; - const isHttpsRequest = isHttps.test(options.protocol); - // Don't clobber a CONNECT-tunneling agent installed by setProxy() for an - // HTTPS target. - if (options.agent == null) { - options.agent = isHttpsRequest ? httpsAgent : httpAgent; - } - if (isHttp2) { - transport = http2Transport; - } else { - const configTransport = own('transport'); - if (configTransport) { - transport = configTransport; - } else if (maxRedirects === 0) { - transport = isHttpsRequest ? https : http; - isNativeTransport = true; - } else { - transportEnforcesMaxBodyLength = true; - options.sensitiveHeaders = []; - if (maxRedirects) { - options.maxRedirects = maxRedirects; - } - const configBeforeRedirect = own('beforeRedirect'); - if (configBeforeRedirect) { - options.beforeRedirects.config = configBeforeRedirect; - } - if (auth) { - // Restore HTTP Basic credentials on same-origin redirects only. - // follow-redirects >= 1.15.8 strips Authorization on every redirect (see #6929); - // cross-origin stripping is the documented mitigation for T-R2 in THREATMODEL.md - // and is preserved by deliberately not restoring on origin change. - const requestOrigin = parsed.origin; - const authToRestore = auth; - options.beforeRedirects.auth = function beforeRedirectAuth(redirectOptions) { - try { - if (new URL(redirectOptions.href).origin === requestOrigin) { - redirectOptions.auth = authToRestore; - } - } catch (e) { - // ignore malformed URL: leaving auth stripped is fail-safe - } - }; - } - const sensitiveHeaders = own('sensitiveHeaders'); - if (sensitiveHeaders != null) { - if (!utils$1.isArray(sensitiveHeaders)) { - return reject(new AxiosError('sensitiveHeaders must be an array of strings', AxiosError.ERR_BAD_OPTION_VALUE, config)); - } - const sensitiveSet = new Set(); - for (const header of sensitiveHeaders) { - if (!utils$1.isString(header)) { - return reject(new AxiosError('sensitiveHeaders must be an array of strings', AxiosError.ERR_BAD_OPTION_VALUE, config)); - } - sensitiveSet.add(header.toLowerCase()); - } - if (sensitiveSet.size) { - options.sensitiveHeaders = Array.from(sensitiveSet); - options.beforeRedirects.sensitiveHeaders = function beforeRedirectSensitiveHeaders(redirectOptions, requestDetails) { - if (!isSameOriginRedirect(redirectOptions, requestDetails)) { - stripMatchingHeaders(redirectOptions.headers, sensitiveSet); - } - }; - } - } - transport = isHttpsRequest ? httpsFollow : httpFollow; - } - } - - // Set an explicit maxBodyLength option for transports that inspect it. - // When maxBodyLength is -1 (default/unlimited), use Infinity so - // follow-redirects does not fall back to its own 10MB default. - if (maxBodyLength > -1) { - options.maxBodyLength = maxBodyLength; - } else { - options.maxBodyLength = Infinity; - } - - // Always set an explicit own value so a polluted - // Object.prototype.insecureHTTPParser cannot enable the lenient parser - // through Node's internal options copy - options.insecureHTTPParser = Boolean(own('insecureHTTPParser')); - - // Create the request - req = transport.request(options, function handleResponse(res) { - clearConnectPhaseTimer(); - if (req.destroyed) return; - const streams = [res]; - const responseLength = utils$1.toFiniteNumber(res.headers['content-length']); - if (onDownloadProgress || maxDownloadRate) { - const transformStream = new AxiosTransformStream({ - maxRate: utils$1.toFiniteNumber(maxDownloadRate) - }); - onDownloadProgress && transformStream.on('progress', flushOnFinish(transformStream, progressEventDecorator(responseLength, progressEventReducer(asyncDecorator(onDownloadProgress, scheduleProgress), true, 3)))); - streams.push(transformStream); - } - - // decompress the response body transparently if required - let responseStream = res; - - // return the last request in case of redirects - const lastRequest = res.req || req; - - // if decompress disabled we should not decompress - if (decompress !== false && res.headers['content-encoding']) { - // if no content, but headers still say that it is encoded, - // remove the header not confuse downstream operations - if (method === 'HEAD' || res.statusCode === 204) { - delete res.headers['content-encoding']; - } - switch ((res.headers['content-encoding'] || '').toLowerCase()) { - /*eslint default-case:0*/ - case 'gzip': - case 'x-gzip': - case 'compress': - case 'x-compress': - // add the unzipper to the body stream processing pipeline - streams.push(zlib.createUnzip(zlibOptions)); - - // remove the content-encoding in order to not confuse downstream operations - delete res.headers['content-encoding']; - break; - case 'deflate': - streams.push(new ZlibHeaderTransformStream()); - - // add the unzipper to the body stream processing pipeline - streams.push(zlib.createUnzip(zlibOptions)); - - // remove the content-encoding in order to not confuse downstream operations - delete res.headers['content-encoding']; - break; - case 'br': - if (isBrotliSupported) { - streams.push(zlib.createBrotliDecompress(brotliOptions)); - delete res.headers['content-encoding']; - } - break; - case 'zstd': - if (isZstdSupported) { - streams.push(zlib.createZstdDecompress(zstdOptions)); - delete res.headers['content-encoding']; - } - break; - } - } - responseStream = streams.length > 1 ? stream.pipeline(streams, utils$1.noop) : streams[0]; - const response = { - status: res.statusCode, - statusText: res.statusMessage, - headers: new AxiosHeaders(res.headers), - config, - request: lastRequest - }; - if (responseType === 'stream') { - // Enforce maxContentLength on streamed responses; previously this - // was applied only to buffered responses. - if (maxContentLength > -1) { - const limit = maxContentLength; - const source = responseStream; - async function* enforceMaxContentLength() { - let totalResponseBytes = 0; - for await (const chunk of source) { - totalResponseBytes += chunk.length; - if (totalResponseBytes > limit) { - throw new AxiosError('maxContentLength size of ' + limit + ' exceeded', AxiosError.ERR_BAD_RESPONSE, config, lastRequest); - } - yield chunk; - } - } - responseStream = stream.Readable.from(enforceMaxContentLength(), { - objectMode: false - }); - } - response.data = responseStream; - settle(resolve, reject, response); - } else { - const responseBuffer = []; - let totalResponseBytes = 0; - responseStream.on('data', function handleStreamData(chunk) { - responseBuffer.push(chunk); - totalResponseBytes += chunk.length; - - // make sure the content length is not over the maxContentLength if specified - if (maxContentLength > -1 && totalResponseBytes > maxContentLength) { - // stream.destroy() emit aborted event before calling reject() on Node.js v16 - rejected = true; - responseStream.destroy(); - abort(new AxiosError('maxContentLength size of ' + maxContentLength + ' exceeded', AxiosError.ERR_BAD_RESPONSE, config, lastRequest)); - } - }); - responseStream.on('aborted', function handlerStreamAborted() { - if (rejected) { - return; - } - const err = new AxiosError('stream has been aborted', AxiosError.ERR_BAD_RESPONSE, config, lastRequest, response); - responseStream.destroy(err); - reject(err); - }); - responseStream.on('error', function handleStreamError(err) { - if (rejected) return; - reject(AxiosError.from(err, null, config, lastRequest, response)); - }); - responseStream.on('end', function handleStreamEnd() { - try { - let responseData = responseBuffer.length === 1 ? responseBuffer[0] : Buffer.concat(responseBuffer); - if (responseType !== 'arraybuffer') { - responseData = responseData.toString(responseEncoding); - if (!responseEncoding || responseEncoding === 'utf8') { - responseData = utils$1.stripBOM(responseData); - } - } - response.data = responseData; - } catch (err) { - return reject(AxiosError.from(err, null, config, response.request, response)); - } - settle(resolve, reject, response); - }); - } - abortEmitter.once('abort', err => { - if (!responseStream.destroyed) { - responseStream.emit('error', err); - responseStream.destroy(); - } - }); - }); - abortEmitter.once('abort', err => { - if (req.close) { - req.close(); - } else { - req.destroy(err); - } - }); - - // Handle errors - req.on('error', function handleRequestError(err) { - reject(AxiosError.from(err, null, config, req)); - }); - - // set tcp keep alive to prevent drop connection by peer - // Track every socket bound to this outer RedirectableRequest so a single - // 'close' listener can release ownership on all of them. follow-redirects - // re-emits the 'socket' event for each hop's native request onto the same - // outer request, so attaching per-request listeners inside this handler - // would accumulate across hops and trigger MaxListenersExceededWarning at - // >= 11 redirects. Clearing only the last-bound socket would leave stale - // kAxiosCurrentReq refs on earlier hop sockets returned to the keep-alive - // pool, causing an idle-pool 'error' to be attributed to a closed req. - const boundSockets = new Set(); - req.on('socket', function handleRequestSocket(socket) { - // default interval of sending ack packet is 1 minute - // proxy agents (e.g. agent-base) may return a generic Duplex stream - // that doesn't have setKeepAlive, so guard before calling - if (typeof socket.setKeepAlive === 'function') { - socket.setKeepAlive(true, 1000 * 60); - } - - // Install a single 'error' listener per socket (not per request) to avoid - // accumulating listeners on pooled keep-alive sockets that get reassigned - // to new requests before the previous request's 'close' fires (issue #10780). - // The listener is bound to the socket's currently-active request via a - // symbol, which is swapped as the socket is reassigned. - if (!socket[kAxiosSocketListener]) { - socket.on('error', function handleSocketError(err) { - const current = socket[kAxiosCurrentReq]; - if (current && !current.destroyed) { - current.destroy(err); - } - }); - socket[kAxiosSocketListener] = true; - } - socket[kAxiosCurrentReq] = req; - boundSockets.add(socket); - }); - req.once('close', function clearCurrentReq() { - clearConnectPhaseTimer(); - for (const socket of boundSockets) { - if (socket[kAxiosCurrentReq] === req) { - socket[kAxiosCurrentReq] = null; - } - } - boundSockets.clear(); - }); - - // Handle request timeout - if (own('timeout')) { - // This is forcing a int timeout to avoid problems if the `req` interface doesn't handle other types. - const timeout = parseInt(own('timeout'), 10); - if (Number.isNaN(timeout)) { - abort(new AxiosError('error trying to parse `config.timeout` to int', AxiosError.ERR_BAD_OPTION_VALUE, config, req)); - return; - } - const handleTimeout = function handleTimeout() { - if (isDone) return; - abort(createTimeoutError()); - }; - if (isNativeTransport && timeout > 0) { - // Native ClientRequest#setTimeout starts from the socket lifecycle and - // may not fire while TCP connect is still pending. Mirror the - // follow-redirects wall-clock timer for the maxRedirects === 0 path. - connectPhaseTimer = setTimeout(handleTimeout, timeout); - } - - // Sometime, the response will be very slow, and does not respond, the connect event will be block by event loop system. - // And timer callback will be fired, and abort() will be invoked before connection, then get "socket hang up" and code ECONNRESET. - // At this time, if we have a large number of request, nodejs will hang up some socket on background. and the number will up and up. - // And then these socket which be hang up will devouring CPU little by little. - // ClientRequest.setTimeout will be fired on the specify milliseconds, and can make sure that abort() will be fired after connect. - req.setTimeout(timeout, handleTimeout); - } else { - // explicitly reset the socket timeout value for a possible `keep-alive` request - req.setTimeout(0); - } - - // Send the request - if (utils$1.isStream(data)) { - let ended = false; - let errored = false; - data.on('end', () => { - ended = true; - }); - data.once('error', err => { - errored = true; - req.destroy(err); - }); - data.on('close', () => { - if (!ended && !errored) { - abort(new CanceledError('Request stream has been aborted', config, req)); - } - }); - - // Enforce maxBodyLength for streamed uploads on every transport that - // does not apply options.maxBodyLength itself (native http/https, http2, - // and user-supplied custom transports). The follow-redirects transport - // enforces it on the redirected HTTP/1 path. - let uploadStream = data; - if (maxBodyLength > -1 && !transportEnforcesMaxBodyLength) { - const limit = maxBodyLength; - let bytesSent = 0; - uploadStream = stream.pipeline([data, new stream.Transform({ - transform(chunk, _enc, cb) { - bytesSent += chunk.length; - if (bytesSent > limit) { - return cb(new AxiosError('Request body larger than maxBodyLength limit', AxiosError.ERR_BAD_REQUEST, config, req)); - } - cb(null, chunk); - } - })], utils$1.noop); - uploadStream.on('error', err => { - if (!req.destroyed) req.destroy(err); - }); - } - uploadStream.pipe(req); - } else { - data && req.write(data); - req.end(); - } - }); -}; - -var isURLSameOrigin = platform.hasStandardBrowserEnv ? ((origin, isMSIE) => url => { - url = new URL(url, platform.origin); - return origin.protocol === url.protocol && origin.host === url.host && (isMSIE || origin.port === url.port); -})(new URL(platform.origin), platform.navigator && /(msie|trident)/i.test(platform.navigator.userAgent)) : () => true; - -var cookies = platform.hasStandardBrowserEnv ? -// Standard browser envs support document.cookie -{ - write(name, value, expires, path, domain, secure, sameSite) { - if (typeof document === 'undefined') return; - const cookie = [`${name}=${encodeURIComponent(value)}`]; - if (utils$1.isNumber(expires)) { - cookie.push(`expires=${new Date(expires).toUTCString()}`); - } - if (utils$1.isString(path)) { - cookie.push(`path=${path}`); - } - if (utils$1.isString(domain)) { - cookie.push(`domain=${domain}`); - } - if (secure === true) { - cookie.push('secure'); - } - if (utils$1.isString(sameSite)) { - cookie.push(`SameSite=${sameSite}`); - } - document.cookie = cookie.join('; '); - }, - read(name) { - if (typeof document === 'undefined') return null; - // Match name=value by splitting on the semicolon separator instead of building a - // RegExp from `name` — interpolating an unescaped string into a RegExp would let - // metacharacters (e.g. `.+?` in an attacker-influenced cookie name) cause ReDoS or - // match the wrong cookie. Browsers may serialize cookie pairs as either ";" or - // "; ", so ignore optional whitespace before each cookie name. - const cookies = document.cookie.split(';'); - for (let i = 0; i < cookies.length; i++) { - const cookie = cookies[i].replace(/^\s+/, ''); - const eq = cookie.indexOf('='); - if (eq !== -1 && cookie.slice(0, eq) === name) { - try { - return decodeURIComponent(cookie.slice(eq + 1)); - } catch (e) { - return cookie.slice(eq + 1); - } - } - } - return null; - }, - remove(name) { - this.write(name, '', Date.now() - 86400000, '/'); - } -} : -// Non-standard browser env (web workers, react-native) lack needed support. -{ - write() {}, - read() { - return null; - }, - remove() {} -}; - -const headersToObject = thing => thing instanceof AxiosHeaders ? { - ...thing -} : thing; -const ownEnumerableKeys = thing => { - if (Object.getOwnPropertySymbols && Object.getOwnPropertyDescriptor) { - return Object.keys(thing).concat(Object.getOwnPropertySymbols(thing).filter(symbol => Object.getOwnPropertyDescriptor(thing, symbol).enumerable)); - } - return Object.keys(thing); -}; - -/** - * Config-specific merge-function which creates a new config-object - * by merging two configuration objects together. - * - * @param {Object} config1 - * @param {Object} config2 - * - * @returns {Object} New object resulting from merging config2 to config1 - */ -function mergeConfig(config1, config2) { - // eslint-disable-next-line no-param-reassign - config1 = config1 || {}; - config2 = config2 || {}; - - // Use a null-prototype object so that downstream reads such as `config.auth` - // or `config.baseURL` cannot inherit polluted values from Object.prototype. - // `hasOwnProperty` is restored as a non-enumerable own slot to preserve - // ergonomics for user code that relies on it. - const config = Object.create(null); - Object.defineProperty(config, 'hasOwnProperty', { - // Null-proto descriptor so a polluted Object.prototype.get cannot turn - // this data descriptor into an accessor descriptor on the way in. - __proto__: null, - value: Object.prototype.hasOwnProperty, - enumerable: false, - writable: true, - configurable: true - }); - function getMergedValue(target, source, prop, caseless) { - if (utils$1.isPlainObject(target) && utils$1.isPlainObject(source)) { - return utils$1.merge.call({ - caseless - }, target, source); - } else if (utils$1.isPlainObject(source)) { - return utils$1.merge({}, source); - } else if (utils$1.isArray(source)) { - return source.slice(); - } - return source; - } - function mergeDeepProperties(a, b, prop, caseless) { - if (!utils$1.isUndefined(b)) { - return getMergedValue(a, b, prop, caseless); - } else if (!utils$1.isUndefined(a)) { - return getMergedValue(undefined, a, prop, caseless); - } - } - - // eslint-disable-next-line consistent-return - function valueFromConfig2(a, b) { - if (!utils$1.isUndefined(b)) { - return getMergedValue(undefined, b); - } - } - - // eslint-disable-next-line consistent-return - function defaultToConfig2(a, b) { - if (!utils$1.isUndefined(b)) { - return getMergedValue(undefined, b); - } else if (!utils$1.isUndefined(a)) { - return getMergedValue(undefined, a); - } - } - function getMergedTransitionalOption(prop) { - const transitional2 = utils$1.hasOwnProp(config2, 'transitional') ? config2.transitional : undefined; - if (!utils$1.isUndefined(transitional2)) { - if (utils$1.isPlainObject(transitional2)) { - if (utils$1.hasOwnProp(transitional2, prop)) { - return transitional2[prop]; - } - } else { - return undefined; - } - } - const transitional1 = utils$1.hasOwnProp(config1, 'transitional') ? config1.transitional : undefined; - if (utils$1.isPlainObject(transitional1) && utils$1.hasOwnProp(transitional1, prop)) { - return transitional1[prop]; - } - return undefined; - } - - // eslint-disable-next-line consistent-return - function mergeDirectKeys(a, b, prop) { - if (utils$1.hasOwnProp(config2, prop)) { - return getMergedValue(a, b); - } else if (utils$1.hasOwnProp(config1, prop)) { - return getMergedValue(undefined, a); - } - } - const mergeMap = { - url: valueFromConfig2, - method: valueFromConfig2, - data: valueFromConfig2, - baseURL: defaultToConfig2, - transformRequest: defaultToConfig2, - transformResponse: defaultToConfig2, - paramsSerializer: defaultToConfig2, - timeout: defaultToConfig2, - timeoutMessage: defaultToConfig2, - withCredentials: defaultToConfig2, - withXSRFToken: defaultToConfig2, - adapter: defaultToConfig2, - responseType: defaultToConfig2, - xsrfCookieName: defaultToConfig2, - xsrfHeaderName: defaultToConfig2, - onUploadProgress: defaultToConfig2, - onDownloadProgress: defaultToConfig2, - decompress: defaultToConfig2, - maxContentLength: defaultToConfig2, - maxBodyLength: defaultToConfig2, - beforeRedirect: defaultToConfig2, - transport: defaultToConfig2, - httpAgent: defaultToConfig2, - httpsAgent: defaultToConfig2, - cancelToken: defaultToConfig2, - socketPath: defaultToConfig2, - allowedSocketPaths: defaultToConfig2, - responseEncoding: defaultToConfig2, - validateStatus: mergeDirectKeys, - headers: (a, b, prop) => mergeDeepProperties(headersToObject(a), headersToObject(b), prop, true) - }; - utils$1.forEach(ownEnumerableKeys({ - ...config1, - ...config2 - }), function computeConfigValue(prop) { - if (prop === '__proto__' || prop === 'constructor' || prop === 'prototype') return; - const merge = utils$1.hasOwnProp(mergeMap, prop) ? mergeMap[prop] : mergeDeepProperties; - const a = utils$1.hasOwnProp(config1, prop) ? config1[prop] : undefined; - const b = utils$1.hasOwnProp(config2, prop) ? config2[prop] : undefined; - const configValue = merge(a, b, prop); - utils$1.isUndefined(configValue) && merge !== mergeDirectKeys || (config[prop] = configValue); - }); - if (utils$1.hasOwnProp(config2, 'validateStatus') && utils$1.isUndefined(config2.validateStatus) && getMergedTransitionalOption('validateStatusUndefinedResolves') === false) { - if (utils$1.hasOwnProp(config1, 'validateStatus')) { - config.validateStatus = getMergedValue(undefined, config1.validateStatus); - } else { - delete config.validateStatus; - } - } - return config; -} - -/** - * Encode a UTF-8 string to a Latin-1 byte string for use with btoa(). - * This is a modern replacement for the deprecated unescape(encodeURIComponent(str)) pattern. - * - * @param {string} str The string to encode - * - * @returns {string} UTF-8 bytes as a Latin-1 string - */ -const encodeUTF8$1 = str => encodeURIComponent(str).replace(/%([0-9A-F]{2})/gi, (_, hex) => String.fromCharCode(parseInt(hex, 16))); -function resolveConfig(config) { - const newConfig = mergeConfig({}, config); - - // Read only own properties to prevent prototype pollution gadgets - // (e.g. Object.prototype.baseURL = 'https://evil.com'). - const own = key => utils$1.hasOwnProp(newConfig, key) ? newConfig[key] : undefined; - const data = own('data'); - let withXSRFToken = own('withXSRFToken'); - const xsrfHeaderName = own('xsrfHeaderName'); - const xsrfCookieName = own('xsrfCookieName'); - let headers = own('headers'); - const auth = own('auth'); - const baseURL = own('baseURL'); - const allowAbsoluteUrls = own('allowAbsoluteUrls'); - const url = own('url'); - newConfig.headers = headers = AxiosHeaders.from(headers); - newConfig.url = buildURL(buildFullPath(baseURL, url, allowAbsoluteUrls, newConfig), own('params'), own('paramsSerializer')); - - // HTTP basic authentication - if (auth) { - const username = utils$1.getSafeProp(auth, 'username') || ''; - const password = utils$1.getSafeProp(auth, 'password') || ''; - try { - headers.set('Authorization', 'Basic ' + btoa(username + ':' + (password ? encodeUTF8$1(password) : ''))); - } catch (e) { - throw AxiosError.from(e, AxiosError.ERR_BAD_OPTION_VALUE, config); - } - } - if (utils$1.isFormData(data)) { - if (platform.hasStandardBrowserEnv || platform.hasStandardBrowserWebWorkerEnv || utils$1.isReactNative(data)) { - headers.setContentType(undefined); // browser/web worker/RN handles it - } else if (utils$1.isFunction(data.getHeaders)) { - // Node.js FormData (like form-data package) - setFormDataHeaders(headers, data.getHeaders(), own('formDataHeaderPolicy')); - } - } - - // Add xsrf header - // This is only done if running in a standard browser environment. - // Specifically not if we're in a web worker, or react-native. - - if (platform.hasStandardBrowserEnv) { - if (utils$1.isFunction(withXSRFToken)) { - withXSRFToken = withXSRFToken(newConfig); - } - - // Strict boolean check — prevents proto-pollution gadgets (e.g. Object.prototype.withXSRFToken = 1) - // and misconfigurations (e.g. "false") from short-circuiting the same-origin check and leaking - // the XSRF token cross-origin. - const shouldSendXSRF = withXSRFToken === true || withXSRFToken == null && isURLSameOrigin(newConfig.url); - if (shouldSendXSRF) { - const xsrfValue = xsrfHeaderName && xsrfCookieName && cookies.read(xsrfCookieName); - if (xsrfValue) { - headers.set(xsrfHeaderName, xsrfValue); - } - } - } - return newConfig; -} - -const isXHRAdapterSupported = typeof XMLHttpRequest !== 'undefined'; -var xhrAdapter = isXHRAdapterSupported && function (config) { - return new Promise(function dispatchXhrRequest(resolve, reject) { - const _config = resolveConfig(config); - let requestData = _config.data; - const requestHeaders = AxiosHeaders.from(_config.headers).normalize(); - let { - responseType, - onUploadProgress, - onDownloadProgress - } = _config; - let onCanceled; - let uploadThrottled, downloadThrottled; - let flushUpload, flushDownload; - function done() { - flushUpload && flushUpload(); // flush events - flushDownload && flushDownload(); // flush events - - _config.cancelToken && _config.cancelToken.unsubscribe(onCanceled); - _config.signal && _config.signal.removeEventListener('abort', onCanceled); - } - let request = new XMLHttpRequest(); - request.open(_config.method.toUpperCase(), _config.url, true); - - // Set the request timeout in MS - request.timeout = _config.timeout; - function onloadend() { - if (!request) { - return; - } - // Prepare the response - const responseHeaders = AxiosHeaders.from('getAllResponseHeaders' in request && request.getAllResponseHeaders()); - const responseData = !responseType || responseType === 'text' || responseType === 'json' ? request.responseText : request.response; - const response = { - data: responseData, - status: request.status, - statusText: request.statusText, - headers: responseHeaders, - config, - request - }; - settle(function _resolve(value) { - resolve(value); - done(); - }, function _reject(err) { - reject(err); - done(); - }, response); - - // Clean up request - request = null; - } - if ('onloadend' in request) { - // Use onloadend if available - request.onloadend = onloadend; - } else { - // Listen for ready state to emulate onloadend - request.onreadystatechange = function handleLoad() { - if (!request || request.readyState !== 4) { - return; - } - - // The request errored out and we didn't get a response, this will be - // handled by onerror instead - // With one exception: request that using file: protocol, most browsers - // will return status as 0 even though it's a successful request - if (request.status === 0 && !(request.responseURL && request.responseURL.startsWith('file:'))) { - return; - } - // readystate handler is calling before onerror or ontimeout handlers, - // so we should call onloadend on the next 'tick' - setTimeout(onloadend); - }; - } - - // Handle browser request cancellation (as opposed to a manual cancellation) - request.onabort = function handleAbort() { - if (!request) { - return; - } - reject(new AxiosError('Request aborted', AxiosError.ECONNABORTED, config, request)); - done(); - - // Clean up request - request = null; - }; - - // Handle low level network errors - request.onerror = function handleError(event) { - // Browsers deliver a ProgressEvent in XHR onerror - // (message may be empty; when present, surface it) - // See https://developer.mozilla.org/docs/Web/API/XMLHttpRequest/error_event - const msg = event && event.message ? event.message : 'Network Error'; - const err = new AxiosError(msg, AxiosError.ERR_NETWORK, config, request); - // attach the underlying event for consumers who want details - err.event = event || null; - reject(err); - done(); - request = null; - }; - - // Handle timeout - request.ontimeout = function handleTimeout() { - let timeoutErrorMessage = _config.timeout ? 'timeout of ' + _config.timeout + 'ms exceeded' : 'timeout exceeded'; - const transitional = _config.transitional || transitionalDefaults; - if (_config.timeoutErrorMessage) { - timeoutErrorMessage = _config.timeoutErrorMessage; - } - reject(new AxiosError(timeoutErrorMessage, transitional.clarifyTimeoutError ? AxiosError.ETIMEDOUT : AxiosError.ECONNABORTED, config, request)); - done(); - - // Clean up request - request = null; - }; - - // Remove Content-Type if data is undefined - requestData === undefined && requestHeaders.setContentType(null); - - // Add headers to the request - if ('setRequestHeader' in request) { - utils$1.forEach(toByteStringHeaderObject(requestHeaders), function setRequestHeader(val, key) { - request.setRequestHeader(key, val); - }); - } - - // Add withCredentials to request if needed - if (!utils$1.isUndefined(_config.withCredentials)) { - request.withCredentials = !!_config.withCredentials; - } - - // Add responseType to request if needed - if (responseType && responseType !== 'json') { - request.responseType = _config.responseType; - } - - // Handle progress if needed - if (onDownloadProgress) { - [downloadThrottled, flushDownload] = progressEventReducer(onDownloadProgress, true); - request.addEventListener('progress', downloadThrottled); - } - - // Not all browsers support upload events - if (onUploadProgress && request.upload) { - [uploadThrottled, flushUpload] = progressEventReducer(onUploadProgress); - request.upload.addEventListener('progress', uploadThrottled); - request.upload.addEventListener('loadend', flushUpload); - } - if (_config.cancelToken || _config.signal) { - // Handle cancellation - // eslint-disable-next-line func-names - onCanceled = cancel => { - if (!request) { - return; - } - reject(!cancel || cancel.type ? new CanceledError(null, config, request) : cancel); - request.abort(); - done(); - request = null; - }; - _config.cancelToken && _config.cancelToken.subscribe(onCanceled); - if (_config.signal) { - _config.signal.aborted ? onCanceled() : _config.signal.addEventListener('abort', onCanceled); - } - } - const protocol = parseProtocol(_config.url); - if (protocol && !platform.protocols.includes(protocol)) { - reject(new AxiosError('Unsupported protocol ' + protocol + ':', AxiosError.ERR_BAD_REQUEST, config)); - done(); - return; - } - - // Send the request - request.send(requestData || null); - }); -}; - -const composeSignals = (signals, timeout) => { - signals = signals ? signals.filter(Boolean) : []; - if (!timeout && !signals.length) { - return; - } - const controller = new AbortController(); - let aborted = false; - const onabort = function (reason) { - if (!aborted) { - aborted = true; - unsubscribe(); - const err = reason instanceof Error ? reason : this.reason; - controller.abort(err instanceof AxiosError ? err : new CanceledError(err instanceof Error ? err.message : err)); - } - }; - let timer = timeout && setTimeout(() => { - timer = null; - onabort(new AxiosError(`timeout of ${timeout}ms exceeded`, AxiosError.ETIMEDOUT)); - }, timeout); - const unsubscribe = () => { - if (!signals) { - return; - } - timer && clearTimeout(timer); - timer = null; - signals.forEach(signal => { - signal.unsubscribe ? signal.unsubscribe(onabort) : signal.removeEventListener('abort', onabort); - }); - signals = null; - }; - signals.forEach(signal => { - if (aborted) { - return; - } - if (signal.aborted) { - onabort.call(signal); - return; - } - signal.addEventListener('abort', onabort, { - once: true - }); - }); - const { - signal - } = controller; - signal.unsubscribe = () => utils$1.asap(unsubscribe); - return signal; -}; - -const streamChunk = function* (chunk, chunkSize) { - let len = chunk.byteLength; - if (len < chunkSize) { - yield chunk; - return; - } - let pos = 0; - let end; - while (pos < len) { - end = pos + chunkSize; - yield chunk.slice(pos, end); - pos = end; - } -}; -const readBytes = async function* (iterable, chunkSize) { - for await (const chunk of readStream(iterable)) { - yield* streamChunk(chunk, chunkSize); - } -}; -const readStream = async function* (stream) { - if (stream[Symbol.asyncIterator]) { - yield* stream; - return; - } - const reader = stream.getReader(); - try { - for (;;) { - const { - done, - value - } = await reader.read(); - if (done) { - break; - } - yield value; - } - } finally { - await reader.cancel(); - } -}; -const trackStream = (stream, chunkSize, onProgress, onFinish) => { - const iterator = readBytes(stream, chunkSize); - let bytes = 0; - let done; - let _onFinish = e => { - if (!done) { - done = true; - onFinish && onFinish(e); - } - }; - return new ReadableStream({ - async pull(controller) { - try { - const { - done, - value - } = await iterator.next(); - if (done) { - _onFinish(); - controller.close(); - return; - } - let len = value.byteLength; - if (onProgress) { - let loadedBytes = bytes += len; - onProgress(loadedBytes); - } - controller.enqueue(new Uint8Array(value)); - } catch (err) { - _onFinish(err); - throw err; - } - }, - cancel(reason) { - _onFinish(reason); - return iterator.return(); - } - }, { - highWaterMark: 2 - }); -}; - -const DEFAULT_CHUNK_SIZE = 64 * 1024; -const { - isFunction -} = utils$1; - -/** - * Encode a UTF-8 string to a Latin-1 byte string for use with btoa(). - * This is a modern replacement for the deprecated unescape(encodeURIComponent(str)) pattern. - * - * @param {string} str The string to encode - * - * @returns {string} UTF-8 bytes as a Latin-1 string - */ -const encodeUTF8 = str => encodeURIComponent(str).replace(/%([0-9A-F]{2})/gi, (_, hex) => String.fromCharCode(parseInt(hex, 16))); - -// Node's WHATWG URL parser returns `username` and `password` percent-encoded. -// Decode before composing the `auth` option so credentials such as -// `my%40email.com:pass` are sent as `my@email.com:pass`. Falls back to the -// original value for malformed input so a bad encoding never throws. -const decodeURIComponentSafe = value => { - if (!utils$1.isString(value)) { - return value; - } - try { - return decodeURIComponent(value); - } catch (error) { - return value; - } -}; -const test = (fn, ...args) => { - try { - return !!fn(...args); - } catch (e) { - return false; - } -}; -const maybeWithAuthCredentials = url => { - const protocolIndex = url.indexOf('://'); - let urlToCheck = url; - if (protocolIndex !== -1) { - urlToCheck = urlToCheck.slice(protocolIndex + 3); - } - return urlToCheck.includes('@') || urlToCheck.includes(':'); -}; -const factory = env => { - const globalObject = utils$1.global !== undefined && utils$1.global !== null ? utils$1.global : globalThis; - const { - ReadableStream, - TextEncoder - } = globalObject; - env = utils$1.merge.call({ - skipUndefined: true - }, { - Request: globalObject.Request, - Response: globalObject.Response - }, env); - const { - fetch: envFetch, - Request, - Response - } = env; - const isFetchSupported = envFetch ? isFunction(envFetch) : typeof fetch === 'function'; - const isRequestSupported = isFunction(Request); - const isResponseSupported = isFunction(Response); - if (!isFetchSupported) { - return false; - } - const isReadableStreamSupported = isFetchSupported && isFunction(ReadableStream); - const encodeText = isFetchSupported && (typeof TextEncoder === 'function' ? (encoder => str => encoder.encode(str))(new TextEncoder()) : async str => new Uint8Array(await new Request(str).arrayBuffer())); - const supportsRequestStream = isRequestSupported && isReadableStreamSupported && test(() => { - let duplexAccessed = false; - const request = new Request(platform.origin, { - body: new ReadableStream(), - method: 'POST', - get duplex() { - duplexAccessed = true; - return 'half'; - } - }); - const hasContentType = request.headers.has('Content-Type'); - if (request.body != null) { - request.body.cancel(); - } - return duplexAccessed && !hasContentType; - }); - const supportsResponseStream = isResponseSupported && isReadableStreamSupported && test(() => utils$1.isReadableStream(new Response('').body)); - const resolvers = { - stream: supportsResponseStream && (res => res.body) - }; - isFetchSupported && (() => { - ['text', 'arrayBuffer', 'blob', 'formData', 'stream'].forEach(type => { - !resolvers[type] && (resolvers[type] = (res, config) => { - let method = res && res[type]; - if (method) { - return method.call(res); - } - throw new AxiosError(`Response type '${type}' is not supported`, AxiosError.ERR_NOT_SUPPORT, config); - }); - }); - })(); - const getBodyLength = async body => { - if (body == null) { - return 0; - } - if (utils$1.isBlob(body)) { - return body.size; - } - if (utils$1.isSpecCompliantForm(body)) { - const _request = new Request(platform.origin, { - method: 'POST', - body - }); - return (await _request.arrayBuffer()).byteLength; - } - if (utils$1.isArrayBufferView(body) || utils$1.isArrayBuffer(body)) { - return body.byteLength; - } - if (utils$1.isURLSearchParams(body)) { - body = body + ''; - } - if (utils$1.isString(body)) { - return (await encodeText(body)).byteLength; - } - }; - const resolveBodyLength = async (headers, body) => { - const length = utils$1.toFiniteNumber(headers.getContentLength()); - return length == null ? getBodyLength(body) : length; - }; - return async config => { - let { - url, - method, - data, - signal, - cancelToken, - timeout, - onDownloadProgress, - onUploadProgress, - responseType, - headers, - withCredentials = 'same-origin', - fetchOptions, - maxContentLength, - maxBodyLength - } = resolveConfig(config); - const hasMaxContentLength = utils$1.isNumber(maxContentLength) && maxContentLength > -1; - const hasMaxBodyLength = utils$1.isNumber(maxBodyLength) && maxBodyLength > -1; - const own = key => utils$1.hasOwnProp(config, key) ? config[key] : undefined; - let _fetch = envFetch || fetch; - responseType = responseType ? (responseType + '').toLowerCase() : 'text'; - let composedSignal = composeSignals([signal, cancelToken && cancelToken.toAbortSignal()], timeout); - let request = null; - const unsubscribe = composedSignal && composedSignal.unsubscribe && (() => { - composedSignal.unsubscribe(); - }); - let requestContentLength; - - // AxiosError we raise while the request body is being streamed. Captured - // by identity so the catch block can surface it directly, regardless of - // how the runtime wraps the resulting fetch rejection (undici exposes it - // as `err.cause`; some browsers drop the original error entirely). - let pendingBodyError = null; - const maxBodyLengthError = () => new AxiosError('Request body larger than maxBodyLength limit', AxiosError.ERR_BAD_REQUEST, config, request); - try { - // HTTP basic authentication - let auth = undefined; - const configAuth = own('auth'); - if (configAuth) { - const username = utils$1.getSafeProp(configAuth, 'username') || ''; - const password = utils$1.getSafeProp(configAuth, 'password') || ''; - auth = { - username, - password - }; - } - if (maybeWithAuthCredentials(url)) { - const parsedURL = new URL(url, platform.origin); - if (!auth && (parsedURL.username || parsedURL.password)) { - const urlUsername = decodeURIComponentSafe(parsedURL.username); - const urlPassword = decodeURIComponentSafe(parsedURL.password); - auth = { - username: urlUsername, - password: urlPassword - }; - } - if (parsedURL.username || parsedURL.password) { - parsedURL.username = ''; - parsedURL.password = ''; - url = parsedURL.href; - } - } - if (auth) { - headers.delete('authorization'); - headers.set('Authorization', 'Basic ' + btoa(encodeUTF8((auth.username || '') + ':' + (auth.password || '')))); - } - - // Enforce maxContentLength for data: URLs up-front so we never materialize - // an oversized payload. The HTTP adapter applies the same check (see http.js - // "if (protocol === 'data:')" branch). - if (hasMaxContentLength && typeof url === 'string' && url.startsWith('data:')) { - const estimated = estimateDataURLDecodedBytes(url); - if (estimated > maxContentLength) { - throw new AxiosError('maxContentLength size of ' + maxContentLength + ' exceeded', AxiosError.ERR_BAD_RESPONSE, config, request); - } - } - - // Enforce maxBodyLength against known-size bodies before dispatch using - // the body's *actual* size — never a caller-declared Content-Length, - // which could under-report to slip an oversized body past the check. - // Unknown-size streams return undefined here and are counted per-chunk - // below as fetch consumes them. - if (hasMaxBodyLength && method !== 'get' && method !== 'head') { - const outboundLength = await getBodyLength(data); - if (typeof outboundLength === 'number' && isFinite(outboundLength)) { - requestContentLength = outboundLength; - if (outboundLength > maxBodyLength) { - throw maxBodyLengthError(); - } - } - } - - // A streamed body under maxBodyLength must be counted as fetch consumes - // it; its size is never trusted from a caller-declared Content-Length. - const mustEnforceStreamBody = hasMaxBodyLength && (utils$1.isReadableStream(data) || utils$1.isStream(data)); - const trackRequestStream = (stream, onProgress, flush) => trackStream(stream, DEFAULT_CHUNK_SIZE, loadedBytes => { - if (hasMaxBodyLength && loadedBytes > maxBodyLength) { - throw pendingBodyError = maxBodyLengthError(); - } - onProgress && onProgress(loadedBytes); - }, flush); - if (supportsRequestStream && method !== 'get' && method !== 'head' && (onUploadProgress || mustEnforceStreamBody)) { - requestContentLength = requestContentLength == null ? await resolveBodyLength(headers, data) : requestContentLength; - - // A declared length of 0 is only trusted to skip the wrap when we are - // not enforcing a stream limit (which must not rely on that header). - if (requestContentLength !== 0 || mustEnforceStreamBody) { - let _request = new Request(url, { - method: 'POST', - body: data, - duplex: 'half' - }); - let contentTypeHeader; - if (utils$1.isFormData(data) && (contentTypeHeader = _request.headers.get('content-type'))) { - headers.setContentType(contentTypeHeader); - } - if (_request.body) { - const [onProgress, flush] = onUploadProgress && progressEventDecorator(requestContentLength, progressEventReducer(asyncDecorator(onUploadProgress))) || []; - data = trackRequestStream(_request.body, onProgress, flush); - } - } - } else if (mustEnforceStreamBody && !isRequestSupported && isReadableStreamSupported && method !== 'get' && method !== 'head') { - data = trackRequestStream(data); - } else if (mustEnforceStreamBody && isRequestSupported && !supportsRequestStream && method !== 'get' && method !== 'head') { - throw new AxiosError('Stream request bodies are not supported by the current fetch implementation', AxiosError.ERR_NOT_SUPPORT, config, request); - } - if (!utils$1.isString(withCredentials)) { - withCredentials = withCredentials ? 'include' : 'omit'; - } - - // Cloudflare Workers throws when credentials are defined - // see https://github.com/cloudflare/workerd/issues/902 - const isCredentialsSupported = isRequestSupported && 'credentials' in Request.prototype; - - // If data is FormData and Content-Type is multipart/form-data without boundary, - // delete it so fetch can set it correctly with the boundary - if (utils$1.isFormData(data)) { - const contentType = headers.getContentType(); - if (contentType && /^multipart\/form-data/i.test(contentType) && !/boundary=/i.test(contentType)) { - headers.delete('content-type'); - } - } - - // Set User-Agent header if not already set (fetch defaults to 'node' in Node.js) - headers.set('User-Agent', 'axios/' + VERSION, false); - const resolvedOptions = { - ...fetchOptions, - signal: composedSignal, - method: method.toUpperCase(), - headers: toByteStringHeaderObject(headers.normalize()), - body: data, - duplex: 'half', - credentials: isCredentialsSupported ? withCredentials : undefined - }; - request = isRequestSupported && new Request(url, resolvedOptions); - let response = await (isRequestSupported ? _fetch(request, fetchOptions) : _fetch(url, resolvedOptions)); - const responseHeaders = AxiosHeaders.from(response.headers); - - // Cheap pre-check: if the server honestly declares a content-length that - // already exceeds the cap, reject before we start streaming. - if (hasMaxContentLength) { - const declaredLength = utils$1.toFiniteNumber(responseHeaders.getContentLength()); - if (declaredLength != null && declaredLength > maxContentLength) { - throw new AxiosError('maxContentLength size of ' + maxContentLength + ' exceeded', AxiosError.ERR_BAD_RESPONSE, config, request); - } - } - const isStreamResponse = supportsResponseStream && (responseType === 'stream' || responseType === 'response'); - if (supportsResponseStream && response.body && (onDownloadProgress || hasMaxContentLength || isStreamResponse && unsubscribe)) { - const options = {}; - ['status', 'statusText', 'headers'].forEach(prop => { - options[prop] = response[prop]; - }); - const responseContentLength = utils$1.toFiniteNumber(responseHeaders.getContentLength()); - const [onProgress, flush] = onDownloadProgress && progressEventDecorator(responseContentLength, progressEventReducer(asyncDecorator(onDownloadProgress), true)) || []; - let bytesRead = 0; - const onChunkProgress = loadedBytes => { - if (hasMaxContentLength) { - bytesRead = loadedBytes; - if (bytesRead > maxContentLength) { - throw new AxiosError('maxContentLength size of ' + maxContentLength + ' exceeded', AxiosError.ERR_BAD_RESPONSE, config, request); - } - } - onProgress && onProgress(loadedBytes); - }; - response = new Response(trackStream(response.body, DEFAULT_CHUNK_SIZE, onChunkProgress, () => { - flush && flush(); - unsubscribe && unsubscribe(); - }), options); - } - responseType = responseType || 'text'; - let responseData = await resolvers[utils$1.findKey(resolvers, responseType) || 'text'](response, config); - - // Fallback enforcement for environments without ReadableStream support - // (legacy runtimes). Detect materialized size from typed output; skip - // streams/Response passthrough since the user will read those themselves. - if (hasMaxContentLength && !supportsResponseStream && !isStreamResponse) { - let materializedSize; - if (responseData != null) { - if (typeof responseData.byteLength === 'number') { - materializedSize = responseData.byteLength; - } else if (typeof responseData.size === 'number') { - materializedSize = responseData.size; - } else if (typeof responseData === 'string') { - materializedSize = typeof TextEncoder === 'function' ? new TextEncoder().encode(responseData).byteLength : responseData.length; - } - } - if (typeof materializedSize === 'number' && materializedSize > maxContentLength) { - throw new AxiosError('maxContentLength size of ' + maxContentLength + ' exceeded', AxiosError.ERR_BAD_RESPONSE, config, request); - } - } - !isStreamResponse && unsubscribe && unsubscribe(); - return await new Promise((resolve, reject) => { - settle(resolve, reject, { - data: responseData, - headers: AxiosHeaders.from(response.headers), - status: response.status, - statusText: response.statusText, - config, - request - }); - }); - } catch (err) { - unsubscribe && unsubscribe(); - - // Safari can surface fetch aborts as a DOMException-like object whose - // branded getters throw. Prefer our composed signal reason before reading - // the caught error, preserving timeout vs cancellation semantics. - if (composedSignal && composedSignal.aborted && composedSignal.reason instanceof AxiosError) { - const canceledError = composedSignal.reason; - canceledError.config = config; - request && (canceledError.request = request); - if (err !== canceledError) { - // Non-enumerable to match native Error `cause` semantics so loggers - // don't recurse into circular fetch internals (see #7205). - Object.defineProperty(canceledError, 'cause', { - __proto__: null, - value: err, - writable: true, - enumerable: false, - configurable: true - }); - } - throw canceledError; - } - - // Surface a maxBodyLength violation we raised while the request body was - // being streamed. Matching by identity (rather than reading - // `err.cause.isAxiosError`) keeps the error deterministic across runtimes - // and avoids both prototype-pollution reads and mis-attributing a foreign - // AxiosError that merely happened to land in `err.cause`. - if (pendingBodyError) { - request && !pendingBodyError.request && (pendingBodyError.request = request); - throw pendingBodyError; - } - - // Re-throw AxiosErrors we raised synchronously (data: URL / content-length - // pre-checks, response size enforcement) without re-wrapping them. - if (err instanceof AxiosError) { - request && !err.request && (err.request = request); - throw err; - } - if (err && err.name === 'TypeError' && /Load failed|fetch/i.test(err.message)) { - const networkError = new AxiosError('Network Error', AxiosError.ERR_NETWORK, config, request, err && err.response); - // Non-enumerable to match native Error `cause` semantics so loggers - // don't recurse into circular fetch internals (see #7205). - Object.defineProperty(networkError, 'cause', { - __proto__: null, - value: err.cause || err, - writable: true, - enumerable: false, - configurable: true - }); - throw networkError; - } - throw AxiosError.from(err, err && err.code, config, request, err && err.response); - } - }; -}; -const seedCache = new Map(); -const getFetch = config => { - let env = config && config.env || {}; - const { - fetch, - Request, - Response - } = env; - const seeds = [Request, Response, fetch]; - let len = seeds.length, - i = len, - seed, - target, - map = seedCache; - while (i--) { - seed = seeds[i]; - target = map.get(seed); - target === undefined && map.set(seed, target = i ? new Map() : factory(env)); - map = target; - } - return target; -}; -getFetch(); - -/** - * Known adapters mapping. - * Provides environment-specific adapters for Axios: - * - `http` for Node.js - * - `xhr` for browsers - * - `fetch` for fetch API-based requests - * - * @type {Object} - */ -const knownAdapters = { - http: httpAdapter, - xhr: xhrAdapter, - fetch: { - get: getFetch - } -}; - -// Assign adapter names for easier debugging and identification -utils$1.forEach(knownAdapters, (fn, value) => { - if (fn) { - try { - // Null-proto descriptors so a polluted Object.prototype.get cannot turn - // these data descriptors into accessor descriptors on the way in. - Object.defineProperty(fn, 'name', { - __proto__: null, - value - }); - } catch (e) { - // eslint-disable-next-line no-empty - } - Object.defineProperty(fn, 'adapterName', { - __proto__: null, - value - }); - } -}); - -/** - * Render a rejection reason string for unknown or unsupported adapters - * - * @param {string} reason - * @returns {string} - */ -const renderReason = reason => `- ${reason}`; - -/** - * Check if the adapter is resolved (function, null, or false) - * - * @param {Function|null|false} adapter - * @returns {boolean} - */ -const isResolvedHandle = adapter => utils$1.isFunction(adapter) || adapter === null || adapter === false; - -/** - * Get the first suitable adapter from the provided list. - * Tries each adapter in order until a supported one is found. - * Throws an AxiosError if no adapter is suitable. - * - * @param {Array|string|Function} adapters - Adapter(s) by name or function. - * @param {Object} config - Axios request configuration - * @throws {AxiosError} If no suitable adapter is available - * @returns {Function} The resolved adapter function - */ -function getAdapter(adapters, config) { - adapters = utils$1.isArray(adapters) ? adapters : [adapters]; - const { - length - } = adapters; - let nameOrAdapter; - let adapter; - const rejectedReasons = {}; - for (let i = 0; i < length; i++) { - nameOrAdapter = adapters[i]; - let id; - adapter = nameOrAdapter; - if (!isResolvedHandle(nameOrAdapter)) { - adapter = knownAdapters[(id = String(nameOrAdapter)).toLowerCase()]; - if (adapter === undefined) { - throw new AxiosError(`Unknown adapter '${id}'`); - } - } - if (adapter && (utils$1.isFunction(adapter) || (adapter = adapter.get(config)))) { - break; - } - rejectedReasons[id || '#' + i] = adapter; - } - if (!adapter) { - const reasons = Object.entries(rejectedReasons).map(([id, state]) => `adapter ${id} ` + (state === false ? 'is not supported by the environment' : 'is not available in the build')); - let s = length ? reasons.length > 1 ? 'since :\n' + reasons.map(renderReason).join('\n') : ' ' + renderReason(reasons[0]) : 'as no adapter specified'; - throw new AxiosError(`There is no suitable adapter to dispatch the request ` + s, AxiosError.ERR_NOT_SUPPORT); - } - return adapter; -} - -/** - * Exports Axios adapters and utility to resolve an adapter - */ -var adapters = { - /** - * Resolve an adapter from a list of adapter names or functions. - * @type {Function} - */ - getAdapter, - /** - * Exposes all known adapters - * @type {Object} - */ - adapters: knownAdapters -}; - -/** - * Throws a `CanceledError` if cancellation has been requested. - * - * @param {Object} config The config that is to be used for the request - * - * @returns {void} - */ -function throwIfCancellationRequested(config) { - if (config.cancelToken) { - config.cancelToken.throwIfRequested(); - } - if (config.signal && config.signal.aborted) { - throw new CanceledError(null, config); - } -} - -/** - * Dispatch a request to the server using the configured adapter. - * - * @param {object} config The config that is to be used for the request - * - * @returns {Promise} The Promise to be fulfilled - */ -function dispatchRequest(config) { - throwIfCancellationRequested(config); - config.headers = AxiosHeaders.from(config.headers); - - // Transform request data - config.data = transformData.call(config, config.transformRequest); - if (['post', 'put', 'patch'].indexOf(config.method) !== -1) { - config.headers.setContentType('application/x-www-form-urlencoded', false); - } - const adapter = adapters.getAdapter(config.adapter || defaults.adapter, config); - return adapter(config).then(function onAdapterResolution(response) { - throwIfCancellationRequested(config); - - // Expose the current response on config so that transformResponse can - // attach it to any AxiosError it throws (e.g. on JSON parse failure). - // We clean it up afterwards to avoid polluting the config object. - config.response = response; - try { - response.data = transformData.call(config, config.transformResponse, response); - } finally { - delete config.response; - } - response.headers = AxiosHeaders.from(response.headers); - return response; - }, function onAdapterRejection(reason) { - if (!isCancel(reason)) { - throwIfCancellationRequested(config); - - // Transform response data - if (reason && reason.response) { - config.response = reason.response; - try { - reason.response.data = transformData.call(config, config.transformResponse, reason.response); - } finally { - delete config.response; - } - reason.response.headers = AxiosHeaders.from(reason.response.headers); - } - } - return Promise.reject(reason); - }); -} - -const validators$1 = {}; - -// eslint-disable-next-line func-names -['object', 'boolean', 'number', 'function', 'string', 'symbol'].forEach((type, i) => { - validators$1[type] = function validator(thing) { - return typeof thing === type || 'a' + (i < 1 ? 'n ' : ' ') + type; - }; -}); -const deprecatedWarnings = {}; - -/** - * Transitional option validator - * - * @param {function|boolean?} validator - set to false if the transitional option has been removed - * @param {string?} version - deprecated version / removed since version - * @param {string?} message - some message with additional info - * - * @returns {function} - */ -validators$1.transitional = function transitional(validator, version, message) { - function formatMessage(opt, desc) { - return '[Axios v' + VERSION + "] Transitional option '" + opt + "'" + desc + (message ? '. ' + message : ''); - } - - // eslint-disable-next-line func-names - return (value, opt, opts) => { - if (validator === false) { - throw new AxiosError(formatMessage(opt, ' has been removed' + (version ? ' in ' + version : '')), AxiosError.ERR_DEPRECATED); - } - if (version && !deprecatedWarnings[opt]) { - deprecatedWarnings[opt] = true; - // eslint-disable-next-line no-console - console.warn(formatMessage(opt, ' has been deprecated since v' + version + ' and will be removed in the near future')); - } - return validator ? validator(value, opt, opts) : true; - }; -}; -validators$1.spelling = function spelling(correctSpelling) { - return (value, opt) => { - // eslint-disable-next-line no-console - console.warn(`${opt} is likely a misspelling of ${correctSpelling}`); - return true; - }; -}; - -/** - * Assert object's properties type - * - * @param {object} options - * @param {object} schema - * @param {boolean?} allowUnknown - * - * @returns {object} - */ - -function assertOptions(options, schema, allowUnknown) { - if (typeof options !== 'object' || options === null) { - throw new AxiosError('options must be an object', AxiosError.ERR_BAD_OPTION_VALUE); - } - const keys = Object.keys(options); - let i = keys.length; - while (i-- > 0) { - const opt = keys[i]; - // Use hasOwnProperty so a polluted Object.prototype. cannot supply - // a non-function validator and cause a TypeError. - const validator = Object.prototype.hasOwnProperty.call(schema, opt) ? schema[opt] : undefined; - if (validator) { - const value = options[opt]; - const result = value === undefined || validator(value, opt, options); - if (result !== true) { - throw new AxiosError('option ' + opt + ' must be ' + result, AxiosError.ERR_BAD_OPTION_VALUE); - } - continue; - } - if (allowUnknown !== true) { - throw new AxiosError('Unknown option ' + opt, AxiosError.ERR_BAD_OPTION); - } - } -} -var validator = { - assertOptions, - validators: validators$1 -}; - -const validators = validator.validators; - -/** - * Create a new instance of Axios - * - * @param {Object} instanceConfig The default config for the instance - * - * @return {Axios} A new instance of Axios - */ -class Axios { - constructor(instanceConfig) { - this.defaults = instanceConfig || {}; - this.interceptors = { - request: new InterceptorManager(), - response: new InterceptorManager() - }; - } - - /** - * Dispatch a request - * - * @param {String|Object} configOrUrl The config specific for this request (merged with this.defaults) - * @param {?Object} config - * - * @returns {Promise} The Promise to be fulfilled - */ - async request(configOrUrl, config) { - try { - return await this._request(configOrUrl, config); - } catch (err) { - if (err instanceof Error) { - let dummy = {}; - Error.captureStackTrace ? Error.captureStackTrace(dummy) : dummy = new Error(); - - // slice off the Error: ... line - const stack = (() => { - if (!dummy.stack) { - return ''; - } - const firstNewlineIndex = dummy.stack.indexOf('\n'); - return firstNewlineIndex === -1 ? '' : dummy.stack.slice(firstNewlineIndex + 1); - })(); - try { - if (!err.stack) { - err.stack = stack; - // match without the 2 top stack lines - } else if (stack) { - const firstNewlineIndex = stack.indexOf('\n'); - const secondNewlineIndex = firstNewlineIndex === -1 ? -1 : stack.indexOf('\n', firstNewlineIndex + 1); - const stackWithoutTwoTopLines = secondNewlineIndex === -1 ? '' : stack.slice(secondNewlineIndex + 1); - if (!String(err.stack).endsWith(stackWithoutTwoTopLines)) { - err.stack += '\n' + stack; - } - } - } catch (e) { - // ignore the case where "stack" is an un-writable property - } - } - throw err; - } - } - _request(configOrUrl, config) { - /*eslint no-param-reassign:0*/ - // Allow for axios('example/url'[, config]) a la fetch API - if (typeof configOrUrl === 'string') { - config = config || {}; - config.url = configOrUrl; - } else { - config = configOrUrl || {}; - } - config = mergeConfig(this.defaults, config); - const { - transitional, - paramsSerializer, - headers - } = config; - if (transitional !== undefined) { - validator.assertOptions(transitional, { - silentJSONParsing: validators.transitional(validators.boolean), - forcedJSONParsing: validators.transitional(validators.boolean), - clarifyTimeoutError: validators.transitional(validators.boolean), - legacyInterceptorReqResOrdering: validators.transitional(validators.boolean), - advertiseZstdAcceptEncoding: validators.transitional(validators.boolean), - validateStatusUndefinedResolves: validators.transitional(validators.boolean) - }, false); - } - if (paramsSerializer != null) { - if (utils$1.isFunction(paramsSerializer)) { - config.paramsSerializer = { - serialize: paramsSerializer - }; - } else { - validator.assertOptions(paramsSerializer, { - encode: validators.function, - serialize: validators.function - }, true); - } - } - - // Set config.allowAbsoluteUrls - if (config.allowAbsoluteUrls !== undefined) ; else if (this.defaults.allowAbsoluteUrls !== undefined) { - config.allowAbsoluteUrls = this.defaults.allowAbsoluteUrls; - } else { - config.allowAbsoluteUrls = true; - } - validator.assertOptions(config, { - baseUrl: validators.spelling('baseURL'), - withXsrfToken: validators.spelling('withXSRFToken') - }, true); - - // Set config.method - config.method = (config.method || this.defaults.method || 'get').toLowerCase(); - - // Flatten headers - let contextHeaders = headers && utils$1.merge(headers.common, headers[config.method]); - headers && utils$1.forEach(['delete', 'get', 'head', 'post', 'put', 'patch', 'query', 'common'], method => { - delete headers[method]; - }); - config.headers = AxiosHeaders.concat(contextHeaders, headers); - - // filter out skipped interceptors - const requestInterceptorChain = []; - let synchronousRequestInterceptors = true; - this.interceptors.request.forEach(function unshiftRequestInterceptors(interceptor) { - if (typeof interceptor.runWhen === 'function' && interceptor.runWhen(config) === false) { - return; - } - synchronousRequestInterceptors = synchronousRequestInterceptors && interceptor.synchronous; - const transitional = config.transitional || transitionalDefaults; - const legacyInterceptorReqResOrdering = transitional && transitional.legacyInterceptorReqResOrdering; - if (legacyInterceptorReqResOrdering) { - requestInterceptorChain.unshift(interceptor.fulfilled, interceptor.rejected); - } else { - requestInterceptorChain.push(interceptor.fulfilled, interceptor.rejected); - } - }); - const responseInterceptorChain = []; - this.interceptors.response.forEach(function pushResponseInterceptors(interceptor) { - responseInterceptorChain.push(interceptor.fulfilled, interceptor.rejected); - }); - let promise; - let i = 0; - let len; - if (!synchronousRequestInterceptors) { - const chain = [dispatchRequest.bind(this), undefined]; - chain.unshift(...requestInterceptorChain); - chain.push(...responseInterceptorChain); - len = chain.length; - promise = Promise.resolve(config); - while (i < len) { - promise = promise.then(chain[i++], chain[i++]); - } - return promise; - } - len = requestInterceptorChain.length; - let newConfig = config; - while (i < len) { - const onFulfilled = requestInterceptorChain[i++]; - const onRejected = requestInterceptorChain[i++]; - try { - newConfig = onFulfilled ? onFulfilled(newConfig) : newConfig; - } catch (error) { - if (!onRejected) { - promise = Promise.reject(error); - break; - } - try { - const rejectedResult = onRejected.call(this, error); - if (utils$1.isThenable(rejectedResult)) { - promise = Promise.resolve(rejectedResult).then(() => dispatchRequest.call(this, newConfig)); - } - } catch (rejectedError) { - promise = Promise.reject(rejectedError); - } - break; - } - } - if (!promise) { - try { - promise = dispatchRequest.call(this, newConfig); - } catch (error) { - promise = Promise.reject(error); - } - } - i = 0; - len = responseInterceptorChain.length; - while (i < len) { - promise = promise.then(responseInterceptorChain[i++], responseInterceptorChain[i++]); - } - return promise; - } - getUri(config) { - config = mergeConfig(this.defaults, config); - const fullPath = buildFullPath(config.baseURL, config.url, config.allowAbsoluteUrls, config); - return buildURL(fullPath, config.params, config.paramsSerializer); - } -} - -// Provide aliases for supported request methods -utils$1.forEach(['delete', 'get', 'head', 'options'], function forEachMethodNoData(method) { - /*eslint func-names:0*/ - Axios.prototype[method] = function (url, config) { - return this.request(mergeConfig(config || {}, { - method, - url, - data: config && utils$1.hasOwnProp(config, 'data') ? config.data : undefined - })); - }; -}); -utils$1.forEach(['post', 'put', 'patch', 'query'], function forEachMethodWithData(method) { - function generateHTTPMethod(isForm) { - return function httpMethod(url, data, config) { - return this.request(mergeConfig(config || {}, { - method, - headers: isForm ? { - 'Content-Type': 'multipart/form-data' - } : {}, - url, - data - })); - }; - } - Axios.prototype[method] = generateHTTPMethod(); - - // QUERY is a safe/idempotent read method; multipart form bodies don't fit - // its semantics, so no queryForm shorthand is generated. - if (method !== 'query') { - Axios.prototype[method + 'Form'] = generateHTTPMethod(true); - } -}); - -/** - * A `CancelToken` is an object that can be used to request cancellation of an operation. - * - * @param {Function} executor The executor function. - * - * @returns {CancelToken} - */ -class CancelToken { - constructor(executor) { - if (typeof executor !== 'function') { - throw new TypeError('executor must be a function.'); - } - let resolvePromise; - this.promise = new Promise(function promiseExecutor(resolve) { - resolvePromise = resolve; - }); - const token = this; - - // eslint-disable-next-line func-names - this.promise.then(cancel => { - if (!token._listeners) return; - let i = token._listeners.length; - while (i-- > 0) { - token._listeners[i](cancel); - } - token._listeners = null; - }); - - // eslint-disable-next-line func-names - this.promise.then = onfulfilled => { - let _resolve; - // eslint-disable-next-line func-names - const promise = new Promise(resolve => { - token.subscribe(resolve); - _resolve = resolve; - }).then(onfulfilled); - promise.cancel = function reject() { - token.unsubscribe(_resolve); - }; - return promise; - }; - executor(function cancel(message, config, request) { - if (token.reason) { - // Cancellation has already been requested - return; - } - token.reason = new CanceledError(message, config, request); - resolvePromise(token.reason); - }); - } - - /** - * Throws a `CanceledError` if cancellation has been requested. - */ - throwIfRequested() { - if (this.reason) { - throw this.reason; - } - } - - /** - * Subscribe to the cancel signal - */ - - subscribe(listener) { - if (this.reason) { - listener(this.reason); - return; - } - if (this._listeners) { - this._listeners.push(listener); - } else { - this._listeners = [listener]; - } - } - - /** - * Unsubscribe from the cancel signal - */ - - unsubscribe(listener) { - if (!this._listeners) { - return; - } - const index = this._listeners.indexOf(listener); - if (index !== -1) { - this._listeners.splice(index, 1); - } - } - toAbortSignal() { - const controller = new AbortController(); - const abort = err => { - controller.abort(err); - }; - this.subscribe(abort); - controller.signal.unsubscribe = () => this.unsubscribe(abort); - return controller.signal; - } - - /** - * Returns an object that contains a new `CancelToken` and a function that, when called, - * cancels the `CancelToken`. - */ - static source() { - let cancel; - const token = new CancelToken(function executor(c) { - cancel = c; - }); - return { - token, - cancel - }; - } -} - -/** - * Syntactic sugar for invoking a function and expanding an array for arguments. - * - * Common use case would be to use `Function.prototype.apply`. - * - * ```js - * function f(x, y, z) {} - * const args = [1, 2, 3]; - * f.apply(null, args); - * ``` - * - * With `spread` this example can be re-written. - * - * ```js - * spread(function(x, y, z) {})([1, 2, 3]); - * ``` - * - * @param {Function} callback - * - * @returns {Function} - */ -function spread(callback) { - return function wrap(arr) { - return callback.apply(null, arr); - }; -} - -/** - * Determines whether the payload is an error thrown by Axios - * - * @param {*} payload The value to test - * - * @returns {boolean} True if the payload is an error thrown by Axios, otherwise false - */ -function isAxiosError(payload) { - return utils$1.isObject(payload) && payload.isAxiosError === true; -} - -const HttpStatusCode = { - Continue: 100, - SwitchingProtocols: 101, - Processing: 102, - EarlyHints: 103, - Ok: 200, - Created: 201, - Accepted: 202, - NonAuthoritativeInformation: 203, - NoContent: 204, - ResetContent: 205, - PartialContent: 206, - MultiStatus: 207, - AlreadyReported: 208, - ImUsed: 226, - MultipleChoices: 300, - MovedPermanently: 301, - Found: 302, - SeeOther: 303, - NotModified: 304, - UseProxy: 305, - Unused: 306, - TemporaryRedirect: 307, - PermanentRedirect: 308, - BadRequest: 400, - Unauthorized: 401, - PaymentRequired: 402, - Forbidden: 403, - NotFound: 404, - MethodNotAllowed: 405, - NotAcceptable: 406, - ProxyAuthenticationRequired: 407, - RequestTimeout: 408, - Conflict: 409, - Gone: 410, - LengthRequired: 411, - PreconditionFailed: 412, - PayloadTooLarge: 413, - UriTooLong: 414, - UnsupportedMediaType: 415, - RangeNotSatisfiable: 416, - ExpectationFailed: 417, - ImATeapot: 418, - MisdirectedRequest: 421, - UnprocessableEntity: 422, - Locked: 423, - FailedDependency: 424, - TooEarly: 425, - UpgradeRequired: 426, - PreconditionRequired: 428, - TooManyRequests: 429, - RequestHeaderFieldsTooLarge: 431, - UnavailableForLegalReasons: 451, - InternalServerError: 500, - NotImplemented: 501, - BadGateway: 502, - ServiceUnavailable: 503, - GatewayTimeout: 504, - HttpVersionNotSupported: 505, - VariantAlsoNegotiates: 506, - InsufficientStorage: 507, - LoopDetected: 508, - NotExtended: 510, - NetworkAuthenticationRequired: 511, - WebServerReturnsAnUnknownError: 520, - WebServerIsDown: 521, - ConnectionTimedOut: 522, - OriginIsUnreachable: 523, - TimeoutOccurred: 524, - SslHandshakeFailed: 525, - InvalidSslCertificate: 526 -}; -Object.entries(HttpStatusCode).forEach(([key, value]) => { - HttpStatusCode[value] = key; -}); - -/** - * Create an instance of Axios - * - * @param {Object} defaultConfig The default config for the instance - * - * @returns {Axios} A new instance of Axios - */ -function createInstance(defaultConfig) { - const context = new Axios(defaultConfig); - const instance = bind(Axios.prototype.request, context); - - // Copy axios.prototype to instance - utils$1.extend(instance, Axios.prototype, context, { - allOwnKeys: true - }); - - // Copy context to instance - utils$1.extend(instance, context, null, { - allOwnKeys: true - }); - - // Factory for creating new instances - instance.create = function create(instanceConfig) { - return createInstance(mergeConfig(defaultConfig, instanceConfig)); - }; - return instance; -} - -// Create the default instance to be exported -const axios = createInstance(defaults); - -// Expose Axios class to allow class inheritance -axios.Axios = Axios; - -// Expose Cancel & CancelToken -axios.CanceledError = CanceledError; -axios.CancelToken = CancelToken; -axios.isCancel = isCancel; -axios.VERSION = VERSION; -axios.toFormData = toFormData; - -// Expose AxiosError class -axios.AxiosError = AxiosError; - -// alias for CanceledError for backward compatibility -axios.Cancel = axios.CanceledError; - -// Expose all/spread -axios.all = function all(promises) { - return Promise.all(promises); -}; -axios.spread = spread; - -// Expose isAxiosError -axios.isAxiosError = isAxiosError; - -// Expose mergeConfig -axios.mergeConfig = mergeConfig; -axios.AxiosHeaders = AxiosHeaders; -axios.formToJSON = thing => formDataToJSON(utils$1.isHTMLForm(thing) ? new FormData(thing) : thing); -axios.getAdapter = adapters.getAdapter; -axios.HttpStatusCode = HttpStatusCode; -axios.default = axios; - -module.exports = axios; diff --git a/server/node_modules/axios/index.d.cts b/server/node_modules/axios/index.d.cts deleted file mode 100644 index 62a028c..0000000 --- a/server/node_modules/axios/index.d.cts +++ /dev/null @@ -1,762 +0,0 @@ -type MethodsHeaders = Partial< - { - [Key in axios.Method as Lowercase]: AxiosHeaders; - } & { common: AxiosHeaders } ->; - -type AxiosHeaderMatcher = - | string - | RegExp - | ((this: AxiosHeaders, value: string, name: string) => boolean); - -type AxiosHeaderParser = (this: AxiosHeaders, value: axios.AxiosHeaderValue, header: string) => any; - -type CommonRequestHeadersList = - | 'Accept' - | 'Content-Length' - | 'User-Agent' - | 'Content-Encoding' - | 'Authorization' - | 'Location'; - -type ContentType = - | axios.AxiosHeaderValue - | 'text/html' - | 'text/plain' - | 'multipart/form-data' - | 'application/json' - | 'application/x-www-form-urlencoded' - | 'application/octet-stream'; - -type CommonResponseHeadersList = - | 'Server' - | 'Content-Type' - | 'Content-Length' - | 'Cache-Control' - | 'Content-Encoding'; - -type CommonResponseHeaderKey = CommonResponseHeadersList | Lowercase; - -type BrowserProgressEvent = any; - -declare class AxiosHeaders { - constructor(headers?: axios.RawAxiosHeaders | AxiosHeaders | string); - - [key: string]: any; - - set( - headerName?: string, - value?: axios.AxiosHeaderValue, - rewrite?: boolean | AxiosHeaderMatcher - ): AxiosHeaders; - set(headers?: axios.RawAxiosHeaders | AxiosHeaders | string, rewrite?: boolean): AxiosHeaders; - set(headers?: Iterable<[string, axios.AxiosHeaderValue]>, rewrite?: boolean): AxiosHeaders; - - get( - headerName: string, - parser: typeof AxiosHeaders.parseParameters - ): axios.AxiosHeaderParameters; - get(headerName: string, parser: RegExp): RegExpExecArray | null; - get(headerName: string, matcher?: true | AxiosHeaderParser): axios.AxiosHeaderValue; - - has(header: string, matcher?: AxiosHeaderMatcher): boolean; - - delete(header: string | string[], matcher?: AxiosHeaderMatcher): boolean; - - clear(matcher?: AxiosHeaderMatcher): boolean; - - normalize(format: boolean): AxiosHeaders; - - concat( - ...targets: Array - ): AxiosHeaders; - - toJSON(asStrings: true): Record; - toJSON(asStrings?: false): Record; - toJSON(asStrings?: boolean): Record; - - static from(thing?: AxiosHeaders | axios.RawAxiosHeaders | string): AxiosHeaders; - - static parseParameters(value: axios.AxiosHeaderValue): axios.AxiosHeaderParameters; - - static accessor(header: string | string[]): AxiosHeaders; - - static concat( - ...targets: Array - ): AxiosHeaders; - - setContentType(value: ContentType, rewrite?: boolean | AxiosHeaderMatcher): AxiosHeaders; - getContentType(parser?: RegExp): RegExpExecArray | null; - getContentType(matcher?: AxiosHeaderMatcher): axios.AxiosHeaderValue; - hasContentType(matcher?: AxiosHeaderMatcher): boolean; - - setContentLength( - value: axios.AxiosHeaderValue, - rewrite?: boolean | AxiosHeaderMatcher - ): AxiosHeaders; - getContentLength(parser?: RegExp): RegExpExecArray | null; - getContentLength(matcher?: AxiosHeaderMatcher): axios.AxiosHeaderValue; - hasContentLength(matcher?: AxiosHeaderMatcher): boolean; - - setAccept(value: axios.AxiosHeaderValue, rewrite?: boolean | AxiosHeaderMatcher): AxiosHeaders; - getAccept(parser?: RegExp): RegExpExecArray | null; - getAccept(matcher?: AxiosHeaderMatcher): axios.AxiosHeaderValue; - hasAccept(matcher?: AxiosHeaderMatcher): boolean; - - setUserAgent(value: axios.AxiosHeaderValue, rewrite?: boolean | AxiosHeaderMatcher): AxiosHeaders; - getUserAgent(parser?: RegExp): RegExpExecArray | null; - getUserAgent(matcher?: AxiosHeaderMatcher): axios.AxiosHeaderValue; - hasUserAgent(matcher?: AxiosHeaderMatcher): boolean; - - setContentEncoding( - value: axios.AxiosHeaderValue, - rewrite?: boolean | AxiosHeaderMatcher - ): AxiosHeaders; - getContentEncoding(parser?: RegExp): RegExpExecArray | null; - getContentEncoding(matcher?: AxiosHeaderMatcher): axios.AxiosHeaderValue; - hasContentEncoding(matcher?: AxiosHeaderMatcher): boolean; - - setAuthorization( - value: axios.AxiosHeaderValue, - rewrite?: boolean | AxiosHeaderMatcher - ): AxiosHeaders; - getAuthorization(parser?: RegExp): RegExpExecArray | null; - getAuthorization(matcher?: AxiosHeaderMatcher): axios.AxiosHeaderValue; - hasAuthorization(matcher?: AxiosHeaderMatcher): boolean; - - getSetCookie(): string[]; - - toString(): string; - - [Symbol.iterator](): IterableIterator<[string, axios.AxiosHeaderValue]>; -} - -declare class AxiosError extends Error { - constructor( - message?: string, - code?: string, - config?: axios.InternalAxiosRequestConfig, - request?: any, - response?: axios.AxiosResponse - ); - - config?: axios.InternalAxiosRequestConfig; - code?: string; - request?: any; - response?: axios.AxiosResponse; - isAxiosError: boolean; - status?: number; - toJSON: () => object; - cause?: Error; - event?: BrowserProgressEvent; - static from( - error: Error | unknown, - code?: string, - config?: axios.InternalAxiosRequestConfig, - request?: any, - response?: axios.AxiosResponse, - customProps?: object - ): AxiosError; - static readonly ERR_FR_TOO_MANY_REDIRECTS = 'ERR_FR_TOO_MANY_REDIRECTS'; - static readonly ERR_BAD_OPTION_VALUE = 'ERR_BAD_OPTION_VALUE'; - static readonly ERR_BAD_OPTION = 'ERR_BAD_OPTION'; - static readonly ERR_NETWORK = 'ERR_NETWORK'; - static readonly ERR_DEPRECATED = 'ERR_DEPRECATED'; - static readonly ERR_BAD_RESPONSE = 'ERR_BAD_RESPONSE'; - static readonly ERR_BAD_REQUEST = 'ERR_BAD_REQUEST'; - static readonly ERR_NOT_SUPPORT = 'ERR_NOT_SUPPORT'; - static readonly ERR_INVALID_URL = 'ERR_INVALID_URL'; - static readonly ERR_CANCELED = 'ERR_CANCELED'; - static readonly ERR_FORM_DATA_DEPTH_EXCEEDED = 'ERR_FORM_DATA_DEPTH_EXCEEDED'; - static readonly ECONNABORTED = 'ECONNABORTED'; - static readonly ECONNREFUSED = 'ECONNREFUSED'; - static readonly ETIMEDOUT = 'ETIMEDOUT'; -} - -declare class CanceledError extends AxiosError { - constructor(message?: string, config?: axios.InternalAxiosRequestConfig, request?: any); - readonly name: 'CanceledError'; - __CANCEL__?: boolean; -} - -declare const axiosResponseDefault: unique symbol; - -type AxiosResponseDefault = typeof axiosResponseDefault; - -type AxiosResponseResult = R extends AxiosResponseDefault - ? axios.AxiosResponse - : R; - -declare class Axios { - constructor(config?: axios.AxiosRequestConfig); - defaults: axios.AxiosDefaults; - interceptors: { - request: axios.AxiosInterceptorManager; - response: axios.AxiosInterceptorManager; - }; - getUri(config?: axios.AxiosRequestConfig): string; - request( - config: axios.AxiosRequestConfig - ): Promise>; - get( - url: string, - config?: axios.AxiosRequestConfig - ): Promise>; - delete( - url: string, - config?: axios.AxiosRequestConfig - ): Promise>; - head( - url: string, - config?: axios.AxiosRequestConfig - ): Promise>; - options( - url: string, - config?: axios.AxiosRequestConfig - ): Promise>; - post( - url: string, - data?: D, - config?: axios.AxiosRequestConfig - ): Promise>; - put( - url: string, - data?: D, - config?: axios.AxiosRequestConfig - ): Promise>; - patch( - url: string, - data?: D, - config?: axios.AxiosRequestConfig - ): Promise>; - postForm( - url: string, - data?: D, - config?: axios.AxiosRequestConfig - ): Promise>; - putForm( - url: string, - data?: D, - config?: axios.AxiosRequestConfig - ): Promise>; - patchForm( - url: string, - data?: D, - config?: axios.AxiosRequestConfig - ): Promise>; - query( - url: string, - data?: D, - config?: axios.AxiosRequestConfig - ): Promise>; -} - -declare enum HttpStatusCode { - Continue = 100, - SwitchingProtocols = 101, - Processing = 102, - EarlyHints = 103, - Ok = 200, - Created = 201, - Accepted = 202, - NonAuthoritativeInformation = 203, - NoContent = 204, - ResetContent = 205, - PartialContent = 206, - MultiStatus = 207, - AlreadyReported = 208, - ImUsed = 226, - MultipleChoices = 300, - MovedPermanently = 301, - Found = 302, - SeeOther = 303, - NotModified = 304, - UseProxy = 305, - Unused = 306, - TemporaryRedirect = 307, - PermanentRedirect = 308, - BadRequest = 400, - Unauthorized = 401, - PaymentRequired = 402, - Forbidden = 403, - NotFound = 404, - MethodNotAllowed = 405, - NotAcceptable = 406, - ProxyAuthenticationRequired = 407, - RequestTimeout = 408, - Conflict = 409, - Gone = 410, - LengthRequired = 411, - PreconditionFailed = 412, - PayloadTooLarge = 413, - UriTooLong = 414, - UnsupportedMediaType = 415, - RangeNotSatisfiable = 416, - ExpectationFailed = 417, - ImATeapot = 418, - MisdirectedRequest = 421, - UnprocessableEntity = 422, - Locked = 423, - FailedDependency = 424, - TooEarly = 425, - UpgradeRequired = 426, - PreconditionRequired = 428, - TooManyRequests = 429, - RequestHeaderFieldsTooLarge = 431, - UnavailableForLegalReasons = 451, - InternalServerError = 500, - NotImplemented = 501, - BadGateway = 502, - ServiceUnavailable = 503, - GatewayTimeout = 504, - HttpVersionNotSupported = 505, - VariantAlsoNegotiates = 506, - InsufficientStorage = 507, - LoopDetected = 508, - NotExtended = 510, - NetworkAuthenticationRequired = 511, - WebServerReturnsAnUnknownError = 520, - WebServerIsDown = 521, - ConnectionTimedOut = 522, - OriginIsUnreachable = 523, - TimeoutOccurred = 524, - SslHandshakeFailed = 525, - InvalidSslCertificate = 526, -} - -type InternalAxiosError = AxiosError; - -declare namespace axios { - type AxiosHeaderParameters = Record; - - type AxiosError = InternalAxiosError; - - interface RawAxiosHeaders { - [key: string]: AxiosHeaderValue; - } - - type RawAxiosRequestHeaders = Partial< - RawAxiosHeaders & { - [Key in CommonRequestHeadersList]: AxiosHeaderValue; - } & { - 'Content-Type': ContentType; - } - >; - - type AxiosRequestHeaders = RawAxiosRequestHeaders & AxiosHeaders; - - type AxiosHeaderValue = AxiosHeaders | string | string[] | number | boolean | null; - - type RawCommonResponseHeaders = { - [Key in CommonResponseHeaderKey]: AxiosHeaderValue; - } & { - 'set-cookie': string[]; - }; - - type RawAxiosResponseHeaders = Partial; - - type AxiosResponseHeaders = RawAxiosResponseHeaders & AxiosHeaders; - - interface AxiosRequestTransformer { - (this: InternalAxiosRequestConfig, data: any, headers: AxiosRequestHeaders): any; - } - - interface AxiosResponseTransformer { - ( - this: InternalAxiosRequestConfig, - data: any, - headers: AxiosResponseHeaders, - status?: number - ): any; - } - - interface AxiosAdapter { - (config: InternalAxiosRequestConfig): AxiosPromise; - } - - interface AxiosBasicCredentials { - username: string; - password: string; - } - - interface AxiosProxyConfig { - host: string; - port: number; - auth?: AxiosBasicCredentials; - protocol?: string; - } - - type UppercaseMethod = - | 'GET' - | 'DELETE' - | 'HEAD' - | 'OPTIONS' - | 'POST' - | 'PUT' - | 'PATCH' - | 'PURGE' - | 'LINK' - | 'UNLINK' - | 'QUERY'; - - type Method = (UppercaseMethod | Lowercase) & {}; - - type ResponseType = 'arraybuffer' | 'blob' | 'document' | 'json' | 'text' | 'stream' | 'formdata'; - - type UppercaseResponseEncoding = - | 'ASCII' - | 'ANSI' - | 'BINARY' - | 'BASE64' - | 'BASE64URL' - | 'HEX' - | 'LATIN1' - | 'UCS-2' - | 'UCS2' - | 'UTF-8' - | 'UTF8' - | 'UTF16LE'; - - type responseEncoding = (UppercaseResponseEncoding | Lowercase) & {}; - - interface TransitionalOptions { - silentJSONParsing?: boolean; - forcedJSONParsing?: boolean; - clarifyTimeoutError?: boolean; - legacyInterceptorReqResOrdering?: boolean; - advertiseZstdAcceptEncoding?: boolean; - validateStatusUndefinedResolves?: boolean; - } - - interface GenericAbortSignal { - readonly aborted: boolean; - onabort?: ((...args: any) => any) | null; - addEventListener?: (...args: any) => any; - removeEventListener?: (...args: any) => any; - } - - interface FormDataVisitorHelpers { - defaultVisitor: SerializerVisitor; - convertValue: (value: any) => any; - isVisitable: (value: any) => boolean; - } - - interface SerializerVisitor { - ( - this: GenericFormData, - value: any, - key: string | number, - path: null | Array, - helpers: FormDataVisitorHelpers - ): boolean; - } - - interface SerializerOptions { - visitor?: SerializerVisitor; - dots?: boolean; - metaTokens?: boolean; - indexes?: boolean | null; - maxDepth?: number; - Blob?: { new (...args: any[]): any }; - } - - // tslint:disable-next-line - interface FormSerializerOptions extends SerializerOptions {} - - interface ParamEncoder { - (value: any, defaultEncoder: (value: any) => any): any; - } - - interface CustomParamsSerializer

> { - (params: P, options?: ParamsSerializerOptions

): string; - } - - interface ParamsSerializerOptions

> extends SerializerOptions { - encode?: ParamEncoder; - serialize?: CustomParamsSerializer

; - } - - type MaxUploadRate = number; - - type MaxDownloadRate = number; - - interface AxiosProgressEvent { - loaded: number; - total?: number; - progress?: number; - bytes: number; - rate?: number; - estimated?: number; - upload?: boolean; - download?: boolean; - event?: BrowserProgressEvent; - lengthComputable: boolean; - } - - type Milliseconds = number; - - type AxiosAdapterName = 'fetch' | 'xhr' | 'http' | (string & {}); - - type AxiosAdapterConfig = AxiosAdapter | AxiosAdapterName; - - type AddressFamily = 4 | 6 | undefined; - - interface LookupAddressEntry { - address: string; - family?: AddressFamily; - } - - type LookupAddress = string | LookupAddressEntry; - - interface AxiosRequestConfig { - url?: string; - method?: Method | string; - baseURL?: string; - allowAbsoluteUrls?: boolean; - transformRequest?: AxiosRequestTransformer | AxiosRequestTransformer[]; - transformResponse?: AxiosResponseTransformer | AxiosResponseTransformer[]; - headers?: (RawAxiosRequestHeaders & MethodsHeaders) | AxiosHeaders; - params?: P; - paramsSerializer?: - | ParamsSerializerOptions : P> - | CustomParamsSerializer : P>; - data?: D; - timeout?: Milliseconds; - timeoutErrorMessage?: string; - withCredentials?: boolean; - adapter?: AxiosAdapterConfig | AxiosAdapterConfig[]; - auth?: AxiosBasicCredentials; - responseType?: ResponseType; - responseEncoding?: responseEncoding | string; - xsrfCookieName?: string; - xsrfHeaderName?: string; - onUploadProgress?: (progressEvent: AxiosProgressEvent) => void; - onDownloadProgress?: (progressEvent: AxiosProgressEvent) => void; - maxContentLength?: number; - validateStatus?: ((status: number) => boolean) | null; - maxBodyLength?: number; - maxRedirects?: number; - maxRate?: number | [MaxUploadRate, MaxDownloadRate]; - beforeRedirect?: ( - options: Record, - responseDetails: { headers: Record; statusCode: HttpStatusCode }, - requestDetails: { headers: Record; url: string; method: string }, - ) => void; - socketPath?: string | null; - allowedSocketPaths?: string | string[] | null; - transport?: any; - httpAgent?: any; - httpsAgent?: any; - proxy?: AxiosProxyConfig | false; - cancelToken?: CancelToken | undefined; - decompress?: boolean; - transitional?: TransitionalOptions; - signal?: GenericAbortSignal; - insecureHTTPParser?: boolean; - env?: { - FormData?: new (...args: any[]) => object; - fetch?: (input: URL | Request | string, init?: RequestInit) => Promise; - Request?: new (input: URL | Request | string, init?: RequestInit) => Request; - Response?: new ( - body?: ArrayBuffer | ArrayBufferView | Blob | FormData | URLSearchParams | string | null, - init?: ResponseInit - ) => Response; - }; - formSerializer?: FormSerializerOptions; - family?: AddressFamily; - lookup?: - | (( - hostname: string, - options: object, - cb: ( - err: Error | null, - address: LookupAddress | LookupAddress[], - family?: AddressFamily - ) => void - ) => void) - | (( - hostname: string, - options: object - ) => Promise< - | [address: LookupAddressEntry | LookupAddressEntry[], family?: AddressFamily] - | LookupAddress - >); - withXSRFToken?: boolean | ((config: InternalAxiosRequestConfig) => boolean | undefined); - parseReviver?: (this: any, key: string, value: any, context?: { source?: string }) => any; - fetchOptions?: - | Omit - | Record; - httpVersion?: 1 | 2; - http2Options?: Record & { - sessionTimeout?: number; - }; - formDataHeaderPolicy?: 'legacy' | 'content-only'; - redact?: string[]; - sensitiveHeaders?: string[]; - } - - // Alias - type RawAxiosRequestConfig = AxiosRequestConfig; - - interface InternalAxiosRequestConfig extends AxiosRequestConfig { - headers: AxiosRequestHeaders; - } - - interface HeadersDefaults { - common: RawAxiosRequestHeaders; - delete: RawAxiosRequestHeaders; - get: RawAxiosRequestHeaders; - head: RawAxiosRequestHeaders; - post: RawAxiosRequestHeaders; - put: RawAxiosRequestHeaders; - patch: RawAxiosRequestHeaders; - options?: RawAxiosRequestHeaders; - purge?: RawAxiosRequestHeaders; - link?: RawAxiosRequestHeaders; - unlink?: RawAxiosRequestHeaders; - query?: RawAxiosRequestHeaders; - } - - interface AxiosDefaults extends Omit, 'headers'> { - headers: HeadersDefaults; - } - - interface CreateAxiosDefaults extends Omit< - AxiosRequestConfig, - 'headers' - > { - headers?: RawAxiosRequestHeaders | AxiosHeaders | Partial; - } - - interface AxiosResponse { - data: T; - status: number; - statusText: string; - headers: (H & RawAxiosResponseHeaders) | AxiosResponseHeaders; - config: InternalAxiosRequestConfig; - request?: any; - } - - type AxiosPromise = Promise>; - - interface CancelStatic { - new (message?: string): Cancel; - } - - interface Cancel { - message: string | undefined; - } - - interface Canceler { - (message?: string, config?: AxiosRequestConfig, request?: any): void; - } - - interface CancelTokenStatic { - new (executor: (cancel: Canceler) => void): CancelToken; - source(): CancelTokenSource; - } - - interface CancelToken { - promise: Promise; - reason?: Cancel; - throwIfRequested(): void; - subscribe(listener: (cancel: Cancel | any) => void): void; - unsubscribe(listener: (cancel: Cancel | any) => void): void; - toAbortSignal(): AbortSignal; - } - - interface CancelTokenSource { - token: CancelToken; - cancel: Canceler; - } - - interface AxiosInterceptorOptions { - synchronous?: boolean; - runWhen?: ((config: InternalAxiosRequestConfig) => boolean) | null; - } - - type AxiosInterceptorFulfilled = (value: T) => T | Promise; - type AxiosInterceptorRejected = (error: any) => any; - - type AxiosRequestInterceptorUse = ( - onFulfilled?: AxiosInterceptorFulfilled | null, - onRejected?: AxiosInterceptorRejected | null, - options?: AxiosInterceptorOptions - ) => number; - - type AxiosResponseInterceptorUse = ( - onFulfilled?: AxiosInterceptorFulfilled | null, - onRejected?: AxiosInterceptorRejected | null - ) => number; - - interface AxiosInterceptorHandler { - fulfilled: AxiosInterceptorFulfilled; - rejected?: AxiosInterceptorRejected; - synchronous: boolean; - runWhen?: ((config: InternalAxiosRequestConfig) => boolean) | null; - } - - interface AxiosInterceptorManager { - use: V extends AxiosResponse ? AxiosResponseInterceptorUse : AxiosRequestInterceptorUse; - eject(id: number): void; - clear(): void; - handlers?: Array>; - } - - interface AxiosInstance extends Axios { - ( - config: AxiosRequestConfig - ): Promise>; - ( - url: string, - config?: AxiosRequestConfig - ): Promise>; - - create(config?: CreateAxiosDefaults): AxiosInstance; - defaults: Omit & { - headers: HeadersDefaults & { - [key: string]: AxiosHeaderValue; - }; - }; - } - - interface GenericFormData { - append(name: string, value: any, options?: any): any; - } - - interface GenericHTMLFormElement { - name: string; - method: string; - submit(): void; - } - - interface AxiosStatic extends AxiosInstance { - Cancel: typeof CanceledError; - CancelToken: CancelTokenStatic; - Axios: typeof Axios; - AxiosError: typeof AxiosError; - CanceledError: typeof CanceledError; - HttpStatusCode: typeof HttpStatusCode; - readonly VERSION: string; - isCancel(value: any): value is CanceledError; - all(values: Array>): Promise; - spread(callback: (...args: T[]) => R): (array: T[]) => R; - isAxiosError(payload: any): payload is AxiosError; - toFormData( - sourceObj: object, - targetFormData?: GenericFormData, - options?: FormSerializerOptions - ): GenericFormData; - formToJSON(form: GenericFormData | GenericHTMLFormElement): object; - getAdapter(adapters: AxiosAdapterConfig | AxiosAdapterConfig[] | undefined): AxiosAdapter; - AxiosHeaders: typeof AxiosHeaders; - mergeConfig( - config1: AxiosRequestConfig, - config2: AxiosRequestConfig - ): AxiosRequestConfig; - } -} - -declare const axios: axios.AxiosStatic; - -export = axios; diff --git a/server/node_modules/axios/index.d.ts b/server/node_modules/axios/index.d.ts deleted file mode 100644 index 6339f6d..0000000 --- a/server/node_modules/axios/index.d.ts +++ /dev/null @@ -1,783 +0,0 @@ -// TypeScript Version: 4.7 -type StringLiteralsOrString = Literals | (string & {}); - -export type AxiosHeaderValue = AxiosHeaders | string | string[] | number | boolean | null; - -export type AxiosHeaderParameters = Record; - -export interface RawAxiosHeaders { - [key: string]: AxiosHeaderValue; -} - -type MethodsHeaders = Partial< - { - [Key in Method as Lowercase]: AxiosHeaders; - } & { common: AxiosHeaders } ->; - -type AxiosHeaderMatcher = - | string - | RegExp - | ((this: AxiosHeaders, value: string, name: string) => boolean); - -type AxiosHeaderParser = (this: AxiosHeaders, value: AxiosHeaderValue, header: string) => any; - -export class AxiosHeaders { - constructor(headers?: RawAxiosHeaders | AxiosHeaders | string); - - [key: string]: any; - - set( - headerName?: string, - value?: AxiosHeaderValue, - rewrite?: boolean | AxiosHeaderMatcher - ): AxiosHeaders; - set(headers?: RawAxiosHeaders | AxiosHeaders | string, rewrite?: boolean): AxiosHeaders; - set(headers?: Iterable<[string, AxiosHeaderValue]>, rewrite?: boolean): AxiosHeaders; - - get(headerName: string, parser: typeof AxiosHeaders.parseParameters): AxiosHeaderParameters; - get(headerName: string, parser: RegExp): RegExpExecArray | null; - get(headerName: string, matcher?: true | AxiosHeaderParser): AxiosHeaderValue; - - has(header: string, matcher?: AxiosHeaderMatcher): boolean; - - delete(header: string | string[], matcher?: AxiosHeaderMatcher): boolean; - - clear(matcher?: AxiosHeaderMatcher): boolean; - - normalize(format: boolean): AxiosHeaders; - - concat( - ...targets: Array - ): AxiosHeaders; - - toJSON(asStrings: true): Record; - toJSON(asStrings?: false): Record; - toJSON(asStrings?: boolean): Record; - - static from(thing?: AxiosHeaders | RawAxiosHeaders | string): AxiosHeaders; - - static parseParameters(value: AxiosHeaderValue): AxiosHeaderParameters; - - static accessor(header: string | string[]): AxiosHeaders; - - static concat( - ...targets: Array - ): AxiosHeaders; - - setContentType(value: ContentType, rewrite?: boolean | AxiosHeaderMatcher): AxiosHeaders; - getContentType(parser?: RegExp): RegExpExecArray | null; - getContentType(matcher?: AxiosHeaderMatcher): AxiosHeaderValue; - hasContentType(matcher?: AxiosHeaderMatcher): boolean; - - setContentLength(value: AxiosHeaderValue, rewrite?: boolean | AxiosHeaderMatcher): AxiosHeaders; - getContentLength(parser?: RegExp): RegExpExecArray | null; - getContentLength(matcher?: AxiosHeaderMatcher): AxiosHeaderValue; - hasContentLength(matcher?: AxiosHeaderMatcher): boolean; - - setAccept(value: AxiosHeaderValue, rewrite?: boolean | AxiosHeaderMatcher): AxiosHeaders; - getAccept(parser?: RegExp): RegExpExecArray | null; - getAccept(matcher?: AxiosHeaderMatcher): AxiosHeaderValue; - hasAccept(matcher?: AxiosHeaderMatcher): boolean; - - setUserAgent(value: AxiosHeaderValue, rewrite?: boolean | AxiosHeaderMatcher): AxiosHeaders; - getUserAgent(parser?: RegExp): RegExpExecArray | null; - getUserAgent(matcher?: AxiosHeaderMatcher): AxiosHeaderValue; - hasUserAgent(matcher?: AxiosHeaderMatcher): boolean; - - setContentEncoding(value: AxiosHeaderValue, rewrite?: boolean | AxiosHeaderMatcher): AxiosHeaders; - getContentEncoding(parser?: RegExp): RegExpExecArray | null; - getContentEncoding(matcher?: AxiosHeaderMatcher): AxiosHeaderValue; - hasContentEncoding(matcher?: AxiosHeaderMatcher): boolean; - - setAuthorization(value: AxiosHeaderValue, rewrite?: boolean | AxiosHeaderMatcher): AxiosHeaders; - getAuthorization(parser?: RegExp): RegExpExecArray | null; - getAuthorization(matcher?: AxiosHeaderMatcher): AxiosHeaderValue; - hasAuthorization(matcher?: AxiosHeaderMatcher): boolean; - - getSetCookie(): string[]; - - toString(): string; - - [Symbol.iterator](): IterableIterator<[string, AxiosHeaderValue]>; -} - -type CommonRequestHeadersList = - | 'Accept' - | 'Content-Length' - | 'User-Agent' - | 'Content-Encoding' - | 'Authorization' - | 'Location'; - -type ContentType = - | AxiosHeaderValue - | 'text/html' - | 'text/plain' - | 'multipart/form-data' - | 'application/json' - | 'application/x-www-form-urlencoded' - | 'application/octet-stream'; - -export type RawAxiosRequestHeaders = Partial< - RawAxiosHeaders & { - [Key in CommonRequestHeadersList]: AxiosHeaderValue; - } & { - 'Content-Type': ContentType; - } ->; - -export type AxiosRequestHeaders = RawAxiosRequestHeaders & AxiosHeaders; - -type CommonResponseHeadersList = - | 'Server' - | 'Content-Type' - | 'Content-Length' - | 'Cache-Control' - | 'Content-Encoding'; - -type CommonResponseHeaderKey = CommonResponseHeadersList | Lowercase; - -type RawCommonResponseHeaders = { - [Key in CommonResponseHeaderKey]: AxiosHeaderValue; -} & { - 'set-cookie': string[]; -}; - -export type RawAxiosResponseHeaders = Partial; - -export type AxiosResponseHeaders = RawAxiosResponseHeaders & AxiosHeaders; - -export interface AxiosRequestTransformer { - (this: InternalAxiosRequestConfig, data: any, headers: AxiosRequestHeaders): any; -} - -export interface AxiosResponseTransformer { - ( - this: InternalAxiosRequestConfig, - data: any, - headers: AxiosResponseHeaders, - status?: number - ): any; -} - -export interface AxiosAdapter { - (config: InternalAxiosRequestConfig): AxiosPromise; -} - -export interface AxiosBasicCredentials { - username: string; - password: string; -} - -export interface AxiosProxyConfig { - host: string; - port: number; - auth?: AxiosBasicCredentials; - protocol?: string; -} - -export enum HttpStatusCode { - Continue = 100, - SwitchingProtocols = 101, - Processing = 102, - EarlyHints = 103, - Ok = 200, - Created = 201, - Accepted = 202, - NonAuthoritativeInformation = 203, - NoContent = 204, - ResetContent = 205, - PartialContent = 206, - MultiStatus = 207, - AlreadyReported = 208, - ImUsed = 226, - MultipleChoices = 300, - MovedPermanently = 301, - Found = 302, - SeeOther = 303, - NotModified = 304, - UseProxy = 305, - Unused = 306, - TemporaryRedirect = 307, - PermanentRedirect = 308, - BadRequest = 400, - Unauthorized = 401, - PaymentRequired = 402, - Forbidden = 403, - NotFound = 404, - MethodNotAllowed = 405, - NotAcceptable = 406, - ProxyAuthenticationRequired = 407, - RequestTimeout = 408, - Conflict = 409, - Gone = 410, - LengthRequired = 411, - PreconditionFailed = 412, - PayloadTooLarge = 413, - UriTooLong = 414, - UnsupportedMediaType = 415, - RangeNotSatisfiable = 416, - ExpectationFailed = 417, - ImATeapot = 418, - MisdirectedRequest = 421, - UnprocessableEntity = 422, - Locked = 423, - FailedDependency = 424, - TooEarly = 425, - UpgradeRequired = 426, - PreconditionRequired = 428, - TooManyRequests = 429, - RequestHeaderFieldsTooLarge = 431, - UnavailableForLegalReasons = 451, - InternalServerError = 500, - NotImplemented = 501, - BadGateway = 502, - ServiceUnavailable = 503, - GatewayTimeout = 504, - HttpVersionNotSupported = 505, - VariantAlsoNegotiates = 506, - InsufficientStorage = 507, - LoopDetected = 508, - NotExtended = 510, - NetworkAuthenticationRequired = 511, - WebServerReturnsAnUnknownError = 520, - WebServerIsDown = 521, - ConnectionTimedOut = 522, - OriginIsUnreachable = 523, - TimeoutOccurred = 524, - SslHandshakeFailed = 525, - InvalidSslCertificate = 526, -} - -type UppercaseMethod = - | 'GET' - | 'DELETE' - | 'HEAD' - | 'OPTIONS' - | 'POST' - | 'PUT' - | 'PATCH' - | 'PURGE' - | 'LINK' - | 'UNLINK' - | 'QUERY'; - -export type Method = (UppercaseMethod | Lowercase) & {}; - -export type ResponseType = - | 'arraybuffer' - | 'blob' - | 'document' - | 'json' - | 'text' - | 'stream' - | 'formdata'; - -type UppercaseResponseEncoding = - | 'ASCII' - | 'ANSI' - | 'BINARY' - | 'BASE64' - | 'BASE64URL' - | 'HEX' - | 'LATIN1' - | 'UCS-2' - | 'UCS2' - | 'UTF-8' - | 'UTF8' - | 'UTF16LE'; - -export type responseEncoding = ( - | UppercaseResponseEncoding - | Lowercase -) & {}; - -export interface TransitionalOptions { - silentJSONParsing?: boolean; - forcedJSONParsing?: boolean; - clarifyTimeoutError?: boolean; - legacyInterceptorReqResOrdering?: boolean; - advertiseZstdAcceptEncoding?: boolean; - validateStatusUndefinedResolves?: boolean; -} - -export interface GenericAbortSignal { - readonly aborted: boolean; - onabort?: ((...args: any) => any) | null; - addEventListener?: (...args: any) => any; - removeEventListener?: (...args: any) => any; -} - -export interface FormDataVisitorHelpers { - defaultVisitor: SerializerVisitor; - convertValue: (value: any) => any; - isVisitable: (value: any) => boolean; -} - -export interface SerializerVisitor { - ( - this: GenericFormData, - value: any, - key: string | number, - path: null | Array, - helpers: FormDataVisitorHelpers - ): boolean; -} - -export interface SerializerOptions { - visitor?: SerializerVisitor; - dots?: boolean; - metaTokens?: boolean; - indexes?: boolean | null; - maxDepth?: number; - Blob?: { new (...args: any[]): any }; -} - -// tslint:disable-next-line -export interface FormSerializerOptions extends SerializerOptions {} - -export interface ParamEncoder { - (value: any, defaultEncoder: (value: any) => any): any; -} - -export interface CustomParamsSerializer

> { - (params: P, options?: ParamsSerializerOptions

): string; -} - -export interface ParamsSerializerOptions

> extends SerializerOptions { - encode?: ParamEncoder; - serialize?: CustomParamsSerializer

; -} - -type MaxUploadRate = number; - -type MaxDownloadRate = number; - -type BrowserProgressEvent = any; - -export interface AxiosProgressEvent { - loaded: number; - total?: number; - progress?: number; - bytes: number; - rate?: number; - estimated?: number; - upload?: boolean; - download?: boolean; - event?: BrowserProgressEvent; - lengthComputable: boolean; -} - -type Milliseconds = number; - -type AxiosAdapterName = StringLiteralsOrString<'xhr' | 'http' | 'fetch'>; - -type AxiosAdapterConfig = AxiosAdapter | AxiosAdapterName; - -export type AddressFamily = 4 | 6 | undefined; - -export interface LookupAddressEntry { - address: string; - family?: AddressFamily; -} - -export type LookupAddress = string | LookupAddressEntry; - -export interface AxiosRequestConfig { - url?: string; - method?: StringLiteralsOrString; - baseURL?: string; - allowAbsoluteUrls?: boolean; - transformRequest?: AxiosRequestTransformer | AxiosRequestTransformer[]; - transformResponse?: AxiosResponseTransformer | AxiosResponseTransformer[]; - headers?: (RawAxiosRequestHeaders & MethodsHeaders) | AxiosHeaders; - params?: P; - paramsSerializer?: - | ParamsSerializerOptions : P> - | CustomParamsSerializer : P>; - data?: D; - timeout?: Milliseconds; - timeoutErrorMessage?: string; - withCredentials?: boolean; - adapter?: AxiosAdapterConfig | AxiosAdapterConfig[]; - auth?: AxiosBasicCredentials; - responseType?: ResponseType; - responseEncoding?: StringLiteralsOrString; - xsrfCookieName?: string; - xsrfHeaderName?: string; - onUploadProgress?: (progressEvent: AxiosProgressEvent) => void; - onDownloadProgress?: (progressEvent: AxiosProgressEvent) => void; - maxContentLength?: number; - validateStatus?: ((status: number) => boolean) | null; - maxBodyLength?: number; - maxRedirects?: number; - maxRate?: number | [MaxUploadRate, MaxDownloadRate]; - beforeRedirect?: ( - options: Record, - responseDetails: { - headers: Record; - statusCode: HttpStatusCode; - }, - requestDetails: { - headers: Record; - url: string; - method: string; - }, - ) => void; - socketPath?: string | null; - allowedSocketPaths?: string | string[] | null; - transport?: any; - httpAgent?: any; - httpsAgent?: any; - proxy?: AxiosProxyConfig | false; - cancelToken?: CancelToken | undefined; - decompress?: boolean; - transitional?: TransitionalOptions; - signal?: GenericAbortSignal; - insecureHTTPParser?: boolean; - env?: { - FormData?: new (...args: any[]) => object; - fetch?: (input: URL | Request | string, init?: RequestInit) => Promise; - Request?: new (input: URL | Request | string, init?: RequestInit) => Request; - Response?: new ( - body?: ArrayBuffer | ArrayBufferView | Blob | FormData | URLSearchParams | string | null, - init?: ResponseInit - ) => Response; - }; - formSerializer?: FormSerializerOptions; - family?: AddressFamily; - lookup?: - | (( - hostname: string, - options: object, - cb: ( - err: Error | null, - address: LookupAddress | LookupAddress[], - family?: AddressFamily - ) => void - ) => void) - | (( - hostname: string, - options: object - ) => Promise< - [address: LookupAddressEntry | LookupAddressEntry[], family?: AddressFamily] | LookupAddress - >); - withXSRFToken?: boolean | ((config: InternalAxiosRequestConfig) => boolean | undefined); - parseReviver?: (this: any, key: string, value: any, context?: { source?: string }) => any; - fetchOptions?: Omit | Record; - httpVersion?: 1 | 2; - http2Options?: Record & { - sessionTimeout?: number; - }; - formDataHeaderPolicy?: 'legacy' | 'content-only'; - redact?: string[]; - sensitiveHeaders?: string[]; -} - -// Alias -export type RawAxiosRequestConfig = AxiosRequestConfig; - -export interface InternalAxiosRequestConfig extends AxiosRequestConfig { - headers: AxiosRequestHeaders; -} - -export interface HeadersDefaults { - common: RawAxiosRequestHeaders; - delete: RawAxiosRequestHeaders; - get: RawAxiosRequestHeaders; - head: RawAxiosRequestHeaders; - post: RawAxiosRequestHeaders; - put: RawAxiosRequestHeaders; - patch: RawAxiosRequestHeaders; - options?: RawAxiosRequestHeaders; - purge?: RawAxiosRequestHeaders; - link?: RawAxiosRequestHeaders; - unlink?: RawAxiosRequestHeaders; - query?: RawAxiosRequestHeaders; -} - -export interface AxiosDefaults extends Omit, 'headers'> { - headers: HeadersDefaults; -} - -export interface CreateAxiosDefaults extends Omit< - AxiosRequestConfig, - 'headers' -> { - headers?: RawAxiosRequestHeaders | AxiosHeaders | Partial; -} - -export interface AxiosResponse { - data: T; - status: number; - statusText: string; - headers: (H & RawAxiosResponseHeaders) | AxiosResponseHeaders; - config: InternalAxiosRequestConfig; - request?: any; -} - -export class AxiosError extends Error { - constructor( - message?: string, - code?: string, - config?: InternalAxiosRequestConfig, - request?: any, - response?: AxiosResponse - ); - - config?: InternalAxiosRequestConfig; - code?: string; - request?: any; - response?: AxiosResponse; - isAxiosError: boolean; - status?: number; - toJSON: () => object; - cause?: Error; - event?: BrowserProgressEvent; - static from( - error: Error | unknown, - code?: string, - config?: InternalAxiosRequestConfig, - request?: any, - response?: AxiosResponse, - customProps?: object - ): AxiosError; - static readonly ERR_FR_TOO_MANY_REDIRECTS = 'ERR_FR_TOO_MANY_REDIRECTS'; - static readonly ERR_BAD_OPTION_VALUE = 'ERR_BAD_OPTION_VALUE'; - static readonly ERR_BAD_OPTION = 'ERR_BAD_OPTION'; - static readonly ERR_NETWORK = 'ERR_NETWORK'; - static readonly ERR_DEPRECATED = 'ERR_DEPRECATED'; - static readonly ERR_BAD_RESPONSE = 'ERR_BAD_RESPONSE'; - static readonly ERR_BAD_REQUEST = 'ERR_BAD_REQUEST'; - static readonly ERR_NOT_SUPPORT = 'ERR_NOT_SUPPORT'; - static readonly ERR_INVALID_URL = 'ERR_INVALID_URL'; - static readonly ERR_CANCELED = 'ERR_CANCELED'; - static readonly ERR_FORM_DATA_DEPTH_EXCEEDED = 'ERR_FORM_DATA_DEPTH_EXCEEDED'; - static readonly ECONNABORTED = 'ECONNABORTED'; - static readonly ECONNREFUSED = 'ECONNREFUSED'; - static readonly ETIMEDOUT = 'ETIMEDOUT'; -} - -export class CanceledError extends AxiosError { - constructor(message?: string, config?: InternalAxiosRequestConfig, request?: any); - readonly name: 'CanceledError'; - __CANCEL__?: boolean; -} - -declare const axiosResponseDefault: unique symbol; - -type AxiosResponseDefault = typeof axiosResponseDefault; - -type AxiosResponseResult = R extends AxiosResponseDefault - ? AxiosResponse - : R; - -export type AxiosPromise = Promise>; - -export interface CancelStatic { - new (message?: string): Cancel; -} - -export interface Cancel { - message: string | undefined; -} - -export interface Canceler { - (message?: string, config?: AxiosRequestConfig, request?: any): void; -} - -export interface CancelTokenStatic { - new (executor: (cancel: Canceler) => void): CancelToken; - source(): CancelTokenSource; -} - -export interface CancelToken { - promise: Promise; - reason?: Cancel; - throwIfRequested(): void; - subscribe(listener: (cancel: Cancel | any) => void): void; - unsubscribe(listener: (cancel: Cancel | any) => void): void; - toAbortSignal(): AbortSignal; -} - -export interface CancelTokenSource { - token: CancelToken; - cancel: Canceler; -} - -export interface AxiosInterceptorOptions { - synchronous?: boolean; - runWhen?: ((config: InternalAxiosRequestConfig) => boolean) | null; -} - -type AxiosInterceptorFulfilled = (value: T) => T | Promise; -type AxiosInterceptorRejected = (error: any) => any; - -type AxiosRequestInterceptorUse = ( - onFulfilled?: AxiosInterceptorFulfilled | null, - onRejected?: AxiosInterceptorRejected | null, - options?: AxiosInterceptorOptions -) => number; - -type AxiosResponseInterceptorUse = ( - onFulfilled?: AxiosInterceptorFulfilled | null, - onRejected?: AxiosInterceptorRejected | null -) => number; - -interface AxiosInterceptorHandler { - fulfilled: AxiosInterceptorFulfilled; - rejected?: AxiosInterceptorRejected; - synchronous: boolean; - runWhen?: ((config: InternalAxiosRequestConfig) => boolean) | null; -} - -export interface AxiosInterceptorManager { - use: V extends AxiosResponse ? AxiosResponseInterceptorUse : AxiosRequestInterceptorUse; - eject(id: number): void; - clear(): void; - handlers?: Array>; -} - -export class Axios { - constructor(config?: AxiosRequestConfig); - defaults: AxiosDefaults; - interceptors: { - request: AxiosInterceptorManager; - response: AxiosInterceptorManager; - }; - getUri(config?: AxiosRequestConfig): string; - request( - config: AxiosRequestConfig - ): Promise>; - get( - url: string, - config?: AxiosRequestConfig - ): Promise>; - delete( - url: string, - config?: AxiosRequestConfig - ): Promise>; - head( - url: string, - config?: AxiosRequestConfig - ): Promise>; - options( - url: string, - config?: AxiosRequestConfig - ): Promise>; - post( - url: string, - data?: D, - config?: AxiosRequestConfig - ): Promise>; - put( - url: string, - data?: D, - config?: AxiosRequestConfig - ): Promise>; - patch( - url: string, - data?: D, - config?: AxiosRequestConfig - ): Promise>; - postForm( - url: string, - data?: D, - config?: AxiosRequestConfig - ): Promise>; - putForm( - url: string, - data?: D, - config?: AxiosRequestConfig - ): Promise>; - patchForm( - url: string, - data?: D, - config?: AxiosRequestConfig - ): Promise>; - query( - url: string, - data?: D, - config?: AxiosRequestConfig - ): Promise>; -} - -export interface AxiosInstance extends Axios { - ( - config: AxiosRequestConfig - ): Promise>; - ( - url: string, - config?: AxiosRequestConfig - ): Promise>; - - create(config?: CreateAxiosDefaults): AxiosInstance; - defaults: Omit & { - headers: HeadersDefaults & { - [key: string]: AxiosHeaderValue; - }; - }; -} - -export interface GenericFormData { - append(name: string, value: any, options?: any): any; -} - -export interface GenericHTMLFormElement { - name: string; - method: string; - submit(): void; -} - -export function getAdapter( - adapters: AxiosAdapterConfig | AxiosAdapterConfig[] | undefined -): AxiosAdapter; - -export function toFormData( - sourceObj: object, - targetFormData?: GenericFormData, - options?: FormSerializerOptions -): GenericFormData; - -export function formToJSON(form: GenericFormData | GenericHTMLFormElement): object; - -export function isAxiosError( - payload: any -): payload is AxiosError; - -export function spread(callback: (...args: T[]) => R): (array: T[]) => R; - -export function isCancel(value: any): value is CanceledError; - -export function all(values: Array>): Promise; - -export function mergeConfig( - config1: AxiosRequestConfig, - config2: AxiosRequestConfig -): AxiosRequestConfig; - -export function create(config?: CreateAxiosDefaults): AxiosInstance; - -export interface AxiosStatic extends AxiosInstance { - Cancel: typeof CanceledError; - CancelToken: CancelTokenStatic; - Axios: typeof Axios; - AxiosError: typeof AxiosError; - HttpStatusCode: typeof HttpStatusCode; - readonly VERSION: string; - isCancel: typeof isCancel; - all: typeof all; - spread: typeof spread; - isAxiosError: typeof isAxiosError; - toFormData: typeof toFormData; - formToJSON: typeof formToJSON; - getAdapter: typeof getAdapter; - CanceledError: typeof CanceledError; - AxiosHeaders: typeof AxiosHeaders; - mergeConfig: typeof mergeConfig; -} - -declare const axios: AxiosStatic; - -export default axios; diff --git a/server/node_modules/axios/index.js b/server/node_modules/axios/index.js deleted file mode 100644 index 5bc0365..0000000 --- a/server/node_modules/axios/index.js +++ /dev/null @@ -1,45 +0,0 @@ -import axios from './lib/axios.js'; - -// This module is intended to unwrap Axios default export as named. -// Keep top-level export same with static properties -// so that it can keep same with es module or cjs -const { - Axios, - AxiosError, - CanceledError, - isCancel, - CancelToken, - VERSION, - all, - Cancel, - isAxiosError, - spread, - toFormData, - AxiosHeaders, - HttpStatusCode, - formToJSON, - getAdapter, - mergeConfig, - create, -} = axios; - -export { - axios as default, - create, - Axios, - AxiosError, - CanceledError, - isCancel, - CancelToken, - VERSION, - all, - Cancel, - isAxiosError, - spread, - toFormData, - AxiosHeaders, - HttpStatusCode, - formToJSON, - getAdapter, - mergeConfig, -}; diff --git a/server/node_modules/axios/lib/adapters/README.md b/server/node_modules/axios/lib/adapters/README.md deleted file mode 100644 index 8d9dd97..0000000 --- a/server/node_modules/axios/lib/adapters/README.md +++ /dev/null @@ -1,36 +0,0 @@ -# axios // adapters - -The modules under `adapters/` are modules that handle dispatching a request and settling a returned `Promise` once a response is received. - -## Example - -```js -var settle = require('../core/settle'); - -module.exports = function myAdapter(config) { - // At this point: - // - config has been merged with defaults - // - request transformers have already run - // - request interceptors have already run - - // Make the request using config provided - // Upon response settle the Promise - - return new Promise(function (resolve, reject) { - var response = { - data: responseData, - status: request.status, - statusText: request.statusText, - headers: responseHeaders, - config: config, - request: request, - }; - - settle(resolve, reject, response); - - // From here: - // - response transformers will run - // - response interceptors will run - }); -}; -``` diff --git a/server/node_modules/axios/lib/adapters/adapters.js b/server/node_modules/axios/lib/adapters/adapters.js deleted file mode 100644 index aa5da5e..0000000 --- a/server/node_modules/axios/lib/adapters/adapters.js +++ /dev/null @@ -1,132 +0,0 @@ -import utils from '../utils.js'; -import httpAdapter from './http.js'; -import xhrAdapter from './xhr.js'; -import * as fetchAdapter from './fetch.js'; -import AxiosError from '../core/AxiosError.js'; - -/** - * Known adapters mapping. - * Provides environment-specific adapters for Axios: - * - `http` for Node.js - * - `xhr` for browsers - * - `fetch` for fetch API-based requests - * - * @type {Object} - */ -const knownAdapters = { - http: httpAdapter, - xhr: xhrAdapter, - fetch: { - get: fetchAdapter.getFetch, - }, -}; - -// Assign adapter names for easier debugging and identification -utils.forEach(knownAdapters, (fn, value) => { - if (fn) { - try { - // Null-proto descriptors so a polluted Object.prototype.get cannot turn - // these data descriptors into accessor descriptors on the way in. - Object.defineProperty(fn, 'name', { __proto__: null, value }); - } catch (e) { - // eslint-disable-next-line no-empty - } - Object.defineProperty(fn, 'adapterName', { __proto__: null, value }); - } -}); - -/** - * Render a rejection reason string for unknown or unsupported adapters - * - * @param {string} reason - * @returns {string} - */ -const renderReason = (reason) => `- ${reason}`; - -/** - * Check if the adapter is resolved (function, null, or false) - * - * @param {Function|null|false} adapter - * @returns {boolean} - */ -const isResolvedHandle = (adapter) => - utils.isFunction(adapter) || adapter === null || adapter === false; - -/** - * Get the first suitable adapter from the provided list. - * Tries each adapter in order until a supported one is found. - * Throws an AxiosError if no adapter is suitable. - * - * @param {Array|string|Function} adapters - Adapter(s) by name or function. - * @param {Object} config - Axios request configuration - * @throws {AxiosError} If no suitable adapter is available - * @returns {Function} The resolved adapter function - */ -function getAdapter(adapters, config) { - adapters = utils.isArray(adapters) ? adapters : [adapters]; - - const { length } = adapters; - let nameOrAdapter; - let adapter; - - const rejectedReasons = {}; - - for (let i = 0; i < length; i++) { - nameOrAdapter = adapters[i]; - let id; - - adapter = nameOrAdapter; - - if (!isResolvedHandle(nameOrAdapter)) { - adapter = knownAdapters[(id = String(nameOrAdapter)).toLowerCase()]; - - if (adapter === undefined) { - throw new AxiosError(`Unknown adapter '${id}'`); - } - } - - if (adapter && (utils.isFunction(adapter) || (adapter = adapter.get(config)))) { - break; - } - - rejectedReasons[id || '#' + i] = adapter; - } - - if (!adapter) { - const reasons = Object.entries(rejectedReasons).map( - ([id, state]) => - `adapter ${id} ` + - (state === false ? 'is not supported by the environment' : 'is not available in the build') - ); - - let s = length - ? reasons.length > 1 - ? 'since :\n' + reasons.map(renderReason).join('\n') - : ' ' + renderReason(reasons[0]) - : 'as no adapter specified'; - - throw new AxiosError( - `There is no suitable adapter to dispatch the request ` + s, - AxiosError.ERR_NOT_SUPPORT - ); - } - - return adapter; -} - -/** - * Exports Axios adapters and utility to resolve an adapter - */ -export default { - /** - * Resolve an adapter from a list of adapter names or functions. - * @type {Function} - */ - getAdapter, - - /** - * Exposes all known adapters - * @type {Object} - */ - adapters: knownAdapters, -}; diff --git a/server/node_modules/axios/lib/adapters/fetch.js b/server/node_modules/axios/lib/adapters/fetch.js deleted file mode 100644 index 1a2bfd5..0000000 --- a/server/node_modules/axios/lib/adapters/fetch.js +++ /dev/null @@ -1,643 +0,0 @@ -import platform from '../platform/index.js'; -import utils from '../utils.js'; -import AxiosError from '../core/AxiosError.js'; -import composeSignals from '../helpers/composeSignals.js'; -import { trackStream } from '../helpers/trackStream.js'; -import AxiosHeaders from '../core/AxiosHeaders.js'; -import { - progressEventReducer, - progressEventDecorator, - asyncDecorator, -} from '../helpers/progressEventReducer.js'; -import resolveConfig from '../helpers/resolveConfig.js'; -import settle from '../core/settle.js'; -import estimateDataURLDecodedBytes from '../helpers/estimateDataURLDecodedBytes.js'; -import { VERSION } from '../env/data.js'; -import { toByteStringHeaderObject } from '../helpers/sanitizeHeaderValue.js'; - -const DEFAULT_CHUNK_SIZE = 64 * 1024; - -const { isFunction } = utils; - -/** - * Encode a UTF-8 string to a Latin-1 byte string for use with btoa(). - * This is a modern replacement for the deprecated unescape(encodeURIComponent(str)) pattern. - * - * @param {string} str The string to encode - * - * @returns {string} UTF-8 bytes as a Latin-1 string - */ -const encodeUTF8 = (str) => - encodeURIComponent(str).replace(/%([0-9A-F]{2})/gi, (_, hex) => - String.fromCharCode(parseInt(hex, 16)) - ); - -// Node's WHATWG URL parser returns `username` and `password` percent-encoded. -// Decode before composing the `auth` option so credentials such as -// `my%40email.com:pass` are sent as `my@email.com:pass`. Falls back to the -// original value for malformed input so a bad encoding never throws. -const decodeURIComponentSafe = (value) => { - if (!utils.isString(value)) { - return value; - } - - try { - return decodeURIComponent(value); - } catch (error) { - return value; - } -}; - -const test = (fn, ...args) => { - try { - return !!fn(...args); - } catch (e) { - return false; - } -}; - -const maybeWithAuthCredentials = (url) => { - const protocolIndex = url.indexOf('://'); - let urlToCheck = url; - if (protocolIndex !== -1) { - urlToCheck = urlToCheck.slice(protocolIndex + 3); - } - return urlToCheck.includes('@') || urlToCheck.includes(':'); -}; - -const factory = (env) => { - const globalObject = - utils.global !== undefined && utils.global !== null - ? utils.global - : globalThis; - const { ReadableStream, TextEncoder } = globalObject; - - env = utils.merge.call( - { - skipUndefined: true, - }, - { - Request: globalObject.Request, - Response: globalObject.Response, - }, - env - ); - - const { fetch: envFetch, Request, Response } = env; - const isFetchSupported = envFetch ? isFunction(envFetch) : typeof fetch === 'function'; - const isRequestSupported = isFunction(Request); - const isResponseSupported = isFunction(Response); - - if (!isFetchSupported) { - return false; - } - - const isReadableStreamSupported = isFetchSupported && isFunction(ReadableStream); - - const encodeText = - isFetchSupported && - (typeof TextEncoder === 'function' - ? ( - (encoder) => (str) => - encoder.encode(str) - )(new TextEncoder()) - : async (str) => new Uint8Array(await new Request(str).arrayBuffer())); - - const supportsRequestStream = - isRequestSupported && - isReadableStreamSupported && - test(() => { - let duplexAccessed = false; - - const request = new Request(platform.origin, { - body: new ReadableStream(), - method: 'POST', - get duplex() { - duplexAccessed = true; - return 'half'; - }, - }); - - const hasContentType = request.headers.has('Content-Type'); - - if (request.body != null) { - request.body.cancel(); - } - - return duplexAccessed && !hasContentType; - }); - - const supportsResponseStream = - isResponseSupported && - isReadableStreamSupported && - test(() => utils.isReadableStream(new Response('').body)); - - const resolvers = { - stream: supportsResponseStream && ((res) => res.body), - }; - - isFetchSupported && - (() => { - ['text', 'arrayBuffer', 'blob', 'formData', 'stream'].forEach((type) => { - !resolvers[type] && - (resolvers[type] = (res, config) => { - let method = res && res[type]; - - if (method) { - return method.call(res); - } - - throw new AxiosError( - `Response type '${type}' is not supported`, - AxiosError.ERR_NOT_SUPPORT, - config - ); - }); - }); - })(); - - const getBodyLength = async (body) => { - if (body == null) { - return 0; - } - - if (utils.isBlob(body)) { - return body.size; - } - - if (utils.isSpecCompliantForm(body)) { - const _request = new Request(platform.origin, { - method: 'POST', - body, - }); - return (await _request.arrayBuffer()).byteLength; - } - - if (utils.isArrayBufferView(body) || utils.isArrayBuffer(body)) { - return body.byteLength; - } - - if (utils.isURLSearchParams(body)) { - body = body + ''; - } - - if (utils.isString(body)) { - return (await encodeText(body)).byteLength; - } - }; - - const resolveBodyLength = async (headers, body) => { - const length = utils.toFiniteNumber(headers.getContentLength()); - - return length == null ? getBodyLength(body) : length; - }; - - return async (config) => { - let { - url, - method, - data, - signal, - cancelToken, - timeout, - onDownloadProgress, - onUploadProgress, - responseType, - headers, - withCredentials = 'same-origin', - fetchOptions, - maxContentLength, - maxBodyLength, - } = resolveConfig(config); - - const hasMaxContentLength = utils.isNumber(maxContentLength) && maxContentLength > -1; - const hasMaxBodyLength = utils.isNumber(maxBodyLength) && maxBodyLength > -1; - const own = (key) => (utils.hasOwnProp(config, key) ? config[key] : undefined); - - let _fetch = envFetch || fetch; - - responseType = responseType ? (responseType + '').toLowerCase() : 'text'; - - let composedSignal = composeSignals( - [signal, cancelToken && cancelToken.toAbortSignal()], - timeout - ); - - let request = null; - - const unsubscribe = - composedSignal && - composedSignal.unsubscribe && - (() => { - composedSignal.unsubscribe(); - }); - - let requestContentLength; - - // AxiosError we raise while the request body is being streamed. Captured - // by identity so the catch block can surface it directly, regardless of - // how the runtime wraps the resulting fetch rejection (undici exposes it - // as `err.cause`; some browsers drop the original error entirely). - let pendingBodyError = null; - - const maxBodyLengthError = () => - new AxiosError( - 'Request body larger than maxBodyLength limit', - AxiosError.ERR_BAD_REQUEST, - config, - request - ); - - try { - // HTTP basic authentication - let auth = undefined; - const configAuth = own('auth'); - - if (configAuth) { - const username = utils.getSafeProp(configAuth, 'username') || ''; - const password = utils.getSafeProp(configAuth, 'password') || ''; - auth = { - username, - password - }; - } - - if (maybeWithAuthCredentials(url)) { - const parsedURL = new URL(url, platform.origin); - - if (!auth && (parsedURL.username || parsedURL.password)) { - const urlUsername = decodeURIComponentSafe(parsedURL.username); - const urlPassword = decodeURIComponentSafe(parsedURL.password); - auth = { - username: urlUsername, - password: urlPassword - }; - } - - if (parsedURL.username || parsedURL.password) { - parsedURL.username = ''; - parsedURL.password = ''; - url = parsedURL.href; - } - } - - if (auth) { - headers.delete('authorization'); - headers.set( - 'Authorization', - 'Basic ' + btoa(encodeUTF8((auth.username || '') + ':' + (auth.password || ''))) - ); - } - - // Enforce maxContentLength for data: URLs up-front so we never materialize - // an oversized payload. The HTTP adapter applies the same check (see http.js - // "if (protocol === 'data:')" branch). - if (hasMaxContentLength && typeof url === 'string' && url.startsWith('data:')) { - const estimated = estimateDataURLDecodedBytes(url); - if (estimated > maxContentLength) { - throw new AxiosError( - 'maxContentLength size of ' + maxContentLength + ' exceeded', - AxiosError.ERR_BAD_RESPONSE, - config, - request - ); - } - } - - // Enforce maxBodyLength against known-size bodies before dispatch using - // the body's *actual* size — never a caller-declared Content-Length, - // which could under-report to slip an oversized body past the check. - // Unknown-size streams return undefined here and are counted per-chunk - // below as fetch consumes them. - if (hasMaxBodyLength && method !== 'get' && method !== 'head') { - const outboundLength = await getBodyLength(data); - if (typeof outboundLength === 'number' && isFinite(outboundLength)) { - requestContentLength = outboundLength; - if (outboundLength > maxBodyLength) { - throw maxBodyLengthError(); - } - } - } - - // A streamed body under maxBodyLength must be counted as fetch consumes - // it; its size is never trusted from a caller-declared Content-Length. - const mustEnforceStreamBody = - hasMaxBodyLength && (utils.isReadableStream(data) || utils.isStream(data)); - - const trackRequestStream = (stream, onProgress, flush) => - trackStream( - stream, - DEFAULT_CHUNK_SIZE, - (loadedBytes) => { - if (hasMaxBodyLength && loadedBytes > maxBodyLength) { - throw (pendingBodyError = maxBodyLengthError()); - } - onProgress && onProgress(loadedBytes); - }, - flush - ); - - if ( - supportsRequestStream && - method !== 'get' && - method !== 'head' && - (onUploadProgress || mustEnforceStreamBody) - ) { - requestContentLength = - requestContentLength == null ? await resolveBodyLength(headers, data) : requestContentLength; - - // A declared length of 0 is only trusted to skip the wrap when we are - // not enforcing a stream limit (which must not rely on that header). - if (requestContentLength !== 0 || mustEnforceStreamBody) { - let _request = new Request(url, { - method: 'POST', - body: data, - duplex: 'half', - }); - - let contentTypeHeader; - - if (utils.isFormData(data) && (contentTypeHeader = _request.headers.get('content-type'))) { - headers.setContentType(contentTypeHeader); - } - - if (_request.body) { - const [onProgress, flush] = - (onUploadProgress && - progressEventDecorator( - requestContentLength, - progressEventReducer(asyncDecorator(onUploadProgress)) - )) || - []; - - data = trackRequestStream(_request.body, onProgress, flush); - } - } - } else if ( - mustEnforceStreamBody && - !isRequestSupported && - isReadableStreamSupported && - method !== 'get' && - method !== 'head' - ) { - data = trackRequestStream(data); - } else if ( - mustEnforceStreamBody && - isRequestSupported && - !supportsRequestStream && - method !== 'get' && - method !== 'head' - ) { - throw new AxiosError( - 'Stream request bodies are not supported by the current fetch implementation', - AxiosError.ERR_NOT_SUPPORT, - config, - request - ); - } - - if (!utils.isString(withCredentials)) { - withCredentials = withCredentials ? 'include' : 'omit'; - } - - // Cloudflare Workers throws when credentials are defined - // see https://github.com/cloudflare/workerd/issues/902 - const isCredentialsSupported = isRequestSupported && 'credentials' in Request.prototype; - - // If data is FormData and Content-Type is multipart/form-data without boundary, - // delete it so fetch can set it correctly with the boundary - if (utils.isFormData(data)) { - const contentType = headers.getContentType(); - if ( - contentType && - /^multipart\/form-data/i.test(contentType) && - !/boundary=/i.test(contentType) - ) { - headers.delete('content-type'); - } - } - - // Set User-Agent header if not already set (fetch defaults to 'node' in Node.js) - headers.set('User-Agent', 'axios/' + VERSION, false); - - const resolvedOptions = { - ...fetchOptions, - signal: composedSignal, - method: method.toUpperCase(), - headers: toByteStringHeaderObject(headers.normalize()), - body: data, - duplex: 'half', - credentials: isCredentialsSupported ? withCredentials : undefined, - }; - - request = isRequestSupported && new Request(url, resolvedOptions); - - let response = await (isRequestSupported - ? _fetch(request, fetchOptions) - : _fetch(url, resolvedOptions)); - - const responseHeaders = AxiosHeaders.from(response.headers); - - // Cheap pre-check: if the server honestly declares a content-length that - // already exceeds the cap, reject before we start streaming. - if (hasMaxContentLength) { - const declaredLength = utils.toFiniteNumber(responseHeaders.getContentLength()); - if (declaredLength != null && declaredLength > maxContentLength) { - throw new AxiosError( - 'maxContentLength size of ' + maxContentLength + ' exceeded', - AxiosError.ERR_BAD_RESPONSE, - config, - request - ); - } - } - - const isStreamResponse = - supportsResponseStream && (responseType === 'stream' || responseType === 'response'); - - if ( - supportsResponseStream && - response.body && - (onDownloadProgress || hasMaxContentLength || (isStreamResponse && unsubscribe)) - ) { - const options = {}; - - ['status', 'statusText', 'headers'].forEach((prop) => { - options[prop] = response[prop]; - }); - - const responseContentLength = utils.toFiniteNumber(responseHeaders.getContentLength()); - - const [onProgress, flush] = - (onDownloadProgress && - progressEventDecorator( - responseContentLength, - progressEventReducer(asyncDecorator(onDownloadProgress), true) - )) || - []; - - let bytesRead = 0; - const onChunkProgress = (loadedBytes) => { - if (hasMaxContentLength) { - bytesRead = loadedBytes; - if (bytesRead > maxContentLength) { - throw new AxiosError( - 'maxContentLength size of ' + maxContentLength + ' exceeded', - AxiosError.ERR_BAD_RESPONSE, - config, - request - ); - } - } - onProgress && onProgress(loadedBytes); - }; - - response = new Response( - trackStream(response.body, DEFAULT_CHUNK_SIZE, onChunkProgress, () => { - flush && flush(); - unsubscribe && unsubscribe(); - }), - options - ); - } - - responseType = responseType || 'text'; - - let responseData = await resolvers[utils.findKey(resolvers, responseType) || 'text']( - response, - config - ); - - // Fallback enforcement for environments without ReadableStream support - // (legacy runtimes). Detect materialized size from typed output; skip - // streams/Response passthrough since the user will read those themselves. - if (hasMaxContentLength && !supportsResponseStream && !isStreamResponse) { - let materializedSize; - if (responseData != null) { - if (typeof responseData.byteLength === 'number') { - materializedSize = responseData.byteLength; - } else if (typeof responseData.size === 'number') { - materializedSize = responseData.size; - } else if (typeof responseData === 'string') { - materializedSize = - typeof TextEncoder === 'function' - ? new TextEncoder().encode(responseData).byteLength - : responseData.length; - } - } - if (typeof materializedSize === 'number' && materializedSize > maxContentLength) { - throw new AxiosError( - 'maxContentLength size of ' + maxContentLength + ' exceeded', - AxiosError.ERR_BAD_RESPONSE, - config, - request - ); - } - } - - !isStreamResponse && unsubscribe && unsubscribe(); - - return await new Promise((resolve, reject) => { - settle(resolve, reject, { - data: responseData, - headers: AxiosHeaders.from(response.headers), - status: response.status, - statusText: response.statusText, - config, - request, - }); - }); - } catch (err) { - unsubscribe && unsubscribe(); - - // Safari can surface fetch aborts as a DOMException-like object whose - // branded getters throw. Prefer our composed signal reason before reading - // the caught error, preserving timeout vs cancellation semantics. - if (composedSignal && composedSignal.aborted && composedSignal.reason instanceof AxiosError) { - const canceledError = composedSignal.reason; - canceledError.config = config; - request && (canceledError.request = request); - if (err !== canceledError) { - // Non-enumerable to match native Error `cause` semantics so loggers - // don't recurse into circular fetch internals (see #7205). - Object.defineProperty(canceledError, 'cause', { - __proto__: null, - value: err, - writable: true, - enumerable: false, - configurable: true, - }); - } - throw canceledError; - } - - // Surface a maxBodyLength violation we raised while the request body was - // being streamed. Matching by identity (rather than reading - // `err.cause.isAxiosError`) keeps the error deterministic across runtimes - // and avoids both prototype-pollution reads and mis-attributing a foreign - // AxiosError that merely happened to land in `err.cause`. - if (pendingBodyError) { - request && !pendingBodyError.request && (pendingBodyError.request = request); - throw pendingBodyError; - } - - // Re-throw AxiosErrors we raised synchronously (data: URL / content-length - // pre-checks, response size enforcement) without re-wrapping them. - if (err instanceof AxiosError) { - request && !err.request && (err.request = request); - throw err; - } - - if (err && err.name === 'TypeError' && /Load failed|fetch/i.test(err.message)) { - const networkError = new AxiosError( - 'Network Error', - AxiosError.ERR_NETWORK, - config, - request, - err && err.response - ); - // Non-enumerable to match native Error `cause` semantics so loggers - // don't recurse into circular fetch internals (see #7205). - Object.defineProperty(networkError, 'cause', { - __proto__: null, - value: err.cause || err, - writable: true, - enumerable: false, - configurable: true, - }); - throw networkError; - } - - throw AxiosError.from(err, err && err.code, config, request, err && err.response); - } - }; -}; - -const seedCache = new Map(); - -export const getFetch = (config) => { - let env = (config && config.env) || {}; - const { fetch, Request, Response } = env; - const seeds = [Request, Response, fetch]; - - let len = seeds.length, - i = len, - seed, - target, - map = seedCache; - - while (i--) { - seed = seeds[i]; - target = map.get(seed); - - target === undefined && map.set(seed, (target = i ? new Map() : factory(env))); - - map = target; - } - - return target; -}; - -const adapter = getFetch(); - -export default adapter; diff --git a/server/node_modules/axios/lib/adapters/http.js b/server/node_modules/axios/lib/adapters/http.js deleted file mode 100644 index 3553361..0000000 --- a/server/node_modules/axios/lib/adapters/http.js +++ /dev/null @@ -1,1406 +0,0 @@ -import utils from '../utils.js'; -import settle from '../core/settle.js'; -import buildFullPath from '../core/buildFullPath.js'; -import buildURL from '../helpers/buildURL.js'; -import { getProxyForUrl } from 'proxy-from-env'; -import HttpsProxyAgent from 'https-proxy-agent'; -import http from 'http'; -import https from 'https'; -import http2 from 'http2'; -import util from 'util'; -import { resolve as resolvePath } from 'path'; -import followRedirects from 'follow-redirects'; -import zlib from 'zlib'; -import { VERSION } from '../env/data.js'; -import transitionalDefaults from '../defaults/transitional.js'; -import AxiosError from '../core/AxiosError.js'; -import CanceledError from '../cancel/CanceledError.js'; -import platform from '../platform/index.js'; -import fromDataURI from '../helpers/fromDataURI.js'; -import stream from 'stream'; -import AxiosHeaders from '../core/AxiosHeaders.js'; -import setFormDataHeaders from '../core/setFormDataHeaders.js'; -import AxiosTransformStream from '../helpers/AxiosTransformStream.js'; -import { EventEmitter } from 'events'; -import formDataToStream from '../helpers/formDataToStream.js'; -import readBlob from '../helpers/readBlob.js'; -import ZlibHeaderTransformStream from '../helpers/ZlibHeaderTransformStream.js'; -import Http2Sessions from '../helpers/Http2Sessions.js'; -import callbackify from '../helpers/callbackify.js'; -import shouldBypassProxy from '../helpers/shouldBypassProxy.js'; -import { toByteStringHeaderObject } from '../helpers/sanitizeHeaderValue.js'; -import { - progressEventReducer, - progressEventDecorator, - asyncDecorator, -} from '../helpers/progressEventReducer.js'; -import { estimateDataURLBufferAllocation } from '../helpers/estimateDataURLDecodedBytes.js'; - -const zlibOptions = { - flush: zlib.constants.Z_SYNC_FLUSH, - finishFlush: zlib.constants.Z_SYNC_FLUSH, -}; - -const brotliOptions = { - flush: zlib.constants.BROTLI_OPERATION_FLUSH, - finishFlush: zlib.constants.BROTLI_OPERATION_FLUSH, -}; - -const zstdOptions = { - flush: zlib.constants.ZSTD_e_flush, - finishFlush: zlib.constants.ZSTD_e_flush, -}; - -const isBrotliSupported = utils.isFunction(zlib.createBrotliDecompress); -const isZstdSupported = utils.isFunction(zlib.createZstdDecompress); -const ACCEPT_ENCODING = 'gzip, compress, deflate' + (isBrotliSupported ? ', br' : ''); -const ACCEPT_ENCODING_WITH_ZSTD = ACCEPT_ENCODING + (isZstdSupported ? ', zstd' : ''); -const scheduleProgress = - typeof process !== 'undefined' && process.nextTick ? process.nextTick.bind(process) : utils.asap; - -const { http: httpFollow, https: httpsFollow } = followRedirects; - -const isHttps = /https:?/; - -// Symbols used to bind a single 'error' listener to a pooled socket and track -// the request currently owning that socket across keep-alive reuse (issue #10780). -const kAxiosSocketListener = Symbol('axios.http.socketListener'); -const kAxiosCurrentReq = Symbol('axios.http.currentReq'); - -// Tags HttpsProxyAgent instances installed by setProxy() so the redirect path -// can strip them without clobbering a user-supplied agent that happens to be -// an HttpsProxyAgent. -const kAxiosInstalledTunnel = Symbol('axios.http.installedTunnel'); - -// Cache of CONNECT-tunneling agents keyed by proxy config so repeat requests -// through the same proxy reuse a single agent (and its socket pool). The -// keyspace is bounded by the set of distinct proxy configs the process uses, -// so unbounded growth is not a concern in practice. -const tunnelingAgentCache = new Map(); -const tunnelingAgentCacheUser = new WeakMap(); -// Minimum minor versions where Node's HTTP Agent supports native proxyEnv -// handling. Checking the selected agent below also covers startup modes such -// as NODE_OPTIONS=--use-env-proxy and --no-use-env-proxy precedence. -const NODE_NATIVE_ENV_PROXY_SUPPORT = { - 22: 21, - 24: 5, -}; - -function isNodeNativeEnvProxySupported(nodeVersion = process.versions && process.versions.node) { - if (!nodeVersion) { - return false; - } - - const [major, minor] = nodeVersion.split('.').map((part) => Number(part)); - - if (!Number.isInteger(major) || !Number.isInteger(minor)) { - return false; - } - - if (major > 24) { - return true; - } - - return ( - NODE_NATIVE_ENV_PROXY_SUPPORT[major] != null && minor >= NODE_NATIVE_ENV_PROXY_SUPPORT[major] - ); -} - -function isNodeEnvProxyEnabled(agent, nodeVersion = process.versions && process.versions.node) { - if (!isNodeNativeEnvProxySupported(nodeVersion)) { - return false; - } - - const agentOptions = agent && agent.options; - - return Boolean( - agentOptions && - utils.hasOwnProp(agentOptions, 'proxyEnv') && - agentOptions.proxyEnv != null - ); -} - -function getProxyEnvAgent(options, configHttpAgent, configHttpsAgent) { - return isHttps.test(options.protocol) - ? (configHttpsAgent || https.globalAgent) - : (configHttpAgent || http.globalAgent); -} - -function getTunnelingAgent(agentOptions, userHttpsAgent) { - const key = - agentOptions.protocol + - '//' + - agentOptions.hostname + - ':' + - (agentOptions.port || '') + - '#' + - (agentOptions.auth || ''); - const cache = userHttpsAgent - ? (tunnelingAgentCacheUser.get(userHttpsAgent) || - tunnelingAgentCacheUser.set(userHttpsAgent, new Map()).get(userHttpsAgent)) - : tunnelingAgentCache; - let agent = cache.get(key); - if (agent) return agent; - // Forward the user's TLS options (custom CA, rejectUnauthorized, client cert, - // etc.) into the tunneling agent so they apply to the origin TLS upgrade - // performed after CONNECT. Our proxy fields take precedence on conflict. - const merged = userHttpsAgent && userHttpsAgent.options - ? { ...userHttpsAgent.options, ...agentOptions } - : agentOptions; - agent = new HttpsProxyAgent(merged); - if (userHttpsAgent && userHttpsAgent.options) { - const originTLSOptions = { ...userHttpsAgent.options }; - const callback = agent.callback; - agent.callback = function axiosTunnelingAgentCallback(req, opts) { - // HttpsProxyAgent v5 reads callback opts for the post-CONNECT origin TLS upgrade. - return callback.call(this, req, { ...originTLSOptions, ...opts }); - }; - } - agent[kAxiosInstalledTunnel] = true; - cache.set(key, agent); - return agent; -} - -const supportedProtocols = platform.protocols.map((protocol) => { - return protocol + ':'; -}); - -// Node's WHATWG URL parser returns `username` and `password` percent-encoded. -// Decode before composing the `auth` option so credentials such as -// `my%40email.com:pass` are sent as `my@email.com:pass`. Falls back to the -// original value for malformed input so a bad encoding never throws. -const decodeURIComponentSafe = (value) => { - if (!utils.isString(value)) { - return value; - } - - try { - return decodeURIComponent(value); - } catch (error) { - return value; - } -}; - -const flushOnFinish = (stream, [throttled, flush]) => { - stream.on('end', flush).on('error', flush); - - return throttled; -}; - -const http2Sessions = new Http2Sessions(); - -/** - * If the proxy, auth, sensitive header, or config beforeRedirects functions are defined, - * call them with the options object. - * - * @param {Object} options - The options object that was passed to the request. - * - * @returns {Object} - */ -function dispatchBeforeRedirect(options, responseDetails, requestDetails) { - if (options.beforeRedirects.proxy) { - options.beforeRedirects.proxy(options); - } - if (options.beforeRedirects.auth) { - options.beforeRedirects.auth(options); - } - if (options.beforeRedirects.sensitiveHeaders) { - options.beforeRedirects.sensitiveHeaders(options, requestDetails); - } - if (options.beforeRedirects.config) { - options.beforeRedirects.config(options, responseDetails, requestDetails); - } -} - -function stripMatchingHeaders(headers, sensitiveSet) { - if (!headers) { - return; - } - - Object.keys(headers).forEach((header) => { - if (sensitiveSet.has(header.toLowerCase())) { - delete headers[header]; - } - }); -} - -function isSameOriginRedirect(redirectOptions, requestDetails) { - if (!requestDetails) { - return false; - } - - try { - return new URL(requestDetails.url).origin === new URL(redirectOptions.href).origin; - } catch (e) { - // If origin comparison fails, treat the redirect as unsafe. - return false; - } -} - -/** - * If the proxy or config afterRedirects functions are defined, call them with the options - * - * @param {http.ClientRequestArgs} options - * @param {AxiosProxyConfig} configProxy configuration from Axios options object - * @param {string} location - * - * @returns {http.ClientRequestArgs} - */ -function setProxy(options, configProxy, location, isRedirect, configHttpsAgent, configHttpAgent) { - let proxy = configProxy; - const proxyEnvAgent = getProxyEnvAgent(options, configHttpAgent, configHttpsAgent); - if (!proxy && proxy !== false && !isNodeEnvProxyEnabled(proxyEnvAgent)) { - const proxyUrl = getProxyForUrl(location); - if (proxyUrl) { - if (!shouldBypassProxy(location)) { - proxy = new URL(proxyUrl); - } - } - } - // On redirect re-invocation, strip any stale Proxy-Authorization header carried - // over from the prior request (e.g. new target no longer uses a proxy, or uses - // a different proxy). Skip on the initial request so user-supplied headers are - // preserved. Header names are case-insensitive, so remove every case variant. - if (isRedirect && options.headers) { - for (const name of Object.keys(options.headers)) { - if (name.toLowerCase() === 'proxy-authorization') { - delete options.headers[name]; - } - } - } - // Strip any tunneling agent we installed for the previous hop so a redirect - // that drops the proxy or crosses an HTTPS↔HTTP boundary doesn't reuse a - // stale one. Match on our Symbol marker so a user-supplied HttpsProxyAgent - // (which won't carry the marker) is left alone. - if (isRedirect && options.agent && options.agent[kAxiosInstalledTunnel]) { - options.agent = undefined; - } - if (proxy) { - // Read proxy fields without traversing the prototype chain. URL instances expose - // username/password/hostname/host/port/protocol via getters on URL.prototype (so - // direct reads are shielded), but plain object proxies — and the `auth` field - // (which URL does not expose) — must be guarded so a polluted Object.prototype - // (e.g. Object.prototype.auth = { username, password }) cannot inject - // attacker-controlled credentials into the Proxy-Authorization header or - // redirect proxying to an attacker-controlled host. - const isProxyURL = proxy instanceof URL; - const readProxyField = (key) => - isProxyURL || utils.hasOwnProp(proxy, key) ? proxy[key] : undefined; - - const proxyUsername = readProxyField('username'); - const proxyPassword = readProxyField('password'); - let proxyAuth = utils.hasOwnProp(proxy, 'auth') ? proxy.auth : undefined; - - // Basic proxy authorization - if (proxyUsername) { - proxyAuth = (proxyUsername || '') + ':' + (proxyPassword || ''); - } - - if (proxyAuth) { - // Support proxy auth object form. Read sub-fields via own-prop checks so a - // plain object inheriting from polluted Object.prototype cannot leak creds. - const authIsObject = typeof proxyAuth === 'object'; - const authUsername = - authIsObject && utils.hasOwnProp(proxyAuth, 'username') ? proxyAuth.username : undefined; - const authPassword = - authIsObject && utils.hasOwnProp(proxyAuth, 'password') ? proxyAuth.password : undefined; - const validProxyAuth = Boolean(authUsername || authPassword); - - if (validProxyAuth) { - proxyAuth = (authUsername || '') + ':' + (authPassword || ''); - } else if (authIsObject) { - throw new AxiosError('Invalid proxy authorization', AxiosError.ERR_BAD_OPTION, { proxy }); - } - } - - const targetIsHttps = isHttps.test(options.protocol); - - if (targetIsHttps) { - // CONNECT-tunneling path for HTTPS targets. Preserves end-to-end TLS to - // the origin so the proxy cannot inspect the URL, headers, or body — the - // behavior already promised by THREATMODEL.md (T-R9). HttpsProxyAgent - // sends Proxy-Authorization on the CONNECT request only, never on the - // wrapped TLS request, which is why we don't stamp it onto - // options.headers here. If the user already supplied an HttpsProxyAgent, - // they own tunneling end-to-end and we leave them alone; otherwise we - // install our own tunneling agent and forward their TLS options (if any) - // so a custom httpsAgent for cert pinning / rejectUnauthorized still - // applies to the origin TLS upgrade. - if (!(configHttpsAgent instanceof HttpsProxyAgent)) { - const proxyHost = readProxyField('hostname') || readProxyField('host'); - const proxyPort = readProxyField('port'); - const rawProxyProtocol = readProxyField('protocol'); - const normalizedProtocol = rawProxyProtocol - ? rawProxyProtocol.includes(':') - ? rawProxyProtocol - : `${rawProxyProtocol}:` - : 'http:'; - // Bracket IPv6 literals for URL parsing; URL.hostname strips the - // brackets again on read so the agent receives the raw form. - const proxyHostForURL = - proxyHost && proxyHost.includes(':') && !proxyHost.startsWith('[') - ? `[${proxyHost}]` - : proxyHost; - const proxyURL = new URL( - `${normalizedProtocol}//${proxyHostForURL}${proxyPort ? ':' + proxyPort : ''}` - ); - const agentOptions = { - protocol: proxyURL.protocol, - hostname: proxyURL.hostname.replace(/^\[|\]$/g, ''), - port: proxyURL.port, - auth: proxyAuth && typeof proxyAuth === 'string' ? proxyAuth : undefined, - }; - if (proxyURL.protocol === 'https:') { - agentOptions.ALPNProtocols = ['http/1.1']; - } - const tunnelingAgent = getTunnelingAgent(agentOptions, configHttpsAgent); - // Set both: `options.agent` is consumed by the native https.request path - // (maxRedirects === 0); `options.agents.https` is consumed by - // follow-redirects, which ignores `options.agent` when `options.agents` - // is present. - options.agent = tunnelingAgent; - if (options.agents) { - options.agents.https = tunnelingAgent; - } - } - } else { - // Forward-proxy mode for plaintext HTTP targets. The request line carries - // the absolute URL and the proxy sees everything — acceptable for plain - // HTTP since the wire was already plaintext. - if (proxyAuth) { - const base64 = Buffer.from(proxyAuth, 'utf8').toString('base64'); - options.headers['Proxy-Authorization'] = 'Basic ' + base64; - } - - // Preserve a user-supplied Host header (case-insensitive) so callers can override - // the value forwarded to the proxy; otherwise default to the request URL's host. - let hasUserHostHeader = false; - for (const name of Object.keys(options.headers)) { - if (name.toLowerCase() === 'host') { - hasUserHostHeader = true; - break; - } - } - if (!hasUserHostHeader) { - options.headers.host = options.hostname + (options.port ? ':' + options.port : ''); - } - const proxyHost = readProxyField('hostname') || readProxyField('host'); - options.hostname = proxyHost; - // Replace 'host' since options is not a URL object - options.host = proxyHost; - options.port = readProxyField('port'); - options.path = location; - const proxyProtocol = readProxyField('protocol'); - if (proxyProtocol) { - options.protocol = proxyProtocol.includes(':') ? proxyProtocol : `${proxyProtocol}:`; - } - } - } - - options.beforeRedirects.proxy = function beforeRedirect(redirectOptions) { - // Configure proxy for redirected request, passing the original config proxy to apply - // the exact same logic as if the redirected request was performed by axios directly. - setProxy( - redirectOptions, - configProxy, - redirectOptions.href, - true, - configHttpsAgent, - configHttpAgent - ); - }; -} - -const isHttpAdapterSupported = - typeof process !== 'undefined' && utils.kindOf(process) === 'process'; - -// temporary hotfix - -const wrapAsync = (asyncExecutor) => { - return new Promise((resolve, reject) => { - let onDone; - let isDone; - - const done = (value, isRejected) => { - if (isDone) return; - isDone = true; - onDone && onDone(value, isRejected); - }; - - const _resolve = (value) => { - done(value); - resolve(value); - }; - - const _reject = (reason) => { - done(reason, true); - reject(reason); - }; - - asyncExecutor(_resolve, _reject, (onDoneHandler) => (onDone = onDoneHandler)).catch(_reject); - }); -}; - -const resolveFamily = ({ address, family }) => { - if (!utils.isString(address)) { - throw TypeError('address must be a string'); - } - return { - address, - family: family || (address.indexOf('.') < 0 ? 6 : 4), - }; -}; - -const buildAddressEntry = (address, family) => - resolveFamily(utils.isObject(address) ? address : { address, family }); - -const http2Transport = { - request(options, cb) { - const authority = - options.protocol + - '//' + - options.hostname + - ':' + - (options.port || (options.protocol === 'https:' ? 443 : 80)); - - const { http2Options, headers } = options; - - const session = http2Sessions.getSession(authority, http2Options); - - const { HTTP2_HEADER_SCHEME, HTTP2_HEADER_METHOD, HTTP2_HEADER_PATH, HTTP2_HEADER_STATUS } = - http2.constants; - - const http2Headers = { - [HTTP2_HEADER_SCHEME]: options.protocol.replace(':', ''), - [HTTP2_HEADER_METHOD]: options.method, - [HTTP2_HEADER_PATH]: options.path, - }; - - utils.forEach(headers, (header, name) => { - name.charAt(0) !== ':' && (http2Headers[name] = header); - }); - - const req = session.request(http2Headers); - - req.once('response', (responseHeaders) => { - const response = req; //duplex - - responseHeaders = Object.assign({}, responseHeaders); - - const status = responseHeaders[HTTP2_HEADER_STATUS]; - - delete responseHeaders[HTTP2_HEADER_STATUS]; - - response.headers = responseHeaders; - - response.statusCode = +status; - - cb(response); - }); - - return req; - }, -}; - -/*eslint consistent-return:0*/ -export default isHttpAdapterSupported && - function httpAdapter(config) { - return wrapAsync(async function dispatchHttpRequest(resolve, reject, onDone) { - // Read config pollution-safely: own properties and members inherited from - // a non-Object.prototype source (e.g. an Object.create(defaults) template) - // are honored, but values injected onto a polluted Object.prototype are - // ignored. All behavior-affecting reads in this adapter go through own() - // so the protection boundary stays consistent. - const own = (key) => utils.getSafeProp(config, key); - const transitional = own('transitional') || transitionalDefaults; - let data = own('data'); - let lookup = own('lookup'); - let family = own('family'); - let httpVersion = own('httpVersion'); - if (httpVersion === undefined) httpVersion = 1; - let http2Options = own('http2Options'); - const httpAgent = own('httpAgent'); - const httpsAgent = own('httpsAgent'); - const configProxy = own('proxy'); - const responseType = own('responseType'); - const responseEncoding = own('responseEncoding'); - const socketPath = own('socketPath'); - const method = own('method').toUpperCase(); - const maxRedirects = own('maxRedirects'); - const maxBodyLength = own('maxBodyLength'); - const maxContentLength = own('maxContentLength'); - const decompress = own('decompress'); - let isDone; - let rejected = false; - let req; - let connectPhaseTimer; - - httpVersion = +httpVersion; - - if (Number.isNaN(httpVersion)) { - throw TypeError(`Invalid protocol version: '${config.httpVersion}' is not a number`); - } - - if (httpVersion !== 1 && httpVersion !== 2) { - throw TypeError(`Unsupported protocol version '${httpVersion}'`); - } - - const isHttp2 = httpVersion === 2; - - if (lookup) { - const _lookup = callbackify(lookup, (value) => (utils.isArray(value) ? value : [value])); - // hotfix to support opt.all option which is required for node 20.x - lookup = (hostname, opt, cb) => { - _lookup(hostname, opt, (err, arg0, arg1) => { - if (err) { - return cb(err); - } - - const addresses = utils.isArray(arg0) - ? arg0.map((addr) => buildAddressEntry(addr)) - : [buildAddressEntry(arg0, arg1)]; - - opt.all ? cb(err, addresses) : cb(err, addresses[0].address, addresses[0].family); - }); - }; - } - - const abortEmitter = new EventEmitter(); - - function abort(reason) { - try { - abortEmitter.emit( - 'abort', - !reason || reason.type ? new CanceledError(null, config, req) : reason - ); - } catch (err) { - // ignore emit errors - } - } - - function clearConnectPhaseTimer() { - if (connectPhaseTimer) { - clearTimeout(connectPhaseTimer); - connectPhaseTimer = null; - } - } - - function createTimeoutError() { - const configTimeout = own('timeout'); - let timeoutErrorMessage = configTimeout - ? 'timeout of ' + configTimeout + 'ms exceeded' - : 'timeout exceeded'; - const configTimeoutErrorMessage = own('timeoutErrorMessage'); - if (configTimeoutErrorMessage) { - timeoutErrorMessage = configTimeoutErrorMessage; - } - return new AxiosError( - timeoutErrorMessage, - transitional.clarifyTimeoutError ? AxiosError.ETIMEDOUT : AxiosError.ECONNABORTED, - config, - req - ); - } - - abortEmitter.once('abort', reject); - - const onFinished = () => { - clearConnectPhaseTimer(); - - if (config.cancelToken) { - config.cancelToken.unsubscribe(abort); - } - - if (config.signal) { - config.signal.removeEventListener('abort', abort); - } - - abortEmitter.removeAllListeners(); - }; - - if (config.cancelToken || config.signal) { - config.cancelToken && config.cancelToken.subscribe(abort); - if (config.signal) { - config.signal.aborted ? abort() : config.signal.addEventListener('abort', abort); - } - } - - onDone((response, isRejected) => { - isDone = true; - clearConnectPhaseTimer(); - - if (isRejected) { - rejected = true; - onFinished(); - return; - } - - const { data } = response; - - if (data instanceof stream.Readable || data instanceof stream.Duplex) { - const offListeners = stream.finished(data, () => { - offListeners(); - onFinished(); - }); - } else { - onFinished(); - } - }); - - // Parse url - const fullPath = buildFullPath(own('baseURL'), own('url'), own('allowAbsoluteUrls'), config); - // Unix-socket requests (own socketPath) commonly pass a path-only url - // like '/foo'; supply a synthetic base so new URL() can still parse it. - // Use the own-property value (not config.socketPath) so a polluted - // prototype cannot influence URL base selection. - const urlBase = socketPath - ? 'http://localhost' - : (platform.hasBrowserEnv ? platform.origin : undefined); - const parsed = new URL(fullPath, urlBase); - const protocol = parsed.protocol || supportedProtocols[0]; - - if (protocol === 'data:') { - // Apply the same semantics as HTTP: only enforce if a finite, non-negative cap is set. - if (maxContentLength > -1) { - // Use the exact string passed to fromDataURI (the configured url); fall back to fullPath if needed. - const dataUrl = String(own('url') || fullPath || ''); - const estimated = estimateDataURLBufferAllocation(dataUrl); - - if (estimated > maxContentLength) { - return reject( - new AxiosError( - 'maxContentLength size of ' + maxContentLength + ' exceeded', - AxiosError.ERR_BAD_RESPONSE, - config - ) - ); - } - } - - let convertedData; - - if (method !== 'GET') { - return settle(resolve, reject, { - status: 405, - statusText: 'method not allowed', - headers: {}, - config, - }); - } - - try { - convertedData = fromDataURI(own('url'), responseType === 'blob', { - Blob: config.env && config.env.Blob, - }); - } catch (err) { - throw AxiosError.from(err, AxiosError.ERR_BAD_REQUEST, config); - } - - if (responseType === 'text') { - convertedData = convertedData.toString(responseEncoding); - - if (!responseEncoding || responseEncoding === 'utf8') { - convertedData = utils.stripBOM(convertedData); - } - } else if (responseType === 'stream') { - convertedData = stream.Readable.from(convertedData); - } - - return settle(resolve, reject, { - data: convertedData, - status: 200, - statusText: 'OK', - headers: new AxiosHeaders(), - config, - }); - } - - if (supportedProtocols.indexOf(protocol) === -1) { - return reject( - new AxiosError('Unsupported protocol ' + protocol, AxiosError.ERR_BAD_REQUEST, config) - ); - } - - const headers = AxiosHeaders.from(config.headers).normalize(); - - // Set User-Agent (required by some servers) - // See https://github.com/axios/axios/issues/69 - // User-Agent is specified; handle case where no UA header is desired - // Only set header if it hasn't been set in config - headers.set('User-Agent', 'axios/' + VERSION, false); - - const { onUploadProgress, onDownloadProgress } = config; - const maxRate = config.maxRate; - let maxUploadRate = undefined; - let maxDownloadRate = undefined; - - // support for spec compliant FormData objects - if (utils.isSpecCompliantForm(data)) { - const userBoundary = headers.getContentType(/boundary=([-_\w\d]{10,70})/i); - - data = formDataToStream( - data, - (formHeaders) => { - headers.set(formHeaders); - }, - { - tag: `axios-${VERSION}-boundary`, - boundary: (userBoundary && userBoundary[1]) || undefined, - } - ); - // support for https://www.npmjs.com/package/form-data api - } else if ( - utils.isFormData(data) && - utils.isFunction(data.getHeaders) && - data.getHeaders !== Object.prototype.getHeaders - ) { - setFormDataHeaders(headers, data.getHeaders(), own('formDataHeaderPolicy')); - - if (!headers.hasContentLength()) { - try { - const knownLength = await util.promisify(data.getLength).call(data); - Number.isFinite(knownLength) && - knownLength >= 0 && - headers.setContentLength(knownLength); - /*eslint no-empty:0*/ - } catch (e) {} - } - } else if (utils.isBlob(data) || utils.isFile(data)) { - data.size && headers.setContentType(data.type || 'application/octet-stream'); - headers.setContentLength(data.size || 0); - data = stream.Readable.from(readBlob(data)); - } else if (data && !utils.isStream(data)) { - if (Buffer.isBuffer(data)) { - // Nothing to do... - } else if (utils.isArrayBuffer(data)) { - data = Buffer.from(new Uint8Array(data)); - } else if (utils.isString(data)) { - data = Buffer.from(data, 'utf-8'); - } else { - return reject( - new AxiosError( - 'Data after transformation must be a string, an ArrayBuffer, a Buffer, or a Stream', - AxiosError.ERR_BAD_REQUEST, - config - ) - ); - } - - // Add Content-Length header if data exists - headers.setContentLength(data.length, false); - - if (maxBodyLength > -1 && data.length > maxBodyLength) { - return reject( - new AxiosError( - 'Request body larger than maxBodyLength limit', - AxiosError.ERR_BAD_REQUEST, - config - ) - ); - } - } - - const contentLength = utils.toFiniteNumber(headers.getContentLength()); - - if (utils.isArray(maxRate)) { - maxUploadRate = maxRate[0]; - maxDownloadRate = maxRate[1]; - } else { - maxUploadRate = maxDownloadRate = maxRate; - } - - if (data && (onUploadProgress || maxUploadRate)) { - if (!utils.isStream(data)) { - data = stream.Readable.from(data, { objectMode: false }); - } - - data = stream.pipeline( - [ - data, - new AxiosTransformStream({ - maxRate: utils.toFiniteNumber(maxUploadRate), - }), - ], - utils.noop - ); - - onUploadProgress && - data.on( - 'progress', - flushOnFinish( - data, - progressEventDecorator( - contentLength, - progressEventReducer(asyncDecorator(onUploadProgress, scheduleProgress), false, 3) - ) - ) - ); - } - - // HTTP basic authentication - let auth = undefined; - const configAuth = own('auth'); - if (configAuth) { - const username = utils.getSafeProp(configAuth, 'username') || ''; - const password = utils.getSafeProp(configAuth, 'password') || ''; - auth = username + ':' + password; - } - - if (!auth && (parsed.username || parsed.password)) { - const urlUsername = decodeURIComponentSafe(parsed.username); - const urlPassword = decodeURIComponentSafe(parsed.password); - auth = urlUsername + ':' + urlPassword; - } - - auth && headers.delete('authorization'); - - let path; - - try { - path = buildURL( - parsed.pathname + parsed.search, - own('params'), - own('paramsSerializer') - ).replace(/^\?/, ''); - } catch (err) { - return reject( - AxiosError.from(err, AxiosError.ERR_BAD_REQUEST, config, null, null, { - url: own('url'), - exists: true - }) - ); - } - - headers.set( - 'Accept-Encoding', - utils.hasOwnProp(transitional, 'advertiseZstdAcceptEncoding') && - transitional.advertiseZstdAcceptEncoding === true ? ACCEPT_ENCODING_WITH_ZSTD : ACCEPT_ENCODING, - false - ); - - // Null-prototype to block prototype pollution gadgets on properties read - // directly by Node's http.request (e.g. insecureHTTPParser, lookup). - const options = Object.assign(Object.create(null), { - path, - method: method, - headers: toByteStringHeaderObject(headers), - agents: { http: httpAgent, https: httpsAgent }, - auth, - protocol, - family, - beforeRedirect: dispatchBeforeRedirect, - beforeRedirects: Object.create(null), - http2Options, - }); - - // cacheable-lookup integration hotfix - !utils.isUndefined(lookup) && (options.lookup = lookup); - - if (socketPath) { - if (typeof socketPath !== 'string') { - return reject( - new AxiosError('socketPath must be a string', AxiosError.ERR_BAD_OPTION_VALUE, config) - ); - } - - const allowedSocketPaths = own('allowedSocketPaths'); - if (allowedSocketPaths != null) { - const allowed = Array.isArray(allowedSocketPaths) - ? allowedSocketPaths - : [allowedSocketPaths]; - - const resolvedSocket = resolvePath(socketPath); - const isAllowed = allowed.some( - (entry) => typeof entry === 'string' && resolvePath(entry) === resolvedSocket - ); - - if (!isAllowed) { - return reject( - new AxiosError( - `socketPath "${socketPath}" is not permitted by allowedSocketPaths`, - AxiosError.ERR_BAD_OPTION_VALUE, - config - ) - ); - } - } - - options.socketPath = socketPath; - } else { - options.hostname = parsed.hostname.startsWith('[') - ? parsed.hostname.slice(1, -1) - : parsed.hostname; - options.port = parsed.port; - setProxy( - options, - configProxy, - protocol + '//' + parsed.hostname + (parsed.port ? ':' + parsed.port : '') + options.path, - false, - httpsAgent, - httpAgent - ); - } - let transport; - let isNativeTransport = false; - // True only for the follow-redirects transport, which applies - // options.maxBodyLength itself. Every other transport (http2, native - // http/https, a user-supplied custom transport) needs the explicit - // byte-counting pipeline below to enforce maxBodyLength on streamed uploads. - let transportEnforcesMaxBodyLength = false; - const isHttpsRequest = isHttps.test(options.protocol); - // Don't clobber a CONNECT-tunneling agent installed by setProxy() for an - // HTTPS target. - if (options.agent == null) { - options.agent = isHttpsRequest ? httpsAgent : httpAgent; - } - - if (isHttp2) { - transport = http2Transport; - } else { - const configTransport = own('transport'); - if (configTransport) { - transport = configTransport; - } else if (maxRedirects === 0) { - transport = isHttpsRequest ? https : http; - isNativeTransport = true; - } else { - transportEnforcesMaxBodyLength = true; - options.sensitiveHeaders = []; - if (maxRedirects) { - options.maxRedirects = maxRedirects; - } - const configBeforeRedirect = own('beforeRedirect'); - if (configBeforeRedirect) { - options.beforeRedirects.config = configBeforeRedirect; - } - if (auth) { - // Restore HTTP Basic credentials on same-origin redirects only. - // follow-redirects >= 1.15.8 strips Authorization on every redirect (see #6929); - // cross-origin stripping is the documented mitigation for T-R2 in THREATMODEL.md - // and is preserved by deliberately not restoring on origin change. - const requestOrigin = parsed.origin; - const authToRestore = auth; - options.beforeRedirects.auth = function beforeRedirectAuth(redirectOptions) { - try { - if (new URL(redirectOptions.href).origin === requestOrigin) { - redirectOptions.auth = authToRestore; - } - } catch (e) { - // ignore malformed URL: leaving auth stripped is fail-safe - } - }; - } - const sensitiveHeaders = own('sensitiveHeaders'); - if (sensitiveHeaders != null) { - if (!utils.isArray(sensitiveHeaders)) { - return reject( - new AxiosError( - 'sensitiveHeaders must be an array of strings', - AxiosError.ERR_BAD_OPTION_VALUE, - config - ) - ); - } - - const sensitiveSet = new Set(); - for (const header of sensitiveHeaders) { - if (!utils.isString(header)) { - return reject( - new AxiosError( - 'sensitiveHeaders must be an array of strings', - AxiosError.ERR_BAD_OPTION_VALUE, - config - ) - ); - } - - sensitiveSet.add(header.toLowerCase()); - } - - if (sensitiveSet.size) { - options.sensitiveHeaders = Array.from(sensitiveSet); - options.beforeRedirects.sensitiveHeaders = function beforeRedirectSensitiveHeaders( - redirectOptions, - requestDetails - ) { - if (!isSameOriginRedirect(redirectOptions, requestDetails)) { - stripMatchingHeaders(redirectOptions.headers, sensitiveSet); - } - }; - } - } - transport = isHttpsRequest ? httpsFollow : httpFollow; - } - } - - // Set an explicit maxBodyLength option for transports that inspect it. - // When maxBodyLength is -1 (default/unlimited), use Infinity so - // follow-redirects does not fall back to its own 10MB default. - if (maxBodyLength > -1) { - options.maxBodyLength = maxBodyLength; - } else { - options.maxBodyLength = Infinity; - } - - // Always set an explicit own value so a polluted - // Object.prototype.insecureHTTPParser cannot enable the lenient parser - // through Node's internal options copy - options.insecureHTTPParser = Boolean(own('insecureHTTPParser')); - - // Create the request - req = transport.request(options, function handleResponse(res) { - clearConnectPhaseTimer(); - - if (req.destroyed) return; - - const streams = [res]; - - const responseLength = utils.toFiniteNumber(res.headers['content-length']); - - if (onDownloadProgress || maxDownloadRate) { - const transformStream = new AxiosTransformStream({ - maxRate: utils.toFiniteNumber(maxDownloadRate), - }); - - onDownloadProgress && - transformStream.on( - 'progress', - flushOnFinish( - transformStream, - progressEventDecorator( - responseLength, - progressEventReducer(asyncDecorator(onDownloadProgress, scheduleProgress), true, 3) - ) - ) - ); - - streams.push(transformStream); - } - - // decompress the response body transparently if required - let responseStream = res; - - // return the last request in case of redirects - const lastRequest = res.req || req; - - // if decompress disabled we should not decompress - if (decompress !== false && res.headers['content-encoding']) { - // if no content, but headers still say that it is encoded, - // remove the header not confuse downstream operations - if (method === 'HEAD' || res.statusCode === 204) { - delete res.headers['content-encoding']; - } - - switch ((res.headers['content-encoding'] || '').toLowerCase()) { - /*eslint default-case:0*/ - case 'gzip': - case 'x-gzip': - case 'compress': - case 'x-compress': - // add the unzipper to the body stream processing pipeline - streams.push(zlib.createUnzip(zlibOptions)); - - // remove the content-encoding in order to not confuse downstream operations - delete res.headers['content-encoding']; - break; - case 'deflate': - streams.push(new ZlibHeaderTransformStream()); - - // add the unzipper to the body stream processing pipeline - streams.push(zlib.createUnzip(zlibOptions)); - - // remove the content-encoding in order to not confuse downstream operations - delete res.headers['content-encoding']; - break; - case 'br': - if (isBrotliSupported) { - streams.push(zlib.createBrotliDecompress(brotliOptions)); - delete res.headers['content-encoding']; - } - break; - case 'zstd': - if (isZstdSupported) { - streams.push(zlib.createZstdDecompress(zstdOptions)); - delete res.headers['content-encoding']; - } - break; - } - } - - responseStream = streams.length > 1 ? stream.pipeline(streams, utils.noop) : streams[0]; - - const response = { - status: res.statusCode, - statusText: res.statusMessage, - headers: new AxiosHeaders(res.headers), - config, - request: lastRequest, - }; - - if (responseType === 'stream') { - // Enforce maxContentLength on streamed responses; previously this - // was applied only to buffered responses. - if (maxContentLength > -1) { - const limit = maxContentLength; - const source = responseStream; - async function* enforceMaxContentLength() { - let totalResponseBytes = 0; - for await (const chunk of source) { - totalResponseBytes += chunk.length; - if (totalResponseBytes > limit) { - throw new AxiosError( - 'maxContentLength size of ' + limit + ' exceeded', - AxiosError.ERR_BAD_RESPONSE, - config, - lastRequest - ); - } - yield chunk; - } - } - responseStream = stream.Readable.from(enforceMaxContentLength(), { - objectMode: false, - }); - } - response.data = responseStream; - settle(resolve, reject, response); - } else { - const responseBuffer = []; - let totalResponseBytes = 0; - - responseStream.on('data', function handleStreamData(chunk) { - responseBuffer.push(chunk); - totalResponseBytes += chunk.length; - - // make sure the content length is not over the maxContentLength if specified - if (maxContentLength > -1 && totalResponseBytes > maxContentLength) { - // stream.destroy() emit aborted event before calling reject() on Node.js v16 - rejected = true; - responseStream.destroy(); - abort( - new AxiosError( - 'maxContentLength size of ' + maxContentLength + ' exceeded', - AxiosError.ERR_BAD_RESPONSE, - config, - lastRequest - ) - ); - } - }); - - responseStream.on('aborted', function handlerStreamAborted() { - if (rejected) { - return; - } - - const err = new AxiosError( - 'stream has been aborted', - AxiosError.ERR_BAD_RESPONSE, - config, - lastRequest, - response - ); - responseStream.destroy(err); - reject(err); - }); - - responseStream.on('error', function handleStreamError(err) { - if (rejected) return; - reject(AxiosError.from(err, null, config, lastRequest, response)); - }); - - responseStream.on('end', function handleStreamEnd() { - try { - let responseData = - responseBuffer.length === 1 ? responseBuffer[0] : Buffer.concat(responseBuffer); - if (responseType !== 'arraybuffer') { - responseData = responseData.toString(responseEncoding); - if (!responseEncoding || responseEncoding === 'utf8') { - responseData = utils.stripBOM(responseData); - } - } - response.data = responseData; - } catch (err) { - return reject(AxiosError.from(err, null, config, response.request, response)); - } - settle(resolve, reject, response); - }); - } - - abortEmitter.once('abort', (err) => { - if (!responseStream.destroyed) { - responseStream.emit('error', err); - responseStream.destroy(); - } - }); - }); - - abortEmitter.once('abort', (err) => { - if (req.close) { - req.close(); - } else { - req.destroy(err); - } - }); - - // Handle errors - req.on('error', function handleRequestError(err) { - reject(AxiosError.from(err, null, config, req)); - }); - - // set tcp keep alive to prevent drop connection by peer - // Track every socket bound to this outer RedirectableRequest so a single - // 'close' listener can release ownership on all of them. follow-redirects - // re-emits the 'socket' event for each hop's native request onto the same - // outer request, so attaching per-request listeners inside this handler - // would accumulate across hops and trigger MaxListenersExceededWarning at - // >= 11 redirects. Clearing only the last-bound socket would leave stale - // kAxiosCurrentReq refs on earlier hop sockets returned to the keep-alive - // pool, causing an idle-pool 'error' to be attributed to a closed req. - const boundSockets = new Set(); - - req.on('socket', function handleRequestSocket(socket) { - // default interval of sending ack packet is 1 minute - // proxy agents (e.g. agent-base) may return a generic Duplex stream - // that doesn't have setKeepAlive, so guard before calling - if (typeof socket.setKeepAlive === 'function') { - socket.setKeepAlive(true, 1000 * 60); - } - - // Install a single 'error' listener per socket (not per request) to avoid - // accumulating listeners on pooled keep-alive sockets that get reassigned - // to new requests before the previous request's 'close' fires (issue #10780). - // The listener is bound to the socket's currently-active request via a - // symbol, which is swapped as the socket is reassigned. - if (!socket[kAxiosSocketListener]) { - socket.on('error', function handleSocketError(err) { - const current = socket[kAxiosCurrentReq]; - if (current && !current.destroyed) { - current.destroy(err); - } - }); - socket[kAxiosSocketListener] = true; - } - - socket[kAxiosCurrentReq] = req; - boundSockets.add(socket); - }); - - req.once('close', function clearCurrentReq() { - clearConnectPhaseTimer(); - - for (const socket of boundSockets) { - if (socket[kAxiosCurrentReq] === req) { - socket[kAxiosCurrentReq] = null; - } - } - boundSockets.clear(); - }); - - // Handle request timeout - if (own('timeout')) { - // This is forcing a int timeout to avoid problems if the `req` interface doesn't handle other types. - const timeout = parseInt(own('timeout'), 10); - - if (Number.isNaN(timeout)) { - abort( - new AxiosError( - 'error trying to parse `config.timeout` to int', - AxiosError.ERR_BAD_OPTION_VALUE, - config, - req - ) - ); - - return; - } - - const handleTimeout = function handleTimeout() { - if (isDone) return; - abort(createTimeoutError()); - }; - - if (isNativeTransport && timeout > 0) { - // Native ClientRequest#setTimeout starts from the socket lifecycle and - // may not fire while TCP connect is still pending. Mirror the - // follow-redirects wall-clock timer for the maxRedirects === 0 path. - connectPhaseTimer = setTimeout(handleTimeout, timeout); - } - - // Sometime, the response will be very slow, and does not respond, the connect event will be block by event loop system. - // And timer callback will be fired, and abort() will be invoked before connection, then get "socket hang up" and code ECONNRESET. - // At this time, if we have a large number of request, nodejs will hang up some socket on background. and the number will up and up. - // And then these socket which be hang up will devouring CPU little by little. - // ClientRequest.setTimeout will be fired on the specify milliseconds, and can make sure that abort() will be fired after connect. - req.setTimeout(timeout, handleTimeout); - } else { - // explicitly reset the socket timeout value for a possible `keep-alive` request - req.setTimeout(0); - } - - // Send the request - if (utils.isStream(data)) { - let ended = false; - let errored = false; - - data.on('end', () => { - ended = true; - }); - - data.once('error', (err) => { - errored = true; - req.destroy(err); - }); - - data.on('close', () => { - if (!ended && !errored) { - abort(new CanceledError('Request stream has been aborted', config, req)); - } - }); - - // Enforce maxBodyLength for streamed uploads on every transport that - // does not apply options.maxBodyLength itself (native http/https, http2, - // and user-supplied custom transports). The follow-redirects transport - // enforces it on the redirected HTTP/1 path. - let uploadStream = data; - if (maxBodyLength > -1 && !transportEnforcesMaxBodyLength) { - const limit = maxBodyLength; - let bytesSent = 0; - uploadStream = stream.pipeline( - [ - data, - new stream.Transform({ - transform(chunk, _enc, cb) { - bytesSent += chunk.length; - if (bytesSent > limit) { - return cb( - new AxiosError( - 'Request body larger than maxBodyLength limit', - AxiosError.ERR_BAD_REQUEST, - config, - req - ) - ); - } - cb(null, chunk); - }, - }), - ], - utils.noop - ); - uploadStream.on('error', (err) => { - if (!req.destroyed) req.destroy(err); - }); - } - - uploadStream.pipe(req); - } else { - data && req.write(data); - req.end(); - } - }); - }; - -export const __setProxy = setProxy; -export const __isNodeEnvProxyEnabled = isNodeEnvProxyEnabled; -export const __isSameOriginRedirect = isSameOriginRedirect; diff --git a/server/node_modules/axios/lib/adapters/xhr.js b/server/node_modules/axios/lib/adapters/xhr.js deleted file mode 100644 index 5432ca9..0000000 --- a/server/node_modules/axios/lib/adapters/xhr.js +++ /dev/null @@ -1,228 +0,0 @@ -import utils from '../utils.js'; -import settle from '../core/settle.js'; -import transitionalDefaults from '../defaults/transitional.js'; -import AxiosError from '../core/AxiosError.js'; -import CanceledError from '../cancel/CanceledError.js'; -import parseProtocol from '../helpers/parseProtocol.js'; -import platform from '../platform/index.js'; -import AxiosHeaders from '../core/AxiosHeaders.js'; -import { progressEventReducer } from '../helpers/progressEventReducer.js'; -import resolveConfig from '../helpers/resolveConfig.js'; -import { toByteStringHeaderObject } from '../helpers/sanitizeHeaderValue.js'; - -const isXHRAdapterSupported = typeof XMLHttpRequest !== 'undefined'; - -export default isXHRAdapterSupported && - function (config) { - return new Promise(function dispatchXhrRequest(resolve, reject) { - const _config = resolveConfig(config); - let requestData = _config.data; - const requestHeaders = AxiosHeaders.from(_config.headers).normalize(); - let { responseType, onUploadProgress, onDownloadProgress } = _config; - let onCanceled; - let uploadThrottled, downloadThrottled; - let flushUpload, flushDownload; - - function done() { - flushUpload && flushUpload(); // flush events - flushDownload && flushDownload(); // flush events - - _config.cancelToken && _config.cancelToken.unsubscribe(onCanceled); - - _config.signal && _config.signal.removeEventListener('abort', onCanceled); - } - - let request = new XMLHttpRequest(); - - request.open(_config.method.toUpperCase(), _config.url, true); - - // Set the request timeout in MS - request.timeout = _config.timeout; - - function onloadend() { - if (!request) { - return; - } - // Prepare the response - const responseHeaders = AxiosHeaders.from( - 'getAllResponseHeaders' in request && request.getAllResponseHeaders() - ); - const responseData = - !responseType || responseType === 'text' || responseType === 'json' - ? request.responseText - : request.response; - const response = { - data: responseData, - status: request.status, - statusText: request.statusText, - headers: responseHeaders, - config, - request, - }; - - settle( - function _resolve(value) { - resolve(value); - done(); - }, - function _reject(err) { - reject(err); - done(); - }, - response - ); - - // Clean up request - request = null; - } - - if ('onloadend' in request) { - // Use onloadend if available - request.onloadend = onloadend; - } else { - // Listen for ready state to emulate onloadend - request.onreadystatechange = function handleLoad() { - if (!request || request.readyState !== 4) { - return; - } - - // The request errored out and we didn't get a response, this will be - // handled by onerror instead - // With one exception: request that using file: protocol, most browsers - // will return status as 0 even though it's a successful request - if ( - request.status === 0 && - !(request.responseURL && request.responseURL.startsWith('file:')) - ) { - return; - } - // readystate handler is calling before onerror or ontimeout handlers, - // so we should call onloadend on the next 'tick' - setTimeout(onloadend); - }; - } - - // Handle browser request cancellation (as opposed to a manual cancellation) - request.onabort = function handleAbort() { - if (!request) { - return; - } - - reject(new AxiosError('Request aborted', AxiosError.ECONNABORTED, config, request)); - done(); - - // Clean up request - request = null; - }; - - // Handle low level network errors - request.onerror = function handleError(event) { - // Browsers deliver a ProgressEvent in XHR onerror - // (message may be empty; when present, surface it) - // See https://developer.mozilla.org/docs/Web/API/XMLHttpRequest/error_event - const msg = event && event.message ? event.message : 'Network Error'; - const err = new AxiosError(msg, AxiosError.ERR_NETWORK, config, request); - // attach the underlying event for consumers who want details - err.event = event || null; - reject(err); - done(); - request = null; - }; - - // Handle timeout - request.ontimeout = function handleTimeout() { - let timeoutErrorMessage = _config.timeout - ? 'timeout of ' + _config.timeout + 'ms exceeded' - : 'timeout exceeded'; - const transitional = _config.transitional || transitionalDefaults; - if (_config.timeoutErrorMessage) { - timeoutErrorMessage = _config.timeoutErrorMessage; - } - reject( - new AxiosError( - timeoutErrorMessage, - transitional.clarifyTimeoutError ? AxiosError.ETIMEDOUT : AxiosError.ECONNABORTED, - config, - request - ) - ); - done(); - - // Clean up request - request = null; - }; - - // Remove Content-Type if data is undefined - requestData === undefined && requestHeaders.setContentType(null); - - // Add headers to the request - if ('setRequestHeader' in request) { - utils.forEach(toByteStringHeaderObject(requestHeaders), function setRequestHeader(val, key) { - request.setRequestHeader(key, val); - }); - } - - // Add withCredentials to request if needed - if (!utils.isUndefined(_config.withCredentials)) { - request.withCredentials = !!_config.withCredentials; - } - - // Add responseType to request if needed - if (responseType && responseType !== 'json') { - request.responseType = _config.responseType; - } - - // Handle progress if needed - if (onDownloadProgress) { - [downloadThrottled, flushDownload] = progressEventReducer(onDownloadProgress, true); - request.addEventListener('progress', downloadThrottled); - } - - // Not all browsers support upload events - if (onUploadProgress && request.upload) { - [uploadThrottled, flushUpload] = progressEventReducer(onUploadProgress); - - request.upload.addEventListener('progress', uploadThrottled); - - request.upload.addEventListener('loadend', flushUpload); - } - - if (_config.cancelToken || _config.signal) { - // Handle cancellation - // eslint-disable-next-line func-names - onCanceled = (cancel) => { - if (!request) { - return; - } - reject(!cancel || cancel.type ? new CanceledError(null, config, request) : cancel); - request.abort(); - done(); - request = null; - }; - - _config.cancelToken && _config.cancelToken.subscribe(onCanceled); - if (_config.signal) { - _config.signal.aborted - ? onCanceled() - : _config.signal.addEventListener('abort', onCanceled); - } - } - - const protocol = parseProtocol(_config.url); - - if (protocol && !platform.protocols.includes(protocol)) { - reject( - new AxiosError( - 'Unsupported protocol ' + protocol + ':', - AxiosError.ERR_BAD_REQUEST, - config - ) - ); - done(); - return; - } - - // Send the request - request.send(requestData || null); - }); - }; diff --git a/server/node_modules/axios/lib/axios.js b/server/node_modules/axios/lib/axios.js deleted file mode 100644 index 5a3a876..0000000 --- a/server/node_modules/axios/lib/axios.js +++ /dev/null @@ -1,89 +0,0 @@ -'use strict'; - -import utils from './utils.js'; -import bind from './helpers/bind.js'; -import Axios from './core/Axios.js'; -import mergeConfig from './core/mergeConfig.js'; -import defaults from './defaults/index.js'; -import formDataToJSON from './helpers/formDataToJSON.js'; -import CanceledError from './cancel/CanceledError.js'; -import CancelToken from './cancel/CancelToken.js'; -import isCancel from './cancel/isCancel.js'; -import { VERSION } from './env/data.js'; -import toFormData from './helpers/toFormData.js'; -import AxiosError from './core/AxiosError.js'; -import spread from './helpers/spread.js'; -import isAxiosError from './helpers/isAxiosError.js'; -import AxiosHeaders from './core/AxiosHeaders.js'; -import adapters from './adapters/adapters.js'; -import HttpStatusCode from './helpers/HttpStatusCode.js'; - -/** - * Create an instance of Axios - * - * @param {Object} defaultConfig The default config for the instance - * - * @returns {Axios} A new instance of Axios - */ -function createInstance(defaultConfig) { - const context = new Axios(defaultConfig); - const instance = bind(Axios.prototype.request, context); - - // Copy axios.prototype to instance - utils.extend(instance, Axios.prototype, context, { allOwnKeys: true }); - - // Copy context to instance - utils.extend(instance, context, null, { allOwnKeys: true }); - - // Factory for creating new instances - instance.create = function create(instanceConfig) { - return createInstance(mergeConfig(defaultConfig, instanceConfig)); - }; - - return instance; -} - -// Create the default instance to be exported -const axios = createInstance(defaults); - -// Expose Axios class to allow class inheritance -axios.Axios = Axios; - -// Expose Cancel & CancelToken -axios.CanceledError = CanceledError; -axios.CancelToken = CancelToken; -axios.isCancel = isCancel; -axios.VERSION = VERSION; -axios.toFormData = toFormData; - -// Expose AxiosError class -axios.AxiosError = AxiosError; - -// alias for CanceledError for backward compatibility -axios.Cancel = axios.CanceledError; - -// Expose all/spread -axios.all = function all(promises) { - return Promise.all(promises); -}; - -axios.spread = spread; - -// Expose isAxiosError -axios.isAxiosError = isAxiosError; - -// Expose mergeConfig -axios.mergeConfig = mergeConfig; - -axios.AxiosHeaders = AxiosHeaders; - -axios.formToJSON = (thing) => formDataToJSON(utils.isHTMLForm(thing) ? new FormData(thing) : thing); - -axios.getAdapter = adapters.getAdapter; - -axios.HttpStatusCode = HttpStatusCode; - -axios.default = axios; - -// this module should only have a default export -export default axios; diff --git a/server/node_modules/axios/lib/cancel/CancelToken.js b/server/node_modules/axios/lib/cancel/CancelToken.js deleted file mode 100644 index 357381e..0000000 --- a/server/node_modules/axios/lib/cancel/CancelToken.js +++ /dev/null @@ -1,135 +0,0 @@ -'use strict'; - -import CanceledError from './CanceledError.js'; - -/** - * A `CancelToken` is an object that can be used to request cancellation of an operation. - * - * @param {Function} executor The executor function. - * - * @returns {CancelToken} - */ -class CancelToken { - constructor(executor) { - if (typeof executor !== 'function') { - throw new TypeError('executor must be a function.'); - } - - let resolvePromise; - - this.promise = new Promise(function promiseExecutor(resolve) { - resolvePromise = resolve; - }); - - const token = this; - - // eslint-disable-next-line func-names - this.promise.then((cancel) => { - if (!token._listeners) return; - - let i = token._listeners.length; - - while (i-- > 0) { - token._listeners[i](cancel); - } - token._listeners = null; - }); - - // eslint-disable-next-line func-names - this.promise.then = (onfulfilled) => { - let _resolve; - // eslint-disable-next-line func-names - const promise = new Promise((resolve) => { - token.subscribe(resolve); - _resolve = resolve; - }).then(onfulfilled); - - promise.cancel = function reject() { - token.unsubscribe(_resolve); - }; - - return promise; - }; - - executor(function cancel(message, config, request) { - if (token.reason) { - // Cancellation has already been requested - return; - } - - token.reason = new CanceledError(message, config, request); - resolvePromise(token.reason); - }); - } - - /** - * Throws a `CanceledError` if cancellation has been requested. - */ - throwIfRequested() { - if (this.reason) { - throw this.reason; - } - } - - /** - * Subscribe to the cancel signal - */ - - subscribe(listener) { - if (this.reason) { - listener(this.reason); - return; - } - - if (this._listeners) { - this._listeners.push(listener); - } else { - this._listeners = [listener]; - } - } - - /** - * Unsubscribe from the cancel signal - */ - - unsubscribe(listener) { - if (!this._listeners) { - return; - } - const index = this._listeners.indexOf(listener); - if (index !== -1) { - this._listeners.splice(index, 1); - } - } - - toAbortSignal() { - const controller = new AbortController(); - - const abort = (err) => { - controller.abort(err); - }; - - this.subscribe(abort); - - controller.signal.unsubscribe = () => this.unsubscribe(abort); - - return controller.signal; - } - - /** - * Returns an object that contains a new `CancelToken` and a function that, when called, - * cancels the `CancelToken`. - */ - static source() { - let cancel; - const token = new CancelToken(function executor(c) { - cancel = c; - }); - return { - token, - cancel, - }; - } -} - -export default CancelToken; diff --git a/server/node_modules/axios/lib/cancel/CanceledError.js b/server/node_modules/axios/lib/cancel/CanceledError.js deleted file mode 100644 index e769b89..0000000 --- a/server/node_modules/axios/lib/cancel/CanceledError.js +++ /dev/null @@ -1,22 +0,0 @@ -'use strict'; - -import AxiosError from '../core/AxiosError.js'; - -class CanceledError extends AxiosError { - /** - * A `CanceledError` is an object that is thrown when an operation is canceled. - * - * @param {string=} message The message. - * @param {Object=} config The config. - * @param {Object=} request The request. - * - * @returns {CanceledError} The created error. - */ - constructor(message, config, request) { - super(message == null ? 'canceled' : message, AxiosError.ERR_CANCELED, config, request); - this.name = 'CanceledError'; - this.__CANCEL__ = true; - } -} - -export default CanceledError; diff --git a/server/node_modules/axios/lib/cancel/isCancel.js b/server/node_modules/axios/lib/cancel/isCancel.js deleted file mode 100644 index a444a12..0000000 --- a/server/node_modules/axios/lib/cancel/isCancel.js +++ /dev/null @@ -1,5 +0,0 @@ -'use strict'; - -export default function isCancel(value) { - return !!(value && value.__CANCEL__); -} diff --git a/server/node_modules/axios/lib/core/Axios.js b/server/node_modules/axios/lib/core/Axios.js deleted file mode 100644 index fe81632..0000000 --- a/server/node_modules/axios/lib/core/Axios.js +++ /dev/null @@ -1,301 +0,0 @@ -'use strict'; - -import utils from '../utils.js'; -import buildURL from '../helpers/buildURL.js'; -import InterceptorManager from './InterceptorManager.js'; -import dispatchRequest from './dispatchRequest.js'; -import mergeConfig from './mergeConfig.js'; -import buildFullPath from './buildFullPath.js'; -import validator from '../helpers/validator.js'; -import AxiosHeaders from './AxiosHeaders.js'; -import transitionalDefaults from '../defaults/transitional.js'; - -const validators = validator.validators; - -/** - * Create a new instance of Axios - * - * @param {Object} instanceConfig The default config for the instance - * - * @return {Axios} A new instance of Axios - */ -class Axios { - constructor(instanceConfig) { - this.defaults = instanceConfig || {}; - this.interceptors = { - request: new InterceptorManager(), - response: new InterceptorManager(), - }; - } - - /** - * Dispatch a request - * - * @param {String|Object} configOrUrl The config specific for this request (merged with this.defaults) - * @param {?Object} config - * - * @returns {Promise} The Promise to be fulfilled - */ - async request(configOrUrl, config) { - try { - return await this._request(configOrUrl, config); - } catch (err) { - if (err instanceof Error) { - let dummy = {}; - - Error.captureStackTrace ? Error.captureStackTrace(dummy) : (dummy = new Error()); - - // slice off the Error: ... line - const stack = (() => { - if (!dummy.stack) { - return ''; - } - - const firstNewlineIndex = dummy.stack.indexOf('\n'); - - return firstNewlineIndex === -1 ? '' : dummy.stack.slice(firstNewlineIndex + 1); - })(); - try { - if (!err.stack) { - err.stack = stack; - // match without the 2 top stack lines - } else if (stack) { - const firstNewlineIndex = stack.indexOf('\n'); - const secondNewlineIndex = - firstNewlineIndex === -1 ? -1 : stack.indexOf('\n', firstNewlineIndex + 1); - const stackWithoutTwoTopLines = - secondNewlineIndex === -1 ? '' : stack.slice(secondNewlineIndex + 1); - - if (!String(err.stack).endsWith(stackWithoutTwoTopLines)) { - err.stack += '\n' + stack; - } - } - } catch (e) { - // ignore the case where "stack" is an un-writable property - } - } - - throw err; - } - } - - _request(configOrUrl, config) { - /*eslint no-param-reassign:0*/ - // Allow for axios('example/url'[, config]) a la fetch API - if (typeof configOrUrl === 'string') { - config = config || {}; - config.url = configOrUrl; - } else { - config = configOrUrl || {}; - } - - config = mergeConfig(this.defaults, config); - - const { transitional, paramsSerializer, headers } = config; - - if (transitional !== undefined) { - validator.assertOptions( - transitional, - { - silentJSONParsing: validators.transitional(validators.boolean), - forcedJSONParsing: validators.transitional(validators.boolean), - clarifyTimeoutError: validators.transitional(validators.boolean), - legacyInterceptorReqResOrdering: validators.transitional(validators.boolean), - advertiseZstdAcceptEncoding: validators.transitional(validators.boolean), - validateStatusUndefinedResolves: validators.transitional(validators.boolean), - }, - false - ); - } - - if (paramsSerializer != null) { - if (utils.isFunction(paramsSerializer)) { - config.paramsSerializer = { - serialize: paramsSerializer, - }; - } else { - validator.assertOptions( - paramsSerializer, - { - encode: validators.function, - serialize: validators.function, - }, - true - ); - } - } - - // Set config.allowAbsoluteUrls - if (config.allowAbsoluteUrls !== undefined) { - // do nothing - } else if (this.defaults.allowAbsoluteUrls !== undefined) { - config.allowAbsoluteUrls = this.defaults.allowAbsoluteUrls; - } else { - config.allowAbsoluteUrls = true; - } - - validator.assertOptions( - config, - { - baseUrl: validators.spelling('baseURL'), - withXsrfToken: validators.spelling('withXSRFToken'), - }, - true - ); - - // Set config.method - config.method = (config.method || this.defaults.method || 'get').toLowerCase(); - - // Flatten headers - let contextHeaders = headers && utils.merge(headers.common, headers[config.method]); - - headers && - utils.forEach(['delete', 'get', 'head', 'post', 'put', 'patch', 'query', 'common'], (method) => { - delete headers[method]; - }); - - config.headers = AxiosHeaders.concat(contextHeaders, headers); - - // filter out skipped interceptors - const requestInterceptorChain = []; - let synchronousRequestInterceptors = true; - this.interceptors.request.forEach(function unshiftRequestInterceptors(interceptor) { - if (typeof interceptor.runWhen === 'function' && interceptor.runWhen(config) === false) { - return; - } - - synchronousRequestInterceptors = synchronousRequestInterceptors && interceptor.synchronous; - - const transitional = config.transitional || transitionalDefaults; - const legacyInterceptorReqResOrdering = - transitional && transitional.legacyInterceptorReqResOrdering; - - if (legacyInterceptorReqResOrdering) { - requestInterceptorChain.unshift(interceptor.fulfilled, interceptor.rejected); - } else { - requestInterceptorChain.push(interceptor.fulfilled, interceptor.rejected); - } - }); - - const responseInterceptorChain = []; - this.interceptors.response.forEach(function pushResponseInterceptors(interceptor) { - responseInterceptorChain.push(interceptor.fulfilled, interceptor.rejected); - }); - - let promise; - let i = 0; - let len; - - if (!synchronousRequestInterceptors) { - const chain = [dispatchRequest.bind(this), undefined]; - chain.unshift(...requestInterceptorChain); - chain.push(...responseInterceptorChain); - len = chain.length; - - promise = Promise.resolve(config); - - while (i < len) { - promise = promise.then(chain[i++], chain[i++]); - } - - return promise; - } - - len = requestInterceptorChain.length; - - let newConfig = config; - - while (i < len) { - const onFulfilled = requestInterceptorChain[i++]; - const onRejected = requestInterceptorChain[i++]; - try { - newConfig = onFulfilled ? onFulfilled(newConfig) : newConfig; - } catch (error) { - if (!onRejected) { - promise = Promise.reject(error); - break; - } - - try { - const rejectedResult = onRejected.call(this, error); - - if (utils.isThenable(rejectedResult)) { - promise = Promise.resolve(rejectedResult).then(() => - dispatchRequest.call(this, newConfig) - ); - } - } catch (rejectedError) { - promise = Promise.reject(rejectedError); - } - - break; - } - } - - if (!promise) { - try { - promise = dispatchRequest.call(this, newConfig); - } catch (error) { - promise = Promise.reject(error); - } - } - - i = 0; - len = responseInterceptorChain.length; - - while (i < len) { - promise = promise.then(responseInterceptorChain[i++], responseInterceptorChain[i++]); - } - - return promise; - } - - getUri(config) { - config = mergeConfig(this.defaults, config); - const fullPath = buildFullPath(config.baseURL, config.url, config.allowAbsoluteUrls, config); - return buildURL(fullPath, config.params, config.paramsSerializer); - } -} - -// Provide aliases for supported request methods -utils.forEach(['delete', 'get', 'head', 'options'], function forEachMethodNoData(method) { - /*eslint func-names:0*/ - Axios.prototype[method] = function (url, config) { - return this.request( - mergeConfig(config || {}, { - method, - url, - data: config && utils.hasOwnProp(config, 'data') ? config.data : undefined, - }) - ); - }; -}); - -utils.forEach(['post', 'put', 'patch', 'query'], function forEachMethodWithData(method) { - function generateHTTPMethod(isForm) { - return function httpMethod(url, data, config) { - return this.request( - mergeConfig(config || {}, { - method, - headers: isForm - ? { - 'Content-Type': 'multipart/form-data', - } - : {}, - url, - data, - }) - ); - }; - } - - Axios.prototype[method] = generateHTTPMethod(); - - // QUERY is a safe/idempotent read method; multipart form bodies don't fit - // its semantics, so no queryForm shorthand is generated. - if (method !== 'query') { - Axios.prototype[method + 'Form'] = generateHTTPMethod(true); - } -}); - -export default Axios; diff --git a/server/node_modules/axios/lib/core/AxiosError.js b/server/node_modules/axios/lib/core/AxiosError.js deleted file mode 100644 index 740d8a2..0000000 --- a/server/node_modules/axios/lib/core/AxiosError.js +++ /dev/null @@ -1,219 +0,0 @@ -'use strict'; - -import utils from '../utils.js'; -import AxiosHeaders from './AxiosHeaders.js'; - -export const REDACTED = '[REDACTED ****]'; - -function hasOwnOrPrototypeToJSON(source) { - if (utils.hasOwnProp(source, 'toJSON')) { - return true; - } - - let prototype = Object.getPrototypeOf(source); - - while (prototype && prototype !== Object.prototype) { - if (utils.hasOwnProp(prototype, 'toJSON')) { - return true; - } - - prototype = Object.getPrototypeOf(prototype); - } - - return false; -} - -// Build a plain-object snapshot of `config` and replace the value of any key -// (case-insensitive) listed in `redactKeys` with REDACTED. Walks through arrays -// and AxiosHeaders, and short-circuits on circular references. -function redactConfig(config, redactKeys) { - const lowerKeys = new Set(redactKeys.map((k) => String(k).toLowerCase())); - const seen = []; - - const visit = (source) => { - if (source === null || typeof source !== 'object') return source; - if (utils.isBuffer(source)) return source; - if (seen.indexOf(source) !== -1) return undefined; - - if (source instanceof AxiosHeaders) { - source = source.toJSON(); - } - - seen.push(source); - - let result; - if (utils.isArray(source)) { - result = []; - source.forEach((v, i) => { - const reducedValue = visit(v); - if (!utils.isUndefined(reducedValue)) { - result[i] = reducedValue; - } - }); - } else { - if (!utils.isPlainObject(source) && hasOwnOrPrototypeToJSON(source)) { - seen.pop(); - return source; - } - - result = Object.create(null); - for (const [key, value] of Object.entries(source)) { - const reducedValue = lowerKeys.has(key.toLowerCase()) ? REDACTED : visit(value); - if (!utils.isUndefined(reducedValue)) { - result[key] = reducedValue; - } - } - } - - seen.pop(); - return result; - }; - - return visit(config); -} - -function stringifySafely(value) { - try { - return String(value); - } catch (err) { - return ''; - } -} - -function aggregateErrorMessage(error) { - const message = error.errors - .map((entry) => { - try { - return entry && entry.message ? stringifySafely(entry.message) : stringifySafely(entry); - } catch (err) { - return ''; - } - }) - .filter(Boolean) - .join('; '); - - return message || error.name || 'AggregateError'; -} - -class AxiosError extends Error { - static from(error, code, config, request, response, customProps) { - // `AggregateError` (thrown by Node on dual-stack/Happy-Eyeballs connection - // failures) has an empty `message`; its detail lives in `errors[]`. Without - // this, the wrapped error surfaces with a blank message (see #6721). - let message = error.message; - if (!message && utils.isArray(error.errors) && error.errors.length) { - message = aggregateErrorMessage(error); - } - - const axiosError = new AxiosError(message, code || error.code, config, request, response); - // Match native `Error` `cause` semantics: non-enumerable. The wrapped - // error often carries circular internals (sockets, requests, agents), so - // an enumerable `cause` makes structured loggers (pino/winston) and any - // own-property walk throw "Converting circular structure to JSON". - // Regression from #6982; see #7205. `__proto__: null` mirrors the - // `message` descriptor below (prototype-pollution-safe descriptor). - Object.defineProperty(axiosError, 'cause', { - __proto__: null, - value: error, - writable: true, - enumerable: false, - configurable: true, - }); - axiosError.name = error.name; - - // Preserve status from the original error if not already set from response - if (error.status != null && axiosError.status == null) { - axiosError.status = error.status; - } - - customProps && Object.assign(axiosError, customProps); - return axiosError; - } - - /** - * Create an Error with the specified message, config, error code, request and response. - * - * @param {string} message The error message. - * @param {string} [code] The error code (for example, 'ECONNABORTED'). - * @param {Object} [config] The config. - * @param {Object} [request] The request. - * @param {Object} [response] The response. - * - * @returns {Error} The created error. - */ - constructor(message, code, config, request, response) { - super(message); - - // Make message enumerable to maintain backward compatibility - // The native Error constructor sets message as non-enumerable, - // but axios < v1.13.3 had it as enumerable - Object.defineProperty(this, 'message', { - // Null-proto descriptor so a polluted Object.prototype.get cannot turn - // this data descriptor into an accessor descriptor on the way in. - __proto__: null, - value: message, - enumerable: true, - writable: true, - configurable: true, - }); - - this.name = 'AxiosError'; - this.isAxiosError = true; - code && (this.code = code); - config && (this.config = config); - request && (this.request = request); - if (response) { - this.response = response; - this.status = response.status; - } - } - - toJSON() { - // Opt-in redaction: when the request config carries a `redact` array, the - // value of any matching key (case-insensitive, at any depth) is replaced - // with REDACTED in the serialized snapshot. Undefined or empty leaves the - // existing serialization behavior unchanged. - const config = this.config; - const redactKeys = config && utils.hasOwnProp(config, 'redact') ? config.redact : undefined; - const serializedConfig = - utils.isArray(redactKeys) && redactKeys.length > 0 - ? redactConfig(config, redactKeys) - : utils.toJSONObject(config); - - return { - // Standard - message: this.message, - name: this.name, - // Microsoft - description: this.description, - number: this.number, - // Mozilla - fileName: this.fileName, - lineNumber: this.lineNumber, - columnNumber: this.columnNumber, - stack: this.stack, - // Axios - config: serializedConfig, - code: this.code, - status: this.status, - }; - } -} - -// This can be changed to static properties as soon as the parser options in .eslint.cjs are updated. -AxiosError.ERR_BAD_OPTION_VALUE = 'ERR_BAD_OPTION_VALUE'; -AxiosError.ERR_BAD_OPTION = 'ERR_BAD_OPTION'; -AxiosError.ECONNABORTED = 'ECONNABORTED'; -AxiosError.ETIMEDOUT = 'ETIMEDOUT'; -AxiosError.ECONNREFUSED = 'ECONNREFUSED'; -AxiosError.ERR_NETWORK = 'ERR_NETWORK'; -AxiosError.ERR_FR_TOO_MANY_REDIRECTS = 'ERR_FR_TOO_MANY_REDIRECTS'; -AxiosError.ERR_DEPRECATED = 'ERR_DEPRECATED'; -AxiosError.ERR_BAD_RESPONSE = 'ERR_BAD_RESPONSE'; -AxiosError.ERR_BAD_REQUEST = 'ERR_BAD_REQUEST'; -AxiosError.ERR_CANCELED = 'ERR_CANCELED'; -AxiosError.ERR_NOT_SUPPORT = 'ERR_NOT_SUPPORT'; -AxiosError.ERR_INVALID_URL = 'ERR_INVALID_URL'; -AxiosError.ERR_FORM_DATA_DEPTH_EXCEEDED = 'ERR_FORM_DATA_DEPTH_EXCEEDED'; - -export default AxiosError; diff --git a/server/node_modules/axios/lib/core/AxiosHeaders.js b/server/node_modules/axios/lib/core/AxiosHeaders.js deleted file mode 100644 index 0f3337b..0000000 --- a/server/node_modules/axios/lib/core/AxiosHeaders.js +++ /dev/null @@ -1,474 +0,0 @@ -'use strict'; - -import utils from '../utils.js'; -import parseHeaders from '../helpers/parseHeaders.js'; -import { sanitizeHeaderValue } from '../helpers/sanitizeHeaderValue.js'; - -const $internals = Symbol('internals'); - -function normalizeHeader(header) { - return header && String(header).trim().toLowerCase(); -} - -function normalizeValue(value) { - if (value === false || value == null) { - return value; - } - - return utils.isArray(value) ? value.map(normalizeValue) : sanitizeHeaderValue(String(value)); -} - -function parseTokens(str) { - const tokens = Object.create(null); - const tokensRE = /([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g; - let match; - - while ((match = tokensRE.exec(str))) { - tokens[match[1]] = match[2]; - } - - return tokens; -} - -const parameterNameRE = /^[!#$%&'*+\-.^_`|~0-9A-Za-z]+$/; - -function trimOWS(value) { - let start = 0; - let end = value.length; - - while (start < end) { - const code = value.charCodeAt(start); - - if (code !== 0x09 && code !== 0x20) { - break; - } - - start += 1; - } - - while (end > start) { - const code = value.charCodeAt(end - 1); - - if (code !== 0x09 && code !== 0x20) { - break; - } - - end -= 1; - } - - return start === 0 && end === value.length ? value : value.slice(start, end); -} - -function decodeQuotedString(value) { - const last = value.length - 1; - - if (last < 1 || value.charCodeAt(0) !== 0x22 || value.charCodeAt(last) !== 0x22) { - return value; - } - - let decoded = ''; - - for (let i = 1; i < last; i++) { - const code = value.charCodeAt(i); - - if (code === 0x22) { - return value; - } - - if (code === 0x5c) { - i += 1; - - if (i >= last) { - return value; - } - } - - decoded += value[i]; - } - - return decoded; -} - -function parseParameters(value) { - const parameters = Object.create(null); - const str = String(value); - let start = 0; - let quoted = false; - let escaped = false; - - function parseParameter(end) { - const part = trimOWS(str.slice(start, end)); - const equals = part.indexOf('='); - - if (equals < 1) { - return; - } - - const name = trimOWS(part.slice(0, equals)); - - if (!parameterNameRE.test(name)) { - return; - } - - const normalizedName = name.toLowerCase(); - - if ( - normalizedName === '__proto__' || - normalizedName === 'constructor' || - normalizedName === 'prototype' - ) { - return; - } - - const parameterValue = trimOWS(part.slice(equals + 1)); - parameters[normalizedName] = decodeQuotedString(parameterValue); - } - - for (let i = 0; i < str.length; i++) { - const code = str.charCodeAt(i); - - if (quoted) { - if (escaped) { - escaped = false; - } else if (code === 0x5c) { - escaped = true; - } else if (code === 0x22) { - quoted = false; - } - } else if (code === 0x22) { - quoted = true; - } else if (code === 0x2c || code === 0x3b) { - parseParameter(i); - start = i + 1; - } - } - - parseParameter(str.length); - - return parameters; -} - -const isValidHeaderName = (str) => /^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(str.trim()); - -function matchHeaderValue(context, value, header, filter, isHeaderNameFilter) { - if (utils.isFunction(filter)) { - return filter.call(this, value, header); - } - - if (isHeaderNameFilter) { - value = header; - } - - if (!utils.isString(value)) return; - - if (utils.isString(filter)) { - return value.indexOf(filter) !== -1; - } - - if (utils.isRegExp(filter)) { - return filter.test(value); - } -} - -function formatHeader(header) { - return header - .trim() - .toLowerCase() - .replace(/([a-z\d])(\w*)/g, (w, char, str) => { - return char.toUpperCase() + str; - }); -} - -function buildAccessors(obj, header) { - const accessorName = utils.toCamelCase(' ' + header); - - ['get', 'set', 'has'].forEach((methodName) => { - Object.defineProperty(obj, methodName + accessorName, { - // Null-proto descriptor so a polluted Object.prototype.get cannot turn - // this data descriptor into an accessor descriptor on the way in. - __proto__: null, - value: function (arg1, arg2, arg3) { - return this[methodName].call(this, header, arg1, arg2, arg3); - }, - configurable: true, - }); - }); -} - -class AxiosHeaders { - constructor(headers) { - headers && this.set(headers); - } - - set(header, valueOrRewrite, rewrite) { - const self = this; - - function setHeader(_value, _header, _rewrite) { - const lHeader = normalizeHeader(_header); - - if (!lHeader) { - return; - } - - const key = utils.findKey(self, lHeader); - - if ( - !key || - self[key] === undefined || - _rewrite === true || - (_rewrite === undefined && self[key] !== false) - ) { - self[key || _header] = normalizeValue(_value); - } - } - - const setHeaders = (headers, _rewrite) => - utils.forEach(headers, (_value, _header) => setHeader(_value, _header, _rewrite)); - - if (utils.isPlainObject(header) || header instanceof this.constructor) { - setHeaders(header, valueOrRewrite); - } else if (utils.isString(header) && (header = header.trim()) && !isValidHeaderName(header)) { - setHeaders(parseHeaders(header), valueOrRewrite); - } else if (utils.isObject(header) && utils.isSafeIterable(header)) { - let obj = Object.create(null), - dest, - key; - for (const entry of header) { - if (!utils.isArray(entry)) { - throw new TypeError('Object iterator must return a key-value pair'); - } - - key = entry[0]; - - if (utils.hasOwnProp(obj, key)) { - dest = obj[key]; - obj[key] = utils.isArray(dest) ? [...dest, entry[1]] : [dest, entry[1]]; - } else { - obj[key] = entry[1]; - } - } - - setHeaders(obj, valueOrRewrite); - } else { - header != null && setHeader(valueOrRewrite, header, rewrite); - } - - return this; - } - - get(header, parser) { - header = normalizeHeader(header); - - if (header) { - const key = utils.findKey(this, header); - - if (key) { - const value = this[key]; - - if (!parser) { - return value; - } - - if (parser === true) { - return parseTokens(value); - } - - if (utils.isFunction(parser)) { - return parser.call(this, value, key); - } - - if (utils.isRegExp(parser)) { - return parser.exec(value); - } - - throw new TypeError('parser must be boolean|regexp|function'); - } - } - } - - has(header, matcher) { - header = normalizeHeader(header); - - if (header) { - const key = utils.findKey(this, header); - - return !!( - key && - this[key] !== undefined && - (!matcher || matchHeaderValue(this, this[key], key, matcher)) - ); - } - - return false; - } - - delete(header, matcher) { - const self = this; - let deleted = false; - - function deleteHeader(_header) { - _header = normalizeHeader(_header); - - if (_header) { - const key = utils.findKey(self, _header); - - if (key && (!matcher || matchHeaderValue(self, self[key], key, matcher))) { - delete self[key]; - - deleted = true; - } - } - } - - if (utils.isArray(header)) { - header.forEach(deleteHeader); - } else { - deleteHeader(header); - } - - return deleted; - } - - clear(matcher) { - const keys = Object.keys(this); - let i = keys.length; - let deleted = false; - - while (i--) { - const key = keys[i]; - if (!matcher || matchHeaderValue(this, this[key], key, matcher, true)) { - delete this[key]; - deleted = true; - } - } - - return deleted; - } - - normalize(format) { - const self = this; - const headers = {}; - - utils.forEach(this, (value, header) => { - const key = utils.findKey(headers, header); - - if (key) { - self[key] = normalizeValue(value); - delete self[header]; - return; - } - - const normalized = format ? formatHeader(header) : String(header).trim(); - - if (normalized !== header) { - delete self[header]; - } - - self[normalized] = normalizeValue(value); - - headers[normalized] = true; - }); - - return this; - } - - concat(...targets) { - return this.constructor.concat(this, ...targets); - } - - toJSON(asStrings) { - const obj = Object.create(null); - - utils.forEach(this, (value, header) => { - value != null && - value !== false && - (obj[header] = asStrings && utils.isArray(value) ? value.join(', ') : value); - }); - - return obj; - } - - [Symbol.iterator]() { - return Object.entries(this.toJSON())[Symbol.iterator](); - } - - toString() { - return Object.entries(this.toJSON()) - .map(([header, value]) => header + ': ' + value) - .join('\n'); - } - - getSetCookie() { - const value = this.get('set-cookie'); - return utils.isArray(value) ? value : value == null || value === false ? [] : [value]; - } - - get [Symbol.toStringTag]() { - return 'AxiosHeaders'; - } - - static from(thing) { - return thing instanceof this ? thing : new this(thing); - } - - static parseParameters(value) { - return parseParameters(value); - } - - static concat(first, ...targets) { - const computed = new this(first); - - targets.forEach((target) => computed.set(target)); - - return computed; - } - - static accessor(header) { - const internals = - (this[$internals] = - this[$internals] = - { - accessors: {}, - }); - - const accessors = internals.accessors; - const prototype = this.prototype; - - function defineAccessor(_header) { - const lHeader = normalizeHeader(_header); - - if (!accessors[lHeader]) { - buildAccessors(prototype, _header); - accessors[lHeader] = true; - } - } - - utils.isArray(header) ? header.forEach(defineAccessor) : defineAccessor(header); - - return this; - } -} - -AxiosHeaders.accessor([ - 'Content-Type', - 'Content-Length', - 'Accept', - 'Accept-Encoding', - 'User-Agent', - 'Authorization', -]); - -// reserved names hotfix -utils.reduceDescriptors(AxiosHeaders.prototype, ({ value }, key) => { - let mapped = key[0].toUpperCase() + key.slice(1); // map `set` => `Set` - return { - get: () => value, - set(headerValue) { - this[mapped] = headerValue; - }, - }; -}); - -utils.freezeMethods(AxiosHeaders); - -export default AxiosHeaders; diff --git a/server/node_modules/axios/lib/core/InterceptorManager.js b/server/node_modules/axios/lib/core/InterceptorManager.js deleted file mode 100644 index fe10f3d..0000000 --- a/server/node_modules/axios/lib/core/InterceptorManager.js +++ /dev/null @@ -1,72 +0,0 @@ -'use strict'; - -import utils from '../utils.js'; - -class InterceptorManager { - constructor() { - this.handlers = []; - } - - /** - * Add a new interceptor to the stack - * - * @param {Function} fulfilled The function to handle `then` for a `Promise` - * @param {Function} rejected The function to handle `reject` for a `Promise` - * @param {Object} options The options for the interceptor, synchronous and runWhen - * - * @return {Number} An ID used to remove interceptor later - */ - use(fulfilled, rejected, options) { - this.handlers.push({ - fulfilled, - rejected, - synchronous: options ? options.synchronous : false, - runWhen: options ? options.runWhen : null, - }); - return this.handlers.length - 1; - } - - /** - * Remove an interceptor from the stack - * - * @param {Number} id The ID that was returned by `use` - * - * @returns {void} - */ - eject(id) { - if (this.handlers[id]) { - this.handlers[id] = null; - } - } - - /** - * Clear all interceptors from the stack - * - * @returns {void} - */ - clear() { - if (this.handlers) { - this.handlers = []; - } - } - - /** - * Iterate over all the registered interceptors - * - * This method is particularly useful for skipping over any - * interceptors that may have become `null` calling `eject`. - * - * @param {Function} fn The function to call for each interceptor - * - * @returns {void} - */ - forEach(fn) { - utils.forEach(this.handlers, function forEachHandler(h) { - if (h !== null) { - fn(h); - } - }); - } -} - -export default InterceptorManager; diff --git a/server/node_modules/axios/lib/core/README.md b/server/node_modules/axios/lib/core/README.md deleted file mode 100644 index 84559ce..0000000 --- a/server/node_modules/axios/lib/core/README.md +++ /dev/null @@ -1,8 +0,0 @@ -# axios // core - -The modules found in `core/` should be modules that are specific to the domain logic of axios. These modules would most likely not make sense to be consumed outside of the axios module, as their logic is too specific. Some examples of core modules are: - -- Dispatching requests - - Requests sent via `adapters/` (see lib/adapters/README.md) -- Managing interceptors -- Handling config diff --git a/server/node_modules/axios/lib/core/buildFullPath.js b/server/node_modules/axios/lib/core/buildFullPath.js deleted file mode 100644 index 9664d3a..0000000 --- a/server/node_modules/axios/lib/core/buildFullPath.js +++ /dev/null @@ -1,88 +0,0 @@ -'use strict'; - -import AxiosError, { REDACTED } from './AxiosError.js'; -import isAbsoluteURL from '../helpers/isAbsoluteURL.js'; -import combineURLs from '../helpers/combineURLs.js'; - -const malformedHttpProtocol = /^https?:(?!\/\/)/i; -const httpProtocolControlCharacters = /[\t\n\r]/g; - -function stripLeadingC0ControlOrSpace(url) { - let i = 0; - while (i < url.length && url.charCodeAt(i) <= 0x20) { - i++; - } - return url.slice(i); -} - -function normalizeURLForProtocolCheck(url) { - return stripLeadingC0ControlOrSpace(url).replace(httpProtocolControlCharacters, ''); -} - -// Redact the parts of a URL that can carry secrets before it is embedded in an -// error message. AxiosError.toJSON() serializes `message` verbatim and errors -// are commonly logged, while the opt-in `config.redact` model only cleans -// config keys — it cannot reach the message. Redact only the genuinely -// sensitive substrings — userinfo (credentials), query parameter values and -// fragment contents — with the same REDACTED marker the config redaction uses, -// while keeping the scheme, host, path and parameter names so the offending -// request stays accurately identifiable. -function redactFragment(fragment) { - if (!fragment) { - return fragment; - } - - return fragment.replace(/(^|&)([^=&]*=)?[^&]+/g, (match, separator, parameterName = '') => { - return `${separator}${parameterName}${REDACTED}`; - }); -} - -function redactSensitiveURLParts(url) { - const redactedURL = url.replace(/^(https?:\/{0,2})[^/?#]*@/i, `$1${REDACTED}@`); - const fragmentIndex = redactedURL.indexOf('#'); - const urlWithoutFragment = - fragmentIndex === -1 ? redactedURL : redactedURL.slice(0, fragmentIndex); - const redactedURLWithoutFragment = urlWithoutFragment.replace( - /([?&][^=&#]*=)[^&#]*/g, - `$1${REDACTED}` - ); - - if (fragmentIndex === -1) { - return redactedURLWithoutFragment; - } - - return `${redactedURLWithoutFragment}#${redactFragment(redactedURL.slice(fragmentIndex + 1))}`; -} - -function assertValidHttpProtocolURL(url, config) { - if (typeof url === 'string') { - const normalizedURL = normalizeURLForProtocolCheck(url); - if (malformedHttpProtocol.test(normalizedURL)) { - throw new AxiosError( - `Invalid URL ${JSON.stringify(redactSensitiveURLParts(normalizedURL))}: missing "//" after protocol`, - AxiosError.ERR_INVALID_URL, - config - ); - } - } -} - -/** - * Creates a new URL by combining the baseURL with the requestedURL, - * only when the requestedURL is not already an absolute URL. - * If the requestURL is absolute, this function returns the requestedURL untouched. - * - * @param {string} baseURL The base URL - * @param {string} requestedURL Absolute or relative URL to combine - * - * @returns {string} The combined full path - */ -export default function buildFullPath(baseURL, requestedURL, allowAbsoluteUrls, config) { - assertValidHttpProtocolURL(requestedURL, config); - let isRelativeUrl = !isAbsoluteURL(requestedURL); - if (baseURL && (isRelativeUrl || allowAbsoluteUrls === false)) { - assertValidHttpProtocolURL(baseURL, config); - return combineURLs(baseURL, requestedURL); - } - return requestedURL; -} diff --git a/server/node_modules/axios/lib/core/dispatchRequest.js b/server/node_modules/axios/lib/core/dispatchRequest.js deleted file mode 100644 index 59662d4..0000000 --- a/server/node_modules/axios/lib/core/dispatchRequest.js +++ /dev/null @@ -1,89 +0,0 @@ -'use strict'; - -import transformData from './transformData.js'; -import isCancel from '../cancel/isCancel.js'; -import defaults from '../defaults/index.js'; -import CanceledError from '../cancel/CanceledError.js'; -import AxiosHeaders from '../core/AxiosHeaders.js'; -import adapters from '../adapters/adapters.js'; - -/** - * Throws a `CanceledError` if cancellation has been requested. - * - * @param {Object} config The config that is to be used for the request - * - * @returns {void} - */ -function throwIfCancellationRequested(config) { - if (config.cancelToken) { - config.cancelToken.throwIfRequested(); - } - - if (config.signal && config.signal.aborted) { - throw new CanceledError(null, config); - } -} - -/** - * Dispatch a request to the server using the configured adapter. - * - * @param {object} config The config that is to be used for the request - * - * @returns {Promise} The Promise to be fulfilled - */ -export default function dispatchRequest(config) { - throwIfCancellationRequested(config); - - config.headers = AxiosHeaders.from(config.headers); - - // Transform request data - config.data = transformData.call(config, config.transformRequest); - - if (['post', 'put', 'patch'].indexOf(config.method) !== -1) { - config.headers.setContentType('application/x-www-form-urlencoded', false); - } - - const adapter = adapters.getAdapter(config.adapter || defaults.adapter, config); - - return adapter(config).then( - function onAdapterResolution(response) { - throwIfCancellationRequested(config); - - // Expose the current response on config so that transformResponse can - // attach it to any AxiosError it throws (e.g. on JSON parse failure). - // We clean it up afterwards to avoid polluting the config object. - config.response = response; - try { - response.data = transformData.call(config, config.transformResponse, response); - } finally { - delete config.response; - } - - response.headers = AxiosHeaders.from(response.headers); - - return response; - }, - function onAdapterRejection(reason) { - if (!isCancel(reason)) { - throwIfCancellationRequested(config); - - // Transform response data - if (reason && reason.response) { - config.response = reason.response; - try { - reason.response.data = transformData.call( - config, - config.transformResponse, - reason.response - ); - } finally { - delete config.response; - } - reason.response.headers = AxiosHeaders.from(reason.response.headers); - } - } - - return Promise.reject(reason); - } - ); -} diff --git a/server/node_modules/axios/lib/core/mergeConfig.js b/server/node_modules/axios/lib/core/mergeConfig.js deleted file mode 100644 index e164e03..0000000 --- a/server/node_modules/axios/lib/core/mergeConfig.js +++ /dev/null @@ -1,174 +0,0 @@ -'use strict'; - -import utils from '../utils.js'; -import AxiosHeaders from './AxiosHeaders.js'; - -const headersToObject = (thing) => (thing instanceof AxiosHeaders ? { ...thing } : thing); - -const ownEnumerableKeys = (thing) => { - if (Object.getOwnPropertySymbols && Object.getOwnPropertyDescriptor) { - return Object.keys(thing).concat( - Object.getOwnPropertySymbols(thing).filter( - (symbol) => Object.getOwnPropertyDescriptor(thing, symbol).enumerable - ) - ); - } - return Object.keys(thing); -}; - -/** - * Config-specific merge-function which creates a new config-object - * by merging two configuration objects together. - * - * @param {Object} config1 - * @param {Object} config2 - * - * @returns {Object} New object resulting from merging config2 to config1 - */ -export default function mergeConfig(config1, config2) { - // eslint-disable-next-line no-param-reassign - config1 = config1 || {}; - config2 = config2 || {}; - - // Use a null-prototype object so that downstream reads such as `config.auth` - // or `config.baseURL` cannot inherit polluted values from Object.prototype. - // `hasOwnProperty` is restored as a non-enumerable own slot to preserve - // ergonomics for user code that relies on it. - const config = Object.create(null); - Object.defineProperty(config, 'hasOwnProperty', { - // Null-proto descriptor so a polluted Object.prototype.get cannot turn - // this data descriptor into an accessor descriptor on the way in. - __proto__: null, - value: Object.prototype.hasOwnProperty, - enumerable: false, - writable: true, - configurable: true, - }); - - function getMergedValue(target, source, prop, caseless) { - if (utils.isPlainObject(target) && utils.isPlainObject(source)) { - return utils.merge.call({ caseless }, target, source); - } else if (utils.isPlainObject(source)) { - return utils.merge({}, source); - } else if (utils.isArray(source)) { - return source.slice(); - } - return source; - } - - function mergeDeepProperties(a, b, prop, caseless) { - if (!utils.isUndefined(b)) { - return getMergedValue(a, b, prop, caseless); - } else if (!utils.isUndefined(a)) { - return getMergedValue(undefined, a, prop, caseless); - } - } - - // eslint-disable-next-line consistent-return - function valueFromConfig2(a, b) { - if (!utils.isUndefined(b)) { - return getMergedValue(undefined, b); - } - } - - // eslint-disable-next-line consistent-return - function defaultToConfig2(a, b) { - if (!utils.isUndefined(b)) { - return getMergedValue(undefined, b); - } else if (!utils.isUndefined(a)) { - return getMergedValue(undefined, a); - } - } - - function getMergedTransitionalOption(prop) { - const transitional2 = utils.hasOwnProp(config2, 'transitional') - ? config2.transitional - : undefined; - - if (!utils.isUndefined(transitional2)) { - if (utils.isPlainObject(transitional2)) { - if (utils.hasOwnProp(transitional2, prop)) { - return transitional2[prop]; - } - } else { - return undefined; - } - } - - const transitional1 = utils.hasOwnProp(config1, 'transitional') - ? config1.transitional - : undefined; - - if (utils.isPlainObject(transitional1) && utils.hasOwnProp(transitional1, prop)) { - return transitional1[prop]; - } - - return undefined; - } - - // eslint-disable-next-line consistent-return - function mergeDirectKeys(a, b, prop) { - if (utils.hasOwnProp(config2, prop)) { - return getMergedValue(a, b); - } else if (utils.hasOwnProp(config1, prop)) { - return getMergedValue(undefined, a); - } - } - - const mergeMap = { - url: valueFromConfig2, - method: valueFromConfig2, - data: valueFromConfig2, - baseURL: defaultToConfig2, - transformRequest: defaultToConfig2, - transformResponse: defaultToConfig2, - paramsSerializer: defaultToConfig2, - timeout: defaultToConfig2, - timeoutMessage: defaultToConfig2, - withCredentials: defaultToConfig2, - withXSRFToken: defaultToConfig2, - adapter: defaultToConfig2, - responseType: defaultToConfig2, - xsrfCookieName: defaultToConfig2, - xsrfHeaderName: defaultToConfig2, - onUploadProgress: defaultToConfig2, - onDownloadProgress: defaultToConfig2, - decompress: defaultToConfig2, - maxContentLength: defaultToConfig2, - maxBodyLength: defaultToConfig2, - beforeRedirect: defaultToConfig2, - transport: defaultToConfig2, - httpAgent: defaultToConfig2, - httpsAgent: defaultToConfig2, - cancelToken: defaultToConfig2, - socketPath: defaultToConfig2, - allowedSocketPaths: defaultToConfig2, - responseEncoding: defaultToConfig2, - validateStatus: mergeDirectKeys, - headers: (a, b, prop) => - mergeDeepProperties(headersToObject(a), headersToObject(b), prop, true), - }; - - utils.forEach(ownEnumerableKeys({ ...config1, ...config2 }), function computeConfigValue(prop) { - if (prop === '__proto__' || prop === 'constructor' || prop === 'prototype') return; - const merge = utils.hasOwnProp(mergeMap, prop) ? mergeMap[prop] : mergeDeepProperties; - const a = utils.hasOwnProp(config1, prop) ? config1[prop] : undefined; - const b = utils.hasOwnProp(config2, prop) ? config2[prop] : undefined; - const configValue = merge(a, b, prop); - (utils.isUndefined(configValue) && merge !== mergeDirectKeys) || (config[prop] = configValue); - }); - - if ( - utils.hasOwnProp(config2, 'validateStatus') && - utils.isUndefined(config2.validateStatus) && - getMergedTransitionalOption('validateStatusUndefinedResolves') === false - ) { - if (utils.hasOwnProp(config1, 'validateStatus')) { - config.validateStatus = getMergedValue(undefined, config1.validateStatus); - } else { - delete config.validateStatus; - } - } - - return config; -} diff --git a/server/node_modules/axios/lib/core/setFormDataHeaders.js b/server/node_modules/axios/lib/core/setFormDataHeaders.js deleted file mode 100644 index 45e5dd6..0000000 --- a/server/node_modules/axios/lib/core/setFormDataHeaders.js +++ /dev/null @@ -1,27 +0,0 @@ -'use strict'; - -const FORM_DATA_CONTENT_HEADERS = ['content-type', 'content-length']; - -/** - * Apply the headers generated by a FormData implementation to the request headers, - * honoring the `formDataHeaderPolicy` option: with 'content-only', copy only the - * content-* headers; otherwise merge all of them. - * - * @param {AxiosHeaders} headers - the request headers to mutate - * @param {Object | null | undefined} formHeaders - headers produced by the FormData implementation - * @param {String} [policy] - the resolved `formDataHeaderPolicy` config value - * - * @returns {void} - */ -export default function setFormDataHeaders(headers, formHeaders, policy) { - if (policy !== 'content-only') { - headers.set(formHeaders); - return; - } - - Object.entries(formHeaders || {}).forEach(([key, val]) => { - if (FORM_DATA_CONTENT_HEADERS.includes(key.toLowerCase())) { - headers.set(key, val); - } - }); -} diff --git a/server/node_modules/axios/lib/core/settle.js b/server/node_modules/axios/lib/core/settle.js deleted file mode 100644 index 782f571..0000000 --- a/server/node_modules/axios/lib/core/settle.js +++ /dev/null @@ -1,27 +0,0 @@ -'use strict'; - -import AxiosError from './AxiosError.js'; - -/** - * Resolve or reject a Promise based on response status. - * - * @param {Function} resolve A function that resolves the promise. - * @param {Function} reject A function that rejects the promise. - * @param {object} response The response. - * - * @returns {object} The response. - */ -export default function settle(resolve, reject, response) { - const validateStatus = response.config.validateStatus; - if (!response.status || !validateStatus || validateStatus(response.status)) { - resolve(response); - } else { - reject(new AxiosError( - 'Request failed with status code ' + response.status, - response.status >= 400 && response.status < 500 ? AxiosError.ERR_BAD_REQUEST : AxiosError.ERR_BAD_RESPONSE, - response.config, - response.request, - response - )); - } -} diff --git a/server/node_modules/axios/lib/core/transformData.js b/server/node_modules/axios/lib/core/transformData.js deleted file mode 100644 index f22c474..0000000 --- a/server/node_modules/axios/lib/core/transformData.js +++ /dev/null @@ -1,28 +0,0 @@ -'use strict'; - -import utils from '../utils.js'; -import defaults from '../defaults/index.js'; -import AxiosHeaders from '../core/AxiosHeaders.js'; - -/** - * Transform the data for a request or a response - * - * @param {Array|Function} fns A single function or Array of functions - * @param {?Object} response The response object - * - * @returns {*} The resulting transformed data - */ -export default function transformData(fns, response) { - const config = this || defaults; - const context = response || config; - const headers = AxiosHeaders.from(context.headers); - let data = context.data; - - utils.forEach(fns, function transform(fn) { - data = fn.call(config, data, headers.normalize(), response ? response.status : undefined); - }); - - headers.normalize(); - - return data; -} diff --git a/server/node_modules/axios/lib/defaults/index.js b/server/node_modules/axios/lib/defaults/index.js deleted file mode 100644 index 642a089..0000000 --- a/server/node_modules/axios/lib/defaults/index.js +++ /dev/null @@ -1,177 +0,0 @@ -'use strict'; - -import utils from '../utils.js'; -import AxiosError from '../core/AxiosError.js'; -import transitionalDefaults from './transitional.js'; -import toFormData from '../helpers/toFormData.js'; -import toURLEncodedForm from '../helpers/toURLEncodedForm.js'; -import platform from '../platform/index.js'; -import formDataToJSON from '../helpers/formDataToJSON.js'; - -const own = (obj, key) => (obj != null && utils.hasOwnProp(obj, key) ? obj[key] : undefined); - -/** - * It takes a string, tries to parse it, and if it fails, it returns the stringified version - * of the input - * - * @param {any} rawValue - The value to be stringified. - * @param {Function} parser - A function that parses a string into a JavaScript object. - * @param {Function} encoder - A function that takes a value and returns a string. - * - * @returns {string} A stringified version of the rawValue. - */ -function stringifySafely(rawValue, parser, encoder) { - if (utils.isString(rawValue)) { - try { - (parser || JSON.parse)(rawValue); - return utils.trim(rawValue); - } catch (e) { - if (e.name !== 'SyntaxError') { - throw e; - } - } - } - - return (encoder || JSON.stringify)(rawValue); -} - -const defaults = { - transitional: transitionalDefaults, - - adapter: ['xhr', 'http', 'fetch'], - - transformRequest: [ - function transformRequest(data, headers) { - const contentType = headers.getContentType() || ''; - const hasJSONContentType = contentType.indexOf('application/json') > -1; - const isObjectPayload = utils.isObject(data); - - if (isObjectPayload && utils.isHTMLForm(data)) { - data = new FormData(data); - } - - const isFormData = utils.isFormData(data); - - if (isFormData) { - return hasJSONContentType ? JSON.stringify(formDataToJSON(data)) : data; - } - - if ( - utils.isArrayBuffer(data) || - utils.isBuffer(data) || - utils.isStream(data) || - utils.isFile(data) || - utils.isBlob(data) || - utils.isReadableStream(data) - ) { - return data; - } - if (utils.isArrayBufferView(data)) { - return data.buffer; - } - if (utils.isURLSearchParams(data)) { - headers.setContentType('application/x-www-form-urlencoded;charset=utf-8', false); - return data.toString(); - } - - let isFileList; - - if (isObjectPayload) { - const formSerializer = own(this, 'formSerializer'); - if (contentType.indexOf('application/x-www-form-urlencoded') > -1) { - return toURLEncodedForm(data, formSerializer).toString(); - } - - if ( - (isFileList = utils.isFileList(data)) || - contentType.indexOf('multipart/form-data') > -1 - ) { - const env = own(this, 'env'); - const _FormData = env && env.FormData; - - return toFormData( - isFileList ? { 'files[]': data } : data, - _FormData && new _FormData(), - formSerializer - ); - } - } - - if (isObjectPayload || hasJSONContentType) { - headers.setContentType('application/json', false); - return stringifySafely(data); - } - - return data; - }, - ], - - transformResponse: [ - function transformResponse(data) { - const transitional = own(this, 'transitional') || defaults.transitional; - const forcedJSONParsing = transitional && transitional.forcedJSONParsing; - const responseType = own(this, 'responseType'); - const JSONRequested = responseType === 'json'; - - if (utils.isResponse(data) || utils.isReadableStream(data)) { - return data; - } - - if ( - data && - utils.isString(data) && - ((forcedJSONParsing && !responseType) || JSONRequested) - ) { - const silentJSONParsing = transitional && transitional.silentJSONParsing; - const strictJSONParsing = !silentJSONParsing && JSONRequested; - - try { - return JSON.parse(data, own(this, 'parseReviver')); - } catch (e) { - if (strictJSONParsing) { - if (e.name === 'SyntaxError') { - throw AxiosError.from(e, AxiosError.ERR_BAD_RESPONSE, this, null, own(this, 'response')); - } - throw e; - } - } - } - - return data; - }, - ], - - /** - * A timeout in milliseconds to abort a request. If set to 0 (default) a - * timeout is not created. - */ - timeout: 0, - - xsrfCookieName: 'XSRF-TOKEN', - xsrfHeaderName: 'X-XSRF-TOKEN', - - maxContentLength: -1, - maxBodyLength: -1, - - env: { - FormData: platform.classes.FormData, - Blob: platform.classes.Blob, - }, - - validateStatus: function validateStatus(status) { - return status >= 200 && status < 300; - }, - - headers: { - common: { - Accept: 'application/json, text/plain, */*', - 'Content-Type': undefined, - }, - }, -}; - -utils.forEach(['delete', 'get', 'head', 'post', 'put', 'patch', 'query'], (method) => { - defaults.headers[method] = {}; -}); - -export default defaults; diff --git a/server/node_modules/axios/lib/defaults/transitional.js b/server/node_modules/axios/lib/defaults/transitional.js deleted file mode 100644 index e64a6a9..0000000 --- a/server/node_modules/axios/lib/defaults/transitional.js +++ /dev/null @@ -1,10 +0,0 @@ -'use strict'; - -export default { - silentJSONParsing: true, - forcedJSONParsing: true, - clarifyTimeoutError: false, - legacyInterceptorReqResOrdering: true, - advertiseZstdAcceptEncoding: false, - validateStatusUndefinedResolves: true, -}; diff --git a/server/node_modules/axios/lib/env/README.md b/server/node_modules/axios/lib/env/README.md deleted file mode 100644 index b41baff..0000000 --- a/server/node_modules/axios/lib/env/README.md +++ /dev/null @@ -1,3 +0,0 @@ -# axios // env - -The `data.js` file is updated automatically when the package version is upgrading. Please do not edit it manually. diff --git a/server/node_modules/axios/lib/env/classes/FormData.js b/server/node_modules/axios/lib/env/classes/FormData.js deleted file mode 100644 index 862adb9..0000000 --- a/server/node_modules/axios/lib/env/classes/FormData.js +++ /dev/null @@ -1,2 +0,0 @@ -import _FormData from 'form-data'; -export default typeof FormData !== 'undefined' ? FormData : _FormData; diff --git a/server/node_modules/axios/lib/env/data.js b/server/node_modules/axios/lib/env/data.js deleted file mode 100644 index 9c54422..0000000 --- a/server/node_modules/axios/lib/env/data.js +++ /dev/null @@ -1 +0,0 @@ -export const VERSION = "1.19.0"; \ No newline at end of file diff --git a/server/node_modules/axios/lib/helpers/AxiosTransformStream.js b/server/node_modules/axios/lib/helpers/AxiosTransformStream.js deleted file mode 100644 index 96e8acb..0000000 --- a/server/node_modules/axios/lib/helpers/AxiosTransformStream.js +++ /dev/null @@ -1,156 +0,0 @@ -'use strict'; - -import stream from 'stream'; -import utils from '../utils.js'; - -const kInternals = Symbol('internals'); - -class AxiosTransformStream extends stream.Transform { - constructor(options) { - options = utils.toFlatObject( - options, - { - maxRate: 0, - chunkSize: 64 * 1024, - minChunkSize: 100, - timeWindow: 500, - ticksRate: 2, - samplesCount: 15, - }, - null, - (prop, source) => { - return !utils.isUndefined(source[prop]); - } - ); - - super({ - readableHighWaterMark: options.chunkSize, - }); - - const internals = (this[kInternals] = { - timeWindow: options.timeWindow, - chunkSize: options.chunkSize, - maxRate: options.maxRate, - minChunkSize: options.minChunkSize, - bytesSeen: 0, - isCaptured: false, - notifiedBytesLoaded: 0, - ts: Date.now(), - bytes: 0, - onReadCallback: null, - }); - - this.on('newListener', (event) => { - if (event === 'progress') { - if (!internals.isCaptured) { - internals.isCaptured = true; - } - } - }); - } - - _read(size) { - const internals = this[kInternals]; - - if (internals.onReadCallback) { - internals.onReadCallback(); - } - - return super._read(size); - } - - _transform(chunk, encoding, callback) { - const internals = this[kInternals]; - const maxRate = internals.maxRate; - - const readableHighWaterMark = this.readableHighWaterMark; - - const timeWindow = internals.timeWindow; - - const divider = 1000 / timeWindow; - const bytesThreshold = maxRate / divider; - const minChunkSize = - internals.minChunkSize !== false - ? Math.max(internals.minChunkSize, bytesThreshold * 0.01) - : 0; - - const pushChunk = (_chunk, _callback) => { - const bytes = Buffer.byteLength(_chunk); - internals.bytesSeen += bytes; - internals.bytes += bytes; - - internals.isCaptured && this.emit('progress', internals.bytesSeen); - - if (this.push(_chunk)) { - process.nextTick(_callback); - } else { - internals.onReadCallback = () => { - internals.onReadCallback = null; - process.nextTick(_callback); - }; - } - }; - - const transformChunk = (_chunk, _callback) => { - const chunkSize = Buffer.byteLength(_chunk); - let chunkRemainder = null; - let maxChunkSize = readableHighWaterMark; - let bytesLeft; - let passed = 0; - - if (maxRate) { - const now = Date.now(); - - if (!internals.ts || (passed = now - internals.ts) >= timeWindow) { - internals.ts = now; - bytesLeft = bytesThreshold - internals.bytes; - internals.bytes = bytesLeft < 0 ? -bytesLeft : 0; - passed = 0; - } - - bytesLeft = bytesThreshold - internals.bytes; - } - - if (maxRate) { - if (bytesLeft <= 0) { - // next time window - return setTimeout(() => { - _callback(null, _chunk); - }, timeWindow - passed); - } - - if (bytesLeft < maxChunkSize) { - maxChunkSize = bytesLeft; - } - } - - if (maxChunkSize && chunkSize > maxChunkSize && chunkSize - maxChunkSize > minChunkSize) { - chunkRemainder = _chunk.subarray(maxChunkSize); - _chunk = _chunk.subarray(0, maxChunkSize); - } - - pushChunk( - _chunk, - chunkRemainder - ? () => { - process.nextTick(_callback, null, chunkRemainder); - } - : _callback - ); - }; - - transformChunk(chunk, function transformNextChunk(err, _chunk) { - if (err) { - return callback(err); - } - - if (_chunk) { - transformChunk(_chunk, transformNextChunk); - } else { - callback(null); - } - }); - } -} - -export default AxiosTransformStream; diff --git a/server/node_modules/axios/lib/helpers/AxiosURLSearchParams.js b/server/node_modules/axios/lib/helpers/AxiosURLSearchParams.js deleted file mode 100644 index b77b680..0000000 --- a/server/node_modules/axios/lib/helpers/AxiosURLSearchParams.js +++ /dev/null @@ -1,59 +0,0 @@ -'use strict'; - -import toFormData from './toFormData.js'; - -/** - * It encodes a string by replacing all characters that are not in the unreserved set with - * their percent-encoded equivalents - * - * @param {string} str - The string to encode. - * - * @returns {string} The encoded string. - */ -function encode(str) { - const charMap = { - '!': '%21', - "'": '%27', - '(': '%28', - ')': '%29', - '~': '%7E', - '%20': '+', - }; - return encodeURIComponent(str).replace(/[!'()~]|%20/g, function replacer(match) { - return charMap[match]; - }); -} - -/** - * It takes a params object and converts it to a FormData object - * - * @param {Object} params - The parameters to be converted to a FormData object. - * @param {Object} options - The options object passed to the Axios constructor. - * - * @returns {void} - */ -function AxiosURLSearchParams(params, options) { - this._pairs = []; - - params && toFormData(params, this, options); -} - -const prototype = AxiosURLSearchParams.prototype; - -prototype.append = function append(name, value) { - this._pairs.push([name, value]); -}; - -prototype.toString = function toString(encoder) { - const _encode = encoder - ? (value) => encoder.call(this, value, encode) - : encode; - - return this._pairs - .map(function each(pair) { - return _encode(pair[0]) + '=' + _encode(pair[1]); - }, '') - .join('&'); -}; - -export default AxiosURLSearchParams; diff --git a/server/node_modules/axios/lib/helpers/Http2Sessions.js b/server/node_modules/axios/lib/helpers/Http2Sessions.js deleted file mode 100644 index b3cf924..0000000 --- a/server/node_modules/axios/lib/helpers/Http2Sessions.js +++ /dev/null @@ -1,119 +0,0 @@ -'use strict'; - -// Node-only: relies on the built-in `http2` module. Browser/react-native -// builds replace `lib/adapters/http.js` (the sole importer) with `lib/helpers/null.js` -// via the `browser` package.json field, so this module is never reached in -// those environments. Do not import it from any browser-reachable code path. - -import http2 from 'http2'; -import util from 'util'; - -class Http2Sessions { - constructor() { - this.sessions = Object.create(null); - } - - getSession(authority, options) { - options = Object.assign( - { - sessionTimeout: 1000, - }, - options - ); - - let authoritySessions = this.sessions[authority]; - - if (authoritySessions) { - let len = authoritySessions.length; - - for (let i = 0; i < len; i++) { - const [sessionHandle, sessionOptions] = authoritySessions[i]; - if ( - !sessionHandle.destroyed && - !sessionHandle.closed && - util.isDeepStrictEqual(sessionOptions, options) - ) { - return sessionHandle; - } - } - } - - const session = http2.connect(authority, options); - - let removed; - let timer; - - const removeSession = () => { - if (removed) { - return; - } - - removed = true; - - if (timer) { - clearTimeout(timer); - timer = null; - } - - let entries = authoritySessions, - len = entries.length, - i = len; - - while (i--) { - if (entries[i][0] === session) { - if (len === 1) { - delete this.sessions[authority]; - } else { - entries.splice(i, 1); - } - if (!session.closed) { - session.close(); - } - return; - } - } - }; - - const originalRequestFn = session.request; - - const { sessionTimeout } = options; - - if (sessionTimeout != null) { - let streamsCount = 0; - - session.request = function () { - const stream = originalRequestFn.apply(this, arguments); - - streamsCount++; - - if (timer) { - clearTimeout(timer); - timer = null; - } - - stream.once('close', () => { - if (!--streamsCount) { - timer = setTimeout(() => { - timer = null; - removeSession(); - }, sessionTimeout); - } - }); - - return stream; - }; - } - - session.once('close', removeSession); - - let entry = [session, options]; - - authoritySessions - ? authoritySessions.push(entry) - : (authoritySessions = this.sessions[authority] = [entry]); - - return session; - } -} - -export default Http2Sessions; diff --git a/server/node_modules/axios/lib/helpers/HttpStatusCode.js b/server/node_modules/axios/lib/helpers/HttpStatusCode.js deleted file mode 100644 index 0181d93..0000000 --- a/server/node_modules/axios/lib/helpers/HttpStatusCode.js +++ /dev/null @@ -1,78 +0,0 @@ -const HttpStatusCode = { - Continue: 100, - SwitchingProtocols: 101, - Processing: 102, - EarlyHints: 103, - Ok: 200, - Created: 201, - Accepted: 202, - NonAuthoritativeInformation: 203, - NoContent: 204, - ResetContent: 205, - PartialContent: 206, - MultiStatus: 207, - AlreadyReported: 208, - ImUsed: 226, - MultipleChoices: 300, - MovedPermanently: 301, - Found: 302, - SeeOther: 303, - NotModified: 304, - UseProxy: 305, - Unused: 306, - TemporaryRedirect: 307, - PermanentRedirect: 308, - BadRequest: 400, - Unauthorized: 401, - PaymentRequired: 402, - Forbidden: 403, - NotFound: 404, - MethodNotAllowed: 405, - NotAcceptable: 406, - ProxyAuthenticationRequired: 407, - RequestTimeout: 408, - Conflict: 409, - Gone: 410, - LengthRequired: 411, - PreconditionFailed: 412, - PayloadTooLarge: 413, - UriTooLong: 414, - UnsupportedMediaType: 415, - RangeNotSatisfiable: 416, - ExpectationFailed: 417, - ImATeapot: 418, - MisdirectedRequest: 421, - UnprocessableEntity: 422, - Locked: 423, - FailedDependency: 424, - TooEarly: 425, - UpgradeRequired: 426, - PreconditionRequired: 428, - TooManyRequests: 429, - RequestHeaderFieldsTooLarge: 431, - UnavailableForLegalReasons: 451, - InternalServerError: 500, - NotImplemented: 501, - BadGateway: 502, - ServiceUnavailable: 503, - GatewayTimeout: 504, - HttpVersionNotSupported: 505, - VariantAlsoNegotiates: 506, - InsufficientStorage: 507, - LoopDetected: 508, - NotExtended: 510, - NetworkAuthenticationRequired: 511, - WebServerReturnsAnUnknownError: 520, - WebServerIsDown: 521, - ConnectionTimedOut: 522, - OriginIsUnreachable: 523, - TimeoutOccurred: 524, - SslHandshakeFailed: 525, - InvalidSslCertificate: 526, -}; - -Object.entries(HttpStatusCode).forEach(([key, value]) => { - HttpStatusCode[value] = key; -}); - -export default HttpStatusCode; diff --git a/server/node_modules/axios/lib/helpers/README.md b/server/node_modules/axios/lib/helpers/README.md deleted file mode 100644 index 4ae3419..0000000 --- a/server/node_modules/axios/lib/helpers/README.md +++ /dev/null @@ -1,7 +0,0 @@ -# axios // helpers - -The modules found in `helpers/` should be generic modules that are _not_ specific to the domain logic of axios. These modules could theoretically be published to npm on their own and consumed by other modules or apps. Some examples of generic modules are things like: - -- Browser polyfills -- Managing cookies -- Parsing HTTP headers diff --git a/server/node_modules/axios/lib/helpers/ZlibHeaderTransformStream.js b/server/node_modules/axios/lib/helpers/ZlibHeaderTransformStream.js deleted file mode 100644 index c588ded..0000000 --- a/server/node_modules/axios/lib/helpers/ZlibHeaderTransformStream.js +++ /dev/null @@ -1,29 +0,0 @@ -'use strict'; - -import stream from 'stream'; - -class ZlibHeaderTransformStream extends stream.Transform { - __transform(chunk, encoding, callback) { - this.push(chunk); - callback(); - } - - _transform(chunk, encoding, callback) { - if (chunk.length !== 0) { - this._transform = this.__transform; - - // Add Default Compression headers if no zlib headers are present - if (chunk[0] !== 120) { - // Hex: 78 - const header = Buffer.alloc(2); - header[0] = 120; // Hex: 78 - header[1] = 156; // Hex: 9C - this.push(header, encoding); - } - } - - this.__transform(chunk, encoding, callback); - } -} - -export default ZlibHeaderTransformStream; diff --git a/server/node_modules/axios/lib/helpers/bind.js b/server/node_modules/axios/lib/helpers/bind.js deleted file mode 100644 index 938da5c..0000000 --- a/server/node_modules/axios/lib/helpers/bind.js +++ /dev/null @@ -1,14 +0,0 @@ -'use strict'; - -/** - * Create a bound version of a function with a specified `this` context - * - * @param {Function} fn - The function to bind - * @param {*} thisArg - The value to be passed as the `this` parameter - * @returns {Function} A new function that will call the original function with the specified `this` context - */ -export default function bind(fn, thisArg) { - return function wrap() { - return fn.apply(thisArg, arguments); - }; -} diff --git a/server/node_modules/axios/lib/helpers/buildURL.js b/server/node_modules/axios/lib/helpers/buildURL.js deleted file mode 100644 index ba4f5f5..0000000 --- a/server/node_modules/axios/lib/helpers/buildURL.js +++ /dev/null @@ -1,69 +0,0 @@ -'use strict'; - -import utils from '../utils.js'; -import AxiosURLSearchParams from './AxiosURLSearchParams.js'; - -/** - * It replaces URL-encoded forms of `:`, `$`, `,`, and spaces with - * their plain counterparts (`:`, `$`, `,`, `+`). - * - * @param {string} val The value to be encoded. - * - * @returns {string} The encoded value. - */ -export function encode(val) { - return encodeURIComponent(val) - .replace(/%3A/gi, ':') - .replace(/%24/g, '$') - .replace(/%2C/gi, ',') - .replace(/%20/g, '+'); -} - -/** - * Build a URL by appending params to the end - * - * @param {string} url The base of the url (e.g., http://www.google.com) - * @param {object} [params] The params to be appended - * @param {?(object|Function)} options - * - * @returns {string} The formatted url - */ -export default function buildURL(url, params, options) { - if (!params) { - return url; - } - url = url || ''; - - const _options = utils.isFunction(options) - ? { - serialize: options, - } - : options; - - // Read serializer options pollution-safely: own properties and methods on a - // class/template prototype are honored, but values injected onto a polluted - // Object.prototype are ignored. - const _encode = utils.getSafeProp(_options, 'encode') || encode; - const serializeFn = utils.getSafeProp(_options, 'serialize'); - - let serializedParams; - - if (serializeFn) { - serializedParams = serializeFn(params, _options); - } else { - serializedParams = utils.isURLSearchParams(params) - ? params.toString() - : new AxiosURLSearchParams(params, _options).toString(_encode); - } - - if (serializedParams) { - const hashmarkIndex = url.indexOf('#'); - - if (hashmarkIndex !== -1) { - url = url.slice(0, hashmarkIndex); - } - url += (url.indexOf('?') === -1 ? '?' : '&') + serializedParams; - } - - return url; -} diff --git a/server/node_modules/axios/lib/helpers/callbackify.js b/server/node_modules/axios/lib/helpers/callbackify.js deleted file mode 100644 index e8cea68..0000000 --- a/server/node_modules/axios/lib/helpers/callbackify.js +++ /dev/null @@ -1,18 +0,0 @@ -import utils from '../utils.js'; - -const callbackify = (fn, reducer) => { - return utils.isAsyncFn(fn) - ? function (...args) { - const cb = args.pop(); - fn.apply(this, args).then((value) => { - try { - reducer ? cb(null, ...reducer(value)) : cb(null, value); - } catch (err) { - cb(err); - } - }, cb); - } - : fn; -}; - -export default callbackify; diff --git a/server/node_modules/axios/lib/helpers/combineURLs.js b/server/node_modules/axios/lib/helpers/combineURLs.js deleted file mode 100644 index 8863435..0000000 --- a/server/node_modules/axios/lib/helpers/combineURLs.js +++ /dev/null @@ -1,23 +0,0 @@ -'use strict'; - -/** - * Creates a new URL by combining the specified URLs - * - * @param {string} baseURL The base URL - * @param {string} relativeURL The relative URL - * - * @returns {string} The combined URL - */ -export default function combineURLs(baseURL, relativeURL) { - if (!relativeURL) { - return baseURL; - } - - let end = baseURL.length; - - while (end > 0 && baseURL.charCodeAt(end - 1) === 47) { - end--; - } - - return baseURL.slice(0, end) + '/' + relativeURL.replace(/^\/+/, ''); -} diff --git a/server/node_modules/axios/lib/helpers/composeSignals.js b/server/node_modules/axios/lib/helpers/composeSignals.js deleted file mode 100644 index 5385049..0000000 --- a/server/node_modules/axios/lib/helpers/composeSignals.js +++ /dev/null @@ -1,68 +0,0 @@ -import CanceledError from '../cancel/CanceledError.js'; -import AxiosError from '../core/AxiosError.js'; -import utils from '../utils.js'; - -const composeSignals = (signals, timeout) => { - signals = signals ? signals.filter(Boolean) : []; - - if (!timeout && !signals.length) { - return; - } - - const controller = new AbortController(); - - let aborted = false; - - const onabort = function (reason) { - if (!aborted) { - aborted = true; - unsubscribe(); - const err = reason instanceof Error ? reason : this.reason; - controller.abort( - err instanceof AxiosError - ? err - : new CanceledError(err instanceof Error ? err.message : err) - ); - } - }; - - let timer = - timeout && - setTimeout(() => { - timer = null; - onabort(new AxiosError(`timeout of ${timeout}ms exceeded`, AxiosError.ETIMEDOUT)); - }, timeout); - - const unsubscribe = () => { - if (!signals) { return; } - timer && clearTimeout(timer); - timer = null; - signals.forEach((signal) => { - signal.unsubscribe - ? signal.unsubscribe(onabort) - : signal.removeEventListener('abort', onabort); - }); - signals = null; - }; - - signals.forEach((signal) => { - if (aborted) { - return; - } - - if (signal.aborted) { - onabort.call(signal); - return; - } - - signal.addEventListener('abort', onabort, { once: true }); - }); - - const { signal } = controller; - - signal.unsubscribe = () => utils.asap(unsubscribe); - - return signal; -}; - -export default composeSignals; diff --git a/server/node_modules/axios/lib/helpers/cookies.js b/server/node_modules/axios/lib/helpers/cookies.js deleted file mode 100644 index c197875..0000000 --- a/server/node_modules/axios/lib/helpers/cookies.js +++ /dev/null @@ -1,64 +0,0 @@ -import utils from '../utils.js'; -import platform from '../platform/index.js'; - -export default platform.hasStandardBrowserEnv - ? // Standard browser envs support document.cookie - { - write(name, value, expires, path, domain, secure, sameSite) { - if (typeof document === 'undefined') return; - - const cookie = [`${name}=${encodeURIComponent(value)}`]; - - if (utils.isNumber(expires)) { - cookie.push(`expires=${new Date(expires).toUTCString()}`); - } - if (utils.isString(path)) { - cookie.push(`path=${path}`); - } - if (utils.isString(domain)) { - cookie.push(`domain=${domain}`); - } - if (secure === true) { - cookie.push('secure'); - } - if (utils.isString(sameSite)) { - cookie.push(`SameSite=${sameSite}`); - } - - document.cookie = cookie.join('; '); - }, - - read(name) { - if (typeof document === 'undefined') return null; - // Match name=value by splitting on the semicolon separator instead of building a - // RegExp from `name` — interpolating an unescaped string into a RegExp would let - // metacharacters (e.g. `.+?` in an attacker-influenced cookie name) cause ReDoS or - // match the wrong cookie. Browsers may serialize cookie pairs as either ";" or - // "; ", so ignore optional whitespace before each cookie name. - const cookies = document.cookie.split(';'); - for (let i = 0; i < cookies.length; i++) { - const cookie = cookies[i].replace(/^\s+/, ''); - const eq = cookie.indexOf('='); - if (eq !== -1 && cookie.slice(0, eq) === name) { - try { - return decodeURIComponent(cookie.slice(eq + 1)); - } catch (e) { - return cookie.slice(eq + 1); - } - } - } - return null; - }, - - remove(name) { - this.write(name, '', Date.now() - 86400000, '/'); - }, - } - : // Non-standard browser env (web workers, react-native) lack needed support. - { - write() {}, - read() { - return null; - }, - remove() {}, - }; diff --git a/server/node_modules/axios/lib/helpers/deprecatedMethod.js b/server/node_modules/axios/lib/helpers/deprecatedMethod.js deleted file mode 100644 index ec112de..0000000 --- a/server/node_modules/axios/lib/helpers/deprecatedMethod.js +++ /dev/null @@ -1,31 +0,0 @@ -'use strict'; - -/*eslint no-console:0*/ - -/** - * Supply a warning to the developer that a method they are using - * has been deprecated. - * - * @param {string} method The name of the deprecated method - * @param {string} [instead] The alternate method to use if applicable - * @param {string} [docs] The documentation URL to get further details - * - * @returns {void} - */ -export default function deprecatedMethod(method, instead, docs) { - try { - console.warn( - 'DEPRECATED method `' + - method + - '`.' + - (instead ? ' Use `' + instead + '` instead.' : '') + - ' This method will be removed in a future release.' - ); - - if (docs) { - console.warn('For more information about usage see ' + docs); - } - } catch (e) { - /* Ignore */ - } -} diff --git a/server/node_modules/axios/lib/helpers/estimateDataURLDecodedBytes.js b/server/node_modules/axios/lib/helpers/estimateDataURLDecodedBytes.js deleted file mode 100644 index 35528fe..0000000 --- a/server/node_modules/axios/lib/helpers/estimateDataURLDecodedBytes.js +++ /dev/null @@ -1,166 +0,0 @@ -/** - * Estimate data: URL byte lengths *without* allocating large buffers. - * - Fetch percent-decodes a base64 body before decoding it. - * - Node's Buffer.from(body, 'base64') sizes its backing allocation from the - * raw body, including ignored characters and content after padding. - * - Non-base64 data is percent-decoded and then encoded as UTF-8. - */ -const isHexDigit = (charCode) => - (charCode >= 48 && charCode <= 57) || - (charCode >= 65 && charCode <= 70) || - (charCode >= 97 && charCode <= 102); - -const isPercentEncodedByte = (str, i, len) => - i + 2 < len && isHexDigit(str.charCodeAt(i + 1)) && isHexDigit(str.charCodeAt(i + 2)); - -const hexValue = (charCode) => (charCode <= 57 ? charCode - 48 : (charCode & 0xdf) - 55); - -const isBase64Char = (charCode) => - (charCode >= 65 && charCode <= 90) || // A-Z - (charCode >= 97 && charCode <= 122) || // a-z - (charCode >= 48 && charCode <= 57) || // 0-9 - charCode === 43 || // + - charCode === 47 || // / - charCode === 45 || // - (base64url) - charCode === 95; // _ (base64url) - -const isBase64Whitespace = (charCode) => - charCode === 9 || charCode === 10 || charCode === 12 || charCode === 13 || charCode === 32; - -const base64Bytes = (significant) => { - const groups = Math.floor(significant / 4); - const remainder = significant % 4; - return groups * 3 + (remainder === 2 ? 1 : remainder === 3 ? 2 : 0); -}; - -// Buffer.byteLength(body, 'base64') uses the raw string length as an allocation -// upper bound even when Buffer.from later ignores characters or stops at '='. -const estimateBase64BufferAllocation = (body) => { - const len = body.length; - let padding = 0; - - if (len > 0 && body.charCodeAt(len - 1) === 61 /* '=' */) { - padding++; - - if (len > 1 && body.charCodeAt(len - 2) === 61 /* '=' */) { - padding++; - } - } - - return Math.floor(((len - padding) * 3) / 4); -}; - -const estimatePercentDecodedBase64Bytes = (body) => { - const len = body.length; - let significant = 0; - let padding = 0; - let invalid = false; - - for (let i = 0; i < len; i++) { - let code = body.charCodeAt(i); - - if (code === 37 /* '%' */ && isPercentEncodedByte(body, i, len)) { - code = hexValue(body.charCodeAt(i + 1)) * 16 + hexValue(body.charCodeAt(i + 2)); - i += 2; - } - - if (isBase64Whitespace(code)) { - continue; - } - - if (code === 61 /* '=' */) { - padding++; - continue; - } - - if (!isBase64Char(code) || padding > 0) { - invalid = true; - continue; - } - - significant++; - } - - // Fetch rejects malformed forgiving-base64 input. Returning the raw-size - // allocation bound keeps that invalid input from becoming a pre-check bypass. - if ( - invalid || - padding > 2 || - (padding > 0 && (significant + padding) % 4 !== 0) || - significant % 4 === 1 - ) { - return estimateBase64BufferAllocation(body); - } - - return base64Bytes(significant); -}; - -const estimateDataURLBytes = (url, estimateBase64) => { - if (!url || typeof url !== 'string') return 0; - if (!url.startsWith('data:')) return 0; - - const comma = url.indexOf(','); - if (comma < 0) return 0; - - const meta = url.slice(5, comma); - const body = url.slice(comma + 1); - const isBase64 = /;base64/i.test(meta); - - if (isBase64) { - return estimateBase64(body); - } - - // Compute UTF-8 byte length directly from UTF-16 code units without allocating - // a byte buffer (TextEncoder.encode would defeat the DoS guard on large bodies). - // Valid %XX triplets count as one decoded byte; this matches the bytes that - // decodeURIComponent(body) would produce before Buffer re-encodes the string. - let bytes = 0; - for (let i = 0, len = body.length; i < len; i++) { - const c = body.charCodeAt(i); - if (c === 37 /* '%' */ && isPercentEncodedByte(body, i, len)) { - bytes += 1; - i += 2; - } else if (c < 0x80) { - bytes += 1; - } else if (c < 0x800) { - bytes += 2; - } else if (c >= 0xd800 && c <= 0xdbff && i + 1 < len) { - const next = body.charCodeAt(i + 1); - if (next >= 0xdc00 && next <= 0xdfff) { - bytes += 4; - i++; - } else { - bytes += 3; - } - } else { - bytes += 3; - } - } - return bytes; -}; - -/** - * Estimate the percent-decoded payload size used by Fetch data: URLs. - * - * @param {string} url - * @returns {number} - */ -export default function estimateDataURLDecodedBytes(url) { - // Fetch removes URL fragments before processing a data: URL. - const fragmentIndex = typeof url === 'string' ? url.indexOf('#') : -1; - - return estimateDataURLBytes( - fragmentIndex === -1 ? url : url.slice(0, fragmentIndex), - estimatePercentDecodedBase64Bytes - ); -} - -/** - * Estimate the Buffer backing allocation used by Node's raw base64 decoder. - * - * @param {string} url - * @returns {number} - */ -export function estimateDataURLBufferAllocation(url) { - return estimateDataURLBytes(url, estimateBase64BufferAllocation); -} diff --git a/server/node_modules/axios/lib/helpers/formDataToJSON.js b/server/node_modules/axios/lib/helpers/formDataToJSON.js deleted file mode 100644 index 4b9129b..0000000 --- a/server/node_modules/axios/lib/helpers/formDataToJSON.js +++ /dev/null @@ -1,125 +0,0 @@ -'use strict'; - -import utils from '../utils.js'; -import AxiosError from '../core/AxiosError.js'; -import { DEFAULT_FORM_DATA_MAX_DEPTH } from './toFormData.js'; - -const MAX_DEPTH = DEFAULT_FORM_DATA_MAX_DEPTH; - -function throwIfDepthExceeded(index) { - if (index > MAX_DEPTH) { - throw new AxiosError( - 'FormData field is too deeply nested (' + index + ' levels). Max depth: ' + MAX_DEPTH, - AxiosError.ERR_FORM_DATA_DEPTH_EXCEEDED - ); - } -} - -/** - * It takes a string like `foo[x][y][z]` and returns an array like `['foo', 'x', 'y', 'z'] - * - * @param {string} name - The name of the property to get. - * - * @returns An array of strings. - */ -function parsePropPath(name) { - // foo[x][y][z] -> ['foo', 'x', 'y', 'z'] - // foo.x.y.z -> ['foo', 'x', 'y', 'z'] - // A path is split on `.` and on `[...]` groups. A segment — whether written - // in dot notation or captured inside brackets — may contain any character - // except `.`, `[` and `]`, so a key like `user-name` or `user name` is kept - // literal instead of being split (#5402). `.`, `[` and `]` keep their existing - // meaning, e.g. `foo[bar.baz]` -> ['foo', 'bar', 'baz'] and `[]` is an array push. - // Excluding `[` from the bracket group also makes the match fail fast at the - // next `[`, so a malformed name cannot rescan to the end of the string from - // every unmatched `[` — parsing stays linear in the length of the name. - const path = []; - const pattern = /[^.[\]]+|\[([^.[\]]*)]/g; - let match; - - while ((match = pattern.exec(name)) !== null) { - throwIfDepthExceeded(path.length); - path.push(match[0] === '[]' ? '' : match[1] || match[0]); - } - - return path; -} - -/** - * Convert an array to an object. - * - * @param {Array} arr - The array to convert to an object. - * - * @returns An object with the same keys and values as the array. - */ -function arrayToObject(arr) { - const obj = {}; - const keys = Object.keys(arr); - let i; - const len = keys.length; - let key; - for (i = 0; i < len; i++) { - key = keys[i]; - obj[key] = arr[key]; - } - return obj; -} - -/** - * It takes a FormData object and returns a JavaScript object - * - * @param {string} formData The FormData object to convert to JSON. - * - * @returns {Object | null} The converted object. - */ -function formDataToJSON(formData) { - function buildPath(path, value, target, index) { - throwIfDepthExceeded(index); - - let name = path[index++]; - - if (name === '__proto__') return true; - - const isNumericKey = Number.isFinite(+name); - const isLast = index >= path.length; - name = !name && utils.isArray(target) ? target.length : name; - - if (isLast) { - if (utils.hasOwnProp(target, name)) { - target[name] = utils.isArray(target[name]) - ? target[name].concat(value) - : [target[name], value]; - } else { - target[name] = value; - } - - return !isNumericKey; - } - - if (!utils.hasOwnProp(target, name) || !utils.isObject(target[name])) { - target[name] = []; - } - - const result = buildPath(path, value, target[name], index); - - if (result && utils.isArray(target[name])) { - target[name] = arrayToObject(target[name]); - } - - return !isNumericKey; - } - - if (utils.isFormData(formData) && utils.isFunction(formData.entries)) { - const obj = {}; - - utils.forEachEntry(formData, (name, value) => { - buildPath(parsePropPath(name), value, obj, 0); - }); - - return obj; - } - - return null; -} - -export default formDataToJSON; diff --git a/server/node_modules/axios/lib/helpers/formDataToStream.js b/server/node_modules/axios/lib/helpers/formDataToStream.js deleted file mode 100644 index 17f369d..0000000 --- a/server/node_modules/axios/lib/helpers/formDataToStream.js +++ /dev/null @@ -1,119 +0,0 @@ -import util from 'util'; -import { Readable } from 'stream'; -import utils from '../utils.js'; -import readBlob from './readBlob.js'; -import platform from '../platform/index.js'; - -const BOUNDARY_ALPHABET = platform.ALPHABET.ALPHA_DIGIT + '-_'; - -const textEncoder = typeof TextEncoder === 'function' ? new TextEncoder() : new util.TextEncoder(); - -const CRLF = '\r\n'; -const CRLF_BYTES = textEncoder.encode(CRLF); -const CRLF_BYTES_COUNT = 2; - -class FormDataPart { - constructor(name, value) { - const { escapeName } = this.constructor; - const isStringValue = utils.isString(value); - - let headers = `Content-Disposition: form-data; name="${escapeName(name)}"${ - !isStringValue && value.name ? `; filename="${escapeName(value.name)}"` : '' - }${CRLF}`; - - if (isStringValue) { - value = textEncoder.encode(String(value).replace(/\r?\n|\r\n?/g, CRLF)); - } else { - const safeType = String(value.type || 'application/octet-stream').replace(/[\r\n]/g, ''); - headers += `Content-Type: ${safeType}${CRLF}`; - } - - this.headers = textEncoder.encode(headers + CRLF); - - this.contentLength = isStringValue ? value.byteLength : value.size; - - this.size = this.headers.byteLength + this.contentLength + CRLF_BYTES_COUNT; - - this.name = name; - this.value = value; - } - - async *encode() { - yield this.headers; - - const { value } = this; - - if (utils.isTypedArray(value)) { - yield value; - } else { - yield* readBlob(value); - } - - yield CRLF_BYTES; - } - - static escapeName(name) { - return String(name).replace( - /[\r\n"]/g, - (match) => - ({ - '\r': '%0D', - '\n': '%0A', - '"': '%22', - })[match] - ); - } -} - -const formDataToStream = (form, headersHandler, options) => { - const { - tag = 'form-data-boundary', - size = 25, - boundary = tag + '-' + platform.generateString(size, BOUNDARY_ALPHABET), - } = options || {}; - - if (!utils.isFormData(form)) { - throw new TypeError('FormData instance required'); - } - - if (boundary.length < 1 || boundary.length > 70) { - throw new Error('boundary must be 1-70 characters long'); - } - - const boundaryBytes = textEncoder.encode('--' + boundary + CRLF); - const footerBytes = textEncoder.encode('--' + boundary + '--' + CRLF); - let contentLength = footerBytes.byteLength; - - const parts = Array.from(form.entries()).map(([name, value]) => { - const part = new FormDataPart(name, value); - contentLength += part.size; - return part; - }); - - contentLength += boundaryBytes.byteLength * parts.length; - - contentLength = utils.toFiniteNumber(contentLength); - - const computedHeaders = { - 'Content-Type': `multipart/form-data; boundary=${boundary}`, - }; - - if (Number.isFinite(contentLength)) { - computedHeaders['Content-Length'] = contentLength; - } - - headersHandler && headersHandler(computedHeaders); - - return Readable.from( - (async function* () { - for (const part of parts) { - yield boundaryBytes; - yield* part.encode(); - } - - yield footerBytes; - })() - ); -}; - -export default formDataToStream; diff --git a/server/node_modules/axios/lib/helpers/fromDataURI.js b/server/node_modules/axios/lib/helpers/fromDataURI.js deleted file mode 100644 index 81fcc6e..0000000 --- a/server/node_modules/axios/lib/helpers/fromDataURI.js +++ /dev/null @@ -1,68 +0,0 @@ -'use strict'; - -import AxiosError from '../core/AxiosError.js'; -import parseProtocol from './parseProtocol.js'; -import platform from '../platform/index.js'; - -// RFC 2397: data:[][;base64], -// mediatype = type/subtype followed by optional ;name=value parameters -const DATA_URL_PATTERN = /^([^,;]+\/[^,;]+)?((?:;[^,;=]+=[^,;]+)*)(;base64)?,([\s\S]*)$/; - -/** - * Parse data uri to a Buffer or Blob - * - * @param {String} uri - * @param {?Boolean} asBlob - * @param {?Object} options - * @param {?Function} options.Blob - * - * @returns {Buffer|Blob} - */ -export default function fromDataURI(uri, asBlob, options) { - const _Blob = (options && options.Blob) || platform.classes.Blob; - const protocol = parseProtocol(uri); - - if (asBlob === undefined && _Blob) { - asBlob = true; - } - - if (protocol === 'data') { - uri = protocol.length ? uri.slice(protocol.length + 1) : uri; - - const match = DATA_URL_PATTERN.exec(uri); - - if (!match) { - throw new AxiosError('Invalid URL', AxiosError.ERR_INVALID_URL); - } - - const type = match[1]; - const params = match[2]; - const encoding = match[3] ? 'base64' : 'utf8'; - const body = match[4]; - - // RFC 2397 section 3: default mediatype is text/plain;charset=US-ASCII - // Bare `data:,` leaves mime undefined; Blob normalises that to "" per spec. - let mime = ''; - if (type) { - mime = params ? type + params : type; - } else if (params) { - mime = 'text/plain' + params; - } - - const buffer = encoding === 'base64' - ? Buffer.from(body, 'base64') - : Buffer.from(decodeURIComponent(body), encoding); - - if (asBlob) { - if (!_Blob) { - throw new AxiosError('Blob is not supported', AxiosError.ERR_NOT_SUPPORT); - } - - return new _Blob([buffer], { type: mime }); - } - - return buffer; - } - - throw new AxiosError('Unsupported protocol ' + protocol, AxiosError.ERR_NOT_SUPPORT); -} diff --git a/server/node_modules/axios/lib/helpers/isAbsoluteURL.js b/server/node_modules/axios/lib/helpers/isAbsoluteURL.js deleted file mode 100644 index c461900..0000000 --- a/server/node_modules/axios/lib/helpers/isAbsoluteURL.js +++ /dev/null @@ -1,19 +0,0 @@ -'use strict'; - -/** - * Determines whether the specified URL is absolute - * - * @param {string} url The URL to test - * - * @returns {boolean} True if the specified URL is absolute, otherwise false - */ -export default function isAbsoluteURL(url) { - // A URL is considered absolute if it begins with "://" or "//" (protocol-relative URL). - // RFC 3986 defines scheme name as a sequence of characters beginning with a letter and followed - // by any combination of letters, digits, plus, period, or hyphen. - if (typeof url !== 'string') { - return false; - } - - return /^([a-z][a-z\d+\-.]*:)?\/\//i.test(url); -} diff --git a/server/node_modules/axios/lib/helpers/isAxiosError.js b/server/node_modules/axios/lib/helpers/isAxiosError.js deleted file mode 100644 index ffba610..0000000 --- a/server/node_modules/axios/lib/helpers/isAxiosError.js +++ /dev/null @@ -1,14 +0,0 @@ -'use strict'; - -import utils from '../utils.js'; - -/** - * Determines whether the payload is an error thrown by Axios - * - * @param {*} payload The value to test - * - * @returns {boolean} True if the payload is an error thrown by Axios, otherwise false - */ -export default function isAxiosError(payload) { - return utils.isObject(payload) && payload.isAxiosError === true; -} diff --git a/server/node_modules/axios/lib/helpers/isURLSameOrigin.js b/server/node_modules/axios/lib/helpers/isURLSameOrigin.js deleted file mode 100644 index 66af274..0000000 --- a/server/node_modules/axios/lib/helpers/isURLSameOrigin.js +++ /dev/null @@ -1,16 +0,0 @@ -import platform from '../platform/index.js'; - -export default platform.hasStandardBrowserEnv - ? ((origin, isMSIE) => (url) => { - url = new URL(url, platform.origin); - - return ( - origin.protocol === url.protocol && - origin.host === url.host && - (isMSIE || origin.port === url.port) - ); - })( - new URL(platform.origin), - platform.navigator && /(msie|trident)/i.test(platform.navigator.userAgent) - ) - : () => true; diff --git a/server/node_modules/axios/lib/helpers/null.js b/server/node_modules/axios/lib/helpers/null.js deleted file mode 100644 index b9f82c4..0000000 --- a/server/node_modules/axios/lib/helpers/null.js +++ /dev/null @@ -1,2 +0,0 @@ -// eslint-disable-next-line strict -export default null; diff --git a/server/node_modules/axios/lib/helpers/parseHeaders.js b/server/node_modules/axios/lib/helpers/parseHeaders.js deleted file mode 100644 index f9330a4..0000000 --- a/server/node_modules/axios/lib/helpers/parseHeaders.js +++ /dev/null @@ -1,71 +0,0 @@ -'use strict'; - -import utils from '../utils.js'; - -// RawAxiosHeaders whose duplicates are ignored by node -// c.f. https://nodejs.org/api/http.html#http_message_headers -const ignoreDuplicateOf = utils.toObjectSet([ - 'age', - 'authorization', - 'content-length', - 'content-type', - 'etag', - 'expires', - 'from', - 'host', - 'if-modified-since', - 'if-unmodified-since', - 'last-modified', - 'location', - 'max-forwards', - 'proxy-authorization', - 'referer', - 'retry-after', - 'user-agent', -]); - -/** - * Parse headers into an object - * - * ``` - * Date: Wed, 27 Aug 2014 08:58:49 GMT - * Content-Type: application/json - * Connection: keep-alive - * Transfer-Encoding: chunked - * ``` - * - * @param {String} rawHeaders Headers needing to be parsed - * - * @returns {Object} Headers parsed into an object - */ -export default (rawHeaders) => { - const parsed = {}; - let key; - let val; - let i; - - rawHeaders && - rawHeaders.split('\n').forEach(function parser(line) { - i = line.indexOf(':'); - key = line.substring(0, i).trim().toLowerCase(); - val = line.substring(i + 1).trim(); - - const hasKey = utils.hasOwnProp(parsed, key); - - if (!key || (hasKey && utils.hasOwnProp(ignoreDuplicateOf, key))) { - return; - } - - if (key === 'set-cookie') { - if (hasKey) { - parsed[key].push(val); - } else { - parsed[key] = [val]; - } - } else { - parsed[key] = hasKey ? parsed[key] + ', ' + val : val; - } - }); - - return parsed; -}; diff --git a/server/node_modules/axios/lib/helpers/parseProtocol.js b/server/node_modules/axios/lib/helpers/parseProtocol.js deleted file mode 100644 index 05a2d6d..0000000 --- a/server/node_modules/axios/lib/helpers/parseProtocol.js +++ /dev/null @@ -1,6 +0,0 @@ -'use strict'; - -export default function parseProtocol(url) { - const match = /^([-+\w]{1,25}):(?:\/\/)?/.exec(url); - return (match && match[1]) || ''; -} diff --git a/server/node_modules/axios/lib/helpers/progressEventReducer.js b/server/node_modules/axios/lib/helpers/progressEventReducer.js deleted file mode 100644 index d64c369..0000000 --- a/server/node_modules/axios/lib/helpers/progressEventReducer.js +++ /dev/null @@ -1,54 +0,0 @@ -import speedometer from './speedometer.js'; -import throttle from './throttle.js'; -import utils from '../utils.js'; - -export const progressEventReducer = (listener, isDownloadStream, freq = 3) => { - let bytesNotified = 0; - const _speedometer = speedometer(50, 250); - - return throttle((e) => { - if (!e || typeof e.loaded !== 'number') { - return; - } - const rawLoaded = e.loaded; - const total = e.lengthComputable ? e.total : undefined; - const loaded = Math.max(0, total != null ? Math.min(rawLoaded, total) : rawLoaded); - const progressBytes = Math.max(0, loaded - bytesNotified); - const rate = _speedometer(progressBytes); - - bytesNotified = Math.max(bytesNotified, loaded); - - const data = { - loaded, - total, - progress: total ? loaded / total : undefined, - bytes: progressBytes, - rate: rate ? rate : undefined, - estimated: rate && total ? (total - loaded) / rate : undefined, - event: e, - lengthComputable: total != null, - [isDownloadStream ? 'download' : 'upload']: true, - }; - - listener(data); - }, freq); -}; - -export const progressEventDecorator = (total, throttled) => { - const lengthComputable = total != null; - - return [ - (loaded) => - throttled[0]({ - lengthComputable, - total, - loaded, - }), - throttled[1], - ]; -}; - -export const asyncDecorator = - (fn, scheduler = utils.asap) => - (...args) => - scheduler(() => fn(...args)); diff --git a/server/node_modules/axios/lib/helpers/readBlob.js b/server/node_modules/axios/lib/helpers/readBlob.js deleted file mode 100644 index 87d0ea8..0000000 --- a/server/node_modules/axios/lib/helpers/readBlob.js +++ /dev/null @@ -1,15 +0,0 @@ -const { asyncIterator } = Symbol; - -const readBlob = async function* (blob) { - if (blob.stream) { - yield* blob.stream(); - } else if (blob.arrayBuffer) { - yield await blob.arrayBuffer(); - } else if (blob[asyncIterator]) { - yield* blob[asyncIterator](); - } else { - yield blob; - } -}; - -export default readBlob; diff --git a/server/node_modules/axios/lib/helpers/resolveConfig.js b/server/node_modules/axios/lib/helpers/resolveConfig.js deleted file mode 100644 index ee1b9f3..0000000 --- a/server/node_modules/axios/lib/helpers/resolveConfig.js +++ /dev/null @@ -1,105 +0,0 @@ -import platform from '../platform/index.js'; -import utils from '../utils.js'; -import AxiosError from '../core/AxiosError.js'; -import isURLSameOrigin from './isURLSameOrigin.js'; -import cookies from './cookies.js'; -import buildFullPath from '../core/buildFullPath.js'; -import mergeConfig from '../core/mergeConfig.js'; -import AxiosHeaders from '../core/AxiosHeaders.js'; -import setFormDataHeaders from '../core/setFormDataHeaders.js'; -import buildURL from './buildURL.js'; - -/** - * Encode a UTF-8 string to a Latin-1 byte string for use with btoa(). - * This is a modern replacement for the deprecated unescape(encodeURIComponent(str)) pattern. - * - * @param {string} str The string to encode - * - * @returns {string} UTF-8 bytes as a Latin-1 string - */ -const encodeUTF8 = (str) => - encodeURIComponent(str).replace(/%([0-9A-F]{2})/gi, (_, hex) => - String.fromCharCode(parseInt(hex, 16)) - ); - -function resolveConfig(config) { - const newConfig = mergeConfig({}, config); - - // Read only own properties to prevent prototype pollution gadgets - // (e.g. Object.prototype.baseURL = 'https://evil.com'). - const own = (key) => (utils.hasOwnProp(newConfig, key) ? newConfig[key] : undefined); - - const data = own('data'); - let withXSRFToken = own('withXSRFToken'); - const xsrfHeaderName = own('xsrfHeaderName'); - const xsrfCookieName = own('xsrfCookieName'); - let headers = own('headers'); - const auth = own('auth'); - const baseURL = own('baseURL'); - const allowAbsoluteUrls = own('allowAbsoluteUrls'); - const url = own('url'); - - newConfig.headers = headers = AxiosHeaders.from(headers); - - newConfig.url = buildURL( - buildFullPath(baseURL, url, allowAbsoluteUrls, newConfig), - own('params'), - own('paramsSerializer') - ); - - // HTTP basic authentication - if (auth) { - const username = utils.getSafeProp(auth, 'username') || ''; - const password = utils.getSafeProp(auth, 'password') || ''; - - try { - headers.set( - 'Authorization', - 'Basic ' + btoa(username + ':' + (password ? encodeUTF8(password) : '')) - ); - } catch (e) { - throw AxiosError.from(e, AxiosError.ERR_BAD_OPTION_VALUE, config); - } - } - - if (utils.isFormData(data)) { - if ( - platform.hasStandardBrowserEnv || - platform.hasStandardBrowserWebWorkerEnv || - utils.isReactNative(data) - ) { - headers.setContentType(undefined); // browser/web worker/RN handles it - } else if (utils.isFunction(data.getHeaders)) { - // Node.js FormData (like form-data package) - setFormDataHeaders(headers, data.getHeaders(), own('formDataHeaderPolicy')); - } - } - - // Add xsrf header - // This is only done if running in a standard browser environment. - // Specifically not if we're in a web worker, or react-native. - - if (platform.hasStandardBrowserEnv) { - if (utils.isFunction(withXSRFToken)) { - withXSRFToken = withXSRFToken(newConfig); - } - - // Strict boolean check — prevents proto-pollution gadgets (e.g. Object.prototype.withXSRFToken = 1) - // and misconfigurations (e.g. "false") from short-circuiting the same-origin check and leaking - // the XSRF token cross-origin. - const shouldSendXSRF = - withXSRFToken === true || (withXSRFToken == null && isURLSameOrigin(newConfig.url)); - - if (shouldSendXSRF) { - const xsrfValue = xsrfHeaderName && xsrfCookieName && cookies.read(xsrfCookieName); - - if (xsrfValue) { - headers.set(xsrfHeaderName, xsrfValue); - } - } - } - - return newConfig; -} - -export default resolveConfig; diff --git a/server/node_modules/axios/lib/helpers/sanitizeHeaderValue.js b/server/node_modules/axios/lib/helpers/sanitizeHeaderValue.js deleted file mode 100644 index 0462fc0..0000000 --- a/server/node_modules/axios/lib/helpers/sanitizeHeaderValue.js +++ /dev/null @@ -1,60 +0,0 @@ -'use strict'; - -import utils from '../utils.js'; - -function trimSPorHTAB(str) { - let start = 0; - let end = str.length; - - while (start < end) { - const code = str.charCodeAt(start); - - if (code !== 0x09 && code !== 0x20) { - break; - } - - start += 1; - } - - while (end > start) { - const code = str.charCodeAt(end - 1); - - if (code !== 0x09 && code !== 0x20) { - break; - } - - end -= 1; - } - - return start === 0 && end === str.length ? str : str.slice(start, end); -} - -// The control-code ranges are intentional: header sanitization strips C0/DEL bytes. -// eslint-disable-next-line no-control-regex -const INVALID_UNICODE_HEADER_VALUE_CHARS = new RegExp('[\\u0000-\\u0008\\u000a-\\u001f\\u007f]+', 'g'); -// eslint-disable-next-line no-control-regex -const INVALID_BYTE_STRING_HEADER_VALUE_CHARS = new RegExp('[^\\u0009\\u0020-\\u007e\\u0080-\\u00ff]+', 'g'); - -function sanitizeValue(value, invalidChars) { - if (utils.isArray(value)) { - return value.map((item) => sanitizeValue(item, invalidChars)); - } - - return trimSPorHTAB(String(value).replace(invalidChars, '')); -} - -export const sanitizeHeaderValue = (value) => - sanitizeValue(value, INVALID_UNICODE_HEADER_VALUE_CHARS); - -export const sanitizeByteStringHeaderValue = (value) => - sanitizeValue(value, INVALID_BYTE_STRING_HEADER_VALUE_CHARS); - -export function toByteStringHeaderObject(headers) { - const byteStringHeaders = Object.create(null); - - utils.forEach(headers.toJSON(), (value, header) => { - byteStringHeaders[header] = sanitizeByteStringHeaderValue(value); - }); - - return byteStringHeaders; -} diff --git a/server/node_modules/axios/lib/helpers/shouldBypassProxy.js b/server/node_modules/axios/lib/helpers/shouldBypassProxy.js deleted file mode 100644 index a1c3173..0000000 --- a/server/node_modules/axios/lib/helpers/shouldBypassProxy.js +++ /dev/null @@ -1,329 +0,0 @@ -const LOOPBACK_HOSTNAMES = new Set(['localhost', '0.0.0.0']); - -const isIPv4Loopback = (host) => { - const parts = host.split('.'); - if (parts.length !== 4) return false; - if (parts[0] !== '127') return false; - return parts.every((p) => /^\d+$/.test(p) && Number(p) >= 0 && Number(p) <= 255); -}; - -/** - * Canonicalize an IPv4 address written in shorthand, octal, or hex form into - * dotted-decimal. IPv6 addresses and non-IP strings are returned unchanged so - * the existing IPv4-mapped IPv6 unmap path and the isLoopback path can still - * see them. - * - * Shorthand expansion mirrors Node's URL parser: literal parts fill from the - * left, the final part fills the remaining octets from the right with - * zero-padding on the left. - * 127.1 -> 127.0.0.1 - * 127.0.1 -> 127.0.0.1 - * 1.2.3 -> 1.2.0.3 - * - * Each octet is parsed with an explicit base: 16 for `0x`/`0X` prefix, 8 for - * zero-prefixed multi-digit all-`0-7` parts, 10 otherwise. Zero-prefixed - * decimal-looking parts that contain `8` or `9` are rejected to match Node's - * URL parser, and the comparison layer falls through to non-bypass if either - * side rejects the form (fail-safe). - * - * Returns the input unchanged on any parse failure, out-of-range octet, or - * unusual shape (1-part, 5+ parts) so the comparison layer fails closed. - */ -const parseIPv4Octet = (text) => { - if (/^0[xX][0-9a-fA-F]+$/.test(text)) { - const n = parseInt(text.slice(2), 16); - return Number.isFinite(n) ? n : null; - } - if (text.length > 1 && /^0[0-7]+$/.test(text)) { - const n = parseInt(text, 8); - return Number.isFinite(n) ? n : null; - } - if (text.length > 1 && /^0[0-9]+$/.test(text)) { - return null; - } - if (/^[0-9]+$/.test(text)) { - const n = parseInt(text, 10); - return Number.isFinite(n) ? n : null; - } - return null; -}; - -const normalizeIPAddress = (host) => { - if (typeof host !== 'string' || !host || host.indexOf(':') !== -1) { - return host; - } - - let h = host; - if (h.charAt(0) === '[' && h.charAt(h.length - 1) === ']') { - h = h.slice(1, -1); - } - h = h.replace(/\.+$/, ''); - - // Allowed characters for any IPv4 shape: digits, dot, 'x', 'X', hex digits. - if (!/^[0-9.xXa-fA-F]+$/.test(h)) return host; - - const parts = h.split('.'); - - // No part may be empty (e.g. "127..0.1" or "127.0.0."). Trailing dots are - // already stripped above; this guards against the empty-middle case. - if (parts.some((p) => p === '')) return host; - - if (parts.length === 4) { - // Full IPv4 form: each part is an octet. - const octets = parts.map(parseIPv4Octet); - if (octets.some((n) => n === null || n < 0 || n > 255)) return host; - return octets.join('.'); - } - - if (parts.length > 4) { - return host; - } - - // Shorthand: 1..3 parts. Node's URL parser treats a 1-part input as a 32-bit - // integer split into octets, which has surprising semantics (e.g. "127" -> - // "0.0.0.127"). Reject 1-part inputs to keep the helper predictable: the - // fail-safe returns the input unchanged and the comparison layer falls - // through to non-bypass. - if (parts.length === 1) return host; - - // 2..3 parts: literal parts fill from the left, tail fills remaining octets - // from the right with zero-padding. - const literalOctets = parts.slice(0, -1); - const tail = parts[parts.length - 1]; - const tailSlots = 4 - literalOctets.length; - - // Tail is parsed as a full IPv4 number (hex/octal/decimal) and packed - // low-byte-right into the remaining octets, matching Node's URL parser. - // e.g. 127.65535 (tail 0xFFFF into 3 slots) -> 127.0.255.255; - // 127.0x00ff (tail 0xFF into 3 slots) -> 127.0.0.255; - // 127.0.65535 (tail 0xFFFF into 2 slots) -> 127.0.255.255. - const tailValue = parseIPv4Octet(tail); - if (tailValue === null) return host; - const maxTail = (1 << (8 * tailSlots)) - 1; - if (tailValue < 0 || tailValue > maxTail) return host; - - const tailOctets = new Array(tailSlots).fill(0); - for (let i = tailSlots - 1, v = tailValue; i >= 0; i--, v >>= 8) { - tailOctets[i] = v & 0xff; - } - - const literal = literalOctets.map(parseIPv4Octet); - if (literal.some((n) => n === null || n < 0 || n > 255)) return host; - - return [...literal, ...tailOctets].join('.'); -}; - -const isIPv6ZeroGroup = (group) => /^0{1,4}$/.test(group); - -// The unspecified address (IPv4 0.0.0.0 / IPv6 ::) resolves to the local host -// for outbound connections, so treat it as loopback-equivalent for NO_PROXY -// matching. 0.0.0.0 is covered by LOOPBACK_HOSTNAMES; this handles compressed -// and full IPv6 all-zero forms so both families bypass symmetrically. -const isIPv6Unspecified = (host) => { - if (host === '::') return true; - - const compressionIndex = host.indexOf('::'); - - if (compressionIndex !== -1) { - if (compressionIndex !== host.lastIndexOf('::')) return false; - - const left = host.slice(0, compressionIndex); - const right = host.slice(compressionIndex + 2); - const leftGroups = left ? left.split(':') : []; - const rightGroups = right ? right.split(':') : []; - const explicitGroups = leftGroups.length + rightGroups.length; - - return ( - explicitGroups < 8 && - leftGroups.every(isIPv6ZeroGroup) && - rightGroups.every(isIPv6ZeroGroup) - ); - } - - const groups = host.split(':'); - return groups.length === 8 && groups.every(isIPv6ZeroGroup); -}; - -const isIPv6Loopback = (host) => { - // Collapse all-zero groups: any form of ::1 / 0:0:...:0:1 - // First, strip any leading "::" by normalising with Set lookup of common forms, - // then fall back to structural check. - if (host === '::1') return true; - - // Check IPv4-mapped IPv6 loopback: ::ffff: or ::ffff: - // Node's URL parser normalises ::ffff:127.0.0.1 → ::ffff:7f00:1 - const v4MappedDotted = host.match(/^::ffff:(\d+\.\d+\.\d+\.\d+)$/i); - if (v4MappedDotted) return isIPv4Loopback(v4MappedDotted[1]); - - const v4MappedHex = host.match(/^::ffff:([0-9a-f]{1,4}):([0-9a-f]{1,4})$/i); - if (v4MappedHex) { - const high = parseInt(v4MappedHex[1], 16); - // High 16 bits must start with 127 (0x7f) — i.e. 0x7f00..0x7fff - return high >= 0x7f00 && high <= 0x7fff; - } - - // Full-form ::1 variants: any number of zero groups followed by trailing 1 - // e.g. 0:0:0:0:0:0:0:1, 0000:...:0001 - const groups = host.split(':'); - if (groups.length === 8) { - for (let i = 0; i < 7; i++) { - if (!/^0+$/.test(groups[i])) return false; - } - return /^0*1$/.test(groups[7]); - } - - return false; -}; - -const isLoopback = (host) => { - if (!host) return false; - if (LOOPBACK_HOSTNAMES.has(host)) return true; - if (isIPv4Loopback(host)) return true; - if (isIPv6Unspecified(host)) return true; - return isIPv6Loopback(host); -}; - -const DEFAULT_PORTS = { - http: 80, - https: 443, - ws: 80, - wss: 443, - ftp: 21, -}; - -const parseNoProxyEntry = (entry) => { - let entryHost = entry; - let entryPort = 0; - - if (entryHost.charAt(0) === '[') { - const bracketIndex = entryHost.indexOf(']'); - - if (bracketIndex !== -1) { - const host = entryHost.slice(1, bracketIndex); - const rest = entryHost.slice(bracketIndex + 1); - - if (rest.charAt(0) === ':' && /^\d+$/.test(rest.slice(1))) { - entryPort = Number.parseInt(rest.slice(1), 10); - } - - return [host, entryPort]; - } - } - - const firstColon = entryHost.indexOf(':'); - const lastColon = entryHost.lastIndexOf(':'); - - if ( - firstColon !== -1 && - firstColon === lastColon && - /^\d+$/.test(entryHost.slice(lastColon + 1)) - ) { - entryPort = Number.parseInt(entryHost.slice(lastColon + 1), 10); - entryHost = entryHost.slice(0, lastColon); - } - - return [entryHost, entryPort]; -}; - -// Convert IPv4-mapped IPv6 (::ffff:0:0/96 prefix) to IPv4 dotted form so both -// sides of a NO_PROXY comparison see the same canonical address. Without this, -// `NO_PROXY=192.168.1.5` would not match a request to `http://[::ffff:192.168.1.5]/` -// (Node's URL parser normalises that to `[::ffff:c0a8:105]`), and vice-versa, -// allowing the proxy-bypass policy to be circumvented by using the alternate -// representation. Returns the input unchanged when not IPv4-mapped. -const IPV4_MAPPED_DOTTED_RE = /^(?:::|(?:0{1,4}:){1,4}:|(?:0{1,4}:){5})ffff:(\d+\.\d+\.\d+\.\d+)$/i; -const IPV4_MAPPED_HEX_RE = /^(?:::|(?:0{1,4}:){1,4}:|(?:0{1,4}:){5})ffff:([0-9a-f]{1,4}):([0-9a-f]{1,4})$/i; - -const unmapIPv4MappedIPv6 = (host) => { - if (typeof host !== 'string' || host.indexOf(':') === -1) return host; - - const dotted = host.match(IPV4_MAPPED_DOTTED_RE); - if (dotted) return dotted[1]; - - const hex = host.match(IPV4_MAPPED_HEX_RE); - if (hex) { - const high = parseInt(hex[1], 16); - const low = parseInt(hex[2], 16); - return `${high >> 8}.${high & 0xff}.${low >> 8}.${low & 0xff}`; - } - - return host; -}; - -const normalizeNoProxyHost = (hostname) => { - if (!hostname) { - return hostname; - } - - if (hostname.charAt(0) === '[' && hostname.charAt(hostname.length - 1) === ']') { - hostname = hostname.slice(1, -1); - } - - const trimmed = hostname.replace(/\.+$/, ''); - - // IPv4 shorthand/octal/hex → dotted-decimal; helper is a no-op for inputs - // containing ':' (IPv6 and IPv4-mapped IPv6) so we fall through to unmap. - const ipv4 = normalizeIPAddress(trimmed); - if (ipv4 !== trimmed) { - return ipv4; - } - - return unmapIPv4MappedIPv6(trimmed); -}; - -export default function shouldBypassProxy(location) { - let parsed; - - try { - parsed = new URL(location); - } catch (_err) { - return false; - } - - const noProxy = (process.env.no_proxy || process.env.NO_PROXY || '').toLowerCase(); - - if (!noProxy) { - return false; - } - - if (noProxy === '*') { - return true; - } - - const port = - Number.parseInt(parsed.port, 10) || DEFAULT_PORTS[parsed.protocol.split(':', 1)[0]] || 0; - - const hostname = normalizeNoProxyHost(parsed.hostname.toLowerCase()); - - return noProxy.split(/[\s,]+/).some((entry) => { - if (!entry) { - return false; - } - - if (entry === '*') { - return true; - } - - let [entryHost, entryPort] = parseNoProxyEntry(entry); - - entryHost = normalizeNoProxyHost(entryHost); - - if (!entryHost) { - return false; - } - - if (entryPort && entryPort !== port) { - return false; - } - - if (entryHost.charAt(0) === '*') { - entryHost = entryHost.slice(1); - } - - if (entryHost.charAt(0) === '.') { - return hostname.endsWith(entryHost); - } - - return hostname === entryHost || (isLoopback(hostname) && isLoopback(entryHost)); - }); -} diff --git a/server/node_modules/axios/lib/helpers/speedometer.js b/server/node_modules/axios/lib/helpers/speedometer.js deleted file mode 100644 index 566a1ff..0000000 --- a/server/node_modules/axios/lib/helpers/speedometer.js +++ /dev/null @@ -1,55 +0,0 @@ -'use strict'; - -/** - * Calculate data maxRate - * @param {Number} [samplesCount= 10] - * @param {Number} [min= 1000] - * @returns {Function} - */ -function speedometer(samplesCount, min) { - samplesCount = samplesCount || 10; - const bytes = new Array(samplesCount); - const timestamps = new Array(samplesCount); - let head = 0; - let tail = 0; - let firstSampleTS; - - min = min !== undefined ? min : 1000; - - return function push(chunkLength) { - const now = Date.now(); - - const startedAt = timestamps[tail]; - - if (!firstSampleTS) { - firstSampleTS = now; - } - - bytes[head] = chunkLength; - timestamps[head] = now; - - let i = tail; - let bytesCount = 0; - - while (i !== head) { - bytesCount += bytes[i++]; - i = i % samplesCount; - } - - head = (head + 1) % samplesCount; - - if (head === tail) { - tail = (tail + 1) % samplesCount; - } - - if (now - firstSampleTS < min) { - return; - } - - const passed = startedAt && now - startedAt; - - return passed ? Math.round((bytesCount * 1000) / passed) : undefined; - }; -} - -export default speedometer; diff --git a/server/node_modules/axios/lib/helpers/spread.js b/server/node_modules/axios/lib/helpers/spread.js deleted file mode 100644 index 2e72fc8..0000000 --- a/server/node_modules/axios/lib/helpers/spread.js +++ /dev/null @@ -1,28 +0,0 @@ -'use strict'; - -/** - * Syntactic sugar for invoking a function and expanding an array for arguments. - * - * Common use case would be to use `Function.prototype.apply`. - * - * ```js - * function f(x, y, z) {} - * const args = [1, 2, 3]; - * f.apply(null, args); - * ``` - * - * With `spread` this example can be re-written. - * - * ```js - * spread(function(x, y, z) {})([1, 2, 3]); - * ``` - * - * @param {Function} callback - * - * @returns {Function} - */ -export default function spread(callback) { - return function wrap(arr) { - return callback.apply(null, arr); - }; -} diff --git a/server/node_modules/axios/lib/helpers/throttle.js b/server/node_modules/axios/lib/helpers/throttle.js deleted file mode 100644 index fbef472..0000000 --- a/server/node_modules/axios/lib/helpers/throttle.js +++ /dev/null @@ -1,44 +0,0 @@ -/** - * Throttle decorator - * @param {Function} fn - * @param {Number} freq - * @return {Function} - */ -function throttle(fn, freq) { - let timestamp = 0; - let threshold = 1000 / freq; - let lastArgs; - let timer; - - const invoke = (args, now = Date.now()) => { - timestamp = now; - lastArgs = null; - if (timer) { - clearTimeout(timer); - timer = null; - } - fn(...args); - }; - - const throttled = (...args) => { - const now = Date.now(); - const passed = now - timestamp; - if (passed >= threshold) { - invoke(args, now); - } else { - lastArgs = args; - if (!timer) { - timer = setTimeout(() => { - timer = null; - invoke(lastArgs); - }, threshold - passed); - } - } - }; - - const flush = () => lastArgs && invoke(lastArgs); - - return [throttled, flush]; -} - -export default throttle; diff --git a/server/node_modules/axios/lib/helpers/toFormData.js b/server/node_modules/axios/lib/helpers/toFormData.js deleted file mode 100644 index 6d5a144..0000000 --- a/server/node_modules/axios/lib/helpers/toFormData.js +++ /dev/null @@ -1,286 +0,0 @@ -'use strict'; - -import utils from '../utils.js'; -import AxiosError from '../core/AxiosError.js'; -// temporary hotfix to avoid circular references until AxiosURLSearchParams is refactored -import PlatformFormData from '../platform/node/classes/FormData.js'; -import PlatformBuffer from '../platform/node/classes/Buffer.js'; - -// Default nesting limit shared with the inverse transform (formDataToJSON) so -// the FormData <-> JSON round-trip stays symmetric. -export const DEFAULT_FORM_DATA_MAX_DEPTH = 100; - -/** - * Determines if the given thing is a array or js object. - * - * @param {string} thing - The object or array to be visited. - * - * @returns {boolean} - */ -function isVisitable(thing) { - return utils.isPlainObject(thing) || utils.isArray(thing); -} - -/** - * It removes the brackets from the end of a string - * - * @param {string} key - The key of the parameter. - * - * @returns {string} the key without the brackets. - */ -function removeBrackets(key) { - return utils.endsWith(key, '[]') ? key.slice(0, -2) : key; -} - -/** - * It takes a path, a key, and a boolean, and returns a string - * - * @param {string} path - The path to the current key. - * @param {string} key - The key of the current object being iterated over. - * @param {string} dots - If true, the key will be rendered with dots instead of brackets. - * - * @returns {string} The path to the current key. - */ -function renderKey(path, key, dots) { - if (!path) return key; - return path - .concat(key) - .map(function each(token, i) { - // eslint-disable-next-line no-param-reassign - token = removeBrackets(token); - return !dots && i ? '[' + token + ']' : token; - }) - .join(dots ? '.' : ''); -} - -/** - * If the array is an array and none of its elements are visitable, then it's a flat array. - * - * @param {Array} arr - The array to check - * - * @returns {boolean} - */ -function isFlatArray(arr) { - return utils.isArray(arr) && !arr.some(isVisitable); -} - -const predicates = utils.toFlatObject(utils, {}, null, function filter(prop) { - return /^is[A-Z]/.test(prop); -}); - -/** - * Convert a data object to FormData - * - * @param {Object} obj - * @param {?Object} [formData] - * @param {?Object} [options] - * @param {Function} [options.visitor] - * @param {Boolean} [options.metaTokens = true] - * @param {Boolean} [options.dots = false] - * @param {?Boolean} [options.indexes = false] - * - * @returns {Object} - **/ - -/** - * It converts an object into a FormData object - * - * @param {Object} obj - The object to convert to form data. - * @param {string} formData - The FormData object to append to. - * @param {Object} options - * - * @returns - */ -function toFormData(obj, formData, options) { - if (!utils.isObject(obj)) { - throw new TypeError('target must be an object'); - } - - // eslint-disable-next-line no-param-reassign - formData = formData || new (PlatformFormData || FormData)(); - - // eslint-disable-next-line no-param-reassign - options = utils.toFlatObject( - options, - { - metaTokens: true, - dots: false, - indexes: false, - }, - false, - function defined(option, source) { - // eslint-disable-next-line no-eq-null,eqeqeq - return !utils.isUndefined(source[option]); - } - ); - - const metaTokens = options.metaTokens; - // eslint-disable-next-line no-use-before-define - const visitor = options.visitor || defaultVisitor; - const dots = options.dots; - const indexes = options.indexes; - const _Blob = options.Blob || (typeof Blob !== 'undefined' && Blob); - const maxDepth = options.maxDepth === undefined ? DEFAULT_FORM_DATA_MAX_DEPTH : options.maxDepth; - const useBlob = _Blob && utils.isSpecCompliantForm(formData); - const stack = []; - - if (!utils.isFunction(visitor)) { - throw new TypeError('visitor must be a function'); - } - - function convertValue(value) { - if (value === null) return ''; - - if (utils.isDate(value)) { - return value.toISOString(); - } - - if (utils.isBoolean(value)) { - return value.toString(); - } - - if (!useBlob && utils.isBlob(value)) { - throw new AxiosError('Blob is not supported. Use a Buffer instead.'); - } - - if (utils.isArrayBuffer(value) || utils.isTypedArray(value)) { - if (useBlob && typeof _Blob === 'function') { - return new _Blob([value]); - } - if (PlatformBuffer && PlatformBuffer.isBufferAvailable()) { - return PlatformBuffer.from(value); - } - throw new AxiosError('Blob is not supported. Use a Buffer instead.', AxiosError.ERR_NOT_SUPPORT); - } - - return value; - } - - function throwIfMaxDepthExceeded(depth) { - if (depth > maxDepth) { - throw new AxiosError( - 'Object is too deeply nested (' + depth + ' levels). Max depth: ' + maxDepth, - AxiosError.ERR_FORM_DATA_DEPTH_EXCEEDED - ); - } - } - - function stringifyWithDepthLimit(value, depth) { - if (maxDepth === Infinity) { - return JSON.stringify(value); - } - - const ancestors = []; - - return JSON.stringify(value, function limitDepth(_key, currentValue) { - if (!utils.isObject(currentValue)) { - return currentValue; - } - - while (ancestors.length && ancestors[ancestors.length - 1] !== this) { - ancestors.pop(); - } - - ancestors.push(currentValue); - throwIfMaxDepthExceeded(depth + ancestors.length - 1); - - return currentValue; - }); - } - - /** - * Default visitor. - * - * @param {*} value - * @param {String|Number} key - * @param {Array} path - * @this {FormData} - * - * @returns {boolean} return true to visit the each prop of the value recursively - */ - function defaultVisitor(value, key, path) { - let arr = value; - - if (utils.isReactNative(formData) && utils.isReactNativeBlob(value)) { - formData.append(renderKey(path, key, dots), convertValue(value)); - return false; - } - - if (value && !path && typeof value === 'object') { - if (utils.endsWith(key, '{}')) { - // eslint-disable-next-line no-param-reassign - key = metaTokens ? key : key.slice(0, -2); - // eslint-disable-next-line no-param-reassign - value = stringifyWithDepthLimit(value, 1); - } else if ( - (utils.isArray(value) && isFlatArray(value)) || - ((utils.isFileList(value) || utils.endsWith(key, '[]')) && (arr = utils.toArray(value))) - ) { - // eslint-disable-next-line no-param-reassign - key = removeBrackets(key); - - arr.forEach(function each(el, index) { - !(utils.isUndefined(el) || el === null) && - formData.append( - // eslint-disable-next-line no-nested-ternary - indexes === true - ? renderKey([key], index, dots) - : indexes === null - ? key - : key + '[]', - convertValue(el) - ); - }); - return false; - } - } - - if (isVisitable(value)) { - return true; - } - - formData.append(renderKey(path, key, dots), convertValue(value)); - - return false; - } - - const exposedHelpers = Object.assign(predicates, { - defaultVisitor, - convertValue, - isVisitable, - }); - - function build(value, path, depth = 0) { - if (utils.isUndefined(value)) return; - - throwIfMaxDepthExceeded(depth); - - if (stack.indexOf(value) !== -1) { - throw new Error('Circular reference detected in ' + path.join('.')); - } - - stack.push(value); - - utils.forEach(value, function each(el, key) { - const result = - !(utils.isUndefined(el) || el === null) && - visitor.call(formData, el, utils.isString(key) ? key.trim() : key, path, exposedHelpers); - - if (result === true) { - build(el, path ? path.concat(key) : [key], depth + 1); - } - }); - - stack.pop(); - } - - if (!utils.isObject(obj)) { - throw new TypeError('data must be an object'); - } - - build(obj); - - return formData; -} - -export default toFormData; diff --git a/server/node_modules/axios/lib/helpers/toURLEncodedForm.js b/server/node_modules/axios/lib/helpers/toURLEncodedForm.js deleted file mode 100644 index 749e13a..0000000 --- a/server/node_modules/axios/lib/helpers/toURLEncodedForm.js +++ /dev/null @@ -1,19 +0,0 @@ -'use strict'; - -import utils from '../utils.js'; -import toFormData from './toFormData.js'; -import platform from '../platform/index.js'; - -export default function toURLEncodedForm(data, options) { - return toFormData(data, new platform.classes.URLSearchParams(), { - visitor: function (value, key, path, helpers) { - if (platform.isNode && utils.isBuffer(value)) { - this.append(key, value.toString('base64')); - return false; - } - - return helpers.defaultVisitor.apply(this, arguments); - }, - ...options, - }); -} diff --git a/server/node_modules/axios/lib/helpers/trackStream.js b/server/node_modules/axios/lib/helpers/trackStream.js deleted file mode 100644 index c75eace..0000000 --- a/server/node_modules/axios/lib/helpers/trackStream.js +++ /dev/null @@ -1,89 +0,0 @@ -export const streamChunk = function* (chunk, chunkSize) { - let len = chunk.byteLength; - - if (!chunkSize || len < chunkSize) { - yield chunk; - return; - } - - let pos = 0; - let end; - - while (pos < len) { - end = pos + chunkSize; - yield chunk.slice(pos, end); - pos = end; - } -}; - -export const readBytes = async function* (iterable, chunkSize) { - for await (const chunk of readStream(iterable)) { - yield* streamChunk(chunk, chunkSize); - } -}; - -const readStream = async function* (stream) { - if (stream[Symbol.asyncIterator]) { - yield* stream; - return; - } - - const reader = stream.getReader(); - try { - for (;;) { - const { done, value } = await reader.read(); - if (done) { - break; - } - yield value; - } - } finally { - await reader.cancel(); - } -}; - -export const trackStream = (stream, chunkSize, onProgress, onFinish) => { - const iterator = readBytes(stream, chunkSize); - - let bytes = 0; - let done; - let _onFinish = (e) => { - if (!done) { - done = true; - onFinish && onFinish(e); - } - }; - - return new ReadableStream( - { - async pull(controller) { - try { - const { done, value } = await iterator.next(); - - if (done) { - _onFinish(); - controller.close(); - return; - } - - let len = value.byteLength; - if (onProgress) { - let loadedBytes = (bytes += len); - onProgress(loadedBytes); - } - controller.enqueue(new Uint8Array(value)); - } catch (err) { - _onFinish(err); - throw err; - } - }, - cancel(reason) { - _onFinish(reason); - return iterator.return(); - }, - }, - { - highWaterMark: 2, - } - ); -}; diff --git a/server/node_modules/axios/lib/helpers/validator.js b/server/node_modules/axios/lib/helpers/validator.js deleted file mode 100644 index a152c8c..0000000 --- a/server/node_modules/axios/lib/helpers/validator.js +++ /dev/null @@ -1,112 +0,0 @@ -'use strict'; - -import { VERSION } from '../env/data.js'; -import AxiosError from '../core/AxiosError.js'; - -const validators = {}; - -// eslint-disable-next-line func-names -['object', 'boolean', 'number', 'function', 'string', 'symbol'].forEach((type, i) => { - validators[type] = function validator(thing) { - return typeof thing === type || 'a' + (i < 1 ? 'n ' : ' ') + type; - }; -}); - -const deprecatedWarnings = {}; - -/** - * Transitional option validator - * - * @param {function|boolean?} validator - set to false if the transitional option has been removed - * @param {string?} version - deprecated version / removed since version - * @param {string?} message - some message with additional info - * - * @returns {function} - */ -validators.transitional = function transitional(validator, version, message) { - function formatMessage(opt, desc) { - return ( - '[Axios v' + - VERSION + - "] Transitional option '" + - opt + - "'" + - desc + - (message ? '. ' + message : '') - ); - } - - // eslint-disable-next-line func-names - return (value, opt, opts) => { - if (validator === false) { - throw new AxiosError( - formatMessage(opt, ' has been removed' + (version ? ' in ' + version : '')), - AxiosError.ERR_DEPRECATED - ); - } - - if (version && !deprecatedWarnings[opt]) { - deprecatedWarnings[opt] = true; - // eslint-disable-next-line no-console - console.warn( - formatMessage( - opt, - ' has been deprecated since v' + version + ' and will be removed in the near future' - ) - ); - } - - return validator ? validator(value, opt, opts) : true; - }; -}; - -validators.spelling = function spelling(correctSpelling) { - return (value, opt) => { - // eslint-disable-next-line no-console - console.warn(`${opt} is likely a misspelling of ${correctSpelling}`); - return true; - }; -}; - -/** - * Assert object's properties type - * - * @param {object} options - * @param {object} schema - * @param {boolean?} allowUnknown - * - * @returns {object} - */ - -function assertOptions(options, schema, allowUnknown) { - if (typeof options !== 'object' || options === null) { - throw new AxiosError('options must be an object', AxiosError.ERR_BAD_OPTION_VALUE); - } - const keys = Object.keys(options); - let i = keys.length; - while (i-- > 0) { - const opt = keys[i]; - // Use hasOwnProperty so a polluted Object.prototype. cannot supply - // a non-function validator and cause a TypeError. - const validator = Object.prototype.hasOwnProperty.call(schema, opt) ? schema[opt] : undefined; - if (validator) { - const value = options[opt]; - const result = value === undefined || validator(value, opt, options); - if (result !== true) { - throw new AxiosError( - 'option ' + opt + ' must be ' + result, - AxiosError.ERR_BAD_OPTION_VALUE - ); - } - continue; - } - if (allowUnknown !== true) { - throw new AxiosError('Unknown option ' + opt, AxiosError.ERR_BAD_OPTION); - } - } -} - -export default { - assertOptions, - validators, -}; diff --git a/server/node_modules/axios/lib/platform/browser/classes/Blob.js b/server/node_modules/axios/lib/platform/browser/classes/Blob.js deleted file mode 100644 index 9ec4af8..0000000 --- a/server/node_modules/axios/lib/platform/browser/classes/Blob.js +++ /dev/null @@ -1,3 +0,0 @@ -'use strict'; - -export default typeof Blob !== 'undefined' ? Blob : null; diff --git a/server/node_modules/axios/lib/platform/browser/classes/FormData.js b/server/node_modules/axios/lib/platform/browser/classes/FormData.js deleted file mode 100644 index f36d31b..0000000 --- a/server/node_modules/axios/lib/platform/browser/classes/FormData.js +++ /dev/null @@ -1,3 +0,0 @@ -'use strict'; - -export default typeof FormData !== 'undefined' ? FormData : null; diff --git a/server/node_modules/axios/lib/platform/browser/classes/URLSearchParams.js b/server/node_modules/axios/lib/platform/browser/classes/URLSearchParams.js deleted file mode 100644 index b7dae95..0000000 --- a/server/node_modules/axios/lib/platform/browser/classes/URLSearchParams.js +++ /dev/null @@ -1,4 +0,0 @@ -'use strict'; - -import AxiosURLSearchParams from '../../../helpers/AxiosURLSearchParams.js'; -export default typeof URLSearchParams !== 'undefined' ? URLSearchParams : AxiosURLSearchParams; diff --git a/server/node_modules/axios/lib/platform/browser/index.js b/server/node_modules/axios/lib/platform/browser/index.js deleted file mode 100644 index 8e5f99c..0000000 --- a/server/node_modules/axios/lib/platform/browser/index.js +++ /dev/null @@ -1,13 +0,0 @@ -import URLSearchParams from './classes/URLSearchParams.js'; -import FormData from './classes/FormData.js'; -import Blob from './classes/Blob.js'; - -export default { - isBrowser: true, - classes: { - URLSearchParams, - FormData, - Blob, - }, - protocols: ['http', 'https', 'file', 'blob', 'url', 'data'], -}; diff --git a/server/node_modules/axios/lib/platform/common/utils.js b/server/node_modules/axios/lib/platform/common/utils.js deleted file mode 100644 index e4dfe46..0000000 --- a/server/node_modules/axios/lib/platform/common/utils.js +++ /dev/null @@ -1,52 +0,0 @@ -const hasBrowserEnv = typeof window !== 'undefined' && typeof document !== 'undefined'; - -const _navigator = (typeof navigator === 'object' && navigator) || undefined; - -/** - * Determine if we're running in a standard browser environment - * - * This allows axios to run in a web worker, and react-native. - * Both environments support XMLHttpRequest, but not fully standard globals. - * - * web workers: - * typeof window -> undefined - * typeof document -> undefined - * - * react-native: - * navigator.product -> 'ReactNative' - * nativescript - * navigator.product -> 'NativeScript' or 'NS' - * - * @returns {boolean} - */ -const hasStandardBrowserEnv = - hasBrowserEnv && - (!_navigator || ['ReactNative', 'NativeScript', 'NS'].indexOf(_navigator.product) < 0); - -/** - * Determine if we're running in a standard browser webWorker environment - * - * Although the `isStandardBrowserEnv` method indicates that - * `allows axios to run in a web worker`, the WebWorker will still be - * filtered out due to its judgment standard - * `typeof window !== 'undefined' && typeof document !== 'undefined'`. - * This leads to a problem when axios post `FormData` in webWorker - */ -const hasStandardBrowserWebWorkerEnv = (() => { - return ( - typeof WorkerGlobalScope !== 'undefined' && - // eslint-disable-next-line no-undef - self instanceof WorkerGlobalScope && - typeof self.importScripts === 'function' - ); -})(); - -const origin = (hasBrowserEnv && window.location.href) || 'http://localhost'; - -export { - hasBrowserEnv, - hasStandardBrowserWebWorkerEnv, - hasStandardBrowserEnv, - _navigator as navigator, - origin, -}; diff --git a/server/node_modules/axios/lib/platform/index.js b/server/node_modules/axios/lib/platform/index.js deleted file mode 100644 index e1094ab..0000000 --- a/server/node_modules/axios/lib/platform/index.js +++ /dev/null @@ -1,7 +0,0 @@ -import platform from './node/index.js'; -import * as utils from './common/utils.js'; - -export default { - ...utils, - ...platform, -}; diff --git a/server/node_modules/axios/lib/platform/node/classes/Buffer.js b/server/node_modules/axios/lib/platform/node/classes/Buffer.js deleted file mode 100644 index 24a3625..0000000 --- a/server/node_modules/axios/lib/platform/node/classes/Buffer.js +++ /dev/null @@ -1,11 +0,0 @@ -'use strict'; - -export default { - isBufferAvailable() { - return typeof Buffer !== 'undefined'; - }, - - from(value) { - return Buffer.from(value); - } -}; diff --git a/server/node_modules/axios/lib/platform/node/classes/FormData.js b/server/node_modules/axios/lib/platform/node/classes/FormData.js deleted file mode 100644 index b07f947..0000000 --- a/server/node_modules/axios/lib/platform/node/classes/FormData.js +++ /dev/null @@ -1,3 +0,0 @@ -import FormData from 'form-data'; - -export default FormData; diff --git a/server/node_modules/axios/lib/platform/node/classes/URLSearchParams.js b/server/node_modules/axios/lib/platform/node/classes/URLSearchParams.js deleted file mode 100644 index fba5842..0000000 --- a/server/node_modules/axios/lib/platform/node/classes/URLSearchParams.js +++ /dev/null @@ -1,4 +0,0 @@ -'use strict'; - -import url from 'url'; -export default url.URLSearchParams; diff --git a/server/node_modules/axios/lib/platform/node/index.js b/server/node_modules/axios/lib/platform/node/index.js deleted file mode 100644 index 9979a71..0000000 --- a/server/node_modules/axios/lib/platform/node/index.js +++ /dev/null @@ -1,37 +0,0 @@ -import crypto from 'crypto'; -import URLSearchParams from './classes/URLSearchParams.js'; -import FormData from './classes/FormData.js'; - -const ALPHA = 'abcdefghijklmnopqrstuvwxyz'; - -const DIGIT = '0123456789'; - -const ALPHABET = { - DIGIT, - ALPHA, - ALPHA_DIGIT: ALPHA + ALPHA.toUpperCase() + DIGIT, -}; - -const generateString = (size = 16, alphabet = ALPHABET.ALPHA_DIGIT) => { - let str = ''; - const { length } = alphabet; - const randomValues = new Uint32Array(size); - crypto.randomFillSync(randomValues); - for (let i = 0; i < size; i++) { - str += alphabet[randomValues[i] % length]; - } - - return str; -}; - -export default { - isNode: true, - classes: { - URLSearchParams, - FormData, - Blob: (typeof Blob !== 'undefined' && Blob) || null, - }, - ALPHABET, - generateString, - protocols: ['http', 'https', 'file', 'data'], -}; diff --git a/server/node_modules/axios/lib/utils.js b/server/node_modules/axios/lib/utils.js deleted file mode 100644 index d35f76b..0000000 --- a/server/node_modules/axios/lib/utils.js +++ /dev/null @@ -1,1029 +0,0 @@ -'use strict'; - -import bind from './helpers/bind.js'; - -// utils is a library of generic helper functions non-specific to axios - -const { toString } = Object.prototype; -const { getPrototypeOf } = Object; -const { iterator, toStringTag } = Symbol; - -/* Creating a function that will check if an object has a property. */ -const hasOwnProperty = ( - ({ hasOwnProperty }) => - (obj, prop) => - hasOwnProperty.call(obj, prop) -)(Object.prototype); - -/** - * Walk the prototype chain (excluding the shared Object.prototype) looking for - * an own `prop`. This distinguishes genuine own/inherited members — including - * class accessors and template prototypes — from members injected via - * Object.prototype pollution (e.g. `Object.prototype.username = '...'`), which - * live on Object.prototype itself and are therefore never matched. - * - * @param {*} thing The value whose chain to inspect - * @param {string|symbol} prop The property key to look for - * - * @returns {boolean} True when `prop` is owned below Object.prototype - */ -const hasOwnInPrototypeChain = (thing, prop) => { - let obj = thing; - const seen = []; - - while (obj != null && obj !== Object.prototype) { - if (seen.indexOf(obj) !== -1) { - return false; - } - seen.push(obj); - - if (hasOwnProperty(obj, prop)) { - return true; - } - obj = getPrototypeOf(obj); - } - return false; -}; - -/** - * Read `obj[prop]` only when it is safe from Object.prototype pollution. Own - * properties and members inherited from a non-Object.prototype source (a class - * instance or template object) are honored; a value reachable only through a - * polluted Object.prototype is ignored and `undefined` is returned. - * - * @param {*} obj The source object - * @param {string|symbol} prop The property key to read - * - * @returns {*} The resolved value, or undefined when unsafe/absent - */ -const getSafeProp = (obj, prop) => - obj != null && hasOwnInPrototypeChain(obj, prop) ? obj[prop] : undefined; - -const kindOf = ((cache) => (thing) => { - const str = toString.call(thing); - return cache[str] || (cache[str] = str.slice(8, -1).toLowerCase()); -})(Object.create(null)); - -const kindOfTest = (type) => { - type = type.toLowerCase(); - return (thing) => kindOf(thing) === type; -}; - -const typeOfTest = (type) => (thing) => typeof thing === type; - -/** - * Determine if a value is a non-null object - * - * @param {Object} val The value to test - * - * @returns {boolean} True if value is an Array, otherwise false - */ -const { isArray } = Array; - -/** - * Determine if a value is undefined - * - * @param {*} val The value to test - * - * @returns {boolean} True if the value is undefined, otherwise false - */ -const isUndefined = typeOfTest('undefined'); - -/** - * Determine if a value is a Buffer - * - * @param {*} val The value to test - * - * @returns {boolean} True if value is a Buffer, otherwise false - */ -function isBuffer(val) { - return ( - val !== null && - !isUndefined(val) && - val.constructor !== null && - !isUndefined(val.constructor) && - isFunction(val.constructor.isBuffer) && - val.constructor.isBuffer(val) - ); -} - -/** - * Determine if a value is an ArrayBuffer - * - * @param {*} val The value to test - * - * @returns {boolean} True if value is an ArrayBuffer, otherwise false - */ -const isArrayBuffer = kindOfTest('ArrayBuffer'); - -/** - * Determine if a value is a view on an ArrayBuffer - * - * @param {*} val The value to test - * - * @returns {boolean} True if value is a view on an ArrayBuffer, otherwise false - */ -function isArrayBufferView(val) { - let result; - if (typeof ArrayBuffer !== 'undefined' && ArrayBuffer.isView) { - result = ArrayBuffer.isView(val); - } else { - result = val && val.buffer && isArrayBuffer(val.buffer); - } - return result; -} - -/** - * Determine if a value is a String - * - * @param {*} val The value to test - * - * @returns {boolean} True if value is a String, otherwise false - */ -const isString = typeOfTest('string'); - -/** - * Determine if a value is a Function - * - * @param {*} val The value to test - * @returns {boolean} True if value is a Function, otherwise false - */ -const isFunction = typeOfTest('function'); - -/** - * Determine if a value is a Number - * - * @param {*} val The value to test - * - * @returns {boolean} True if value is a Number, otherwise false - */ -const isNumber = typeOfTest('number'); - -/** - * Determine if a value is an Object - * - * @param {*} thing The value to test - * - * @returns {boolean} True if value is an Object, otherwise false - */ -const isObject = (thing) => thing !== null && typeof thing === 'object'; - -/** - * Determine if a value is a Boolean - * - * @param {*} thing The value to test - * @returns {boolean} True if value is a Boolean, otherwise false - */ -const isBoolean = (thing) => thing === true || thing === false; - -/** - * Determine if a value is a plain Object - * - * @param {*} val The value to test - * - * @returns {boolean} True if value is a plain Object, otherwise false - */ -const isPlainObject = (val) => { - if (!isObject(val)) { - return false; - } - - const prototype = getPrototypeOf(val); - return ( - (prototype === null || - prototype === Object.prototype || - getPrototypeOf(prototype) === null) && - // Treat any genuine (non-Object.prototype-polluted) Symbol.toStringTag or - // Symbol.iterator as evidence the value is a tagged/iterable type rather - // than a plain object, while ignoring keys injected onto Object.prototype. - !hasOwnInPrototypeChain(val, toStringTag) && - !hasOwnInPrototypeChain(val, iterator) - ); -}; - -/** - * Determine if a value is an empty object (safely handles Buffers) - * - * @param {*} val The value to test - * - * @returns {boolean} True if value is an empty object, otherwise false - */ -const isEmptyObject = (val) => { - // Early return for non-objects or Buffers to prevent RangeError - if (!isObject(val) || isBuffer(val)) { - return false; - } - - try { - return Object.keys(val).length === 0 && Object.getPrototypeOf(val) === Object.prototype; - } catch (e) { - // Fallback for any other objects that might cause RangeError with Object.keys() - return false; - } -}; - -/** - * Determine if a value is a Date - * - * @param {*} val The value to test - * - * @returns {boolean} True if value is a Date, otherwise false - */ -const isDate = kindOfTest('Date'); - -/** - * Determine if a value is a File - * - * @param {*} val The value to test - * - * @returns {boolean} True if value is a File, otherwise false - */ -const isFile = kindOfTest('File'); - -/** - * Determine if a value is a React Native Blob - * React Native "blob": an object with a `uri` attribute. Optionally, it can - * also have a `name` and `type` attribute to specify filename and content type - * - * @see https://github.com/facebook/react-native/blob/26684cf3adf4094eb6c405d345a75bf8c7c0bf88/Libraries/Network/FormData.js#L68-L71 - * - * @param {*} value The value to test - * - * @returns {boolean} True if value is a React Native Blob, otherwise false - */ -const isReactNativeBlob = (value) => { - return !!(value && typeof value.uri !== 'undefined'); -}; - -/** - * Determine if environment is React Native - * ReactNative `FormData` has a non-standard `getParts()` method - * - * @param {*} formData The formData to test - * - * @returns {boolean} True if environment is React Native, otherwise false - */ -const isReactNative = (formData) => formData && typeof formData.getParts !== 'undefined'; - -/** - * Determine if a value is a Blob - * - * @param {*} val The value to test - * - * @returns {boolean} True if value is a Blob, otherwise false - */ -const isBlob = kindOfTest('Blob'); - -/** - * Determine if a value is a FileList - * - * @param {*} val The value to test - * - * @returns {boolean} True if value is a FileList, otherwise false - */ -const isFileList = kindOfTest('FileList'); -const isSet = kindOfTest('Set'); - -/** - * Determine if a value is a Stream - * - * @param {*} val The value to test - * - * @returns {boolean} True if value is a Stream, otherwise false - */ -const isStream = (val) => isObject(val) && isFunction(val.pipe); - -/** - * Determine if a value is a FormData - * - * @param {*} thing The value to test - * - * @returns {boolean} True if value is an FormData, otherwise false - */ -function getGlobal() { - if (typeof globalThis !== 'undefined') return globalThis; - if (typeof self !== 'undefined') return self; - if (typeof window !== 'undefined') return window; - if (typeof global !== 'undefined') return global; - return {}; -} - -const G = getGlobal(); -const FormDataCtor = typeof G.FormData !== 'undefined' ? G.FormData : undefined; - -const isFormData = (thing) => { - if (!thing) return false; - if (FormDataCtor && thing instanceof FormDataCtor) return true; - // Reject plain objects inheriting directly from Object.prototype so prototype-pollution gadgets can't spoof FormData. - const proto = getPrototypeOf(thing); - if (!proto || proto === Object.prototype) return false; - if (!isFunction(thing.append)) return false; - const kind = kindOf(thing); - return ( - kind === 'formdata' || - // detect form-data instance - (kind === 'object' && isFunction(thing.toString) && thing.toString() === '[object FormData]') - ); -}; - -/** - * Determine if a value is a URLSearchParams object - * - * @param {*} val The value to test - * - * @returns {boolean} True if value is a URLSearchParams object, otherwise false - */ -const isURLSearchParams = kindOfTest('URLSearchParams'); - -const [isReadableStream, isRequest, isResponse, isHeaders] = [ - 'ReadableStream', - 'Request', - 'Response', - 'Headers', -].map(kindOfTest); - -/** - * Trim excess whitespace off the beginning and end of a string - * - * @param {String} str The String to trim - * - * @returns {String} The String freed of excess whitespace - */ -const trim = (str) => { - return str.trim ? str.trim() : str.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, ''); -}; -/** - * Iterate over an Array or an Object invoking a function for each item. - * - * If `obj` is an Array callback will be called passing - * the value, index, and complete array for each item. - * - * If 'obj' is an Object callback will be called passing - * the value, key, and complete object for each property. - * - * @param {Object|Array} obj The object to iterate - * @param {Function} fn The callback to invoke for each item - * - * @param {Object} [options] - * @param {Boolean} [options.allOwnKeys = false] - * @returns {any} - */ -function forEach(obj, fn, { allOwnKeys = false } = {}) { - // Don't bother if no value provided - if (obj === null || typeof obj === 'undefined') { - return; - } - - let i; - let l; - - // Force an array if not already something iterable - if (typeof obj !== 'object') { - /*eslint no-param-reassign:0*/ - obj = [obj]; - } - - if (isArray(obj)) { - // Iterate over array values - for (i = 0, l = obj.length; i < l; i++) { - fn.call(null, obj[i], i, obj); - } - } else { - // Buffer check - if (isBuffer(obj)) { - return; - } - - // Iterate over object keys - const keys = allOwnKeys ? Object.getOwnPropertyNames(obj) : Object.keys(obj); - const len = keys.length; - let key; - - for (i = 0; i < len; i++) { - key = keys[i]; - fn.call(null, obj[key], key, obj); - } - } -} - -/** - * Finds a key in an object, case-insensitive, returning the actual key name. - * Returns null if the object is a Buffer or if no match is found. - * - * @param {Object} obj - The object to search. - * @param {string} key - The key to find (case-insensitive). - * @returns {?string} The actual key name if found, otherwise null. - */ -function findKey(obj, key) { - if (isBuffer(obj)) { - return null; - } - - key = key.toLowerCase(); - const keys = Object.keys(obj); - let i = keys.length; - let _key; - while (i-- > 0) { - _key = keys[i]; - if (key === _key.toLowerCase()) { - return _key; - } - } - return null; -} - -const _global = (() => { - /*eslint no-undef:0*/ - if (typeof globalThis !== 'undefined') return globalThis; - return typeof self !== 'undefined' ? self : typeof window !== 'undefined' ? window : global; -})(); - -const isContextDefined = (context) => !isUndefined(context) && context !== _global; - -/** - * Accepts varargs expecting each argument to be an object, then - * immutably merges the properties of each object and returns result. - * - * When multiple objects contain the same key the later object in - * the arguments list will take precedence. - * - * Example: - * - * ```js - * const result = merge({foo: 123}, {foo: 456}); - * console.log(result.foo); // outputs 456 - * ``` - * - * @param {Object} obj1 Object to merge - * - * @returns {Object} Result of all merge properties - */ -function merge(...objs) { - const { caseless, skipUndefined } = (isContextDefined(this) && this) || {}; - const result = {}; - const assignValue = (val, key) => { - // Skip dangerous property names to prevent prototype pollution - if (key === '__proto__' || key === 'constructor' || key === 'prototype') { - return; - } - - // findKey lowercases the key, so caseless lookup only applies to strings — - // symbol keys are identity-matched. - const targetKey = (caseless && typeof key === 'string' && findKey(result, key)) || key; - // Read via own-prop only — a bare `result[targetKey]` walks the prototype - // chain, so a polluted Object.prototype value could surface here and get - // copied into the merged result. - const existing = hasOwnProperty(result, targetKey) ? result[targetKey] : undefined; - if (isPlainObject(existing) && isPlainObject(val)) { - result[targetKey] = merge(existing, val); - } else if (isPlainObject(val)) { - result[targetKey] = merge({}, val); - } else if (isArray(val)) { - result[targetKey] = val.slice(); - } else if (!skipUndefined || !isUndefined(val)) { - result[targetKey] = val; - } - }; - - for (let i = 0, l = objs.length; i < l; i++) { - const source = objs[i]; - if (!source || isBuffer(source)) { - continue; - } - - forEach(source, assignValue); - - if (typeof source !== 'object' || isArray(source)) { - continue; - } - - const symbols = Object.getOwnPropertySymbols(source); - for (let j = 0; j < symbols.length; j++) { - const symbol = symbols[j]; - if (propertyIsEnumerable.call(source, symbol)) { - assignValue(source[symbol], symbol); - } - } - } - return result; -} - -/** - * Extends object a by mutably adding to it the properties of object b. - * - * @param {Object} a The object to be extended - * @param {Object} b The object to copy properties from - * @param {Object} thisArg The object to bind function to - * - * @param {Object} [options] - * @param {Boolean} [options.allOwnKeys] - * @returns {Object} The resulting value of object a - */ -const extend = (a, b, thisArg, { allOwnKeys } = {}) => { - forEach( - b, - (val, key) => { - if (thisArg && isFunction(val)) { - Object.defineProperty(a, key, { - // Null-proto descriptor so a polluted Object.prototype.get cannot - // hijack defineProperty's accessor-vs-data resolution. - __proto__: null, - value: bind(val, thisArg), - writable: true, - enumerable: true, - configurable: true, - }); - } else { - Object.defineProperty(a, key, { - __proto__: null, - value: val, - writable: true, - enumerable: true, - configurable: true, - }); - } - }, - { allOwnKeys } - ); - return a; -}; - -/** - * Remove byte order marker. This catches EF BB BF (the UTF-8 BOM) - * - * @param {string} content with BOM - * - * @returns {string} content value without BOM - */ -const stripBOM = (content) => { - if (content.charCodeAt(0) === 0xfeff) { - content = content.slice(1); - } - return content; -}; - -/** - * Inherit the prototype methods from one constructor into another - * @param {function} constructor - * @param {function} superConstructor - * @param {object} [props] - * @param {object} [descriptors] - * - * @returns {void} - */ -const inherits = (constructor, superConstructor, props, descriptors) => { - constructor.prototype = Object.create(superConstructor.prototype, descriptors); - Object.defineProperty(constructor.prototype, 'constructor', { - __proto__: null, - value: constructor, - writable: true, - enumerable: false, - configurable: true, - }); - Object.defineProperty(constructor, 'super', { - __proto__: null, - value: superConstructor.prototype, - }); - props && Object.assign(constructor.prototype, props); -}; - -/** - * Resolve object with deep prototype chain to a flat object - * @param {Object} sourceObj source object - * @param {Object} [destObj] - * @param {Function|Boolean} [filter] - * @param {Function} [propFilter] - * - * @returns {Object} - */ -const toFlatObject = (sourceObj, destObj, filter, propFilter) => { - let props; - let i; - let prop; - const merged = {}; - - destObj = destObj || {}; - // eslint-disable-next-line no-eq-null,eqeqeq - if (sourceObj == null) return destObj; - - do { - props = Object.getOwnPropertyNames(sourceObj); - i = props.length; - while (i-- > 0) { - prop = props[i]; - if ((!propFilter || propFilter(prop, sourceObj, destObj)) && !merged[prop]) { - destObj[prop] = sourceObj[prop]; - merged[prop] = true; - } - } - sourceObj = filter !== false && getPrototypeOf(sourceObj); - } while (sourceObj && (!filter || filter(sourceObj, destObj)) && sourceObj !== Object.prototype); - - return destObj; -}; - -/** - * Determines whether a string ends with the characters of a specified string - * - * @param {String} str - * @param {String} searchString - * @param {Number} [position= 0] - * - * @returns {boolean} - */ -const endsWith = (str, searchString, position) => { - str = String(str); - if (position === undefined || position > str.length) { - position = str.length; - } - position -= searchString.length; - const lastIndex = str.indexOf(searchString, position); - return lastIndex !== -1 && lastIndex === position; -}; - -/** - * Returns new array from array like object or null if failed - * - * @param {*} [thing] - * - * @returns {?Array} - */ -const toArray = (thing) => { - if (!thing) return null; - if (isArray(thing)) return thing; - let i = thing.length; - if (!isNumber(i)) return null; - const arr = new Array(i); - while (i-- > 0) { - arr[i] = thing[i]; - } - return arr; -}; - -/** - * Checking if the Uint8Array exists and if it does, it returns a function that checks if the - * thing passed in is an instance of Uint8Array - * - * @param {TypedArray} - * - * @returns {Array} - */ -// eslint-disable-next-line func-names -const isTypedArray = ((TypedArray) => { - // eslint-disable-next-line func-names - return (thing) => { - return TypedArray && thing instanceof TypedArray; - }; -})(typeof Uint8Array !== 'undefined' && getPrototypeOf(Uint8Array)); - -/** - * For each entry in the object, call the function with the key and value. - * - * @param {Object} obj - The object to iterate over. - * @param {Function} fn - The function to call for each entry. - * - * @returns {void} - */ -const forEachEntry = (obj, fn) => { - const generator = obj && obj[iterator]; - - const _iterator = generator.call(obj); - - let result; - - while ((result = _iterator.next()) && !result.done) { - const pair = result.value; - fn.call(obj, pair[0], pair[1]); - } -}; - -/** - * It takes a regular expression and a string, and returns an array of all the matches - * - * @param {string} regExp - The regular expression to match against. - * @param {string} str - The string to search. - * - * @returns {Array} - */ -const matchAll = (regExp, str) => { - let matches; - const arr = []; - - while ((matches = regExp.exec(str)) !== null) { - arr.push(matches); - } - - return arr; -}; - -/* Checking if the kindOfTest function returns true when passed an HTMLFormElement. */ -const isHTMLForm = kindOfTest('HTMLFormElement'); - -const toCamelCase = (str) => { - return str.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g, function replacer(m, p1, p2) { - return p1.toUpperCase() + p2; - }); -}; - -const { propertyIsEnumerable } = Object.prototype; - -/** - * Determine if a value is a RegExp object - * - * @param {*} val The value to test - * - * @returns {boolean} True if value is a RegExp object, otherwise false - */ -const isRegExp = kindOfTest('RegExp'); - -const reduceDescriptors = (obj, reducer) => { - const descriptors = Object.getOwnPropertyDescriptors(obj); - const reducedDescriptors = {}; - - forEach(descriptors, (descriptor, name) => { - let ret; - if ((ret = reducer(descriptor, name, obj)) !== false) { - reducedDescriptors[name] = ret || descriptor; - } - }); - - Object.defineProperties(obj, reducedDescriptors); -}; - -/** - * Makes all methods read-only - * @param {Object} obj - */ - -const freezeMethods = (obj) => { - reduceDescriptors(obj, (descriptor, name) => { - // skip restricted props in strict mode - if (isFunction(obj) && ['arguments', 'caller', 'callee'].includes(name)) { - return false; - } - - const value = obj[name]; - - if (!isFunction(value)) return; - - descriptor.enumerable = false; - - if ('writable' in descriptor) { - descriptor.writable = false; - return; - } - - if (!descriptor.set) { - descriptor.set = () => { - throw Error("Can not rewrite read-only method '" + name + "'"); - }; - } - }); -}; - -/** - * Converts an array or a delimited string into an object set with values as keys and true as values. - * Useful for fast membership checks. - * - * @param {Array|string} arrayOrString - The array or string to convert. - * @param {string} delimiter - The delimiter to use if input is a string. - * @returns {Object} An object with keys from the array or string, values set to true. - */ -const toObjectSet = (arrayOrString, delimiter) => { - const obj = {}; - - const define = (arr) => { - arr.forEach((value) => { - obj[value] = true; - }); - }; - - isArray(arrayOrString) ? define(arrayOrString) : define(String(arrayOrString).split(delimiter)); - - return obj; -}; - -const noop = () => {}; - -const toFiniteNumber = (value, defaultValue) => { - return value != null && Number.isFinite((value = +value)) ? value : defaultValue; -}; - -/** - * If the thing is a FormData object, return true, otherwise return false. - * - * @param {unknown} thing - The thing to check. - * - * @returns {boolean} - */ -function isSpecCompliantForm(thing) { - return !!( - thing && - isFunction(thing.append) && - thing[toStringTag] === 'FormData' && - thing[iterator] - ); -} - -/** - * Recursively converts an object to a JSON-compatible object, handling circular references and Buffers. - * - * @param {Object} obj - The object to convert. - * @returns {Object} The JSON-compatible object. - */ -const toJSONObject = (obj) => { - const visited = new WeakSet(); - - const visit = (source) => { - if (isObject(source)) { - if (visited.has(source)) { - return; - } - - //Buffer check - if (isBuffer(source)) { - return source; - } - - if (!('toJSON' in source)) { - // add-on descent / delete-on-ascent: preserves path semantics, so DAG nodes serialise at every occurrence (see #7230). - visited.add(source); - - let target; - - if (isSet(source)) { - target = []; - for (const value of source) { - const reducedValue = visit(value); - !isUndefined(reducedValue) && target.push(reducedValue); - } - } else { - target = isArray(source) ? [] : {}; - - forEach(source, (value, key) => { - const reducedValue = visit(value); - !isUndefined(reducedValue) && (target[key] = reducedValue); - }); - } - - visited.delete(source); - - return target; - } - } - - return source; - }; - - return visit(obj); -}; - -/** - * Determines if a value is an async function. - * - * @param {*} thing - The value to test. - * @returns {boolean} True if value is an async function, otherwise false. - */ -const isAsyncFn = kindOfTest('AsyncFunction'); - -/** - * Determines if a value is thenable (has then and catch methods). - * - * @param {*} thing - The value to test. - * @returns {boolean} True if value is thenable, otherwise false. - */ -const isThenable = (thing) => - thing && - (isObject(thing) || isFunction(thing)) && - isFunction(thing.then) && - isFunction(thing.catch); - -// original code -// https://github.com/DigitalBrainJS/AxiosPromise/blob/16deab13710ec09779922131f3fa5954320f83ab/lib/utils.js#L11-L34 - -/** - * Provides a cross-platform setImmediate implementation. - * Uses native setImmediate if available, otherwise falls back to postMessage or setTimeout. - * - * @param {boolean} setImmediateSupported - Whether setImmediate is supported. - * @param {boolean} postMessageSupported - Whether postMessage is supported. - * @returns {Function} A function to schedule a callback asynchronously. - */ -const _setImmediate = ((setImmediateSupported, postMessageSupported) => { - if (setImmediateSupported) { - return setImmediate; - } - - return postMessageSupported - ? ((token, callbacks) => { - _global.addEventListener( - 'message', - ({ source, data }) => { - if (source === _global && data === token) { - callbacks.length && callbacks.shift()(); - } - }, - false - ); - - return (cb) => { - callbacks.push(cb); - _global.postMessage(token, '*'); - }; - })(`axios@${Math.random()}`, []) - : (cb) => setTimeout(cb); -})(typeof setImmediate === 'function', isFunction(_global.postMessage)); - -/** - * Schedules a microtask or asynchronous callback as soon as possible. - * Uses queueMicrotask if available, otherwise falls back to process.nextTick or _setImmediate. - * - * @type {Function} - */ -const asap = - typeof queueMicrotask !== 'undefined' - ? queueMicrotask.bind(_global) - : (typeof process !== 'undefined' && process.nextTick) || _setImmediate; - -// ********************* - -const isIterable = (thing) => thing != null && isFunction(thing[iterator]); - -/** - * Determine if a value is iterable via an iterator that is NOT sourced solely - * from a polluted Object.prototype. Use this instead of `isIterable` whenever - * the iterable comes from untrusted input (e.g. user-supplied header sources), - * so `Object.prototype[Symbol.iterator] = ...` cannot turn an ordinary object - * into an attacker-controlled entries iterator. - * - * @param {*} thing The value to test - * - * @returns {boolean} True if value has a non-polluted iterator - */ -const isSafeIterable = (thing) => - thing != null && hasOwnInPrototypeChain(thing, iterator) && isIterable(thing); - -export default { - isArray, - isArrayBuffer, - isBuffer, - isFormData, - isArrayBufferView, - isString, - isNumber, - isBoolean, - isObject, - isPlainObject, - isEmptyObject, - isReadableStream, - isRequest, - isResponse, - isHeaders, - isUndefined, - isDate, - isFile, - isReactNativeBlob, - isReactNative, - isBlob, - isRegExp, - isFunction, - isStream, - isURLSearchParams, - isTypedArray, - isFileList, - forEach, - merge, - extend, - trim, - stripBOM, - inherits, - toFlatObject, - kindOf, - kindOfTest, - endsWith, - toArray, - forEachEntry, - matchAll, - isHTMLForm, - hasOwnProperty, - hasOwnProp: hasOwnProperty, // an alias to avoid ESLint no-prototype-builtins detection - hasOwnInPrototypeChain, - getSafeProp, - reduceDescriptors, - freezeMethods, - toObjectSet, - toCamelCase, - noop, - toFiniteNumber, - findKey, - global: _global, - isContextDefined, - isSpecCompliantForm, - toJSONObject, - isAsyncFn, - isThenable, - setImmediate: _setImmediate, - asap, - isIterable, - isSafeIterable, -}; diff --git a/server/node_modules/axios/package.json b/server/node_modules/axios/package.json deleted file mode 100644 index 802d9f1..0000000 --- a/server/node_modules/axios/package.json +++ /dev/null @@ -1,203 +0,0 @@ -{ - "name": "axios", - "version": "1.19.0", - "description": "Promise based HTTP client for the browser and node.js", - "main": "./dist/node/axios.cjs", - "module": "./index.js", - "type": "module", - "types": "index.d.ts", - "jsdelivr": "dist/axios.min.js", - "unpkg": "dist/axios.min.js", - "typings": "./index.d.ts", - "exports": { - ".": { - "types": { - "require": "./index.d.cts", - "default": "./index.d.ts" - }, - "bun": { - "require": "./dist/node/axios.cjs", - "default": "./index.js" - }, - "react-native": { - "require": "./dist/browser/axios.cjs", - "default": "./dist/esm/axios.js" - }, - "browser": { - "require": "./dist/browser/axios.cjs", - "default": "./index.js" - }, - "default": { - "require": "./dist/node/axios.cjs", - "default": "./index.js" - } - }, - "./lib/adapters/http.js": "./lib/adapters/http.js", - "./lib/adapters/xhr.js": "./lib/adapters/xhr.js", - "./unsafe/*": "./lib/*", - "./unsafe/core/settle.js": "./lib/core/settle.js", - "./unsafe/core/buildFullPath.js": "./lib/core/buildFullPath.js", - "./unsafe/helpers/isAbsoluteURL.js": "./lib/helpers/isAbsoluteURL.js", - "./unsafe/helpers/buildURL.js": "./lib/helpers/buildURL.js", - "./unsafe/helpers/combineURLs.js": "./lib/helpers/combineURLs.js", - "./unsafe/adapters/http.js": "./lib/adapters/http.js", - "./unsafe/adapters/xhr.js": "./lib/adapters/xhr.js", - "./unsafe/utils.js": "./lib/utils.js", - "./package.json": "./package.json", - "./dist/browser/axios.cjs": "./dist/browser/axios.cjs", - "./dist/node/axios.cjs": "./dist/node/axios.cjs" - }, - "browser": { - "./dist/node/axios.cjs": "./dist/browser/axios.cjs", - "./lib/adapters/http.js": "./lib/helpers/null.js", - "./lib/platform/node/index.js": "./lib/platform/browser/index.js", - "./lib/platform/node/classes/Buffer.js": "./lib/helpers/null.js", - "./lib/platform/node/classes/FormData.js": "./lib/helpers/null.js" - }, - "react-native": { - "./dist/node/axios.cjs": "./dist/browser/axios.cjs", - "./lib/adapters/http.js": "./lib/helpers/null.js", - "./lib/platform/node/index.js": "./lib/platform/browser/index.js", - "./lib/platform/node/classes/Buffer.js": "./lib/helpers/null.js", - "./lib/platform/node/classes/FormData.js": "./lib/helpers/null.js" - }, - "repository": { - "type": "git", - "url": "https://github.com/axios/axios.git" - }, - "keywords": [ - "xhr", - "http", - "ajax", - "promise", - "node", - "browser", - "fetch", - "rest", - "api", - "client" - ], - "author": "Matt Zabriskie", - "contributors": [ - "Matt Zabriskie (https://github.com/mzabriskie)", - "Jay (https://github.com/jasonsaayman)", - "Dmitriy Mozgovoy (https://github.com/DigitalBrainJS)", - "Nick Uraltsev (https://github.com/nickuraltsev)", - "Emily Morehouse (https://github.com/emilyemorehouse)", - "Rubén Norte (https://github.com/rubennorte)", - "Justin Beckwith (https://github.com/JustinBeckwith)", - "Martti Laine (https://github.com/codeclown)", - "Xianming Zhong (https://github.com/chinesedfan)", - "Shaan Majid (https://github.com/shaanmajid)", - "Remco Haszing (https://github.com/remcohaszing)", - "Willian Agostini (https://github.com/WillianAgostini)", - "Rikki Gibson (https://github.com/RikkiGibson)" - ], - "sideEffects": false, - "license": "MIT", - "bugs": { - "url": "https://github.com/axios/axios/issues" - }, - "homepage": "https://axios-http.com", - "files": [ - "index.js", - "index.d.ts", - "index.d.cts", - "CHANGELOG.md", - "MIGRATION_GUIDE.md", - "lib/", - "dist/axios.js", - "dist/axios.min.js", - "dist/axios.min.js.map", - "dist/esm/axios.js", - "dist/esm/axios.min.js", - "dist/esm/axios.min.js.map", - "dist/browser/axios.cjs", - "dist/node/axios.cjs" - ], - "scripts": { - "build": "gulp clear && cross-env NODE_ENV=production rollup -c", - "version": "npm run build && git add package.json", - "preversion": "gulp version", - "test": "npm run test:vitest", - "test:vitest": "vitest run", - "test:vitest:unit": "vitest run --project unit", - "test:vitest:browser": "vitest run --project browser", - "test:vitest:browser:headless": "vitest run --project browser-headless", - "test:vitest:watch": "vitest", - "test:smoke:cjs:vitest": "npm --prefix tests/smoke/cjs run test:smoke:cjs:mocha", - "test:smoke:esm:vitest": "npm --prefix tests/smoke/esm run test:smoke:esm:vitest", - "test:smoke:deno": "deno task --cwd tests/smoke/deno test", - "test:smoke:bun": "bun test --cwd tests/smoke/bun", - "test:module:cjs": "npm --prefix tests/module/cjs run test:module:cjs", - "test:module:esm": "npm --prefix tests/module/esm run test:module:esm", - "docs:dev": "cd docs && npm run docs:dev", - "start": "node ./sandbox/server.js", - "examples": "node ./examples/server.js", - "lint": "eslint lib/**/*.js", - "fix": "eslint --fix lib/**/*.js", - "prepare": "husky" - }, - "dependencies": { - "follow-redirects": "^1.16.0", - "form-data": "^4.0.6", - "https-proxy-agent": "^5.0.1", - "proxy-from-env": "^2.1.0" - }, - "devDependencies": { - "@babel/core": "^7.29.0", - "@babel/preset-env": "^7.29.5", - "@commitlint/cli": "^21.2.0", - "@commitlint/config-conventional": "^21.2.0", - "@eslint/js": "^10.0.1", - "@rollup/plugin-alias": "^6.0.0", - "@rollup/plugin-babel": "^7.1.0", - "@rollup/plugin-commonjs": "^29.0.3", - "@rollup/plugin-json": "^6.1.0", - "@rollup/plugin-node-resolve": "^16.0.3", - "@rollup/plugin-terser": "^1.0.0", - "@vitest/browser": "^4.1.9", - "@vitest/browser-playwright": "^4.1.9", - "abortcontroller-polyfill": "^1.7.8", - "acorn": "^8.17.0", - "body-parser": "^2.3.0", - "chalk": "^5.6.2", - "cross-env": "^10.1.0", - "dev-null": "^0.1.1", - "eslint": "^10.6.0", - "express": "^5.2.1", - "formdata-node": "^6.0.3", - "formidable": "^3.5.4", - "fs-extra": "^11.3.6", - "get-stream": "^9.0.1", - "globals": "^17.7.0", - "gulp": "^5.0.1", - "husky": "^9.1.7", - "lint-staged": "^17.0.8", - "minimist": "^1.2.8", - "multer": "^2.2.0", - "playwright": "^1.61.1", - "prettier": "^3.9.4", - "rollup": "^4.60.4", - "rollup-plugin-bundle-size": "^1.0.3", - "selfsigned": "^5.5.0", - "stream-throttle": "^0.1.3", - "typescript": "^5.9.3", - "vitest": "^4.1.9" - }, - "commitlint": { - "rules": { - "header-max-length": [ - 2, - "always", - 130 - ] - }, - "extends": [ - "@commitlint/config-conventional" - ] - }, - "lint-staged": { - "*.{js,cjs,mjs,ts,json,md,yml,yaml}": "prettier --write" - } -} \ No newline at end of file diff --git a/server/node_modules/body-parser/HISTORY.md b/server/node_modules/body-parser/HISTORY.md deleted file mode 100644 index 397213a..0000000 --- a/server/node_modules/body-parser/HISTORY.md +++ /dev/null @@ -1,692 +0,0 @@ -1.20.6 / 2026-07-09 -=================== -* fix: improve `limit` option validation (#698) - * Invalid `limit` values (e.g. unparseable strings or `NaN`) now throw instead of being silently ignored, which previously disabled size limit enforcement - * `null` and `undefined` fall back to the default 100kb limit - -1.20.5 / 2026-04-24 -=================== -* refactor(json): simplify strict mode error string construction -* fix: extended urlencoded parsing of arrays with >100 elements (#716) -* deps: qs@~6.15.1 - -1.20.4 / 2025-12-01 -=================== - - * deps: qs@~6.14.0 - * deps: use tilde notation for dependencies - * deps: http-errors@~2.0.1 - * deps: raw-body@~2.5.3 - -1.20.3 / 2024-09-10 -=================== - - * deps: qs@6.13.0 - * add `depth` option to customize the depth level in the parser - * IMPORTANT: The default `depth` level for parsing URL-encoded data is now `32` (previously was `Infinity`) - -1.20.2 / 2023-02-21 -=================== - - * Fix strict json error message on Node.js 19+ - * deps: content-type@~1.0.5 - - perf: skip value escaping when unnecessary - * deps: raw-body@2.5.2 - -1.20.1 / 2022-10-06 -=================== - - * deps: qs@6.11.0 - * perf: remove unnecessary object clone - -1.20.0 / 2022-04-02 -=================== - - * Fix error message for json parse whitespace in `strict` - * Fix internal error when inflated body exceeds limit - * Prevent loss of async hooks context - * Prevent hanging when request already read - * deps: depd@2.0.0 - - Replace internal `eval` usage with `Function` constructor - - Use instance methods on `process` to check for listeners - * deps: http-errors@2.0.0 - - deps: depd@2.0.0 - - deps: statuses@2.0.1 - * deps: on-finished@2.4.1 - * deps: qs@6.10.3 - * deps: raw-body@2.5.1 - - deps: http-errors@2.0.0 - -1.19.2 / 2022-02-15 -=================== - - * deps: bytes@3.1.2 - * deps: qs@6.9.7 - * Fix handling of `__proto__` keys - * deps: raw-body@2.4.3 - - deps: bytes@3.1.2 - -1.19.1 / 2021-12-10 -=================== - - * deps: bytes@3.1.1 - * deps: http-errors@1.8.1 - - deps: inherits@2.0.4 - - deps: toidentifier@1.0.1 - - deps: setprototypeof@1.2.0 - * deps: qs@6.9.6 - * deps: raw-body@2.4.2 - - deps: bytes@3.1.1 - - deps: http-errors@1.8.1 - * deps: safe-buffer@5.2.1 - * deps: type-is@~1.6.18 - -1.19.0 / 2019-04-25 -=================== - - * deps: bytes@3.1.0 - - Add petabyte (`pb`) support - * deps: http-errors@1.7.2 - - Set constructor name when possible - - deps: setprototypeof@1.1.1 - - deps: statuses@'>= 1.5.0 < 2' - * deps: iconv-lite@0.4.24 - - Added encoding MIK - * deps: qs@6.7.0 - - Fix parsing array brackets after index - * deps: raw-body@2.4.0 - - deps: bytes@3.1.0 - - deps: http-errors@1.7.2 - - deps: iconv-lite@0.4.24 - * deps: type-is@~1.6.17 - - deps: mime-types@~2.1.24 - - perf: prevent internal `throw` on invalid type - -1.18.3 / 2018-05-14 -=================== - - * Fix stack trace for strict json parse error - * deps: depd@~1.1.2 - - perf: remove argument reassignment - * deps: http-errors@~1.6.3 - - deps: depd@~1.1.2 - - deps: setprototypeof@1.1.0 - - deps: statuses@'>= 1.3.1 < 2' - * deps: iconv-lite@0.4.23 - - Fix loading encoding with year appended - - Fix deprecation warnings on Node.js 10+ - * deps: qs@6.5.2 - * deps: raw-body@2.3.3 - - deps: http-errors@1.6.3 - - deps: iconv-lite@0.4.23 - * deps: type-is@~1.6.16 - - deps: mime-types@~2.1.18 - -1.18.2 / 2017-09-22 -=================== - - * deps: debug@2.6.9 - * perf: remove argument reassignment - -1.18.1 / 2017-09-12 -=================== - - * deps: content-type@~1.0.4 - - perf: remove argument reassignment - - perf: skip parameter parsing when no parameters - * deps: iconv-lite@0.4.19 - - Fix ISO-8859-1 regression - - Update Windows-1255 - * deps: qs@6.5.1 - - Fix parsing & compacting very deep objects - * deps: raw-body@2.3.2 - - deps: iconv-lite@0.4.19 - -1.18.0 / 2017-09-08 -=================== - - * Fix JSON strict violation error to match native parse error - * Include the `body` property on verify errors - * Include the `type` property on all generated errors - * Use `http-errors` to set status code on errors - * deps: bytes@3.0.0 - * deps: debug@2.6.8 - * deps: depd@~1.1.1 - - Remove unnecessary `Buffer` loading - * deps: http-errors@~1.6.2 - - deps: depd@1.1.1 - * deps: iconv-lite@0.4.18 - - Add support for React Native - - Add a warning if not loaded as utf-8 - - Fix CESU-8 decoding in Node.js 8 - - Improve speed of ISO-8859-1 encoding - * deps: qs@6.5.0 - * deps: raw-body@2.3.1 - - Use `http-errors` for standard emitted errors - - deps: bytes@3.0.0 - - deps: iconv-lite@0.4.18 - - perf: skip buffer decoding on overage chunk - * perf: prevent internal `throw` when missing charset - -1.17.2 / 2017-05-17 -=================== - - * deps: debug@2.6.7 - - Fix `DEBUG_MAX_ARRAY_LENGTH` - - deps: ms@2.0.0 - * deps: type-is@~1.6.15 - - deps: mime-types@~2.1.15 - -1.17.1 / 2017-03-06 -=================== - - * deps: qs@6.4.0 - - Fix regression parsing keys starting with `[` - -1.17.0 / 2017-03-01 -=================== - - * deps: http-errors@~1.6.1 - - Make `message` property enumerable for `HttpError`s - - deps: setprototypeof@1.0.3 - * deps: qs@6.3.1 - - Fix compacting nested arrays - -1.16.1 / 2017-02-10 -=================== - - * deps: debug@2.6.1 - - Fix deprecation messages in WebStorm and other editors - - Undeprecate `DEBUG_FD` set to `1` or `2` - -1.16.0 / 2017-01-17 -=================== - - * deps: debug@2.6.0 - - Allow colors in workers - - Deprecated `DEBUG_FD` environment variable - - Fix error when running under React Native - - Use same color for same namespace - - deps: ms@0.7.2 - * deps: http-errors@~1.5.1 - - deps: inherits@2.0.3 - - deps: setprototypeof@1.0.2 - - deps: statuses@'>= 1.3.1 < 2' - * deps: iconv-lite@0.4.15 - - Added encoding MS-31J - - Added encoding MS-932 - - Added encoding MS-936 - - Added encoding MS-949 - - Added encoding MS-950 - - Fix GBK/GB18030 handling of Euro character - * deps: qs@6.2.1 - - Fix array parsing from skipping empty values - * deps: raw-body@~2.2.0 - - deps: iconv-lite@0.4.15 - * deps: type-is@~1.6.14 - - deps: mime-types@~2.1.13 - -1.15.2 / 2016-06-19 -=================== - - * deps: bytes@2.4.0 - * deps: content-type@~1.0.2 - - perf: enable strict mode - * deps: http-errors@~1.5.0 - - Use `setprototypeof` module to replace `__proto__` setting - - deps: statuses@'>= 1.3.0 < 2' - - perf: enable strict mode - * deps: qs@6.2.0 - * deps: raw-body@~2.1.7 - - deps: bytes@2.4.0 - - perf: remove double-cleanup on happy path - * deps: type-is@~1.6.13 - - deps: mime-types@~2.1.11 - -1.15.1 / 2016-05-05 -=================== - - * deps: bytes@2.3.0 - - Drop partial bytes on all parsed units - - Fix parsing byte string that looks like hex - * deps: raw-body@~2.1.6 - - deps: bytes@2.3.0 - * deps: type-is@~1.6.12 - - deps: mime-types@~2.1.10 - -1.15.0 / 2016-02-10 -=================== - - * deps: http-errors@~1.4.0 - - Add `HttpError` export, for `err instanceof createError.HttpError` - - deps: inherits@2.0.1 - - deps: statuses@'>= 1.2.1 < 2' - * deps: qs@6.1.0 - * deps: type-is@~1.6.11 - - deps: mime-types@~2.1.9 - -1.14.2 / 2015-12-16 -=================== - - * deps: bytes@2.2.0 - * deps: iconv-lite@0.4.13 - * deps: qs@5.2.0 - * deps: raw-body@~2.1.5 - - deps: bytes@2.2.0 - - deps: iconv-lite@0.4.13 - * deps: type-is@~1.6.10 - - deps: mime-types@~2.1.8 - -1.14.1 / 2015-09-27 -=================== - - * Fix issue where invalid charset results in 400 when `verify` used - * deps: iconv-lite@0.4.12 - - Fix CESU-8 decoding in Node.js 4.x - * deps: raw-body@~2.1.4 - - Fix masking critical errors from `iconv-lite` - - deps: iconv-lite@0.4.12 - * deps: type-is@~1.6.9 - - deps: mime-types@~2.1.7 - -1.14.0 / 2015-09-16 -=================== - - * Fix JSON strict parse error to match syntax errors - * Provide static `require` analysis in `urlencoded` parser - * deps: depd@~1.1.0 - - Support web browser loading - * deps: qs@5.1.0 - * deps: raw-body@~2.1.3 - - Fix sync callback when attaching data listener causes sync read - * deps: type-is@~1.6.8 - - Fix type error when given invalid type to match against - - deps: mime-types@~2.1.6 - -1.13.3 / 2015-07-31 -=================== - - * deps: type-is@~1.6.6 - - deps: mime-types@~2.1.4 - -1.13.2 / 2015-07-05 -=================== - - * deps: iconv-lite@0.4.11 - * deps: qs@4.0.0 - - Fix dropping parameters like `hasOwnProperty` - - Fix user-visible incompatibilities from 3.1.0 - - Fix various parsing edge cases - * deps: raw-body@~2.1.2 - - Fix error stack traces to skip `makeError` - - deps: iconv-lite@0.4.11 - * deps: type-is@~1.6.4 - - deps: mime-types@~2.1.2 - - perf: enable strict mode - - perf: remove argument reassignment - -1.13.1 / 2015-06-16 -=================== - - * deps: qs@2.4.2 - - Downgraded from 3.1.0 because of user-visible incompatibilities - -1.13.0 / 2015-06-14 -=================== - - * Add `statusCode` property on `Error`s, in addition to `status` - * Change `type` default to `application/json` for JSON parser - * Change `type` default to `application/x-www-form-urlencoded` for urlencoded parser - * Provide static `require` analysis - * Use the `http-errors` module to generate errors - * deps: bytes@2.1.0 - - Slight optimizations - * deps: iconv-lite@0.4.10 - - The encoding UTF-16 without BOM now defaults to UTF-16LE when detection fails - - Leading BOM is now removed when decoding - * deps: on-finished@~2.3.0 - - Add defined behavior for HTTP `CONNECT` requests - - Add defined behavior for HTTP `Upgrade` requests - - deps: ee-first@1.1.1 - * deps: qs@3.1.0 - - Fix dropping parameters like `hasOwnProperty` - - Fix various parsing edge cases - - Parsed object now has `null` prototype - * deps: raw-body@~2.1.1 - - Use `unpipe` module for unpiping requests - - deps: iconv-lite@0.4.10 - * deps: type-is@~1.6.3 - - deps: mime-types@~2.1.1 - - perf: reduce try block size - - perf: remove bitwise operations - * perf: enable strict mode - * perf: remove argument reassignment - * perf: remove delete call - -1.12.4 / 2015-05-10 -=================== - - * deps: debug@~2.2.0 - * deps: qs@2.4.2 - - Fix allowing parameters like `constructor` - * deps: on-finished@~2.2.1 - * deps: raw-body@~2.0.1 - - Fix a false-positive when unpiping in Node.js 0.8 - - deps: bytes@2.0.1 - * deps: type-is@~1.6.2 - - deps: mime-types@~2.0.11 - -1.12.3 / 2015-04-15 -=================== - - * Slight efficiency improvement when not debugging - * deps: depd@~1.0.1 - * deps: iconv-lite@0.4.8 - - Add encoding alias UNICODE-1-1-UTF-7 - * deps: raw-body@1.3.4 - - Fix hanging callback if request aborts during read - - deps: iconv-lite@0.4.8 - -1.12.2 / 2015-03-16 -=================== - - * deps: qs@2.4.1 - - Fix error when parameter `hasOwnProperty` is present - -1.12.1 / 2015-03-15 -=================== - - * deps: debug@~2.1.3 - - Fix high intensity foreground color for bold - - deps: ms@0.7.0 - * deps: type-is@~1.6.1 - - deps: mime-types@~2.0.10 - -1.12.0 / 2015-02-13 -=================== - - * add `debug` messages - * accept a function for the `type` option - * use `content-type` to parse `Content-Type` headers - * deps: iconv-lite@0.4.7 - - Gracefully support enumerables on `Object.prototype` - * deps: raw-body@1.3.3 - - deps: iconv-lite@0.4.7 - * deps: type-is@~1.6.0 - - fix argument reassignment - - fix false-positives in `hasBody` `Transfer-Encoding` check - - support wildcard for both type and subtype (`*/*`) - - deps: mime-types@~2.0.9 - -1.11.0 / 2015-01-30 -=================== - - * make internal `extended: true` depth limit infinity - * deps: type-is@~1.5.6 - - deps: mime-types@~2.0.8 - -1.10.2 / 2015-01-20 -=================== - - * deps: iconv-lite@0.4.6 - - Fix rare aliases of single-byte encodings - * deps: raw-body@1.3.2 - - deps: iconv-lite@0.4.6 - -1.10.1 / 2015-01-01 -=================== - - * deps: on-finished@~2.2.0 - * deps: type-is@~1.5.5 - - deps: mime-types@~2.0.7 - -1.10.0 / 2014-12-02 -=================== - - * make internal `extended: true` array limit dynamic - -1.9.3 / 2014-11-21 -================== - - * deps: iconv-lite@0.4.5 - - Fix Windows-31J and X-SJIS encoding support - * deps: qs@2.3.3 - - Fix `arrayLimit` behavior - * deps: raw-body@1.3.1 - - deps: iconv-lite@0.4.5 - * deps: type-is@~1.5.3 - - deps: mime-types@~2.0.3 - -1.9.2 / 2014-10-27 -================== - - * deps: qs@2.3.2 - - Fix parsing of mixed objects and values - -1.9.1 / 2014-10-22 -================== - - * deps: on-finished@~2.1.1 - - Fix handling of pipelined requests - * deps: qs@2.3.0 - - Fix parsing of mixed implicit and explicit arrays - * deps: type-is@~1.5.2 - - deps: mime-types@~2.0.2 - -1.9.0 / 2014-09-24 -================== - - * include the charset in "unsupported charset" error message - * include the encoding in "unsupported content encoding" error message - * deps: depd@~1.0.0 - -1.8.4 / 2014-09-23 -================== - - * fix content encoding to be case-insensitive - -1.8.3 / 2014-09-19 -================== - - * deps: qs@2.2.4 - - Fix issue with object keys starting with numbers truncated - -1.8.2 / 2014-09-15 -================== - - * deps: depd@0.4.5 - -1.8.1 / 2014-09-07 -================== - - * deps: media-typer@0.3.0 - * deps: type-is@~1.5.1 - -1.8.0 / 2014-09-05 -================== - - * make empty-body-handling consistent between chunked requests - - empty `json` produces `{}` - - empty `raw` produces `new Buffer(0)` - - empty `text` produces `''` - - empty `urlencoded` produces `{}` - * deps: qs@2.2.3 - - Fix issue where first empty value in array is discarded - * deps: type-is@~1.5.0 - - fix `hasbody` to be true for `content-length: 0` - -1.7.0 / 2014-09-01 -================== - - * add `parameterLimit` option to `urlencoded` parser - * change `urlencoded` extended array limit to 100 - * respond with 413 when over `parameterLimit` in `urlencoded` - -1.6.7 / 2014-08-29 -================== - - * deps: qs@2.2.2 - - Remove unnecessary cloning - -1.6.6 / 2014-08-27 -================== - - * deps: qs@2.2.0 - - Array parsing fix - - Performance improvements - -1.6.5 / 2014-08-16 -================== - - * deps: on-finished@2.1.0 - -1.6.4 / 2014-08-14 -================== - - * deps: qs@1.2.2 - -1.6.3 / 2014-08-10 -================== - - * deps: qs@1.2.1 - -1.6.2 / 2014-08-07 -================== - - * deps: qs@1.2.0 - - Fix parsing array of objects - -1.6.1 / 2014-08-06 -================== - - * deps: qs@1.1.0 - - Accept urlencoded square brackets - - Accept empty values in implicit array notation - -1.6.0 / 2014-08-05 -================== - - * deps: qs@1.0.2 - - Complete rewrite - - Limits array length to 20 - - Limits object depth to 5 - - Limits parameters to 1,000 - -1.5.2 / 2014-07-27 -================== - - * deps: depd@0.4.4 - - Work-around v8 generating empty stack traces - -1.5.1 / 2014-07-26 -================== - - * deps: depd@0.4.3 - - Fix exception when global `Error.stackTraceLimit` is too low - -1.5.0 / 2014-07-20 -================== - - * deps: depd@0.4.2 - - Add `TRACE_DEPRECATION` environment variable - - Remove non-standard grey color from color output - - Support `--no-deprecation` argument - - Support `--trace-deprecation` argument - * deps: iconv-lite@0.4.4 - - Added encoding UTF-7 - * deps: raw-body@1.3.0 - - deps: iconv-lite@0.4.4 - - Added encoding UTF-7 - - Fix `Cannot switch to old mode now` error on Node.js 0.10+ - * deps: type-is@~1.3.2 - -1.4.3 / 2014-06-19 -================== - - * deps: type-is@1.3.1 - - fix global variable leak - -1.4.2 / 2014-06-19 -================== - - * deps: type-is@1.3.0 - - improve type parsing - -1.4.1 / 2014-06-19 -================== - - * fix urlencoded extended deprecation message - -1.4.0 / 2014-06-19 -================== - - * add `text` parser - * add `raw` parser - * check accepted charset in content-type (accepts utf-8) - * check accepted encoding in content-encoding (accepts identity) - * deprecate `bodyParser()` middleware; use `.json()` and `.urlencoded()` as needed - * deprecate `urlencoded()` without provided `extended` option - * lazy-load urlencoded parsers - * parsers split into files for reduced mem usage - * support gzip and deflate bodies - - set `inflate: false` to turn off - * deps: raw-body@1.2.2 - - Support all encodings from `iconv-lite` - -1.3.1 / 2014-06-11 -================== - - * deps: type-is@1.2.1 - - Switch dependency from mime to mime-types@1.0.0 - -1.3.0 / 2014-05-31 -================== - - * add `extended` option to urlencoded parser - -1.2.2 / 2014-05-27 -================== - - * deps: raw-body@1.1.6 - - assert stream encoding on node.js 0.8 - - assert stream encoding on node.js < 0.10.6 - - deps: bytes@1 - -1.2.1 / 2014-05-26 -================== - - * invoke `next(err)` after request fully read - - prevents hung responses and socket hang ups - -1.2.0 / 2014-05-11 -================== - - * add `verify` option - * deps: type-is@1.2.0 - - support suffix matching - -1.1.2 / 2014-05-11 -================== - - * improve json parser speed - -1.1.1 / 2014-05-11 -================== - - * fix repeated limit parsing with every request - -1.1.0 / 2014-05-10 -================== - - * add `type` option - * deps: pin for safety and consistency - -1.0.2 / 2014-04-14 -================== - - * use `type-is` module - -1.0.1 / 2014-03-20 -================== - - * lower default limits to 100kb diff --git a/server/node_modules/body-parser/LICENSE b/server/node_modules/body-parser/LICENSE deleted file mode 100644 index 386b7b6..0000000 --- a/server/node_modules/body-parser/LICENSE +++ /dev/null @@ -1,23 +0,0 @@ -(The MIT License) - -Copyright (c) 2014 Jonathan Ong -Copyright (c) 2014-2015 Douglas Christopher Wilson - -Permission is hereby granted, free of charge, to any person obtaining -a copy of this software and associated documentation files (the -'Software'), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sublicense, and/or sell copies of the Software, and to -permit persons to whom the Software is furnished to do so, subject to -the following conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, -TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE -SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/server/node_modules/body-parser/README.md b/server/node_modules/body-parser/README.md deleted file mode 100644 index f6661b7..0000000 --- a/server/node_modules/body-parser/README.md +++ /dev/null @@ -1,476 +0,0 @@ -# body-parser - -[![NPM Version][npm-version-image]][npm-url] -[![NPM Downloads][npm-downloads-image]][npm-url] -[![Build Status][ci-image]][ci-url] -[![Test Coverage][coveralls-image]][coveralls-url] -[![OpenSSF Scorecard Badge][ossf-scorecard-badge]][ossf-scorecard-visualizer] - -Node.js body parsing middleware. - -Parse incoming request bodies in a middleware before your handlers, available -under the `req.body` property. - -**Note** As `req.body`'s shape is based on user-controlled input, all -properties and values in this object are untrusted and should be validated -before trusting. For example, `req.body.foo.toString()` may fail in multiple -ways, for example the `foo` property may not be there or may not be a string, -and `toString` may not be a function and instead a string or other user input. - -[Learn about the anatomy of an HTTP transaction in Node.js](https://nodejs.org/en/docs/guides/anatomy-of-an-http-transaction/). - -_This does not handle multipart bodies_, due to their complex and typically -large nature. For multipart bodies, you may be interested in the following -modules: - - * [busboy](https://www.npmjs.org/package/busboy#readme) and - [connect-busboy](https://www.npmjs.org/package/connect-busboy#readme) - * [multiparty](https://www.npmjs.org/package/multiparty#readme) and - [connect-multiparty](https://www.npmjs.org/package/connect-multiparty#readme) - * [formidable](https://www.npmjs.org/package/formidable#readme) - * [multer](https://www.npmjs.org/package/multer#readme) - -This module provides the following parsers: - - * [JSON body parser](#bodyparserjsonoptions) - * [Raw body parser](#bodyparserrawoptions) - * [Text body parser](#bodyparsertextoptions) - * [URL-encoded form body parser](#bodyparserurlencodedoptions) - -Other body parsers you might be interested in: - -- [body](https://www.npmjs.org/package/body#readme) -- [co-body](https://www.npmjs.org/package/co-body#readme) - -## Installation - -```sh -$ npm install body-parser -``` - -## API - -```js -var bodyParser = require('body-parser') -``` - -The `bodyParser` object exposes various factories to create middlewares. All -middlewares will populate the `req.body` property with the parsed body when -the `Content-Type` request header matches the `type` option, or an empty -object (`{}`) if there was no body to parse, the `Content-Type` was not matched, -or an error occurred. - -The various errors returned by this module are described in the -[errors section](#errors). - -### bodyParser.json([options]) - -Returns middleware that only parses `json` and only looks at requests where -the `Content-Type` header matches the `type` option. This parser accepts any -Unicode encoding of the body and supports automatic inflation of `gzip` and -`deflate` encodings. - -A new `body` object containing the parsed data is populated on the `request` -object after the middleware (i.e. `req.body`). - -#### Options - -The `json` function takes an optional `options` object that may contain any of -the following keys: - -##### inflate - -When set to `true`, then deflated (compressed) bodies will be inflated; when -`false`, deflated bodies are rejected. Defaults to `true`. - -##### limit - -Controls the maximum request body size. If this is a number, then the value -specifies the number of bytes; if it is a string, the value is passed to the -[bytes](https://www.npmjs.com/package/bytes) library for parsing. Defaults -to `'100kb'`. - -##### reviver - -The `reviver` option is passed directly to `JSON.parse` as the second -argument. You can find more information on this argument -[in the MDN documentation about JSON.parse](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/parse#Example.3A_Using_the_reviver_parameter). - -##### strict - -When set to `true`, will only accept arrays and objects; when `false` will -accept anything `JSON.parse` accepts. Defaults to `true`. - -##### type - -The `type` option is used to determine what media type the middleware will -parse. This option can be a string, array of strings, or a function. If not a -function, `type` option is passed directly to the -[type-is](https://www.npmjs.org/package/type-is#readme) library and this can -be an extension name (like `json`), a mime type (like `application/json`), or -a mime type with a wildcard (like `*/*` or `*/json`). If a function, the `type` -option is called as `fn(req)` and the request is parsed if it returns a truthy -value. Defaults to `application/json`. - -##### verify - -The `verify` option, if supplied, is called as `verify(req, res, buf, encoding)`, -where `buf` is a `Buffer` of the raw request body and `encoding` is the -encoding of the request. The parsing can be aborted by throwing an error. - -### bodyParser.raw([options]) - -Returns middleware that parses all bodies as a `Buffer` and only looks at -requests where the `Content-Type` header matches the `type` option. This -parser supports automatic inflation of `gzip` and `deflate` encodings. - -A new `body` object containing the parsed data is populated on the `request` -object after the middleware (i.e. `req.body`). This will be a `Buffer` object -of the body. - -#### Options - -The `raw` function takes an optional `options` object that may contain any of -the following keys: - -##### inflate - -When set to `true`, then deflated (compressed) bodies will be inflated; when -`false`, deflated bodies are rejected. Defaults to `true`. - -##### limit - -Controls the maximum request body size. If this is a number, then the value -specifies the number of bytes; if it is a string, the value is passed to the -[bytes](https://www.npmjs.com/package/bytes) library for parsing. Defaults -to `'100kb'`. - -##### type - -The `type` option is used to determine what media type the middleware will -parse. This option can be a string, array of strings, or a function. -If not a function, `type` option is passed directly to the -[type-is](https://www.npmjs.org/package/type-is#readme) library and this -can be an extension name (like `bin`), a mime type (like -`application/octet-stream`), or a mime type with a wildcard (like `*/*` or -`application/*`). If a function, the `type` option is called as `fn(req)` -and the request is parsed if it returns a truthy value. Defaults to -`application/octet-stream`. - -##### verify - -The `verify` option, if supplied, is called as `verify(req, res, buf, encoding)`, -where `buf` is a `Buffer` of the raw request body and `encoding` is the -encoding of the request. The parsing can be aborted by throwing an error. - -### bodyParser.text([options]) - -Returns middleware that parses all bodies as a string and only looks at -requests where the `Content-Type` header matches the `type` option. This -parser supports automatic inflation of `gzip` and `deflate` encodings. - -A new `body` string containing the parsed data is populated on the `request` -object after the middleware (i.e. `req.body`). This will be a string of the -body. - -#### Options - -The `text` function takes an optional `options` object that may contain any of -the following keys: - -##### defaultCharset - -Specify the default character set for the text content if the charset is not -specified in the `Content-Type` header of the request. Defaults to `utf-8`. - -##### inflate - -When set to `true`, then deflated (compressed) bodies will be inflated; when -`false`, deflated bodies are rejected. Defaults to `true`. - -##### limit - -Controls the maximum request body size. If this is a number, then the value -specifies the number of bytes; if it is a string, the value is passed to the -[bytes](https://www.npmjs.com/package/bytes) library for parsing. Defaults -to `'100kb'`. - -##### type - -The `type` option is used to determine what media type the middleware will -parse. This option can be a string, array of strings, or a function. If not -a function, `type` option is passed directly to the -[type-is](https://www.npmjs.org/package/type-is#readme) library and this can -be an extension name (like `txt`), a mime type (like `text/plain`), or a mime -type with a wildcard (like `*/*` or `text/*`). If a function, the `type` -option is called as `fn(req)` and the request is parsed if it returns a -truthy value. Defaults to `text/plain`. - -##### verify - -The `verify` option, if supplied, is called as `verify(req, res, buf, encoding)`, -where `buf` is a `Buffer` of the raw request body and `encoding` is the -encoding of the request. The parsing can be aborted by throwing an error. - -### bodyParser.urlencoded([options]) - -Returns middleware that only parses `urlencoded` bodies and only looks at -requests where the `Content-Type` header matches the `type` option. This -parser accepts only UTF-8 encoding of the body and supports automatic -inflation of `gzip` and `deflate` encodings. - -A new `body` object containing the parsed data is populated on the `request` -object after the middleware (i.e. `req.body`). This object will contain -key-value pairs, where the value can be a string or array (when `extended` is -`false`), or any type (when `extended` is `true`). - -#### Options - -The `urlencoded` function takes an optional `options` object that may contain -any of the following keys: - -##### extended - -The `extended` option allows to choose between parsing the URL-encoded data -with the `querystring` library (when `false`) or the `qs` library (when -`true`). The "extended" syntax allows for rich objects and arrays to be -encoded into the URL-encoded format, allowing for a JSON-like experience -with URL-encoded. For more information, please -[see the qs library](https://www.npmjs.org/package/qs#readme). - -Defaults to `true`, but using the default has been deprecated. Please -research into the difference between `qs` and `querystring` and choose the -appropriate setting. - -##### inflate - -When set to `true`, then deflated (compressed) bodies will be inflated; when -`false`, deflated bodies are rejected. Defaults to `true`. - -##### limit - -Controls the maximum request body size. If this is a number, then the value -specifies the number of bytes; if it is a string, the value is passed to the -[bytes](https://www.npmjs.com/package/bytes) library for parsing. Defaults -to `'100kb'`. - -##### parameterLimit - -The `parameterLimit` option controls the maximum number of parameters that -are allowed in the URL-encoded data. If a request contains more parameters -than this value, a 413 will be returned to the client. Defaults to `1000`. - -##### type - -The `type` option is used to determine what media type the middleware will -parse. This option can be a string, array of strings, or a function. If not -a function, `type` option is passed directly to the -[type-is](https://www.npmjs.org/package/type-is#readme) library and this can -be an extension name (like `urlencoded`), a mime type (like -`application/x-www-form-urlencoded`), or a mime type with a wildcard (like -`*/x-www-form-urlencoded`). If a function, the `type` option is called as -`fn(req)` and the request is parsed if it returns a truthy value. Defaults -to `application/x-www-form-urlencoded`. - -##### verify - -The `verify` option, if supplied, is called as `verify(req, res, buf, encoding)`, -where `buf` is a `Buffer` of the raw request body and `encoding` is the -encoding of the request. The parsing can be aborted by throwing an error. - -#### depth - -The `depth` option is used to configure the maximum depth of the `qs` library when `extended` is `true`. This allows you to limit the amount of keys that are parsed and can be useful to prevent certain types of abuse. Defaults to `32`. It is recommended to keep this value as low as possible. - -## Errors - -The middlewares provided by this module create errors using the -[`http-errors` module](https://www.npmjs.com/package/http-errors). The errors -will typically have a `status`/`statusCode` property that contains the suggested -HTTP response code, an `expose` property to determine if the `message` property -should be displayed to the client, a `type` property to determine the type of -error without matching against the `message`, and a `body` property containing -the read body, if available. - -The following are the common errors created, though any error can come through -for various reasons. - -### content encoding unsupported - -This error will occur when the request had a `Content-Encoding` header that -contained an encoding but the "inflation" option was set to `false`. The -`status` property is set to `415`, the `type` property is set to -`'encoding.unsupported'`, and the `charset` property will be set to the -encoding that is unsupported. - -### entity parse failed - -This error will occur when the request contained an entity that could not be -parsed by the middleware. The `status` property is set to `400`, the `type` -property is set to `'entity.parse.failed'`, and the `body` property is set to -the entity value that failed parsing. - -### entity verify failed - -This error will occur when the request contained an entity that could not be -failed verification by the defined `verify` option. The `status` property is -set to `403`, the `type` property is set to `'entity.verify.failed'`, and the -`body` property is set to the entity value that failed verification. - -### request aborted - -This error will occur when the request is aborted by the client before reading -the body has finished. The `received` property will be set to the number of -bytes received before the request was aborted and the `expected` property is -set to the number of expected bytes. The `status` property is set to `400` -and `type` property is set to `'request.aborted'`. - -### request entity too large - -This error will occur when the request body's size is larger than the "limit" -option. The `limit` property will be set to the byte limit and the `length` -property will be set to the request body's length. The `status` property is -set to `413` and the `type` property is set to `'entity.too.large'`. - -### request size did not match content length - -This error will occur when the request's length did not match the length from -the `Content-Length` header. This typically occurs when the request is malformed, -typically when the `Content-Length` header was calculated based on characters -instead of bytes. The `status` property is set to `400` and the `type` property -is set to `'request.size.invalid'`. - -### stream encoding should not be set - -This error will occur when something called the `req.setEncoding` method prior -to this middleware. This module operates directly on bytes only and you cannot -call `req.setEncoding` when using this module. The `status` property is set to -`500` and the `type` property is set to `'stream.encoding.set'`. - -### stream is not readable - -This error will occur when the request is no longer readable when this middleware -attempts to read it. This typically means something other than a middleware from -this module read the request body already and the middleware was also configured to -read the same request. The `status` property is set to `500` and the `type` -property is set to `'stream.not.readable'`. - -### too many parameters - -This error will occur when the content of the request exceeds the configured -`parameterLimit` for the `urlencoded` parser. The `status` property is set to -`413` and the `type` property is set to `'parameters.too.many'`. - -### unsupported charset "BOGUS" - -This error will occur when the request had a charset parameter in the -`Content-Type` header, but the `iconv-lite` module does not support it OR the -parser does not support it. The charset is contained in the message as well -as in the `charset` property. The `status` property is set to `415`, the -`type` property is set to `'charset.unsupported'`, and the `charset` property -is set to the charset that is unsupported. - -### unsupported content encoding "bogus" - -This error will occur when the request had a `Content-Encoding` header that -contained an unsupported encoding. The encoding is contained in the message -as well as in the `encoding` property. The `status` property is set to `415`, -the `type` property is set to `'encoding.unsupported'`, and the `encoding` -property is set to the encoding that is unsupported. - -### The input exceeded the depth - -This error occurs when using `bodyParser.urlencoded` with the `extended` property set to `true` and the input exceeds the configured `depth` option. The `status` property is set to `400`. It is recommended to review the `depth` option and evaluate if it requires a higher value. When the `depth` option is set to `32` (default value), the error will not be thrown. - -## Examples - -### Express/Connect top-level generic - -This example demonstrates adding a generic JSON and URL-encoded parser as a -top-level middleware, which will parse the bodies of all incoming requests. -This is the simplest setup. - -```js -var express = require('express') -var bodyParser = require('body-parser') - -var app = express() - -// parse application/x-www-form-urlencoded -app.use(bodyParser.urlencoded({ extended: false })) - -// parse application/json -app.use(bodyParser.json()) - -app.use(function (req, res) { - res.setHeader('Content-Type', 'text/plain') - res.write('you posted:\n') - res.end(JSON.stringify(req.body, null, 2)) -}) -``` - -### Express route-specific - -This example demonstrates adding body parsers specifically to the routes that -need them. In general, this is the most recommended way to use body-parser with -Express. - -```js -var express = require('express') -var bodyParser = require('body-parser') - -var app = express() - -// create application/json parser -var jsonParser = bodyParser.json() - -// create application/x-www-form-urlencoded parser -var urlencodedParser = bodyParser.urlencoded({ extended: false }) - -// POST /login gets urlencoded bodies -app.post('/login', urlencodedParser, function (req, res) { - res.send('welcome, ' + req.body.username) -}) - -// POST /api/users gets JSON bodies -app.post('/api/users', jsonParser, function (req, res) { - // create user in req.body -}) -``` - -### Change accepted type for parsers - -All the parsers accept a `type` option which allows you to change the -`Content-Type` that the middleware will parse. - -```js -var express = require('express') -var bodyParser = require('body-parser') - -var app = express() - -// parse various different custom JSON types as JSON -app.use(bodyParser.json({ type: 'application/*+json' })) - -// parse some custom thing into a Buffer -app.use(bodyParser.raw({ type: 'application/vnd.custom-type' })) - -// parse an HTML body into a string -app.use(bodyParser.text({ type: 'text/html' })) -``` - -## License - -[MIT](LICENSE) - -[ci-image]: https://badgen.net/github/checks/expressjs/body-parser/master?label=ci -[ci-url]: https://github.com/expressjs/body-parser/actions/workflows/ci.yml -[coveralls-image]: https://badgen.net/coveralls/c/github/expressjs/body-parser/master -[coveralls-url]: https://coveralls.io/r/expressjs/body-parser?branch=master -[node-version-image]: https://badgen.net/npm/node/body-parser -[node-version-url]: https://nodejs.org/en/download -[npm-downloads-image]: https://badgen.net/npm/dm/body-parser -[npm-url]: https://npmjs.org/package/body-parser -[npm-version-image]: https://badgen.net/npm/v/body-parser -[ossf-scorecard-badge]: https://api.scorecard.dev/projects/github.com/expressjs/body-parser/badge -[ossf-scorecard-visualizer]: https://ossf.github.io/scorecard-visualizer/#/projects/github.com/expressjs/body-parser \ No newline at end of file diff --git a/server/node_modules/body-parser/index.js b/server/node_modules/body-parser/index.js deleted file mode 100644 index bb24d73..0000000 --- a/server/node_modules/body-parser/index.js +++ /dev/null @@ -1,156 +0,0 @@ -/*! - * body-parser - * Copyright(c) 2014-2015 Douglas Christopher Wilson - * MIT Licensed - */ - -'use strict' - -/** - * Module dependencies. - * @private - */ - -var deprecate = require('depd')('body-parser') - -/** - * Cache of loaded parsers. - * @private - */ - -var parsers = Object.create(null) - -/** - * @typedef Parsers - * @type {function} - * @property {function} json - * @property {function} raw - * @property {function} text - * @property {function} urlencoded - */ - -/** - * Module exports. - * @type {Parsers} - */ - -exports = module.exports = deprecate.function(bodyParser, - 'bodyParser: use individual json/urlencoded middlewares') - -/** - * JSON parser. - * @public - */ - -Object.defineProperty(exports, 'json', { - configurable: true, - enumerable: true, - get: createParserGetter('json') -}) - -/** - * Raw parser. - * @public - */ - -Object.defineProperty(exports, 'raw', { - configurable: true, - enumerable: true, - get: createParserGetter('raw') -}) - -/** - * Text parser. - * @public - */ - -Object.defineProperty(exports, 'text', { - configurable: true, - enumerable: true, - get: createParserGetter('text') -}) - -/** - * URL-encoded parser. - * @public - */ - -Object.defineProperty(exports, 'urlencoded', { - configurable: true, - enumerable: true, - get: createParserGetter('urlencoded') -}) - -/** - * Create a middleware to parse json and urlencoded bodies. - * - * @param {object} [options] - * @return {function} - * @deprecated - * @public - */ - -function bodyParser (options) { - // use default type for parsers - var opts = Object.create(options || null, { - type: { - configurable: true, - enumerable: true, - value: undefined, - writable: true - } - }) - - var _urlencoded = exports.urlencoded(opts) - var _json = exports.json(opts) - - return function bodyParser (req, res, next) { - _json(req, res, function (err) { - if (err) return next(err) - _urlencoded(req, res, next) - }) - } -} - -/** - * Create a getter for loading a parser. - * @private - */ - -function createParserGetter (name) { - return function get () { - return loadParser(name) - } -} - -/** - * Load a parser module. - * @private - */ - -function loadParser (parserName) { - var parser = parsers[parserName] - - if (parser !== undefined) { - return parser - } - - // this uses a switch for static require analysis - switch (parserName) { - case 'json': - parser = require('./lib/types/json') - break - case 'raw': - parser = require('./lib/types/raw') - break - case 'text': - parser = require('./lib/types/text') - break - case 'urlencoded': - parser = require('./lib/types/urlencoded') - break - } - - // store to prevent invoking require() - return (parsers[parserName] = parser) -} diff --git a/server/node_modules/body-parser/lib/read.js b/server/node_modules/body-parser/lib/read.js deleted file mode 100644 index fce6283..0000000 --- a/server/node_modules/body-parser/lib/read.js +++ /dev/null @@ -1,205 +0,0 @@ -/*! - * body-parser - * Copyright(c) 2014-2015 Douglas Christopher Wilson - * MIT Licensed - */ - -'use strict' - -/** - * Module dependencies. - * @private - */ - -var createError = require('http-errors') -var destroy = require('destroy') -var getBody = require('raw-body') -var iconv = require('iconv-lite') -var onFinished = require('on-finished') -var unpipe = require('unpipe') -var zlib = require('zlib') - -/** - * Module exports. - */ - -module.exports = read - -/** - * Read a request into a buffer and parse. - * - * @param {object} req - * @param {object} res - * @param {function} next - * @param {function} parse - * @param {function} debug - * @param {object} options - * @private - */ - -function read (req, res, next, parse, debug, options) { - var length - var opts = options - var stream - - // flag as parsed - req._body = true - - // read options - var encoding = opts.encoding !== null - ? opts.encoding - : null - var verify = opts.verify - - try { - // get the content stream - stream = contentstream(req, debug, opts.inflate) - length = stream.length - stream.length = undefined - } catch (err) { - return next(err) - } - - // set raw-body options - opts.length = length - opts.encoding = verify - ? null - : encoding - - // assert charset is supported - if (opts.encoding === null && encoding !== null && !iconv.encodingExists(encoding)) { - return next(createError(415, 'unsupported charset "' + encoding.toUpperCase() + '"', { - charset: encoding.toLowerCase(), - type: 'charset.unsupported' - })) - } - - // read body - debug('read body') - getBody(stream, opts, function (error, body) { - if (error) { - var _error - - if (error.type === 'encoding.unsupported') { - // echo back charset - _error = createError(415, 'unsupported charset "' + encoding.toUpperCase() + '"', { - charset: encoding.toLowerCase(), - type: 'charset.unsupported' - }) - } else { - // set status code on error - _error = createError(400, error) - } - - // unpipe from stream and destroy - if (stream !== req) { - unpipe(req) - destroy(stream, true) - } - - // read off entire request - dump(req, function onfinished () { - next(createError(400, _error)) - }) - return - } - - // verify - if (verify) { - try { - debug('verify body') - verify(req, res, body, encoding) - } catch (err) { - next(createError(403, err, { - body: body, - type: err.type || 'entity.verify.failed' - })) - return - } - } - - // parse - var str = body - try { - debug('parse body') - str = typeof body !== 'string' && encoding !== null - ? iconv.decode(body, encoding) - : body - req.body = parse(str) - } catch (err) { - next(createError(400, err, { - body: str, - type: err.type || 'entity.parse.failed' - })) - return - } - - next() - }) -} - -/** - * Get the content stream of the request. - * - * @param {object} req - * @param {function} debug - * @param {boolean} [inflate=true] - * @return {object} - * @api private - */ - -function contentstream (req, debug, inflate) { - var encoding = (req.headers['content-encoding'] || 'identity').toLowerCase() - var length = req.headers['content-length'] - var stream - - debug('content-encoding "%s"', encoding) - - if (inflate === false && encoding !== 'identity') { - throw createError(415, 'content encoding unsupported', { - encoding: encoding, - type: 'encoding.unsupported' - }) - } - - switch (encoding) { - case 'deflate': - stream = zlib.createInflate() - debug('inflate body') - req.pipe(stream) - break - case 'gzip': - stream = zlib.createGunzip() - debug('gunzip body') - req.pipe(stream) - break - case 'identity': - stream = req - stream.length = length - break - default: - throw createError(415, 'unsupported content encoding "' + encoding + '"', { - encoding: encoding, - type: 'encoding.unsupported' - }) - } - - return stream -} - -/** - * Dump the contents of a request. - * - * @param {object} req - * @param {function} callback - * @api private - */ - -function dump (req, callback) { - if (onFinished.isFinished(req)) { - callback(null) - } else { - onFinished(req, callback) - req.resume() - } -} diff --git a/server/node_modules/body-parser/lib/types/json.js b/server/node_modules/body-parser/lib/types/json.js deleted file mode 100644 index f180243..0000000 --- a/server/node_modules/body-parser/lib/types/json.js +++ /dev/null @@ -1,247 +0,0 @@ -/*! - * body-parser - * Copyright(c) 2014 Jonathan Ong - * Copyright(c) 2014-2015 Douglas Christopher Wilson - * MIT Licensed - */ - -'use strict' - -/** - * Module dependencies. - * @private - */ - -var bytes = require('bytes') -var contentType = require('content-type') -var createError = require('http-errors') -var debug = require('debug')('body-parser:json') -var read = require('../read') -var typeis = require('type-is') - -/** - * Module exports. - */ - -module.exports = json - -/** - * RegExp to match the first non-space in a string. - * - * Allowed whitespace is defined in RFC 7159: - * - * ws = *( - * %x20 / ; Space - * %x09 / ; Horizontal tab - * %x0A / ; Line feed or New line - * %x0D ) ; Carriage return - */ - -var FIRST_CHAR_REGEXP = /^[\x20\x09\x0a\x0d]*([^\x20\x09\x0a\x0d])/ // eslint-disable-line no-control-regex - -var JSON_SYNTAX_CHAR = '#' -var JSON_SYNTAX_REGEXP = /#+/g - -/** - * Create a middleware to parse JSON bodies. - * - * @param {object} [options] - * @return {function} - * @public - */ - -function json (options) { - var opts = options || {} - - var limit = typeof opts.limit === 'undefined' || opts.limit === null - ? 102400 // 100kb default - : bytes.parse(opts.limit) - var inflate = opts.inflate !== false - var reviver = opts.reviver - var strict = opts.strict !== false - var type = opts.type || 'application/json' - var verify = opts.verify || false - - if (limit === null) { - throw new TypeError('option limit "' + String(opts.limit) + '" is invalid') - } - - if (verify !== false && typeof verify !== 'function') { - throw new TypeError('option verify must be function') - } - - // create the appropriate type checking function - var shouldParse = typeof type !== 'function' - ? typeChecker(type) - : type - - function parse (body) { - if (body.length === 0) { - // special-case empty json body, as it's a common client-side mistake - // TODO: maybe make this configurable or part of "strict" option - return {} - } - - if (strict) { - var first = firstchar(body) - - if (first !== '{' && first !== '[') { - debug('strict violation') - throw createStrictSyntaxError(body, first) - } - } - - try { - debug('parse json') - return JSON.parse(body, reviver) - } catch (e) { - throw normalizeJsonSyntaxError(e, { - message: e.message, - stack: e.stack - }) - } - } - - return function jsonParser (req, res, next) { - if (req._body) { - debug('body already parsed') - next() - return - } - - req.body = req.body || {} - - // skip requests without bodies - if (!typeis.hasBody(req)) { - debug('skip empty body') - next() - return - } - - debug('content-type %j', req.headers['content-type']) - - // determine if request should be parsed - if (!shouldParse(req)) { - debug('skip parsing') - next() - return - } - - // assert charset per RFC 7159 sec 8.1 - var charset = getCharset(req) || 'utf-8' - if (charset.slice(0, 4) !== 'utf-') { - debug('invalid charset') - next(createError(415, 'unsupported charset "' + charset.toUpperCase() + '"', { - charset: charset, - type: 'charset.unsupported' - })) - return - } - - // read - read(req, res, next, parse, debug, { - encoding: charset, - inflate: inflate, - limit: limit, - verify: verify - }) - } -} - -/** - * Create strict violation syntax error matching native error. - * - * @param {string} str - * @param {string} char - * @return {Error} - * @private - */ - -function createStrictSyntaxError (str, char) { - var index = str.indexOf(char) - var partial = '' - - if (index !== -1) { - partial = str.substring(0, index) + new Array(str.length - index + 1).join(JSON_SYNTAX_CHAR) - } - - try { - JSON.parse(partial); /* istanbul ignore next */ throw new SyntaxError('strict violation') - } catch (e) { - return normalizeJsonSyntaxError(e, { - message: e.message.replace(JSON_SYNTAX_REGEXP, function (placeholder) { - return str.substring(index, index + placeholder.length) - }), - stack: e.stack - }) - } -} - -/** - * Get the first non-whitespace character in a string. - * - * @param {string} str - * @return {function} - * @private - */ - -function firstchar (str) { - var match = FIRST_CHAR_REGEXP.exec(str) - - return match - ? match[1] - : undefined -} - -/** - * Get the charset of a request. - * - * @param {object} req - * @api private - */ - -function getCharset (req) { - try { - return (contentType.parse(req).parameters.charset || '').toLowerCase() - } catch (e) { - return undefined - } -} - -/** - * Normalize a SyntaxError for JSON.parse. - * - * @param {SyntaxError} error - * @param {object} obj - * @return {SyntaxError} - */ - -function normalizeJsonSyntaxError (error, obj) { - var keys = Object.getOwnPropertyNames(error) - - for (var i = 0; i < keys.length; i++) { - var key = keys[i] - if (key !== 'stack' && key !== 'message') { - delete error[key] - } - } - - // replace stack before message for Node.js 0.10 and below - error.stack = obj.stack.replace(error.message, obj.message) - error.message = obj.message - - return error -} - -/** - * Get the simple type checker. - * - * @param {string} type - * @return {function} - */ - -function typeChecker (type) { - return function checkType (req) { - return Boolean(typeis(req, type)) - } -} diff --git a/server/node_modules/body-parser/lib/types/raw.js b/server/node_modules/body-parser/lib/types/raw.js deleted file mode 100644 index 2b3e06d..0000000 --- a/server/node_modules/body-parser/lib/types/raw.js +++ /dev/null @@ -1,105 +0,0 @@ -/*! - * body-parser - * Copyright(c) 2014-2015 Douglas Christopher Wilson - * MIT Licensed - */ - -'use strict' - -/** - * Module dependencies. - */ - -var bytes = require('bytes') -var debug = require('debug')('body-parser:raw') -var read = require('../read') -var typeis = require('type-is') - -/** - * Module exports. - */ - -module.exports = raw - -/** - * Create a middleware to parse raw bodies. - * - * @param {object} [options] - * @return {function} - * @api public - */ - -function raw (options) { - var opts = options || {} - - var inflate = opts.inflate !== false - var limit = typeof opts.limit === 'undefined' || opts.limit === null - ? 102400 // 100kb default - : bytes.parse(opts.limit) - var type = opts.type || 'application/octet-stream' - var verify = opts.verify || false - - if (limit === null) { - throw new TypeError('option limit "' + String(opts.limit) + '" is invalid') - } - - if (verify !== false && typeof verify !== 'function') { - throw new TypeError('option verify must be function') - } - - // create the appropriate type checking function - var shouldParse = typeof type !== 'function' - ? typeChecker(type) - : type - - function parse (buf) { - return buf - } - - return function rawParser (req, res, next) { - if (req._body) { - debug('body already parsed') - next() - return - } - - req.body = req.body || {} - - // skip requests without bodies - if (!typeis.hasBody(req)) { - debug('skip empty body') - next() - return - } - - debug('content-type %j', req.headers['content-type']) - - // determine if request should be parsed - if (!shouldParse(req)) { - debug('skip parsing') - next() - return - } - - // read - read(req, res, next, parse, debug, { - encoding: null, - inflate: inflate, - limit: limit, - verify: verify - }) - } -} - -/** - * Get the simple type checker. - * - * @param {string} type - * @return {function} - */ - -function typeChecker (type) { - return function checkType (req) { - return Boolean(typeis(req, type)) - } -} diff --git a/server/node_modules/body-parser/lib/types/text.js b/server/node_modules/body-parser/lib/types/text.js deleted file mode 100644 index 5247a92..0000000 --- a/server/node_modules/body-parser/lib/types/text.js +++ /dev/null @@ -1,125 +0,0 @@ -/*! - * body-parser - * Copyright(c) 2014-2015 Douglas Christopher Wilson - * MIT Licensed - */ - -'use strict' - -/** - * Module dependencies. - */ - -var bytes = require('bytes') -var contentType = require('content-type') -var debug = require('debug')('body-parser:text') -var read = require('../read') -var typeis = require('type-is') - -/** - * Module exports. - */ - -module.exports = text - -/** - * Create a middleware to parse text bodies. - * - * @param {object} [options] - * @return {function} - * @api public - */ - -function text (options) { - var opts = options || {} - - var defaultCharset = opts.defaultCharset || 'utf-8' - var inflate = opts.inflate !== false - var limit = typeof opts.limit === 'undefined' || opts.limit === null - ? 102400 // 100kb default - : bytes.parse(opts.limit) - var type = opts.type || 'text/plain' - var verify = opts.verify || false - - if (limit === null) { - throw new TypeError('option limit "' + String(opts.limit) + '" is invalid') - } - - if (verify !== false && typeof verify !== 'function') { - throw new TypeError('option verify must be function') - } - - // create the appropriate type checking function - var shouldParse = typeof type !== 'function' - ? typeChecker(type) - : type - - function parse (buf) { - return buf - } - - return function textParser (req, res, next) { - if (req._body) { - debug('body already parsed') - next() - return - } - - req.body = req.body || {} - - // skip requests without bodies - if (!typeis.hasBody(req)) { - debug('skip empty body') - next() - return - } - - debug('content-type %j', req.headers['content-type']) - - // determine if request should be parsed - if (!shouldParse(req)) { - debug('skip parsing') - next() - return - } - - // get charset - var charset = getCharset(req) || defaultCharset - - // read - read(req, res, next, parse, debug, { - encoding: charset, - inflate: inflate, - limit: limit, - verify: verify - }) - } -} - -/** - * Get the charset of a request. - * - * @param {object} req - * @api private - */ - -function getCharset (req) { - try { - return (contentType.parse(req).parameters.charset || '').toLowerCase() - } catch (e) { - return undefined - } -} - -/** - * Get the simple type checker. - * - * @param {string} type - * @return {function} - */ - -function typeChecker (type) { - return function checkType (req) { - return Boolean(typeis(req, type)) - } -} diff --git a/server/node_modules/body-parser/lib/types/urlencoded.js b/server/node_modules/body-parser/lib/types/urlencoded.js deleted file mode 100644 index 52ebe5f..0000000 --- a/server/node_modules/body-parser/lib/types/urlencoded.js +++ /dev/null @@ -1,303 +0,0 @@ -/*! - * body-parser - * Copyright(c) 2014 Jonathan Ong - * Copyright(c) 2014-2015 Douglas Christopher Wilson - * MIT Licensed - */ - -'use strict' - -/** - * Module dependencies. - * @private - */ - -var bytes = require('bytes') -var contentType = require('content-type') -var createError = require('http-errors') -var debug = require('debug')('body-parser:urlencoded') -var deprecate = require('depd')('body-parser') -var read = require('../read') -var typeis = require('type-is') - -/** - * Module exports. - */ - -module.exports = urlencoded - -/** - * Cache of parser modules. - */ - -var parsers = Object.create(null) - -/** - * Create a middleware to parse urlencoded bodies. - * - * @param {object} [options] - * @return {function} - * @public - */ - -function urlencoded (options) { - var opts = options || {} - - // notice because option default will flip in next major - if (opts.extended === undefined) { - deprecate('undefined extended: provide extended option') - } - - var extended = opts.extended !== false - var inflate = opts.inflate !== false - var limit = typeof opts.limit === 'undefined' || opts.limit === null - ? 102400 // 100kb default - : bytes.parse(opts.limit) - var type = opts.type || 'application/x-www-form-urlencoded' - var verify = opts.verify || false - - if (limit === null) { - throw new TypeError('option limit "' + String(opts.limit) + '" is invalid') - } - - if (verify !== false && typeof verify !== 'function') { - throw new TypeError('option verify must be function') - } - - // create the appropriate query parser - var queryparse = extended - ? extendedparser(opts) - : simpleparser(opts) - - // create the appropriate type checking function - var shouldParse = typeof type !== 'function' - ? typeChecker(type) - : type - - function parse (body) { - return body.length - ? queryparse(body) - : {} - } - - return function urlencodedParser (req, res, next) { - if (req._body) { - debug('body already parsed') - next() - return - } - - req.body = req.body || {} - - // skip requests without bodies - if (!typeis.hasBody(req)) { - debug('skip empty body') - next() - return - } - - debug('content-type %j', req.headers['content-type']) - - // determine if request should be parsed - if (!shouldParse(req)) { - debug('skip parsing') - next() - return - } - - // assert charset - var charset = getCharset(req) || 'utf-8' - if (charset !== 'utf-8') { - debug('invalid charset') - next(createError(415, 'unsupported charset "' + charset.toUpperCase() + '"', { - charset: charset, - type: 'charset.unsupported' - })) - return - } - - // read - read(req, res, next, parse, debug, { - debug: debug, - encoding: charset, - inflate: inflate, - limit: limit, - verify: verify - }) - } -} - -/** - * Get the extended query parser. - * - * @param {object} options - */ - -function extendedparser (options) { - var parameterLimit = options.parameterLimit !== undefined - ? options.parameterLimit - : 1000 - var depth = options.depth !== undefined ? options.depth : 32 - var parse = parser('qs') - - if (isNaN(parameterLimit) || parameterLimit < 1) { - throw new TypeError('option parameterLimit must be a positive number') - } - - if (isNaN(depth) || depth < 0) { - throw new TypeError('option depth must be a zero or a positive number') - } - - if (isFinite(parameterLimit)) { - parameterLimit = parameterLimit | 0 - } - - return function queryparse (body) { - var paramCount = parameterCount(body, parameterLimit) - - if (paramCount === undefined) { - debug('too many parameters') - throw createError(413, 'too many parameters', { - type: 'parameters.too.many' - }) - } - - var arrayLimit = Math.max(100, paramCount) - - debug('parse extended urlencoding') - try { - return parse(body, { - allowPrototypes: true, - arrayLimit: arrayLimit, - depth: depth, - strictDepth: true, - parameterLimit: parameterLimit - }) - } catch (err) { - if (err instanceof RangeError) { - throw createError(400, 'The input exceeded the depth', { - type: 'querystring.parse.rangeError' - }) - } else { - throw err - } - } - } -} - -/** - * Get the charset of a request. - * - * @param {object} req - * @api private - */ - -function getCharset (req) { - try { - return (contentType.parse(req).parameters.charset || '').toLowerCase() - } catch (e) { - return undefined - } -} - -/** - * Count the number of parameters, stopping once limit reached - * - * @param {string} body - * @param {number} limit - * @api private - */ - -function parameterCount (body, limit) { - var count = 0 - var index = -1 - - do { - count++ - if (count > limit) { - return undefined - } - index = body.indexOf('&', index + 1) - } while (index !== -1) - - return count -} - -/** - * Get parser for module name dynamically. - * - * @param {string} name - * @return {function} - * @api private - */ - -function parser (name) { - var mod = parsers[name] - - if (mod !== undefined) { - return mod.parse - } - - // this uses a switch for static require analysis - switch (name) { - case 'qs': - mod = require('qs') - break - case 'querystring': - mod = require('querystring') - break - } - - // store to prevent invoking require() - parsers[name] = mod - - return mod.parse -} - -/** - * Get the simple query parser. - * - * @param {object} options - */ - -function simpleparser (options) { - var parameterLimit = options.parameterLimit !== undefined - ? options.parameterLimit - : 1000 - var parse = parser('querystring') - - if (isNaN(parameterLimit) || parameterLimit < 1) { - throw new TypeError('option parameterLimit must be a positive number') - } - - if (isFinite(parameterLimit)) { - parameterLimit = parameterLimit | 0 - } - - return function queryparse (body) { - var paramCount = parameterCount(body, parameterLimit) - - if (paramCount === undefined) { - debug('too many parameters') - throw createError(413, 'too many parameters', { - type: 'parameters.too.many' - }) - } - - debug('parse urlencoding') - return parse(body, undefined, undefined, { maxKeys: parameterLimit }) - } -} - -/** - * Get the simple type checker. - * - * @param {string} type - * @return {function} - */ - -function typeChecker (type) { - return function checkType (req) { - return Boolean(typeis(req, type)) - } -} diff --git a/server/node_modules/body-parser/package.json b/server/node_modules/body-parser/package.json deleted file mode 100644 index 211c799..0000000 --- a/server/node_modules/body-parser/package.json +++ /dev/null @@ -1,55 +0,0 @@ -{ - "name": "body-parser", - "description": "Node.js body parsing middleware", - "version": "1.20.6", - "contributors": [ - "Douglas Christopher Wilson ", - "Jonathan Ong (http://jongleberry.com)" - ], - "license": "MIT", - "repository": "expressjs/body-parser", - "dependencies": { - "bytes": "~3.1.2", - "content-type": "~1.0.5", - "debug": "2.6.9", - "depd": "2.0.0", - "destroy": "~1.2.0", - "http-errors": "~2.0.1", - "iconv-lite": "~0.4.24", - "on-finished": "~2.4.1", - "qs": "~6.15.1", - "raw-body": "~2.5.3", - "type-is": "~1.6.18", - "unpipe": "~1.0.0" - }, - "devDependencies": { - "eslint": "8.34.0", - "eslint-config-standard": "14.1.1", - "eslint-plugin-import": "2.27.5", - "eslint-plugin-markdown": "3.0.0", - "eslint-plugin-node": "11.1.0", - "eslint-plugin-promise": "6.1.1", - "eslint-plugin-standard": "4.1.0", - "methods": "1.1.2", - "mocha": "10.2.0", - "nyc": "15.1.0", - "safe-buffer": "5.2.1", - "supertest": "6.3.3" - }, - "files": [ - "lib/", - "LICENSE", - "HISTORY.md", - "index.js" - ], - "engines": { - "node": ">= 0.8", - "npm": "1.2.8000 || >= 1.4.16" - }, - "scripts": { - "lint": "eslint .", - "test": "mocha --require test/support/env --reporter spec --check-leaks --bail test/", - "test-ci": "nyc --reporter=lcov --reporter=text npm test", - "test-cov": "nyc --reporter=html --reporter=text npm test" - } -} diff --git a/server/node_modules/buffer-from/LICENSE b/server/node_modules/buffer-from/LICENSE deleted file mode 100644 index e4bf1d6..0000000 --- a/server/node_modules/buffer-from/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -MIT License - -Copyright (c) 2016, 2018 Linus Unnebäck - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/server/node_modules/buffer-from/index.js b/server/node_modules/buffer-from/index.js deleted file mode 100644 index e1a58b5..0000000 --- a/server/node_modules/buffer-from/index.js +++ /dev/null @@ -1,72 +0,0 @@ -/* eslint-disable node/no-deprecated-api */ - -var toString = Object.prototype.toString - -var isModern = ( - typeof Buffer !== 'undefined' && - typeof Buffer.alloc === 'function' && - typeof Buffer.allocUnsafe === 'function' && - typeof Buffer.from === 'function' -) - -function isArrayBuffer (input) { - return toString.call(input).slice(8, -1) === 'ArrayBuffer' -} - -function fromArrayBuffer (obj, byteOffset, length) { - byteOffset >>>= 0 - - var maxLength = obj.byteLength - byteOffset - - if (maxLength < 0) { - throw new RangeError("'offset' is out of bounds") - } - - if (length === undefined) { - length = maxLength - } else { - length >>>= 0 - - if (length > maxLength) { - throw new RangeError("'length' is out of bounds") - } - } - - return isModern - ? Buffer.from(obj.slice(byteOffset, byteOffset + length)) - : new Buffer(new Uint8Array(obj.slice(byteOffset, byteOffset + length))) -} - -function fromString (string, encoding) { - if (typeof encoding !== 'string' || encoding === '') { - encoding = 'utf8' - } - - if (!Buffer.isEncoding(encoding)) { - throw new TypeError('"encoding" must be a valid string encoding') - } - - return isModern - ? Buffer.from(string, encoding) - : new Buffer(string, encoding) -} - -function bufferFrom (value, encodingOrOffset, length) { - if (typeof value === 'number') { - throw new TypeError('"value" argument must not be a number') - } - - if (isArrayBuffer(value)) { - return fromArrayBuffer(value, encodingOrOffset, length) - } - - if (typeof value === 'string') { - return fromString(value, encodingOrOffset) - } - - return isModern - ? Buffer.from(value) - : new Buffer(value) -} - -module.exports = bufferFrom diff --git a/server/node_modules/buffer-from/package.json b/server/node_modules/buffer-from/package.json deleted file mode 100644 index 6ac5327..0000000 --- a/server/node_modules/buffer-from/package.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "name": "buffer-from", - "version": "1.1.2", - "license": "MIT", - "repository": "LinusU/buffer-from", - "files": [ - "index.js" - ], - "scripts": { - "test": "standard && node test" - }, - "devDependencies": { - "standard": "^12.0.1" - }, - "keywords": [ - "buffer", - "buffer from" - ] -} diff --git a/server/node_modules/buffer-from/readme.md b/server/node_modules/buffer-from/readme.md deleted file mode 100644 index 9880a55..0000000 --- a/server/node_modules/buffer-from/readme.md +++ /dev/null @@ -1,69 +0,0 @@ -# Buffer From - -A [ponyfill](https://ponyfill.com) for `Buffer.from`, uses native implementation if available. - -## Installation - -```sh -npm install --save buffer-from -``` - -## Usage - -```js -const bufferFrom = require('buffer-from') - -console.log(bufferFrom([1, 2, 3, 4])) -//=> - -const arr = new Uint8Array([1, 2, 3, 4]) -console.log(bufferFrom(arr.buffer, 1, 2)) -//=> - -console.log(bufferFrom('test', 'utf8')) -//=> - -const buf = bufferFrom('test') -console.log(bufferFrom(buf)) -//=> -``` - -## API - -### bufferFrom(array) - -- `array` <Array> - -Allocates a new `Buffer` using an `array` of octets. - -### bufferFrom(arrayBuffer[, byteOffset[, length]]) - -- `arrayBuffer` <ArrayBuffer> The `.buffer` property of a TypedArray or ArrayBuffer -- `byteOffset` <Integer> Where to start copying from `arrayBuffer`. **Default:** `0` -- `length` <Integer> How many bytes to copy from `arrayBuffer`. **Default:** `arrayBuffer.length - byteOffset` - -When passed a reference to the `.buffer` property of a TypedArray instance, the -newly created `Buffer` will share the same allocated memory as the TypedArray. - -The optional `byteOffset` and `length` arguments specify a memory range within -the `arrayBuffer` that will be shared by the `Buffer`. - -### bufferFrom(buffer) - -- `buffer` <Buffer> An existing `Buffer` to copy data from - -Copies the passed `buffer` data onto a new `Buffer` instance. - -### bufferFrom(string[, encoding]) - -- `string` <String> A string to encode. -- `encoding` <String> The encoding of `string`. **Default:** `'utf8'` - -Creates a new `Buffer` containing the given JavaScript string `string`. If -provided, the `encoding` parameter identifies the character encoding of -`string`. - -## See also - -- [buffer-alloc](https://github.com/LinusU/buffer-alloc) A ponyfill for `Buffer.alloc` -- [buffer-alloc-unsafe](https://github.com/LinusU/buffer-alloc-unsafe) A ponyfill for `Buffer.allocUnsafe` diff --git a/server/node_modules/busboy/.eslintrc.js b/server/node_modules/busboy/.eslintrc.js deleted file mode 100644 index be9311d..0000000 --- a/server/node_modules/busboy/.eslintrc.js +++ /dev/null @@ -1,5 +0,0 @@ -'use strict'; - -module.exports = { - extends: '@mscdex/eslint-config', -}; diff --git a/server/node_modules/busboy/.github/workflows/ci.yml b/server/node_modules/busboy/.github/workflows/ci.yml deleted file mode 100644 index 799bae0..0000000 --- a/server/node_modules/busboy/.github/workflows/ci.yml +++ /dev/null @@ -1,24 +0,0 @@ -name: CI - -on: - pull_request: - push: - branches: [ master ] - -jobs: - tests-linux: - runs-on: ubuntu-latest - strategy: - fail-fast: false - matrix: - node-version: [10.16.0, 10.x, 12.x, 14.x, 16.x] - steps: - - uses: actions/checkout@v2 - - name: Use Node.js ${{ matrix.node-version }} - uses: actions/setup-node@v1 - with: - node-version: ${{ matrix.node-version }} - - name: Install module - run: npm install - - name: Run tests - run: npm test diff --git a/server/node_modules/busboy/.github/workflows/lint.yml b/server/node_modules/busboy/.github/workflows/lint.yml deleted file mode 100644 index 9f9e1f5..0000000 --- a/server/node_modules/busboy/.github/workflows/lint.yml +++ /dev/null @@ -1,23 +0,0 @@ -name: lint - -on: - pull_request: - push: - branches: [ master ] - -env: - NODE_VERSION: 16.x - -jobs: - lint-js: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - name: Use Node.js ${{ env.NODE_VERSION }} - uses: actions/setup-node@v1 - with: - node-version: ${{ env.NODE_VERSION }} - - name: Install ESLint + ESLint configs/plugins - run: npm install --only=dev - - name: Lint files - run: npm run lint diff --git a/server/node_modules/busboy/LICENSE b/server/node_modules/busboy/LICENSE deleted file mode 100644 index 290762e..0000000 --- a/server/node_modules/busboy/LICENSE +++ /dev/null @@ -1,19 +0,0 @@ -Copyright Brian White. All rights reserved. - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to -deal in the Software without restriction, including without limitation the -rights to use, copy, modify, merge, publish, distribute, sublicense, and/or -sell copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS -IN THE SOFTWARE. \ No newline at end of file diff --git a/server/node_modules/busboy/README.md b/server/node_modules/busboy/README.md deleted file mode 100644 index 654af30..0000000 --- a/server/node_modules/busboy/README.md +++ /dev/null @@ -1,191 +0,0 @@ -# Description - -A node.js module for parsing incoming HTML form data. - -Changes (breaking or otherwise) in v1.0.0 can be found [here](https://github.com/mscdex/busboy/issues/266). - -# Requirements - -* [node.js](http://nodejs.org/) -- v10.16.0 or newer - - -# Install - - npm install busboy - - -# Examples - -* Parsing (multipart) with default options: - -```js -const http = require('http'); - -const busboy = require('busboy'); - -http.createServer((req, res) => { - if (req.method === 'POST') { - console.log('POST request'); - const bb = busboy({ headers: req.headers }); - bb.on('file', (name, file, info) => { - const { filename, encoding, mimeType } = info; - console.log( - `File [${name}]: filename: %j, encoding: %j, mimeType: %j`, - filename, - encoding, - mimeType - ); - file.on('data', (data) => { - console.log(`File [${name}] got ${data.length} bytes`); - }).on('close', () => { - console.log(`File [${name}] done`); - }); - }); - bb.on('field', (name, val, info) => { - console.log(`Field [${name}]: value: %j`, val); - }); - bb.on('close', () => { - console.log('Done parsing form!'); - res.writeHead(303, { Connection: 'close', Location: '/' }); - res.end(); - }); - req.pipe(bb); - } else if (req.method === 'GET') { - res.writeHead(200, { Connection: 'close' }); - res.end(` - - - -

-
-
- -
- - - `); - } -}).listen(8000, () => { - console.log('Listening for requests'); -}); - -// Example output: -// -// Listening for requests -// < ... form submitted ... > -// POST request -// File [filefield]: filename: "logo.jpg", encoding: "binary", mime: "image/jpeg" -// File [filefield] got 11912 bytes -// Field [textfield]: value: "testing! :-)" -// File [filefield] done -// Done parsing form! -``` - -* Save all incoming files to disk: - -```js -const { randomFillSync } = require('crypto'); -const fs = require('fs'); -const http = require('http'); -const os = require('os'); -const path = require('path'); - -const busboy = require('busboy'); - -const random = (() => { - const buf = Buffer.alloc(16); - return () => randomFillSync(buf).toString('hex'); -})(); - -http.createServer((req, res) => { - if (req.method === 'POST') { - const bb = busboy({ headers: req.headers }); - bb.on('file', (name, file, info) => { - const saveTo = path.join(os.tmpdir(), `busboy-upload-${random()}`); - file.pipe(fs.createWriteStream(saveTo)); - }); - bb.on('close', () => { - res.writeHead(200, { 'Connection': 'close' }); - res.end(`That's all folks!`); - }); - req.pipe(bb); - return; - } - res.writeHead(404); - res.end(); -}).listen(8000, () => { - console.log('Listening for requests'); -}); -``` - - -# API - -## Exports - -`busboy` exports a single function: - -**( _function_ )**(< _object_ >config) - Creates and returns a new _Writable_ form parser stream. - -* Valid `config` properties: - - * **headers** - _object_ - These are the HTTP headers of the incoming request, which are used by individual parsers. - - * **highWaterMark** - _integer_ - highWaterMark to use for the parser stream. **Default:** node's _stream.Writable_ default. - - * **fileHwm** - _integer_ - highWaterMark to use for individual file streams. **Default:** node's _stream.Readable_ default. - - * **defCharset** - _string_ - Default character set to use when one isn't defined. **Default:** `'utf8'`. - - * **defParamCharset** - _string_ - For multipart forms, the default character set to use for values of part header parameters (e.g. filename) that are not extended parameters (that contain an explicit charset). **Default:** `'latin1'`. - - * **preservePath** - _boolean_ - If paths in filenames from file parts in a `'multipart/form-data'` request shall be preserved. **Default:** `false`. - - * **limits** - _object_ - Various limits on incoming data. Valid properties are: - - * **fieldNameSize** - _integer_ - Max field name size (in bytes). **Default:** `100`. - - * **fieldSize** - _integer_ - Max field value size (in bytes). **Default:** `1048576` (1MB). - - * **fields** - _integer_ - Max number of non-file fields. **Default:** `Infinity`. - - * **fileSize** - _integer_ - For multipart forms, the max file size (in bytes). **Default:** `Infinity`. - - * **files** - _integer_ - For multipart forms, the max number of file fields. **Default:** `Infinity`. - - * **parts** - _integer_ - For multipart forms, the max number of parts (fields + files). **Default:** `Infinity`. - - * **headerPairs** - _integer_ - For multipart forms, the max number of header key-value pairs to parse. **Default:** `2000` (same as node's http module). - -This function can throw exceptions if there is something wrong with the values in `config`. For example, if the Content-Type in `headers` is missing entirely, is not a supported type, or is missing the boundary for `'multipart/form-data'` requests. - -## (Special) Parser stream events - -* **file**(< _string_ >name, < _Readable_ >stream, < _object_ >info) - Emitted for each new file found. `name` contains the form field name. `stream` is a _Readable_ stream containing the file's data. No transformations/conversions (e.g. base64 to raw binary) are done on the file's data. `info` contains the following properties: - - * `filename` - _string_ - If supplied, this contains the file's filename. **WARNING:** You should almost _never_ use this value as-is (especially if you are using `preservePath: true` in your `config`) as it could contain malicious input. You are better off generating your own (safe) filenames, or at the very least using a hash of the filename. - - * `encoding` - _string_ - The file's `'Content-Transfer-Encoding'` value. - - * `mimeType` - _string_ - The file's `'Content-Type'` value. - - **Note:** If you listen for this event, you should always consume the `stream` whether you care about its contents or not (you can simply do `stream.resume();` if you want to discard/skip the contents), otherwise the `'finish'`/`'close'` event will never fire on the busboy parser stream. - However, if you aren't accepting files, you can either simply not listen for the `'file'` event at all or set `limits.files` to `0`, and any/all files will be automatically skipped (these skipped files will still count towards any configured `limits.files` and `limits.parts` limits though). - - **Note:** If a configured `limits.fileSize` limit was reached for a file, `stream` will both have a boolean property `truncated` set to `true` (best checked at the end of the stream) and emit a `'limit'` event to notify you when this happens. - -* **field**(< _string_ >name, < _string_ >value, < _object_ >info) - Emitted for each new non-file field found. `name` contains the form field name. `value` contains the string value of the field. `info` contains the following properties: - - * `nameTruncated` - _boolean_ - Whether `name` was truncated or not (due to a configured `limits.fieldNameSize` limit) - - * `valueTruncated` - _boolean_ - Whether `value` was truncated or not (due to a configured `limits.fieldSize` limit) - - * `encoding` - _string_ - The field's `'Content-Transfer-Encoding'` value. - - * `mimeType` - _string_ - The field's `'Content-Type'` value. - -* **partsLimit**() - Emitted when the configured `limits.parts` limit has been reached. No more `'file'` or `'field'` events will be emitted. - -* **filesLimit**() - Emitted when the configured `limits.files` limit has been reached. No more `'file'` events will be emitted. - -* **fieldsLimit**() - Emitted when the configured `limits.fields` limit has been reached. No more `'field'` events will be emitted. diff --git a/server/node_modules/busboy/bench/bench-multipart-fields-100mb-big.js b/server/node_modules/busboy/bench/bench-multipart-fields-100mb-big.js deleted file mode 100644 index ef15729..0000000 --- a/server/node_modules/busboy/bench/bench-multipart-fields-100mb-big.js +++ /dev/null @@ -1,149 +0,0 @@ -'use strict'; - -function createMultipartBuffers(boundary, sizes) { - const bufs = []; - for (let i = 0; i < sizes.length; ++i) { - const mb = sizes[i] * 1024 * 1024; - bufs.push(Buffer.from([ - `--${boundary}`, - `content-disposition: form-data; name="field${i + 1}"`, - '', - '0'.repeat(mb), - '', - ].join('\r\n'))); - } - bufs.push(Buffer.from([ - `--${boundary}--`, - '', - ].join('\r\n'))); - return bufs; -} - -const boundary = '-----------------------------168072824752491622650073'; -const buffers = createMultipartBuffers(boundary, [ - 10, - 10, - 10, - 20, - 50, -]); -const calls = { - partBegin: 0, - headerField: 0, - headerValue: 0, - headerEnd: 0, - headersEnd: 0, - partData: 0, - partEnd: 0, - end: 0, -}; - -const moduleName = process.argv[2]; -switch (moduleName) { - case 'busboy': { - const busboy = require('busboy'); - - const parser = busboy({ - limits: { - fieldSizeLimit: Infinity, - }, - headers: { - 'content-type': `multipart/form-data; boundary=${boundary}`, - }, - }); - parser.on('field', (name, val, info) => { - ++calls.partBegin; - ++calls.partData; - ++calls.partEnd; - }).on('close', () => { - ++calls.end; - console.timeEnd(moduleName); - }); - - console.time(moduleName); - for (const buf of buffers) - parser.write(buf); - break; - } - - case 'formidable': { - const { MultipartParser } = require('formidable'); - - const parser = new MultipartParser(); - parser.initWithBoundary(boundary); - parser.on('data', ({ name }) => { - ++calls[name]; - if (name === 'end') - console.timeEnd(moduleName); - }); - - console.time(moduleName); - for (const buf of buffers) - parser.write(buf); - - break; - } - - case 'multiparty': { - const { Readable } = require('stream'); - - const { Form } = require('multiparty'); - - const form = new Form({ - maxFieldsSize: Infinity, - maxFields: Infinity, - maxFilesSize: Infinity, - autoFields: false, - autoFiles: false, - }); - - const req = new Readable({ read: () => {} }); - req.headers = { - 'content-type': `multipart/form-data; boundary=${boundary}`, - }; - - function hijack(name, fn) { - const oldFn = form[name]; - form[name] = function() { - fn(); - return oldFn.apply(this, arguments); - }; - } - - hijack('onParseHeaderField', () => { - ++calls.headerField; - }); - hijack('onParseHeaderValue', () => { - ++calls.headerValue; - }); - hijack('onParsePartBegin', () => { - ++calls.partBegin; - }); - hijack('onParsePartData', () => { - ++calls.partData; - }); - hijack('onParsePartEnd', () => { - ++calls.partEnd; - }); - - form.on('close', () => { - ++calls.end; - console.timeEnd(moduleName); - }).on('part', (p) => p.resume()); - - console.time(moduleName); - form.parse(req); - for (const buf of buffers) - req.push(buf); - req.push(null); - - break; - } - - default: - if (moduleName === undefined) - console.error('Missing parser module name'); - else - console.error(`Invalid parser module name: ${moduleName}`); - process.exit(1); -} diff --git a/server/node_modules/busboy/bench/bench-multipart-fields-100mb-small.js b/server/node_modules/busboy/bench/bench-multipart-fields-100mb-small.js deleted file mode 100644 index f32d421..0000000 --- a/server/node_modules/busboy/bench/bench-multipart-fields-100mb-small.js +++ /dev/null @@ -1,143 +0,0 @@ -'use strict'; - -function createMultipartBuffers(boundary, sizes) { - const bufs = []; - for (let i = 0; i < sizes.length; ++i) { - const mb = sizes[i] * 1024 * 1024; - bufs.push(Buffer.from([ - `--${boundary}`, - `content-disposition: form-data; name="field${i + 1}"`, - '', - '0'.repeat(mb), - '', - ].join('\r\n'))); - } - bufs.push(Buffer.from([ - `--${boundary}--`, - '', - ].join('\r\n'))); - return bufs; -} - -const boundary = '-----------------------------168072824752491622650073'; -const buffers = createMultipartBuffers(boundary, (new Array(100)).fill(1)); -const calls = { - partBegin: 0, - headerField: 0, - headerValue: 0, - headerEnd: 0, - headersEnd: 0, - partData: 0, - partEnd: 0, - end: 0, -}; - -const moduleName = process.argv[2]; -switch (moduleName) { - case 'busboy': { - const busboy = require('busboy'); - - const parser = busboy({ - limits: { - fieldSizeLimit: Infinity, - }, - headers: { - 'content-type': `multipart/form-data; boundary=${boundary}`, - }, - }); - parser.on('field', (name, val, info) => { - ++calls.partBegin; - ++calls.partData; - ++calls.partEnd; - }).on('close', () => { - ++calls.end; - console.timeEnd(moduleName); - }); - - console.time(moduleName); - for (const buf of buffers) - parser.write(buf); - break; - } - - case 'formidable': { - const { MultipartParser } = require('formidable'); - - const parser = new MultipartParser(); - parser.initWithBoundary(boundary); - parser.on('data', ({ name }) => { - ++calls[name]; - if (name === 'end') - console.timeEnd(moduleName); - }); - - console.time(moduleName); - for (const buf of buffers) - parser.write(buf); - - break; - } - - case 'multiparty': { - const { Readable } = require('stream'); - - const { Form } = require('multiparty'); - - const form = new Form({ - maxFieldsSize: Infinity, - maxFields: Infinity, - maxFilesSize: Infinity, - autoFields: false, - autoFiles: false, - }); - - const req = new Readable({ read: () => {} }); - req.headers = { - 'content-type': `multipart/form-data; boundary=${boundary}`, - }; - - function hijack(name, fn) { - const oldFn = form[name]; - form[name] = function() { - fn(); - return oldFn.apply(this, arguments); - }; - } - - hijack('onParseHeaderField', () => { - ++calls.headerField; - }); - hijack('onParseHeaderValue', () => { - ++calls.headerValue; - }); - hijack('onParsePartBegin', () => { - ++calls.partBegin; - }); - hijack('onParsePartData', () => { - ++calls.partData; - }); - hijack('onParsePartEnd', () => { - ++calls.partEnd; - }); - - form.on('close', () => { - ++calls.end; - console.timeEnd(moduleName); - }).on('part', (p) => p.resume()); - - console.time(moduleName); - form.parse(req); - for (const buf of buffers) - req.push(buf); - req.push(null); - - break; - } - - default: - if (moduleName === undefined) - console.error('Missing parser module name'); - else - console.error(`Invalid parser module name: ${moduleName}`); - process.exit(1); -} diff --git a/server/node_modules/busboy/bench/bench-multipart-files-100mb-big.js b/server/node_modules/busboy/bench/bench-multipart-files-100mb-big.js deleted file mode 100644 index b46bdee..0000000 --- a/server/node_modules/busboy/bench/bench-multipart-files-100mb-big.js +++ /dev/null @@ -1,154 +0,0 @@ -'use strict'; - -function createMultipartBuffers(boundary, sizes) { - const bufs = []; - for (let i = 0; i < sizes.length; ++i) { - const mb = sizes[i] * 1024 * 1024; - bufs.push(Buffer.from([ - `--${boundary}`, - `content-disposition: form-data; name="file${i + 1}"; ` - + `filename="random${i + 1}.bin"`, - 'content-type: application/octet-stream', - '', - '0'.repeat(mb), - '', - ].join('\r\n'))); - } - bufs.push(Buffer.from([ - `--${boundary}--`, - '', - ].join('\r\n'))); - return bufs; -} - -const boundary = '-----------------------------168072824752491622650073'; -const buffers = createMultipartBuffers(boundary, [ - 10, - 10, - 10, - 20, - 50, -]); -const calls = { - partBegin: 0, - headerField: 0, - headerValue: 0, - headerEnd: 0, - headersEnd: 0, - partData: 0, - partEnd: 0, - end: 0, -}; - -const moduleName = process.argv[2]; -switch (moduleName) { - case 'busboy': { - const busboy = require('busboy'); - - const parser = busboy({ - limits: { - fieldSizeLimit: Infinity, - }, - headers: { - 'content-type': `multipart/form-data; boundary=${boundary}`, - }, - }); - parser.on('file', (name, stream, info) => { - ++calls.partBegin; - stream.on('data', (chunk) => { - ++calls.partData; - }).on('end', () => { - ++calls.partEnd; - }); - }).on('close', () => { - ++calls.end; - console.timeEnd(moduleName); - }); - - console.time(moduleName); - for (const buf of buffers) - parser.write(buf); - break; - } - - case 'formidable': { - const { MultipartParser } = require('formidable'); - - const parser = new MultipartParser(); - parser.initWithBoundary(boundary); - parser.on('data', ({ name }) => { - ++calls[name]; - if (name === 'end') - console.timeEnd(moduleName); - }); - - console.time(moduleName); - for (const buf of buffers) - parser.write(buf); - - break; - } - - case 'multiparty': { - const { Readable } = require('stream'); - - const { Form } = require('multiparty'); - - const form = new Form({ - maxFieldsSize: Infinity, - maxFields: Infinity, - maxFilesSize: Infinity, - autoFields: false, - autoFiles: false, - }); - - const req = new Readable({ read: () => {} }); - req.headers = { - 'content-type': `multipart/form-data; boundary=${boundary}`, - }; - - function hijack(name, fn) { - const oldFn = form[name]; - form[name] = function() { - fn(); - return oldFn.apply(this, arguments); - }; - } - - hijack('onParseHeaderField', () => { - ++calls.headerField; - }); - hijack('onParseHeaderValue', () => { - ++calls.headerValue; - }); - hijack('onParsePartBegin', () => { - ++calls.partBegin; - }); - hijack('onParsePartData', () => { - ++calls.partData; - }); - hijack('onParsePartEnd', () => { - ++calls.partEnd; - }); - - form.on('close', () => { - ++calls.end; - console.timeEnd(moduleName); - }).on('part', (p) => p.resume()); - - console.time(moduleName); - form.parse(req); - for (const buf of buffers) - req.push(buf); - req.push(null); - - break; - } - - default: - if (moduleName === undefined) - console.error('Missing parser module name'); - else - console.error(`Invalid parser module name: ${moduleName}`); - process.exit(1); -} diff --git a/server/node_modules/busboy/bench/bench-multipart-files-100mb-small.js b/server/node_modules/busboy/bench/bench-multipart-files-100mb-small.js deleted file mode 100644 index 46b5dff..0000000 --- a/server/node_modules/busboy/bench/bench-multipart-files-100mb-small.js +++ /dev/null @@ -1,148 +0,0 @@ -'use strict'; - -function createMultipartBuffers(boundary, sizes) { - const bufs = []; - for (let i = 0; i < sizes.length; ++i) { - const mb = sizes[i] * 1024 * 1024; - bufs.push(Buffer.from([ - `--${boundary}`, - `content-disposition: form-data; name="file${i + 1}"; ` - + `filename="random${i + 1}.bin"`, - 'content-type: application/octet-stream', - '', - '0'.repeat(mb), - '', - ].join('\r\n'))); - } - bufs.push(Buffer.from([ - `--${boundary}--`, - '', - ].join('\r\n'))); - return bufs; -} - -const boundary = '-----------------------------168072824752491622650073'; -const buffers = createMultipartBuffers(boundary, (new Array(100)).fill(1)); -const calls = { - partBegin: 0, - headerField: 0, - headerValue: 0, - headerEnd: 0, - headersEnd: 0, - partData: 0, - partEnd: 0, - end: 0, -}; - -const moduleName = process.argv[2]; -switch (moduleName) { - case 'busboy': { - const busboy = require('busboy'); - - const parser = busboy({ - limits: { - fieldSizeLimit: Infinity, - }, - headers: { - 'content-type': `multipart/form-data; boundary=${boundary}`, - }, - }); - parser.on('file', (name, stream, info) => { - ++calls.partBegin; - stream.on('data', (chunk) => { - ++calls.partData; - }).on('end', () => { - ++calls.partEnd; - }); - }).on('close', () => { - ++calls.end; - console.timeEnd(moduleName); - }); - - console.time(moduleName); - for (const buf of buffers) - parser.write(buf); - break; - } - - case 'formidable': { - const { MultipartParser } = require('formidable'); - - const parser = new MultipartParser(); - parser.initWithBoundary(boundary); - parser.on('data', ({ name }) => { - ++calls[name]; - if (name === 'end') - console.timeEnd(moduleName); - }); - - console.time(moduleName); - for (const buf of buffers) - parser.write(buf); - - break; - } - - case 'multiparty': { - const { Readable } = require('stream'); - - const { Form } = require('multiparty'); - - const form = new Form({ - maxFieldsSize: Infinity, - maxFields: Infinity, - maxFilesSize: Infinity, - autoFields: false, - autoFiles: false, - }); - - const req = new Readable({ read: () => {} }); - req.headers = { - 'content-type': `multipart/form-data; boundary=${boundary}`, - }; - - function hijack(name, fn) { - const oldFn = form[name]; - form[name] = function() { - fn(); - return oldFn.apply(this, arguments); - }; - } - - hijack('onParseHeaderField', () => { - ++calls.headerField; - }); - hijack('onParseHeaderValue', () => { - ++calls.headerValue; - }); - hijack('onParsePartBegin', () => { - ++calls.partBegin; - }); - hijack('onParsePartData', () => { - ++calls.partData; - }); - hijack('onParsePartEnd', () => { - ++calls.partEnd; - }); - - form.on('close', () => { - ++calls.end; - console.timeEnd(moduleName); - }).on('part', (p) => p.resume()); - - console.time(moduleName); - form.parse(req); - for (const buf of buffers) - req.push(buf); - req.push(null); - - break; - } - - default: - if (moduleName === undefined) - console.error('Missing parser module name'); - else - console.error(`Invalid parser module name: ${moduleName}`); - process.exit(1); -} diff --git a/server/node_modules/busboy/bench/bench-urlencoded-fields-100pairs-small.js b/server/node_modules/busboy/bench/bench-urlencoded-fields-100pairs-small.js deleted file mode 100644 index 5c337df..0000000 --- a/server/node_modules/busboy/bench/bench-urlencoded-fields-100pairs-small.js +++ /dev/null @@ -1,101 +0,0 @@ -'use strict'; - -const buffers = [ - Buffer.from( - (new Array(100)).fill('').map((_, i) => `key${i}=value${i}`).join('&') - ), -]; -const calls = { - field: 0, - end: 0, -}; - -let n = 3e3; - -const moduleName = process.argv[2]; -switch (moduleName) { - case 'busboy': { - const busboy = require('busboy'); - - console.time(moduleName); - (function next() { - const parser = busboy({ - limits: { - fieldSizeLimit: Infinity, - }, - headers: { - 'content-type': 'application/x-www-form-urlencoded; charset=utf-8', - }, - }); - parser.on('field', (name, val, info) => { - ++calls.field; - }).on('close', () => { - ++calls.end; - if (--n === 0) - console.timeEnd(moduleName); - else - process.nextTick(next); - }); - - for (const buf of buffers) - parser.write(buf); - parser.end(); - })(); - break; - } - - case 'formidable': { - const QuerystringParser = - require('formidable/src/parsers/Querystring.js'); - - console.time(moduleName); - (function next() { - const parser = new QuerystringParser(); - parser.on('data', (obj) => { - ++calls.field; - }).on('end', () => { - ++calls.end; - if (--n === 0) - console.timeEnd(moduleName); - else - process.nextTick(next); - }); - - for (const buf of buffers) - parser.write(buf); - parser.end(); - })(); - break; - } - - case 'formidable-streaming': { - const QuerystringParser = - require('formidable/src/parsers/StreamingQuerystring.js'); - - console.time(moduleName); - (function next() { - const parser = new QuerystringParser(); - parser.on('data', (obj) => { - ++calls.field; - }).on('end', () => { - ++calls.end; - if (--n === 0) - console.timeEnd(moduleName); - else - process.nextTick(next); - }); - - for (const buf of buffers) - parser.write(buf); - parser.end(); - })(); - break; - } - - default: - if (moduleName === undefined) - console.error('Missing parser module name'); - else - console.error(`Invalid parser module name: ${moduleName}`); - process.exit(1); -} diff --git a/server/node_modules/busboy/bench/bench-urlencoded-fields-900pairs-small-alt.js b/server/node_modules/busboy/bench/bench-urlencoded-fields-900pairs-small-alt.js deleted file mode 100644 index 1f5645c..0000000 --- a/server/node_modules/busboy/bench/bench-urlencoded-fields-900pairs-small-alt.js +++ /dev/null @@ -1,84 +0,0 @@ -'use strict'; - -const buffers = [ - Buffer.from( - (new Array(900)).fill('').map((_, i) => `key${i}=value${i}`).join('&') - ), -]; -const calls = { - field: 0, - end: 0, -}; - -const moduleName = process.argv[2]; -switch (moduleName) { - case 'busboy': { - const busboy = require('busboy'); - - console.time(moduleName); - const parser = busboy({ - limits: { - fieldSizeLimit: Infinity, - }, - headers: { - 'content-type': 'application/x-www-form-urlencoded; charset=utf-8', - }, - }); - parser.on('field', (name, val, info) => { - ++calls.field; - }).on('close', () => { - ++calls.end; - console.timeEnd(moduleName); - }); - - for (const buf of buffers) - parser.write(buf); - parser.end(); - break; - } - - case 'formidable': { - const QuerystringParser = - require('formidable/src/parsers/Querystring.js'); - - console.time(moduleName); - const parser = new QuerystringParser(); - parser.on('data', (obj) => { - ++calls.field; - }).on('end', () => { - ++calls.end; - console.timeEnd(moduleName); - }); - - for (const buf of buffers) - parser.write(buf); - parser.end(); - break; - } - - case 'formidable-streaming': { - const QuerystringParser = - require('formidable/src/parsers/StreamingQuerystring.js'); - - console.time(moduleName); - const parser = new QuerystringParser(); - parser.on('data', (obj) => { - ++calls.field; - }).on('end', () => { - ++calls.end; - console.timeEnd(moduleName); - }); - - for (const buf of buffers) - parser.write(buf); - parser.end(); - break; - } - - default: - if (moduleName === undefined) - console.error('Missing parser module name'); - else - console.error(`Invalid parser module name: ${moduleName}`); - process.exit(1); -} diff --git a/server/node_modules/busboy/lib/index.js b/server/node_modules/busboy/lib/index.js deleted file mode 100644 index 873272d..0000000 --- a/server/node_modules/busboy/lib/index.js +++ /dev/null @@ -1,57 +0,0 @@ -'use strict'; - -const { parseContentType } = require('./utils.js'); - -function getInstance(cfg) { - const headers = cfg.headers; - const conType = parseContentType(headers['content-type']); - if (!conType) - throw new Error('Malformed content type'); - - for (const type of TYPES) { - const matched = type.detect(conType); - if (!matched) - continue; - - const instanceCfg = { - limits: cfg.limits, - headers, - conType, - highWaterMark: undefined, - fileHwm: undefined, - defCharset: undefined, - defParamCharset: undefined, - preservePath: false, - }; - if (cfg.highWaterMark) - instanceCfg.highWaterMark = cfg.highWaterMark; - if (cfg.fileHwm) - instanceCfg.fileHwm = cfg.fileHwm; - instanceCfg.defCharset = cfg.defCharset; - instanceCfg.defParamCharset = cfg.defParamCharset; - instanceCfg.preservePath = cfg.preservePath; - return new type(instanceCfg); - } - - throw new Error(`Unsupported content type: ${headers['content-type']}`); -} - -// Note: types are explicitly listed here for easier bundling -// See: https://github.com/mscdex/busboy/issues/121 -const TYPES = [ - require('./types/multipart'), - require('./types/urlencoded'), -].filter(function(typemod) { return typeof typemod.detect === 'function'; }); - -module.exports = (cfg) => { - if (typeof cfg !== 'object' || cfg === null) - cfg = {}; - - if (typeof cfg.headers !== 'object' - || cfg.headers === null - || typeof cfg.headers['content-type'] !== 'string') { - throw new Error('Missing Content-Type'); - } - - return getInstance(cfg); -}; diff --git a/server/node_modules/busboy/lib/types/multipart.js b/server/node_modules/busboy/lib/types/multipart.js deleted file mode 100644 index cc0d7bb..0000000 --- a/server/node_modules/busboy/lib/types/multipart.js +++ /dev/null @@ -1,653 +0,0 @@ -'use strict'; - -const { Readable, Writable } = require('stream'); - -const StreamSearch = require('streamsearch'); - -const { - basename, - convertToUTF8, - getDecoder, - parseContentType, - parseDisposition, -} = require('../utils.js'); - -const BUF_CRLF = Buffer.from('\r\n'); -const BUF_CR = Buffer.from('\r'); -const BUF_DASH = Buffer.from('-'); - -function noop() {} - -const MAX_HEADER_PAIRS = 2000; // From node -const MAX_HEADER_SIZE = 16 * 1024; // From node (its default value) - -const HPARSER_NAME = 0; -const HPARSER_PRE_OWS = 1; -const HPARSER_VALUE = 2; -class HeaderParser { - constructor(cb) { - this.header = Object.create(null); - this.pairCount = 0; - this.byteCount = 0; - this.state = HPARSER_NAME; - this.name = ''; - this.value = ''; - this.crlf = 0; - this.cb = cb; - } - - reset() { - this.header = Object.create(null); - this.pairCount = 0; - this.byteCount = 0; - this.state = HPARSER_NAME; - this.name = ''; - this.value = ''; - this.crlf = 0; - } - - push(chunk, pos, end) { - let start = pos; - while (pos < end) { - switch (this.state) { - case HPARSER_NAME: { - let done = false; - for (; pos < end; ++pos) { - if (this.byteCount === MAX_HEADER_SIZE) - return -1; - ++this.byteCount; - const code = chunk[pos]; - if (TOKEN[code] !== 1) { - if (code !== 58/* ':' */) - return -1; - this.name += chunk.latin1Slice(start, pos); - if (this.name.length === 0) - return -1; - ++pos; - done = true; - this.state = HPARSER_PRE_OWS; - break; - } - } - if (!done) { - this.name += chunk.latin1Slice(start, pos); - break; - } - // FALLTHROUGH - } - case HPARSER_PRE_OWS: { - // Skip optional whitespace - let done = false; - for (; pos < end; ++pos) { - if (this.byteCount === MAX_HEADER_SIZE) - return -1; - ++this.byteCount; - const code = chunk[pos]; - if (code !== 32/* ' ' */ && code !== 9/* '\t' */) { - start = pos; - done = true; - this.state = HPARSER_VALUE; - break; - } - } - if (!done) - break; - // FALLTHROUGH - } - case HPARSER_VALUE: - switch (this.crlf) { - case 0: // Nothing yet - for (; pos < end; ++pos) { - if (this.byteCount === MAX_HEADER_SIZE) - return -1; - ++this.byteCount; - const code = chunk[pos]; - if (FIELD_VCHAR[code] !== 1) { - if (code !== 13/* '\r' */) - return -1; - ++this.crlf; - break; - } - } - this.value += chunk.latin1Slice(start, pos++); - break; - case 1: // Received CR - if (this.byteCount === MAX_HEADER_SIZE) - return -1; - ++this.byteCount; - if (chunk[pos++] !== 10/* '\n' */) - return -1; - ++this.crlf; - break; - case 2: { // Received CR LF - if (this.byteCount === MAX_HEADER_SIZE) - return -1; - ++this.byteCount; - const code = chunk[pos]; - if (code === 32/* ' ' */ || code === 9/* '\t' */) { - // Folded value - start = pos; - this.crlf = 0; - } else { - if (++this.pairCount < MAX_HEADER_PAIRS) { - this.name = this.name.toLowerCase(); - if (this.header[this.name] === undefined) - this.header[this.name] = [this.value]; - else - this.header[this.name].push(this.value); - } - if (code === 13/* '\r' */) { - ++this.crlf; - ++pos; - } else { - // Assume start of next header field name - start = pos; - this.crlf = 0; - this.state = HPARSER_NAME; - this.name = ''; - this.value = ''; - } - } - break; - } - case 3: { // Received CR LF CR - if (this.byteCount === MAX_HEADER_SIZE) - return -1; - ++this.byteCount; - if (chunk[pos++] !== 10/* '\n' */) - return -1; - // End of header - const header = this.header; - this.reset(); - this.cb(header); - return pos; - } - } - break; - } - } - - return pos; - } -} - -class FileStream extends Readable { - constructor(opts, owner) { - super(opts); - this.truncated = false; - this._readcb = null; - this.once('end', () => { - // We need to make sure that we call any outstanding _writecb() that is - // associated with this file so that processing of the rest of the form - // can continue. This may not happen if the file stream ends right after - // backpressure kicks in, so we force it here. - this._read(); - if (--owner._fileEndsLeft === 0 && owner._finalcb) { - const cb = owner._finalcb; - owner._finalcb = null; - // Make sure other 'end' event handlers get a chance to be executed - // before busboy's 'finish' event is emitted - process.nextTick(cb); - } - }); - } - _read(n) { - const cb = this._readcb; - if (cb) { - this._readcb = null; - cb(); - } - } -} - -const ignoreData = { - push: (chunk, pos) => {}, - destroy: () => {}, -}; - -function callAndUnsetCb(self, err) { - const cb = self._writecb; - self._writecb = null; - if (err) - self.destroy(err); - else if (cb) - cb(); -} - -function nullDecoder(val, hint) { - return val; -} - -class Multipart extends Writable { - constructor(cfg) { - const streamOpts = { - autoDestroy: true, - emitClose: true, - highWaterMark: (typeof cfg.highWaterMark === 'number' - ? cfg.highWaterMark - : undefined), - }; - super(streamOpts); - - if (!cfg.conType.params || typeof cfg.conType.params.boundary !== 'string') - throw new Error('Multipart: Boundary not found'); - - const boundary = cfg.conType.params.boundary; - const paramDecoder = (typeof cfg.defParamCharset === 'string' - && cfg.defParamCharset - ? getDecoder(cfg.defParamCharset) - : nullDecoder); - const defCharset = (cfg.defCharset || 'utf8'); - const preservePath = cfg.preservePath; - const fileOpts = { - autoDestroy: true, - emitClose: true, - highWaterMark: (typeof cfg.fileHwm === 'number' - ? cfg.fileHwm - : undefined), - }; - - const limits = cfg.limits; - const fieldSizeLimit = (limits && typeof limits.fieldSize === 'number' - ? limits.fieldSize - : 1 * 1024 * 1024); - const fileSizeLimit = (limits && typeof limits.fileSize === 'number' - ? limits.fileSize - : Infinity); - const filesLimit = (limits && typeof limits.files === 'number' - ? limits.files - : Infinity); - const fieldsLimit = (limits && typeof limits.fields === 'number' - ? limits.fields - : Infinity); - const partsLimit = (limits && typeof limits.parts === 'number' - ? limits.parts - : Infinity); - - let parts = -1; // Account for initial boundary - let fields = 0; - let files = 0; - let skipPart = false; - - this._fileEndsLeft = 0; - this._fileStream = undefined; - this._complete = false; - let fileSize = 0; - - let field; - let fieldSize = 0; - let partCharset; - let partEncoding; - let partType; - let partName; - let partTruncated = false; - - let hitFilesLimit = false; - let hitFieldsLimit = false; - - this._hparser = null; - const hparser = new HeaderParser((header) => { - this._hparser = null; - skipPart = false; - - partType = 'text/plain'; - partCharset = defCharset; - partEncoding = '7bit'; - partName = undefined; - partTruncated = false; - - let filename; - if (!header['content-disposition']) { - skipPart = true; - return; - } - - const disp = parseDisposition(header['content-disposition'][0], - paramDecoder); - if (!disp || disp.type !== 'form-data') { - skipPart = true; - return; - } - - if (disp.params) { - if (disp.params.name) - partName = disp.params.name; - - if (disp.params['filename*']) - filename = disp.params['filename*']; - else if (disp.params.filename) - filename = disp.params.filename; - - if (filename !== undefined && !preservePath) - filename = basename(filename); - } - - if (header['content-type']) { - const conType = parseContentType(header['content-type'][0]); - if (conType) { - partType = `${conType.type}/${conType.subtype}`; - if (conType.params && typeof conType.params.charset === 'string') - partCharset = conType.params.charset.toLowerCase(); - } - } - - if (header['content-transfer-encoding']) - partEncoding = header['content-transfer-encoding'][0].toLowerCase(); - - if (partType === 'application/octet-stream' || filename !== undefined) { - // File - - if (files === filesLimit) { - if (!hitFilesLimit) { - hitFilesLimit = true; - this.emit('filesLimit'); - } - skipPart = true; - return; - } - ++files; - - if (this.listenerCount('file') === 0) { - skipPart = true; - return; - } - - fileSize = 0; - this._fileStream = new FileStream(fileOpts, this); - ++this._fileEndsLeft; - this.emit( - 'file', - partName, - this._fileStream, - { filename, - encoding: partEncoding, - mimeType: partType } - ); - } else { - // Non-file - - if (fields === fieldsLimit) { - if (!hitFieldsLimit) { - hitFieldsLimit = true; - this.emit('fieldsLimit'); - } - skipPart = true; - return; - } - ++fields; - - if (this.listenerCount('field') === 0) { - skipPart = true; - return; - } - - field = []; - fieldSize = 0; - } - }); - - let matchPostBoundary = 0; - const ssCb = (isMatch, data, start, end, isDataSafe) => { -retrydata: - while (data) { - if (this._hparser !== null) { - const ret = this._hparser.push(data, start, end); - if (ret === -1) { - this._hparser = null; - hparser.reset(); - this.emit('error', new Error('Malformed part header')); - break; - } - start = ret; - } - - if (start === end) - break; - - if (matchPostBoundary !== 0) { - if (matchPostBoundary === 1) { - switch (data[start]) { - case 45: // '-' - // Try matching '--' after boundary - matchPostBoundary = 2; - ++start; - break; - case 13: // '\r' - // Try matching CR LF before header - matchPostBoundary = 3; - ++start; - break; - default: - matchPostBoundary = 0; - } - if (start === end) - return; - } - - if (matchPostBoundary === 2) { - matchPostBoundary = 0; - if (data[start] === 45/* '-' */) { - // End of multipart data - this._complete = true; - this._bparser = ignoreData; - return; - } - // We saw something other than '-', so put the dash we consumed - // "back" - const writecb = this._writecb; - this._writecb = noop; - ssCb(false, BUF_DASH, 0, 1, false); - this._writecb = writecb; - } else if (matchPostBoundary === 3) { - matchPostBoundary = 0; - if (data[start] === 10/* '\n' */) { - ++start; - if (parts >= partsLimit) - break; - // Prepare the header parser - this._hparser = hparser; - if (start === end) - break; - // Process the remaining data as a header - continue retrydata; - } else { - // We saw something other than LF, so put the CR we consumed - // "back" - const writecb = this._writecb; - this._writecb = noop; - ssCb(false, BUF_CR, 0, 1, false); - this._writecb = writecb; - } - } - } - - if (!skipPart) { - if (this._fileStream) { - let chunk; - const actualLen = Math.min(end - start, fileSizeLimit - fileSize); - if (!isDataSafe) { - chunk = Buffer.allocUnsafe(actualLen); - data.copy(chunk, 0, start, start + actualLen); - } else { - chunk = data.slice(start, start + actualLen); - } - - fileSize += chunk.length; - if (fileSize === fileSizeLimit) { - if (chunk.length > 0) - this._fileStream.push(chunk); - this._fileStream.emit('limit'); - this._fileStream.truncated = true; - skipPart = true; - } else if (!this._fileStream.push(chunk)) { - if (this._writecb) - this._fileStream._readcb = this._writecb; - this._writecb = null; - } - } else if (field !== undefined) { - let chunk; - const actualLen = Math.min( - end - start, - fieldSizeLimit - fieldSize - ); - if (!isDataSafe) { - chunk = Buffer.allocUnsafe(actualLen); - data.copy(chunk, 0, start, start + actualLen); - } else { - chunk = data.slice(start, start + actualLen); - } - - fieldSize += actualLen; - field.push(chunk); - if (fieldSize === fieldSizeLimit) { - skipPart = true; - partTruncated = true; - } - } - } - - break; - } - - if (isMatch) { - matchPostBoundary = 1; - - if (this._fileStream) { - // End the active file stream if the previous part was a file - this._fileStream.push(null); - this._fileStream = null; - } else if (field !== undefined) { - let data; - switch (field.length) { - case 0: - data = ''; - break; - case 1: - data = convertToUTF8(field[0], partCharset, 0); - break; - default: - data = convertToUTF8( - Buffer.concat(field, fieldSize), - partCharset, - 0 - ); - } - field = undefined; - fieldSize = 0; - this.emit( - 'field', - partName, - data, - { nameTruncated: false, - valueTruncated: partTruncated, - encoding: partEncoding, - mimeType: partType } - ); - } - - if (++parts === partsLimit) - this.emit('partsLimit'); - } - }; - this._bparser = new StreamSearch(`\r\n--${boundary}`, ssCb); - - this._writecb = null; - this._finalcb = null; - - // Just in case there is no preamble - this.write(BUF_CRLF); - } - - static detect(conType) { - return (conType.type === 'multipart' && conType.subtype === 'form-data'); - } - - _write(chunk, enc, cb) { - this._writecb = cb; - this._bparser.push(chunk, 0); - if (this._writecb) - callAndUnsetCb(this); - } - - _destroy(err, cb) { - this._hparser = null; - this._bparser = ignoreData; - if (!err) - err = checkEndState(this); - const fileStream = this._fileStream; - if (fileStream) { - this._fileStream = null; - fileStream.destroy(err); - } - cb(err); - } - - _final(cb) { - this._bparser.destroy(); - if (!this._complete) - return cb(new Error('Unexpected end of form')); - if (this._fileEndsLeft) - this._finalcb = finalcb.bind(null, this, cb); - else - finalcb(this, cb); - } -} - -function finalcb(self, cb, err) { - if (err) - return cb(err); - err = checkEndState(self); - cb(err); -} - -function checkEndState(self) { - if (self._hparser) - return new Error('Malformed part header'); - const fileStream = self._fileStream; - if (fileStream) { - self._fileStream = null; - fileStream.destroy(new Error('Unexpected end of file')); - } - if (!self._complete) - return new Error('Unexpected end of form'); -} - -const TOKEN = [ - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 1, 0, 1, 1, 1, 1, 1, 0, 0, 1, 1, 0, 1, 1, 0, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, - 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 0, 1, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -]; - -const FIELD_VCHAR = [ - 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, -]; - -module.exports = Multipart; diff --git a/server/node_modules/busboy/lib/types/urlencoded.js b/server/node_modules/busboy/lib/types/urlencoded.js deleted file mode 100644 index 5c463a2..0000000 --- a/server/node_modules/busboy/lib/types/urlencoded.js +++ /dev/null @@ -1,350 +0,0 @@ -'use strict'; - -const { Writable } = require('stream'); - -const { getDecoder } = require('../utils.js'); - -class URLEncoded extends Writable { - constructor(cfg) { - const streamOpts = { - autoDestroy: true, - emitClose: true, - highWaterMark: (typeof cfg.highWaterMark === 'number' - ? cfg.highWaterMark - : undefined), - }; - super(streamOpts); - - let charset = (cfg.defCharset || 'utf8'); - if (cfg.conType.params && typeof cfg.conType.params.charset === 'string') - charset = cfg.conType.params.charset; - - this.charset = charset; - - const limits = cfg.limits; - this.fieldSizeLimit = (limits && typeof limits.fieldSize === 'number' - ? limits.fieldSize - : 1 * 1024 * 1024); - this.fieldsLimit = (limits && typeof limits.fields === 'number' - ? limits.fields - : Infinity); - this.fieldNameSizeLimit = ( - limits && typeof limits.fieldNameSize === 'number' - ? limits.fieldNameSize - : 100 - ); - - this._inKey = true; - this._keyTrunc = false; - this._valTrunc = false; - this._bytesKey = 0; - this._bytesVal = 0; - this._fields = 0; - this._key = ''; - this._val = ''; - this._byte = -2; - this._lastPos = 0; - this._encode = 0; - this._decoder = getDecoder(charset); - } - - static detect(conType) { - return (conType.type === 'application' - && conType.subtype === 'x-www-form-urlencoded'); - } - - _write(chunk, enc, cb) { - if (this._fields >= this.fieldsLimit) - return cb(); - - let i = 0; - const len = chunk.length; - this._lastPos = 0; - - // Check if we last ended mid-percent-encoded byte - if (this._byte !== -2) { - i = readPctEnc(this, chunk, i, len); - if (i === -1) - return cb(new Error('Malformed urlencoded form')); - if (i >= len) - return cb(); - if (this._inKey) - ++this._bytesKey; - else - ++this._bytesVal; - } - -main: - while (i < len) { - if (this._inKey) { - // Parsing key - - i = skipKeyBytes(this, chunk, i, len); - - while (i < len) { - switch (chunk[i]) { - case 61: // '=' - if (this._lastPos < i) - this._key += chunk.latin1Slice(this._lastPos, i); - this._lastPos = ++i; - this._key = this._decoder(this._key, this._encode); - this._encode = 0; - this._inKey = false; - continue main; - case 38: // '&' - if (this._lastPos < i) - this._key += chunk.latin1Slice(this._lastPos, i); - this._lastPos = ++i; - this._key = this._decoder(this._key, this._encode); - this._encode = 0; - if (this._bytesKey > 0) { - this.emit( - 'field', - this._key, - '', - { nameTruncated: this._keyTrunc, - valueTruncated: false, - encoding: this.charset, - mimeType: 'text/plain' } - ); - } - this._key = ''; - this._val = ''; - this._keyTrunc = false; - this._valTrunc = false; - this._bytesKey = 0; - this._bytesVal = 0; - if (++this._fields >= this.fieldsLimit) { - this.emit('fieldsLimit'); - return cb(); - } - continue; - case 43: // '+' - if (this._lastPos < i) - this._key += chunk.latin1Slice(this._lastPos, i); - this._key += ' '; - this._lastPos = i + 1; - break; - case 37: // '%' - if (this._encode === 0) - this._encode = 1; - if (this._lastPos < i) - this._key += chunk.latin1Slice(this._lastPos, i); - this._lastPos = i + 1; - this._byte = -1; - i = readPctEnc(this, chunk, i + 1, len); - if (i === -1) - return cb(new Error('Malformed urlencoded form')); - if (i >= len) - return cb(); - ++this._bytesKey; - i = skipKeyBytes(this, chunk, i, len); - continue; - } - ++i; - ++this._bytesKey; - i = skipKeyBytes(this, chunk, i, len); - } - if (this._lastPos < i) - this._key += chunk.latin1Slice(this._lastPos, i); - } else { - // Parsing value - - i = skipValBytes(this, chunk, i, len); - - while (i < len) { - switch (chunk[i]) { - case 38: // '&' - if (this._lastPos < i) - this._val += chunk.latin1Slice(this._lastPos, i); - this._lastPos = ++i; - this._inKey = true; - this._val = this._decoder(this._val, this._encode); - this._encode = 0; - if (this._bytesKey > 0 || this._bytesVal > 0) { - this.emit( - 'field', - this._key, - this._val, - { nameTruncated: this._keyTrunc, - valueTruncated: this._valTrunc, - encoding: this.charset, - mimeType: 'text/plain' } - ); - } - this._key = ''; - this._val = ''; - this._keyTrunc = false; - this._valTrunc = false; - this._bytesKey = 0; - this._bytesVal = 0; - if (++this._fields >= this.fieldsLimit) { - this.emit('fieldsLimit'); - return cb(); - } - continue main; - case 43: // '+' - if (this._lastPos < i) - this._val += chunk.latin1Slice(this._lastPos, i); - this._val += ' '; - this._lastPos = i + 1; - break; - case 37: // '%' - if (this._encode === 0) - this._encode = 1; - if (this._lastPos < i) - this._val += chunk.latin1Slice(this._lastPos, i); - this._lastPos = i + 1; - this._byte = -1; - i = readPctEnc(this, chunk, i + 1, len); - if (i === -1) - return cb(new Error('Malformed urlencoded form')); - if (i >= len) - return cb(); - ++this._bytesVal; - i = skipValBytes(this, chunk, i, len); - continue; - } - ++i; - ++this._bytesVal; - i = skipValBytes(this, chunk, i, len); - } - if (this._lastPos < i) - this._val += chunk.latin1Slice(this._lastPos, i); - } - } - - cb(); - } - - _final(cb) { - if (this._byte !== -2) - return cb(new Error('Malformed urlencoded form')); - if (!this._inKey || this._bytesKey > 0 || this._bytesVal > 0) { - if (this._inKey) - this._key = this._decoder(this._key, this._encode); - else - this._val = this._decoder(this._val, this._encode); - this.emit( - 'field', - this._key, - this._val, - { nameTruncated: this._keyTrunc, - valueTruncated: this._valTrunc, - encoding: this.charset, - mimeType: 'text/plain' } - ); - } - cb(); - } -} - -function readPctEnc(self, chunk, pos, len) { - if (pos >= len) - return len; - - if (self._byte === -1) { - // We saw a '%' but no hex characters yet - const hexUpper = HEX_VALUES[chunk[pos++]]; - if (hexUpper === -1) - return -1; - - if (hexUpper >= 8) - self._encode = 2; // Indicate high bits detected - - if (pos < len) { - // Both hex characters are in this chunk - const hexLower = HEX_VALUES[chunk[pos++]]; - if (hexLower === -1) - return -1; - - if (self._inKey) - self._key += String.fromCharCode((hexUpper << 4) + hexLower); - else - self._val += String.fromCharCode((hexUpper << 4) + hexLower); - - self._byte = -2; - self._lastPos = pos; - } else { - // Only one hex character was available in this chunk - self._byte = hexUpper; - } - } else { - // We saw only one hex character so far - const hexLower = HEX_VALUES[chunk[pos++]]; - if (hexLower === -1) - return -1; - - if (self._inKey) - self._key += String.fromCharCode((self._byte << 4) + hexLower); - else - self._val += String.fromCharCode((self._byte << 4) + hexLower); - - self._byte = -2; - self._lastPos = pos; - } - - return pos; -} - -function skipKeyBytes(self, chunk, pos, len) { - // Skip bytes if we've truncated - if (self._bytesKey > self.fieldNameSizeLimit) { - if (!self._keyTrunc) { - if (self._lastPos < pos) - self._key += chunk.latin1Slice(self._lastPos, pos - 1); - } - self._keyTrunc = true; - for (; pos < len; ++pos) { - const code = chunk[pos]; - if (code === 61/* '=' */ || code === 38/* '&' */) - break; - ++self._bytesKey; - } - self._lastPos = pos; - } - - return pos; -} - -function skipValBytes(self, chunk, pos, len) { - // Skip bytes if we've truncated - if (self._bytesVal > self.fieldSizeLimit) { - if (!self._valTrunc) { - if (self._lastPos < pos) - self._val += chunk.latin1Slice(self._lastPos, pos - 1); - } - self._valTrunc = true; - for (; pos < len; ++pos) { - if (chunk[pos] === 38/* '&' */) - break; - ++self._bytesVal; - } - self._lastPos = pos; - } - - return pos; -} - -/* eslint-disable no-multi-spaces */ -const HEX_VALUES = [ - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, -1, -1, -1, -1, -1, -1, - -1, 10, 11, 12, 13, 14, 15, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, 10, 11, 12, 13, 14, 15, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -]; -/* eslint-enable no-multi-spaces */ - -module.exports = URLEncoded; diff --git a/server/node_modules/busboy/lib/utils.js b/server/node_modules/busboy/lib/utils.js deleted file mode 100644 index 8274f6c..0000000 --- a/server/node_modules/busboy/lib/utils.js +++ /dev/null @@ -1,596 +0,0 @@ -'use strict'; - -function parseContentType(str) { - if (str.length === 0) - return; - - const params = Object.create(null); - let i = 0; - - // Parse type - for (; i < str.length; ++i) { - const code = str.charCodeAt(i); - if (TOKEN[code] !== 1) { - if (code !== 47/* '/' */ || i === 0) - return; - break; - } - } - // Check for type without subtype - if (i === str.length) - return; - - const type = str.slice(0, i).toLowerCase(); - - // Parse subtype - const subtypeStart = ++i; - for (; i < str.length; ++i) { - const code = str.charCodeAt(i); - if (TOKEN[code] !== 1) { - // Make sure we have a subtype - if (i === subtypeStart) - return; - - if (parseContentTypeParams(str, i, params) === undefined) - return; - break; - } - } - // Make sure we have a subtype - if (i === subtypeStart) - return; - - const subtype = str.slice(subtypeStart, i).toLowerCase(); - - return { type, subtype, params }; -} - -function parseContentTypeParams(str, i, params) { - while (i < str.length) { - // Consume whitespace - for (; i < str.length; ++i) { - const code = str.charCodeAt(i); - if (code !== 32/* ' ' */ && code !== 9/* '\t' */) - break; - } - - // Ended on whitespace - if (i === str.length) - break; - - // Check for malformed parameter - if (str.charCodeAt(i++) !== 59/* ';' */) - return; - - // Consume whitespace - for (; i < str.length; ++i) { - const code = str.charCodeAt(i); - if (code !== 32/* ' ' */ && code !== 9/* '\t' */) - break; - } - - // Ended on whitespace (malformed) - if (i === str.length) - return; - - let name; - const nameStart = i; - // Parse parameter name - for (; i < str.length; ++i) { - const code = str.charCodeAt(i); - if (TOKEN[code] !== 1) { - if (code !== 61/* '=' */) - return; - break; - } - } - - // No value (malformed) - if (i === str.length) - return; - - name = str.slice(nameStart, i); - ++i; // Skip over '=' - - // No value (malformed) - if (i === str.length) - return; - - let value = ''; - let valueStart; - if (str.charCodeAt(i) === 34/* '"' */) { - valueStart = ++i; - let escaping = false; - // Parse quoted value - for (; i < str.length; ++i) { - const code = str.charCodeAt(i); - if (code === 92/* '\\' */) { - if (escaping) { - valueStart = i; - escaping = false; - } else { - value += str.slice(valueStart, i); - escaping = true; - } - continue; - } - if (code === 34/* '"' */) { - if (escaping) { - valueStart = i; - escaping = false; - continue; - } - value += str.slice(valueStart, i); - break; - } - if (escaping) { - valueStart = i - 1; - escaping = false; - } - // Invalid unescaped quoted character (malformed) - if (QDTEXT[code] !== 1) - return; - } - - // No end quote (malformed) - if (i === str.length) - return; - - ++i; // Skip over double quote - } else { - valueStart = i; - // Parse unquoted value - for (; i < str.length; ++i) { - const code = str.charCodeAt(i); - if (TOKEN[code] !== 1) { - // No value (malformed) - if (i === valueStart) - return; - break; - } - } - value = str.slice(valueStart, i); - } - - name = name.toLowerCase(); - if (params[name] === undefined) - params[name] = value; - } - - return params; -} - -function parseDisposition(str, defDecoder) { - if (str.length === 0) - return; - - const params = Object.create(null); - let i = 0; - - for (; i < str.length; ++i) { - const code = str.charCodeAt(i); - if (TOKEN[code] !== 1) { - if (parseDispositionParams(str, i, params, defDecoder) === undefined) - return; - break; - } - } - - const type = str.slice(0, i).toLowerCase(); - - return { type, params }; -} - -function parseDispositionParams(str, i, params, defDecoder) { - while (i < str.length) { - // Consume whitespace - for (; i < str.length; ++i) { - const code = str.charCodeAt(i); - if (code !== 32/* ' ' */ && code !== 9/* '\t' */) - break; - } - - // Ended on whitespace - if (i === str.length) - break; - - // Check for malformed parameter - if (str.charCodeAt(i++) !== 59/* ';' */) - return; - - // Consume whitespace - for (; i < str.length; ++i) { - const code = str.charCodeAt(i); - if (code !== 32/* ' ' */ && code !== 9/* '\t' */) - break; - } - - // Ended on whitespace (malformed) - if (i === str.length) - return; - - let name; - const nameStart = i; - // Parse parameter name - for (; i < str.length; ++i) { - const code = str.charCodeAt(i); - if (TOKEN[code] !== 1) { - if (code === 61/* '=' */) - break; - return; - } - } - - // No value (malformed) - if (i === str.length) - return; - - let value = ''; - let valueStart; - let charset; - //~ let lang; - name = str.slice(nameStart, i); - if (name.charCodeAt(name.length - 1) === 42/* '*' */) { - // Extended value - - const charsetStart = ++i; - // Parse charset name - for (; i < str.length; ++i) { - const code = str.charCodeAt(i); - if (CHARSET[code] !== 1) { - if (code !== 39/* '\'' */) - return; - break; - } - } - - // Incomplete charset (malformed) - if (i === str.length) - return; - - charset = str.slice(charsetStart, i); - ++i; // Skip over the '\'' - - //~ const langStart = ++i; - // Parse language name - for (; i < str.length; ++i) { - const code = str.charCodeAt(i); - if (code === 39/* '\'' */) - break; - } - - // Incomplete language (malformed) - if (i === str.length) - return; - - //~ lang = str.slice(langStart, i); - ++i; // Skip over the '\'' - - // No value (malformed) - if (i === str.length) - return; - - valueStart = i; - - let encode = 0; - // Parse value - for (; i < str.length; ++i) { - const code = str.charCodeAt(i); - if (EXTENDED_VALUE[code] !== 1) { - if (code === 37/* '%' */) { - let hexUpper; - let hexLower; - if (i + 2 < str.length - && (hexUpper = HEX_VALUES[str.charCodeAt(i + 1)]) !== -1 - && (hexLower = HEX_VALUES[str.charCodeAt(i + 2)]) !== -1) { - const byteVal = (hexUpper << 4) + hexLower; - value += str.slice(valueStart, i); - value += String.fromCharCode(byteVal); - i += 2; - valueStart = i + 1; - if (byteVal >= 128) - encode = 2; - else if (encode === 0) - encode = 1; - continue; - } - // '%' disallowed in non-percent encoded contexts (malformed) - return; - } - break; - } - } - - value += str.slice(valueStart, i); - value = convertToUTF8(value, charset, encode); - if (value === undefined) - return; - } else { - // Non-extended value - - ++i; // Skip over '=' - - // No value (malformed) - if (i === str.length) - return; - - if (str.charCodeAt(i) === 34/* '"' */) { - valueStart = ++i; - let escaping = false; - // Parse quoted value - for (; i < str.length; ++i) { - const code = str.charCodeAt(i); - if (code === 92/* '\\' */) { - if (escaping) { - valueStart = i; - escaping = false; - } else { - value += str.slice(valueStart, i); - escaping = true; - } - continue; - } - if (code === 34/* '"' */) { - if (escaping) { - valueStart = i; - escaping = false; - continue; - } - value += str.slice(valueStart, i); - break; - } - if (escaping) { - valueStart = i - 1; - escaping = false; - } - // Invalid unescaped quoted character (malformed) - if (QDTEXT[code] !== 1) - return; - } - - // No end quote (malformed) - if (i === str.length) - return; - - ++i; // Skip over double quote - } else { - valueStart = i; - // Parse unquoted value - for (; i < str.length; ++i) { - const code = str.charCodeAt(i); - if (TOKEN[code] !== 1) { - // No value (malformed) - if (i === valueStart) - return; - break; - } - } - value = str.slice(valueStart, i); - } - - value = defDecoder(value, 2); - if (value === undefined) - return; - } - - name = name.toLowerCase(); - if (params[name] === undefined) - params[name] = value; - } - - return params; -} - -function getDecoder(charset) { - let lc; - while (true) { - switch (charset) { - case 'utf-8': - case 'utf8': - return decoders.utf8; - case 'latin1': - case 'ascii': // TODO: Make these a separate, strict decoder? - case 'us-ascii': - case 'iso-8859-1': - case 'iso8859-1': - case 'iso88591': - case 'iso_8859-1': - case 'windows-1252': - case 'iso_8859-1:1987': - case 'cp1252': - case 'x-cp1252': - return decoders.latin1; - case 'utf16le': - case 'utf-16le': - case 'ucs2': - case 'ucs-2': - return decoders.utf16le; - case 'base64': - return decoders.base64; - default: - if (lc === undefined) { - lc = true; - charset = charset.toLowerCase(); - continue; - } - return decoders.other.bind(charset); - } - } -} - -const decoders = { - utf8: (data, hint) => { - if (data.length === 0) - return ''; - if (typeof data === 'string') { - // If `data` never had any percent-encoded bytes or never had any that - // were outside of the ASCII range, then we can safely just return the - // input since UTF-8 is ASCII compatible - if (hint < 2) - return data; - - data = Buffer.from(data, 'latin1'); - } - return data.utf8Slice(0, data.length); - }, - - latin1: (data, hint) => { - if (data.length === 0) - return ''; - if (typeof data === 'string') - return data; - return data.latin1Slice(0, data.length); - }, - - utf16le: (data, hint) => { - if (data.length === 0) - return ''; - if (typeof data === 'string') - data = Buffer.from(data, 'latin1'); - return data.ucs2Slice(0, data.length); - }, - - base64: (data, hint) => { - if (data.length === 0) - return ''; - if (typeof data === 'string') - data = Buffer.from(data, 'latin1'); - return data.base64Slice(0, data.length); - }, - - other: (data, hint) => { - if (data.length === 0) - return ''; - if (typeof data === 'string') - data = Buffer.from(data, 'latin1'); - try { - const decoder = new TextDecoder(this); - return decoder.decode(data); - } catch {} - }, -}; - -function convertToUTF8(data, charset, hint) { - const decode = getDecoder(charset); - if (decode) - return decode(data, hint); -} - -function basename(path) { - if (typeof path !== 'string') - return ''; - for (let i = path.length - 1; i >= 0; --i) { - switch (path.charCodeAt(i)) { - case 0x2F: // '/' - case 0x5C: // '\' - path = path.slice(i + 1); - return (path === '..' || path === '.' ? '' : path); - } - } - return (path === '..' || path === '.' ? '' : path); -} - -const TOKEN = [ - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 1, 0, 1, 1, 1, 1, 1, 0, 0, 1, 1, 0, 1, 1, 0, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, - 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 0, 1, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0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1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, - 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 0, 1, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -]; - -/* eslint-disable no-multi-spaces */ -const HEX_VALUES = [ - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, -1, -1, -1, -1, -1, -1, - -1, 10, 11, 12, 13, 14, 15, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, 10, 11, 12, 13, 14, 15, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -]; -/* eslint-enable no-multi-spaces */ - -module.exports = { - basename, - convertToUTF8, - getDecoder, - parseContentType, - parseDisposition, -}; diff --git a/server/node_modules/busboy/package.json b/server/node_modules/busboy/package.json deleted file mode 100644 index ac2577f..0000000 --- a/server/node_modules/busboy/package.json +++ /dev/null @@ -1,22 +0,0 @@ -{ "name": "busboy", - "version": "1.6.0", - "author": "Brian White ", - "description": "A streaming parser for HTML form data for node.js", - "main": "./lib/index.js", - "dependencies": { - "streamsearch": "^1.1.0" - }, - "devDependencies": { - "@mscdex/eslint-config": "^1.1.0", - "eslint": "^7.32.0" - }, - "scripts": { - "test": "node test/test.js", - "lint": "eslint --cache --report-unused-disable-directives --ext=.js .eslintrc.js lib test bench", - "lint:fix": "npm run lint -- --fix" - }, - "engines": { "node": ">=10.16.0" }, - "keywords": [ "uploads", "forms", "multipart", "form-data" ], - "licenses": [ { "type": "MIT", "url": "http://github.com/mscdex/busboy/raw/master/LICENSE" } ], - "repository": { "type": "git", "url": "http://github.com/mscdex/busboy.git" } -} diff --git a/server/node_modules/busboy/test/common.js b/server/node_modules/busboy/test/common.js deleted file mode 100644 index fb82ad8..0000000 --- a/server/node_modules/busboy/test/common.js +++ /dev/null @@ -1,109 +0,0 @@ -'use strict'; - -const assert = require('assert'); -const { inspect } = require('util'); - -const mustCallChecks = []; - -function noop() {} - -function runCallChecks(exitCode) { - if (exitCode !== 0) return; - - const failed = mustCallChecks.filter((context) => { - if ('minimum' in context) { - context.messageSegment = `at least ${context.minimum}`; - return context.actual < context.minimum; - } - context.messageSegment = `exactly ${context.exact}`; - return context.actual !== context.exact; - }); - - failed.forEach((context) => { - console.error('Mismatched %s function calls. Expected %s, actual %d.', - context.name, - context.messageSegment, - context.actual); - console.error(context.stack.split('\n').slice(2).join('\n')); - }); - - if (failed.length) - process.exit(1); -} - -function mustCall(fn, exact) { - return _mustCallInner(fn, exact, 'exact'); -} - -function mustCallAtLeast(fn, minimum) { - return _mustCallInner(fn, minimum, 'minimum'); -} - -function _mustCallInner(fn, criteria = 1, field) { - if (process._exiting) - throw new Error('Cannot use common.mustCall*() in process exit handler'); - - if (typeof fn === 'number') { - criteria = fn; - fn = noop; - } else if (fn === undefined) { - fn = noop; - } - - if (typeof criteria !== 'number') - throw new TypeError(`Invalid ${field} value: ${criteria}`); - - const context = { - [field]: criteria, - actual: 0, - stack: inspect(new Error()), - name: fn.name || '' - }; - - // Add the exit listener only once to avoid listener leak warnings - if (mustCallChecks.length === 0) - process.on('exit', runCallChecks); - - mustCallChecks.push(context); - - function wrapped(...args) { - ++context.actual; - return fn.call(this, ...args); - } - // TODO: remove origFn? - wrapped.origFn = fn; - - return wrapped; -} - -function getCallSite(top) { - const originalStackFormatter = Error.prepareStackTrace; - Error.prepareStackTrace = (err, stack) => - `${stack[0].getFileName()}:${stack[0].getLineNumber()}`; - const err = new Error(); - Error.captureStackTrace(err, top); - // With the V8 Error API, the stack is not formatted until it is accessed - // eslint-disable-next-line no-unused-expressions - err.stack; - Error.prepareStackTrace = originalStackFormatter; - return err.stack; -} - -function mustNotCall(msg) { - const callSite = getCallSite(mustNotCall); - return function mustNotCall(...args) { - args = args.map(inspect).join(', '); - const argsInfo = (args.length > 0 - ? `\ncalled with arguments: ${args}` - : ''); - assert.fail( - `${msg || 'function should not have been called'} at ${callSite}` - + argsInfo); - }; -} - -module.exports = { - mustCall, - mustCallAtLeast, - mustNotCall, -}; diff --git a/server/node_modules/busboy/test/test-types-multipart-charsets.js b/server/node_modules/busboy/test/test-types-multipart-charsets.js deleted file mode 100644 index ed9c38a..0000000 --- a/server/node_modules/busboy/test/test-types-multipart-charsets.js +++ /dev/null @@ -1,94 +0,0 @@ -'use strict'; - -const assert = require('assert'); -const { inspect } = require('util'); - -const { mustCall } = require(`${__dirname}/common.js`); - -const busboy = require('..'); - -const input = Buffer.from([ - '-----------------------------paZqsnEHRufoShdX6fh0lUhXBP4k', - 'Content-Disposition: form-data; ' - + 'name="upload_file_0"; filename="テスト.dat"', - 'Content-Type: application/octet-stream', - '', - 'A'.repeat(1023), - '-----------------------------paZqsnEHRufoShdX6fh0lUhXBP4k--' -].join('\r\n')); -const boundary = '---------------------------paZqsnEHRufoShdX6fh0lUhXBP4k'; -const expected = [ - { type: 'file', - name: 'upload_file_0', - data: Buffer.from('A'.repeat(1023)), - info: { - filename: 'テスト.dat', - encoding: '7bit', - mimeType: 'application/octet-stream', - }, - limited: false, - }, -]; -const bb = busboy({ - defParamCharset: 'utf8', - headers: { - 'content-type': `multipart/form-data; boundary=${boundary}`, - } -}); -const results = []; - -bb.on('field', (name, val, info) => { - results.push({ type: 'field', name, val, info }); -}); - -bb.on('file', (name, stream, info) => { - const data = []; - let nb = 0; - const file = { - type: 'file', - name, - data: null, - info, - limited: false, - }; - results.push(file); - stream.on('data', (d) => { - data.push(d); - nb += d.length; - }).on('limit', () => { - file.limited = true; - }).on('close', () => { - file.data = Buffer.concat(data, nb); - assert.strictEqual(stream.truncated, file.limited); - }).once('error', (err) => { - file.err = err.message; - }); -}); - -bb.on('error', (err) => { - results.push({ error: err.message }); -}); - -bb.on('partsLimit', () => { - results.push('partsLimit'); -}); - -bb.on('filesLimit', () => { - results.push('filesLimit'); -}); - -bb.on('fieldsLimit', () => { - results.push('fieldsLimit'); -}); - -bb.on('close', mustCall(() => { - assert.deepStrictEqual( - results, - expected, - 'Results mismatch.\n' - + `Parsed: ${inspect(results)}\n` - + `Expected: ${inspect(expected)}` - ); -})); - -bb.end(input); diff --git a/server/node_modules/busboy/test/test-types-multipart-stream-pause.js b/server/node_modules/busboy/test/test-types-multipart-stream-pause.js deleted file mode 100644 index df7268a..0000000 --- a/server/node_modules/busboy/test/test-types-multipart-stream-pause.js +++ /dev/null @@ -1,102 +0,0 @@ -'use strict'; - -const assert = require('assert'); -const { randomFillSync } = require('crypto'); -const { inspect } = require('util'); - -const busboy = require('..'); - -const { mustCall } = require('./common.js'); - -const BOUNDARY = 'u2KxIV5yF1y+xUspOQCCZopaVgeV6Jxihv35XQJmuTx8X3sh'; - -function formDataSection(key, value) { - return Buffer.from( - `\r\n--${BOUNDARY}` - + `\r\nContent-Disposition: form-data; name="${key}"` - + `\r\n\r\n${value}` - ); -} - -function formDataFile(key, filename, contentType) { - const buf = Buffer.allocUnsafe(100000); - return Buffer.concat([ - Buffer.from(`\r\n--${BOUNDARY}\r\n`), - Buffer.from(`Content-Disposition: form-data; name="${key}"` - + `; filename="${filename}"\r\n`), - Buffer.from(`Content-Type: ${contentType}\r\n\r\n`), - randomFillSync(buf) - ]); -} - -const reqChunks = [ - Buffer.concat([ - formDataFile('file', 'file.bin', 'application/octet-stream'), - formDataSection('foo', 'foo value'), - ]), - formDataSection('bar', 'bar value'), - Buffer.from(`\r\n--${BOUNDARY}--\r\n`) -]; -const bb = busboy({ - headers: { - 'content-type': `multipart/form-data; boundary=${BOUNDARY}` - } -}); -const expected = [ - { type: 'file', - name: 'file', - info: { - filename: 'file.bin', - encoding: '7bit', - mimeType: 'application/octet-stream', - }, - }, - { type: 'field', - name: 'foo', - val: 'foo value', - info: { - nameTruncated: false, - valueTruncated: false, - encoding: '7bit', - mimeType: 'text/plain', - }, - }, - { type: 'field', - name: 'bar', - val: 'bar value', - info: { - nameTruncated: false, - valueTruncated: false, - encoding: '7bit', - mimeType: 'text/plain', - }, - }, -]; -const results = []; - -bb.on('field', (name, val, info) => { - results.push({ type: 'field', name, val, info }); -}); - -bb.on('file', (name, stream, info) => { - results.push({ type: 'file', name, info }); - // Simulate a pipe where the destination is pausing (perhaps due to waiting - // for file system write to finish) - setTimeout(() => { - stream.resume(); - }, 10); -}); - -bb.on('close', mustCall(() => { - assert.deepStrictEqual( - results, - expected, - 'Results mismatch.\n' - + `Parsed: ${inspect(results)}\n` - + `Expected: ${inspect(expected)}` - ); -})); - -for (const chunk of reqChunks) - bb.write(chunk); -bb.end(); diff --git a/server/node_modules/busboy/test/test-types-multipart.js b/server/node_modules/busboy/test/test-types-multipart.js deleted file mode 100644 index 9755642..0000000 --- a/server/node_modules/busboy/test/test-types-multipart.js +++ /dev/null @@ -1,1053 +0,0 @@ -'use strict'; - -const assert = require('assert'); -const { inspect } = require('util'); - -const busboy = require('..'); - -const active = new Map(); - -const tests = [ - { source: [ - ['-----------------------------paZqsnEHRufoShdX6fh0lUhXBP4k', - 'Content-Disposition: form-data; name="file_name_0"', - '', - 'super alpha file', - '-----------------------------paZqsnEHRufoShdX6fh0lUhXBP4k', - 'Content-Disposition: form-data; name="file_name_1"', - '', - 'super beta file', - '-----------------------------paZqsnEHRufoShdX6fh0lUhXBP4k', - 'Content-Disposition: form-data; ' - + 'name="upload_file_0"; filename="1k_a.dat"', - 'Content-Type: application/octet-stream', - '', - 'A'.repeat(1023), - '-----------------------------paZqsnEHRufoShdX6fh0lUhXBP4k', - 'Content-Disposition: form-data; ' - + 'name="upload_file_1"; filename="1k_b.dat"', - 'Content-Type: application/octet-stream', - '', - 'B'.repeat(1023), - '-----------------------------paZqsnEHRufoShdX6fh0lUhXBP4k--' - ].join('\r\n') - ], - boundary: '---------------------------paZqsnEHRufoShdX6fh0lUhXBP4k', - expected: [ - { type: 'field', - name: 'file_name_0', - val: 'super alpha file', - info: { - nameTruncated: false, - valueTruncated: false, - encoding: '7bit', - mimeType: 'text/plain', - }, - }, - { type: 'field', - name: 'file_name_1', - val: 'super beta file', - info: { - nameTruncated: false, - valueTruncated: false, - encoding: '7bit', - mimeType: 'text/plain', - }, - }, - { type: 'file', - name: 'upload_file_0', - data: Buffer.from('A'.repeat(1023)), - info: { - filename: '1k_a.dat', - encoding: '7bit', - mimeType: 'application/octet-stream', - }, - limited: false, - }, - { type: 'file', - name: 'upload_file_1', - data: Buffer.from('B'.repeat(1023)), - info: { - filename: '1k_b.dat', - encoding: '7bit', - mimeType: 'application/octet-stream', - }, - limited: false, - }, - ], - what: 'Fields and files' - }, - { source: [ - ['------WebKitFormBoundaryTB2MiQ36fnSJlrhY', - 'Content-Disposition: form-data; name="cont"', - '', - 'some random content', - '------WebKitFormBoundaryTB2MiQ36fnSJlrhY', - 'Content-Disposition: form-data; name="pass"', - '', - 'some random pass', - '------WebKitFormBoundaryTB2MiQ36fnSJlrhY', - 'Content-Disposition: form-data; name=bit', - '', - '2', - '------WebKitFormBoundaryTB2MiQ36fnSJlrhY--' - ].join('\r\n') - ], - boundary: '----WebKitFormBoundaryTB2MiQ36fnSJlrhY', - expected: [ - { type: 'field', - name: 'cont', - val: 'some random content', - info: { - nameTruncated: false, - valueTruncated: false, - encoding: '7bit', - mimeType: 'text/plain', - }, - }, - { type: 'field', - name: 'pass', - val: 'some random pass', - info: { - nameTruncated: false, - valueTruncated: false, - encoding: '7bit', - mimeType: 'text/plain', - }, - }, - { type: 'field', - name: 'bit', - val: '2', - info: { - nameTruncated: false, - valueTruncated: false, - encoding: '7bit', - mimeType: 'text/plain', - }, - }, - ], - what: 'Fields only' - }, - { source: [ - '' - ], - boundary: '----WebKitFormBoundaryTB2MiQ36fnSJlrhY', - expected: [ - { error: 'Unexpected end of form' }, - ], - what: 'No fields and no files' - }, - { source: [ - ['-----------------------------paZqsnEHRufoShdX6fh0lUhXBP4k', - 'Content-Disposition: form-data; name="file_name_0"', - '', - 'super alpha file', - '-----------------------------paZqsnEHRufoShdX6fh0lUhXBP4k', - 'Content-Disposition: form-data; ' - + 'name="upload_file_0"; filename="1k_a.dat"', - 'Content-Type: application/octet-stream', - '', - 'ABCDEFGHIJKLMNOPQRSTUVWXYZ', - '-----------------------------paZqsnEHRufoShdX6fh0lUhXBP4k--' - ].join('\r\n') - ], - boundary: '---------------------------paZqsnEHRufoShdX6fh0lUhXBP4k', - limits: { - fileSize: 13, - fieldSize: 5 - }, - expected: [ - { type: 'field', - name: 'file_name_0', - val: 'super', - info: { - nameTruncated: false, - valueTruncated: true, - encoding: '7bit', - mimeType: 'text/plain', - }, - }, - { type: 'file', - name: 'upload_file_0', - data: Buffer.from('ABCDEFGHIJKLM'), - info: { - filename: '1k_a.dat', - encoding: '7bit', - mimeType: 'application/octet-stream', - }, - limited: true, - }, - ], - what: 'Fields and files (limits)' - }, - { source: [ - ['-----------------------------paZqsnEHRufoShdX6fh0lUhXBP4k', - 'Content-Disposition: form-data; name="file_name_0"', - '', - 'super alpha file', - '-----------------------------paZqsnEHRufoShdX6fh0lUhXBP4k', - 'Content-Disposition: form-data; ' - + 'name="upload_file_0"; filename="1k_a.dat"', - 'Content-Type: application/octet-stream', - '', - 'ABCDEFGHIJKLMNOPQRSTUVWXYZ', - '-----------------------------paZqsnEHRufoShdX6fh0lUhXBP4k--' - ].join('\r\n') - ], - boundary: '---------------------------paZqsnEHRufoShdX6fh0lUhXBP4k', - limits: { - files: 0 - }, - expected: [ - { type: 'field', - name: 'file_name_0', - val: 'super alpha file', - info: { - nameTruncated: false, - valueTruncated: false, - encoding: '7bit', - mimeType: 'text/plain', - }, - }, - 'filesLimit', - ], - what: 'Fields and files (limits: 0 files)' - }, - { source: [ - ['-----------------------------paZqsnEHRufoShdX6fh0lUhXBP4k', - 'Content-Disposition: form-data; name="file_name_0"', - '', - 'super alpha file', - '-----------------------------paZqsnEHRufoShdX6fh0lUhXBP4k', - 'Content-Disposition: form-data; name="file_name_1"', - '', - 'super beta file', - '-----------------------------paZqsnEHRufoShdX6fh0lUhXBP4k', - 'Content-Disposition: form-data; ' - + 'name="upload_file_0"; filename="1k_a.dat"', - 'Content-Type: application/octet-stream', - '', - 'A'.repeat(1023), - '-----------------------------paZqsnEHRufoShdX6fh0lUhXBP4k', - 'Content-Disposition: form-data; ' - + 'name="upload_file_1"; filename="1k_b.dat"', - 'Content-Type: application/octet-stream', - '', - 'B'.repeat(1023), - '-----------------------------paZqsnEHRufoShdX6fh0lUhXBP4k--' - ].join('\r\n') - ], - boundary: '---------------------------paZqsnEHRufoShdX6fh0lUhXBP4k', - expected: [ - { type: 'field', - name: 'file_name_0', - val: 'super alpha file', - info: { - nameTruncated: false, - valueTruncated: false, - encoding: '7bit', - mimeType: 'text/plain', - }, - }, - { type: 'field', - name: 'file_name_1', - val: 'super beta file', - info: { - nameTruncated: false, - valueTruncated: false, - encoding: '7bit', - mimeType: 'text/plain', - }, - }, - ], - events: ['field'], - what: 'Fields and (ignored) files' - }, - { source: [ - ['-----------------------------paZqsnEHRufoShdX6fh0lUhXBP4k', - 'Content-Disposition: form-data; ' - + 'name="upload_file_0"; filename="/tmp/1k_a.dat"', - 'Content-Type: application/octet-stream', - '', - 'ABCDEFGHIJKLMNOPQRSTUVWXYZ', - '-----------------------------paZqsnEHRufoShdX6fh0lUhXBP4k', - 'Content-Disposition: form-data; ' - + 'name="upload_file_1"; filename="C:\\files\\1k_b.dat"', - 'Content-Type: application/octet-stream', - '', - 'ABCDEFGHIJKLMNOPQRSTUVWXYZ', - '-----------------------------paZqsnEHRufoShdX6fh0lUhXBP4k', - 'Content-Disposition: form-data; ' - + 'name="upload_file_2"; filename="relative/1k_c.dat"', - 'Content-Type: application/octet-stream', - '', - 'ABCDEFGHIJKLMNOPQRSTUVWXYZ', - '-----------------------------paZqsnEHRufoShdX6fh0lUhXBP4k--' - ].join('\r\n') - ], - boundary: '---------------------------paZqsnEHRufoShdX6fh0lUhXBP4k', - expected: [ - { type: 'file', - name: 'upload_file_0', - data: Buffer.from('ABCDEFGHIJKLMNOPQRSTUVWXYZ'), - info: { - filename: '1k_a.dat', - encoding: '7bit', - mimeType: 'application/octet-stream', - }, - limited: false, - }, - { type: 'file', - name: 'upload_file_1', - data: Buffer.from('ABCDEFGHIJKLMNOPQRSTUVWXYZ'), - info: { - filename: '1k_b.dat', - encoding: '7bit', - mimeType: 'application/octet-stream', - }, - limited: false, - }, - { type: 'file', - name: 'upload_file_2', - data: Buffer.from('ABCDEFGHIJKLMNOPQRSTUVWXYZ'), - info: { - filename: '1k_c.dat', - encoding: '7bit', - mimeType: 'application/octet-stream', - }, - limited: false, - }, - ], - what: 'Files with filenames containing paths' - }, - { source: [ - ['-----------------------------paZqsnEHRufoShdX6fh0lUhXBP4k', - 'Content-Disposition: form-data; ' - + 'name="upload_file_0"; filename="/absolute/1k_a.dat"', - 'Content-Type: application/octet-stream', - '', - 'ABCDEFGHIJKLMNOPQRSTUVWXYZ', - '-----------------------------paZqsnEHRufoShdX6fh0lUhXBP4k', - 'Content-Disposition: form-data; ' - + 'name="upload_file_1"; filename="C:\\absolute\\1k_b.dat"', - 'Content-Type: application/octet-stream', - '', - 'ABCDEFGHIJKLMNOPQRSTUVWXYZ', - '-----------------------------paZqsnEHRufoShdX6fh0lUhXBP4k', - 'Content-Disposition: form-data; ' - + 'name="upload_file_2"; filename="relative/1k_c.dat"', - 'Content-Type: application/octet-stream', - '', - 'ABCDEFGHIJKLMNOPQRSTUVWXYZ', - '-----------------------------paZqsnEHRufoShdX6fh0lUhXBP4k--' - ].join('\r\n') - ], - boundary: '---------------------------paZqsnEHRufoShdX6fh0lUhXBP4k', - preservePath: true, - expected: [ - { type: 'file', - name: 'upload_file_0', - data: Buffer.from('ABCDEFGHIJKLMNOPQRSTUVWXYZ'), - info: { - filename: '/absolute/1k_a.dat', - encoding: '7bit', - mimeType: 'application/octet-stream', - }, - limited: false, - }, - { type: 'file', - name: 'upload_file_1', - data: Buffer.from('ABCDEFGHIJKLMNOPQRSTUVWXYZ'), - info: { - filename: 'C:\\absolute\\1k_b.dat', - encoding: '7bit', - mimeType: 'application/octet-stream', - }, - limited: false, - }, - { type: 'file', - name: 'upload_file_2', - data: Buffer.from('ABCDEFGHIJKLMNOPQRSTUVWXYZ'), - info: { - filename: 'relative/1k_c.dat', - encoding: '7bit', - mimeType: 'application/octet-stream', - }, - limited: false, - }, - ], - what: 'Paths to be preserved through the preservePath option' - }, - { source: [ - ['------WebKitFormBoundaryTB2MiQ36fnSJlrhY', - 'Content-Disposition: form-data; name="cont"', - 'Content-Type: ', - '', - 'some random content', - '------WebKitFormBoundaryTB2MiQ36fnSJlrhY', - 'Content-Disposition: ', - '', - 'some random pass', - '------WebKitFormBoundaryTB2MiQ36fnSJlrhY--' - ].join('\r\n') - ], - boundary: '----WebKitFormBoundaryTB2MiQ36fnSJlrhY', - expected: [ - { type: 'field', - name: 'cont', - val: 'some random content', - info: { - nameTruncated: false, - valueTruncated: false, - encoding: '7bit', - mimeType: 'text/plain', - }, - }, - ], - what: 'Empty content-type and empty content-disposition' - }, - { source: [ - ['-----------------------------paZqsnEHRufoShdX6fh0lUhXBP4k', - 'Content-Disposition: form-data; ' - + 'name="file"; filename*=utf-8\'\'n%C3%A4me.txt', - 'Content-Type: application/octet-stream', - '', - 'ABCDEFGHIJKLMNOPQRSTUVWXYZ', - '-----------------------------paZqsnEHRufoShdX6fh0lUhXBP4k--' - ].join('\r\n') - ], - boundary: '---------------------------paZqsnEHRufoShdX6fh0lUhXBP4k', - expected: [ - { type: 'file', - name: 'file', - data: Buffer.from('ABCDEFGHIJKLMNOPQRSTUVWXYZ'), - info: { - filename: 'näme.txt', - encoding: '7bit', - mimeType: 'application/octet-stream', - }, - limited: false, - }, - ], - what: 'Unicode filenames' - }, - { source: [ - ['--asdasdasdasd\r\n', - 'Content-Type: text/plain\r\n', - 'Content-Disposition: form-data; name="foo"\r\n', - '\r\n', - 'asd\r\n', - '--asdasdasdasd--' - ].join(':)') - ], - boundary: 'asdasdasdasd', - expected: [ - { error: 'Malformed part header' }, - { error: 'Unexpected end of form' }, - ], - what: 'Stopped mid-header' - }, - { source: [ - ['------WebKitFormBoundaryTB2MiQ36fnSJlrhY', - 'Content-Disposition: form-data; name="cont"', - 'Content-Type: application/json', - '', - '{}', - '------WebKitFormBoundaryTB2MiQ36fnSJlrhY--', - ].join('\r\n') - ], - boundary: '----WebKitFormBoundaryTB2MiQ36fnSJlrhY', - expected: [ - { type: 'field', - name: 'cont', - val: '{}', - info: { - nameTruncated: false, - valueTruncated: false, - encoding: '7bit', - mimeType: 'application/json', - }, - }, - ], - what: 'content-type for fields' - }, - { source: [ - '------WebKitFormBoundaryTB2MiQ36fnSJlrhY--', - ], - boundary: '----WebKitFormBoundaryTB2MiQ36fnSJlrhY', - expected: [], - what: 'empty form' - }, - { source: [ - ['-----------------------------paZqsnEHRufoShdX6fh0lUhXBP4k', - 'Content-Disposition: form-data; ' - + 'name=upload_file_0; filename="1k_a.dat"', - 'Content-Type: application/octet-stream', - 'Content-Transfer-Encoding: binary', - '', - '', - ].join('\r\n') - ], - boundary: '---------------------------paZqsnEHRufoShdX6fh0lUhXBP4k', - expected: [ - { type: 'file', - name: 'upload_file_0', - data: Buffer.alloc(0), - info: { - filename: '1k_a.dat', - encoding: 'binary', - mimeType: 'application/octet-stream', - }, - limited: false, - err: 'Unexpected end of form', - }, - { error: 'Unexpected end of form' }, - ], - what: 'Stopped mid-file #1' - }, - { source: [ - ['-----------------------------paZqsnEHRufoShdX6fh0lUhXBP4k', - 'Content-Disposition: form-data; ' - + 'name=upload_file_0; filename="1k_a.dat"', - 'Content-Type: application/octet-stream', - '', - 'a', - ].join('\r\n') - ], - boundary: '---------------------------paZqsnEHRufoShdX6fh0lUhXBP4k', - expected: [ - { type: 'file', - name: 'upload_file_0', - data: Buffer.from('a'), - info: { - filename: '1k_a.dat', - encoding: '7bit', - mimeType: 'application/octet-stream', - }, - limited: false, - err: 'Unexpected end of form', - }, - { error: 'Unexpected end of form' }, - ], - what: 'Stopped mid-file #2' - }, - { source: [ - ['-----------------------------paZqsnEHRufoShdX6fh0lUhXBP4k', - 'Content-Disposition: form-data; ' - + 'name="upload_file_0"; filename="notes.txt"', - 'Content-Type: text/plain; charset=utf8', - '', - 'a', - '-----------------------------paZqsnEHRufoShdX6fh0lUhXBP4k--', - ].join('\r\n') - ], - boundary: '---------------------------paZqsnEHRufoShdX6fh0lUhXBP4k', - expected: [ - { type: 'file', - name: 'upload_file_0', - data: Buffer.from('a'), - info: { - filename: 'notes.txt', - encoding: '7bit', - mimeType: 'text/plain', - }, - limited: false, - }, - ], - what: 'Text file with charset' - }, - { source: [ - ['-----------------------------paZqsnEHRufoShdX6fh0lUhXBP4k', - 'Content-Disposition: form-data; ' - + 'name="upload_file_0"; filename="notes.txt"', - 'Content-Type: ', - ' text/plain; charset=utf8', - '', - 'a', - '-----------------------------paZqsnEHRufoShdX6fh0lUhXBP4k--', - ].join('\r\n') - ], - boundary: '---------------------------paZqsnEHRufoShdX6fh0lUhXBP4k', - expected: [ - { type: 'file', - name: 'upload_file_0', - data: Buffer.from('a'), - info: { - filename: 'notes.txt', - encoding: '7bit', - mimeType: 'text/plain', - }, - limited: false, - }, - ], - what: 'Folded header value' - }, - { source: [ - ['-----------------------------paZqsnEHRufoShdX6fh0lUhXBP4k', - 'Content-Type: text/plain; charset=utf8', - '', - 'a', - '-----------------------------paZqsnEHRufoShdX6fh0lUhXBP4k--', - ].join('\r\n') - ], - boundary: '---------------------------paZqsnEHRufoShdX6fh0lUhXBP4k', - expected: [], - what: 'No Content-Disposition' - }, - { source: [ - ['-----------------------------paZqsnEHRufoShdX6fh0lUhXBP4k', - 'Content-Disposition: form-data; name="file_name_0"', - '', - 'a'.repeat(64 * 1024), - '-----------------------------paZqsnEHRufoShdX6fh0lUhXBP4k', - 'Content-Disposition: form-data; ' - + 'name="upload_file_0"; filename="notes.txt"', - 'Content-Type: ', - ' text/plain; charset=utf8', - '', - 'bc', - '-----------------------------paZqsnEHRufoShdX6fh0lUhXBP4k--', - ].join('\r\n') - ], - boundary: '---------------------------paZqsnEHRufoShdX6fh0lUhXBP4k', - limits: { - fieldSize: Infinity, - }, - expected: [ - { type: 'file', - name: 'upload_file_0', - data: Buffer.from('bc'), - info: { - filename: 'notes.txt', - encoding: '7bit', - mimeType: 'text/plain', - }, - limited: false, - }, - ], - events: [ 'file' ], - what: 'Skip field parts if no listener' - }, - { source: [ - ['-----------------------------paZqsnEHRufoShdX6fh0lUhXBP4k', - 'Content-Disposition: form-data; name="file_name_0"', - '', - 'a', - '-----------------------------paZqsnEHRufoShdX6fh0lUhXBP4k', - 'Content-Disposition: form-data; ' - + 'name="upload_file_0"; filename="notes.txt"', - 'Content-Type: ', - ' text/plain; charset=utf8', - '', - 'bc', - '-----------------------------paZqsnEHRufoShdX6fh0lUhXBP4k--', - ].join('\r\n') - ], - boundary: '---------------------------paZqsnEHRufoShdX6fh0lUhXBP4k', - limits: { - parts: 1, - }, - expected: [ - { type: 'field', - name: 'file_name_0', - val: 'a', - info: { - nameTruncated: false, - valueTruncated: false, - encoding: '7bit', - mimeType: 'text/plain', - }, - }, - 'partsLimit', - ], - what: 'Parts limit' - }, - { source: [ - ['-----------------------------paZqsnEHRufoShdX6fh0lUhXBP4k', - 'Content-Disposition: form-data; name="file_name_0"', - '', - 'a', - '-----------------------------paZqsnEHRufoShdX6fh0lUhXBP4k', - 'Content-Disposition: form-data; name="file_name_1"', - '', - 'b', - '-----------------------------paZqsnEHRufoShdX6fh0lUhXBP4k--', - ].join('\r\n') - ], - boundary: '---------------------------paZqsnEHRufoShdX6fh0lUhXBP4k', - limits: { - fields: 1, - }, - expected: [ - { type: 'field', - name: 'file_name_0', - val: 'a', - info: { - nameTruncated: false, - valueTruncated: false, - encoding: '7bit', - mimeType: 'text/plain', - }, - }, - 'fieldsLimit', - ], - what: 'Fields limit' - }, - { source: [ - ['-----------------------------paZqsnEHRufoShdX6fh0lUhXBP4k', - 'Content-Disposition: form-data; ' - + 'name="upload_file_0"; filename="notes.txt"', - 'Content-Type: text/plain; charset=utf8', - '', - 'ab', - '-----------------------------paZqsnEHRufoShdX6fh0lUhXBP4k', - 'Content-Disposition: form-data; ' - + 'name="upload_file_1"; filename="notes2.txt"', - 'Content-Type: text/plain; charset=utf8', - '', - 'cd', - '-----------------------------paZqsnEHRufoShdX6fh0lUhXBP4k--', - ].join('\r\n') - ], - boundary: '---------------------------paZqsnEHRufoShdX6fh0lUhXBP4k', - limits: { - files: 1, - }, - expected: [ - { type: 'file', - name: 'upload_file_0', - data: Buffer.from('ab'), - info: { - filename: 'notes.txt', - encoding: '7bit', - mimeType: 'text/plain', - }, - limited: false, - }, - 'filesLimit', - ], - what: 'Files limit' - }, - { source: [ - ['-----------------------------paZqsnEHRufoShdX6fh0lUhXBP4k', - 'Content-Disposition: form-data; ' - + `name="upload_file_0"; filename="${'a'.repeat(64 * 1024)}.txt"`, - 'Content-Type: text/plain; charset=utf8', - '', - 'ab', - '-----------------------------paZqsnEHRufoShdX6fh0lUhXBP4k', - 'Content-Disposition: form-data; ' - + 'name="upload_file_1"; filename="notes2.txt"', - 'Content-Type: text/plain; charset=utf8', - '', - 'cd', - '-----------------------------paZqsnEHRufoShdX6fh0lUhXBP4k--', - ].join('\r\n') - ], - boundary: '---------------------------paZqsnEHRufoShdX6fh0lUhXBP4k', - expected: [ - { error: 'Malformed part header' }, - { type: 'file', - name: 'upload_file_1', - data: Buffer.from('cd'), - info: { - filename: 'notes2.txt', - encoding: '7bit', - mimeType: 'text/plain', - }, - limited: false, - }, - ], - what: 'Oversized part header' - }, - { source: [ - ['-----------------------------paZqsnEHRufoShdX6fh0lUhXBP4k', - 'Content-Disposition: form-data; ' - + 'name="upload_file_0"; filename="notes.txt"', - 'Content-Type: text/plain; charset=utf8', - '', - 'a'.repeat(31) + '\r', - ].join('\r\n'), - 'b'.repeat(40), - '\r\n-----------------------------paZqsnEHRufoShdX6fh0lUhXBP4k--', - ], - boundary: '---------------------------paZqsnEHRufoShdX6fh0lUhXBP4k', - fileHwm: 32, - expected: [ - { type: 'file', - name: 'upload_file_0', - data: Buffer.from('a'.repeat(31) + '\r' + 'b'.repeat(40)), - info: { - filename: 'notes.txt', - encoding: '7bit', - mimeType: 'text/plain', - }, - limited: false, - }, - ], - what: 'Lookbehind data should not stall file streams' - }, - { source: [ - ['-----------------------------paZqsnEHRufoShdX6fh0lUhXBP4k', - 'Content-Disposition: form-data; ' - + `name="upload_file_0"; filename="${'a'.repeat(8 * 1024)}.txt"`, - 'Content-Type: text/plain; charset=utf8', - '', - 'ab', - '-----------------------------paZqsnEHRufoShdX6fh0lUhXBP4k', - 'Content-Disposition: form-data; ' - + `name="upload_file_1"; filename="${'b'.repeat(8 * 1024)}.txt"`, - 'Content-Type: text/plain; charset=utf8', - '', - 'cd', - '-----------------------------paZqsnEHRufoShdX6fh0lUhXBP4k', - 'Content-Disposition: form-data; ' - + `name="upload_file_2"; filename="${'c'.repeat(8 * 1024)}.txt"`, - 'Content-Type: text/plain; charset=utf8', - '', - 'ef', - '-----------------------------paZqsnEHRufoShdX6fh0lUhXBP4k--', - ].join('\r\n') - ], - boundary: '---------------------------paZqsnEHRufoShdX6fh0lUhXBP4k', - expected: [ - { type: 'file', - name: 'upload_file_0', - data: Buffer.from('ab'), - info: { - filename: `${'a'.repeat(8 * 1024)}.txt`, - encoding: '7bit', - mimeType: 'text/plain', - }, - limited: false, - }, - { type: 'file', - name: 'upload_file_1', - data: Buffer.from('cd'), - info: { - filename: `${'b'.repeat(8 * 1024)}.txt`, - encoding: '7bit', - mimeType: 'text/plain', - }, - limited: false, - }, - { type: 'file', - name: 'upload_file_2', - data: Buffer.from('ef'), - info: { - filename: `${'c'.repeat(8 * 1024)}.txt`, - encoding: '7bit', - mimeType: 'text/plain', - }, - limited: false, - }, - ], - what: 'Header size limit should be per part' - }, - { source: [ - '\r\n--d1bf46b3-aa33-4061-b28d-6c5ced8b08ee\r\n', - 'Content-Type: application/gzip\r\n' - + 'Content-Encoding: gzip\r\n' - + 'Content-Disposition: form-data; name=batch-1; filename=batch-1' - + '\r\n\r\n', - '\r\n--d1bf46b3-aa33-4061-b28d-6c5ced8b08ee--', - ], - boundary: 'd1bf46b3-aa33-4061-b28d-6c5ced8b08ee', - expected: [ - { type: 'file', - name: 'batch-1', - data: Buffer.alloc(0), - info: { - filename: 'batch-1', - encoding: '7bit', - mimeType: 'application/gzip', - }, - limited: false, - }, - ], - what: 'Empty part' - }, -]; - -for (const test of tests) { - active.set(test, 1); - - const { what, boundary, events, limits, preservePath, fileHwm } = test; - const bb = busboy({ - fileHwm, - limits, - preservePath, - headers: { - 'content-type': `multipart/form-data; boundary=${boundary}`, - } - }); - const results = []; - - if (events === undefined || events.includes('field')) { - bb.on('field', (name, val, info) => { - results.push({ type: 'field', name, val, info }); - }); - } - - if (events === undefined || events.includes('file')) { - bb.on('file', (name, stream, info) => { - const data = []; - let nb = 0; - const file = { - type: 'file', - name, - data: null, - info, - limited: false, - }; - results.push(file); - stream.on('data', (d) => { - data.push(d); - nb += d.length; - }).on('limit', () => { - file.limited = true; - }).on('close', () => { - file.data = Buffer.concat(data, nb); - assert.strictEqual(stream.truncated, file.limited); - }).once('error', (err) => { - file.err = err.message; - }); - }); - } - - bb.on('error', (err) => { - results.push({ error: err.message }); - }); - - bb.on('partsLimit', () => { - results.push('partsLimit'); - }); - - bb.on('filesLimit', () => { - results.push('filesLimit'); - }); - - bb.on('fieldsLimit', () => { - results.push('fieldsLimit'); - }); - - bb.on('close', () => { - active.delete(test); - - assert.deepStrictEqual( - results, - test.expected, - `[${what}] Results mismatch.\n` - + `Parsed: ${inspect(results)}\n` - + `Expected: ${inspect(test.expected)}` - ); - }); - - for (const src of test.source) { - const buf = (typeof src === 'string' ? Buffer.from(src, 'utf8') : src); - bb.write(buf); - } - bb.end(); -} - -// Byte-by-byte versions -for (let test of tests) { - test = { ...test }; - test.what += ' (byte-by-byte)'; - active.set(test, 1); - - const { what, boundary, events, limits, preservePath, fileHwm } = test; - const bb = busboy({ - fileHwm, - limits, - preservePath, - headers: { - 'content-type': `multipart/form-data; boundary=${boundary}`, - } - }); - const results = []; - - if (events === undefined || events.includes('field')) { - bb.on('field', (name, val, info) => { - results.push({ type: 'field', name, val, info }); - }); - } - - if (events === undefined || events.includes('file')) { - bb.on('file', (name, stream, info) => { - const data = []; - let nb = 0; - const file = { - type: 'file', - name, - data: null, - info, - limited: false, - }; - results.push(file); - stream.on('data', (d) => { - data.push(d); - nb += d.length; - }).on('limit', () => { - file.limited = true; - }).on('close', () => { - file.data = Buffer.concat(data, nb); - assert.strictEqual(stream.truncated, file.limited); - }).once('error', (err) => { - file.err = err.message; - }); - }); - } - - bb.on('error', (err) => { - results.push({ error: err.message }); - }); - - bb.on('partsLimit', () => { - results.push('partsLimit'); - }); - - bb.on('filesLimit', () => { - results.push('filesLimit'); - }); - - bb.on('fieldsLimit', () => { - results.push('fieldsLimit'); - }); - - bb.on('close', () => { - active.delete(test); - - assert.deepStrictEqual( - results, - test.expected, - `[${what}] Results mismatch.\n` - + `Parsed: ${inspect(results)}\n` - + `Expected: ${inspect(test.expected)}` - ); - }); - - for (const src of test.source) { - const buf = (typeof src === 'string' ? Buffer.from(src, 'utf8') : src); - for (let i = 0; i < buf.length; ++i) - bb.write(buf.slice(i, i + 1)); - } - bb.end(); -} - -{ - let exception = false; - process.once('uncaughtException', (ex) => { - exception = true; - throw ex; - }); - process.on('exit', () => { - if (exception || active.size === 0) - return; - process.exitCode = 1; - console.error('=========================='); - console.error(`${active.size} test(s) did not finish:`); - console.error('=========================='); - console.error(Array.from(active.keys()).map((v) => v.what).join('\n')); - }); -} diff --git a/server/node_modules/busboy/test/test-types-urlencoded.js b/server/node_modules/busboy/test/test-types-urlencoded.js deleted file mode 100644 index c35962b..0000000 --- a/server/node_modules/busboy/test/test-types-urlencoded.js +++ /dev/null @@ -1,488 +0,0 @@ -'use strict'; - -const assert = require('assert'); -const { transcode } = require('buffer'); -const { inspect } = require('util'); - -const busboy = require('..'); - -const active = new Map(); - -const tests = [ - { source: ['foo'], - expected: [ - ['foo', - '', - { nameTruncated: false, - valueTruncated: false, - encoding: 'utf-8', - mimeType: 'text/plain' }, - ], - ], - what: 'Unassigned value' - }, - { source: ['foo=bar'], - expected: [ - ['foo', - 'bar', - { nameTruncated: false, - valueTruncated: false, - encoding: 'utf-8', - mimeType: 'text/plain' }, - ], - ], - what: 'Assigned value' - }, - { source: ['foo&bar=baz'], - expected: [ - ['foo', - '', - { nameTruncated: false, - valueTruncated: false, - encoding: 'utf-8', - mimeType: 'text/plain' }, - ], - ['bar', - 'baz', - { nameTruncated: false, - valueTruncated: false, - encoding: 'utf-8', - mimeType: 'text/plain' }, - ], - ], - what: 'Unassigned and assigned value' - }, - { source: ['foo=bar&baz'], - expected: [ - ['foo', - 'bar', - { nameTruncated: false, - valueTruncated: false, - encoding: 'utf-8', - mimeType: 'text/plain' }, - ], - ['baz', - '', - { nameTruncated: false, - valueTruncated: false, - encoding: 'utf-8', - mimeType: 'text/plain' }, - ], - ], - what: 'Assigned and unassigned value' - }, - { source: ['foo=bar&baz=bla'], - expected: [ - ['foo', - 'bar', - { nameTruncated: false, - valueTruncated: false, - encoding: 'utf-8', - mimeType: 'text/plain' }, - ], - ['baz', - 'bla', - { nameTruncated: false, - valueTruncated: false, - encoding: 'utf-8', - mimeType: 'text/plain' }, - ], - ], - what: 'Two assigned values' - }, - { source: ['foo&bar'], - expected: [ - ['foo', - '', - { nameTruncated: false, - valueTruncated: false, - encoding: 'utf-8', - mimeType: 'text/plain' }, - ], - ['bar', - '', - { nameTruncated: false, - valueTruncated: false, - encoding: 'utf-8', - mimeType: 'text/plain' }, - ], - ], - what: 'Two unassigned values' - }, - { source: ['foo&bar&'], - expected: [ - ['foo', - '', - { nameTruncated: false, - valueTruncated: false, - encoding: 'utf-8', - mimeType: 'text/plain' }, - ], - ['bar', - '', - { nameTruncated: false, - valueTruncated: false, - encoding: 'utf-8', - mimeType: 'text/plain' }, - ], - ], - what: 'Two unassigned values and ampersand' - }, - { source: ['foo+1=bar+baz%2Bquux'], - expected: [ - ['foo 1', - 'bar baz+quux', - { nameTruncated: false, - valueTruncated: false, - encoding: 'utf-8', - mimeType: 'text/plain' }, - ], - ], - what: 'Assigned key and value with (plus) space' - }, - { source: ['foo=bar%20baz%21'], - expected: [ - ['foo', - 'bar baz!', - { nameTruncated: false, - valueTruncated: false, - encoding: 'utf-8', - mimeType: 'text/plain' }, - ], - ], - what: 'Assigned value with encoded bytes' - }, - { source: ['foo%20bar=baz%20bla%21'], - expected: [ - ['foo bar', - 'baz bla!', - { nameTruncated: false, - valueTruncated: false, - encoding: 'utf-8', - mimeType: 'text/plain' }, - ], - ], - what: 'Assigned value with encoded bytes #2' - }, - { source: ['foo=bar%20baz%21&num=1000'], - expected: [ - ['foo', - 'bar baz!', - { nameTruncated: false, - valueTruncated: false, - encoding: 'utf-8', - mimeType: 'text/plain' }, - ], - ['num', - '1000', - { nameTruncated: false, - valueTruncated: false, - encoding: 'utf-8', - mimeType: 'text/plain' }, - ], - ], - what: 'Two assigned values, one with encoded bytes' - }, - { source: [ - Array.from(transcode(Buffer.from('foo'), 'utf8', 'utf16le')).map( - (n) => `%${n.toString(16).padStart(2, '0')}` - ).join(''), - '=', - Array.from(transcode(Buffer.from('😀!'), 'utf8', 'utf16le')).map( - (n) => `%${n.toString(16).padStart(2, '0')}` - ).join(''), - ], - expected: [ - ['foo', - '😀!', - { nameTruncated: false, - valueTruncated: false, - encoding: 'UTF-16LE', - mimeType: 'text/plain' }, - ], - ], - charset: 'UTF-16LE', - what: 'Encoded value with multi-byte charset' - }, - { source: [ - 'foo=<', - Array.from(transcode(Buffer.from('©:^þ'), 'utf8', 'latin1')).map( - (n) => `%${n.toString(16).padStart(2, '0')}` - ).join(''), - ], - expected: [ - ['foo', - '<©:^þ', - { nameTruncated: false, - valueTruncated: false, - encoding: 'ISO-8859-1', - mimeType: 'text/plain' }, - ], - ], - charset: 'ISO-8859-1', - what: 'Encoded value with single-byte, ASCII-compatible, non-UTF8 charset' - }, - { source: ['foo=bar&baz=bla'], - expected: [], - what: 'Limits: zero fields', - limits: { fields: 0 } - }, - { source: ['foo=bar&baz=bla'], - expected: [ - ['foo', - 'bar', - { nameTruncated: false, - valueTruncated: false, - encoding: 'utf-8', - mimeType: 'text/plain' }, - ], - ], - what: 'Limits: one field', - limits: { fields: 1 } - }, - { source: ['foo=bar&baz=bla'], - expected: [ - ['foo', - 'bar', - { nameTruncated: false, - valueTruncated: false, - encoding: 'utf-8', - mimeType: 'text/plain' }, - ], - ['baz', - 'bla', - { nameTruncated: false, - valueTruncated: false, - encoding: 'utf-8', - mimeType: 'text/plain' }, - ], - ], - what: 'Limits: field part lengths match limits', - limits: { fieldNameSize: 3, fieldSize: 3 } - }, - { source: ['foo=bar&baz=bla'], - expected: [ - ['fo', - 'bar', - { nameTruncated: true, - valueTruncated: false, - encoding: 'utf-8', - mimeType: 'text/plain' }, - ], - ['ba', - 'bla', - { nameTruncated: true, - valueTruncated: false, - encoding: 'utf-8', - mimeType: 'text/plain' }, - ], - ], - what: 'Limits: truncated field name', - limits: { fieldNameSize: 2 } - }, - { source: ['foo=bar&baz=bla'], - expected: [ - ['foo', - 'ba', - { nameTruncated: false, - valueTruncated: true, - encoding: 'utf-8', - mimeType: 'text/plain' }, - ], - ['baz', - 'bl', - { nameTruncated: false, - valueTruncated: true, - encoding: 'utf-8', - mimeType: 'text/plain' }, - ], - ], - what: 'Limits: truncated field value', - limits: { fieldSize: 2 } - }, - { source: ['foo=bar&baz=bla'], - expected: [ - ['fo', - 'ba', - { nameTruncated: true, - valueTruncated: true, - encoding: 'utf-8', - mimeType: 'text/plain' }, - ], - ['ba', - 'bl', - { nameTruncated: true, - valueTruncated: true, - encoding: 'utf-8', - mimeType: 'text/plain' }, - ], - ], - what: 'Limits: truncated field name and value', - limits: { fieldNameSize: 2, fieldSize: 2 } - }, - { source: ['foo=bar&baz=bla'], - expected: [ - ['fo', - '', - { nameTruncated: true, - valueTruncated: true, - encoding: 'utf-8', - mimeType: 'text/plain' }, - ], - ['ba', - '', - { nameTruncated: true, - valueTruncated: true, - encoding: 'utf-8', - mimeType: 'text/plain' }, - ], - ], - what: 'Limits: truncated field name and zero value limit', - limits: { fieldNameSize: 2, fieldSize: 0 } - }, - { source: ['foo=bar&baz=bla'], - expected: [ - ['', - '', - { nameTruncated: true, - valueTruncated: true, - encoding: 'utf-8', - mimeType: 'text/plain' }, - ], - ['', - '', - { nameTruncated: true, - valueTruncated: true, - encoding: 'utf-8', - mimeType: 'text/plain' }, - ], - ], - what: 'Limits: truncated zero field name and zero value limit', - limits: { fieldNameSize: 0, fieldSize: 0 } - }, - { source: ['&'], - expected: [], - what: 'Ampersand' - }, - { source: ['&&&&&'], - expected: [], - what: 'Many ampersands' - }, - { source: ['='], - expected: [ - ['', - '', - { nameTruncated: false, - valueTruncated: false, - encoding: 'utf-8', - mimeType: 'text/plain' }, - ], - ], - what: 'Assigned value, empty name and value' - }, - { source: [''], - expected: [], - what: 'Nothing' - }, -]; - -for (const test of tests) { - active.set(test, 1); - - const { what } = test; - const charset = test.charset || 'utf-8'; - const bb = busboy({ - limits: test.limits, - headers: { - 'content-type': `application/x-www-form-urlencoded; charset=${charset}`, - }, - }); - const results = []; - - bb.on('field', (key, val, info) => { - results.push([key, val, info]); - }); - - bb.on('file', () => { - throw new Error(`[${what}] Unexpected file`); - }); - - bb.on('close', () => { - active.delete(test); - - assert.deepStrictEqual( - results, - test.expected, - `[${what}] Results mismatch.\n` - + `Parsed: ${inspect(results)}\n` - + `Expected: ${inspect(test.expected)}` - ); - }); - - for (const src of test.source) { - const buf = (typeof src === 'string' ? Buffer.from(src, 'utf8') : src); - bb.write(buf); - } - bb.end(); -} - -// Byte-by-byte versions -for (let test of tests) { - test = { ...test }; - test.what += ' (byte-by-byte)'; - active.set(test, 1); - - const { what } = test; - const charset = test.charset || 'utf-8'; - const bb = busboy({ - limits: test.limits, - headers: { - 'content-type': `application/x-www-form-urlencoded; charset="${charset}"`, - }, - }); - const results = []; - - bb.on('field', (key, val, info) => { - results.push([key, val, info]); - }); - - bb.on('file', () => { - throw new Error(`[${what}] Unexpected file`); - }); - - bb.on('close', () => { - active.delete(test); - - assert.deepStrictEqual( - results, - test.expected, - `[${what}] Results mismatch.\n` - + `Parsed: ${inspect(results)}\n` - + `Expected: ${inspect(test.expected)}` - ); - }); - - for (const src of test.source) { - const buf = (typeof src === 'string' ? Buffer.from(src, 'utf8') : src); - for (let i = 0; i < buf.length; ++i) - bb.write(buf.slice(i, i + 1)); - } - bb.end(); -} - -{ - let exception = false; - process.once('uncaughtException', (ex) => { - exception = true; - throw ex; - }); - process.on('exit', () => { - if (exception || active.size === 0) - return; - process.exitCode = 1; - console.error('=========================='); - console.error(`${active.size} test(s) did not finish:`); - console.error('=========================='); - console.error(Array.from(active.keys()).map((v) => v.what).join('\n')); - }); -} diff --git a/server/node_modules/busboy/test/test.js b/server/node_modules/busboy/test/test.js deleted file mode 100644 index d0380f2..0000000 --- a/server/node_modules/busboy/test/test.js +++ /dev/null @@ -1,20 +0,0 @@ -'use strict'; - -const { spawnSync } = require('child_process'); -const { readdirSync } = require('fs'); -const { join } = require('path'); - -const files = readdirSync(__dirname).sort(); -for (const filename of files) { - if (filename.startsWith('test-')) { - const path = join(__dirname, filename); - console.log(`> Running ${filename} ...`); - const result = spawnSync(`${process.argv0} ${path}`, { - shell: true, - stdio: 'inherit', - windowsHide: true - }); - if (result.status !== 0) - process.exitCode = 1; - } -} diff --git a/server/node_modules/bytes/History.md b/server/node_modules/bytes/History.md deleted file mode 100644 index d60ce0e..0000000 --- a/server/node_modules/bytes/History.md +++ /dev/null @@ -1,97 +0,0 @@ -3.1.2 / 2022-01-27 -================== - - * Fix return value for un-parsable strings - -3.1.1 / 2021-11-15 -================== - - * Fix "thousandsSeparator" incorrecting formatting fractional part - -3.1.0 / 2019-01-22 -================== - - * Add petabyte (`pb`) support - -3.0.0 / 2017-08-31 -================== - - * Change "kB" to "KB" in format output - * Remove support for Node.js 0.6 - * Remove support for ComponentJS - -2.5.0 / 2017-03-24 -================== - - * Add option "unit" - -2.4.0 / 2016-06-01 -================== - - * Add option "unitSeparator" - -2.3.0 / 2016-02-15 -================== - - * Drop partial bytes on all parsed units - * Fix non-finite numbers to `.format` to return `null` - * Fix parsing byte string that looks like hex - * perf: hoist regular expressions - -2.2.0 / 2015-11-13 -================== - - * add option "decimalPlaces" - * add option "fixedDecimals" - -2.1.0 / 2015-05-21 -================== - - * add `.format` export - * add `.parse` export - -2.0.2 / 2015-05-20 -================== - - * remove map recreation - * remove unnecessary object construction - -2.0.1 / 2015-05-07 -================== - - * fix browserify require - * remove node.extend dependency - -2.0.0 / 2015-04-12 -================== - - * add option "case" - * add option "thousandsSeparator" - * return "null" on invalid parse input - * support proper round-trip: bytes(bytes(num)) === num - * units no longer case sensitive when parsing - -1.0.0 / 2014-05-05 -================== - - * add negative support. fixes #6 - -0.3.0 / 2014-03-19 -================== - - * added terabyte support - -0.2.1 / 2013-04-01 -================== - - * add .component - -0.2.0 / 2012-10-28 -================== - - * bytes(200).should.eql('200b') - -0.1.0 / 2012-07-04 -================== - - * add bytes to string conversion [yields] diff --git a/server/node_modules/bytes/LICENSE b/server/node_modules/bytes/LICENSE deleted file mode 100644 index 63e95a9..0000000 --- a/server/node_modules/bytes/LICENSE +++ /dev/null @@ -1,23 +0,0 @@ -(The MIT License) - -Copyright (c) 2012-2014 TJ Holowaychuk -Copyright (c) 2015 Jed Watson - -Permission is hereby granted, free of charge, to any person obtaining -a copy of this software and associated documentation files (the -'Software'), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sublicense, and/or sell copies of the Software, and to -permit persons to whom the Software is furnished to do so, subject to -the following conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, -TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE -SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/server/node_modules/bytes/Readme.md b/server/node_modules/bytes/Readme.md deleted file mode 100644 index 5790e23..0000000 --- a/server/node_modules/bytes/Readme.md +++ /dev/null @@ -1,152 +0,0 @@ -# Bytes utility - -[![NPM Version][npm-image]][npm-url] -[![NPM Downloads][downloads-image]][downloads-url] -[![Build Status][ci-image]][ci-url] -[![Test Coverage][coveralls-image]][coveralls-url] - -Utility to parse a string bytes (ex: `1TB`) to bytes (`1099511627776`) and vice-versa. - -## Installation - -This is a [Node.js](https://nodejs.org/en/) module available through the -[npm registry](https://www.npmjs.com/). Installation is done using the -[`npm install` command](https://docs.npmjs.com/getting-started/installing-npm-packages-locally): - -```bash -$ npm install bytes -``` - -## Usage - -```js -var bytes = require('bytes'); -``` - -#### bytes(number|string value, [options]): number|string|null - -Default export function. Delegates to either `bytes.format` or `bytes.parse` based on the type of `value`. - -**Arguments** - -| Name | Type | Description | -|---------|----------|--------------------| -| value | `number`|`string` | Number value to format or string value to parse | -| options | `Object` | Conversion options for `format` | - -**Returns** - -| Name | Type | Description | -|---------|------------------|-------------------------------------------------| -| results | `string`|`number`|`null` | Return null upon error. Numeric value in bytes, or string value otherwise. | - -**Example** - -```js -bytes(1024); -// output: '1KB' - -bytes('1KB'); -// output: 1024 -``` - -#### bytes.format(number value, [options]): string|null - -Format the given value in bytes into a string. If the value is negative, it is kept as such. If it is a float, it is - rounded. - -**Arguments** - -| Name | Type | Description | -|---------|----------|--------------------| -| value | `number` | Value in bytes | -| options | `Object` | Conversion options | - -**Options** - -| Property | Type | Description | -|-------------------|--------|-----------------------------------------------------------------------------------------| -| decimalPlaces | `number`|`null` | Maximum number of decimal places to include in output. Default value to `2`. | -| fixedDecimals | `boolean`|`null` | Whether to always display the maximum number of decimal places. Default value to `false` | -| thousandsSeparator | `string`|`null` | Example of values: `' '`, `','` and `'.'`... Default value to `''`. | -| unit | `string`|`null` | The unit in which the result will be returned (B/KB/MB/GB/TB). Default value to `''` (which means auto detect). | -| unitSeparator | `string`|`null` | Separator to use between number and unit. Default value to `''`. | - -**Returns** - -| Name | Type | Description | -|---------|------------------|-------------------------------------------------| -| results | `string`|`null` | Return null upon error. String value otherwise. | - -**Example** - -```js -bytes.format(1024); -// output: '1KB' - -bytes.format(1000); -// output: '1000B' - -bytes.format(1000, {thousandsSeparator: ' '}); -// output: '1 000B' - -bytes.format(1024 * 1.7, {decimalPlaces: 0}); -// output: '2KB' - -bytes.format(1024, {unitSeparator: ' '}); -// output: '1 KB' -``` - -#### bytes.parse(string|number value): number|null - -Parse the string value into an integer in bytes. If no unit is given, or `value` -is a number, it is assumed the value is in bytes. - -Supported units and abbreviations are as follows and are case-insensitive: - - * `b` for bytes - * `kb` for kilobytes - * `mb` for megabytes - * `gb` for gigabytes - * `tb` for terabytes - * `pb` for petabytes - -The units are in powers of two, not ten. This means 1kb = 1024b according to this parser. - -**Arguments** - -| Name | Type | Description | -|---------------|--------|--------------------| -| value | `string`|`number` | String to parse, or number in bytes. | - -**Returns** - -| Name | Type | Description | -|---------|-------------|-------------------------| -| results | `number`|`null` | Return null upon error. Value in bytes otherwise. | - -**Example** - -```js -bytes.parse('1KB'); -// output: 1024 - -bytes.parse('1024'); -// output: 1024 - -bytes.parse(1024); -// output: 1024 -``` - -## License - -[MIT](LICENSE) - -[ci-image]: https://badgen.net/github/checks/visionmedia/bytes.js/master?label=ci -[ci-url]: https://github.com/visionmedia/bytes.js/actions?query=workflow%3Aci -[coveralls-image]: https://badgen.net/coveralls/c/github/visionmedia/bytes.js/master -[coveralls-url]: https://coveralls.io/r/visionmedia/bytes.js?branch=master -[downloads-image]: https://badgen.net/npm/dm/bytes -[downloads-url]: https://npmjs.org/package/bytes -[npm-image]: https://badgen.net/npm/v/bytes -[npm-url]: https://npmjs.org/package/bytes diff --git a/server/node_modules/bytes/index.js b/server/node_modules/bytes/index.js deleted file mode 100644 index 6f2d0f8..0000000 --- a/server/node_modules/bytes/index.js +++ /dev/null @@ -1,170 +0,0 @@ -/*! - * bytes - * Copyright(c) 2012-2014 TJ Holowaychuk - * Copyright(c) 2015 Jed Watson - * MIT Licensed - */ - -'use strict'; - -/** - * Module exports. - * @public - */ - -module.exports = bytes; -module.exports.format = format; -module.exports.parse = parse; - -/** - * Module variables. - * @private - */ - -var formatThousandsRegExp = /\B(?=(\d{3})+(?!\d))/g; - -var formatDecimalsRegExp = /(?:\.0*|(\.[^0]+)0+)$/; - -var map = { - b: 1, - kb: 1 << 10, - mb: 1 << 20, - gb: 1 << 30, - tb: Math.pow(1024, 4), - pb: Math.pow(1024, 5), -}; - -var parseRegExp = /^((-|\+)?(\d+(?:\.\d+)?)) *(kb|mb|gb|tb|pb)$/i; - -/** - * Convert the given value in bytes into a string or parse to string to an integer in bytes. - * - * @param {string|number} value - * @param {{ - * case: [string], - * decimalPlaces: [number] - * fixedDecimals: [boolean] - * thousandsSeparator: [string] - * unitSeparator: [string] - * }} [options] bytes options. - * - * @returns {string|number|null} - */ - -function bytes(value, options) { - if (typeof value === 'string') { - return parse(value); - } - - if (typeof value === 'number') { - return format(value, options); - } - - return null; -} - -/** - * Format the given value in bytes into a string. - * - * If the value is negative, it is kept as such. If it is a float, - * it is rounded. - * - * @param {number} value - * @param {object} [options] - * @param {number} [options.decimalPlaces=2] - * @param {number} [options.fixedDecimals=false] - * @param {string} [options.thousandsSeparator=] - * @param {string} [options.unit=] - * @param {string} [options.unitSeparator=] - * - * @returns {string|null} - * @public - */ - -function format(value, options) { - if (!Number.isFinite(value)) { - return null; - } - - var mag = Math.abs(value); - var thousandsSeparator = (options && options.thousandsSeparator) || ''; - var unitSeparator = (options && options.unitSeparator) || ''; - var decimalPlaces = (options && options.decimalPlaces !== undefined) ? options.decimalPlaces : 2; - var fixedDecimals = Boolean(options && options.fixedDecimals); - var unit = (options && options.unit) || ''; - - if (!unit || !map[unit.toLowerCase()]) { - if (mag >= map.pb) { - unit = 'PB'; - } else if (mag >= map.tb) { - unit = 'TB'; - } else if (mag >= map.gb) { - unit = 'GB'; - } else if (mag >= map.mb) { - unit = 'MB'; - } else if (mag >= map.kb) { - unit = 'KB'; - } else { - unit = 'B'; - } - } - - var val = value / map[unit.toLowerCase()]; - var str = val.toFixed(decimalPlaces); - - if (!fixedDecimals) { - str = str.replace(formatDecimalsRegExp, '$1'); - } - - if (thousandsSeparator) { - str = str.split('.').map(function (s, i) { - return i === 0 - ? s.replace(formatThousandsRegExp, thousandsSeparator) - : s - }).join('.'); - } - - return str + unitSeparator + unit; -} - -/** - * Parse the string value into an integer in bytes. - * - * If no unit is given, it is assumed the value is in bytes. - * - * @param {number|string} val - * - * @returns {number|null} - * @public - */ - -function parse(val) { - if (typeof val === 'number' && !isNaN(val)) { - return val; - } - - if (typeof val !== 'string') { - return null; - } - - // Test if the string passed is valid - var results = parseRegExp.exec(val); - var floatValue; - var unit = 'b'; - - if (!results) { - // Nothing could be extracted from the given string - floatValue = parseInt(val, 10); - unit = 'b' - } else { - // Retrieve the value and the unit - floatValue = parseFloat(results[1]); - unit = results[4].toLowerCase(); - } - - if (isNaN(floatValue)) { - return null; - } - - return Math.floor(map[unit] * floatValue); -} diff --git a/server/node_modules/bytes/package.json b/server/node_modules/bytes/package.json deleted file mode 100644 index f2b6a8b..0000000 --- a/server/node_modules/bytes/package.json +++ /dev/null @@ -1,42 +0,0 @@ -{ - "name": "bytes", - "description": "Utility to parse a string bytes to bytes and vice-versa", - "version": "3.1.2", - "author": "TJ Holowaychuk (http://tjholowaychuk.com)", - "contributors": [ - "Jed Watson ", - "Théo FIDRY " - ], - "license": "MIT", - "keywords": [ - "byte", - "bytes", - "utility", - "parse", - "parser", - "convert", - "converter" - ], - "repository": "visionmedia/bytes.js", - "devDependencies": { - "eslint": "7.32.0", - "eslint-plugin-markdown": "2.2.1", - "mocha": "9.2.0", - "nyc": "15.1.0" - }, - "files": [ - "History.md", - "LICENSE", - "Readme.md", - "index.js" - ], - "engines": { - "node": ">= 0.8" - }, - "scripts": { - "lint": "eslint .", - "test": "mocha --check-leaks --reporter spec", - "test-ci": "nyc --reporter=lcov --reporter=text npm test", - "test-cov": "nyc --reporter=html --reporter=text npm test" - } -} diff --git a/server/node_modules/call-bind-apply-helpers/.eslintrc b/server/node_modules/call-bind-apply-helpers/.eslintrc deleted file mode 100644 index 201e859..0000000 --- a/server/node_modules/call-bind-apply-helpers/.eslintrc +++ /dev/null @@ -1,17 +0,0 @@ -{ - "root": true, - - "extends": "@ljharb", - - "rules": { - "func-name-matching": 0, - "id-length": 0, - "new-cap": [2, { - "capIsNewExceptions": [ - "GetIntrinsic", - ], - }], - "no-extra-parens": 0, - "no-magic-numbers": 0, - }, -} diff --git a/server/node_modules/call-bind-apply-helpers/.github/FUNDING.yml b/server/node_modules/call-bind-apply-helpers/.github/FUNDING.yml deleted file mode 100644 index 0011e9d..0000000 --- a/server/node_modules/call-bind-apply-helpers/.github/FUNDING.yml +++ /dev/null @@ -1,12 +0,0 @@ -# These are supported funding model platforms - -github: [ljharb] -patreon: # Replace with a single Patreon username -open_collective: # Replace with a single Open Collective username -ko_fi: # Replace with a single Ko-fi username -tidelift: npm/call-bind-apply-helpers -community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry -liberapay: # Replace with a single Liberapay username -issuehunt: # Replace with a single IssueHunt username -otechie: # Replace with a single Otechie username -custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2'] diff --git a/server/node_modules/call-bind-apply-helpers/.nycrc b/server/node_modules/call-bind-apply-helpers/.nycrc deleted file mode 100644 index bdd626c..0000000 --- a/server/node_modules/call-bind-apply-helpers/.nycrc +++ /dev/null @@ -1,9 +0,0 @@ -{ - "all": true, - "check-coverage": false, - "reporter": ["text-summary", "text", "html", "json"], - "exclude": [ - "coverage", - "test" - ] -} diff --git a/server/node_modules/call-bind-apply-helpers/CHANGELOG.md b/server/node_modules/call-bind-apply-helpers/CHANGELOG.md deleted file mode 100644 index 2484942..0000000 --- a/server/node_modules/call-bind-apply-helpers/CHANGELOG.md +++ /dev/null @@ -1,30 +0,0 @@ -# Changelog - -All notable changes to this project will be documented in this file. - -The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) -and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). - -## [v1.0.2](https://github.com/ljharb/call-bind-apply-helpers/compare/v1.0.1...v1.0.2) - 2025-02-12 - -### Commits - -- [types] improve inferred types [`e6f9586`](https://github.com/ljharb/call-bind-apply-helpers/commit/e6f95860a3c72879cb861a858cdfb8138fbedec1) -- [Dev Deps] update `@arethetypeswrong/cli`, `@ljharb/tsconfig`, `@types/tape`, `es-value-fixtures`, `for-each`, `has-strict-mode`, `object-inspect` [`e43d540`](https://github.com/ljharb/call-bind-apply-helpers/commit/e43d5409f97543bfbb11f345d47d8ce4e066d8c1) - -## [v1.0.1](https://github.com/ljharb/call-bind-apply-helpers/compare/v1.0.0...v1.0.1) - 2024-12-08 - -### Commits - -- [types] `reflectApply`: fix types [`4efc396`](https://github.com/ljharb/call-bind-apply-helpers/commit/4efc3965351a4f02cc55e836fa391d3d11ef2ef8) -- [Fix] `reflectApply`: oops, Reflect is not a function [`83cc739`](https://github.com/ljharb/call-bind-apply-helpers/commit/83cc7395de6b79b7730bdf092f1436f0b1263c75) -- [Dev Deps] update `@arethetypeswrong/cli` [`80bd5d3`](https://github.com/ljharb/call-bind-apply-helpers/commit/80bd5d3ae58b4f6b6995ce439dd5a1bcb178a940) - -## v1.0.0 - 2024-12-05 - -### Commits - -- Initial implementation, tests, readme [`7879629`](https://github.com/ljharb/call-bind-apply-helpers/commit/78796290f9b7430c9934d6f33d94ae9bc89fce04) -- Initial commit [`3f1dc16`](https://github.com/ljharb/call-bind-apply-helpers/commit/3f1dc164afc43285631b114a5f9dd9137b2b952f) -- npm init [`081df04`](https://github.com/ljharb/call-bind-apply-helpers/commit/081df048c312fcee400922026f6e97281200a603) -- Only apps should have lockfiles [`5b9ca0f`](https://github.com/ljharb/call-bind-apply-helpers/commit/5b9ca0fe8101ebfaf309c549caac4e0a017ed930) diff --git a/server/node_modules/call-bind-apply-helpers/LICENSE b/server/node_modules/call-bind-apply-helpers/LICENSE deleted file mode 100644 index f82f389..0000000 --- a/server/node_modules/call-bind-apply-helpers/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -MIT License - -Copyright (c) 2024 Jordan Harband - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/server/node_modules/call-bind-apply-helpers/README.md b/server/node_modules/call-bind-apply-helpers/README.md deleted file mode 100644 index 8fc0dae..0000000 --- a/server/node_modules/call-bind-apply-helpers/README.md +++ /dev/null @@ -1,62 +0,0 @@ -# call-bind-apply-helpers [![Version Badge][npm-version-svg]][package-url] - -[![github actions][actions-image]][actions-url] -[![coverage][codecov-image]][codecov-url] -[![dependency status][deps-svg]][deps-url] -[![dev dependency status][dev-deps-svg]][dev-deps-url] -[![License][license-image]][license-url] -[![Downloads][downloads-image]][downloads-url] - -[![npm badge][npm-badge-png]][package-url] - -Helper functions around Function call/apply/bind, for use in `call-bind`. - -The only packages that should likely ever use this package directly are `call-bind` and `get-intrinsic`. -Please use `call-bind` unless you have a very good reason not to. - -## Getting started - -```sh -npm install --save call-bind-apply-helpers -``` - -## Usage/Examples - -```js -const assert = require('assert'); -const callBindBasic = require('call-bind-apply-helpers'); - -function f(a, b) { - assert.equal(this, 1); - assert.equal(a, 2); - assert.equal(b, 3); - assert.equal(arguments.length, 2); -} - -const fBound = callBindBasic([f, 1]); - -delete Function.prototype.call; -delete Function.prototype.bind; - -fBound(2, 3); -``` - -## Tests - -Clone the repo, `npm install`, and run `npm test` - -[package-url]: https://npmjs.org/package/call-bind-apply-helpers -[npm-version-svg]: https://versionbadg.es/ljharb/call-bind-apply-helpers.svg -[deps-svg]: https://david-dm.org/ljharb/call-bind-apply-helpers.svg -[deps-url]: https://david-dm.org/ljharb/call-bind-apply-helpers -[dev-deps-svg]: https://david-dm.org/ljharb/call-bind-apply-helpers/dev-status.svg -[dev-deps-url]: https://david-dm.org/ljharb/call-bind-apply-helpers#info=devDependencies -[npm-badge-png]: https://nodei.co/npm/call-bind-apply-helpers.png?downloads=true&stars=true -[license-image]: https://img.shields.io/npm/l/call-bind-apply-helpers.svg -[license-url]: LICENSE -[downloads-image]: https://img.shields.io/npm/dm/call-bind-apply-helpers.svg -[downloads-url]: https://npm-stat.com/charts.html?package=call-bind-apply-helpers -[codecov-image]: https://codecov.io/gh/ljharb/call-bind-apply-helpers/branch/main/graphs/badge.svg -[codecov-url]: https://app.codecov.io/gh/ljharb/call-bind-apply-helpers/ -[actions-image]: https://img.shields.io/endpoint?url=https://github-actions-badge-u3jn4tfpocch.runkit.sh/ljharb/call-bind-apply-helpers -[actions-url]: https://github.com/ljharb/call-bind-apply-helpers/actions diff --git a/server/node_modules/call-bind-apply-helpers/actualApply.d.ts b/server/node_modules/call-bind-apply-helpers/actualApply.d.ts deleted file mode 100644 index b87286a..0000000 --- a/server/node_modules/call-bind-apply-helpers/actualApply.d.ts +++ /dev/null @@ -1 +0,0 @@ -export = Reflect.apply; \ No newline at end of file diff --git a/server/node_modules/call-bind-apply-helpers/actualApply.js b/server/node_modules/call-bind-apply-helpers/actualApply.js deleted file mode 100644 index ffa5135..0000000 --- a/server/node_modules/call-bind-apply-helpers/actualApply.js +++ /dev/null @@ -1,10 +0,0 @@ -'use strict'; - -var bind = require('function-bind'); - -var $apply = require('./functionApply'); -var $call = require('./functionCall'); -var $reflectApply = require('./reflectApply'); - -/** @type {import('./actualApply')} */ -module.exports = $reflectApply || bind.call($call, $apply); diff --git a/server/node_modules/call-bind-apply-helpers/applyBind.d.ts b/server/node_modules/call-bind-apply-helpers/applyBind.d.ts deleted file mode 100644 index d176c1a..0000000 --- a/server/node_modules/call-bind-apply-helpers/applyBind.d.ts +++ /dev/null @@ -1,19 +0,0 @@ -import actualApply from './actualApply'; - -type TupleSplitHead = T['length'] extends N - ? T - : T extends [...infer R, any] - ? TupleSplitHead - : never - -type TupleSplitTail = O['length'] extends N - ? T - : T extends [infer F, ...infer R] - ? TupleSplitTail<[...R], N, [...O, F]> - : never - -type TupleSplit = [TupleSplitHead, TupleSplitTail] - -declare function applyBind(...args: TupleSplit, 2>[1]): ReturnType; - -export = applyBind; \ No newline at end of file diff --git a/server/node_modules/call-bind-apply-helpers/applyBind.js b/server/node_modules/call-bind-apply-helpers/applyBind.js deleted file mode 100644 index d2b7723..0000000 --- a/server/node_modules/call-bind-apply-helpers/applyBind.js +++ /dev/null @@ -1,10 +0,0 @@ -'use strict'; - -var bind = require('function-bind'); -var $apply = require('./functionApply'); -var actualApply = require('./actualApply'); - -/** @type {import('./applyBind')} */ -module.exports = function applyBind() { - return actualApply(bind, $apply, arguments); -}; diff --git a/server/node_modules/call-bind-apply-helpers/functionApply.d.ts b/server/node_modules/call-bind-apply-helpers/functionApply.d.ts deleted file mode 100644 index 1f6e11b..0000000 --- a/server/node_modules/call-bind-apply-helpers/functionApply.d.ts +++ /dev/null @@ -1 +0,0 @@ -export = Function.prototype.apply; \ No newline at end of file diff --git a/server/node_modules/call-bind-apply-helpers/functionApply.js b/server/node_modules/call-bind-apply-helpers/functionApply.js deleted file mode 100644 index c71df9c..0000000 --- a/server/node_modules/call-bind-apply-helpers/functionApply.js +++ /dev/null @@ -1,4 +0,0 @@ -'use strict'; - -/** @type {import('./functionApply')} */ -module.exports = Function.prototype.apply; diff --git a/server/node_modules/call-bind-apply-helpers/functionCall.d.ts b/server/node_modules/call-bind-apply-helpers/functionCall.d.ts deleted file mode 100644 index 15e93df..0000000 --- a/server/node_modules/call-bind-apply-helpers/functionCall.d.ts +++ /dev/null @@ -1 +0,0 @@ -export = Function.prototype.call; \ No newline at end of file diff --git a/server/node_modules/call-bind-apply-helpers/functionCall.js b/server/node_modules/call-bind-apply-helpers/functionCall.js deleted file mode 100644 index 7a8d873..0000000 --- a/server/node_modules/call-bind-apply-helpers/functionCall.js +++ /dev/null @@ -1,4 +0,0 @@ -'use strict'; - -/** @type {import('./functionCall')} */ -module.exports = Function.prototype.call; diff --git a/server/node_modules/call-bind-apply-helpers/index.d.ts b/server/node_modules/call-bind-apply-helpers/index.d.ts deleted file mode 100644 index 541516b..0000000 --- a/server/node_modules/call-bind-apply-helpers/index.d.ts +++ /dev/null @@ -1,64 +0,0 @@ -type RemoveFromTuple< - Tuple extends readonly unknown[], - RemoveCount extends number, - Index extends 1[] = [] -> = Index["length"] extends RemoveCount - ? Tuple - : Tuple extends [infer First, ...infer Rest] - ? RemoveFromTuple - : Tuple; - -type ConcatTuples< - Prefix extends readonly unknown[], - Suffix extends readonly unknown[] -> = [...Prefix, ...Suffix]; - -type ExtractFunctionParams = T extends (this: infer TThis, ...args: infer P extends readonly unknown[]) => infer R - ? { thisArg: TThis; params: P; returnType: R } - : never; - -type BindFunction< - T extends (this: any, ...args: any[]) => any, - TThis, - TBoundArgs extends readonly unknown[], - ReceiverBound extends boolean -> = ExtractFunctionParams extends { - thisArg: infer OrigThis; - params: infer P extends readonly unknown[]; - returnType: infer R; -} - ? ReceiverBound extends true - ? (...args: RemoveFromTuple>) => R extends [OrigThis, ...infer Rest] - ? [TThis, ...Rest] // Replace `this` with `thisArg` - : R - : >>( - thisArg: U, - ...args: RemainingArgs - ) => R extends [OrigThis, ...infer Rest] - ? [U, ...ConcatTuples] // Preserve bound args in return type - : R - : never; - -declare function callBind< - const T extends (this: any, ...args: any[]) => any, - Extracted extends ExtractFunctionParams, - const TBoundArgs extends Partial & readonly unknown[], - const TThis extends Extracted["thisArg"] ->( - args: [fn: T, thisArg: TThis, ...boundArgs: TBoundArgs] -): BindFunction; - -declare function callBind< - const T extends (this: any, ...args: any[]) => any, - Extracted extends ExtractFunctionParams, - const TBoundArgs extends Partial & readonly unknown[] ->( - args: [fn: T, ...boundArgs: TBoundArgs] -): BindFunction; - -declare function callBind( - args: [fn: Exclude, ...rest: TArgs] -): never; - -// export as namespace callBind; -export = callBind; diff --git a/server/node_modules/call-bind-apply-helpers/index.js b/server/node_modules/call-bind-apply-helpers/index.js deleted file mode 100644 index 2f6dab4..0000000 --- a/server/node_modules/call-bind-apply-helpers/index.js +++ /dev/null @@ -1,15 +0,0 @@ -'use strict'; - -var bind = require('function-bind'); -var $TypeError = require('es-errors/type'); - -var $call = require('./functionCall'); -var $actualApply = require('./actualApply'); - -/** @type {(args: [Function, thisArg?: unknown, ...args: unknown[]]) => Function} TODO FIXME, find a way to use import('.') */ -module.exports = function callBindBasic(args) { - if (args.length < 1 || typeof args[0] !== 'function') { - throw new $TypeError('a function is required'); - } - return $actualApply(bind, $call, args); -}; diff --git a/server/node_modules/call-bind-apply-helpers/package.json b/server/node_modules/call-bind-apply-helpers/package.json deleted file mode 100644 index 923b8be..0000000 --- a/server/node_modules/call-bind-apply-helpers/package.json +++ /dev/null @@ -1,85 +0,0 @@ -{ - "name": "call-bind-apply-helpers", - "version": "1.0.2", - "description": "Helper functions around Function call/apply/bind, for use in `call-bind`", - "main": "index.js", - "exports": { - ".": "./index.js", - "./actualApply": "./actualApply.js", - "./applyBind": "./applyBind.js", - "./functionApply": "./functionApply.js", - "./functionCall": "./functionCall.js", - "./reflectApply": "./reflectApply.js", - "./package.json": "./package.json" - }, - "scripts": { - "prepack": "npmignore --auto --commentLines=auto", - "prepublish": "not-in-publish || npm run prepublishOnly", - "prepublishOnly": "safe-publish-latest", - "prelint": "evalmd README.md", - "lint": "eslint --ext=.js,.mjs .", - "postlint": "tsc -p . && attw -P", - "pretest": "npm run lint", - "tests-only": "nyc tape 'test/**/*.js'", - "test": "npm run tests-only", - "posttest": "npx npm@'>=10.2' audit --production", - "version": "auto-changelog && git add CHANGELOG.md", - "postversion": "auto-changelog && git add CHANGELOG.md && git commit --no-edit --amend && git tag -f \"v$(node -e \"console.log(require('./package.json').version)\")\"" - }, - "repository": { - "type": "git", - "url": "git+https://github.com/ljharb/call-bind-apply-helpers.git" - }, - "author": "Jordan Harband ", - "license": "MIT", - "bugs": { - "url": "https://github.com/ljharb/call-bind-apply-helpers/issues" - }, - "homepage": "https://github.com/ljharb/call-bind-apply-helpers#readme", - "dependencies": { - "es-errors": "^1.3.0", - "function-bind": "^1.1.2" - }, - "devDependencies": { - "@arethetypeswrong/cli": "^0.17.3", - "@ljharb/eslint-config": "^21.1.1", - "@ljharb/tsconfig": "^0.2.3", - "@types/for-each": "^0.3.3", - "@types/function-bind": "^1.1.10", - "@types/object-inspect": "^1.13.0", - "@types/tape": "^5.8.1", - "auto-changelog": "^2.5.0", - "encoding": "^0.1.13", - "es-value-fixtures": "^1.7.1", - "eslint": "=8.8.0", - "evalmd": "^0.0.19", - "for-each": "^0.3.5", - "has-strict-mode": "^1.1.0", - "in-publish": "^2.0.1", - "npmignore": "^0.3.1", - "nyc": "^10.3.2", - "object-inspect": "^1.13.4", - "safe-publish-latest": "^2.0.0", - "tape": "^5.9.0", - "typescript": "next" - }, - "testling": { - "files": "test/index.js" - }, - "auto-changelog": { - "output": "CHANGELOG.md", - "template": "keepachangelog", - "unreleased": false, - "commitLimit": false, - "backfillLimit": false, - "hideCredit": true - }, - "publishConfig": { - "ignore": [ - ".github/workflows" - ] - }, - "engines": { - "node": ">= 0.4" - } -} diff --git a/server/node_modules/call-bind-apply-helpers/reflectApply.d.ts b/server/node_modules/call-bind-apply-helpers/reflectApply.d.ts deleted file mode 100644 index 6b2ae76..0000000 --- a/server/node_modules/call-bind-apply-helpers/reflectApply.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -declare const reflectApply: false | typeof Reflect.apply; - -export = reflectApply; diff --git a/server/node_modules/call-bind-apply-helpers/reflectApply.js b/server/node_modules/call-bind-apply-helpers/reflectApply.js deleted file mode 100644 index 3d03caa..0000000 --- a/server/node_modules/call-bind-apply-helpers/reflectApply.js +++ /dev/null @@ -1,4 +0,0 @@ -'use strict'; - -/** @type {import('./reflectApply')} */ -module.exports = typeof Reflect !== 'undefined' && Reflect && Reflect.apply; diff --git a/server/node_modules/call-bind-apply-helpers/test/index.js b/server/node_modules/call-bind-apply-helpers/test/index.js deleted file mode 100644 index 1cdc89e..0000000 --- a/server/node_modules/call-bind-apply-helpers/test/index.js +++ /dev/null @@ -1,63 +0,0 @@ -'use strict'; - -var callBind = require('../'); -var hasStrictMode = require('has-strict-mode')(); -var forEach = require('for-each'); -var inspect = require('object-inspect'); -var v = require('es-value-fixtures'); - -var test = require('tape'); - -test('callBindBasic', function (t) { - forEach(v.nonFunctions, function (nonFunction) { - t['throws']( - // @ts-expect-error - function () { callBind([nonFunction]); }, - TypeError, - inspect(nonFunction) + ' is not a function' - ); - }); - - var sentinel = { sentinel: true }; - /** @type {(this: T, a: A, b: B) => [T | undefined, A, B]} */ - var func = function (a, b) { - // eslint-disable-next-line no-invalid-this - return [!hasStrictMode && this === global ? undefined : this, a, b]; - }; - t.equal(func.length, 2, 'original function length is 2'); - - /** type {(thisArg: unknown, a: number, b: number) => [unknown, number, number]} */ - var bound = callBind([func]); - /** type {((a: number, b: number) => [typeof sentinel, typeof a, typeof b])} */ - var boundR = callBind([func, sentinel]); - /** type {((b: number) => [typeof sentinel, number, typeof b])} */ - var boundArg = callBind([func, sentinel, /** @type {const} */ (1)]); - - // @ts-expect-error - t.deepEqual(bound(), [undefined, undefined, undefined], 'bound func with no args'); - - // @ts-expect-error - t.deepEqual(func(), [undefined, undefined, undefined], 'unbound func with too few args'); - // @ts-expect-error - t.deepEqual(bound(1, 2), [hasStrictMode ? 1 : Object(1), 2, undefined], 'bound func too few args'); - // @ts-expect-error - t.deepEqual(boundR(), [sentinel, undefined, undefined], 'bound func with receiver, with too few args'); - // @ts-expect-error - t.deepEqual(boundArg(), [sentinel, 1, undefined], 'bound func with receiver and arg, with too few args'); - - t.deepEqual(func(1, 2), [undefined, 1, 2], 'unbound func with right args'); - t.deepEqual(bound(1, 2, 3), [hasStrictMode ? 1 : Object(1), 2, 3], 'bound func with right args'); - t.deepEqual(boundR(1, 2), [sentinel, 1, 2], 'bound func with receiver, with right args'); - t.deepEqual(boundArg(2), [sentinel, 1, 2], 'bound func with receiver and arg, with right arg'); - - // @ts-expect-error - t.deepEqual(func(1, 2, 3), [undefined, 1, 2], 'unbound func with too many args'); - // @ts-expect-error - t.deepEqual(bound(1, 2, 3, 4), [hasStrictMode ? 1 : Object(1), 2, 3], 'bound func with too many args'); - // @ts-expect-error - t.deepEqual(boundR(1, 2, 3), [sentinel, 1, 2], 'bound func with receiver, with too many args'); - // @ts-expect-error - t.deepEqual(boundArg(2, 3), [sentinel, 1, 2], 'bound func with receiver and arg, with too many args'); - - t.end(); -}); diff --git a/server/node_modules/call-bind-apply-helpers/tsconfig.json b/server/node_modules/call-bind-apply-helpers/tsconfig.json deleted file mode 100644 index aef9993..0000000 --- a/server/node_modules/call-bind-apply-helpers/tsconfig.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "extends": "@ljharb/tsconfig", - "compilerOptions": { - "target": "es2021", - }, - "exclude": [ - "coverage", - ], -} \ No newline at end of file diff --git a/server/node_modules/call-bound/.eslintrc b/server/node_modules/call-bound/.eslintrc deleted file mode 100644 index 2612ed8..0000000 --- a/server/node_modules/call-bound/.eslintrc +++ /dev/null @@ -1,13 +0,0 @@ -{ - "root": true, - - "extends": "@ljharb", - - "rules": { - "new-cap": [2, { - "capIsNewExceptions": [ - "GetIntrinsic", - ], - }], - }, -} diff --git a/server/node_modules/call-bound/.github/FUNDING.yml b/server/node_modules/call-bound/.github/FUNDING.yml deleted file mode 100644 index 2a2a135..0000000 --- a/server/node_modules/call-bound/.github/FUNDING.yml +++ /dev/null @@ -1,12 +0,0 @@ -# These are supported funding model platforms - -github: [ljharb] -patreon: # Replace with a single Patreon username -open_collective: # Replace with a single Open Collective username -ko_fi: # Replace with a single Ko-fi username -tidelift: npm/call-bound -community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry -liberapay: # Replace with a single Liberapay username -issuehunt: # Replace with a single IssueHunt username -otechie: # Replace with a single Otechie username -custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2'] diff --git a/server/node_modules/call-bound/.nycrc b/server/node_modules/call-bound/.nycrc deleted file mode 100644 index bdd626c..0000000 --- a/server/node_modules/call-bound/.nycrc +++ /dev/null @@ -1,9 +0,0 @@ -{ - "all": true, - "check-coverage": false, - "reporter": ["text-summary", "text", "html", "json"], - "exclude": [ - "coverage", - "test" - ] -} diff --git a/server/node_modules/call-bound/CHANGELOG.md b/server/node_modules/call-bound/CHANGELOG.md deleted file mode 100644 index 8bde4e9..0000000 --- a/server/node_modules/call-bound/CHANGELOG.md +++ /dev/null @@ -1,42 +0,0 @@ -# Changelog - -All notable changes to this project will be documented in this file. - -The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) -and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). - -## [v1.0.4](https://github.com/ljharb/call-bound/compare/v1.0.3...v1.0.4) - 2025-03-03 - -### Commits - -- [types] improve types [`e648922`](https://github.com/ljharb/call-bound/commit/e6489222a9e54f350fbf952ceabe51fd8b6027ff) -- [Dev Deps] update `@arethetypeswrong/cli`, `@ljharb/tsconfig`, `@types/tape`, `es-value-fixtures`, `for-each`, `has-strict-mode`, `object-inspect` [`a42a5eb`](https://github.com/ljharb/call-bound/commit/a42a5ebe6c1b54fcdc7997c7dc64fdca9e936719) -- [Deps] update `call-bind-apply-helpers`, `get-intrinsic` [`f529eac`](https://github.com/ljharb/call-bound/commit/f529eac132404c17156bbc23ab2297a25d0f20b8) - -## [v1.0.3](https://github.com/ljharb/call-bound/compare/v1.0.2...v1.0.3) - 2024-12-15 - -### Commits - -- [Refactor] use `call-bind-apply-helpers` instead of `call-bind` [`5e0b134`](https://github.com/ljharb/call-bound/commit/5e0b13496df14fb7d05dae9412f088da8d3f75be) -- [Deps] update `get-intrinsic` [`41fc967`](https://github.com/ljharb/call-bound/commit/41fc96732a22c7b7e8f381f93ccc54bb6293be2e) -- [readme] fix example [`79a0137`](https://github.com/ljharb/call-bound/commit/79a0137723f7c6d09c9c05452bbf8d5efb5d6e49) -- [meta] add `sideEffects` flag [`08b07be`](https://github.com/ljharb/call-bound/commit/08b07be7f1c03f67dc6f3cdaf0906259771859f7) - -## [v1.0.2](https://github.com/ljharb/call-bound/compare/v1.0.1...v1.0.2) - 2024-12-10 - -### Commits - -- [Dev Deps] update `@arethetypeswrong/cli`, `@ljharb/tsconfig`, `gopd` [`e6a5ffe`](https://github.com/ljharb/call-bound/commit/e6a5ffe849368fe4f74dfd6cdeca1b9baa39e8d5) -- [Deps] update `call-bind`, `get-intrinsic` [`2aeb5b5`](https://github.com/ljharb/call-bound/commit/2aeb5b521dc2b2683d1345c753ea1161de2d1c14) -- [types] improve return type [`1a0c9fe`](https://github.com/ljharb/call-bound/commit/1a0c9fe3114471e7ca1f57d104e2efe713bb4871) - -## v1.0.1 - 2024-12-05 - -### Commits - -- Initial implementation, tests, readme, types [`6d94121`](https://github.com/ljharb/call-bound/commit/6d94121a9243602e506334069f7a03189fe3363d) -- Initial commit [`0eae867`](https://github.com/ljharb/call-bound/commit/0eae867334ea025c33e6e91cdecfc9df96680cf9) -- npm init [`71b2479`](https://github.com/ljharb/call-bound/commit/71b2479c6723e0b7d91a6b663613067e98b7b275) -- Only apps should have lockfiles [`c3754a9`](https://github.com/ljharb/call-bound/commit/c3754a949b7f9132b47e2d18c1729889736741eb) -- [actions] skip `npm ls` in node < 10 [`74275a5`](https://github.com/ljharb/call-bound/commit/74275a5186b8caf6309b6b97472bdcb0df4683a8) -- [Dev Deps] add missing peer dep [`1354de8`](https://github.com/ljharb/call-bound/commit/1354de8679413e4ae9c523d85f76fa7a5e032d97) diff --git a/server/node_modules/call-bound/LICENSE b/server/node_modules/call-bound/LICENSE deleted file mode 100644 index f82f389..0000000 --- a/server/node_modules/call-bound/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -MIT License - -Copyright (c) 2024 Jordan Harband - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/server/node_modules/call-bound/README.md b/server/node_modules/call-bound/README.md deleted file mode 100644 index a44e43e..0000000 --- a/server/node_modules/call-bound/README.md +++ /dev/null @@ -1,53 +0,0 @@ -# call-bound [![Version Badge][npm-version-svg]][package-url] - -[![github actions][actions-image]][actions-url] -[![coverage][codecov-image]][codecov-url] -[![dependency status][deps-svg]][deps-url] -[![dev dependency status][dev-deps-svg]][dev-deps-url] -[![License][license-image]][license-url] -[![Downloads][downloads-image]][downloads-url] - -[![npm badge][npm-badge-png]][package-url] - -Robust call-bound JavaScript intrinsics, using `call-bind` and `get-intrinsic`. - -## Getting started - -```sh -npm install --save call-bound -``` - -## Usage/Examples - -```js -const assert = require('assert'); -const callBound = require('call-bound'); - -const slice = callBound('Array.prototype.slice'); - -delete Function.prototype.call; -delete Function.prototype.bind; -delete Array.prototype.slice; - -assert.deepEqual(slice([1, 2, 3, 4], 1, -1), [2, 3]); -``` - -## Tests - -Clone the repo, `npm install`, and run `npm test` - -[package-url]: https://npmjs.org/package/call-bound -[npm-version-svg]: https://versionbadg.es/ljharb/call-bound.svg -[deps-svg]: https://david-dm.org/ljharb/call-bound.svg -[deps-url]: https://david-dm.org/ljharb/call-bound -[dev-deps-svg]: https://david-dm.org/ljharb/call-bound/dev-status.svg -[dev-deps-url]: https://david-dm.org/ljharb/call-bound#info=devDependencies -[npm-badge-png]: https://nodei.co/npm/call-bound.png?downloads=true&stars=true -[license-image]: https://img.shields.io/npm/l/call-bound.svg -[license-url]: LICENSE -[downloads-image]: https://img.shields.io/npm/dm/call-bound.svg -[downloads-url]: https://npm-stat.com/charts.html?package=call-bound -[codecov-image]: https://codecov.io/gh/ljharb/call-bound/branch/main/graphs/badge.svg -[codecov-url]: https://app.codecov.io/gh/ljharb/call-bound/ -[actions-image]: https://img.shields.io/endpoint?url=https://github-actions-badge-u3jn4tfpocch.runkit.sh/ljharb/call-bound -[actions-url]: https://github.com/ljharb/call-bound/actions diff --git a/server/node_modules/call-bound/index.d.ts b/server/node_modules/call-bound/index.d.ts deleted file mode 100644 index 5562f00..0000000 --- a/server/node_modules/call-bound/index.d.ts +++ /dev/null @@ -1,94 +0,0 @@ -type Intrinsic = typeof globalThis; - -type IntrinsicName = keyof Intrinsic | `%${keyof Intrinsic}%`; - -type IntrinsicPath = IntrinsicName | `${StripPercents}.${string}` | `%${StripPercents}.${string}%`; - -type AllowMissing = boolean; - -type StripPercents = T extends `%${infer U}%` ? U : T; - -type BindMethodPrecise = - F extends (this: infer This, ...args: infer Args) => infer R - ? (obj: This, ...args: Args) => R - : F extends { - (this: infer This1, ...args: infer Args1): infer R1; - (this: infer This2, ...args: infer Args2): infer R2 - } - ? { - (obj: This1, ...args: Args1): R1; - (obj: This2, ...args: Args2): R2 - } - : never - -// Extract method type from a prototype -type GetPrototypeMethod = - (typeof globalThis)[T] extends { prototype: any } - ? M extends keyof (typeof globalThis)[T]['prototype'] - ? (typeof globalThis)[T]['prototype'][M] - : never - : never - -// Get static property/method -type GetStaticMember = - P extends keyof (typeof globalThis)[T] ? (typeof globalThis)[T][P] : never - -// Type that maps string path to actual bound function or value with better precision -type BoundIntrinsic = - S extends `${infer Obj}.prototype.${infer Method}` - ? Obj extends keyof typeof globalThis - ? BindMethodPrecise> - : unknown - : S extends `${infer Obj}.${infer Prop}` - ? Obj extends keyof typeof globalThis - ? GetStaticMember - : unknown - : unknown - -declare function arraySlice(array: readonly T[], start?: number, end?: number): T[]; -declare function arraySlice(array: ArrayLike, start?: number, end?: number): T[]; -declare function arraySlice(array: IArguments, start?: number, end?: number): T[]; - -// Special cases for methods that need explicit typing -interface SpecialCases { - '%Object.prototype.isPrototypeOf%': (thisArg: {}, obj: unknown) => boolean; - '%String.prototype.replace%': { - (str: string, searchValue: string | RegExp, replaceValue: string): string; - (str: string, searchValue: string | RegExp, replacer: (substring: string, ...args: any[]) => string): string - }; - '%Object.prototype.toString%': (obj: {}) => string; - '%Object.prototype.hasOwnProperty%': (obj: {}, v: PropertyKey) => boolean; - '%Array.prototype.slice%': typeof arraySlice; - '%Array.prototype.map%': (array: readonly T[], callbackfn: (value: T, index: number, array: readonly T[]) => U, thisArg?: any) => U[]; - '%Array.prototype.filter%': (array: readonly T[], predicate: (value: T, index: number, array: readonly T[]) => unknown, thisArg?: any) => T[]; - '%Array.prototype.indexOf%': (array: readonly T[], searchElement: T, fromIndex?: number) => number; - '%Function.prototype.apply%': (fn: (...args: A) => R, thisArg: any, args: A) => R; - '%Function.prototype.call%': (fn: (...args: A) => R, thisArg: any, ...args: A) => R; - '%Function.prototype.bind%': (fn: (...args: A) => R, thisArg: any, ...args: A) => (...remainingArgs: A) => R; - '%Promise.prototype.then%': { - (promise: Promise, onfulfilled: (value: T) => R | PromiseLike): Promise; - (promise: Promise, onfulfilled: ((value: T) => R | PromiseLike) | undefined | null, onrejected: (reason: any) => R | PromiseLike): Promise; - }; - '%RegExp.prototype.test%': (regexp: RegExp, str: string) => boolean; - '%RegExp.prototype.exec%': (regexp: RegExp, str: string) => RegExpExecArray | null; - '%Error.prototype.toString%': (error: Error) => string; - '%TypeError.prototype.toString%': (error: TypeError) => string; - '%String.prototype.split%': ( - obj: unknown, - splitter: string | RegExp | { - [Symbol.split](string: string, limit?: number): string[]; - }, - limit?: number | undefined - ) => string[]; -} - -/** - * Returns a bound function for a prototype method, or a value for a static property. - * - * @param name - The name of the intrinsic (e.g. 'Array.prototype.slice') - * @param {AllowMissing} [allowMissing] - Whether to allow missing intrinsics (default: false) - */ -declare function callBound, S extends IntrinsicPath>(name: K, allowMissing?: AllowMissing): SpecialCases[`%${StripPercents}%`]; -declare function callBound, S extends IntrinsicPath>(name: S, allowMissing?: AllowMissing): BoundIntrinsic; - -export = callBound; diff --git a/server/node_modules/call-bound/index.js b/server/node_modules/call-bound/index.js deleted file mode 100644 index e9ade74..0000000 --- a/server/node_modules/call-bound/index.js +++ /dev/null @@ -1,19 +0,0 @@ -'use strict'; - -var GetIntrinsic = require('get-intrinsic'); - -var callBindBasic = require('call-bind-apply-helpers'); - -/** @type {(thisArg: string, searchString: string, position?: number) => number} */ -var $indexOf = callBindBasic([GetIntrinsic('%String.prototype.indexOf%')]); - -/** @type {import('.')} */ -module.exports = function callBoundIntrinsic(name, allowMissing) { - /* eslint no-extra-parens: 0 */ - - var intrinsic = /** @type {(this: unknown, ...args: unknown[]) => unknown} */ (GetIntrinsic(name, !!allowMissing)); - if (typeof intrinsic === 'function' && $indexOf(name, '.prototype.') > -1) { - return callBindBasic(/** @type {const} */ ([intrinsic])); - } - return intrinsic; -}; diff --git a/server/node_modules/call-bound/package.json b/server/node_modules/call-bound/package.json deleted file mode 100644 index d542db4..0000000 --- a/server/node_modules/call-bound/package.json +++ /dev/null @@ -1,99 +0,0 @@ -{ - "name": "call-bound", - "version": "1.0.4", - "description": "Robust call-bound JavaScript intrinsics, using `call-bind` and `get-intrinsic`.", - "main": "index.js", - "exports": { - ".": "./index.js", - "./package.json": "./package.json" - }, - "sideEffects": false, - "scripts": { - "prepack": "npmignore --auto --commentLines=auto", - "prepublish": "not-in-publish || npm run prepublishOnly", - "prepublishOnly": "safe-publish-latest", - "prelint": "evalmd README.md", - "lint": "eslint --ext=.js,.mjs .", - "postlint": "tsc -p . && attw -P", - "pretest": "npm run lint", - "tests-only": "nyc tape 'test/**/*.js'", - "test": "npm run tests-only", - "posttest": "npx npm@'>=10.2' audit --production", - "version": "auto-changelog && git add CHANGELOG.md", - "postversion": "auto-changelog && git add CHANGELOG.md && git commit --no-edit --amend && git tag -f \"v$(node -e \"console.log(require('./package.json').version)\")\"" - }, - "repository": { - "type": "git", - "url": "git+https://github.com/ljharb/call-bound.git" - }, - "keywords": [ - "javascript", - "ecmascript", - "es", - "js", - "callbind", - "callbound", - "call", - "bind", - "bound", - "call-bind", - "call-bound", - "function", - "es-abstract" - ], - "author": "Jordan Harband ", - "funding": { - "url": "https://github.com/sponsors/ljharb" - }, - "license": "MIT", - "bugs": { - "url": "https://github.com/ljharb/call-bound/issues" - }, - "homepage": "https://github.com/ljharb/call-bound#readme", - "dependencies": { - "call-bind-apply-helpers": "^1.0.2", - "get-intrinsic": "^1.3.0" - }, - "devDependencies": { - "@arethetypeswrong/cli": "^0.17.4", - "@ljharb/eslint-config": "^21.1.1", - "@ljharb/tsconfig": "^0.3.0", - "@types/call-bind": "^1.0.5", - "@types/get-intrinsic": "^1.2.3", - "@types/tape": "^5.8.1", - "auto-changelog": "^2.5.0", - "encoding": "^0.1.13", - "es-value-fixtures": "^1.7.1", - "eslint": "=8.8.0", - "evalmd": "^0.0.19", - "for-each": "^0.3.5", - "gopd": "^1.2.0", - "has-strict-mode": "^1.1.0", - "in-publish": "^2.0.1", - "npmignore": "^0.3.1", - "nyc": "^10.3.2", - "object-inspect": "^1.13.4", - "safe-publish-latest": "^2.0.0", - "tape": "^5.9.0", - "typescript": "next" - }, - "testling": { - "files": "test/index.js" - }, - "auto-changelog": { - "output": "CHANGELOG.md", - "template": "keepachangelog", - "unreleased": false, - "commitLimit": false, - "backfillLimit": false, - "hideCredit": true - }, - "publishConfig": { - "ignore": [ - ".github/workflows" - ] - }, - "engines": { - "node": ">= 0.4" - } -} diff --git a/server/node_modules/call-bound/test/index.js b/server/node_modules/call-bound/test/index.js deleted file mode 100644 index a2fc9f0..0000000 --- a/server/node_modules/call-bound/test/index.js +++ /dev/null @@ -1,61 +0,0 @@ -'use strict'; - -var test = require('tape'); - -var callBound = require('../'); - -/** @template {true} T @template U @typedef {T extends U ? T : never} AssertType */ - -test('callBound', function (t) { - // static primitive - t.equal(callBound('Array.length'), Array.length, 'Array.length yields itself'); - t.equal(callBound('%Array.length%'), Array.length, '%Array.length% yields itself'); - - // static non-function object - t.equal(callBound('Array.prototype'), Array.prototype, 'Array.prototype yields itself'); - t.equal(callBound('%Array.prototype%'), Array.prototype, '%Array.prototype% yields itself'); - t.equal(callBound('Array.constructor'), Array.constructor, 'Array.constructor yields itself'); - t.equal(callBound('%Array.constructor%'), Array.constructor, '%Array.constructor% yields itself'); - - // static function - t.equal(callBound('Date.parse'), Date.parse, 'Date.parse yields itself'); - t.equal(callBound('%Date.parse%'), Date.parse, '%Date.parse% yields itself'); - - // prototype primitive - t.equal(callBound('Error.prototype.message'), Error.prototype.message, 'Error.prototype.message yields itself'); - t.equal(callBound('%Error.prototype.message%'), Error.prototype.message, '%Error.prototype.message% yields itself'); - - var x = callBound('Object.prototype.toString'); - var y = callBound('%Object.prototype.toString%'); - - // prototype function - t.notEqual(x, Object.prototype.toString, 'Object.prototype.toString does not yield itself'); - t.notEqual(y, Object.prototype.toString, '%Object.prototype.toString% does not yield itself'); - t.equal(x(true), Object.prototype.toString.call(true), 'call-bound Object.prototype.toString calls into the original'); - t.equal(y(true), Object.prototype.toString.call(true), 'call-bound %Object.prototype.toString% calls into the original'); - - t['throws']( - // @ts-expect-error - function () { callBound('does not exist'); }, - SyntaxError, - 'nonexistent intrinsic throws' - ); - t['throws']( - // @ts-expect-error - function () { callBound('does not exist', true); }, - SyntaxError, - 'allowMissing arg still throws for unknown intrinsic' - ); - - t.test('real but absent intrinsic', { skip: typeof WeakRef !== 'undefined' }, function (st) { - st['throws']( - function () { callBound('WeakRef'); }, - TypeError, - 'real but absent intrinsic throws' - ); - st.equal(callBound('WeakRef', true), undefined, 'allowMissing arg avoids exception'); - st.end(); - }); - - t.end(); -}); diff --git a/server/node_modules/call-bound/tsconfig.json b/server/node_modules/call-bound/tsconfig.json deleted file mode 100644 index 8976d98..0000000 --- a/server/node_modules/call-bound/tsconfig.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "extends": "@ljharb/tsconfig", - "compilerOptions": { - "target": "ESNext", - "lib": ["es2024"], - }, - "exclude": [ - "coverage", - ], -} diff --git a/server/node_modules/combined-stream/License b/server/node_modules/combined-stream/License deleted file mode 100644 index 4804b7a..0000000 --- a/server/node_modules/combined-stream/License +++ /dev/null @@ -1,19 +0,0 @@ -Copyright (c) 2011 Debuggable Limited - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/server/node_modules/combined-stream/Readme.md b/server/node_modules/combined-stream/Readme.md deleted file mode 100644 index 9e367b5..0000000 --- a/server/node_modules/combined-stream/Readme.md +++ /dev/null @@ -1,138 +0,0 @@ -# combined-stream - -A stream that emits multiple other streams one after another. - -**NB** Currently `combined-stream` works with streams version 1 only. There is ongoing effort to switch this library to streams version 2. Any help is welcome. :) Meanwhile you can explore other libraries that provide streams2 support with more or less compatibility with `combined-stream`. - -- [combined-stream2](https://www.npmjs.com/package/combined-stream2): A drop-in streams2-compatible replacement for the combined-stream module. - -- [multistream](https://www.npmjs.com/package/multistream): A stream that emits multiple other streams one after another. - -## Installation - -``` bash -npm install combined-stream -``` - -## Usage - -Here is a simple example that shows how you can use combined-stream to combine -two files into one: - -``` javascript -var CombinedStream = require('combined-stream'); -var fs = require('fs'); - -var combinedStream = CombinedStream.create(); -combinedStream.append(fs.createReadStream('file1.txt')); -combinedStream.append(fs.createReadStream('file2.txt')); - -combinedStream.pipe(fs.createWriteStream('combined.txt')); -``` - -While the example above works great, it will pause all source streams until -they are needed. If you don't want that to happen, you can set `pauseStreams` -to `false`: - -``` javascript -var CombinedStream = require('combined-stream'); -var fs = require('fs'); - -var combinedStream = CombinedStream.create({pauseStreams: false}); -combinedStream.append(fs.createReadStream('file1.txt')); -combinedStream.append(fs.createReadStream('file2.txt')); - -combinedStream.pipe(fs.createWriteStream('combined.txt')); -``` - -However, what if you don't have all the source streams yet, or you don't want -to allocate the resources (file descriptors, memory, etc.) for them right away? -Well, in that case you can simply provide a callback that supplies the stream -by calling a `next()` function: - -``` javascript -var CombinedStream = require('combined-stream'); -var fs = require('fs'); - -var combinedStream = CombinedStream.create(); -combinedStream.append(function(next) { - next(fs.createReadStream('file1.txt')); -}); -combinedStream.append(function(next) { - next(fs.createReadStream('file2.txt')); -}); - -combinedStream.pipe(fs.createWriteStream('combined.txt')); -``` - -## API - -### CombinedStream.create([options]) - -Returns a new combined stream object. Available options are: - -* `maxDataSize` -* `pauseStreams` - -The effect of those options is described below. - -### combinedStream.pauseStreams = `true` - -Whether to apply back pressure to the underlaying streams. If set to `false`, -the underlaying streams will never be paused. If set to `true`, the -underlaying streams will be paused right after being appended, as well as when -`delayedStream.pipe()` wants to throttle. - -### combinedStream.maxDataSize = `2 * 1024 * 1024` - -The maximum amount of bytes (or characters) to buffer for all source streams. -If this value is exceeded, `combinedStream` emits an `'error'` event. - -### combinedStream.dataSize = `0` - -The amount of bytes (or characters) currently buffered by `combinedStream`. - -### combinedStream.append(stream) - -Appends the given `stream` to the combinedStream object. If `pauseStreams` is -set to `true, this stream will also be paused right away. - -`streams` can also be a function that takes one parameter called `next`. `next` -is a function that must be invoked in order to provide the `next` stream, see -example above. - -Regardless of how the `stream` is appended, combined-stream always attaches an -`'error'` listener to it, so you don't have to do that manually. - -Special case: `stream` can also be a String or Buffer. - -### combinedStream.write(data) - -You should not call this, `combinedStream` takes care of piping the appended -streams into itself for you. - -### combinedStream.resume() - -Causes `combinedStream` to start drain the streams it manages. The function is -idempotent, and also emits a `'resume'` event each time which usually goes to -the stream that is currently being drained. - -### combinedStream.pause(); - -If `combinedStream.pauseStreams` is set to `false`, this does nothing. -Otherwise a `'pause'` event is emitted, this goes to the stream that is -currently being drained, so you can use it to apply back pressure. - -### combinedStream.end(); - -Sets `combinedStream.writable` to false, emits an `'end'` event, and removes -all streams from the queue. - -### combinedStream.destroy(); - -Same as `combinedStream.end()`, except it emits a `'close'` event instead of -`'end'`. - -## License - -combined-stream is licensed under the MIT license. diff --git a/server/node_modules/combined-stream/lib/combined_stream.js b/server/node_modules/combined-stream/lib/combined_stream.js deleted file mode 100644 index 125f097..0000000 --- a/server/node_modules/combined-stream/lib/combined_stream.js +++ /dev/null @@ -1,208 +0,0 @@ -var util = require('util'); -var Stream = require('stream').Stream; -var DelayedStream = require('delayed-stream'); - -module.exports = CombinedStream; -function CombinedStream() { - this.writable = false; - this.readable = true; - this.dataSize = 0; - this.maxDataSize = 2 * 1024 * 1024; - this.pauseStreams = true; - - this._released = false; - this._streams = []; - this._currentStream = null; - this._insideLoop = false; - this._pendingNext = false; -} -util.inherits(CombinedStream, Stream); - -CombinedStream.create = function(options) { - var combinedStream = new this(); - - options = options || {}; - for (var option in options) { - combinedStream[option] = options[option]; - } - - return combinedStream; -}; - -CombinedStream.isStreamLike = function(stream) { - return (typeof stream !== 'function') - && (typeof stream !== 'string') - && (typeof stream !== 'boolean') - && (typeof stream !== 'number') - && (!Buffer.isBuffer(stream)); -}; - -CombinedStream.prototype.append = function(stream) { - var isStreamLike = CombinedStream.isStreamLike(stream); - - if (isStreamLike) { - if (!(stream instanceof DelayedStream)) { - var newStream = DelayedStream.create(stream, { - maxDataSize: Infinity, - pauseStream: this.pauseStreams, - }); - stream.on('data', this._checkDataSize.bind(this)); - stream = newStream; - } - - this._handleErrors(stream); - - if (this.pauseStreams) { - stream.pause(); - } - } - - this._streams.push(stream); - return this; -}; - -CombinedStream.prototype.pipe = function(dest, options) { - Stream.prototype.pipe.call(this, dest, options); - this.resume(); - return dest; -}; - -CombinedStream.prototype._getNext = function() { - this._currentStream = null; - - if (this._insideLoop) { - this._pendingNext = true; - return; // defer call - } - - this._insideLoop = true; - try { - do { - this._pendingNext = false; - this._realGetNext(); - } while (this._pendingNext); - } finally { - this._insideLoop = false; - } -}; - -CombinedStream.prototype._realGetNext = function() { - var stream = this._streams.shift(); - - - if (typeof stream == 'undefined') { - this.end(); - return; - } - - if (typeof stream !== 'function') { - this._pipeNext(stream); - return; - } - - var getStream = stream; - getStream(function(stream) { - var isStreamLike = CombinedStream.isStreamLike(stream); - if (isStreamLike) { - stream.on('data', this._checkDataSize.bind(this)); - this._handleErrors(stream); - } - - this._pipeNext(stream); - }.bind(this)); -}; - -CombinedStream.prototype._pipeNext = function(stream) { - this._currentStream = stream; - - var isStreamLike = CombinedStream.isStreamLike(stream); - if (isStreamLike) { - stream.on('end', this._getNext.bind(this)); - stream.pipe(this, {end: false}); - return; - } - - var value = stream; - this.write(value); - this._getNext(); -}; - -CombinedStream.prototype._handleErrors = function(stream) { - var self = this; - stream.on('error', function(err) { - self._emitError(err); - }); -}; - -CombinedStream.prototype.write = function(data) { - this.emit('data', data); -}; - -CombinedStream.prototype.pause = function() { - if (!this.pauseStreams) { - return; - } - - if(this.pauseStreams && this._currentStream && typeof(this._currentStream.pause) == 'function') this._currentStream.pause(); - this.emit('pause'); -}; - -CombinedStream.prototype.resume = function() { - if (!this._released) { - this._released = true; - this.writable = true; - this._getNext(); - } - - if(this.pauseStreams && this._currentStream && typeof(this._currentStream.resume) == 'function') this._currentStream.resume(); - this.emit('resume'); -}; - -CombinedStream.prototype.end = function() { - this._reset(); - this.emit('end'); -}; - -CombinedStream.prototype.destroy = function() { - this._reset(); - this.emit('close'); -}; - -CombinedStream.prototype._reset = function() { - this.writable = false; - this._streams = []; - this._currentStream = null; -}; - -CombinedStream.prototype._checkDataSize = function() { - this._updateDataSize(); - if (this.dataSize <= this.maxDataSize) { - return; - } - - var message = - 'DelayedStream#maxDataSize of ' + this.maxDataSize + ' bytes exceeded.'; - this._emitError(new Error(message)); -}; - -CombinedStream.prototype._updateDataSize = function() { - this.dataSize = 0; - - var self = this; - this._streams.forEach(function(stream) { - if (!stream.dataSize) { - return; - } - - self.dataSize += stream.dataSize; - }); - - if (this._currentStream && this._currentStream.dataSize) { - this.dataSize += this._currentStream.dataSize; - } -}; - -CombinedStream.prototype._emitError = function(err) { - this._reset(); - this.emit('error', err); -}; diff --git a/server/node_modules/combined-stream/package.json b/server/node_modules/combined-stream/package.json deleted file mode 100644 index 6982b6d..0000000 --- a/server/node_modules/combined-stream/package.json +++ /dev/null @@ -1,25 +0,0 @@ -{ - "author": "Felix Geisendörfer (http://debuggable.com/)", - "name": "combined-stream", - "description": "A stream that emits multiple other streams one after another.", - "version": "1.0.8", - "homepage": "https://github.com/felixge/node-combined-stream", - "repository": { - "type": "git", - "url": "git://github.com/felixge/node-combined-stream.git" - }, - "main": "./lib/combined_stream", - "scripts": { - "test": "node test/run.js" - }, - "engines": { - "node": ">= 0.8" - }, - "dependencies": { - "delayed-stream": "~1.0.0" - }, - "devDependencies": { - "far": "~0.0.7" - }, - "license": "MIT" -} diff --git a/server/node_modules/combined-stream/yarn.lock b/server/node_modules/combined-stream/yarn.lock deleted file mode 100644 index 7edf418..0000000 --- a/server/node_modules/combined-stream/yarn.lock +++ /dev/null @@ -1,17 +0,0 @@ -# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. -# yarn lockfile v1 - - -delayed-stream@~1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/delayed-stream/-/delayed-stream-1.0.0.tgz#df3ae199acadfb7d440aaae0b29e2272b24ec619" - -far@~0.0.7: - version "0.0.7" - resolved "https://registry.yarnpkg.com/far/-/far-0.0.7.tgz#01c1fd362bcd26ce9cf161af3938aa34619f79a7" - dependencies: - oop "0.0.3" - -oop@0.0.3: - version "0.0.3" - resolved "https://registry.yarnpkg.com/oop/-/oop-0.0.3.tgz#70fa405a5650891a194fdc82ca68dad6dabf4401" diff --git a/server/node_modules/concat-stream/LICENSE b/server/node_modules/concat-stream/LICENSE deleted file mode 100644 index 99c130e..0000000 --- a/server/node_modules/concat-stream/LICENSE +++ /dev/null @@ -1,24 +0,0 @@ -The MIT License - -Copyright (c) 2013 Max Ogden - -Permission is hereby granted, free of charge, -to any person obtaining a copy of this software and -associated documentation files (the "Software"), to -deal in the Software without restriction, including -without limitation the rights to use, copy, modify, -merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom -the Software is furnished to do so, -subject to the following conditions: - -The above copyright notice and this permission notice -shall be included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES -OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR -ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, -TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE -SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. \ No newline at end of file diff --git a/server/node_modules/concat-stream/index.js b/server/node_modules/concat-stream/index.js deleted file mode 100644 index dd672a7..0000000 --- a/server/node_modules/concat-stream/index.js +++ /dev/null @@ -1,144 +0,0 @@ -var Writable = require('readable-stream').Writable -var inherits = require('inherits') -var bufferFrom = require('buffer-from') - -if (typeof Uint8Array === 'undefined') { - var U8 = require('typedarray').Uint8Array -} else { - var U8 = Uint8Array -} - -function ConcatStream(opts, cb) { - if (!(this instanceof ConcatStream)) return new ConcatStream(opts, cb) - - if (typeof opts === 'function') { - cb = opts - opts = {} - } - if (!opts) opts = {} - - var encoding = opts.encoding - var shouldInferEncoding = false - - if (!encoding) { - shouldInferEncoding = true - } else { - encoding = String(encoding).toLowerCase() - if (encoding === 'u8' || encoding === 'uint8') { - encoding = 'uint8array' - } - } - - Writable.call(this, { objectMode: true }) - - this.encoding = encoding - this.shouldInferEncoding = shouldInferEncoding - - if (cb) this.on('finish', function () { cb(this.getBody()) }) - this.body = [] -} - -module.exports = ConcatStream -inherits(ConcatStream, Writable) - -ConcatStream.prototype._write = function(chunk, enc, next) { - this.body.push(chunk) - next() -} - -ConcatStream.prototype.inferEncoding = function (buff) { - var firstBuffer = buff === undefined ? this.body[0] : buff; - if (Buffer.isBuffer(firstBuffer)) return 'buffer' - if (typeof Uint8Array !== 'undefined' && firstBuffer instanceof Uint8Array) return 'uint8array' - if (Array.isArray(firstBuffer)) return 'array' - if (typeof firstBuffer === 'string') return 'string' - if (Object.prototype.toString.call(firstBuffer) === "[object Object]") return 'object' - return 'buffer' -} - -ConcatStream.prototype.getBody = function () { - if (!this.encoding && this.body.length === 0) return [] - if (this.shouldInferEncoding) this.encoding = this.inferEncoding() - if (this.encoding === 'array') return arrayConcat(this.body) - if (this.encoding === 'string') return stringConcat(this.body) - if (this.encoding === 'buffer') return bufferConcat(this.body) - if (this.encoding === 'uint8array') return u8Concat(this.body) - return this.body -} - -var isArray = Array.isArray || function (arr) { - return Object.prototype.toString.call(arr) == '[object Array]' -} - -function isArrayish (arr) { - return /Array\]$/.test(Object.prototype.toString.call(arr)) -} - -function isBufferish (p) { - return typeof p === 'string' || isArrayish(p) || (p && typeof p.subarray === 'function') -} - -function stringConcat (parts) { - var strings = [] - var needsToString = false - for (var i = 0; i < parts.length; i++) { - var p = parts[i] - if (typeof p === 'string') { - strings.push(p) - } else if (Buffer.isBuffer(p)) { - strings.push(p) - } else if (isBufferish(p)) { - strings.push(bufferFrom(p)) - } else { - strings.push(bufferFrom(String(p))) - } - } - if (Buffer.isBuffer(parts[0])) { - strings = Buffer.concat(strings) - strings = strings.toString('utf8') - } else { - strings = strings.join('') - } - return strings -} - -function bufferConcat (parts) { - var bufs = [] - for (var i = 0; i < parts.length; i++) { - var p = parts[i] - if (Buffer.isBuffer(p)) { - bufs.push(p) - } else if (isBufferish(p)) { - bufs.push(bufferFrom(p)) - } else { - bufs.push(bufferFrom(String(p))) - } - } - return Buffer.concat(bufs) -} - -function arrayConcat (parts) { - var res = [] - for (var i = 0; i < parts.length; i++) { - res.push.apply(res, parts[i]) - } - return res -} - -function u8Concat (parts) { - var len = 0 - for (var i = 0; i < parts.length; i++) { - if (typeof parts[i] === 'string') { - parts[i] = bufferFrom(parts[i]) - } - len += parts[i].length - } - var u8 = new U8(len) - for (var i = 0, offset = 0; i < parts.length; i++) { - var part = parts[i] - for (var j = 0; j < part.length; j++) { - u8[offset++] = part[j] - } - } - return u8 -} diff --git a/server/node_modules/concat-stream/package.json b/server/node_modules/concat-stream/package.json deleted file mode 100644 index 3797828..0000000 --- a/server/node_modules/concat-stream/package.json +++ /dev/null @@ -1,55 +0,0 @@ -{ - "name": "concat-stream", - "version": "2.0.0", - "description": "writable stream that concatenates strings or binary data and calls a callback with the result", - "tags": [ - "stream", - "simple", - "util", - "utility" - ], - "author": "Max Ogden ", - "repository": { - "type": "git", - "url": "http://github.com/maxogden/concat-stream.git" - }, - "bugs": { - "url": "http://github.com/maxogden/concat-stream/issues" - }, - "engines": [ - "node >= 6.0" - ], - "main": "index.js", - "files": [ - "index.js" - ], - "scripts": { - "test": "tape test/*.js test/server/*.js" - }, - "license": "MIT", - "dependencies": { - "buffer-from": "^1.0.0", - "inherits": "^2.0.3", - "readable-stream": "^3.0.2", - "typedarray": "^0.0.6" - }, - "devDependencies": { - "tape": "^4.6.3" - }, - "testling": { - "files": "test/*.js", - "browsers": [ - "ie/8..latest", - "firefox/17..latest", - "firefox/nightly", - "chrome/22..latest", - "chrome/canary", - "opera/12..latest", - "opera/next", - "safari/5.1..latest", - "ipad/6.0..latest", - "iphone/6.0..latest", - "android-browser/4.2..latest" - ] - } -} diff --git a/server/node_modules/concat-stream/readme.md b/server/node_modules/concat-stream/readme.md deleted file mode 100644 index 7aa19c4..0000000 --- a/server/node_modules/concat-stream/readme.md +++ /dev/null @@ -1,102 +0,0 @@ -# concat-stream - -Writable stream that concatenates all the data from a stream and calls a callback with the result. Use this when you want to collect all the data from a stream into a single buffer. - -[![Build Status](https://travis-ci.org/maxogden/concat-stream.svg?branch=master)](https://travis-ci.org/maxogden/concat-stream) - -[![NPM](https://nodei.co/npm/concat-stream.png)](https://nodei.co/npm/concat-stream/) - -### description - -Streams emit many buffers. If you want to collect all of the buffers, and when the stream ends concatenate all of the buffers together and receive a single buffer then this is the module for you. - -Only use this if you know you can fit all of the output of your stream into a single Buffer (e.g. in RAM). - -There are also `objectMode` streams that emit things other than Buffers, and you can concatenate these too. See below for details. - -## Related - -`concat-stream` is part of the [mississippi stream utility collection](https://github.com/maxogden/mississippi) which includes more useful stream modules similar to this one. - -### examples - -#### Buffers - -```js -var fs = require('fs') -var concat = require('concat-stream') - -var readStream = fs.createReadStream('cat.png') -var concatStream = concat(gotPicture) - -readStream.on('error', handleError) -readStream.pipe(concatStream) - -function gotPicture(imageBuffer) { - // imageBuffer is all of `cat.png` as a node.js Buffer -} - -function handleError(err) { - // handle your error appropriately here, e.g.: - console.error(err) // print the error to STDERR - process.exit(1) // exit program with non-zero exit code -} - -``` - -#### Arrays - -```js -var write = concat(function(data) {}) -write.write([1,2,3]) -write.write([4,5,6]) -write.end() -// data will be [1,2,3,4,5,6] in the above callback -``` - -#### Uint8Arrays - -```js -var write = concat(function(data) {}) -var a = new Uint8Array(3) -a[0] = 97; a[1] = 98; a[2] = 99 -write.write(a) -write.write('!') -write.end(Buffer.from('!!1')) -``` - -See `test/` for more examples - -# methods - -```js -var concat = require('concat-stream') -``` - -## var writable = concat(opts={}, cb) - -Return a `writable` stream that will fire `cb(data)` with all of the data that -was written to the stream. Data can be written to `writable` as strings, -Buffers, arrays of byte integers, and Uint8Arrays. - -By default `concat-stream` will give you back the same data type as the type of the first buffer written to the stream. Use `opts.encoding` to set what format `data` should be returned as, e.g. if you if you don't want to rely on the built-in type checking or for some other reason. - -* `string` - get a string -* `buffer` - get back a Buffer -* `array` - get an array of byte integers -* `uint8array`, `u8`, `uint8` - get back a Uint8Array -* `object`, get back an array of Objects - -If you don't specify an encoding, and the types can't be inferred (e.g. you write things that aren't in the list above), it will try to convert concat them into a `Buffer`. - -If nothing is written to `writable` then `data` will be an empty array `[]`. - -# error handling - -`concat-stream` does not handle errors for you, so you must handle errors on whatever streams you pipe into `concat-stream`. This is a general rule when programming with node.js streams: always handle errors on each and every stream. Since `concat-stream` is not itself a stream it does not emit errors. - -We recommend using [`end-of-stream`](https://npmjs.org/end-of-stream) or [`pump`](https://npmjs.org/pump) for writing error tolerant stream code. - -# license - -MIT LICENSE diff --git a/server/node_modules/content-disposition/HISTORY.md b/server/node_modules/content-disposition/HISTORY.md deleted file mode 100644 index 488effa..0000000 --- a/server/node_modules/content-disposition/HISTORY.md +++ /dev/null @@ -1,60 +0,0 @@ -0.5.4 / 2021-12-10 -================== - - * deps: safe-buffer@5.2.1 - -0.5.3 / 2018-12-17 -================== - - * Use `safe-buffer` for improved Buffer API - -0.5.2 / 2016-12-08 -================== - - * Fix `parse` to accept any linear whitespace character - -0.5.1 / 2016-01-17 -================== - - * perf: enable strict mode - -0.5.0 / 2014-10-11 -================== - - * Add `parse` function - -0.4.0 / 2014-09-21 -================== - - * Expand non-Unicode `filename` to the full ISO-8859-1 charset - -0.3.0 / 2014-09-20 -================== - - * Add `fallback` option - * Add `type` option - -0.2.0 / 2014-09-19 -================== - - * Reduce ambiguity of file names with hex escape in buggy browsers - -0.1.2 / 2014-09-19 -================== - - * Fix periodic invalid Unicode filename header - -0.1.1 / 2014-09-19 -================== - - * Fix invalid characters appearing in `filename*` parameter - -0.1.0 / 2014-09-18 -================== - - * Make the `filename` argument optional - -0.0.0 / 2014-09-18 -================== - - * Initial release diff --git a/server/node_modules/content-disposition/LICENSE b/server/node_modules/content-disposition/LICENSE deleted file mode 100644 index 84441fb..0000000 --- a/server/node_modules/content-disposition/LICENSE +++ /dev/null @@ -1,22 +0,0 @@ -(The MIT License) - -Copyright (c) 2014-2017 Douglas Christopher Wilson - -Permission is hereby granted, free of charge, to any person obtaining -a copy of this software and associated documentation files (the -'Software'), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sublicense, and/or sell copies of the Software, and to -permit persons to whom the Software is furnished to do so, subject to -the following conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, -TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE -SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/server/node_modules/content-disposition/README.md b/server/node_modules/content-disposition/README.md deleted file mode 100644 index 3a0bb05..0000000 --- a/server/node_modules/content-disposition/README.md +++ /dev/null @@ -1,142 +0,0 @@ -# content-disposition - -[![NPM Version][npm-image]][npm-url] -[![NPM Downloads][downloads-image]][downloads-url] -[![Node.js Version][node-version-image]][node-version-url] -[![Build Status][github-actions-ci-image]][github-actions-ci-url] -[![Test Coverage][coveralls-image]][coveralls-url] - -Create and parse HTTP `Content-Disposition` header - -## Installation - -```sh -$ npm install content-disposition -``` - -## API - -```js -var contentDisposition = require('content-disposition') -``` - -### contentDisposition(filename, options) - -Create an attachment `Content-Disposition` header value using the given file name, -if supplied. The `filename` is optional and if no file name is desired, but you -want to specify `options`, set `filename` to `undefined`. - -```js -res.setHeader('Content-Disposition', contentDisposition('∫ maths.pdf')) -``` - -**note** HTTP headers are of the ISO-8859-1 character set. If you are writing this -header through a means different from `setHeader` in Node.js, you'll want to specify -the `'binary'` encoding in Node.js. - -#### Options - -`contentDisposition` accepts these properties in the options object. - -##### fallback - -If the `filename` option is outside ISO-8859-1, then the file name is actually -stored in a supplemental field for clients that support Unicode file names and -a ISO-8859-1 version of the file name is automatically generated. - -This specifies the ISO-8859-1 file name to override the automatic generation or -disables the generation all together, defaults to `true`. - - - A string will specify the ISO-8859-1 file name to use in place of automatic - generation. - - `false` will disable including a ISO-8859-1 file name and only include the - Unicode version (unless the file name is already ISO-8859-1). - - `true` will enable automatic generation if the file name is outside ISO-8859-1. - -If the `filename` option is ISO-8859-1 and this option is specified and has a -different value, then the `filename` option is encoded in the extended field -and this set as the fallback field, even though they are both ISO-8859-1. - -##### type - -Specifies the disposition type, defaults to `"attachment"`. This can also be -`"inline"`, or any other value (all values except inline are treated like -`attachment`, but can convey additional information if both parties agree to -it). The type is normalized to lower-case. - -### contentDisposition.parse(string) - -```js -var disposition = contentDisposition.parse('attachment; filename="EURO rates.txt"; filename*=UTF-8\'\'%e2%82%ac%20rates.txt') -``` - -Parse a `Content-Disposition` header string. This automatically handles extended -("Unicode") parameters by decoding them and providing them under the standard -parameter name. This will return an object with the following properties (examples -are shown for the string `'attachment; filename="EURO rates.txt"; filename*=UTF-8\'\'%e2%82%ac%20rates.txt'`): - - - `type`: The disposition type (always lower case). Example: `'attachment'` - - - `parameters`: An object of the parameters in the disposition (name of parameter - always lower case and extended versions replace non-extended versions). Example: - `{filename: "€ rates.txt"}` - -## Examples - -### Send a file for download - -```js -var contentDisposition = require('content-disposition') -var destroy = require('destroy') -var fs = require('fs') -var http = require('http') -var onFinished = require('on-finished') - -var filePath = '/path/to/public/plans.pdf' - -http.createServer(function onRequest (req, res) { - // set headers - res.setHeader('Content-Type', 'application/pdf') - res.setHeader('Content-Disposition', contentDisposition(filePath)) - - // send file - var stream = fs.createReadStream(filePath) - stream.pipe(res) - onFinished(res, function () { - destroy(stream) - }) -}) -``` - -## Testing - -```sh -$ npm test -``` - -## References - -- [RFC 2616: Hypertext Transfer Protocol -- HTTP/1.1][rfc-2616] -- [RFC 5987: Character Set and Language Encoding for Hypertext Transfer Protocol (HTTP) Header Field Parameters][rfc-5987] -- [RFC 6266: Use of the Content-Disposition Header Field in the Hypertext Transfer Protocol (HTTP)][rfc-6266] -- [Test Cases for HTTP Content-Disposition header field (RFC 6266) and the Encodings defined in RFCs 2047, 2231 and 5987][tc-2231] - -[rfc-2616]: https://tools.ietf.org/html/rfc2616 -[rfc-5987]: https://tools.ietf.org/html/rfc5987 -[rfc-6266]: https://tools.ietf.org/html/rfc6266 -[tc-2231]: http://greenbytes.de/tech/tc2231/ - -## License - -[MIT](LICENSE) - -[npm-image]: https://img.shields.io/npm/v/content-disposition.svg -[npm-url]: https://npmjs.org/package/content-disposition -[node-version-image]: https://img.shields.io/node/v/content-disposition.svg -[node-version-url]: https://nodejs.org/en/download -[coveralls-image]: https://img.shields.io/coveralls/jshttp/content-disposition.svg -[coveralls-url]: https://coveralls.io/r/jshttp/content-disposition?branch=master -[downloads-image]: https://img.shields.io/npm/dm/content-disposition.svg -[downloads-url]: https://npmjs.org/package/content-disposition -[github-actions-ci-image]: https://img.shields.io/github/workflow/status/jshttp/content-disposition/ci/master?label=ci -[github-actions-ci-url]: https://github.com/jshttp/content-disposition?query=workflow%3Aci diff --git a/server/node_modules/content-disposition/index.js b/server/node_modules/content-disposition/index.js deleted file mode 100644 index ecec899..0000000 --- a/server/node_modules/content-disposition/index.js +++ /dev/null @@ -1,458 +0,0 @@ -/*! - * content-disposition - * Copyright(c) 2014-2017 Douglas Christopher Wilson - * MIT Licensed - */ - -'use strict' - -/** - * Module exports. - * @public - */ - -module.exports = contentDisposition -module.exports.parse = parse - -/** - * Module dependencies. - * @private - */ - -var basename = require('path').basename -var Buffer = require('safe-buffer').Buffer - -/** - * RegExp to match non attr-char, *after* encodeURIComponent (i.e. not including "%") - * @private - */ - -var ENCODE_URL_ATTR_CHAR_REGEXP = /[\x00-\x20"'()*,/:;<=>?@[\\\]{}\x7f]/g // eslint-disable-line no-control-regex - -/** - * RegExp to match percent encoding escape. - * @private - */ - -var HEX_ESCAPE_REGEXP = /%[0-9A-Fa-f]{2}/ -var HEX_ESCAPE_REPLACE_REGEXP = /%([0-9A-Fa-f]{2})/g - -/** - * RegExp to match non-latin1 characters. - * @private - */ - -var NON_LATIN1_REGEXP = /[^\x20-\x7e\xa0-\xff]/g - -/** - * RegExp to match quoted-pair in RFC 2616 - * - * quoted-pair = "\" CHAR - * CHAR = - * @private - */ - -var QESC_REGEXP = /\\([\u0000-\u007f])/g // eslint-disable-line no-control-regex - -/** - * RegExp to match chars that must be quoted-pair in RFC 2616 - * @private - */ - -var QUOTE_REGEXP = /([\\"])/g - -/** - * RegExp for various RFC 2616 grammar - * - * parameter = token "=" ( token | quoted-string ) - * token = 1* - * separators = "(" | ")" | "<" | ">" | "@" - * | "," | ";" | ":" | "\" | <"> - * | "/" | "[" | "]" | "?" | "=" - * | "{" | "}" | SP | HT - * quoted-string = ( <"> *(qdtext | quoted-pair ) <"> ) - * qdtext = > - * quoted-pair = "\" CHAR - * CHAR = - * TEXT = - * LWS = [CRLF] 1*( SP | HT ) - * CRLF = CR LF - * CR = - * LF = - * SP = - * HT = - * CTL = - * OCTET = - * @private - */ - -var PARAM_REGEXP = /;[\x09\x20]*([!#$%&'*+.0-9A-Z^_`a-z|~-]+)[\x09\x20]*=[\x09\x20]*("(?:[\x20!\x23-\x5b\x5d-\x7e\x80-\xff]|\\[\x20-\x7e])*"|[!#$%&'*+.0-9A-Z^_`a-z|~-]+)[\x09\x20]*/g // eslint-disable-line no-control-regex -var TEXT_REGEXP = /^[\x20-\x7e\x80-\xff]+$/ -var TOKEN_REGEXP = /^[!#$%&'*+.0-9A-Z^_`a-z|~-]+$/ - -/** - * RegExp for various RFC 5987 grammar - * - * ext-value = charset "'" [ language ] "'" value-chars - * charset = "UTF-8" / "ISO-8859-1" / mime-charset - * mime-charset = 1*mime-charsetc - * mime-charsetc = ALPHA / DIGIT - * / "!" / "#" / "$" / "%" / "&" - * / "+" / "-" / "^" / "_" / "`" - * / "{" / "}" / "~" - * language = ( 2*3ALPHA [ extlang ] ) - * / 4ALPHA - * / 5*8ALPHA - * extlang = *3( "-" 3ALPHA ) - * value-chars = *( pct-encoded / attr-char ) - * pct-encoded = "%" HEXDIG HEXDIG - * attr-char = ALPHA / DIGIT - * / "!" / "#" / "$" / "&" / "+" / "-" / "." - * / "^" / "_" / "`" / "|" / "~" - * @private - */ - -var EXT_VALUE_REGEXP = /^([A-Za-z0-9!#$%&+\-^_`{}~]+)'(?:[A-Za-z]{2,3}(?:-[A-Za-z]{3}){0,3}|[A-Za-z]{4,8}|)'((?:%[0-9A-Fa-f]{2}|[A-Za-z0-9!#$&+.^_`|~-])+)$/ - -/** - * RegExp for various RFC 6266 grammar - * - * disposition-type = "inline" | "attachment" | disp-ext-type - * disp-ext-type = token - * disposition-parm = filename-parm | disp-ext-parm - * filename-parm = "filename" "=" value - * | "filename*" "=" ext-value - * disp-ext-parm = token "=" value - * | ext-token "=" ext-value - * ext-token = - * @private - */ - -var DISPOSITION_TYPE_REGEXP = /^([!#$%&'*+.0-9A-Z^_`a-z|~-]+)[\x09\x20]*(?:$|;)/ // eslint-disable-line no-control-regex - -/** - * Create an attachment Content-Disposition header. - * - * @param {string} [filename] - * @param {object} [options] - * @param {string} [options.type=attachment] - * @param {string|boolean} [options.fallback=true] - * @return {string} - * @public - */ - -function contentDisposition (filename, options) { - var opts = options || {} - - // get type - var type = opts.type || 'attachment' - - // get parameters - var params = createparams(filename, opts.fallback) - - // format into string - return format(new ContentDisposition(type, params)) -} - -/** - * Create parameters object from filename and fallback. - * - * @param {string} [filename] - * @param {string|boolean} [fallback=true] - * @return {object} - * @private - */ - -function createparams (filename, fallback) { - if (filename === undefined) { - return - } - - var params = {} - - if (typeof filename !== 'string') { - throw new TypeError('filename must be a string') - } - - // fallback defaults to true - if (fallback === undefined) { - fallback = true - } - - if (typeof fallback !== 'string' && typeof fallback !== 'boolean') { - throw new TypeError('fallback must be a string or boolean') - } - - if (typeof fallback === 'string' && NON_LATIN1_REGEXP.test(fallback)) { - throw new TypeError('fallback must be ISO-8859-1 string') - } - - // restrict to file base name - var name = basename(filename) - - // determine if name is suitable for quoted string - var isQuotedString = TEXT_REGEXP.test(name) - - // generate fallback name - var fallbackName = typeof fallback !== 'string' - ? fallback && getlatin1(name) - : basename(fallback) - var hasFallback = typeof fallbackName === 'string' && fallbackName !== name - - // set extended filename parameter - if (hasFallback || !isQuotedString || HEX_ESCAPE_REGEXP.test(name)) { - params['filename*'] = name - } - - // set filename parameter - if (isQuotedString || hasFallback) { - params.filename = hasFallback - ? fallbackName - : name - } - - return params -} - -/** - * Format object to Content-Disposition header. - * - * @param {object} obj - * @param {string} obj.type - * @param {object} [obj.parameters] - * @return {string} - * @private - */ - -function format (obj) { - var parameters = obj.parameters - var type = obj.type - - if (!type || typeof type !== 'string' || !TOKEN_REGEXP.test(type)) { - throw new TypeError('invalid type') - } - - // start with normalized type - var string = String(type).toLowerCase() - - // append parameters - if (parameters && typeof parameters === 'object') { - var param - var params = Object.keys(parameters).sort() - - for (var i = 0; i < params.length; i++) { - param = params[i] - - var val = param.substr(-1) === '*' - ? ustring(parameters[param]) - : qstring(parameters[param]) - - string += '; ' + param + '=' + val - } - } - - return string -} - -/** - * Decode a RFC 5987 field value (gracefully). - * - * @param {string} str - * @return {string} - * @private - */ - -function decodefield (str) { - var match = EXT_VALUE_REGEXP.exec(str) - - if (!match) { - throw new TypeError('invalid extended field value') - } - - var charset = match[1].toLowerCase() - var encoded = match[2] - var value - - // to binary string - var binary = encoded.replace(HEX_ESCAPE_REPLACE_REGEXP, pdecode) - - switch (charset) { - case 'iso-8859-1': - value = getlatin1(binary) - break - case 'utf-8': - value = Buffer.from(binary, 'binary').toString('utf8') - break - default: - throw new TypeError('unsupported charset in extended field') - } - - return value -} - -/** - * Get ISO-8859-1 version of string. - * - * @param {string} val - * @return {string} - * @private - */ - -function getlatin1 (val) { - // simple Unicode -> ISO-8859-1 transformation - return String(val).replace(NON_LATIN1_REGEXP, '?') -} - -/** - * Parse Content-Disposition header string. - * - * @param {string} string - * @return {object} - * @public - */ - -function parse (string) { - if (!string || typeof string !== 'string') { - throw new TypeError('argument string is required') - } - - var match = DISPOSITION_TYPE_REGEXP.exec(string) - - if (!match) { - throw new TypeError('invalid type format') - } - - // normalize type - var index = match[0].length - var type = match[1].toLowerCase() - - var key - var names = [] - var params = {} - var value - - // calculate index to start at - index = PARAM_REGEXP.lastIndex = match[0].substr(-1) === ';' - ? index - 1 - : index - - // match parameters - while ((match = PARAM_REGEXP.exec(string))) { - if (match.index !== index) { - throw new TypeError('invalid parameter format') - } - - index += match[0].length - key = match[1].toLowerCase() - value = match[2] - - if (names.indexOf(key) !== -1) { - throw new TypeError('invalid duplicate parameter') - } - - names.push(key) - - if (key.indexOf('*') + 1 === key.length) { - // decode extended value - key = key.slice(0, -1) - value = decodefield(value) - - // overwrite existing value - params[key] = value - continue - } - - if (typeof params[key] === 'string') { - continue - } - - if (value[0] === '"') { - // remove quotes and escapes - value = value - .substr(1, value.length - 2) - .replace(QESC_REGEXP, '$1') - } - - params[key] = value - } - - if (index !== -1 && index !== string.length) { - throw new TypeError('invalid parameter format') - } - - return new ContentDisposition(type, params) -} - -/** - * Percent decode a single character. - * - * @param {string} str - * @param {string} hex - * @return {string} - * @private - */ - -function pdecode (str, hex) { - return String.fromCharCode(parseInt(hex, 16)) -} - -/** - * Percent encode a single character. - * - * @param {string} char - * @return {string} - * @private - */ - -function pencode (char) { - return '%' + String(char) - .charCodeAt(0) - .toString(16) - .toUpperCase() -} - -/** - * Quote a string for HTTP. - * - * @param {string} val - * @return {string} - * @private - */ - -function qstring (val) { - var str = String(val) - - return '"' + str.replace(QUOTE_REGEXP, '\\$1') + '"' -} - -/** - * Encode a Unicode string for HTTP (RFC 5987). - * - * @param {string} val - * @return {string} - * @private - */ - -function ustring (val) { - var str = String(val) - - // percent encode as UTF-8 - var encoded = encodeURIComponent(str) - .replace(ENCODE_URL_ATTR_CHAR_REGEXP, pencode) - - return 'UTF-8\'\'' + encoded -} - -/** - * Class for parsed Content-Disposition header for v8 optimization - * - * @public - * @param {string} type - * @param {object} parameters - * @constructor - */ - -function ContentDisposition (type, parameters) { - this.type = type - this.parameters = parameters -} diff --git a/server/node_modules/content-disposition/package.json b/server/node_modules/content-disposition/package.json deleted file mode 100644 index 43c70ce..0000000 --- a/server/node_modules/content-disposition/package.json +++ /dev/null @@ -1,44 +0,0 @@ -{ - "name": "content-disposition", - "description": "Create and parse Content-Disposition header", - "version": "0.5.4", - "author": "Douglas Christopher Wilson ", - "license": "MIT", - "keywords": [ - "content-disposition", - "http", - "rfc6266", - "res" - ], - "repository": "jshttp/content-disposition", - "dependencies": { - "safe-buffer": "5.2.1" - }, - "devDependencies": { - "deep-equal": "1.0.1", - "eslint": "7.32.0", - "eslint-config-standard": "13.0.1", - "eslint-plugin-import": "2.25.3", - "eslint-plugin-markdown": "2.2.1", - "eslint-plugin-node": "11.1.0", - "eslint-plugin-promise": "5.2.0", - "eslint-plugin-standard": "4.1.0", - "istanbul": "0.4.5", - "mocha": "9.1.3" - }, - "files": [ - "LICENSE", - "HISTORY.md", - "README.md", - "index.js" - ], - "engines": { - "node": ">= 0.6" - }, - "scripts": { - "lint": "eslint .", - "test": "mocha --reporter spec --bail --check-leaks test/", - "test-ci": "istanbul cover node_modules/mocha/bin/_mocha --report lcovonly -- --reporter spec --check-leaks test/", - "test-cov": "istanbul cover node_modules/mocha/bin/_mocha -- --reporter dot --check-leaks test/" - } -} diff --git a/server/node_modules/content-type/HISTORY.md b/server/node_modules/content-type/HISTORY.md deleted file mode 100644 index 4583671..0000000 --- a/server/node_modules/content-type/HISTORY.md +++ /dev/null @@ -1,29 +0,0 @@ -1.0.5 / 2023-01-29 -================== - - * perf: skip value escaping when unnecessary - -1.0.4 / 2017-09-11 -================== - - * perf: skip parameter parsing when no parameters - -1.0.3 / 2017-09-10 -================== - - * perf: remove argument reassignment - -1.0.2 / 2016-05-09 -================== - - * perf: enable strict mode - -1.0.1 / 2015-02-13 -================== - - * Improve missing `Content-Type` header error message - -1.0.0 / 2015-02-01 -================== - - * Initial implementation, derived from `media-typer@0.3.0` diff --git a/server/node_modules/content-type/LICENSE b/server/node_modules/content-type/LICENSE deleted file mode 100644 index 34b1a2d..0000000 --- a/server/node_modules/content-type/LICENSE +++ /dev/null @@ -1,22 +0,0 @@ -(The MIT License) - -Copyright (c) 2015 Douglas Christopher Wilson - -Permission is hereby granted, free of charge, to any person obtaining -a copy of this software and associated documentation files (the -'Software'), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sublicense, and/or sell copies of the Software, and to -permit persons to whom the Software is furnished to do so, subject to -the following conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, -TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE -SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/server/node_modules/content-type/README.md b/server/node_modules/content-type/README.md deleted file mode 100644 index c1a922a..0000000 --- a/server/node_modules/content-type/README.md +++ /dev/null @@ -1,94 +0,0 @@ -# content-type - -[![NPM Version][npm-version-image]][npm-url] -[![NPM Downloads][npm-downloads-image]][npm-url] -[![Node.js Version][node-image]][node-url] -[![Build Status][ci-image]][ci-url] -[![Coverage Status][coveralls-image]][coveralls-url] - -Create and parse HTTP Content-Type header according to RFC 7231 - -## Installation - -```sh -$ npm install content-type -``` - -## API - -```js -var contentType = require('content-type') -``` - -### contentType.parse(string) - -```js -var obj = contentType.parse('image/svg+xml; charset=utf-8') -``` - -Parse a `Content-Type` header. This will return an object with the following -properties (examples are shown for the string `'image/svg+xml; charset=utf-8'`): - - - `type`: The media type (the type and subtype, always lower case). - Example: `'image/svg+xml'` - - - `parameters`: An object of the parameters in the media type (name of parameter - always lower case). Example: `{charset: 'utf-8'}` - -Throws a `TypeError` if the string is missing or invalid. - -### contentType.parse(req) - -```js -var obj = contentType.parse(req) -``` - -Parse the `Content-Type` header from the given `req`. Short-cut for -`contentType.parse(req.headers['content-type'])`. - -Throws a `TypeError` if the `Content-Type` header is missing or invalid. - -### contentType.parse(res) - -```js -var obj = contentType.parse(res) -``` - -Parse the `Content-Type` header set on the given `res`. Short-cut for -`contentType.parse(res.getHeader('content-type'))`. - -Throws a `TypeError` if the `Content-Type` header is missing or invalid. - -### contentType.format(obj) - -```js -var str = contentType.format({ - type: 'image/svg+xml', - parameters: { charset: 'utf-8' } -}) -``` - -Format an object into a `Content-Type` header. This will return a string of the -content type for the given object with the following properties (examples are -shown that produce the string `'image/svg+xml; charset=utf-8'`): - - - `type`: The media type (will be lower-cased). Example: `'image/svg+xml'` - - - `parameters`: An object of the parameters in the media type (name of the - parameter will be lower-cased). Example: `{charset: 'utf-8'}` - -Throws a `TypeError` if the object contains an invalid type or parameter names. - -## License - -[MIT](LICENSE) - -[ci-image]: https://badgen.net/github/checks/jshttp/content-type/master?label=ci -[ci-url]: https://github.com/jshttp/content-type/actions/workflows/ci.yml -[coveralls-image]: https://badgen.net/coveralls/c/github/jshttp/content-type/master -[coveralls-url]: https://coveralls.io/r/jshttp/content-type?branch=master -[node-image]: https://badgen.net/npm/node/content-type -[node-url]: https://nodejs.org/en/download -[npm-downloads-image]: https://badgen.net/npm/dm/content-type -[npm-url]: https://npmjs.org/package/content-type -[npm-version-image]: https://badgen.net/npm/v/content-type diff --git a/server/node_modules/content-type/index.js b/server/node_modules/content-type/index.js deleted file mode 100644 index 41840e7..0000000 --- a/server/node_modules/content-type/index.js +++ /dev/null @@ -1,225 +0,0 @@ -/*! - * content-type - * Copyright(c) 2015 Douglas Christopher Wilson - * MIT Licensed - */ - -'use strict' - -/** - * RegExp to match *( ";" parameter ) in RFC 7231 sec 3.1.1.1 - * - * parameter = token "=" ( token / quoted-string ) - * token = 1*tchar - * tchar = "!" / "#" / "$" / "%" / "&" / "'" / "*" - * / "+" / "-" / "." / "^" / "_" / "`" / "|" / "~" - * / DIGIT / ALPHA - * ; any VCHAR, except delimiters - * quoted-string = DQUOTE *( qdtext / quoted-pair ) DQUOTE - * qdtext = HTAB / SP / %x21 / %x23-5B / %x5D-7E / obs-text - * obs-text = %x80-FF - * quoted-pair = "\" ( HTAB / SP / VCHAR / obs-text ) - */ -var PARAM_REGEXP = /; *([!#$%&'*+.^_`|~0-9A-Za-z-]+) *= *("(?:[\u000b\u0020\u0021\u0023-\u005b\u005d-\u007e\u0080-\u00ff]|\\[\u000b\u0020-\u00ff])*"|[!#$%&'*+.^_`|~0-9A-Za-z-]+) */g // eslint-disable-line no-control-regex -var TEXT_REGEXP = /^[\u000b\u0020-\u007e\u0080-\u00ff]+$/ // eslint-disable-line no-control-regex -var TOKEN_REGEXP = /^[!#$%&'*+.^_`|~0-9A-Za-z-]+$/ - -/** - * RegExp to match quoted-pair in RFC 7230 sec 3.2.6 - * - * quoted-pair = "\" ( HTAB / SP / VCHAR / obs-text ) - * obs-text = %x80-FF - */ -var QESC_REGEXP = /\\([\u000b\u0020-\u00ff])/g // eslint-disable-line no-control-regex - -/** - * RegExp to match chars that must be quoted-pair in RFC 7230 sec 3.2.6 - */ -var QUOTE_REGEXP = /([\\"])/g - -/** - * RegExp to match type in RFC 7231 sec 3.1.1.1 - * - * media-type = type "/" subtype - * type = token - * subtype = token - */ -var TYPE_REGEXP = /^[!#$%&'*+.^_`|~0-9A-Za-z-]+\/[!#$%&'*+.^_`|~0-9A-Za-z-]+$/ - -/** - * Module exports. - * @public - */ - -exports.format = format -exports.parse = parse - -/** - * Format object to media type. - * - * @param {object} obj - * @return {string} - * @public - */ - -function format (obj) { - if (!obj || typeof obj !== 'object') { - throw new TypeError('argument obj is required') - } - - var parameters = obj.parameters - var type = obj.type - - if (!type || !TYPE_REGEXP.test(type)) { - throw new TypeError('invalid type') - } - - var string = type - - // append parameters - if (parameters && typeof parameters === 'object') { - var param - var params = Object.keys(parameters).sort() - - for (var i = 0; i < params.length; i++) { - param = params[i] - - if (!TOKEN_REGEXP.test(param)) { - throw new TypeError('invalid parameter name') - } - - string += '; ' + param + '=' + qstring(parameters[param]) - } - } - - return string -} - -/** - * Parse media type to object. - * - * @param {string|object} string - * @return {Object} - * @public - */ - -function parse (string) { - if (!string) { - throw new TypeError('argument string is required') - } - - // support req/res-like objects as argument - var header = typeof string === 'object' - ? getcontenttype(string) - : string - - if (typeof header !== 'string') { - throw new TypeError('argument string is required to be a string') - } - - var index = header.indexOf(';') - var type = index !== -1 - ? header.slice(0, index).trim() - : header.trim() - - if (!TYPE_REGEXP.test(type)) { - throw new TypeError('invalid media type') - } - - var obj = new ContentType(type.toLowerCase()) - - // parse parameters - if (index !== -1) { - var key - var match - var value - - PARAM_REGEXP.lastIndex = index - - while ((match = PARAM_REGEXP.exec(header))) { - if (match.index !== index) { - throw new TypeError('invalid parameter format') - } - - index += match[0].length - key = match[1].toLowerCase() - value = match[2] - - if (value.charCodeAt(0) === 0x22 /* " */) { - // remove quotes - value = value.slice(1, -1) - - // remove escapes - if (value.indexOf('\\') !== -1) { - value = value.replace(QESC_REGEXP, '$1') - } - } - - obj.parameters[key] = value - } - - if (index !== header.length) { - throw new TypeError('invalid parameter format') - } - } - - return obj -} - -/** - * Get content-type from req/res objects. - * - * @param {object} - * @return {Object} - * @private - */ - -function getcontenttype (obj) { - var header - - if (typeof obj.getHeader === 'function') { - // res-like - header = obj.getHeader('content-type') - } else if (typeof obj.headers === 'object') { - // req-like - header = obj.headers && obj.headers['content-type'] - } - - if (typeof header !== 'string') { - throw new TypeError('content-type header is missing from object') - } - - return header -} - -/** - * Quote a string if necessary. - * - * @param {string} val - * @return {string} - * @private - */ - -function qstring (val) { - var str = String(val) - - // no need to quote tokens - if (TOKEN_REGEXP.test(str)) { - return str - } - - if (str.length > 0 && !TEXT_REGEXP.test(str)) { - throw new TypeError('invalid parameter value') - } - - return '"' + str.replace(QUOTE_REGEXP, '\\$1') + '"' -} - -/** - * Class to represent a content type. - * @private - */ -function ContentType (type) { - this.parameters = Object.create(null) - this.type = type -} diff --git a/server/node_modules/content-type/package.json b/server/node_modules/content-type/package.json deleted file mode 100644 index 9db19f6..0000000 --- a/server/node_modules/content-type/package.json +++ /dev/null @@ -1,42 +0,0 @@ -{ - "name": "content-type", - "description": "Create and parse HTTP Content-Type header", - "version": "1.0.5", - "author": "Douglas Christopher Wilson ", - "license": "MIT", - "keywords": [ - "content-type", - "http", - "req", - "res", - "rfc7231" - ], - "repository": "jshttp/content-type", - "devDependencies": { - "deep-equal": "1.0.1", - "eslint": "8.32.0", - "eslint-config-standard": "15.0.1", - "eslint-plugin-import": "2.27.5", - "eslint-plugin-node": "11.1.0", - "eslint-plugin-promise": "6.1.1", - "eslint-plugin-standard": "4.1.0", - "mocha": "10.2.0", - "nyc": "15.1.0" - }, - "files": [ - "LICENSE", - "HISTORY.md", - "README.md", - "index.js" - ], - "engines": { - "node": ">= 0.6" - }, - "scripts": { - "lint": "eslint .", - "test": "mocha --reporter spec --check-leaks --bail test/", - "test-ci": "nyc --reporter=lcovonly --reporter=text npm test", - "test-cov": "nyc --reporter=html --reporter=text npm test", - "version": "node scripts/version-history.js && git add HISTORY.md" - } -} diff --git a/server/node_modules/cookie-signature/History.md b/server/node_modules/cookie-signature/History.md deleted file mode 100644 index bcf8cc9..0000000 --- a/server/node_modules/cookie-signature/History.md +++ /dev/null @@ -1,42 +0,0 @@ -1.0.7 / 2023-04-12 -================== - -* backport the buffer support from the 1.2.x release branch (thanks @FadhiliNjagi!) - -1.0.6 / 2015-02-03 -================== - -* use `npm test` instead of `make test` to run tests -* clearer assertion messages when checking input - -1.0.5 / 2014-09-05 -================== - -* add license to package.json - -1.0.4 / 2014-06-25 -================== - - * corrected avoidance of timing attacks (thanks @tenbits!) - -1.0.3 / 2014-01-28 -================== - - * [incorrect] fix for timing attacks - -1.0.2 / 2014-01-28 -================== - - * fix missing repository warning - * fix typo in test - -1.0.1 / 2013-04-15 -================== - - * Revert "Changed underlying HMAC algo. to sha512." - * Revert "Fix for timing attacks on MAC verification." - -0.0.1 / 2010-01-03 -================== - - * Initial release diff --git a/server/node_modules/cookie-signature/Readme.md b/server/node_modules/cookie-signature/Readme.md deleted file mode 100644 index 2559e84..0000000 --- a/server/node_modules/cookie-signature/Readme.md +++ /dev/null @@ -1,42 +0,0 @@ - -# cookie-signature - - Sign and unsign cookies. - -## Example - -```js -var cookie = require('cookie-signature'); - -var val = cookie.sign('hello', 'tobiiscool'); -val.should.equal('hello.DGDUkGlIkCzPz+C0B064FNgHdEjox7ch8tOBGslZ5QI'); - -var val = cookie.sign('hello', 'tobiiscool'); -cookie.unsign(val, 'tobiiscool').should.equal('hello'); -cookie.unsign(val, 'luna').should.be.false; -``` - -## License - -(The MIT License) - -Copyright (c) 2012 LearnBoost <tj@learnboost.com> - -Permission is hereby granted, free of charge, to any person obtaining -a copy of this software and associated documentation files (the -'Software'), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sublicense, and/or sell copies of the Software, and to -permit persons to whom the Software is furnished to do so, subject to -the following conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, -TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE -SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. \ No newline at end of file diff --git a/server/node_modules/cookie-signature/index.js b/server/node_modules/cookie-signature/index.js deleted file mode 100644 index 336d487..0000000 --- a/server/node_modules/cookie-signature/index.js +++ /dev/null @@ -1,51 +0,0 @@ -/** - * Module dependencies. - */ - -var crypto = require('crypto'); - -/** - * Sign the given `val` with `secret`. - * - * @param {String} val - * @param {String|NodeJS.ArrayBufferView|crypto.KeyObject} secret - * @return {String} - * @api private - */ - -exports.sign = function(val, secret){ - if ('string' !== typeof val) throw new TypeError("Cookie value must be provided as a string."); - if (null == secret) throw new TypeError("Secret key must be provided."); - return val + '.' + crypto - .createHmac('sha256', secret) - .update(val) - .digest('base64') - .replace(/\=+$/, ''); -}; - -/** - * Unsign and decode the given `val` with `secret`, - * returning `false` if the signature is invalid. - * - * @param {String} val - * @param {String|NodeJS.ArrayBufferView|crypto.KeyObject} secret - * @return {String|Boolean} - * @api private - */ - -exports.unsign = function(val, secret){ - if ('string' !== typeof val) throw new TypeError("Signed cookie string must be provided."); - if (null == secret) throw new TypeError("Secret key must be provided."); - var str = val.slice(0, val.lastIndexOf('.')) - , mac = exports.sign(str, secret); - - return sha1(mac) == sha1(val) ? str : false; -}; - -/** - * Private - */ - -function sha1(str){ - return crypto.createHash('sha1').update(str).digest('hex'); -} diff --git a/server/node_modules/cookie-signature/package.json b/server/node_modules/cookie-signature/package.json deleted file mode 100644 index 738487b..0000000 --- a/server/node_modules/cookie-signature/package.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "name": "cookie-signature", - "version": "1.0.7", - "description": "Sign and unsign cookies", - "keywords": ["cookie", "sign", "unsign"], - "author": "TJ Holowaychuk ", - "license": "MIT", - "repository": { "type": "git", "url": "https://github.com/visionmedia/node-cookie-signature.git"}, - "dependencies": {}, - "devDependencies": { - "mocha": "*", - "should": "*" - }, - "scripts": { - "test": "mocha --require should --reporter spec" - }, - "main": "index" -} \ No newline at end of file diff --git a/server/node_modules/cookie/LICENSE b/server/node_modules/cookie/LICENSE deleted file mode 100644 index 058b6b4..0000000 --- a/server/node_modules/cookie/LICENSE +++ /dev/null @@ -1,24 +0,0 @@ -(The MIT License) - -Copyright (c) 2012-2014 Roman Shtylman -Copyright (c) 2015 Douglas Christopher Wilson - -Permission is hereby granted, free of charge, to any person obtaining -a copy of this software and associated documentation files (the -'Software'), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sublicense, and/or sell copies of the Software, and to -permit persons to whom the Software is furnished to do so, subject to -the following conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, -TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE -SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - diff --git a/server/node_modules/cookie/README.md b/server/node_modules/cookie/README.md deleted file mode 100644 index 71fdac1..0000000 --- a/server/node_modules/cookie/README.md +++ /dev/null @@ -1,317 +0,0 @@ -# cookie - -[![NPM Version][npm-version-image]][npm-url] -[![NPM Downloads][npm-downloads-image]][npm-url] -[![Node.js Version][node-image]][node-url] -[![Build Status][ci-image]][ci-url] -[![Coverage Status][coveralls-image]][coveralls-url] - -Basic HTTP cookie parser and serializer for HTTP servers. - -## Installation - -This is a [Node.js](https://nodejs.org/en/) module available through the -[npm registry](https://www.npmjs.com/). Installation is done using the -[`npm install` command](https://docs.npmjs.com/getting-started/installing-npm-packages-locally): - -```sh -$ npm install cookie -``` - -## API - -```js -var cookie = require('cookie'); -``` - -### cookie.parse(str, options) - -Parse an HTTP `Cookie` header string and returning an object of all cookie name-value pairs. -The `str` argument is the string representing a `Cookie` header value and `options` is an -optional object containing additional parsing options. - -```js -var cookies = cookie.parse('foo=bar; equation=E%3Dmc%5E2'); -// { foo: 'bar', equation: 'E=mc^2' } -``` - -#### Options - -`cookie.parse` accepts these properties in the options object. - -##### decode - -Specifies a function that will be used to decode a cookie's value. Since the value of a cookie -has a limited character set (and must be a simple string), this function can be used to decode -a previously-encoded cookie value into a JavaScript string or other object. - -The default function is the global `decodeURIComponent`, which will decode any URL-encoded -sequences into their byte representations. - -**note** if an error is thrown from this function, the original, non-decoded cookie value will -be returned as the cookie's value. - -### cookie.serialize(name, value, options) - -Serialize a cookie name-value pair into a `Set-Cookie` header string. The `name` argument is the -name for the cookie, the `value` argument is the value to set the cookie to, and the `options` -argument is an optional object containing additional serialization options. - -```js -var setCookie = cookie.serialize('foo', 'bar'); -// foo=bar -``` - -#### Options - -`cookie.serialize` accepts these properties in the options object. - -##### domain - -Specifies the value for the [`Domain` `Set-Cookie` attribute][rfc-6265-5.2.3]. By default, no -domain is set, and most clients will consider the cookie to apply to only the current domain. - -##### encode - -Specifies a function that will be used to encode a cookie's value. Since value of a cookie -has a limited character set (and must be a simple string), this function can be used to encode -a value into a string suited for a cookie's value. - -The default function is the global `encodeURIComponent`, which will encode a JavaScript string -into UTF-8 byte sequences and then URL-encode any that fall outside of the cookie range. - -##### expires - -Specifies the `Date` object to be the value for the [`Expires` `Set-Cookie` attribute][rfc-6265-5.2.1]. -By default, no expiration is set, and most clients will consider this a "non-persistent cookie" and -will delete it on a condition like exiting a web browser application. - -**note** the [cookie storage model specification][rfc-6265-5.3] states that if both `expires` and -`maxAge` are set, then `maxAge` takes precedence, but it is possible not all clients by obey this, -so if both are set, they should point to the same date and time. - -##### httpOnly - -Specifies the `boolean` value for the [`HttpOnly` `Set-Cookie` attribute][rfc-6265-5.2.6]. When truthy, -the `HttpOnly` attribute is set, otherwise it is not. By default, the `HttpOnly` attribute is not set. - -**note** be careful when setting this to `true`, as compliant clients will not allow client-side -JavaScript to see the cookie in `document.cookie`. - -##### maxAge - -Specifies the `number` (in seconds) to be the value for the [`Max-Age` `Set-Cookie` attribute][rfc-6265-5.2.2]. -The given number will be converted to an integer by rounding down. By default, no maximum age is set. - -**note** the [cookie storage model specification][rfc-6265-5.3] states that if both `expires` and -`maxAge` are set, then `maxAge` takes precedence, but it is possible not all clients by obey this, -so if both are set, they should point to the same date and time. - -##### partitioned - -Specifies the `boolean` value for the [`Partitioned` `Set-Cookie`](rfc-cutler-httpbis-partitioned-cookies) -attribute. When truthy, the `Partitioned` attribute is set, otherwise it is not. By default, the -`Partitioned` attribute is not set. - -**note** This is an attribute that has not yet been fully standardized, and may change in the future. -This also means many clients may ignore this attribute until they understand it. - -More information about can be found in [the proposal](https://github.com/privacycg/CHIPS). - -##### path - -Specifies the value for the [`Path` `Set-Cookie` attribute][rfc-6265-5.2.4]. By default, the path -is considered the ["default path"][rfc-6265-5.1.4]. - -##### priority - -Specifies the `string` to be the value for the [`Priority` `Set-Cookie` attribute][rfc-west-cookie-priority-00-4.1]. - - - `'low'` will set the `Priority` attribute to `Low`. - - `'medium'` will set the `Priority` attribute to `Medium`, the default priority when not set. - - `'high'` will set the `Priority` attribute to `High`. - -More information about the different priority levels can be found in -[the specification][rfc-west-cookie-priority-00-4.1]. - -**note** This is an attribute that has not yet been fully standardized, and may change in the future. -This also means many clients may ignore this attribute until they understand it. - -##### sameSite - -Specifies the `boolean` or `string` to be the value for the [`SameSite` `Set-Cookie` attribute][rfc-6265bis-09-5.4.7]. - - - `true` will set the `SameSite` attribute to `Strict` for strict same site enforcement. - - `false` will not set the `SameSite` attribute. - - `'lax'` will set the `SameSite` attribute to `Lax` for lax same site enforcement. - - `'none'` will set the `SameSite` attribute to `None` for an explicit cross-site cookie. - - `'strict'` will set the `SameSite` attribute to `Strict` for strict same site enforcement. - -More information about the different enforcement levels can be found in -[the specification][rfc-6265bis-09-5.4.7]. - -**note** This is an attribute that has not yet been fully standardized, and may change in the future. -This also means many clients may ignore this attribute until they understand it. - -##### secure - -Specifies the `boolean` value for the [`Secure` `Set-Cookie` attribute][rfc-6265-5.2.5]. When truthy, -the `Secure` attribute is set, otherwise it is not. By default, the `Secure` attribute is not set. - -**note** be careful when setting this to `true`, as compliant clients will not send the cookie back to -the server in the future if the browser does not have an HTTPS connection. - -## Example - -The following example uses this module in conjunction with the Node.js core HTTP server -to prompt a user for their name and display it back on future visits. - -```js -var cookie = require('cookie'); -var escapeHtml = require('escape-html'); -var http = require('http'); -var url = require('url'); - -function onRequest(req, res) { - // Parse the query string - var query = url.parse(req.url, true, true).query; - - if (query && query.name) { - // Set a new cookie with the name - res.setHeader('Set-Cookie', cookie.serialize('name', String(query.name), { - httpOnly: true, - maxAge: 60 * 60 * 24 * 7 // 1 week - })); - - // Redirect back after setting cookie - res.statusCode = 302; - res.setHeader('Location', req.headers.referer || '/'); - res.end(); - return; - } - - // Parse the cookies on the request - var cookies = cookie.parse(req.headers.cookie || ''); - - // Get the visitor name set in the cookie - var name = cookies.name; - - res.setHeader('Content-Type', 'text/html; charset=UTF-8'); - - if (name) { - res.write('

Welcome back, ' + escapeHtml(name) + '!

'); - } else { - res.write('

Hello, new visitor!

'); - } - - res.write('
'); - res.write(' '); - res.end('
'); -} - -http.createServer(onRequest).listen(3000); -``` - -## Testing - -```sh -$ npm test -``` - -## Benchmark - -``` -$ npm run bench - -> cookie@0.5.0 bench -> node benchmark/index.js - - node@18.18.2 - acorn@8.10.0 - ada@2.6.0 - ares@1.19.1 - brotli@1.0.9 - cldr@43.1 - icu@73.2 - llhttp@6.0.11 - modules@108 - napi@9 - nghttp2@1.57.0 - nghttp3@0.7.0 - ngtcp2@0.8.1 - openssl@3.0.10+quic - simdutf@3.2.14 - tz@2023c - undici@5.26.3 - unicode@15.0 - uv@1.44.2 - uvwasi@0.0.18 - v8@10.2.154.26-node.26 - zlib@1.2.13.1-motley - -> node benchmark/parse-top.js - - cookie.parse - top sites - - 14 tests completed. - - parse accounts.google.com x 2,588,913 ops/sec ±0.74% (186 runs sampled) - parse apple.com x 2,370,002 ops/sec ±0.69% (186 runs sampled) - parse cloudflare.com x 2,213,102 ops/sec ±0.88% (188 runs sampled) - parse docs.google.com x 2,194,157 ops/sec ±1.03% (184 runs sampled) - parse drive.google.com x 2,265,084 ops/sec ±0.79% (187 runs sampled) - parse en.wikipedia.org x 457,099 ops/sec ±0.81% (186 runs sampled) - parse linkedin.com x 504,407 ops/sec ±0.89% (186 runs sampled) - parse maps.google.com x 1,230,959 ops/sec ±0.98% (186 runs sampled) - parse microsoft.com x 926,294 ops/sec ±0.88% (184 runs sampled) - parse play.google.com x 2,311,338 ops/sec ±0.83% (185 runs sampled) - parse support.google.com x 1,508,850 ops/sec ±0.86% (186 runs sampled) - parse www.google.com x 1,022,582 ops/sec ±1.32% (182 runs sampled) - parse youtu.be x 332,136 ops/sec ±1.02% (185 runs sampled) - parse youtube.com x 323,833 ops/sec ±0.77% (183 runs sampled) - -> node benchmark/parse.js - - cookie.parse - generic - - 6 tests completed. - - simple x 3,214,032 ops/sec ±1.61% (183 runs sampled) - decode x 587,237 ops/sec ±1.16% (187 runs sampled) - unquote x 2,954,618 ops/sec ±1.35% (183 runs sampled) - duplicates x 857,008 ops/sec ±0.89% (187 runs sampled) - 10 cookies x 292,133 ops/sec ±0.89% (187 runs sampled) - 100 cookies x 22,610 ops/sec ±0.68% (187 runs sampled) -``` - -## References - -- [RFC 6265: HTTP State Management Mechanism][rfc-6265] -- [Same-site Cookies][rfc-6265bis-09-5.4.7] - -[rfc-cutler-httpbis-partitioned-cookies]: https://tools.ietf.org/html/draft-cutler-httpbis-partitioned-cookies/ -[rfc-west-cookie-priority-00-4.1]: https://tools.ietf.org/html/draft-west-cookie-priority-00#section-4.1 -[rfc-6265bis-09-5.4.7]: https://tools.ietf.org/html/draft-ietf-httpbis-rfc6265bis-09#section-5.4.7 -[rfc-6265]: https://tools.ietf.org/html/rfc6265 -[rfc-6265-5.1.4]: https://tools.ietf.org/html/rfc6265#section-5.1.4 -[rfc-6265-5.2.1]: https://tools.ietf.org/html/rfc6265#section-5.2.1 -[rfc-6265-5.2.2]: https://tools.ietf.org/html/rfc6265#section-5.2.2 -[rfc-6265-5.2.3]: https://tools.ietf.org/html/rfc6265#section-5.2.3 -[rfc-6265-5.2.4]: https://tools.ietf.org/html/rfc6265#section-5.2.4 -[rfc-6265-5.2.5]: https://tools.ietf.org/html/rfc6265#section-5.2.5 -[rfc-6265-5.2.6]: https://tools.ietf.org/html/rfc6265#section-5.2.6 -[rfc-6265-5.3]: https://tools.ietf.org/html/rfc6265#section-5.3 - -## License - -[MIT](LICENSE) - -[ci-image]: https://badgen.net/github/checks/jshttp/cookie/master?label=ci -[ci-url]: https://github.com/jshttp/cookie/actions/workflows/ci.yml -[coveralls-image]: https://badgen.net/coveralls/c/github/jshttp/cookie/master -[coveralls-url]: https://coveralls.io/r/jshttp/cookie?branch=master -[node-image]: https://badgen.net/npm/node/cookie -[node-url]: https://nodejs.org/en/download -[npm-downloads-image]: https://badgen.net/npm/dm/cookie -[npm-url]: https://npmjs.org/package/cookie -[npm-version-image]: https://badgen.net/npm/v/cookie diff --git a/server/node_modules/cookie/SECURITY.md b/server/node_modules/cookie/SECURITY.md deleted file mode 100644 index fd4a6c5..0000000 --- a/server/node_modules/cookie/SECURITY.md +++ /dev/null @@ -1,25 +0,0 @@ -# Security Policies and Procedures - -## Reporting a Bug - -The `cookie` team and community take all security bugs seriously. Thank -you for improving the security of the project. We appreciate your efforts and -responsible disclosure and will make every effort to acknowledge your -contributions. - -Report security bugs by emailing the current owner(s) of `cookie`. This -information can be found in the npm registry using the command -`npm owner ls cookie`. -If unsure or unable to get the information from the above, open an issue -in the [project issue tracker](https://github.com/jshttp/cookie/issues) -asking for the current contact information. - -To ensure the timely response to your report, please ensure that the entirety -of the report is contained within the email body and not solely behind a web -link or an attachment. - -At least one owner will acknowledge your email within 48 hours, and will send a -more detailed response within 48 hours indicating the next steps in handling -your report. After the initial reply to your report, the owners will -endeavor to keep you informed of the progress towards a fix and full -announcement, and may ask for additional information or guidance. diff --git a/server/node_modules/cookie/index.js b/server/node_modules/cookie/index.js deleted file mode 100644 index acd5acd..0000000 --- a/server/node_modules/cookie/index.js +++ /dev/null @@ -1,335 +0,0 @@ -/*! - * cookie - * Copyright(c) 2012-2014 Roman Shtylman - * Copyright(c) 2015 Douglas Christopher Wilson - * MIT Licensed - */ - -'use strict'; - -/** - * Module exports. - * @public - */ - -exports.parse = parse; -exports.serialize = serialize; - -/** - * Module variables. - * @private - */ - -var __toString = Object.prototype.toString -var __hasOwnProperty = Object.prototype.hasOwnProperty - -/** - * RegExp to match cookie-name in RFC 6265 sec 4.1.1 - * This refers out to the obsoleted definition of token in RFC 2616 sec 2.2 - * which has been replaced by the token definition in RFC 7230 appendix B. - * - * cookie-name = token - * token = 1*tchar - * tchar = "!" / "#" / "$" / "%" / "&" / "'" / - * "*" / "+" / "-" / "." / "^" / "_" / - * "`" / "|" / "~" / DIGIT / ALPHA - */ - -var cookieNameRegExp = /^[!#$%&'*+\-.^_`|~0-9A-Za-z]+$/; - -/** - * RegExp to match cookie-value in RFC 6265 sec 4.1.1 - * - * cookie-value = *cookie-octet / ( DQUOTE *cookie-octet DQUOTE ) - * cookie-octet = %x21 / %x23-2B / %x2D-3A / %x3C-5B / %x5D-7E - * ; US-ASCII characters excluding CTLs, - * ; whitespace DQUOTE, comma, semicolon, - * ; and backslash - */ - -var cookieValueRegExp = /^("?)[\u0021\u0023-\u002B\u002D-\u003A\u003C-\u005B\u005D-\u007E]*\1$/; - -/** - * RegExp to match domain-value in RFC 6265 sec 4.1.1 - * - * domain-value = - * ; defined in [RFC1034], Section 3.5, as - * ; enhanced by [RFC1123], Section 2.1 - * =