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
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import CanceledError from "../cancel/CanceledError.js";
|
|
2
|
+
import AxiosError from "../core/AxiosError.js";
|
|
3
|
+
|
|
4
|
+
const composeSignals = (signals, timeout) => {
|
|
5
|
+
let controller = new AbortController();
|
|
6
|
+
|
|
7
|
+
let aborted;
|
|
8
|
+
|
|
9
|
+
const onabort = function (cancel) {
|
|
10
|
+
if (!aborted) {
|
|
11
|
+
aborted = true;
|
|
12
|
+
unsubscribe();
|
|
13
|
+
const err = cancel instanceof Error ? cancel : this.reason;
|
|
14
|
+
controller.abort(err instanceof AxiosError ? err : new CanceledError(err instanceof Error ? err.message : err));
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
let timer = timeout && setTimeout(() => {
|
|
19
|
+
onabort(new AxiosError(`timeout ${timeout} of ms exceeded`, AxiosError.ETIMEDOUT))
|
|
20
|
+
}, timeout)
|
|
21
|
+
|
|
22
|
+
const unsubscribe = () => {
|
|
23
|
+
if (signals) {
|
|
24
|
+
timer && clearTimeout(timer);
|
|
25
|
+
timer = null;
|
|
26
|
+
signals.forEach(signal => {
|
|
27
|
+
signal &&
|
|
28
|
+
(signal.removeEventListener ? signal.removeEventListener('abort', onabort) : signal.unsubscribe(onabort));
|
|
29
|
+
});
|
|
30
|
+
signals = null;
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
signals.forEach((signal) => signal && signal.addEventListener && signal.addEventListener('abort', onabort));
|
|
35
|
+
|
|
36
|
+
const {signal} = controller;
|
|
37
|
+
|
|
38
|
+
signal.unsubscribe = unsubscribe;
|
|
39
|
+
|
|
40
|
+
return [signal, () => {
|
|
41
|
+
timer && clearTimeout(timer);
|
|
42
|
+
timer = null;
|
|
43
|
+
}];
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
export default composeSignals;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import speedometer from "./speedometer.js";
|
|
2
|
+
import throttle from "./throttle.js";
|
|
3
|
+
|
|
4
|
+
export default (listener, isDownloadStream, freq = 3) => {
|
|
5
|
+
let bytesNotified = 0;
|
|
6
|
+
const _speedometer = speedometer(50, 250);
|
|
7
|
+
|
|
8
|
+
return throttle(e => {
|
|
9
|
+
const loaded = e.loaded;
|
|
10
|
+
const total = e.lengthComputable ? e.total : undefined;
|
|
11
|
+
const progressBytes = loaded - bytesNotified;
|
|
12
|
+
const rate = _speedometer(progressBytes);
|
|
13
|
+
const inRange = loaded <= total;
|
|
14
|
+
|
|
15
|
+
bytesNotified = loaded;
|
|
16
|
+
|
|
17
|
+
const data = {
|
|
18
|
+
loaded,
|
|
19
|
+
total,
|
|
20
|
+
progress: total ? (loaded / total) : undefined,
|
|
21
|
+
bytes: progressBytes,
|
|
22
|
+
rate: rate ? rate : undefined,
|
|
23
|
+
estimated: rate && total && inRange ? (total - loaded) / rate : undefined,
|
|
24
|
+
event: e,
|
|
25
|
+
lengthComputable: total != null
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
data[isDownloadStream ? 'download' : 'upload'] = true;
|
|
29
|
+
|
|
30
|
+
listener(data);
|
|
31
|
+
}, freq);
|
|
32
|
+
}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import platform from "../platform/index.js";
|
|
2
|
+
import utils from "../utils.js";
|
|
3
|
+
import isURLSameOrigin from "./isURLSameOrigin.js";
|
|
4
|
+
import cookies from "./cookies.js";
|
|
5
|
+
import buildFullPath from "../core/buildFullPath.js";
|
|
6
|
+
import mergeConfig from "../core/mergeConfig.js";
|
|
7
|
+
import AxiosHeaders from "../core/AxiosHeaders.js";
|
|
8
|
+
import buildURL from "./buildURL.js";
|
|
9
|
+
|
|
10
|
+
export default (config) => {
|
|
11
|
+
const newConfig = mergeConfig({}, config);
|
|
12
|
+
|
|
13
|
+
let {data, withXSRFToken, xsrfHeaderName, xsrfCookieName, headers, auth} = newConfig;
|
|
14
|
+
|
|
15
|
+
newConfig.headers = headers = AxiosHeaders.from(headers);
|
|
16
|
+
|
|
17
|
+
newConfig.url = buildURL(buildFullPath(newConfig.baseURL, newConfig.url), config.params, config.paramsSerializer);
|
|
18
|
+
|
|
19
|
+
// HTTP basic authentication
|
|
20
|
+
if (auth) {
|
|
21
|
+
headers.set('Authorization', 'Basic ' +
|
|
22
|
+
btoa((auth.username || '') + ':' + (auth.password ? unescape(encodeURIComponent(auth.password)) : ''))
|
|
23
|
+
);
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
let contentType;
|
|
27
|
+
|
|
28
|
+
if (utils.isFormData(data)) {
|
|
29
|
+
if (platform.hasStandardBrowserEnv || platform.hasStandardBrowserWebWorkerEnv) {
|
|
30
|
+
headers.setContentType(undefined); // Let the browser set it
|
|
31
|
+
} else if ((contentType = headers.getContentType()) !== false) {
|
|
32
|
+
// fix semicolon duplication issue for ReactNative FormData implementation
|
|
33
|
+
const [type, ...tokens] = contentType ? contentType.split(';').map(token => token.trim()).filter(Boolean) : [];
|
|
34
|
+
headers.setContentType([type || 'multipart/form-data', ...tokens].join('; '));
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
// Add xsrf header
|
|
39
|
+
// This is only done if running in a standard browser environment.
|
|
40
|
+
// Specifically not if we're in a web worker, or react-native.
|
|
41
|
+
|
|
42
|
+
if (platform.hasStandardBrowserEnv) {
|
|
43
|
+
withXSRFToken && utils.isFunction(withXSRFToken) && (withXSRFToken = withXSRFToken(newConfig));
|
|
44
|
+
|
|
45
|
+
if (withXSRFToken || (withXSRFToken !== false && isURLSameOrigin(newConfig.url))) {
|
|
46
|
+
// Add xsrf header
|
|
47
|
+
const xsrfValue = xsrfHeaderName && xsrfCookieName && cookies.read(xsrfCookieName);
|
|
48
|
+
|
|
49
|
+
if (xsrfValue) {
|
|
50
|
+
headers.set(xsrfHeaderName, xsrfValue);
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
return newConfig;
|
|
56
|
+
}
|
|
57
|
+
|
|
@@ -10,7 +10,9 @@ function throttle(fn, freq) {
|
|
|
10
10
|
let timestamp = 0;
|
|
11
11
|
const threshold = 1000 / freq;
|
|
12
12
|
let timer = null;
|
|
13
|
-
return function throttled(
|
|
13
|
+
return function throttled() {
|
|
14
|
+
const force = this === true;
|
|
15
|
+
|
|
14
16
|
const now = Date.now();
|
|
15
17
|
if (force || now - timestamp > threshold) {
|
|
16
18
|
if (timer) {
|
|
@@ -18,13 +20,13 @@ function throttle(fn, freq) {
|
|
|
18
20
|
timer = null;
|
|
19
21
|
}
|
|
20
22
|
timestamp = now;
|
|
21
|
-
return fn.apply(null,
|
|
23
|
+
return fn.apply(null, arguments);
|
|
22
24
|
}
|
|
23
25
|
if (!timer) {
|
|
24
26
|
timer = setTimeout(() => {
|
|
25
27
|
timer = null;
|
|
26
28
|
timestamp = Date.now();
|
|
27
|
-
return fn.apply(null,
|
|
29
|
+
return fn.apply(null, arguments);
|
|
28
30
|
}, threshold - (now - timestamp));
|
|
29
31
|
}
|
|
30
32
|
};
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
|
|
2
|
+
|
|
3
|
+
export const streamChunk = function* (chunk, chunkSize) {
|
|
4
|
+
let len = chunk.byteLength;
|
|
5
|
+
|
|
6
|
+
if (!chunkSize || len < chunkSize) {
|
|
7
|
+
yield chunk;
|
|
8
|
+
return;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
let pos = 0;
|
|
12
|
+
let end;
|
|
13
|
+
|
|
14
|
+
while (pos < len) {
|
|
15
|
+
end = pos + chunkSize;
|
|
16
|
+
yield chunk.slice(pos, end);
|
|
17
|
+
pos = end;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export const readBytes = async function* (iterable, chunkSize, encode) {
|
|
22
|
+
for await (const chunk of iterable) {
|
|
23
|
+
yield* streamChunk(ArrayBuffer.isView(chunk) ? chunk : (await encode(String(chunk))), chunkSize);
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
export const trackStream = (stream, chunkSize, onProgress, onFinish, encode) => {
|
|
28
|
+
const iterator = readBytes(stream, chunkSize, encode);
|
|
29
|
+
|
|
30
|
+
let bytes = 0;
|
|
31
|
+
|
|
32
|
+
return new ReadableStream({
|
|
33
|
+
type: 'bytes',
|
|
34
|
+
|
|
35
|
+
async pull(controller) {
|
|
36
|
+
const {done, value} = await iterator.next();
|
|
37
|
+
|
|
38
|
+
if (done) {
|
|
39
|
+
controller.close();
|
|
40
|
+
onFinish();
|
|
41
|
+
return;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
let len = value.byteLength;
|
|
45
|
+
onProgress && onProgress(bytes += len);
|
|
46
|
+
controller.enqueue(new Uint8Array(value));
|
|
47
|
+
},
|
|
48
|
+
cancel(reason) {
|
|
49
|
+
onFinish(reason);
|
|
50
|
+
return iterator.return();
|
|
51
|
+
}
|
|
52
|
+
}, {
|
|
53
|
+
highWaterMark: 2
|
|
54
|
+
})
|
|
55
|
+
}
|
|
@@ -40,8 +40,11 @@ const hasStandardBrowserWebWorkerEnv = (() => {
|
|
|
40
40
|
);
|
|
41
41
|
})();
|
|
42
42
|
|
|
43
|
+
const origin = hasBrowserEnv && window.location.href || 'http://localhost';
|
|
44
|
+
|
|
43
45
|
export {
|
|
44
46
|
hasBrowserEnv,
|
|
45
47
|
hasStandardBrowserWebWorkerEnv,
|
|
46
|
-
hasStandardBrowserEnv
|
|
48
|
+
hasStandardBrowserEnv,
|
|
49
|
+
origin
|
|
47
50
|
}
|
|
@@ -209,6 +209,8 @@ const isFormData = (thing) => {
|
|
|
209
209
|
*/
|
|
210
210
|
const isURLSearchParams = kindOfTest('URLSearchParams');
|
|
211
211
|
|
|
212
|
+
const [isReadableStream, isRequest, isResponse, isHeaders] = ['ReadableStream', 'Request', 'Response', 'Headers'].map(kindOfTest);
|
|
213
|
+
|
|
212
214
|
/**
|
|
213
215
|
* Trim excess whitespace off the beginning and end of a string
|
|
214
216
|
*
|
|
@@ -597,8 +599,7 @@ const toObjectSet = (arrayOrString, delimiter) => {
|
|
|
597
599
|
const noop = () => {}
|
|
598
600
|
|
|
599
601
|
const toFiniteNumber = (value, defaultValue) => {
|
|
600
|
-
value = +value;
|
|
601
|
-
return Number.isFinite(value) ? value : defaultValue;
|
|
602
|
+
return value != null && Number.isFinite(value = +value) ? value : defaultValue;
|
|
602
603
|
}
|
|
603
604
|
|
|
604
605
|
const ALPHA = 'abcdefghijklmnopqrstuvwxyz'
|
|
@@ -679,6 +680,10 @@ export default {
|
|
|
679
680
|
isBoolean,
|
|
680
681
|
isObject,
|
|
681
682
|
isPlainObject,
|
|
683
|
+
isReadableStream,
|
|
684
|
+
isRequest,
|
|
685
|
+
isResponse,
|
|
686
|
+
isHeaders,
|
|
682
687
|
isUndefined,
|
|
683
688
|
isDate,
|
|
684
689
|
isFile,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "axios",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.7.2",
|
|
4
4
|
"description": "Promise based HTTP client for the browser and node.js",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"exports": {
|
|
@@ -80,41 +80,41 @@
|
|
|
80
80
|
},
|
|
81
81
|
"homepage": "https://axios-http.com",
|
|
82
82
|
"devDependencies": {
|
|
83
|
-
"@babel/core": "^7.
|
|
84
|
-
"@babel/preset-env": "^7.
|
|
85
|
-
"@commitlint/cli": "^17.
|
|
86
|
-
"@commitlint/config-conventional": "^17.
|
|
83
|
+
"@babel/core": "^7.23.9",
|
|
84
|
+
"@babel/preset-env": "^7.23.9",
|
|
85
|
+
"@commitlint/cli": "^17.8.1",
|
|
86
|
+
"@commitlint/config-conventional": "^17.8.1",
|
|
87
87
|
"@release-it/conventional-changelog": "^5.1.1",
|
|
88
88
|
"@rollup/plugin-babel": "^5.3.1",
|
|
89
89
|
"@rollup/plugin-commonjs": "^15.1.0",
|
|
90
90
|
"@rollup/plugin-json": "^4.1.0",
|
|
91
|
-
"@rollup/plugin-multi-entry": "^4.
|
|
91
|
+
"@rollup/plugin-multi-entry": "^4.1.0",
|
|
92
92
|
"@rollup/plugin-node-resolve": "^9.0.0",
|
|
93
|
-
"abortcontroller-polyfill": "^1.7.
|
|
93
|
+
"abortcontroller-polyfill": "^1.7.5",
|
|
94
94
|
"auto-changelog": "^2.4.0",
|
|
95
|
-
"body-parser": "^1.20.
|
|
96
|
-
"chalk": "^5.
|
|
95
|
+
"body-parser": "^1.20.2",
|
|
96
|
+
"chalk": "^5.3.0",
|
|
97
97
|
"coveralls": "^3.1.1",
|
|
98
98
|
"cross-env": "^7.0.3",
|
|
99
99
|
"dev-null": "^0.1.1",
|
|
100
100
|
"dtslint": "^4.2.1",
|
|
101
101
|
"es6-promise": "^4.2.8",
|
|
102
|
-
"eslint": "^8.
|
|
103
|
-
"express": "^4.18.
|
|
104
|
-
"formdata-node": "^5.0.
|
|
105
|
-
"formidable": "^2.
|
|
102
|
+
"eslint": "^8.56.0",
|
|
103
|
+
"express": "^4.18.2",
|
|
104
|
+
"formdata-node": "^5.0.1",
|
|
105
|
+
"formidable": "^2.1.2",
|
|
106
106
|
"fs-extra": "^10.1.0",
|
|
107
107
|
"get-stream": "^3.0.0",
|
|
108
108
|
"gulp": "^4.0.2",
|
|
109
109
|
"gzip-size": "^7.0.0",
|
|
110
|
-
"handlebars": "^4.7.
|
|
111
|
-
"husky": "^8.0.
|
|
110
|
+
"handlebars": "^4.7.8",
|
|
111
|
+
"husky": "^8.0.3",
|
|
112
112
|
"istanbul-instrumenter-loader": "^3.0.1",
|
|
113
|
-
"jasmine-core": "^2.
|
|
113
|
+
"jasmine-core": "^2.99.1",
|
|
114
114
|
"karma": "^6.3.17",
|
|
115
|
-
"karma-chrome-launcher": "^3.
|
|
115
|
+
"karma-chrome-launcher": "^3.2.0",
|
|
116
116
|
"karma-firefox-launcher": "^2.1.2",
|
|
117
|
-
"karma-jasmine": "^1.1.
|
|
117
|
+
"karma-jasmine": "^1.1.2",
|
|
118
118
|
"karma-jasmine-ajax": "^0.1.13",
|
|
119
119
|
"karma-rollup-preprocessor": "^7.0.8",
|
|
120
120
|
"karma-safari-launcher": "^1.0.0",
|
|
@@ -122,12 +122,12 @@
|
|
|
122
122
|
"karma-sinon": "^1.0.5",
|
|
123
123
|
"karma-sourcemap-loader": "^0.3.8",
|
|
124
124
|
"memoizee": "^0.4.15",
|
|
125
|
-
"minimist": "^1.2.
|
|
126
|
-
"mocha": "^10.
|
|
125
|
+
"minimist": "^1.2.8",
|
|
126
|
+
"mocha": "^10.3.0",
|
|
127
127
|
"multer": "^1.4.4",
|
|
128
|
-
"pretty-bytes": "^6.
|
|
129
|
-
"release-it": "^15.
|
|
130
|
-
"rollup": "^2.
|
|
128
|
+
"pretty-bytes": "^6.1.1",
|
|
129
|
+
"release-it": "^15.11.0",
|
|
130
|
+
"rollup": "^2.79.1",
|
|
131
131
|
"rollup-plugin-auto-external": "^2.0.0",
|
|
132
132
|
"rollup-plugin-bundle-size": "^1.0.3",
|
|
133
133
|
"rollup-plugin-terser": "^7.0.2",
|
|
@@ -135,7 +135,8 @@
|
|
|
135
135
|
"stream-throttle": "^0.1.3",
|
|
136
136
|
"string-replace-async": "^3.0.2",
|
|
137
137
|
"terser-webpack-plugin": "^4.2.3",
|
|
138
|
-
"typescript": "^4.
|
|
138
|
+
"typescript": "^4.9.5",
|
|
139
|
+
"@rollup/plugin-alias": "^5.1.0"
|
|
139
140
|
},
|
|
140
141
|
"browser": {
|
|
141
142
|
"./lib/adapters/http.js": "./lib/helpers/null.js",
|
|
@@ -146,7 +147,7 @@
|
|
|
146
147
|
"unpkg": "dist/axios.min.js",
|
|
147
148
|
"typings": "./index.d.ts",
|
|
148
149
|
"dependencies": {
|
|
149
|
-
"follow-redirects": "^1.15.
|
|
150
|
+
"follow-redirects": "^1.15.6",
|
|
150
151
|
"form-data": "^4.0.0",
|
|
151
152
|
"proxy-from-env": "^1.1.0"
|
|
152
153
|
},
|
|
@@ -159,8 +160,8 @@
|
|
|
159
160
|
"contributors": [
|
|
160
161
|
"Matt Zabriskie (https://github.com/mzabriskie)",
|
|
161
162
|
"Nick Uraltsev (https://github.com/nickuraltsev)",
|
|
162
|
-
"Jay (https://github.com/jasonsaayman)",
|
|
163
163
|
"Dmitriy Mozgovoy (https://github.com/DigitalBrainJS)",
|
|
164
|
+
"Jay (https://github.com/jasonsaayman)",
|
|
164
165
|
"Emily Morehouse (https://github.com/emilyemorehouse)",
|
|
165
166
|
"Rubén Norte (https://github.com/rubennorte)",
|
|
166
167
|
"Justin Beckwith (https://github.com/JustinBeckwith)",
|
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
Note: If you find missing information about particular minor version, that version must have been changed without any functional change in this library.
|
|
2
2
|
|
|
3
|
+
**4.4.0 / 2024-05-18**
|
|
4
|
+
* fix #654: parse attribute list correctly for self closing stop node.
|
|
5
|
+
* fix: validator bug when closing tag is not opened. (#647) (By [Ryosuke Fukatani](https://github.com/RyosukeFukatani))
|
|
6
|
+
* fix #581: typings; return type of `tagValueProcessor` & `attributeValueProcessor` (#582) (By [monholm]())
|
|
7
|
+
|
|
8
|
+
**4.3.6 / 2024-03-16**
|
|
9
|
+
* Add support for parsing HTML numeric entities (#645) (By [Jonas Schade ](https://github.com/DerZade))
|
|
10
|
+
|
|
11
|
+
**4.3.5 / 2024-02-24**
|
|
12
|
+
* code for v5 is added for experimental use
|
|
13
|
+
|
|
14
|
+
**4.3.4 / 2024-01-10**
|
|
15
|
+
* fix: Don't escape entities in CDATA sections (#633) (By [wackbyte](https://github.com/wackbyte))
|
|
16
|
+
|
|
3
17
|
**4.3.3 / 2024-01-10**
|
|
4
18
|
* Remove unnecessary regex
|
|
5
19
|
|
|
@@ -11,7 +11,8 @@
|
|
|
11
11
|
|
|
12
12
|
Validate XML, Parse XML to JS Object, or Build XML from JS Object without C/C++ based libraries and no callback.
|
|
13
13
|
|
|
14
|
-
|
|
14
|
+
> XML Parser v5 is added for experimental use
|
|
15
|
+
> https://solothought.com
|
|
15
16
|
|
|
16
17
|
Sponsor this project 👉
|
|
17
18
|
<a href="https://github.com/sponsors/NaturalIntelligence">
|
|
@@ -91,6 +92,11 @@ If you want to be an anonymous user of this application and don't want to be hig
|
|
|
91
92
|
* Supports parsing of PI (Processing Instruction) tags with XML declaration tags
|
|
92
93
|
* And many more other features.
|
|
93
94
|
|
|
95
|
+
## v5
|
|
96
|
+
I developed v5 in Apr 2023. And I didn't get the chance to complete all the features. I've ensured that new features don't impact performance. With v5, you have more control on parsing output. Check [docs](./docs/v5) for syntax help and basic understanding.
|
|
97
|
+
|
|
98
|
+
Please leave a comment in discussion forum for your suggestions and if you really need v5.
|
|
99
|
+
|
|
94
100
|
## How to use
|
|
95
101
|
|
|
96
102
|
To use as package dependency
|
|
@@ -174,19 +180,6 @@ Check lib folder for different browser bundles
|
|
|
174
180
|
|
|
175
181
|
[](https://github.com/NaturalIntelligence/ads/)
|
|
176
182
|
|
|
177
|
-
## Our other projects and research you must try
|
|
178
|
-
|
|
179
|
-
* **[BigBit standard](https://github.com/amitguptagwl/bigbit)** :
|
|
180
|
-
* Single text encoding to replace UTF-8, UTF-16, UTF-32 and more with less memory.
|
|
181
|
-
* Single Numeric datatype alternative of integer, float, double, long, decimal and more without precision loss.
|
|
182
|
-
* **[Cytorus](https://github.com/NaturalIntelligence/cytorus)**: Be specific and flexible while running E2E tests.
|
|
183
|
-
* Run tests only for a particular User Story
|
|
184
|
-
* Run tests for a route or from a route
|
|
185
|
-
* Customizable reporting
|
|
186
|
-
* Central dashboard for better monitoring
|
|
187
|
-
* Options to integrate E2E tests with Jira, Github etc using Central dashboard `Tian`.
|
|
188
|
-
* **[Stubmatic](https://github.com/NaturalIntelligence/Stubmatic)** : Create fake webservices, DynamoDB or S3 servers, Manage fake/mock stub data, Or fake any HTTP(s) call.
|
|
189
|
-
|
|
190
183
|
|
|
191
184
|
## Supporters
|
|
192
185
|
### Contributors
|
|
@@ -345,7 +345,7 @@ type XmlBuilderOptions = {
|
|
|
345
345
|
*
|
|
346
346
|
* Defaults to `(tagName, val, jPath, hasAttributes, isLeafNode) => val`
|
|
347
347
|
*/
|
|
348
|
-
tagValueProcessor?: (name: string, value: unknown) =>
|
|
348
|
+
tagValueProcessor?: (name: string, value: unknown) => unknown;
|
|
349
349
|
|
|
350
350
|
/**
|
|
351
351
|
* Control how attribute value should be parsed
|
|
@@ -358,7 +358,7 @@ type XmlBuilderOptions = {
|
|
|
358
358
|
*
|
|
359
359
|
* Defaults to `(attrName, val, jPath) => val`
|
|
360
360
|
*/
|
|
361
|
-
attributeValueProcessor?: (name: string, value: unknown) =>
|
|
361
|
+
attributeValueProcessor?: (name: string, value: unknown) => unknown;
|
|
362
362
|
|
|
363
363
|
/**
|
|
364
364
|
* Whether to process default and DOCTYPE entities
|
|
@@ -387,10 +387,10 @@ export class XMLParser {
|
|
|
387
387
|
parse(xmlData: string | Buffer ,validationOptions?: validationOptions | boolean): any;
|
|
388
388
|
/**
|
|
389
389
|
* Add Entity which is not by default supported by this library
|
|
390
|
-
* @param
|
|
390
|
+
* @param entityIdentifier {string} Eg: 'ent' for &ent;
|
|
391
391
|
* @param entityValue {string} Eg: '\r'
|
|
392
392
|
*/
|
|
393
|
-
addEntity(
|
|
393
|
+
addEntity(entityIdentifier: string, entityValue: string): void;
|
|
394
394
|
}
|
|
395
395
|
|
|
396
396
|
export class XMLValidator{
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
modules.export = {
|
|
2
|
+
"<" : "<", //tag start
|
|
3
|
+
">" : ">", //tag end
|
|
4
|
+
"/" : "/", //close tag
|
|
5
|
+
"!" : "!", //comment or docttype
|
|
6
|
+
"!--" : "!--", //comment
|
|
7
|
+
"-->" : "-->", //comment end
|
|
8
|
+
"?" : "?", //pi
|
|
9
|
+
"?>" : "?>", //pi end
|
|
10
|
+
"?xml" : "?xml", //pi end
|
|
11
|
+
"![" : "![", //cdata
|
|
12
|
+
"]]>" : "]]>", //cdata end
|
|
13
|
+
"[" : "[",
|
|
14
|
+
"-" : "-",
|
|
15
|
+
"D" : "D",
|
|
16
|
+
}
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
const ampEntity = { regex: /&(amp|#38|#x26);/g, val : "&"};
|
|
2
|
+
const htmlEntities = {
|
|
3
|
+
"space": { regex: /&(nbsp|#160);/g, val: " " },
|
|
4
|
+
// "lt" : { regex: /&(lt|#60);/g, val: "<" },
|
|
5
|
+
// "gt" : { regex: /&(gt|#62);/g, val: ">" },
|
|
6
|
+
// "amp" : { regex: /&(amp|#38);/g, val: "&" },
|
|
7
|
+
// "quot" : { regex: /&(quot|#34);/g, val: "\"" },
|
|
8
|
+
// "apos" : { regex: /&(apos|#39);/g, val: "'" },
|
|
9
|
+
"cent" : { regex: /&(cent|#162);/g, val: "¢" },
|
|
10
|
+
"pound" : { regex: /&(pound|#163);/g, val: "£" },
|
|
11
|
+
"yen" : { regex: /&(yen|#165);/g, val: "¥" },
|
|
12
|
+
"euro" : { regex: /&(euro|#8364);/g, val: "€" },
|
|
13
|
+
"copyright" : { regex: /&(copy|#169);/g, val: "©" },
|
|
14
|
+
"reg" : { regex: /&(reg|#174);/g, val: "®" },
|
|
15
|
+
"inr" : { regex: /&(inr|#8377);/g, val: "₹" },
|
|
16
|
+
"num_dec": { regex: /&#([0-9]{1,7});/g, val : (_, str) => String.fromCharCode(Number.parseInt(str, 10)) },
|
|
17
|
+
"num_hex": { regex: /&#x([0-9a-fA-F]{1,6});/g, val : (_, str) => String.fromCharCode(Number.parseInt(str, 16)) },
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
class EntitiesParser{
|
|
21
|
+
constructor(replaceHtmlEntities) {
|
|
22
|
+
this.replaceHtmlEntities = replaceHtmlEntities;
|
|
23
|
+
this.docTypeEntities = {};
|
|
24
|
+
this.lastEntities = {
|
|
25
|
+
"apos" : { regex: /&(apos|#39|#x27);/g, val : "'"},
|
|
26
|
+
"gt" : { regex: /&(gt|#62|#x3E);/g, val : ">"},
|
|
27
|
+
"lt" : { regex: /&(lt|#60|#x3C);/g, val : "<"},
|
|
28
|
+
"quot" : { regex: /&(quot|#34|#x22);/g, val : "\""},
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
addExternalEntities(externalEntities){
|
|
33
|
+
const entKeys = Object.keys(externalEntities);
|
|
34
|
+
for (let i = 0; i < entKeys.length; i++) {
|
|
35
|
+
const ent = entKeys[i];
|
|
36
|
+
this.addExternalEntity(ent,externalEntities[ent])
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
addExternalEntity(key,val){
|
|
40
|
+
validateEntityName(key);
|
|
41
|
+
if(val.indexOf("&") !== -1) {
|
|
42
|
+
reportWarning(`Entity ${key} is not added as '&' is found in value;`)
|
|
43
|
+
return;
|
|
44
|
+
}else{
|
|
45
|
+
this.lastEntities[ent] = {
|
|
46
|
+
regex: new RegExp("&"+key+";","g"),
|
|
47
|
+
val : val
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
addDocTypeEntities(entities){
|
|
53
|
+
const entKeys = Object.keys(entities);
|
|
54
|
+
for (let i = 0; i < entKeys.length; i++) {
|
|
55
|
+
const ent = entKeys[i];
|
|
56
|
+
this.docTypeEntities[ent] = {
|
|
57
|
+
regex: new RegExp("&"+ent+";","g"),
|
|
58
|
+
val : entities[ent]
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
parse(val){
|
|
64
|
+
return this.replaceEntitiesValue(val)
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
/**
|
|
68
|
+
* 1. Replace DOCTYPE entities
|
|
69
|
+
* 2. Replace external entities
|
|
70
|
+
* 3. Replace HTML entities if asked
|
|
71
|
+
* @param {string} val
|
|
72
|
+
*/
|
|
73
|
+
replaceEntitiesValue(val){
|
|
74
|
+
if(typeof val === "string" && val.length > 0){
|
|
75
|
+
for(let entityName in this.docTypeEntities){
|
|
76
|
+
const entity = this.docTypeEntities[entityName];
|
|
77
|
+
val = val.replace( entity.regx, entity.val);
|
|
78
|
+
}
|
|
79
|
+
for(let entityName in this.lastEntities){
|
|
80
|
+
const entity = this.lastEntities[entityName];
|
|
81
|
+
val = val.replace( entity.regex, entity.val);
|
|
82
|
+
}
|
|
83
|
+
if(this.replaceHtmlEntities){
|
|
84
|
+
for(let entityName in htmlEntities){
|
|
85
|
+
const entity = htmlEntities[entityName];
|
|
86
|
+
val = val.replace( entity.regex, entity.val);
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
val = val.replace( ampEntity.regex, ampEntity.val);
|
|
90
|
+
}
|
|
91
|
+
return val;
|
|
92
|
+
}
|
|
93
|
+
};
|
|
94
|
+
|
|
95
|
+
//an entity name should not contains special characters that may be used in regex
|
|
96
|
+
//Eg !?\\\/[]$%{}^&*()<>
|
|
97
|
+
const specialChar = "!?\\\/[]$%{}^&*()<>|+";
|
|
98
|
+
|
|
99
|
+
function validateEntityName(name){
|
|
100
|
+
for (let i = 0; i < specialChar.length; i++) {
|
|
101
|
+
const ch = specialChar[i];
|
|
102
|
+
if(name.indexOf(ch) !== -1) throw new Error(`Invalid character ${ch} in entity name`);
|
|
103
|
+
}
|
|
104
|
+
return name;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
module.exports = EntitiesParser;
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
|
|
2
|
+
const JsObjOutputBuilder = require("./OutputBuilders/JsObjBuilder");
|
|
3
|
+
|
|
4
|
+
const defaultOptions = {
|
|
5
|
+
preserveOrder: false,
|
|
6
|
+
removeNSPrefix: false, // remove NS from tag name or attribute name if true
|
|
7
|
+
//ignoreRootElement : false,
|
|
8
|
+
stopNodes: [], //nested tags will not be parsed even for errors
|
|
9
|
+
// isArray: () => false, //User will set it
|
|
10
|
+
htmlEntities: false,
|
|
11
|
+
// skipEmptyListItem: false
|
|
12
|
+
tags:{
|
|
13
|
+
unpaired: [],
|
|
14
|
+
nameFor:{
|
|
15
|
+
cdata: false,
|
|
16
|
+
comment: false,
|
|
17
|
+
text: '#text'
|
|
18
|
+
},
|
|
19
|
+
separateTextProperty: false,
|
|
20
|
+
},
|
|
21
|
+
attributes:{
|
|
22
|
+
ignore: false,
|
|
23
|
+
booleanType: true,
|
|
24
|
+
entities: true,
|
|
25
|
+
},
|
|
26
|
+
|
|
27
|
+
// select: ["img[src]"],
|
|
28
|
+
// stop: ["anim", "[ads]"]
|
|
29
|
+
only: [], // rest tags will be skipped. It will result in flat array
|
|
30
|
+
hierarchy: false, //will be used when a particular tag is set to be parsed.
|
|
31
|
+
skip: [], // will be skipped from parse result. on('skip') will be triggered
|
|
32
|
+
|
|
33
|
+
select: [], // on('select', tag => tag ) will be called if match
|
|
34
|
+
stop: [], //given tagPath will not be parsed. innerXML will be set as string value
|
|
35
|
+
OutputBuilder: new JsObjOutputBuilder(),
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
const buildOptions = function(options) {
|
|
39
|
+
const finalOptions = { ... defaultOptions};
|
|
40
|
+
copyProperties(finalOptions,options)
|
|
41
|
+
return finalOptions;
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
function copyProperties(target, source) {
|
|
45
|
+
for (let key in source) {
|
|
46
|
+
if (source.hasOwnProperty(key)) {
|
|
47
|
+
if (key === 'OutputBuilder') {
|
|
48
|
+
target[key] = source[key];
|
|
49
|
+
}else if (typeof source[key] === 'object' && !Array.isArray(source[key])) {
|
|
50
|
+
// Recursively copy nested properties
|
|
51
|
+
if (typeof target[key] === 'undefined') {
|
|
52
|
+
target[key] = {};
|
|
53
|
+
}
|
|
54
|
+
copyProperties(target[key], source[key]);
|
|
55
|
+
} else {
|
|
56
|
+
// Copy non-nested properties
|
|
57
|
+
target[key] = source[key];
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
exports.buildOptions = buildOptions;
|
|
64
|
+
exports.defaultOptions = defaultOptions;
|