node-red-contrib-tak-registration 0.11.6 → 0.12.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/node_modules/@types/node/README.md +2 -2
- package/node_modules/@types/node/assert.d.ts +88 -44
- package/node_modules/@types/node/async_hooks.d.ts +17 -15
- package/node_modules/@types/node/buffer.d.ts +29 -110
- package/node_modules/@types/node/child_process.d.ts +38 -34
- package/node_modules/@types/node/cluster.d.ts +165 -19
- package/node_modules/@types/node/console.d.ts +64 -27
- package/node_modules/@types/node/crypto.d.ts +106 -142
- package/node_modules/@types/node/dgram.d.ts +14 -14
- package/node_modules/@types/node/diagnostics_channel.d.ts +12 -3
- package/node_modules/@types/node/dns/promises.d.ts +79 -28
- package/node_modules/@types/node/dns.d.ts +124 -69
- package/node_modules/@types/node/dom-events.d.ts +2 -0
- package/node_modules/@types/node/domain.d.ts +4 -4
- package/node_modules/@types/node/events.d.ts +115 -63
- package/node_modules/@types/node/fs/promises.d.ts +34 -12
- package/node_modules/@types/node/fs.d.ts +104 -40
- package/node_modules/@types/node/globals.d.ts +1 -0
- package/node_modules/@types/node/http.d.ts +69 -48
- package/node_modules/@types/node/http2.d.ts +83 -47
- package/node_modules/@types/node/https.d.ts +3 -3
- package/node_modules/@types/node/index.d.ts +1 -0
- package/node_modules/@types/node/inspector.d.ts +5 -6
- package/node_modules/@types/node/module.d.ts +0 -14
- package/node_modules/@types/node/net.d.ts +58 -13
- package/node_modules/@types/node/os.d.ts +29 -12
- package/node_modules/@types/node/package.json +4 -16
- package/node_modules/@types/node/path.d.ts +1 -1
- package/node_modules/@types/node/perf_hooks.d.ts +308 -48
- package/node_modules/@types/node/process.d.ts +241 -48
- package/node_modules/@types/node/punycode.d.ts +4 -4
- package/node_modules/@types/node/querystring.d.ts +18 -6
- package/node_modules/@types/node/readline/promises.d.ts +9 -9
- package/node_modules/@types/node/readline.d.ts +23 -22
- package/node_modules/@types/node/repl.d.ts +21 -21
- package/node_modules/@types/node/sea.d.ts +153 -0
- package/node_modules/@types/node/stream/web.d.ts +3 -2
- package/node_modules/@types/node/stream.d.ts +63 -57
- package/node_modules/@types/node/string_decoder.d.ts +3 -3
- package/node_modules/@types/node/test.d.ts +363 -98
- package/node_modules/@types/node/timers/promises.d.ts +10 -6
- package/node_modules/@types/node/timers.d.ts +5 -5
- package/node_modules/@types/node/tls.d.ts +39 -32
- package/node_modules/@types/node/trace_events.d.ts +40 -25
- package/node_modules/@types/node/tty.d.ts +8 -8
- package/node_modules/@types/node/url.d.ts +15 -7
- package/node_modules/@types/node/util.d.ts +131 -22
- package/node_modules/@types/node/v8.d.ts +51 -7
- package/node_modules/@types/node/vm.d.ts +43 -24
- package/node_modules/@types/node/wasi.d.ts +12 -10
- package/node_modules/@types/node/worker_threads.d.ts +19 -16
- package/node_modules/@types/node/zlib.d.ts +16 -3
- package/node_modules/adm-zip/README.md +2 -1
- package/node_modules/adm-zip/adm-zip.js +46 -45
- package/node_modules/adm-zip/headers/entryHeader.js +14 -12
- package/node_modules/adm-zip/headers/mainHeader.js +1 -1
- package/node_modules/adm-zip/methods/inflater.js +6 -3
- package/node_modules/adm-zip/methods/zipcrypto.js +6 -2
- package/node_modules/adm-zip/package.json +2 -2
- package/node_modules/adm-zip/util/errors.js +1 -0
- package/node_modules/adm-zip/zipEntry.js +64 -43
- package/node_modules/adm-zip/zipFile.js +35 -35
- package/node_modules/axios/CHANGELOG.md +868 -759
- package/node_modules/axios/README.md +65 -17
- package/node_modules/axios/dist/axios.js +1330 -583
- package/node_modules/axios/dist/axios.js.map +1 -1
- package/node_modules/axios/dist/axios.min.js +1 -1
- package/node_modules/axios/dist/axios.min.js.map +1 -1
- package/node_modules/axios/dist/browser/axios.cjs +696 -316
- package/node_modules/axios/dist/browser/axios.cjs.map +1 -1
- package/node_modules/axios/dist/esm/axios.js +696 -316
- package/node_modules/axios/dist/esm/axios.js.map +1 -1
- package/node_modules/axios/dist/esm/axios.min.js +1 -1
- package/node_modules/axios/dist/esm/axios.min.js.map +1 -1
- package/node_modules/axios/dist/node/axios.cjs +607 -257
- package/node_modules/axios/dist/node/axios.cjs.map +1 -1
- package/node_modules/axios/index.d.cts +5 -2
- package/node_modules/axios/index.d.ts +5 -2
- package/node_modules/axios/lib/adapters/adapters.js +3 -1
- package/node_modules/axios/lib/adapters/fetch.js +227 -0
- package/node_modules/axios/lib/adapters/http.js +1 -1
- package/node_modules/axios/lib/adapters/xhr.js +31 -101
- package/node_modules/axios/lib/core/Axios.js +17 -11
- package/node_modules/axios/lib/core/AxiosHeaders.js +4 -0
- package/node_modules/axios/lib/core/mergeConfig.js +1 -1
- package/node_modules/axios/lib/defaults/index.js +7 -5
- package/node_modules/axios/lib/env/data.js +1 -1
- package/node_modules/axios/lib/helpers/AxiosTransformStream.js +9 -8
- package/node_modules/axios/lib/helpers/composeSignals.js +46 -0
- package/node_modules/axios/lib/helpers/progressEventReducer.js +32 -0
- package/node_modules/axios/lib/helpers/resolveConfig.js +57 -0
- package/node_modules/axios/lib/helpers/throttle.js +5 -3
- package/node_modules/axios/lib/helpers/trackStream.js +55 -0
- package/node_modules/axios/lib/platform/common/utils.js +4 -1
- package/node_modules/axios/lib/utils.js +7 -2
- package/node_modules/axios/package.json +27 -26
- package/node_modules/fast-xml-parser/CHANGELOG.md +14 -0
- package/node_modules/fast-xml-parser/README.md +7 -14
- package/node_modules/fast-xml-parser/package.json +1 -1
- package/node_modules/fast-xml-parser/src/fxp.d.ts +4 -4
- package/node_modules/fast-xml-parser/src/v5/CharsSymbol.js +16 -0
- package/node_modules/fast-xml-parser/src/v5/EntitiesParser.js +107 -0
- package/node_modules/fast-xml-parser/src/v5/OptionsBuilder.js +64 -0
- package/node_modules/fast-xml-parser/src/v5/OutputBuilders/BaseOutputBuilder.js +71 -0
- package/node_modules/fast-xml-parser/src/v5/OutputBuilders/JsArrBuilder.js +103 -0
- package/node_modules/fast-xml-parser/src/v5/OutputBuilders/JsMinArrBuilder.js +102 -0
- package/node_modules/fast-xml-parser/src/v5/OutputBuilders/JsObjBuilder.js +156 -0
- package/node_modules/fast-xml-parser/src/v5/OutputBuilders/ParserOptionsBuilder.js +96 -0
- package/node_modules/fast-xml-parser/src/v5/Report.js +0 -0
- package/node_modules/fast-xml-parser/src/v5/TagPath.js +81 -0
- package/node_modules/fast-xml-parser/src/v5/TagPathMatcher.js +15 -0
- package/node_modules/fast-xml-parser/src/v5/XMLParser.js +85 -0
- package/node_modules/fast-xml-parser/src/v5/Xml2JsParser.js +237 -0
- package/node_modules/fast-xml-parser/src/v5/XmlPartReader.js +212 -0
- package/node_modules/fast-xml-parser/src/v5/XmlSpecialTagsReader.js +118 -0
- package/node_modules/fast-xml-parser/src/v5/inputSource/BufferSource.js +118 -0
- package/node_modules/fast-xml-parser/src/v5/inputSource/StringSource.js +123 -0
- package/node_modules/fast-xml-parser/src/v5/valueParsers/EntitiesParser.js +107 -0
- package/node_modules/fast-xml-parser/src/v5/valueParsers/booleanParser.js +23 -0
- package/node_modules/fast-xml-parser/src/v5/valueParsers/booleanParserExt.js +20 -0
- package/node_modules/fast-xml-parser/src/v5/valueParsers/currency.js +31 -0
- package/node_modules/fast-xml-parser/src/v5/valueParsers/join.js +14 -0
- package/node_modules/fast-xml-parser/src/v5/valueParsers/number.js +16 -0
- package/node_modules/fast-xml-parser/src/v5/valueParsers/trim.js +8 -0
- package/node_modules/fast-xml-parser/src/validator.js +2 -0
- package/node_modules/fast-xml-parser/src/xmlparser/OrderedObjParser.js +13 -4
- package/node_modules/follow-redirects/index.js +1 -1
- package/node_modules/follow-redirects/package.json +1 -1
- package/node_modules/hasown/CHANGELOG.md +12 -0
- package/node_modules/hasown/index.d.ts +2 -2
- package/node_modules/hasown/package.json +5 -2
- package/node_modules/hasown/tsconfig.json +3 -46
- package/node_modules/object-is/.eslintrc +1 -1
- package/node_modules/object-is/.nycrc +0 -4
- package/node_modules/object-is/CHANGELOG.md +25 -0
- package/node_modules/object-is/README.md +20 -20
- package/node_modules/object-is/package.json +23 -14
- package/node_modules/protobufjs/LICENSE +39 -39
- package/node_modules/protobufjs/README.md +727 -740
- package/node_modules/protobufjs/dist/light/protobuf.js +6264 -6264
- package/node_modules/protobufjs/dist/light/protobuf.js.map +1 -1
- package/node_modules/protobufjs/dist/light/protobuf.min.js +2 -2
- package/node_modules/protobufjs/dist/light/protobuf.min.js.map +1 -1
- package/node_modules/protobufjs/dist/minimal/protobuf.js +1928 -1928
- package/node_modules/protobufjs/dist/minimal/protobuf.js.map +1 -1
- package/node_modules/protobufjs/dist/minimal/protobuf.min.js +2 -2
- package/node_modules/protobufjs/dist/minimal/protobuf.min.js.map +1 -1
- package/node_modules/protobufjs/dist/protobuf.js +7978 -7961
- package/node_modules/protobufjs/dist/protobuf.js.map +1 -1
- package/node_modules/protobufjs/dist/protobuf.min.js +3 -3
- package/node_modules/protobufjs/dist/protobuf.min.js.map +1 -1
- package/node_modules/protobufjs/ext/debug/README.md +4 -4
- package/node_modules/protobufjs/ext/debug/index.js +71 -71
- package/node_modules/protobufjs/ext/descriptor/README.md +72 -72
- package/node_modules/protobufjs/ext/descriptor/index.d.ts +191 -191
- package/node_modules/protobufjs/ext/descriptor/index.js +1052 -1052
- package/node_modules/protobufjs/ext/descriptor/test.js +54 -54
- package/node_modules/protobufjs/google/LICENSE +27 -27
- package/node_modules/protobufjs/google/README.md +1 -1
- package/node_modules/protobufjs/google/api/annotations.json +82 -82
- package/node_modules/protobufjs/google/api/annotations.proto +10 -10
- package/node_modules/protobufjs/google/api/http.json +85 -85
- package/node_modules/protobufjs/google/api/http.proto +30 -30
- package/node_modules/protobufjs/google/protobuf/api.json +117 -117
- package/node_modules/protobufjs/google/protobuf/api.proto +33 -33
- package/node_modules/protobufjs/google/protobuf/descriptor.json +738 -738
- package/node_modules/protobufjs/google/protobuf/descriptor.proto +286 -286
- package/node_modules/protobufjs/google/protobuf/source_context.json +19 -19
- package/node_modules/protobufjs/google/protobuf/source_context.proto +7 -7
- package/node_modules/protobufjs/google/protobuf/type.json +201 -201
- package/node_modules/protobufjs/google/protobuf/type.proto +89 -89
- package/node_modules/protobufjs/index.d.ts +2741 -2741
- package/node_modules/protobufjs/index.js +4 -4
- package/node_modules/protobufjs/light.d.ts +2 -2
- package/node_modules/protobufjs/light.js +3 -3
- package/node_modules/protobufjs/minimal.d.ts +2 -2
- package/node_modules/protobufjs/minimal.js +4 -4
- package/node_modules/protobufjs/package.json +111 -111
- package/node_modules/protobufjs/scripts/postinstall.js +32 -32
- package/node_modules/protobufjs/src/common.js +399 -399
- package/node_modules/protobufjs/src/converter.js +301 -301
- package/node_modules/protobufjs/src/decoder.js +129 -129
- package/node_modules/protobufjs/src/encoder.js +100 -100
- package/node_modules/protobufjs/src/enum.js +198 -198
- package/node_modules/protobufjs/src/field.js +377 -377
- package/node_modules/protobufjs/src/index-light.js +104 -104
- package/node_modules/protobufjs/src/index-minimal.js +36 -36
- package/node_modules/protobufjs/src/index.js +12 -12
- package/node_modules/protobufjs/src/mapfield.js +126 -126
- package/node_modules/protobufjs/src/message.js +138 -138
- package/node_modules/protobufjs/src/method.js +160 -160
- package/node_modules/protobufjs/src/namespace.js +433 -433
- package/node_modules/protobufjs/src/object.js +243 -243
- package/node_modules/protobufjs/src/oneof.js +203 -203
- package/node_modules/protobufjs/src/parse.js +889 -872
- package/node_modules/protobufjs/src/reader.js +416 -416
- package/node_modules/protobufjs/src/reader_buffer.js +51 -51
- package/node_modules/protobufjs/src/root.js +368 -368
- package/node_modules/protobufjs/src/roots.js +18 -18
- package/node_modules/protobufjs/src/rpc/service.js +142 -142
- package/node_modules/protobufjs/src/rpc.js +36 -36
- package/node_modules/protobufjs/src/service.js +167 -167
- package/node_modules/protobufjs/src/tokenize.js +416 -416
- package/node_modules/protobufjs/src/type.js +589 -589
- package/node_modules/protobufjs/src/types.js +196 -196
- package/node_modules/protobufjs/src/typescript.jsdoc +15 -15
- package/node_modules/protobufjs/src/util/longbits.js +200 -200
- package/node_modules/protobufjs/src/util/minimal.js +438 -438
- package/node_modules/protobufjs/src/util.js +212 -212
- package/node_modules/protobufjs/src/verifier.js +176 -176
- package/node_modules/protobufjs/src/wrappers.js +102 -102
- package/node_modules/protobufjs/src/writer.js +465 -465
- package/node_modules/protobufjs/src/writer_buffer.js +85 -85
- package/node_modules/protobufjs/tsconfig.json +7 -7
- package/node_modules/set-function-length/CHANGELOG.md +11 -0
- package/node_modules/set-function-length/env.d.ts +9 -6
- package/node_modules/set-function-length/env.js +1 -0
- package/node_modules/set-function-length/index.d.ts +6 -6
- package/node_modules/set-function-length/index.js +1 -3
- package/node_modules/set-function-length/package.json +11 -13
- package/node_modules/set-function-length/tsconfig.json +7 -57
- package/node_modules/undici-types/LICENSE +21 -0
- package/node_modules/undici-types/balanced-pool.d.ts +11 -0
- package/node_modules/undici-types/client.d.ts +12 -1
- package/node_modules/undici-types/diagnostics-channel.d.ts +1 -2
- package/node_modules/undici-types/dispatcher.d.ts +17 -3
- package/node_modules/undici-types/eventsource.d.ts +61 -0
- package/node_modules/undici-types/fetch.d.ts +22 -23
- package/node_modules/undici-types/handlers.d.ts +10 -4
- package/node_modules/undici-types/index.d.ts +6 -1
- package/node_modules/undici-types/package.json +1 -1
- package/node_modules/undici-types/pool.d.ts +11 -0
- package/node_modules/undici-types/proxy-agent.d.ts +0 -2
- package/node_modules/undici-types/readable.d.ts +2 -3
- package/node_modules/undici-types/retry-agent.d.ts +11 -0
- package/node_modules/undici-types/retry-handler.d.ts +116 -0
- package/node_modules/undici-types/util.d.ts +31 -0
- package/node_modules/undici-types/webidl.d.ts +6 -1
- package/node_modules/undici-types/websocket.d.ts +22 -1
- package/node_modules/uuid/CHANGELOG.md +18 -0
- package/node_modules/uuid/README.md +134 -16
- package/node_modules/uuid/dist/commonjs-browser/index.js +40 -15
- package/node_modules/uuid/dist/commonjs-browser/max.js +7 -0
- package/node_modules/uuid/dist/commonjs-browser/md5.js +30 -53
- package/node_modules/uuid/dist/commonjs-browser/native.js +3 -4
- package/node_modules/uuid/dist/commonjs-browser/nil.js +1 -2
- package/node_modules/uuid/dist/commonjs-browser/parse.js +14 -15
- package/node_modules/uuid/dist/commonjs-browser/regex.js +1 -2
- package/node_modules/uuid/dist/commonjs-browser/rng.js +2 -4
- package/node_modules/uuid/dist/commonjs-browser/sha1.js +27 -49
- package/node_modules/uuid/dist/commonjs-browser/stringify.js +10 -16
- package/node_modules/uuid/dist/commonjs-browser/v1.js +73 -49
- package/node_modules/uuid/dist/commonjs-browser/v1ToV6.js +26 -0
- package/node_modules/uuid/dist/commonjs-browser/v3.js +3 -8
- package/node_modules/uuid/dist/commonjs-browser/v35.js +15 -32
- package/node_modules/uuid/dist/commonjs-browser/v4.js +7 -18
- package/node_modules/uuid/dist/commonjs-browser/v5.js +3 -8
- package/node_modules/uuid/dist/commonjs-browser/v6.js +42 -0
- package/node_modules/uuid/dist/commonjs-browser/v6ToV1.js +26 -0
- package/node_modules/uuid/dist/commonjs-browser/v7.js +152 -0
- package/node_modules/uuid/dist/commonjs-browser/validate.js +2 -7
- package/node_modules/uuid/dist/commonjs-browser/version.js +2 -8
- package/node_modules/uuid/dist/esm-browser/index.js +9 -4
- package/node_modules/uuid/dist/esm-browser/max.js +1 -0
- package/node_modules/uuid/dist/esm-browser/md5.js +29 -50
- package/node_modules/uuid/dist/esm-browser/native.js +1 -1
- package/node_modules/uuid/dist/esm-browser/parse.js +12 -10
- package/node_modules/uuid/dist/esm-browser/regex.js +1 -1
- package/node_modules/uuid/dist/esm-browser/rng.js +3 -4
- package/node_modules/uuid/dist/esm-browser/sha1.js +26 -46
- package/node_modules/uuid/dist/esm-browser/stringify.js +9 -11
- package/node_modules/uuid/dist/esm-browser/v1.js +74 -44
- package/node_modules/uuid/dist/esm-browser/v1ToV6.js +20 -0
- package/node_modules/uuid/dist/esm-browser/v3.js +1 -1
- package/node_modules/uuid/dist/esm-browser/v35.js +14 -25
- package/node_modules/uuid/dist/esm-browser/v4.js +5 -9
- package/node_modules/uuid/dist/esm-browser/v5.js +1 -1
- package/node_modules/uuid/dist/esm-browser/v6.js +36 -0
- package/node_modules/uuid/dist/esm-browser/v6ToV1.js +20 -0
- package/node_modules/uuid/dist/esm-browser/v7.js +146 -0
- package/node_modules/uuid/dist/esm-browser/validate.js +0 -2
- package/node_modules/uuid/dist/esm-browser/version.js +0 -3
- package/node_modules/uuid/dist/esm-node/index.js +9 -4
- package/node_modules/uuid/dist/esm-node/max.js +1 -0
- package/node_modules/uuid/dist/esm-node/md5.js +1 -4
- package/node_modules/uuid/dist/esm-node/native.js +1 -1
- package/node_modules/uuid/dist/esm-node/parse.js +11 -9
- package/node_modules/uuid/dist/esm-node/regex.js +1 -1
- package/node_modules/uuid/dist/esm-node/rng.js +1 -3
- package/node_modules/uuid/dist/esm-node/sha1.js +1 -4
- package/node_modules/uuid/dist/esm-node/stringify.js +7 -9
- package/node_modules/uuid/dist/esm-node/v1.js +66 -36
- package/node_modules/uuid/dist/esm-node/v1ToV6.js +20 -0
- package/node_modules/uuid/dist/esm-node/v35.js +8 -19
- package/node_modules/uuid/dist/esm-node/v4.js +4 -8
- package/node_modules/uuid/dist/esm-node/v6.js +32 -0
- package/node_modules/uuid/dist/esm-node/v6ToV1.js +20 -0
- package/node_modules/uuid/dist/esm-node/v7.js +146 -0
- package/node_modules/uuid/dist/esm-node/validate.js +0 -2
- package/node_modules/uuid/dist/esm-node/version.js +0 -3
- package/node_modules/uuid/dist/index.js +40 -15
- package/node_modules/uuid/dist/max.js +7 -0
- package/node_modules/uuid/dist/md5-browser.js +8 -31
- package/node_modules/uuid/dist/md5.js +4 -10
- package/node_modules/uuid/dist/native-browser.js +2 -3
- package/node_modules/uuid/dist/native.js +5 -9
- package/node_modules/uuid/dist/nil.js +1 -2
- package/node_modules/uuid/dist/parse.js +13 -14
- package/node_modules/uuid/dist/regex.js +1 -2
- package/node_modules/uuid/dist/rng-browser.js +1 -3
- package/node_modules/uuid/dist/rng.js +3 -10
- package/node_modules/uuid/dist/sha1-browser.js +1 -23
- package/node_modules/uuid/dist/sha1.js +4 -10
- package/node_modules/uuid/dist/stringify.js +8 -14
- package/node_modules/uuid/dist/uuid-bin.js +12 -22
- package/node_modules/uuid/dist/v1.js +66 -42
- package/node_modules/uuid/dist/v1ToV6.js +26 -0
- package/node_modules/uuid/dist/v3.js +2 -7
- package/node_modules/uuid/dist/v35.js +11 -28
- package/node_modules/uuid/dist/v4.js +6 -17
- package/node_modules/uuid/dist/v5.js +2 -7
- package/node_modules/uuid/dist/v6.js +38 -0
- package/node_modules/uuid/dist/v6ToV1.js +26 -0
- package/node_modules/uuid/dist/v7.js +152 -0
- package/node_modules/uuid/dist/validate.js +2 -7
- package/node_modules/uuid/dist/version.js +2 -8
- package/node_modules/uuid/package.json +41 -34
- package/node_modules/uuid/wrapper.mjs +5 -0
- package/package.json +6 -6
- package/tak-ingest.js +1 -1
- package/tak-registration.js +8 -1
- package/node_modules/@types/node/ts4.8/assert/strict.d.ts +0 -8
- package/node_modules/@types/node/ts4.8/assert.d.ts +0 -996
- package/node_modules/@types/node/ts4.8/async_hooks.d.ts +0 -539
- package/node_modules/@types/node/ts4.8/buffer.d.ts +0 -2363
- package/node_modules/@types/node/ts4.8/child_process.d.ts +0 -1540
- package/node_modules/@types/node/ts4.8/cluster.d.ts +0 -432
- package/node_modules/@types/node/ts4.8/console.d.ts +0 -415
- package/node_modules/@types/node/ts4.8/constants.d.ts +0 -19
- package/node_modules/@types/node/ts4.8/crypto.d.ts +0 -4487
- package/node_modules/@types/node/ts4.8/dgram.d.ts +0 -596
- package/node_modules/@types/node/ts4.8/diagnostics_channel.d.ts +0 -545
- package/node_modules/@types/node/ts4.8/dns/promises.d.ts +0 -425
- package/node_modules/@types/node/ts4.8/dns.d.ts +0 -809
- package/node_modules/@types/node/ts4.8/dom-events.d.ts +0 -122
- package/node_modules/@types/node/ts4.8/domain.d.ts +0 -170
- package/node_modules/@types/node/ts4.8/events.d.ts +0 -879
- package/node_modules/@types/node/ts4.8/fs/promises.d.ts +0 -1239
- package/node_modules/@types/node/ts4.8/fs.d.ts +0 -4311
- package/node_modules/@types/node/ts4.8/globals.d.ts +0 -411
- package/node_modules/@types/node/ts4.8/globals.global.d.ts +0 -1
- package/node_modules/@types/node/ts4.8/http.d.ts +0 -1887
- package/node_modules/@types/node/ts4.8/http2.d.ts +0 -2382
- package/node_modules/@types/node/ts4.8/https.d.ts +0 -550
- package/node_modules/@types/node/ts4.8/index.d.ts +0 -88
- package/node_modules/@types/node/ts4.8/inspector.d.ts +0 -2747
- package/node_modules/@types/node/ts4.8/module.d.ts +0 -315
- package/node_modules/@types/node/ts4.8/net.d.ts +0 -954
- package/node_modules/@types/node/ts4.8/os.d.ts +0 -478
- package/node_modules/@types/node/ts4.8/path.d.ts +0 -191
- package/node_modules/@types/node/ts4.8/perf_hooks.d.ts +0 -645
- package/node_modules/@types/node/ts4.8/process.d.ts +0 -1561
- package/node_modules/@types/node/ts4.8/punycode.d.ts +0 -117
- package/node_modules/@types/node/ts4.8/querystring.d.ts +0 -141
- package/node_modules/@types/node/ts4.8/readline/promises.d.ts +0 -150
- package/node_modules/@types/node/ts4.8/readline.d.ts +0 -539
- package/node_modules/@types/node/ts4.8/repl.d.ts +0 -430
- package/node_modules/@types/node/ts4.8/stream/consumers.d.ts +0 -12
- package/node_modules/@types/node/ts4.8/stream/promises.d.ts +0 -83
- package/node_modules/@types/node/ts4.8/stream/web.d.ts +0 -366
- package/node_modules/@types/node/ts4.8/stream.d.ts +0 -1701
- package/node_modules/@types/node/ts4.8/string_decoder.d.ts +0 -67
- package/node_modules/@types/node/ts4.8/test.d.ts +0 -1465
- package/node_modules/@types/node/ts4.8/timers/promises.d.ts +0 -93
- package/node_modules/@types/node/ts4.8/timers.d.ts +0 -240
- package/node_modules/@types/node/ts4.8/tls.d.ts +0 -1210
- package/node_modules/@types/node/ts4.8/trace_events.d.ts +0 -182
- package/node_modules/@types/node/ts4.8/tty.d.ts +0 -208
- package/node_modules/@types/node/ts4.8/url.d.ts +0 -944
- package/node_modules/@types/node/ts4.8/util.d.ts +0 -2183
- package/node_modules/@types/node/ts4.8/v8.d.ts +0 -764
- package/node_modules/@types/node/ts4.8/vm.d.ts +0 -903
- package/node_modules/@types/node/ts4.8/wasi.d.ts +0 -179
- package/node_modules/@types/node/ts4.8/worker_threads.d.ts +0 -691
- package/node_modules/@types/node/ts4.8/zlib.d.ts +0 -517
- package/node_modules/object-is/.eslintignore +0 -1
- package/node_modules/set-function-length/env.d.ts.map +0 -1
- package/node_modules/set-function-length/index.d.ts.map +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Axios v1.
|
|
1
|
+
// Axios v1.7.2 Copyright (c) 2024 Matt Zabriskie and contributors
|
|
2
2
|
'use strict';
|
|
3
3
|
|
|
4
4
|
function bind(fn, thisArg) {
|
|
@@ -214,6 +214,8 @@ const isFormData = (thing) => {
|
|
|
214
214
|
*/
|
|
215
215
|
const isURLSearchParams = kindOfTest('URLSearchParams');
|
|
216
216
|
|
|
217
|
+
const [isReadableStream, isRequest, isResponse, isHeaders] = ['ReadableStream', 'Request', 'Response', 'Headers'].map(kindOfTest);
|
|
218
|
+
|
|
217
219
|
/**
|
|
218
220
|
* Trim excess whitespace off the beginning and end of a string
|
|
219
221
|
*
|
|
@@ -602,8 +604,7 @@ const toObjectSet = (arrayOrString, delimiter) => {
|
|
|
602
604
|
const noop = () => {};
|
|
603
605
|
|
|
604
606
|
const toFiniteNumber = (value, defaultValue) => {
|
|
605
|
-
value = +value;
|
|
606
|
-
return Number.isFinite(value) ? value : defaultValue;
|
|
607
|
+
return value != null && Number.isFinite(value = +value) ? value : defaultValue;
|
|
607
608
|
};
|
|
608
609
|
|
|
609
610
|
const ALPHA = 'abcdefghijklmnopqrstuvwxyz';
|
|
@@ -684,6 +685,10 @@ var utils$1 = {
|
|
|
684
685
|
isBoolean,
|
|
685
686
|
isObject,
|
|
686
687
|
isPlainObject,
|
|
688
|
+
isReadableStream,
|
|
689
|
+
isRequest,
|
|
690
|
+
isResponse,
|
|
691
|
+
isHeaders,
|
|
687
692
|
isUndefined,
|
|
688
693
|
isDate,
|
|
689
694
|
isFile,
|
|
@@ -1280,11 +1285,14 @@ const hasStandardBrowserWebWorkerEnv = (() => {
|
|
|
1280
1285
|
);
|
|
1281
1286
|
})();
|
|
1282
1287
|
|
|
1288
|
+
const origin = hasBrowserEnv && window.location.href || 'http://localhost';
|
|
1289
|
+
|
|
1283
1290
|
var utils = /*#__PURE__*/Object.freeze({
|
|
1284
1291
|
__proto__: null,
|
|
1285
1292
|
hasBrowserEnv: hasBrowserEnv,
|
|
1286
1293
|
hasStandardBrowserWebWorkerEnv: hasStandardBrowserWebWorkerEnv,
|
|
1287
|
-
hasStandardBrowserEnv: hasStandardBrowserEnv
|
|
1294
|
+
hasStandardBrowserEnv: hasStandardBrowserEnv,
|
|
1295
|
+
origin: origin
|
|
1288
1296
|
});
|
|
1289
1297
|
|
|
1290
1298
|
var platform = {
|
|
@@ -1424,7 +1432,7 @@ const defaults = {
|
|
|
1424
1432
|
|
|
1425
1433
|
transitional: transitionalDefaults,
|
|
1426
1434
|
|
|
1427
|
-
adapter: ['xhr', 'http'],
|
|
1435
|
+
adapter: ['xhr', 'http', 'fetch'],
|
|
1428
1436
|
|
|
1429
1437
|
transformRequest: [function transformRequest(data, headers) {
|
|
1430
1438
|
const contentType = headers.getContentType() || '';
|
|
@@ -1438,9 +1446,6 @@ const defaults = {
|
|
|
1438
1446
|
const isFormData = utils$1.isFormData(data);
|
|
1439
1447
|
|
|
1440
1448
|
if (isFormData) {
|
|
1441
|
-
if (!hasJSONContentType) {
|
|
1442
|
-
return data;
|
|
1443
|
-
}
|
|
1444
1449
|
return hasJSONContentType ? JSON.stringify(formDataToJSON(data)) : data;
|
|
1445
1450
|
}
|
|
1446
1451
|
|
|
@@ -1448,7 +1453,8 @@ const defaults = {
|
|
|
1448
1453
|
utils$1.isBuffer(data) ||
|
|
1449
1454
|
utils$1.isStream(data) ||
|
|
1450
1455
|
utils$1.isFile(data) ||
|
|
1451
|
-
utils$1.isBlob(data)
|
|
1456
|
+
utils$1.isBlob(data) ||
|
|
1457
|
+
utils$1.isReadableStream(data)
|
|
1452
1458
|
) {
|
|
1453
1459
|
return data;
|
|
1454
1460
|
}
|
|
@@ -1491,6 +1497,10 @@ const defaults = {
|
|
|
1491
1497
|
const forcedJSONParsing = transitional && transitional.forcedJSONParsing;
|
|
1492
1498
|
const JSONRequested = this.responseType === 'json';
|
|
1493
1499
|
|
|
1500
|
+
if (utils$1.isResponse(data) || utils$1.isReadableStream(data)) {
|
|
1501
|
+
return data;
|
|
1502
|
+
}
|
|
1503
|
+
|
|
1494
1504
|
if (data && utils$1.isString(data) && ((forcedJSONParsing && !this.responseType) || JSONRequested)) {
|
|
1495
1505
|
const silentJSONParsing = transitional && transitional.silentJSONParsing;
|
|
1496
1506
|
const strictJSONParsing = !silentJSONParsing && JSONRequested;
|
|
@@ -1694,6 +1704,10 @@ class AxiosHeaders {
|
|
|
1694
1704
|
setHeaders(header, valueOrRewrite);
|
|
1695
1705
|
} else if(utils$1.isString(header) && (header = header.trim()) && !isValidHeaderName(header)) {
|
|
1696
1706
|
setHeaders(parseHeaders(header), valueOrRewrite);
|
|
1707
|
+
} else if (utils$1.isHeaders(header)) {
|
|
1708
|
+
for (const [key, value] of header.entries()) {
|
|
1709
|
+
setHeader(value, key, rewrite);
|
|
1710
|
+
}
|
|
1697
1711
|
} else {
|
|
1698
1712
|
header != null && setHeader(valueOrRewrite, header, rewrite);
|
|
1699
1713
|
}
|
|
@@ -1961,90 +1975,125 @@ function settle(resolve, reject, response) {
|
|
|
1961
1975
|
}
|
|
1962
1976
|
}
|
|
1963
1977
|
|
|
1964
|
-
|
|
1978
|
+
function parseProtocol(url) {
|
|
1979
|
+
const match = /^([-+\w]{1,25})(:?\/\/|:)/.exec(url);
|
|
1980
|
+
return match && match[1] || '';
|
|
1981
|
+
}
|
|
1965
1982
|
|
|
1966
|
-
|
|
1967
|
-
|
|
1968
|
-
|
|
1969
|
-
|
|
1983
|
+
/**
|
|
1984
|
+
* Calculate data maxRate
|
|
1985
|
+
* @param {Number} [samplesCount= 10]
|
|
1986
|
+
* @param {Number} [min= 1000]
|
|
1987
|
+
* @returns {Function}
|
|
1988
|
+
*/
|
|
1989
|
+
function speedometer(samplesCount, min) {
|
|
1990
|
+
samplesCount = samplesCount || 10;
|
|
1991
|
+
const bytes = new Array(samplesCount);
|
|
1992
|
+
const timestamps = new Array(samplesCount);
|
|
1993
|
+
let head = 0;
|
|
1994
|
+
let tail = 0;
|
|
1995
|
+
let firstSampleTS;
|
|
1970
1996
|
|
|
1971
|
-
|
|
1997
|
+
min = min !== undefined ? min : 1000;
|
|
1972
1998
|
|
|
1973
|
-
|
|
1999
|
+
return function push(chunkLength) {
|
|
2000
|
+
const now = Date.now();
|
|
1974
2001
|
|
|
1975
|
-
|
|
2002
|
+
const startedAt = timestamps[tail];
|
|
1976
2003
|
|
|
1977
|
-
|
|
2004
|
+
if (!firstSampleTS) {
|
|
2005
|
+
firstSampleTS = now;
|
|
2006
|
+
}
|
|
1978
2007
|
|
|
1979
|
-
|
|
1980
|
-
|
|
2008
|
+
bytes[head] = chunkLength;
|
|
2009
|
+
timestamps[head] = now;
|
|
1981
2010
|
|
|
1982
|
-
|
|
1983
|
-
|
|
1984
|
-
return (match ? decodeURIComponent(match[3]) : null);
|
|
1985
|
-
},
|
|
2011
|
+
let i = tail;
|
|
2012
|
+
let bytesCount = 0;
|
|
1986
2013
|
|
|
1987
|
-
|
|
1988
|
-
|
|
2014
|
+
while (i !== head) {
|
|
2015
|
+
bytesCount += bytes[i++];
|
|
2016
|
+
i = i % samplesCount;
|
|
1989
2017
|
}
|
|
1990
|
-
}
|
|
1991
2018
|
|
|
1992
|
-
|
|
2019
|
+
head = (head + 1) % samplesCount;
|
|
1993
2020
|
|
|
1994
|
-
|
|
1995
|
-
|
|
1996
|
-
|
|
1997
|
-
read() {
|
|
1998
|
-
return null;
|
|
1999
|
-
},
|
|
2000
|
-
remove() {}
|
|
2001
|
-
};
|
|
2021
|
+
if (head === tail) {
|
|
2022
|
+
tail = (tail + 1) % samplesCount;
|
|
2023
|
+
}
|
|
2002
2024
|
|
|
2003
|
-
|
|
2004
|
-
|
|
2005
|
-
|
|
2006
|
-
* @param {string} url The URL to test
|
|
2007
|
-
*
|
|
2008
|
-
* @returns {boolean} True if the specified URL is absolute, otherwise false
|
|
2009
|
-
*/
|
|
2010
|
-
function isAbsoluteURL(url) {
|
|
2011
|
-
// A URL is considered absolute if it begins with "<scheme>://" or "//" (protocol-relative URL).
|
|
2012
|
-
// RFC 3986 defines scheme name as a sequence of characters beginning with a letter and followed
|
|
2013
|
-
// by any combination of letters, digits, plus, period, or hyphen.
|
|
2014
|
-
return /^([a-z][a-z\d+\-.]*:)?\/\//i.test(url);
|
|
2015
|
-
}
|
|
2025
|
+
if (now - firstSampleTS < min) {
|
|
2026
|
+
return;
|
|
2027
|
+
}
|
|
2016
2028
|
|
|
2017
|
-
|
|
2018
|
-
|
|
2019
|
-
*
|
|
2020
|
-
|
|
2021
|
-
* @param {string} relativeURL The relative URL
|
|
2022
|
-
*
|
|
2023
|
-
* @returns {string} The combined URL
|
|
2024
|
-
*/
|
|
2025
|
-
function combineURLs(baseURL, relativeURL) {
|
|
2026
|
-
return relativeURL
|
|
2027
|
-
? baseURL.replace(/\/?\/$/, '') + '/' + relativeURL.replace(/^\/+/, '')
|
|
2028
|
-
: baseURL;
|
|
2029
|
+
const passed = startedAt && now - startedAt;
|
|
2030
|
+
|
|
2031
|
+
return passed ? Math.round(bytesCount * 1000 / passed) : undefined;
|
|
2032
|
+
};
|
|
2029
2033
|
}
|
|
2030
2034
|
|
|
2031
2035
|
/**
|
|
2032
|
-
*
|
|
2033
|
-
*
|
|
2034
|
-
*
|
|
2035
|
-
*
|
|
2036
|
-
* @param {string} baseURL The base URL
|
|
2037
|
-
* @param {string} requestedURL Absolute or relative URL to combine
|
|
2038
|
-
*
|
|
2039
|
-
* @returns {string} The combined full path
|
|
2036
|
+
* Throttle decorator
|
|
2037
|
+
* @param {Function} fn
|
|
2038
|
+
* @param {Number} freq
|
|
2039
|
+
* @return {Function}
|
|
2040
2040
|
*/
|
|
2041
|
-
function
|
|
2042
|
-
|
|
2043
|
-
|
|
2044
|
-
|
|
2045
|
-
return
|
|
2041
|
+
function throttle(fn, freq) {
|
|
2042
|
+
let timestamp = 0;
|
|
2043
|
+
const threshold = 1000 / freq;
|
|
2044
|
+
let timer = null;
|
|
2045
|
+
return function throttled() {
|
|
2046
|
+
const force = this === true;
|
|
2047
|
+
|
|
2048
|
+
const now = Date.now();
|
|
2049
|
+
if (force || now - timestamp > threshold) {
|
|
2050
|
+
if (timer) {
|
|
2051
|
+
clearTimeout(timer);
|
|
2052
|
+
timer = null;
|
|
2053
|
+
}
|
|
2054
|
+
timestamp = now;
|
|
2055
|
+
return fn.apply(null, arguments);
|
|
2056
|
+
}
|
|
2057
|
+
if (!timer) {
|
|
2058
|
+
timer = setTimeout(() => {
|
|
2059
|
+
timer = null;
|
|
2060
|
+
timestamp = Date.now();
|
|
2061
|
+
return fn.apply(null, arguments);
|
|
2062
|
+
}, threshold - (now - timestamp));
|
|
2063
|
+
}
|
|
2064
|
+
};
|
|
2046
2065
|
}
|
|
2047
2066
|
|
|
2067
|
+
var progressEventReducer = (listener, isDownloadStream, freq = 3) => {
|
|
2068
|
+
let bytesNotified = 0;
|
|
2069
|
+
const _speedometer = speedometer(50, 250);
|
|
2070
|
+
|
|
2071
|
+
return throttle(e => {
|
|
2072
|
+
const loaded = e.loaded;
|
|
2073
|
+
const total = e.lengthComputable ? e.total : undefined;
|
|
2074
|
+
const progressBytes = loaded - bytesNotified;
|
|
2075
|
+
const rate = _speedometer(progressBytes);
|
|
2076
|
+
const inRange = loaded <= total;
|
|
2077
|
+
|
|
2078
|
+
bytesNotified = loaded;
|
|
2079
|
+
|
|
2080
|
+
const data = {
|
|
2081
|
+
loaded,
|
|
2082
|
+
total,
|
|
2083
|
+
progress: total ? (loaded / total) : undefined,
|
|
2084
|
+
bytes: progressBytes,
|
|
2085
|
+
rate: rate ? rate : undefined,
|
|
2086
|
+
estimated: rate && total && inRange ? (total - loaded) / rate : undefined,
|
|
2087
|
+
event: e,
|
|
2088
|
+
lengthComputable: total != null
|
|
2089
|
+
};
|
|
2090
|
+
|
|
2091
|
+
data[isDownloadStream ? 'download' : 'upload'] = true;
|
|
2092
|
+
|
|
2093
|
+
listener(data);
|
|
2094
|
+
}, freq);
|
|
2095
|
+
};
|
|
2096
|
+
|
|
2048
2097
|
var isURLSameOrigin = platform.hasStandardBrowserEnv ?
|
|
2049
2098
|
|
|
2050
2099
|
// Standard browser envs have full support of the APIs needed to test
|
|
@@ -2108,137 +2157,265 @@ var isURLSameOrigin = platform.hasStandardBrowserEnv ?
|
|
|
2108
2157
|
};
|
|
2109
2158
|
})();
|
|
2110
2159
|
|
|
2111
|
-
|
|
2112
|
-
const match = /^([-+\w]{1,25})(:?\/\/|:)/.exec(url);
|
|
2113
|
-
return match && match[1] || '';
|
|
2114
|
-
}
|
|
2160
|
+
var cookies = platform.hasStandardBrowserEnv ?
|
|
2115
2161
|
|
|
2116
|
-
|
|
2117
|
-
|
|
2118
|
-
|
|
2119
|
-
|
|
2120
|
-
* @returns {Function}
|
|
2121
|
-
*/
|
|
2122
|
-
function speedometer(samplesCount, min) {
|
|
2123
|
-
samplesCount = samplesCount || 10;
|
|
2124
|
-
const bytes = new Array(samplesCount);
|
|
2125
|
-
const timestamps = new Array(samplesCount);
|
|
2126
|
-
let head = 0;
|
|
2127
|
-
let tail = 0;
|
|
2128
|
-
let firstSampleTS;
|
|
2162
|
+
// Standard browser envs support document.cookie
|
|
2163
|
+
{
|
|
2164
|
+
write(name, value, expires, path, domain, secure) {
|
|
2165
|
+
const cookie = [name + '=' + encodeURIComponent(value)];
|
|
2129
2166
|
|
|
2130
|
-
|
|
2167
|
+
utils$1.isNumber(expires) && cookie.push('expires=' + new Date(expires).toGMTString());
|
|
2131
2168
|
|
|
2132
|
-
|
|
2133
|
-
const now = Date.now();
|
|
2169
|
+
utils$1.isString(path) && cookie.push('path=' + path);
|
|
2134
2170
|
|
|
2135
|
-
|
|
2171
|
+
utils$1.isString(domain) && cookie.push('domain=' + domain);
|
|
2136
2172
|
|
|
2137
|
-
|
|
2138
|
-
firstSampleTS = now;
|
|
2139
|
-
}
|
|
2173
|
+
secure === true && cookie.push('secure');
|
|
2140
2174
|
|
|
2141
|
-
|
|
2142
|
-
|
|
2175
|
+
document.cookie = cookie.join('; ');
|
|
2176
|
+
},
|
|
2143
2177
|
|
|
2144
|
-
|
|
2145
|
-
|
|
2178
|
+
read(name) {
|
|
2179
|
+
const match = document.cookie.match(new RegExp('(^|;\\s*)(' + name + ')=([^;]*)'));
|
|
2180
|
+
return (match ? decodeURIComponent(match[3]) : null);
|
|
2181
|
+
},
|
|
2146
2182
|
|
|
2147
|
-
|
|
2148
|
-
|
|
2149
|
-
i = i % samplesCount;
|
|
2183
|
+
remove(name) {
|
|
2184
|
+
this.write(name, '', Date.now() - 86400000);
|
|
2150
2185
|
}
|
|
2186
|
+
}
|
|
2151
2187
|
|
|
2152
|
-
|
|
2188
|
+
:
|
|
2153
2189
|
|
|
2154
|
-
|
|
2155
|
-
|
|
2156
|
-
}
|
|
2190
|
+
// Non-standard browser env (web workers, react-native) lack needed support.
|
|
2191
|
+
{
|
|
2192
|
+
write() {},
|
|
2193
|
+
read() {
|
|
2194
|
+
return null;
|
|
2195
|
+
},
|
|
2196
|
+
remove() {}
|
|
2197
|
+
};
|
|
2157
2198
|
|
|
2158
|
-
|
|
2159
|
-
|
|
2160
|
-
|
|
2199
|
+
/**
|
|
2200
|
+
* Determines whether the specified URL is absolute
|
|
2201
|
+
*
|
|
2202
|
+
* @param {string} url The URL to test
|
|
2203
|
+
*
|
|
2204
|
+
* @returns {boolean} True if the specified URL is absolute, otherwise false
|
|
2205
|
+
*/
|
|
2206
|
+
function isAbsoluteURL(url) {
|
|
2207
|
+
// A URL is considered absolute if it begins with "<scheme>://" or "//" (protocol-relative URL).
|
|
2208
|
+
// RFC 3986 defines scheme name as a sequence of characters beginning with a letter and followed
|
|
2209
|
+
// by any combination of letters, digits, plus, period, or hyphen.
|
|
2210
|
+
return /^([a-z][a-z\d+\-.]*:)?\/\//i.test(url);
|
|
2211
|
+
}
|
|
2161
2212
|
|
|
2162
|
-
|
|
2213
|
+
/**
|
|
2214
|
+
* Creates a new URL by combining the specified URLs
|
|
2215
|
+
*
|
|
2216
|
+
* @param {string} baseURL The base URL
|
|
2217
|
+
* @param {string} relativeURL The relative URL
|
|
2218
|
+
*
|
|
2219
|
+
* @returns {string} The combined URL
|
|
2220
|
+
*/
|
|
2221
|
+
function combineURLs(baseURL, relativeURL) {
|
|
2222
|
+
return relativeURL
|
|
2223
|
+
? baseURL.replace(/\/?\/$/, '') + '/' + relativeURL.replace(/^\/+/, '')
|
|
2224
|
+
: baseURL;
|
|
2225
|
+
}
|
|
2163
2226
|
|
|
2164
|
-
|
|
2165
|
-
|
|
2227
|
+
/**
|
|
2228
|
+
* Creates a new URL by combining the baseURL with the requestedURL,
|
|
2229
|
+
* only when the requestedURL is not already an absolute URL.
|
|
2230
|
+
* If the requestURL is absolute, this function returns the requestedURL untouched.
|
|
2231
|
+
*
|
|
2232
|
+
* @param {string} baseURL The base URL
|
|
2233
|
+
* @param {string} requestedURL Absolute or relative URL to combine
|
|
2234
|
+
*
|
|
2235
|
+
* @returns {string} The combined full path
|
|
2236
|
+
*/
|
|
2237
|
+
function buildFullPath(baseURL, requestedURL) {
|
|
2238
|
+
if (baseURL && !isAbsoluteURL(requestedURL)) {
|
|
2239
|
+
return combineURLs(baseURL, requestedURL);
|
|
2240
|
+
}
|
|
2241
|
+
return requestedURL;
|
|
2166
2242
|
}
|
|
2167
2243
|
|
|
2168
|
-
|
|
2169
|
-
let bytesNotified = 0;
|
|
2170
|
-
const _speedometer = speedometer(50, 250);
|
|
2244
|
+
const headersToObject = (thing) => thing instanceof AxiosHeaders$1 ? { ...thing } : thing;
|
|
2171
2245
|
|
|
2172
|
-
|
|
2173
|
-
|
|
2174
|
-
|
|
2175
|
-
|
|
2176
|
-
|
|
2177
|
-
|
|
2246
|
+
/**
|
|
2247
|
+
* Config-specific merge-function which creates a new config-object
|
|
2248
|
+
* by merging two configuration objects together.
|
|
2249
|
+
*
|
|
2250
|
+
* @param {Object} config1
|
|
2251
|
+
* @param {Object} config2
|
|
2252
|
+
*
|
|
2253
|
+
* @returns {Object} New object resulting from merging config2 to config1
|
|
2254
|
+
*/
|
|
2255
|
+
function mergeConfig(config1, config2) {
|
|
2256
|
+
// eslint-disable-next-line no-param-reassign
|
|
2257
|
+
config2 = config2 || {};
|
|
2258
|
+
const config = {};
|
|
2178
2259
|
|
|
2179
|
-
|
|
2260
|
+
function getMergedValue(target, source, caseless) {
|
|
2261
|
+
if (utils$1.isPlainObject(target) && utils$1.isPlainObject(source)) {
|
|
2262
|
+
return utils$1.merge.call({caseless}, target, source);
|
|
2263
|
+
} else if (utils$1.isPlainObject(source)) {
|
|
2264
|
+
return utils$1.merge({}, source);
|
|
2265
|
+
} else if (utils$1.isArray(source)) {
|
|
2266
|
+
return source.slice();
|
|
2267
|
+
}
|
|
2268
|
+
return source;
|
|
2269
|
+
}
|
|
2180
2270
|
|
|
2181
|
-
|
|
2182
|
-
|
|
2183
|
-
|
|
2184
|
-
|
|
2185
|
-
|
|
2186
|
-
|
|
2187
|
-
|
|
2188
|
-
|
|
2189
|
-
};
|
|
2271
|
+
// eslint-disable-next-line consistent-return
|
|
2272
|
+
function mergeDeepProperties(a, b, caseless) {
|
|
2273
|
+
if (!utils$1.isUndefined(b)) {
|
|
2274
|
+
return getMergedValue(a, b, caseless);
|
|
2275
|
+
} else if (!utils$1.isUndefined(a)) {
|
|
2276
|
+
return getMergedValue(undefined, a, caseless);
|
|
2277
|
+
}
|
|
2278
|
+
}
|
|
2190
2279
|
|
|
2191
|
-
|
|
2280
|
+
// eslint-disable-next-line consistent-return
|
|
2281
|
+
function valueFromConfig2(a, b) {
|
|
2282
|
+
if (!utils$1.isUndefined(b)) {
|
|
2283
|
+
return getMergedValue(undefined, b);
|
|
2284
|
+
}
|
|
2285
|
+
}
|
|
2192
2286
|
|
|
2193
|
-
|
|
2287
|
+
// eslint-disable-next-line consistent-return
|
|
2288
|
+
function defaultToConfig2(a, b) {
|
|
2289
|
+
if (!utils$1.isUndefined(b)) {
|
|
2290
|
+
return getMergedValue(undefined, b);
|
|
2291
|
+
} else if (!utils$1.isUndefined(a)) {
|
|
2292
|
+
return getMergedValue(undefined, a);
|
|
2293
|
+
}
|
|
2294
|
+
}
|
|
2295
|
+
|
|
2296
|
+
// eslint-disable-next-line consistent-return
|
|
2297
|
+
function mergeDirectKeys(a, b, prop) {
|
|
2298
|
+
if (prop in config2) {
|
|
2299
|
+
return getMergedValue(a, b);
|
|
2300
|
+
} else if (prop in config1) {
|
|
2301
|
+
return getMergedValue(undefined, a);
|
|
2302
|
+
}
|
|
2303
|
+
}
|
|
2304
|
+
|
|
2305
|
+
const mergeMap = {
|
|
2306
|
+
url: valueFromConfig2,
|
|
2307
|
+
method: valueFromConfig2,
|
|
2308
|
+
data: valueFromConfig2,
|
|
2309
|
+
baseURL: defaultToConfig2,
|
|
2310
|
+
transformRequest: defaultToConfig2,
|
|
2311
|
+
transformResponse: defaultToConfig2,
|
|
2312
|
+
paramsSerializer: defaultToConfig2,
|
|
2313
|
+
timeout: defaultToConfig2,
|
|
2314
|
+
timeoutMessage: defaultToConfig2,
|
|
2315
|
+
withCredentials: defaultToConfig2,
|
|
2316
|
+
withXSRFToken: defaultToConfig2,
|
|
2317
|
+
adapter: defaultToConfig2,
|
|
2318
|
+
responseType: defaultToConfig2,
|
|
2319
|
+
xsrfCookieName: defaultToConfig2,
|
|
2320
|
+
xsrfHeaderName: defaultToConfig2,
|
|
2321
|
+
onUploadProgress: defaultToConfig2,
|
|
2322
|
+
onDownloadProgress: defaultToConfig2,
|
|
2323
|
+
decompress: defaultToConfig2,
|
|
2324
|
+
maxContentLength: defaultToConfig2,
|
|
2325
|
+
maxBodyLength: defaultToConfig2,
|
|
2326
|
+
beforeRedirect: defaultToConfig2,
|
|
2327
|
+
transport: defaultToConfig2,
|
|
2328
|
+
httpAgent: defaultToConfig2,
|
|
2329
|
+
httpsAgent: defaultToConfig2,
|
|
2330
|
+
cancelToken: defaultToConfig2,
|
|
2331
|
+
socketPath: defaultToConfig2,
|
|
2332
|
+
responseEncoding: defaultToConfig2,
|
|
2333
|
+
validateStatus: mergeDirectKeys,
|
|
2334
|
+
headers: (a, b) => mergeDeepProperties(headersToObject(a), headersToObject(b), true)
|
|
2194
2335
|
};
|
|
2336
|
+
|
|
2337
|
+
utils$1.forEach(Object.keys(Object.assign({}, config1, config2)), function computeConfigValue(prop) {
|
|
2338
|
+
const merge = mergeMap[prop] || mergeDeepProperties;
|
|
2339
|
+
const configValue = merge(config1[prop], config2[prop], prop);
|
|
2340
|
+
(utils$1.isUndefined(configValue) && merge !== mergeDirectKeys) || (config[prop] = configValue);
|
|
2341
|
+
});
|
|
2342
|
+
|
|
2343
|
+
return config;
|
|
2195
2344
|
}
|
|
2196
2345
|
|
|
2346
|
+
var resolveConfig = (config) => {
|
|
2347
|
+
const newConfig = mergeConfig({}, config);
|
|
2348
|
+
|
|
2349
|
+
let {data, withXSRFToken, xsrfHeaderName, xsrfCookieName, headers, auth} = newConfig;
|
|
2350
|
+
|
|
2351
|
+
newConfig.headers = headers = AxiosHeaders$1.from(headers);
|
|
2352
|
+
|
|
2353
|
+
newConfig.url = buildURL(buildFullPath(newConfig.baseURL, newConfig.url), config.params, config.paramsSerializer);
|
|
2354
|
+
|
|
2355
|
+
// HTTP basic authentication
|
|
2356
|
+
if (auth) {
|
|
2357
|
+
headers.set('Authorization', 'Basic ' +
|
|
2358
|
+
btoa((auth.username || '') + ':' + (auth.password ? unescape(encodeURIComponent(auth.password)) : ''))
|
|
2359
|
+
);
|
|
2360
|
+
}
|
|
2361
|
+
|
|
2362
|
+
let contentType;
|
|
2363
|
+
|
|
2364
|
+
if (utils$1.isFormData(data)) {
|
|
2365
|
+
if (platform.hasStandardBrowserEnv || platform.hasStandardBrowserWebWorkerEnv) {
|
|
2366
|
+
headers.setContentType(undefined); // Let the browser set it
|
|
2367
|
+
} else if ((contentType = headers.getContentType()) !== false) {
|
|
2368
|
+
// fix semicolon duplication issue for ReactNative FormData implementation
|
|
2369
|
+
const [type, ...tokens] = contentType ? contentType.split(';').map(token => token.trim()).filter(Boolean) : [];
|
|
2370
|
+
headers.setContentType([type || 'multipart/form-data', ...tokens].join('; '));
|
|
2371
|
+
}
|
|
2372
|
+
}
|
|
2373
|
+
|
|
2374
|
+
// Add xsrf header
|
|
2375
|
+
// This is only done if running in a standard browser environment.
|
|
2376
|
+
// Specifically not if we're in a web worker, or react-native.
|
|
2377
|
+
|
|
2378
|
+
if (platform.hasStandardBrowserEnv) {
|
|
2379
|
+
withXSRFToken && utils$1.isFunction(withXSRFToken) && (withXSRFToken = withXSRFToken(newConfig));
|
|
2380
|
+
|
|
2381
|
+
if (withXSRFToken || (withXSRFToken !== false && isURLSameOrigin(newConfig.url))) {
|
|
2382
|
+
// Add xsrf header
|
|
2383
|
+
const xsrfValue = xsrfHeaderName && xsrfCookieName && cookies.read(xsrfCookieName);
|
|
2384
|
+
|
|
2385
|
+
if (xsrfValue) {
|
|
2386
|
+
headers.set(xsrfHeaderName, xsrfValue);
|
|
2387
|
+
}
|
|
2388
|
+
}
|
|
2389
|
+
}
|
|
2390
|
+
|
|
2391
|
+
return newConfig;
|
|
2392
|
+
};
|
|
2393
|
+
|
|
2197
2394
|
const isXHRAdapterSupported = typeof XMLHttpRequest !== 'undefined';
|
|
2198
2395
|
|
|
2199
2396
|
var xhrAdapter = isXHRAdapterSupported && function (config) {
|
|
2200
2397
|
return new Promise(function dispatchXhrRequest(resolve, reject) {
|
|
2201
|
-
|
|
2202
|
-
|
|
2203
|
-
|
|
2398
|
+
const _config = resolveConfig(config);
|
|
2399
|
+
let requestData = _config.data;
|
|
2400
|
+
const requestHeaders = AxiosHeaders$1.from(_config.headers).normalize();
|
|
2401
|
+
let {responseType} = _config;
|
|
2204
2402
|
let onCanceled;
|
|
2205
2403
|
function done() {
|
|
2206
|
-
if (
|
|
2207
|
-
|
|
2404
|
+
if (_config.cancelToken) {
|
|
2405
|
+
_config.cancelToken.unsubscribe(onCanceled);
|
|
2208
2406
|
}
|
|
2209
2407
|
|
|
2210
|
-
if (
|
|
2211
|
-
|
|
2212
|
-
}
|
|
2213
|
-
}
|
|
2214
|
-
|
|
2215
|
-
let contentType;
|
|
2216
|
-
|
|
2217
|
-
if (utils$1.isFormData(requestData)) {
|
|
2218
|
-
if (platform.hasStandardBrowserEnv || platform.hasStandardBrowserWebWorkerEnv) {
|
|
2219
|
-
requestHeaders.setContentType(false); // Let the browser set it
|
|
2220
|
-
} else if ((contentType = requestHeaders.getContentType()) !== false) {
|
|
2221
|
-
// fix semicolon duplication issue for ReactNative FormData implementation
|
|
2222
|
-
const [type, ...tokens] = contentType ? contentType.split(';').map(token => token.trim()).filter(Boolean) : [];
|
|
2223
|
-
requestHeaders.setContentType([type || 'multipart/form-data', ...tokens].join('; '));
|
|
2408
|
+
if (_config.signal) {
|
|
2409
|
+
_config.signal.removeEventListener('abort', onCanceled);
|
|
2224
2410
|
}
|
|
2225
2411
|
}
|
|
2226
2412
|
|
|
2227
2413
|
let request = new XMLHttpRequest();
|
|
2228
2414
|
|
|
2229
|
-
|
|
2230
|
-
if (config.auth) {
|
|
2231
|
-
const username = config.auth.username || '';
|
|
2232
|
-
const password = config.auth.password ? unescape(encodeURIComponent(config.auth.password)) : '';
|
|
2233
|
-
requestHeaders.set('Authorization', 'Basic ' + btoa(username + ':' + password));
|
|
2234
|
-
}
|
|
2235
|
-
|
|
2236
|
-
const fullPath = buildFullPath(config.baseURL, config.url);
|
|
2237
|
-
|
|
2238
|
-
request.open(config.method.toUpperCase(), buildURL(fullPath, config.params, config.paramsSerializer), true);
|
|
2415
|
+
request.open(_config.method.toUpperCase(), _config.url, true);
|
|
2239
2416
|
|
|
2240
2417
|
// Set the request timeout in MS
|
|
2241
|
-
request.timeout =
|
|
2418
|
+
request.timeout = _config.timeout;
|
|
2242
2419
|
|
|
2243
2420
|
function onloadend() {
|
|
2244
2421
|
if (!request) {
|
|
@@ -2300,7 +2477,7 @@ var xhrAdapter = isXHRAdapterSupported && function (config) {
|
|
|
2300
2477
|
return;
|
|
2301
2478
|
}
|
|
2302
2479
|
|
|
2303
|
-
reject(new AxiosError('Request aborted', AxiosError.ECONNABORTED,
|
|
2480
|
+
reject(new AxiosError('Request aborted', AxiosError.ECONNABORTED, _config, request));
|
|
2304
2481
|
|
|
2305
2482
|
// Clean up request
|
|
2306
2483
|
request = null;
|
|
@@ -2310,7 +2487,7 @@ var xhrAdapter = isXHRAdapterSupported && function (config) {
|
|
|
2310
2487
|
request.onerror = function handleError() {
|
|
2311
2488
|
// Real errors are hidden from us by the browser
|
|
2312
2489
|
// onerror should only fire if it's a network error
|
|
2313
|
-
reject(new AxiosError('Network Error', AxiosError.ERR_NETWORK,
|
|
2490
|
+
reject(new AxiosError('Network Error', AxiosError.ERR_NETWORK, _config, request));
|
|
2314
2491
|
|
|
2315
2492
|
// Clean up request
|
|
2316
2493
|
request = null;
|
|
@@ -2318,37 +2495,21 @@ var xhrAdapter = isXHRAdapterSupported && function (config) {
|
|
|
2318
2495
|
|
|
2319
2496
|
// Handle timeout
|
|
2320
2497
|
request.ontimeout = function handleTimeout() {
|
|
2321
|
-
let timeoutErrorMessage =
|
|
2322
|
-
const transitional =
|
|
2323
|
-
if (
|
|
2324
|
-
timeoutErrorMessage =
|
|
2498
|
+
let timeoutErrorMessage = _config.timeout ? 'timeout of ' + _config.timeout + 'ms exceeded' : 'timeout exceeded';
|
|
2499
|
+
const transitional = _config.transitional || transitionalDefaults;
|
|
2500
|
+
if (_config.timeoutErrorMessage) {
|
|
2501
|
+
timeoutErrorMessage = _config.timeoutErrorMessage;
|
|
2325
2502
|
}
|
|
2326
2503
|
reject(new AxiosError(
|
|
2327
2504
|
timeoutErrorMessage,
|
|
2328
2505
|
transitional.clarifyTimeoutError ? AxiosError.ETIMEDOUT : AxiosError.ECONNABORTED,
|
|
2329
|
-
|
|
2506
|
+
_config,
|
|
2330
2507
|
request));
|
|
2331
2508
|
|
|
2332
2509
|
// Clean up request
|
|
2333
2510
|
request = null;
|
|
2334
2511
|
};
|
|
2335
2512
|
|
|
2336
|
-
// Add xsrf header
|
|
2337
|
-
// This is only done if running in a standard browser environment.
|
|
2338
|
-
// Specifically not if we're in a web worker, or react-native.
|
|
2339
|
-
if(platform.hasStandardBrowserEnv) {
|
|
2340
|
-
withXSRFToken && utils$1.isFunction(withXSRFToken) && (withXSRFToken = withXSRFToken(config));
|
|
2341
|
-
|
|
2342
|
-
if (withXSRFToken || (withXSRFToken !== false && isURLSameOrigin(fullPath))) {
|
|
2343
|
-
// Add xsrf header
|
|
2344
|
-
const xsrfValue = config.xsrfHeaderName && config.xsrfCookieName && cookies.read(config.xsrfCookieName);
|
|
2345
|
-
|
|
2346
|
-
if (xsrfValue) {
|
|
2347
|
-
requestHeaders.set(config.xsrfHeaderName, xsrfValue);
|
|
2348
|
-
}
|
|
2349
|
-
}
|
|
2350
|
-
}
|
|
2351
|
-
|
|
2352
2513
|
// Remove Content-Type if data is undefined
|
|
2353
2514
|
requestData === undefined && requestHeaders.setContentType(null);
|
|
2354
2515
|
|
|
@@ -2360,26 +2521,26 @@ var xhrAdapter = isXHRAdapterSupported && function (config) {
|
|
|
2360
2521
|
}
|
|
2361
2522
|
|
|
2362
2523
|
// Add withCredentials to request if needed
|
|
2363
|
-
if (!utils$1.isUndefined(
|
|
2364
|
-
request.withCredentials = !!
|
|
2524
|
+
if (!utils$1.isUndefined(_config.withCredentials)) {
|
|
2525
|
+
request.withCredentials = !!_config.withCredentials;
|
|
2365
2526
|
}
|
|
2366
2527
|
|
|
2367
2528
|
// Add responseType to request if needed
|
|
2368
2529
|
if (responseType && responseType !== 'json') {
|
|
2369
|
-
request.responseType =
|
|
2530
|
+
request.responseType = _config.responseType;
|
|
2370
2531
|
}
|
|
2371
2532
|
|
|
2372
2533
|
// Handle progress if needed
|
|
2373
|
-
if (typeof
|
|
2374
|
-
request.addEventListener('progress', progressEventReducer(
|
|
2534
|
+
if (typeof _config.onDownloadProgress === 'function') {
|
|
2535
|
+
request.addEventListener('progress', progressEventReducer(_config.onDownloadProgress, true));
|
|
2375
2536
|
}
|
|
2376
2537
|
|
|
2377
2538
|
// Not all browsers support upload events
|
|
2378
|
-
if (typeof
|
|
2379
|
-
request.upload.addEventListener('progress', progressEventReducer(
|
|
2539
|
+
if (typeof _config.onUploadProgress === 'function' && request.upload) {
|
|
2540
|
+
request.upload.addEventListener('progress', progressEventReducer(_config.onUploadProgress));
|
|
2380
2541
|
}
|
|
2381
2542
|
|
|
2382
|
-
if (
|
|
2543
|
+
if (_config.cancelToken || _config.signal) {
|
|
2383
2544
|
// Handle cancellation
|
|
2384
2545
|
// eslint-disable-next-line func-names
|
|
2385
2546
|
onCanceled = cancel => {
|
|
@@ -2391,13 +2552,13 @@ var xhrAdapter = isXHRAdapterSupported && function (config) {
|
|
|
2391
2552
|
request = null;
|
|
2392
2553
|
};
|
|
2393
2554
|
|
|
2394
|
-
|
|
2395
|
-
if (
|
|
2396
|
-
|
|
2555
|
+
_config.cancelToken && _config.cancelToken.subscribe(onCanceled);
|
|
2556
|
+
if (_config.signal) {
|
|
2557
|
+
_config.signal.aborted ? onCanceled() : _config.signal.addEventListener('abort', onCanceled);
|
|
2397
2558
|
}
|
|
2398
2559
|
}
|
|
2399
2560
|
|
|
2400
|
-
const protocol = parseProtocol(
|
|
2561
|
+
const protocol = parseProtocol(_config.url);
|
|
2401
2562
|
|
|
2402
2563
|
if (protocol && platform.protocols.indexOf(protocol) === -1) {
|
|
2403
2564
|
reject(new AxiosError('Unsupported protocol ' + protocol + ':', AxiosError.ERR_BAD_REQUEST, config));
|
|
@@ -2410,9 +2571,324 @@ var xhrAdapter = isXHRAdapterSupported && function (config) {
|
|
|
2410
2571
|
});
|
|
2411
2572
|
};
|
|
2412
2573
|
|
|
2574
|
+
const composeSignals = (signals, timeout) => {
|
|
2575
|
+
let controller = new AbortController();
|
|
2576
|
+
|
|
2577
|
+
let aborted;
|
|
2578
|
+
|
|
2579
|
+
const onabort = function (cancel) {
|
|
2580
|
+
if (!aborted) {
|
|
2581
|
+
aborted = true;
|
|
2582
|
+
unsubscribe();
|
|
2583
|
+
const err = cancel instanceof Error ? cancel : this.reason;
|
|
2584
|
+
controller.abort(err instanceof AxiosError ? err : new CanceledError(err instanceof Error ? err.message : err));
|
|
2585
|
+
}
|
|
2586
|
+
};
|
|
2587
|
+
|
|
2588
|
+
let timer = timeout && setTimeout(() => {
|
|
2589
|
+
onabort(new AxiosError(`timeout ${timeout} of ms exceeded`, AxiosError.ETIMEDOUT));
|
|
2590
|
+
}, timeout);
|
|
2591
|
+
|
|
2592
|
+
const unsubscribe = () => {
|
|
2593
|
+
if (signals) {
|
|
2594
|
+
timer && clearTimeout(timer);
|
|
2595
|
+
timer = null;
|
|
2596
|
+
signals.forEach(signal => {
|
|
2597
|
+
signal &&
|
|
2598
|
+
(signal.removeEventListener ? signal.removeEventListener('abort', onabort) : signal.unsubscribe(onabort));
|
|
2599
|
+
});
|
|
2600
|
+
signals = null;
|
|
2601
|
+
}
|
|
2602
|
+
};
|
|
2603
|
+
|
|
2604
|
+
signals.forEach((signal) => signal && signal.addEventListener && signal.addEventListener('abort', onabort));
|
|
2605
|
+
|
|
2606
|
+
const {signal} = controller;
|
|
2607
|
+
|
|
2608
|
+
signal.unsubscribe = unsubscribe;
|
|
2609
|
+
|
|
2610
|
+
return [signal, () => {
|
|
2611
|
+
timer && clearTimeout(timer);
|
|
2612
|
+
timer = null;
|
|
2613
|
+
}];
|
|
2614
|
+
};
|
|
2615
|
+
|
|
2616
|
+
var composeSignals$1 = composeSignals;
|
|
2617
|
+
|
|
2618
|
+
const streamChunk = function* (chunk, chunkSize) {
|
|
2619
|
+
let len = chunk.byteLength;
|
|
2620
|
+
|
|
2621
|
+
if (!chunkSize || len < chunkSize) {
|
|
2622
|
+
yield chunk;
|
|
2623
|
+
return;
|
|
2624
|
+
}
|
|
2625
|
+
|
|
2626
|
+
let pos = 0;
|
|
2627
|
+
let end;
|
|
2628
|
+
|
|
2629
|
+
while (pos < len) {
|
|
2630
|
+
end = pos + chunkSize;
|
|
2631
|
+
yield chunk.slice(pos, end);
|
|
2632
|
+
pos = end;
|
|
2633
|
+
}
|
|
2634
|
+
};
|
|
2635
|
+
|
|
2636
|
+
const readBytes = async function* (iterable, chunkSize, encode) {
|
|
2637
|
+
for await (const chunk of iterable) {
|
|
2638
|
+
yield* streamChunk(ArrayBuffer.isView(chunk) ? chunk : (await encode(String(chunk))), chunkSize);
|
|
2639
|
+
}
|
|
2640
|
+
};
|
|
2641
|
+
|
|
2642
|
+
const trackStream = (stream, chunkSize, onProgress, onFinish, encode) => {
|
|
2643
|
+
const iterator = readBytes(stream, chunkSize, encode);
|
|
2644
|
+
|
|
2645
|
+
let bytes = 0;
|
|
2646
|
+
|
|
2647
|
+
return new ReadableStream({
|
|
2648
|
+
type: 'bytes',
|
|
2649
|
+
|
|
2650
|
+
async pull(controller) {
|
|
2651
|
+
const {done, value} = await iterator.next();
|
|
2652
|
+
|
|
2653
|
+
if (done) {
|
|
2654
|
+
controller.close();
|
|
2655
|
+
onFinish();
|
|
2656
|
+
return;
|
|
2657
|
+
}
|
|
2658
|
+
|
|
2659
|
+
let len = value.byteLength;
|
|
2660
|
+
onProgress && onProgress(bytes += len);
|
|
2661
|
+
controller.enqueue(new Uint8Array(value));
|
|
2662
|
+
},
|
|
2663
|
+
cancel(reason) {
|
|
2664
|
+
onFinish(reason);
|
|
2665
|
+
return iterator.return();
|
|
2666
|
+
}
|
|
2667
|
+
}, {
|
|
2668
|
+
highWaterMark: 2
|
|
2669
|
+
})
|
|
2670
|
+
};
|
|
2671
|
+
|
|
2672
|
+
const fetchProgressDecorator = (total, fn) => {
|
|
2673
|
+
const lengthComputable = total != null;
|
|
2674
|
+
return (loaded) => setTimeout(() => fn({
|
|
2675
|
+
lengthComputable,
|
|
2676
|
+
total,
|
|
2677
|
+
loaded
|
|
2678
|
+
}));
|
|
2679
|
+
};
|
|
2680
|
+
|
|
2681
|
+
const isFetchSupported = typeof fetch === 'function' && typeof Request === 'function' && typeof Response === 'function';
|
|
2682
|
+
const isReadableStreamSupported = isFetchSupported && typeof ReadableStream === 'function';
|
|
2683
|
+
|
|
2684
|
+
// used only inside the fetch adapter
|
|
2685
|
+
const encodeText = isFetchSupported && (typeof TextEncoder === 'function' ?
|
|
2686
|
+
((encoder) => (str) => encoder.encode(str))(new TextEncoder()) :
|
|
2687
|
+
async (str) => new Uint8Array(await new Response(str).arrayBuffer())
|
|
2688
|
+
);
|
|
2689
|
+
|
|
2690
|
+
const supportsRequestStream = isReadableStreamSupported && (() => {
|
|
2691
|
+
let duplexAccessed = false;
|
|
2692
|
+
|
|
2693
|
+
const hasContentType = new Request(platform.origin, {
|
|
2694
|
+
body: new ReadableStream(),
|
|
2695
|
+
method: 'POST',
|
|
2696
|
+
get duplex() {
|
|
2697
|
+
duplexAccessed = true;
|
|
2698
|
+
return 'half';
|
|
2699
|
+
},
|
|
2700
|
+
}).headers.has('Content-Type');
|
|
2701
|
+
|
|
2702
|
+
return duplexAccessed && !hasContentType;
|
|
2703
|
+
})();
|
|
2704
|
+
|
|
2705
|
+
const DEFAULT_CHUNK_SIZE = 64 * 1024;
|
|
2706
|
+
|
|
2707
|
+
const supportsResponseStream = isReadableStreamSupported && !!(()=> {
|
|
2708
|
+
try {
|
|
2709
|
+
return utils$1.isReadableStream(new Response('').body);
|
|
2710
|
+
} catch(err) {
|
|
2711
|
+
// return undefined
|
|
2712
|
+
}
|
|
2713
|
+
})();
|
|
2714
|
+
|
|
2715
|
+
const resolvers = {
|
|
2716
|
+
stream: supportsResponseStream && ((res) => res.body)
|
|
2717
|
+
};
|
|
2718
|
+
|
|
2719
|
+
isFetchSupported && (((res) => {
|
|
2720
|
+
['text', 'arrayBuffer', 'blob', 'formData', 'stream'].forEach(type => {
|
|
2721
|
+
!resolvers[type] && (resolvers[type] = utils$1.isFunction(res[type]) ? (res) => res[type]() :
|
|
2722
|
+
(_, config) => {
|
|
2723
|
+
throw new AxiosError(`Response type '${type}' is not supported`, AxiosError.ERR_NOT_SUPPORT, config);
|
|
2724
|
+
});
|
|
2725
|
+
});
|
|
2726
|
+
})(new Response));
|
|
2727
|
+
|
|
2728
|
+
const getBodyLength = async (body) => {
|
|
2729
|
+
if (body == null) {
|
|
2730
|
+
return 0;
|
|
2731
|
+
}
|
|
2732
|
+
|
|
2733
|
+
if(utils$1.isBlob(body)) {
|
|
2734
|
+
return body.size;
|
|
2735
|
+
}
|
|
2736
|
+
|
|
2737
|
+
if(utils$1.isSpecCompliantForm(body)) {
|
|
2738
|
+
return (await new Request(body).arrayBuffer()).byteLength;
|
|
2739
|
+
}
|
|
2740
|
+
|
|
2741
|
+
if(utils$1.isArrayBufferView(body)) {
|
|
2742
|
+
return body.byteLength;
|
|
2743
|
+
}
|
|
2744
|
+
|
|
2745
|
+
if(utils$1.isURLSearchParams(body)) {
|
|
2746
|
+
body = body + '';
|
|
2747
|
+
}
|
|
2748
|
+
|
|
2749
|
+
if(utils$1.isString(body)) {
|
|
2750
|
+
return (await encodeText(body)).byteLength;
|
|
2751
|
+
}
|
|
2752
|
+
};
|
|
2753
|
+
|
|
2754
|
+
const resolveBodyLength = async (headers, body) => {
|
|
2755
|
+
const length = utils$1.toFiniteNumber(headers.getContentLength());
|
|
2756
|
+
|
|
2757
|
+
return length == null ? getBodyLength(body) : length;
|
|
2758
|
+
};
|
|
2759
|
+
|
|
2760
|
+
var fetchAdapter = isFetchSupported && (async (config) => {
|
|
2761
|
+
let {
|
|
2762
|
+
url,
|
|
2763
|
+
method,
|
|
2764
|
+
data,
|
|
2765
|
+
signal,
|
|
2766
|
+
cancelToken,
|
|
2767
|
+
timeout,
|
|
2768
|
+
onDownloadProgress,
|
|
2769
|
+
onUploadProgress,
|
|
2770
|
+
responseType,
|
|
2771
|
+
headers,
|
|
2772
|
+
withCredentials = 'same-origin',
|
|
2773
|
+
fetchOptions
|
|
2774
|
+
} = resolveConfig(config);
|
|
2775
|
+
|
|
2776
|
+
responseType = responseType ? (responseType + '').toLowerCase() : 'text';
|
|
2777
|
+
|
|
2778
|
+
let [composedSignal, stopTimeout] = (signal || cancelToken || timeout) ?
|
|
2779
|
+
composeSignals$1([signal, cancelToken], timeout) : [];
|
|
2780
|
+
|
|
2781
|
+
let finished, request;
|
|
2782
|
+
|
|
2783
|
+
const onFinish = () => {
|
|
2784
|
+
!finished && setTimeout(() => {
|
|
2785
|
+
composedSignal && composedSignal.unsubscribe();
|
|
2786
|
+
});
|
|
2787
|
+
|
|
2788
|
+
finished = true;
|
|
2789
|
+
};
|
|
2790
|
+
|
|
2791
|
+
let requestContentLength;
|
|
2792
|
+
|
|
2793
|
+
try {
|
|
2794
|
+
if (
|
|
2795
|
+
onUploadProgress && supportsRequestStream && method !== 'get' && method !== 'head' &&
|
|
2796
|
+
(requestContentLength = await resolveBodyLength(headers, data)) !== 0
|
|
2797
|
+
) {
|
|
2798
|
+
let _request = new Request(url, {
|
|
2799
|
+
method: 'POST',
|
|
2800
|
+
body: data,
|
|
2801
|
+
duplex: "half"
|
|
2802
|
+
});
|
|
2803
|
+
|
|
2804
|
+
let contentTypeHeader;
|
|
2805
|
+
|
|
2806
|
+
if (utils$1.isFormData(data) && (contentTypeHeader = _request.headers.get('content-type'))) {
|
|
2807
|
+
headers.setContentType(contentTypeHeader);
|
|
2808
|
+
}
|
|
2809
|
+
|
|
2810
|
+
if (_request.body) {
|
|
2811
|
+
data = trackStream(_request.body, DEFAULT_CHUNK_SIZE, fetchProgressDecorator(
|
|
2812
|
+
requestContentLength,
|
|
2813
|
+
progressEventReducer(onUploadProgress)
|
|
2814
|
+
), null, encodeText);
|
|
2815
|
+
}
|
|
2816
|
+
}
|
|
2817
|
+
|
|
2818
|
+
if (!utils$1.isString(withCredentials)) {
|
|
2819
|
+
withCredentials = withCredentials ? 'cors' : 'omit';
|
|
2820
|
+
}
|
|
2821
|
+
|
|
2822
|
+
request = new Request(url, {
|
|
2823
|
+
...fetchOptions,
|
|
2824
|
+
signal: composedSignal,
|
|
2825
|
+
method: method.toUpperCase(),
|
|
2826
|
+
headers: headers.normalize().toJSON(),
|
|
2827
|
+
body: data,
|
|
2828
|
+
duplex: "half",
|
|
2829
|
+
withCredentials
|
|
2830
|
+
});
|
|
2831
|
+
|
|
2832
|
+
let response = await fetch(request);
|
|
2833
|
+
|
|
2834
|
+
const isStreamResponse = supportsResponseStream && (responseType === 'stream' || responseType === 'response');
|
|
2835
|
+
|
|
2836
|
+
if (supportsResponseStream && (onDownloadProgress || isStreamResponse)) {
|
|
2837
|
+
const options = {};
|
|
2838
|
+
|
|
2839
|
+
['status', 'statusText', 'headers'].forEach(prop => {
|
|
2840
|
+
options[prop] = response[prop];
|
|
2841
|
+
});
|
|
2842
|
+
|
|
2843
|
+
const responseContentLength = utils$1.toFiniteNumber(response.headers.get('content-length'));
|
|
2844
|
+
|
|
2845
|
+
response = new Response(
|
|
2846
|
+
trackStream(response.body, DEFAULT_CHUNK_SIZE, onDownloadProgress && fetchProgressDecorator(
|
|
2847
|
+
responseContentLength,
|
|
2848
|
+
progressEventReducer(onDownloadProgress, true)
|
|
2849
|
+
), isStreamResponse && onFinish, encodeText),
|
|
2850
|
+
options
|
|
2851
|
+
);
|
|
2852
|
+
}
|
|
2853
|
+
|
|
2854
|
+
responseType = responseType || 'text';
|
|
2855
|
+
|
|
2856
|
+
let responseData = await resolvers[utils$1.findKey(resolvers, responseType) || 'text'](response, config);
|
|
2857
|
+
|
|
2858
|
+
!isStreamResponse && onFinish();
|
|
2859
|
+
|
|
2860
|
+
stopTimeout && stopTimeout();
|
|
2861
|
+
|
|
2862
|
+
return await new Promise((resolve, reject) => {
|
|
2863
|
+
settle(resolve, reject, {
|
|
2864
|
+
data: responseData,
|
|
2865
|
+
headers: AxiosHeaders$1.from(response.headers),
|
|
2866
|
+
status: response.status,
|
|
2867
|
+
statusText: response.statusText,
|
|
2868
|
+
config,
|
|
2869
|
+
request
|
|
2870
|
+
});
|
|
2871
|
+
})
|
|
2872
|
+
} catch (err) {
|
|
2873
|
+
onFinish();
|
|
2874
|
+
|
|
2875
|
+
if (err && err.name === 'TypeError' && /fetch/i.test(err.message)) {
|
|
2876
|
+
throw Object.assign(
|
|
2877
|
+
new AxiosError('Network Error', AxiosError.ERR_NETWORK, config, request),
|
|
2878
|
+
{
|
|
2879
|
+
cause: err.cause || err
|
|
2880
|
+
}
|
|
2881
|
+
)
|
|
2882
|
+
}
|
|
2883
|
+
|
|
2884
|
+
throw AxiosError.from(err, err && err.code, config, request);
|
|
2885
|
+
}
|
|
2886
|
+
});
|
|
2887
|
+
|
|
2413
2888
|
const knownAdapters = {
|
|
2414
2889
|
http: httpAdapter,
|
|
2415
|
-
xhr: xhrAdapter
|
|
2890
|
+
xhr: xhrAdapter,
|
|
2891
|
+
fetch: fetchAdapter
|
|
2416
2892
|
};
|
|
2417
2893
|
|
|
2418
2894
|
utils$1.forEach(knownAdapters, (fn, value) => {
|
|
@@ -2556,109 +3032,7 @@ function dispatchRequest(config) {
|
|
|
2556
3032
|
});
|
|
2557
3033
|
}
|
|
2558
3034
|
|
|
2559
|
-
const
|
|
2560
|
-
|
|
2561
|
-
/**
|
|
2562
|
-
* Config-specific merge-function which creates a new config-object
|
|
2563
|
-
* by merging two configuration objects together.
|
|
2564
|
-
*
|
|
2565
|
-
* @param {Object} config1
|
|
2566
|
-
* @param {Object} config2
|
|
2567
|
-
*
|
|
2568
|
-
* @returns {Object} New object resulting from merging config2 to config1
|
|
2569
|
-
*/
|
|
2570
|
-
function mergeConfig(config1, config2) {
|
|
2571
|
-
// eslint-disable-next-line no-param-reassign
|
|
2572
|
-
config2 = config2 || {};
|
|
2573
|
-
const config = {};
|
|
2574
|
-
|
|
2575
|
-
function getMergedValue(target, source, caseless) {
|
|
2576
|
-
if (utils$1.isPlainObject(target) && utils$1.isPlainObject(source)) {
|
|
2577
|
-
return utils$1.merge.call({caseless}, target, source);
|
|
2578
|
-
} else if (utils$1.isPlainObject(source)) {
|
|
2579
|
-
return utils$1.merge({}, source);
|
|
2580
|
-
} else if (utils$1.isArray(source)) {
|
|
2581
|
-
return source.slice();
|
|
2582
|
-
}
|
|
2583
|
-
return source;
|
|
2584
|
-
}
|
|
2585
|
-
|
|
2586
|
-
// eslint-disable-next-line consistent-return
|
|
2587
|
-
function mergeDeepProperties(a, b, caseless) {
|
|
2588
|
-
if (!utils$1.isUndefined(b)) {
|
|
2589
|
-
return getMergedValue(a, b, caseless);
|
|
2590
|
-
} else if (!utils$1.isUndefined(a)) {
|
|
2591
|
-
return getMergedValue(undefined, a, caseless);
|
|
2592
|
-
}
|
|
2593
|
-
}
|
|
2594
|
-
|
|
2595
|
-
// eslint-disable-next-line consistent-return
|
|
2596
|
-
function valueFromConfig2(a, b) {
|
|
2597
|
-
if (!utils$1.isUndefined(b)) {
|
|
2598
|
-
return getMergedValue(undefined, b);
|
|
2599
|
-
}
|
|
2600
|
-
}
|
|
2601
|
-
|
|
2602
|
-
// eslint-disable-next-line consistent-return
|
|
2603
|
-
function defaultToConfig2(a, b) {
|
|
2604
|
-
if (!utils$1.isUndefined(b)) {
|
|
2605
|
-
return getMergedValue(undefined, b);
|
|
2606
|
-
} else if (!utils$1.isUndefined(a)) {
|
|
2607
|
-
return getMergedValue(undefined, a);
|
|
2608
|
-
}
|
|
2609
|
-
}
|
|
2610
|
-
|
|
2611
|
-
// eslint-disable-next-line consistent-return
|
|
2612
|
-
function mergeDirectKeys(a, b, prop) {
|
|
2613
|
-
if (prop in config2) {
|
|
2614
|
-
return getMergedValue(a, b);
|
|
2615
|
-
} else if (prop in config1) {
|
|
2616
|
-
return getMergedValue(undefined, a);
|
|
2617
|
-
}
|
|
2618
|
-
}
|
|
2619
|
-
|
|
2620
|
-
const mergeMap = {
|
|
2621
|
-
url: valueFromConfig2,
|
|
2622
|
-
method: valueFromConfig2,
|
|
2623
|
-
data: valueFromConfig2,
|
|
2624
|
-
baseURL: defaultToConfig2,
|
|
2625
|
-
transformRequest: defaultToConfig2,
|
|
2626
|
-
transformResponse: defaultToConfig2,
|
|
2627
|
-
paramsSerializer: defaultToConfig2,
|
|
2628
|
-
timeout: defaultToConfig2,
|
|
2629
|
-
timeoutMessage: defaultToConfig2,
|
|
2630
|
-
withCredentials: defaultToConfig2,
|
|
2631
|
-
withXSRFToken: defaultToConfig2,
|
|
2632
|
-
adapter: defaultToConfig2,
|
|
2633
|
-
responseType: defaultToConfig2,
|
|
2634
|
-
xsrfCookieName: defaultToConfig2,
|
|
2635
|
-
xsrfHeaderName: defaultToConfig2,
|
|
2636
|
-
onUploadProgress: defaultToConfig2,
|
|
2637
|
-
onDownloadProgress: defaultToConfig2,
|
|
2638
|
-
decompress: defaultToConfig2,
|
|
2639
|
-
maxContentLength: defaultToConfig2,
|
|
2640
|
-
maxBodyLength: defaultToConfig2,
|
|
2641
|
-
beforeRedirect: defaultToConfig2,
|
|
2642
|
-
transport: defaultToConfig2,
|
|
2643
|
-
httpAgent: defaultToConfig2,
|
|
2644
|
-
httpsAgent: defaultToConfig2,
|
|
2645
|
-
cancelToken: defaultToConfig2,
|
|
2646
|
-
socketPath: defaultToConfig2,
|
|
2647
|
-
responseEncoding: defaultToConfig2,
|
|
2648
|
-
validateStatus: mergeDirectKeys,
|
|
2649
|
-
headers: (a, b) => mergeDeepProperties(headersToObject(a), headersToObject(b), true)
|
|
2650
|
-
};
|
|
2651
|
-
|
|
2652
|
-
utils$1.forEach(Object.keys(Object.assign({}, config1, config2)), function computeConfigValue(prop) {
|
|
2653
|
-
const merge = mergeMap[prop] || mergeDeepProperties;
|
|
2654
|
-
const configValue = merge(config1[prop], config2[prop], prop);
|
|
2655
|
-
(utils$1.isUndefined(configValue) && merge !== mergeDirectKeys) || (config[prop] = configValue);
|
|
2656
|
-
});
|
|
2657
|
-
|
|
2658
|
-
return config;
|
|
2659
|
-
}
|
|
2660
|
-
|
|
2661
|
-
const VERSION = "1.6.6";
|
|
3035
|
+
const VERSION = "1.7.2";
|
|
2662
3036
|
|
|
2663
3037
|
const validators$1 = {};
|
|
2664
3038
|
|
|
@@ -2777,17 +3151,23 @@ class Axios {
|
|
|
2777
3151
|
try {
|
|
2778
3152
|
return await this._request(configOrUrl, config);
|
|
2779
3153
|
} catch (err) {
|
|
2780
|
-
|
|
2781
|
-
|
|
2782
|
-
|
|
2783
|
-
|
|
2784
|
-
|
|
2785
|
-
|
|
2786
|
-
|
|
2787
|
-
|
|
2788
|
-
|
|
2789
|
-
|
|
2790
|
-
|
|
3154
|
+
if (err instanceof Error) {
|
|
3155
|
+
let dummy;
|
|
3156
|
+
|
|
3157
|
+
Error.captureStackTrace ? Error.captureStackTrace(dummy = {}) : (dummy = new Error());
|
|
3158
|
+
|
|
3159
|
+
// slice off the Error: ... line
|
|
3160
|
+
const stack = dummy.stack ? dummy.stack.replace(/^.+\n/, '') : '';
|
|
3161
|
+
try {
|
|
3162
|
+
if (!err.stack) {
|
|
3163
|
+
err.stack = stack;
|
|
3164
|
+
// match without the 2 top stack lines
|
|
3165
|
+
} else if (stack && !String(err.stack).endsWith(stack.replace(/^.+\n.+\n/, ''))) {
|
|
3166
|
+
err.stack += '\n' + stack;
|
|
3167
|
+
}
|
|
3168
|
+
} catch (e) {
|
|
3169
|
+
// ignore the case where "stack" is an un-writable property
|
|
3170
|
+
}
|
|
2791
3171
|
}
|
|
2792
3172
|
|
|
2793
3173
|
throw err;
|