node-red-contrib-tak-registration 0.14.1 → 0.16.0
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/README.md +1 -1
- package/node_modules/@types/geojson/README.md +1 -1
- package/node_modules/@types/geojson/index.d.ts +36 -2
- package/node_modules/@types/geojson/package.json +2 -2
- package/node_modules/@types/node/README.md +2 -2
- package/node_modules/@types/node/assert.d.ts +14 -0
- package/node_modules/@types/node/async_hooks.d.ts +64 -2
- package/node_modules/@types/node/buffer.buffer.d.ts +117 -39
- package/node_modules/@types/node/buffer.d.ts +6 -13
- package/node_modules/@types/node/cluster.d.ts +1 -1
- package/node_modules/@types/node/constants.d.ts +14 -12
- package/node_modules/@types/node/crypto.d.ts +44 -10
- package/node_modules/@types/node/dgram.d.ts +10 -7
- package/node_modules/@types/node/diagnostics_channel.d.ts +20 -1
- package/node_modules/@types/node/fs/promises.d.ts +23 -26
- package/node_modules/@types/node/fs.d.ts +166 -125
- package/node_modules/@types/node/globals.d.ts +141 -338
- package/node_modules/@types/node/http.d.ts +25 -3
- package/node_modules/@types/node/http2.d.ts +3 -4
- package/node_modules/@types/node/https.d.ts +3 -1
- package/node_modules/@types/node/inspector.d.ts +36 -0
- package/node_modules/@types/node/module.d.ts +599 -236
- package/node_modules/@types/node/net.d.ts +44 -13
- package/node_modules/@types/node/package.json +9 -4
- package/node_modules/@types/node/perf_hooks.d.ts +5 -0
- package/node_modules/@types/node/process.d.ts +69 -2
- package/node_modules/@types/node/querystring.d.ts +2 -3
- package/node_modules/@types/node/readline.d.ts +6 -1
- package/node_modules/@types/node/sea.d.ts +1 -1
- package/node_modules/@types/node/sqlite.d.ts +291 -17
- package/node_modules/@types/node/stream/consumers.d.ts +32 -6
- package/node_modules/@types/node/stream/web.d.ts +9 -4
- package/node_modules/@types/node/stream.d.ts +936 -1000
- package/node_modules/@types/node/test.d.ts +169 -137
- package/node_modules/@types/node/timers/promises.d.ts +24 -13
- package/node_modules/@types/node/timers.d.ts +159 -112
- package/node_modules/@types/node/tls.d.ts +34 -1
- package/node_modules/@types/node/ts5.6/buffer.buffer.d.ts +110 -35
- package/node_modules/@types/node/util.d.ts +323 -110
- package/node_modules/@types/node/v8.d.ts +81 -0
- package/node_modules/@types/node/vm.d.ts +21 -6
- package/node_modules/@types/node/worker_threads.d.ts +1 -0
- package/node_modules/@types/node/zlib.d.ts +167 -36
- package/node_modules/axios/CHANGELOG.md +165 -0
- package/node_modules/axios/README.md +55 -33
- package/node_modules/axios/dist/axios.js +85 -43
- package/node_modules/axios/dist/axios.js.map +1 -1
- package/node_modules/axios/dist/axios.min.js +2 -1
- package/node_modules/axios/dist/axios.min.js.map +1 -1
- package/node_modules/axios/dist/browser/axios.cjs +92 -47
- package/node_modules/axios/dist/browser/axios.cjs.map +1 -1
- package/node_modules/axios/dist/esm/axios.js +92 -47
- package/node_modules/axios/dist/esm/axios.js.map +1 -1
- package/node_modules/axios/dist/esm/axios.min.js +2 -1
- package/node_modules/axios/dist/esm/axios.min.js.map +1 -1
- package/node_modules/axios/dist/node/axios.cjs +123 -51
- package/node_modules/axios/dist/node/axios.cjs.map +1 -1
- package/node_modules/axios/index.d.cts +17 -5
- package/node_modules/axios/index.d.ts +6 -3
- package/node_modules/axios/lib/adapters/fetch.js +2 -2
- package/node_modules/axios/lib/adapters/http.js +1 -1
- package/node_modules/axios/lib/core/Axios.js +13 -4
- package/node_modules/axios/lib/core/AxiosHeaders.js +15 -3
- package/node_modules/axios/lib/core/buildFullPath.js +3 -2
- package/node_modules/axios/lib/core/mergeConfig.js +1 -1
- package/node_modules/axios/lib/env/data.js +1 -1
- package/node_modules/axios/lib/helpers/formDataToStream.js +4 -3
- package/node_modules/axios/lib/helpers/resolveConfig.js +1 -1
- package/node_modules/axios/lib/helpers/throttle.js +1 -1
- package/node_modules/axios/lib/helpers/toFormData.js +4 -0
- package/node_modules/axios/lib/helpers/toURLEncodedForm.js +4 -3
- package/node_modules/axios/lib/platform/node/index.js +26 -0
- package/node_modules/axios/lib/utils.js +48 -28
- package/node_modules/axios/package.json +14 -5
- package/node_modules/bignumber.js/CHANGELOG.md +82 -1
- package/node_modules/bignumber.js/LICENCE.md +1 -1
- package/node_modules/bignumber.js/README.md +6 -4
- package/node_modules/bignumber.js/bignumber.d.mts +6 -0
- package/node_modules/bignumber.js/bignumber.d.ts +3 -1829
- package/node_modules/bignumber.js/bignumber.js +3 -3
- package/node_modules/bignumber.js/bignumber.mjs +3 -3
- package/node_modules/bignumber.js/package.json +17 -7
- package/node_modules/bignumber.js/types.d.ts +1821 -0
- package/node_modules/call-bind-apply-helpers/.eslintrc +17 -0
- package/node_modules/call-bind-apply-helpers/.github/FUNDING.yml +12 -0
- package/node_modules/call-bind-apply-helpers/.nycrc +9 -0
- package/node_modules/call-bind-apply-helpers/CHANGELOG.md +30 -0
- package/node_modules/call-bind-apply-helpers/LICENSE +21 -0
- package/node_modules/call-bind-apply-helpers/README.md +62 -0
- package/node_modules/call-bind-apply-helpers/actualApply.d.ts +1 -0
- package/node_modules/call-bind-apply-helpers/actualApply.js +10 -0
- package/node_modules/call-bind-apply-helpers/applyBind.d.ts +19 -0
- package/node_modules/call-bind-apply-helpers/applyBind.js +10 -0
- package/node_modules/call-bind-apply-helpers/functionApply.d.ts +1 -0
- package/node_modules/call-bind-apply-helpers/functionApply.js +4 -0
- package/node_modules/call-bind-apply-helpers/functionCall.d.ts +1 -0
- package/node_modules/call-bind-apply-helpers/functionCall.js +4 -0
- package/node_modules/call-bind-apply-helpers/index.d.ts +64 -0
- package/node_modules/call-bind-apply-helpers/index.js +15 -0
- package/node_modules/call-bind-apply-helpers/package.json +85 -0
- package/node_modules/call-bind-apply-helpers/reflectApply.d.ts +3 -0
- package/node_modules/call-bind-apply-helpers/reflectApply.js +4 -0
- package/node_modules/call-bind-apply-helpers/test/index.js +63 -0
- package/node_modules/call-bind-apply-helpers/tsconfig.json +9 -0
- package/node_modules/dunder-proto/.eslintrc +5 -0
- package/node_modules/dunder-proto/.github/FUNDING.yml +12 -0
- package/node_modules/dunder-proto/.nycrc +13 -0
- package/node_modules/dunder-proto/CHANGELOG.md +24 -0
- package/node_modules/dunder-proto/LICENSE +21 -0
- package/node_modules/dunder-proto/README.md +54 -0
- package/node_modules/dunder-proto/get.d.ts +5 -0
- package/node_modules/dunder-proto/get.js +30 -0
- package/node_modules/dunder-proto/package.json +76 -0
- package/node_modules/dunder-proto/set.d.ts +5 -0
- package/node_modules/dunder-proto/set.js +35 -0
- package/node_modules/dunder-proto/test/get.js +34 -0
- package/node_modules/dunder-proto/test/index.js +4 -0
- package/node_modules/dunder-proto/test/set.js +50 -0
- package/node_modules/dunder-proto/tsconfig.json +9 -0
- package/node_modules/es-define-property/.eslintrc +13 -0
- package/node_modules/es-define-property/.github/FUNDING.yml +12 -0
- package/node_modules/es-define-property/.nycrc +9 -0
- package/node_modules/es-define-property/CHANGELOG.md +29 -0
- package/node_modules/es-define-property/LICENSE +21 -0
- package/node_modules/es-define-property/README.md +49 -0
- package/node_modules/es-define-property/index.d.ts +3 -0
- package/node_modules/es-define-property/index.js +14 -0
- package/node_modules/es-define-property/package.json +81 -0
- package/node_modules/es-define-property/test/index.js +56 -0
- package/node_modules/es-define-property/tsconfig.json +10 -0
- package/node_modules/es-errors/.eslintrc +5 -0
- package/node_modules/es-errors/.github/FUNDING.yml +12 -0
- package/node_modules/es-errors/CHANGELOG.md +40 -0
- package/node_modules/es-errors/LICENSE +21 -0
- package/node_modules/es-errors/README.md +55 -0
- package/node_modules/es-errors/eval.d.ts +3 -0
- package/node_modules/es-errors/eval.js +4 -0
- package/node_modules/es-errors/index.d.ts +3 -0
- package/node_modules/es-errors/index.js +4 -0
- package/node_modules/es-errors/package.json +80 -0
- package/node_modules/es-errors/range.d.ts +3 -0
- package/node_modules/es-errors/range.js +4 -0
- package/node_modules/es-errors/ref.d.ts +3 -0
- package/node_modules/es-errors/ref.js +4 -0
- package/node_modules/es-errors/syntax.d.ts +3 -0
- package/node_modules/es-errors/syntax.js +4 -0
- package/node_modules/es-errors/test/index.js +19 -0
- package/node_modules/es-errors/tsconfig.json +49 -0
- package/node_modules/es-errors/type.d.ts +3 -0
- package/node_modules/es-errors/type.js +4 -0
- package/node_modules/es-errors/uri.d.ts +3 -0
- package/node_modules/es-errors/uri.js +4 -0
- package/node_modules/es-object-atoms/.eslintrc +16 -0
- package/node_modules/es-object-atoms/.github/FUNDING.yml +12 -0
- package/node_modules/es-object-atoms/CHANGELOG.md +37 -0
- package/node_modules/es-object-atoms/LICENSE +21 -0
- package/node_modules/es-object-atoms/README.md +63 -0
- package/node_modules/es-object-atoms/RequireObjectCoercible.d.ts +3 -0
- package/node_modules/es-object-atoms/RequireObjectCoercible.js +11 -0
- package/node_modules/es-object-atoms/ToObject.d.ts +7 -0
- package/node_modules/es-object-atoms/ToObject.js +10 -0
- package/node_modules/es-object-atoms/index.d.ts +3 -0
- package/node_modules/es-object-atoms/index.js +4 -0
- package/node_modules/es-object-atoms/isObject.d.ts +3 -0
- package/node_modules/es-object-atoms/isObject.js +6 -0
- package/node_modules/es-object-atoms/package.json +80 -0
- package/node_modules/es-object-atoms/test/index.js +38 -0
- package/node_modules/es-object-atoms/tsconfig.json +6 -0
- package/node_modules/es-set-tostringtag/.eslintrc +13 -0
- package/node_modules/es-set-tostringtag/.nycrc +9 -0
- package/node_modules/es-set-tostringtag/CHANGELOG.md +67 -0
- package/node_modules/es-set-tostringtag/LICENSE +21 -0
- package/node_modules/es-set-tostringtag/README.md +53 -0
- package/node_modules/es-set-tostringtag/index.d.ts +10 -0
- package/node_modules/es-set-tostringtag/index.js +35 -0
- package/node_modules/es-set-tostringtag/package.json +78 -0
- package/node_modules/es-set-tostringtag/test/index.js +85 -0
- package/node_modules/es-set-tostringtag/tsconfig.json +9 -0
- package/node_modules/fast-xml-parser/CHANGELOG.md +70 -0
- package/node_modules/fast-xml-parser/README.md +37 -51
- package/node_modules/fast-xml-parser/lib/fxbuilder.min.js +2 -0
- package/node_modules/fast-xml-parser/lib/fxbuilder.min.js.map +1 -0
- package/node_modules/fast-xml-parser/lib/fxp.cjs +1 -0
- package/node_modules/fast-xml-parser/lib/fxp.d.cts +458 -0
- package/node_modules/fast-xml-parser/lib/fxp.min.js +2 -0
- package/node_modules/fast-xml-parser/lib/fxp.min.js.map +1 -0
- package/node_modules/fast-xml-parser/lib/fxparser.min.js +2 -0
- package/node_modules/fast-xml-parser/lib/fxparser.min.js.map +1 -0
- package/node_modules/fast-xml-parser/lib/fxvalidator.min.js +2 -0
- package/node_modules/fast-xml-parser/lib/fxvalidator.min.js.map +1 -0
- package/node_modules/fast-xml-parser/package.json +36 -19
- package/node_modules/fast-xml-parser/src/cli/cli.js +16 -12
- package/node_modules/fast-xml-parser/src/cli/man.js +6 -1
- package/node_modules/fast-xml-parser/src/cli/read.js +30 -79
- package/node_modules/fast-xml-parser/src/fxp.d.ts +33 -6
- package/node_modules/fast-xml-parser/src/fxp.js +11 -8
- package/node_modules/fast-xml-parser/src/ignoreAttributes.js +2 -4
- package/node_modules/fast-xml-parser/src/util.js +14 -18
- package/node_modules/fast-xml-parser/src/{v5 → v6}/CharsSymbol.js +1 -1
- package/node_modules/fast-xml-parser/src/{v5 → v6}/EntitiesParser.js +3 -6
- package/node_modules/fast-xml-parser/src/{v5 → v6}/OptionsBuilder.js +3 -6
- package/node_modules/fast-xml-parser/src/{v5 → v6}/OutputBuilders/BaseOutputBuilder.js +1 -3
- package/node_modules/fast-xml-parser/src/{v5 → v6}/OutputBuilders/JsArrBuilder.js +3 -3
- package/node_modules/fast-xml-parser/src/{v5 → v6}/OutputBuilders/JsMinArrBuilder.js +3 -5
- package/node_modules/fast-xml-parser/src/{v5 → v6}/OutputBuilders/JsObjBuilder.js +3 -5
- package/node_modules/fast-xml-parser/src/{v5 → v6}/OutputBuilders/ParserOptionsBuilder.js +6 -11
- package/node_modules/fast-xml-parser/src/{v5 → v6}/TagPath.js +1 -1
- package/node_modules/fast-xml-parser/src/{v5 → v6}/TagPathMatcher.js +3 -5
- package/node_modules/fast-xml-parser/src/{v5 → v6}/XMLParser.js +3 -5
- package/node_modules/fast-xml-parser/src/{v5 → v6}/Xml2JsParser.js +8 -10
- package/node_modules/fast-xml-parser/src/{v5 → v6}/XmlPartReader.js +4 -10
- package/node_modules/fast-xml-parser/src/{v5 → v6}/XmlSpecialTagsReader.js +5 -12
- package/node_modules/fast-xml-parser/src/{v5 → v6}/inputSource/BufferSource.js +1 -3
- package/node_modules/fast-xml-parser/src/{v5 → v6}/inputSource/StringSource.js +1 -3
- package/node_modules/fast-xml-parser/src/{v5 → v6}/valueParsers/EntitiesParser.js +3 -5
- package/node_modules/fast-xml-parser/src/{v5 → v6}/valueParsers/booleanParser.js +1 -2
- package/node_modules/fast-xml-parser/src/{v5 → v6}/valueParsers/booleanParserExt.js +1 -2
- package/node_modules/fast-xml-parser/src/{v5 → v6}/valueParsers/currency.js +1 -3
- package/node_modules/fast-xml-parser/src/{v5 → v6}/valueParsers/join.js +1 -2
- package/node_modules/fast-xml-parser/src/{v5 → v6}/valueParsers/number.js +2 -4
- package/node_modules/fast-xml-parser/src/{v5 → v6}/valueParsers/trim.js +1 -3
- package/node_modules/fast-xml-parser/src/validator.js +5 -5
- package/node_modules/fast-xml-parser/src/xmlbuilder/json2xml.js +5 -4
- package/node_modules/fast-xml-parser/src/xmlbuilder/orderedJs2Xml.js +1 -2
- package/node_modules/fast-xml-parser/src/xmlparser/DocTypeReader.js +287 -71
- package/node_modules/fast-xml-parser/src/xmlparser/OptionsBuilder.js +3 -5
- package/node_modules/fast-xml-parser/src/xmlparser/OrderedObjParser.js +23 -23
- package/node_modules/fast-xml-parser/src/xmlparser/XMLParser.js +21 -8
- package/node_modules/fast-xml-parser/src/xmlparser/node2json.js +8 -2
- package/node_modules/fast-xml-parser/src/xmlparser/xmlNode.js +22 -7
- package/node_modules/form-data/CHANGELOG.md +601 -0
- package/node_modules/form-data/{Readme.md → README.md} +34 -37
- package/node_modules/form-data/lib/browser.js +3 -1
- package/node_modules/form-data/lib/form_data.js +140 -147
- package/node_modules/form-data/lib/populate.js +5 -5
- package/node_modules/form-data/package.json +34 -23
- package/node_modules/function-bind/.eslintrc +21 -0
- package/node_modules/function-bind/.github/FUNDING.yml +12 -0
- package/node_modules/function-bind/.github/SECURITY.md +3 -0
- package/node_modules/function-bind/.nycrc +13 -0
- package/node_modules/function-bind/CHANGELOG.md +136 -0
- package/node_modules/function-bind/LICENSE +20 -0
- package/node_modules/function-bind/README.md +46 -0
- package/node_modules/function-bind/implementation.js +84 -0
- package/node_modules/function-bind/index.js +5 -0
- package/node_modules/function-bind/package.json +87 -0
- package/node_modules/function-bind/test/.eslintrc +9 -0
- package/node_modules/function-bind/test/index.js +252 -0
- package/node_modules/get-intrinsic/.eslintrc +42 -0
- package/node_modules/get-intrinsic/.github/FUNDING.yml +12 -0
- package/node_modules/get-intrinsic/.nycrc +9 -0
- package/node_modules/get-intrinsic/CHANGELOG.md +186 -0
- package/node_modules/get-intrinsic/LICENSE +21 -0
- package/node_modules/get-intrinsic/README.md +71 -0
- package/node_modules/get-intrinsic/index.js +378 -0
- package/node_modules/get-intrinsic/package.json +97 -0
- package/node_modules/get-intrinsic/test/GetIntrinsic.js +274 -0
- package/node_modules/get-proto/.eslintrc +10 -0
- package/node_modules/get-proto/.github/FUNDING.yml +12 -0
- package/node_modules/get-proto/.nycrc +9 -0
- package/node_modules/get-proto/CHANGELOG.md +21 -0
- package/node_modules/get-proto/LICENSE +21 -0
- package/node_modules/get-proto/Object.getPrototypeOf.d.ts +5 -0
- package/node_modules/get-proto/Object.getPrototypeOf.js +6 -0
- package/node_modules/get-proto/README.md +50 -0
- package/node_modules/get-proto/Reflect.getPrototypeOf.d.ts +3 -0
- package/node_modules/get-proto/Reflect.getPrototypeOf.js +4 -0
- package/node_modules/get-proto/index.d.ts +5 -0
- package/node_modules/get-proto/index.js +27 -0
- package/node_modules/get-proto/package.json +81 -0
- package/node_modules/get-proto/test/index.js +68 -0
- package/node_modules/get-proto/tsconfig.json +9 -0
- package/node_modules/gopd/.eslintrc +16 -0
- package/node_modules/gopd/.github/FUNDING.yml +12 -0
- package/node_modules/gopd/CHANGELOG.md +45 -0
- package/node_modules/gopd/LICENSE +21 -0
- package/node_modules/gopd/README.md +40 -0
- package/node_modules/gopd/gOPD.d.ts +1 -0
- package/node_modules/gopd/gOPD.js +4 -0
- package/node_modules/gopd/index.d.ts +5 -0
- package/node_modules/gopd/index.js +15 -0
- package/node_modules/gopd/package.json +77 -0
- package/node_modules/gopd/test/index.js +36 -0
- package/node_modules/gopd/tsconfig.json +9 -0
- package/node_modules/has-symbols/.eslintrc +11 -0
- package/node_modules/has-symbols/.github/FUNDING.yml +12 -0
- package/node_modules/has-symbols/.nycrc +9 -0
- package/node_modules/has-symbols/CHANGELOG.md +91 -0
- package/node_modules/has-symbols/LICENSE +21 -0
- package/node_modules/has-symbols/README.md +46 -0
- package/node_modules/has-symbols/index.d.ts +3 -0
- package/node_modules/has-symbols/index.js +14 -0
- package/node_modules/has-symbols/package.json +111 -0
- package/node_modules/has-symbols/shams.d.ts +3 -0
- package/node_modules/has-symbols/shams.js +45 -0
- package/node_modules/has-symbols/test/index.js +22 -0
- package/node_modules/has-symbols/test/shams/core-js.js +29 -0
- package/node_modules/has-symbols/test/shams/get-own-property-symbols.js +29 -0
- package/node_modules/has-symbols/test/tests.js +58 -0
- package/node_modules/has-symbols/tsconfig.json +10 -0
- package/node_modules/has-tostringtag/.eslintrc +5 -0
- package/node_modules/has-tostringtag/.github/FUNDING.yml +12 -0
- package/node_modules/has-tostringtag/.nycrc +13 -0
- package/node_modules/has-tostringtag/CHANGELOG.md +42 -0
- package/node_modules/has-tostringtag/LICENSE +21 -0
- package/node_modules/has-tostringtag/README.md +46 -0
- package/node_modules/has-tostringtag/index.d.ts +3 -0
- package/node_modules/has-tostringtag/index.js +8 -0
- package/node_modules/has-tostringtag/package.json +108 -0
- package/node_modules/has-tostringtag/shams.d.ts +3 -0
- package/node_modules/has-tostringtag/shams.js +8 -0
- package/node_modules/has-tostringtag/test/index.js +21 -0
- package/node_modules/has-tostringtag/test/shams/core-js.js +31 -0
- package/node_modules/has-tostringtag/test/shams/get-own-property-symbols.js +30 -0
- package/node_modules/has-tostringtag/test/tests.js +15 -0
- package/node_modules/has-tostringtag/tsconfig.json +49 -0
- package/node_modules/hasown/.eslintrc +5 -0
- package/node_modules/hasown/.github/FUNDING.yml +12 -0
- package/node_modules/hasown/.nycrc +13 -0
- package/node_modules/hasown/CHANGELOG.md +40 -0
- package/node_modules/hasown/LICENSE +21 -0
- package/node_modules/hasown/README.md +40 -0
- package/node_modules/hasown/index.d.ts +3 -0
- package/node_modules/hasown/index.js +8 -0
- package/node_modules/hasown/package.json +92 -0
- package/node_modules/hasown/tsconfig.json +6 -0
- package/node_modules/long/README.md +93 -87
- package/node_modules/long/index.d.ts +2 -2
- package/node_modules/long/index.js +360 -246
- package/node_modules/long/package.json +12 -4
- package/node_modules/long/types.d.ts +474 -0
- package/node_modules/long/umd/index.d.ts +2 -456
- package/node_modules/long/umd/index.js +1585 -1395
- package/node_modules/long/umd/types.d.ts +474 -0
- package/node_modules/math-intrinsics/.eslintrc +16 -0
- package/node_modules/math-intrinsics/.github/FUNDING.yml +12 -0
- package/node_modules/math-intrinsics/CHANGELOG.md +24 -0
- package/node_modules/math-intrinsics/LICENSE +21 -0
- package/node_modules/math-intrinsics/README.md +50 -0
- package/node_modules/math-intrinsics/abs.d.ts +1 -0
- package/node_modules/math-intrinsics/abs.js +4 -0
- package/node_modules/math-intrinsics/constants/maxArrayLength.d.ts +3 -0
- package/node_modules/math-intrinsics/constants/maxArrayLength.js +4 -0
- package/node_modules/math-intrinsics/constants/maxSafeInteger.d.ts +3 -0
- package/node_modules/math-intrinsics/constants/maxSafeInteger.js +5 -0
- package/node_modules/math-intrinsics/constants/maxValue.d.ts +3 -0
- package/node_modules/math-intrinsics/constants/maxValue.js +5 -0
- package/node_modules/math-intrinsics/floor.d.ts +1 -0
- package/node_modules/math-intrinsics/floor.js +4 -0
- package/node_modules/math-intrinsics/isFinite.d.ts +3 -0
- package/node_modules/math-intrinsics/isFinite.js +12 -0
- package/node_modules/math-intrinsics/isInteger.d.ts +3 -0
- package/node_modules/math-intrinsics/isInteger.js +16 -0
- package/node_modules/math-intrinsics/isNaN.d.ts +1 -0
- package/node_modules/math-intrinsics/isNaN.js +6 -0
- package/node_modules/math-intrinsics/isNegativeZero.d.ts +3 -0
- package/node_modules/math-intrinsics/isNegativeZero.js +6 -0
- package/node_modules/math-intrinsics/max.d.ts +1 -0
- package/node_modules/math-intrinsics/max.js +4 -0
- package/node_modules/math-intrinsics/min.d.ts +1 -0
- package/node_modules/math-intrinsics/min.js +4 -0
- package/node_modules/math-intrinsics/mod.d.ts +3 -0
- package/node_modules/math-intrinsics/mod.js +9 -0
- package/node_modules/math-intrinsics/package.json +86 -0
- package/node_modules/math-intrinsics/pow.d.ts +1 -0
- package/node_modules/math-intrinsics/pow.js +4 -0
- package/node_modules/math-intrinsics/round.d.ts +1 -0
- package/node_modules/math-intrinsics/round.js +4 -0
- package/node_modules/math-intrinsics/sign.d.ts +3 -0
- package/node_modules/math-intrinsics/sign.js +11 -0
- package/node_modules/math-intrinsics/test/index.js +192 -0
- package/node_modules/math-intrinsics/tsconfig.json +3 -0
- package/node_modules/protobufjs/dist/light/protobuf.js +532 -80
- package/node_modules/protobufjs/dist/light/protobuf.js.map +1 -1
- package/node_modules/protobufjs/dist/light/protobuf.min.js +3 -3
- package/node_modules/protobufjs/dist/light/protobuf.min.js.map +1 -1
- package/node_modules/protobufjs/dist/minimal/protobuf.js +2 -2
- package/node_modules/protobufjs/dist/minimal/protobuf.min.js +2 -2
- package/node_modules/protobufjs/dist/protobuf.js +672 -144
- 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/descriptor/index.js +179 -69
- package/node_modules/protobufjs/google/protobuf/descriptor.json +659 -16
- package/node_modules/protobufjs/google/protobuf/descriptor.proto +254 -6
- package/node_modules/protobufjs/index.d.ts +71 -13
- package/node_modules/protobufjs/package.json +4 -2
- package/node_modules/protobufjs/src/decoder.js +8 -10
- package/node_modules/protobufjs/src/encoder.js +1 -1
- package/node_modules/protobufjs/src/enum.js +25 -0
- package/node_modules/protobufjs/src/field.js +104 -28
- package/node_modules/protobufjs/src/namespace.js +126 -13
- package/node_modules/protobufjs/src/object.js +139 -4
- package/node_modules/protobufjs/src/oneof.js +19 -0
- package/node_modules/protobufjs/src/parse.js +139 -63
- package/node_modules/protobufjs/src/root.js +51 -15
- package/node_modules/protobufjs/src/service.js +23 -1
- package/node_modules/protobufjs/src/type.js +29 -4
- package/node_modules/protobufjs/src/util.js +4 -1
- package/node_modules/strnum/.github/SECURITY.md +5 -0
- package/node_modules/strnum/CHANGELOG.md +33 -0
- package/node_modules/strnum/README.md +14 -3
- package/node_modules/strnum/algo.stflow +84 -0
- package/node_modules/strnum/package.json +9 -2
- package/node_modules/strnum/strnum.js +72 -67
- package/node_modules/strnum/strnum.test.js +29 -6
- package/node_modules/strnum/test.js +9 -0
- package/node_modules/undici-types/dispatcher.d.ts +1 -0
- package/node_modules/undici-types/package.json +1 -1
- package/node_modules/undici-types/readable.d.ts +5 -0
- package/node_modules/undici-types/webidl.d.ts +6 -0
- package/node_modules/uuid/README.md +12 -12
- package/node_modules/uuid/dist/cjs/types.d.ts +1 -1
- package/node_modules/uuid/dist/cjs/v1.d.ts +1 -1
- package/node_modules/uuid/dist/cjs/v1.js +1 -1
- package/node_modules/uuid/dist/cjs/v3.d.ts +1 -1
- package/node_modules/uuid/dist/cjs/v35.d.ts +1 -1
- package/node_modules/uuid/dist/cjs/v4.d.ts +1 -1
- package/node_modules/uuid/dist/cjs/v5.d.ts +1 -1
- package/node_modules/uuid/dist/cjs/v6.d.ts +1 -1
- package/node_modules/uuid/dist/cjs/v7.d.ts +1 -1
- package/node_modules/uuid/dist/cjs/v7.js +1 -1
- package/node_modules/uuid/dist/cjs-browser/types.d.ts +1 -1
- package/node_modules/uuid/dist/cjs-browser/v1.d.ts +1 -1
- package/node_modules/uuid/dist/cjs-browser/v1.js +1 -1
- package/node_modules/uuid/dist/cjs-browser/v3.d.ts +1 -1
- package/node_modules/uuid/dist/cjs-browser/v35.d.ts +1 -1
- package/node_modules/uuid/dist/cjs-browser/v4.d.ts +1 -1
- package/node_modules/uuid/dist/cjs-browser/v5.d.ts +1 -1
- package/node_modules/uuid/dist/cjs-browser/v6.d.ts +1 -1
- package/node_modules/uuid/dist/cjs-browser/v7.d.ts +1 -1
- package/node_modules/uuid/dist/cjs-browser/v7.js +1 -1
- package/node_modules/uuid/dist/esm/types.d.ts +1 -1
- package/node_modules/uuid/dist/esm/v1.d.ts +1 -1
- package/node_modules/uuid/dist/esm/v1.js +1 -1
- package/node_modules/uuid/dist/esm/v3.d.ts +1 -1
- package/node_modules/uuid/dist/esm/v35.d.ts +1 -1
- package/node_modules/uuid/dist/esm/v4.d.ts +1 -1
- package/node_modules/uuid/dist/esm/v5.d.ts +1 -1
- package/node_modules/uuid/dist/esm/v6.d.ts +1 -1
- package/node_modules/uuid/dist/esm/v7.d.ts +1 -1
- package/node_modules/uuid/dist/esm/v7.js +1 -1
- package/node_modules/uuid/dist/esm-browser/types.d.ts +1 -1
- package/node_modules/uuid/dist/esm-browser/v1.d.ts +1 -1
- package/node_modules/uuid/dist/esm-browser/v1.js +1 -1
- package/node_modules/uuid/dist/esm-browser/v3.d.ts +1 -1
- package/node_modules/uuid/dist/esm-browser/v35.d.ts +1 -1
- package/node_modules/uuid/dist/esm-browser/v4.d.ts +1 -1
- package/node_modules/uuid/dist/esm-browser/v5.d.ts +1 -1
- package/node_modules/uuid/dist/esm-browser/v6.d.ts +1 -1
- package/node_modules/uuid/dist/esm-browser/v7.d.ts +1 -1
- package/node_modules/uuid/dist/esm-browser/v7.js +1 -1
- package/node_modules/uuid/package.json +1 -1
- package/package.json +7 -7
- package/tak-registration.html +4 -4
- package/tak-registration.js +19 -10
- package/node_modules/axios/SECURITY.md +0 -6
- /package/node_modules/fast-xml-parser/src/{v5 → v6}/Report.js +0 -0
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
1
3
|
var CombinedStream = require('combined-stream');
|
|
2
4
|
var util = require('util');
|
|
3
5
|
var path = require('path');
|
|
@@ -6,23 +8,20 @@ var https = require('https');
|
|
|
6
8
|
var parseUrl = require('url').parse;
|
|
7
9
|
var fs = require('fs');
|
|
8
10
|
var Stream = require('stream').Stream;
|
|
11
|
+
var crypto = require('crypto');
|
|
9
12
|
var mime = require('mime-types');
|
|
10
13
|
var asynckit = require('asynckit');
|
|
14
|
+
var setToStringTag = require('es-set-tostringtag');
|
|
15
|
+
var hasOwn = require('hasown');
|
|
11
16
|
var populate = require('./populate.js');
|
|
12
17
|
|
|
13
|
-
// Public API
|
|
14
|
-
module.exports = FormData;
|
|
15
|
-
|
|
16
|
-
// make it a Stream
|
|
17
|
-
util.inherits(FormData, CombinedStream);
|
|
18
|
-
|
|
19
18
|
/**
|
|
20
19
|
* Create readable "multipart/form-data" streams.
|
|
21
20
|
* Can be used to submit forms
|
|
22
21
|
* and file uploads to other web applications.
|
|
23
22
|
*
|
|
24
23
|
* @constructor
|
|
25
|
-
* @param {
|
|
24
|
+
* @param {object} options - Properties to be added/overriden for FormData and CombinedStream
|
|
26
25
|
*/
|
|
27
26
|
function FormData(options) {
|
|
28
27
|
if (!(this instanceof FormData)) {
|
|
@@ -35,35 +34,39 @@ function FormData(options) {
|
|
|
35
34
|
|
|
36
35
|
CombinedStream.call(this);
|
|
37
36
|
|
|
38
|
-
options = options || {};
|
|
39
|
-
for (var option in options) {
|
|
37
|
+
options = options || {}; // eslint-disable-line no-param-reassign
|
|
38
|
+
for (var option in options) { // eslint-disable-line no-restricted-syntax
|
|
40
39
|
this[option] = options[option];
|
|
41
40
|
}
|
|
42
41
|
}
|
|
43
42
|
|
|
43
|
+
// make it a Stream
|
|
44
|
+
util.inherits(FormData, CombinedStream);
|
|
45
|
+
|
|
44
46
|
FormData.LINE_BREAK = '\r\n';
|
|
45
47
|
FormData.DEFAULT_CONTENT_TYPE = 'application/octet-stream';
|
|
46
48
|
|
|
47
|
-
FormData.prototype.append = function(field, value, options) {
|
|
48
|
-
|
|
49
|
-
options = options || {};
|
|
49
|
+
FormData.prototype.append = function (field, value, options) {
|
|
50
|
+
options = options || {}; // eslint-disable-line no-param-reassign
|
|
50
51
|
|
|
51
52
|
// allow filename as single option
|
|
52
|
-
if (typeof options
|
|
53
|
-
options = {filename: options};
|
|
53
|
+
if (typeof options === 'string') {
|
|
54
|
+
options = { filename: options }; // eslint-disable-line no-param-reassign
|
|
54
55
|
}
|
|
55
56
|
|
|
56
57
|
var append = CombinedStream.prototype.append.bind(this);
|
|
57
58
|
|
|
58
59
|
// all that streamy business can't handle numbers
|
|
59
|
-
if (typeof value
|
|
60
|
-
value =
|
|
60
|
+
if (typeof value === 'number' || value == null) {
|
|
61
|
+
value = String(value); // eslint-disable-line no-param-reassign
|
|
61
62
|
}
|
|
62
63
|
|
|
63
64
|
// https://github.com/felixge/node-form-data/issues/38
|
|
64
65
|
if (Array.isArray(value)) {
|
|
65
|
-
|
|
66
|
-
|
|
66
|
+
/*
|
|
67
|
+
* Please convert your array into string
|
|
68
|
+
* the way web server expects it
|
|
69
|
+
*/
|
|
67
70
|
this._error(new Error('Arrays are not supported.'));
|
|
68
71
|
return;
|
|
69
72
|
}
|
|
@@ -79,15 +82,17 @@ FormData.prototype.append = function(field, value, options) {
|
|
|
79
82
|
this._trackLength(header, value, options);
|
|
80
83
|
};
|
|
81
84
|
|
|
82
|
-
FormData.prototype._trackLength = function(header, value, options) {
|
|
85
|
+
FormData.prototype._trackLength = function (header, value, options) {
|
|
83
86
|
var valueLength = 0;
|
|
84
87
|
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
88
|
+
/*
|
|
89
|
+
* used w/ getLengthSync(), when length is known.
|
|
90
|
+
* e.g. for streaming directly from a remote server,
|
|
91
|
+
* w/ a known file a size, and not wanting to wait for
|
|
92
|
+
* incoming file to finish to get its size.
|
|
93
|
+
*/
|
|
89
94
|
if (options.knownLength != null) {
|
|
90
|
-
valueLength +=
|
|
95
|
+
valueLength += Number(options.knownLength);
|
|
91
96
|
} else if (Buffer.isBuffer(value)) {
|
|
92
97
|
valueLength = value.length;
|
|
93
98
|
} else if (typeof value === 'string') {
|
|
@@ -97,12 +102,10 @@ FormData.prototype._trackLength = function(header, value, options) {
|
|
|
97
102
|
this._valueLength += valueLength;
|
|
98
103
|
|
|
99
104
|
// @check why add CRLF? does this account for custom/multiple CRLFs?
|
|
100
|
-
this._overheadLength +=
|
|
101
|
-
Buffer.byteLength(header) +
|
|
102
|
-
FormData.LINE_BREAK.length;
|
|
105
|
+
this._overheadLength += Buffer.byteLength(header) + FormData.LINE_BREAK.length;
|
|
103
106
|
|
|
104
107
|
// empty or either doesn't have path or not an http response or not a stream
|
|
105
|
-
if (!value || (
|
|
108
|
+
if (!value || (!value.path && !(value.readable && hasOwn(value, 'httpVersion')) && !(value instanceof Stream))) {
|
|
106
109
|
return;
|
|
107
110
|
}
|
|
108
111
|
|
|
@@ -112,10 +115,8 @@ FormData.prototype._trackLength = function(header, value, options) {
|
|
|
112
115
|
}
|
|
113
116
|
};
|
|
114
117
|
|
|
115
|
-
FormData.prototype._lengthRetriever = function(value, callback) {
|
|
116
|
-
|
|
117
|
-
if (value.hasOwnProperty('fd')) {
|
|
118
|
-
|
|
118
|
+
FormData.prototype._lengthRetriever = function (value, callback) {
|
|
119
|
+
if (hasOwn(value, 'fd')) {
|
|
119
120
|
// take read range into a account
|
|
120
121
|
// `end` = Infinity –> read file till the end
|
|
121
122
|
//
|
|
@@ -124,54 +125,52 @@ FormData.prototype._lengthRetriever = function(value, callback) {
|
|
|
124
125
|
// Fix it when node fixes it.
|
|
125
126
|
// https://github.com/joyent/node/issues/7819
|
|
126
127
|
if (value.end != undefined && value.end != Infinity && value.start != undefined) {
|
|
127
|
-
|
|
128
128
|
// when end specified
|
|
129
129
|
// no need to calculate range
|
|
130
130
|
// inclusive, starts with 0
|
|
131
|
-
callback(null, value.end + 1 - (value.start ? value.start : 0));
|
|
131
|
+
callback(null, value.end + 1 - (value.start ? value.start : 0)); // eslint-disable-line callback-return
|
|
132
132
|
|
|
133
|
-
|
|
133
|
+
// not that fast snoopy
|
|
134
134
|
} else {
|
|
135
135
|
// still need to fetch file size from fs
|
|
136
|
-
fs.stat(value.path, function(err, stat) {
|
|
137
|
-
|
|
138
|
-
var fileSize;
|
|
139
|
-
|
|
136
|
+
fs.stat(value.path, function (err, stat) {
|
|
140
137
|
if (err) {
|
|
141
138
|
callback(err);
|
|
142
139
|
return;
|
|
143
140
|
}
|
|
144
141
|
|
|
145
142
|
// update final size based on the range options
|
|
146
|
-
fileSize = stat.size - (value.start ? value.start : 0);
|
|
143
|
+
var fileSize = stat.size - (value.start ? value.start : 0);
|
|
147
144
|
callback(null, fileSize);
|
|
148
145
|
});
|
|
149
146
|
}
|
|
150
147
|
|
|
151
|
-
|
|
152
|
-
} else if (value
|
|
153
|
-
callback(null,
|
|
148
|
+
// or http response
|
|
149
|
+
} else if (hasOwn(value, 'httpVersion')) {
|
|
150
|
+
callback(null, Number(value.headers['content-length'])); // eslint-disable-line callback-return
|
|
154
151
|
|
|
155
|
-
|
|
156
|
-
} else if (value
|
|
152
|
+
// or request stream http://github.com/mikeal/request
|
|
153
|
+
} else if (hasOwn(value, 'httpModule')) {
|
|
157
154
|
// wait till response come back
|
|
158
|
-
value.on('response', function(response) {
|
|
155
|
+
value.on('response', function (response) {
|
|
159
156
|
value.pause();
|
|
160
|
-
callback(null,
|
|
157
|
+
callback(null, Number(response.headers['content-length']));
|
|
161
158
|
});
|
|
162
159
|
value.resume();
|
|
163
160
|
|
|
164
|
-
|
|
161
|
+
// something else
|
|
165
162
|
} else {
|
|
166
|
-
callback('Unknown stream');
|
|
163
|
+
callback('Unknown stream'); // eslint-disable-line callback-return
|
|
167
164
|
}
|
|
168
165
|
};
|
|
169
166
|
|
|
170
|
-
FormData.prototype._multiPartHeader = function(field, value, options) {
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
167
|
+
FormData.prototype._multiPartHeader = function (field, value, options) {
|
|
168
|
+
/*
|
|
169
|
+
* custom header specified (as string)?
|
|
170
|
+
* it becomes responsible for boundary
|
|
171
|
+
* (e.g. to handle extra CRLFs on .NET servers)
|
|
172
|
+
*/
|
|
173
|
+
if (typeof options.header === 'string') {
|
|
175
174
|
return options.header;
|
|
176
175
|
}
|
|
177
176
|
|
|
@@ -179,7 +178,7 @@ FormData.prototype._multiPartHeader = function(field, value, options) {
|
|
|
179
178
|
var contentType = this._getContentType(value, options);
|
|
180
179
|
|
|
181
180
|
var contents = '';
|
|
182
|
-
var headers
|
|
181
|
+
var headers = {
|
|
183
182
|
// add custom disposition as third element or keep it two elements if not
|
|
184
183
|
'Content-Disposition': ['form-data', 'name="' + field + '"'].concat(contentDisposition || []),
|
|
185
184
|
// if no content type. allow it to be empty array
|
|
@@ -187,77 +186,74 @@ FormData.prototype._multiPartHeader = function(field, value, options) {
|
|
|
187
186
|
};
|
|
188
187
|
|
|
189
188
|
// allow custom headers.
|
|
190
|
-
if (typeof options.header
|
|
189
|
+
if (typeof options.header === 'object') {
|
|
191
190
|
populate(headers, options.header);
|
|
192
191
|
}
|
|
193
192
|
|
|
194
193
|
var header;
|
|
195
|
-
for (var prop in headers) {
|
|
196
|
-
if (
|
|
197
|
-
|
|
194
|
+
for (var prop in headers) { // eslint-disable-line no-restricted-syntax
|
|
195
|
+
if (hasOwn(headers, prop)) {
|
|
196
|
+
header = headers[prop];
|
|
198
197
|
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
198
|
+
// skip nullish headers.
|
|
199
|
+
if (header == null) {
|
|
200
|
+
continue; // eslint-disable-line no-restricted-syntax, no-continue
|
|
201
|
+
}
|
|
203
202
|
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
203
|
+
// convert all headers to arrays.
|
|
204
|
+
if (!Array.isArray(header)) {
|
|
205
|
+
header = [header];
|
|
206
|
+
}
|
|
208
207
|
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
208
|
+
// add non-empty headers.
|
|
209
|
+
if (header.length) {
|
|
210
|
+
contents += prop + ': ' + header.join('; ') + FormData.LINE_BREAK;
|
|
211
|
+
}
|
|
212
212
|
}
|
|
213
213
|
}
|
|
214
214
|
|
|
215
215
|
return '--' + this.getBoundary() + FormData.LINE_BREAK + contents + FormData.LINE_BREAK;
|
|
216
216
|
};
|
|
217
217
|
|
|
218
|
-
FormData.prototype._getContentDisposition = function(value, options) {
|
|
219
|
-
|
|
220
|
-
var filename
|
|
221
|
-
, contentDisposition
|
|
222
|
-
;
|
|
218
|
+
FormData.prototype._getContentDisposition = function (value, options) { // eslint-disable-line consistent-return
|
|
219
|
+
var filename;
|
|
223
220
|
|
|
224
221
|
if (typeof options.filepath === 'string') {
|
|
225
222
|
// custom filepath for relative paths
|
|
226
223
|
filename = path.normalize(options.filepath).replace(/\\/g, '/');
|
|
227
|
-
} else if (options.filename || value.name || value.path) {
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
224
|
+
} else if (options.filename || (value && (value.name || value.path))) {
|
|
225
|
+
/*
|
|
226
|
+
* custom filename take precedence
|
|
227
|
+
* formidable and the browser add a name property
|
|
228
|
+
* fs- and request- streams have path property
|
|
229
|
+
*/
|
|
230
|
+
filename = path.basename(options.filename || (value && (value.name || value.path)));
|
|
231
|
+
} else if (value && value.readable && hasOwn(value, 'httpVersion')) {
|
|
233
232
|
// or try http response
|
|
234
233
|
filename = path.basename(value.client._httpMessage.path || '');
|
|
235
234
|
}
|
|
236
235
|
|
|
237
236
|
if (filename) {
|
|
238
|
-
|
|
237
|
+
return 'filename="' + filename + '"';
|
|
239
238
|
}
|
|
240
|
-
|
|
241
|
-
return contentDisposition;
|
|
242
239
|
};
|
|
243
240
|
|
|
244
|
-
FormData.prototype._getContentType = function(value, options) {
|
|
245
|
-
|
|
241
|
+
FormData.prototype._getContentType = function (value, options) {
|
|
246
242
|
// use custom content-type above all
|
|
247
243
|
var contentType = options.contentType;
|
|
248
244
|
|
|
249
245
|
// or try `name` from formidable, browser
|
|
250
|
-
if (!contentType && value.name) {
|
|
246
|
+
if (!contentType && value && value.name) {
|
|
251
247
|
contentType = mime.lookup(value.name);
|
|
252
248
|
}
|
|
253
249
|
|
|
254
250
|
// or try `path` from fs-, request- streams
|
|
255
|
-
if (!contentType && value.path) {
|
|
251
|
+
if (!contentType && value && value.path) {
|
|
256
252
|
contentType = mime.lookup(value.path);
|
|
257
253
|
}
|
|
258
254
|
|
|
259
255
|
// or if it's http-reponse
|
|
260
|
-
if (!contentType && value.readable && value
|
|
256
|
+
if (!contentType && value && value.readable && hasOwn(value, 'httpVersion')) {
|
|
261
257
|
contentType = value.headers['content-type'];
|
|
262
258
|
}
|
|
263
259
|
|
|
@@ -267,18 +263,18 @@ FormData.prototype._getContentType = function(value, options) {
|
|
|
267
263
|
}
|
|
268
264
|
|
|
269
265
|
// fallback to the default content type if `value` is not simple value
|
|
270
|
-
if (!contentType && typeof value
|
|
266
|
+
if (!contentType && value && typeof value === 'object') {
|
|
271
267
|
contentType = FormData.DEFAULT_CONTENT_TYPE;
|
|
272
268
|
}
|
|
273
269
|
|
|
274
270
|
return contentType;
|
|
275
271
|
};
|
|
276
272
|
|
|
277
|
-
FormData.prototype._multiPartFooter = function() {
|
|
278
|
-
return function(next) {
|
|
273
|
+
FormData.prototype._multiPartFooter = function () {
|
|
274
|
+
return function (next) {
|
|
279
275
|
var footer = FormData.LINE_BREAK;
|
|
280
276
|
|
|
281
|
-
var lastPart =
|
|
277
|
+
var lastPart = this._streams.length === 0;
|
|
282
278
|
if (lastPart) {
|
|
283
279
|
footer += this._lastBoundary();
|
|
284
280
|
}
|
|
@@ -287,18 +283,18 @@ FormData.prototype._multiPartFooter = function() {
|
|
|
287
283
|
}.bind(this);
|
|
288
284
|
};
|
|
289
285
|
|
|
290
|
-
FormData.prototype._lastBoundary = function() {
|
|
286
|
+
FormData.prototype._lastBoundary = function () {
|
|
291
287
|
return '--' + this.getBoundary() + '--' + FormData.LINE_BREAK;
|
|
292
288
|
};
|
|
293
289
|
|
|
294
|
-
FormData.prototype.getHeaders = function(userHeaders) {
|
|
290
|
+
FormData.prototype.getHeaders = function (userHeaders) {
|
|
295
291
|
var header;
|
|
296
292
|
var formHeaders = {
|
|
297
293
|
'content-type': 'multipart/form-data; boundary=' + this.getBoundary()
|
|
298
294
|
};
|
|
299
295
|
|
|
300
|
-
for (header in userHeaders) {
|
|
301
|
-
if (userHeaders
|
|
296
|
+
for (header in userHeaders) { // eslint-disable-line no-restricted-syntax
|
|
297
|
+
if (hasOwn(userHeaders, header)) {
|
|
302
298
|
formHeaders[header.toLowerCase()] = userHeaders[header];
|
|
303
299
|
}
|
|
304
300
|
}
|
|
@@ -306,11 +302,14 @@ FormData.prototype.getHeaders = function(userHeaders) {
|
|
|
306
302
|
return formHeaders;
|
|
307
303
|
};
|
|
308
304
|
|
|
309
|
-
FormData.prototype.setBoundary = function(boundary) {
|
|
305
|
+
FormData.prototype.setBoundary = function (boundary) {
|
|
306
|
+
if (typeof boundary !== 'string') {
|
|
307
|
+
throw new TypeError('FormData boundary must be a string');
|
|
308
|
+
}
|
|
310
309
|
this._boundary = boundary;
|
|
311
310
|
};
|
|
312
311
|
|
|
313
|
-
FormData.prototype.getBoundary = function() {
|
|
312
|
+
FormData.prototype.getBoundary = function () {
|
|
314
313
|
if (!this._boundary) {
|
|
315
314
|
this._generateBoundary();
|
|
316
315
|
}
|
|
@@ -318,60 +317,55 @@ FormData.prototype.getBoundary = function() {
|
|
|
318
317
|
return this._boundary;
|
|
319
318
|
};
|
|
320
319
|
|
|
321
|
-
FormData.prototype.getBuffer = function() {
|
|
322
|
-
var dataBuffer = new Buffer.alloc(
|
|
320
|
+
FormData.prototype.getBuffer = function () {
|
|
321
|
+
var dataBuffer = new Buffer.alloc(0); // eslint-disable-line new-cap
|
|
323
322
|
var boundary = this.getBoundary();
|
|
324
323
|
|
|
325
324
|
// Create the form content. Add Line breaks to the end of data.
|
|
326
325
|
for (var i = 0, len = this._streams.length; i < len; i++) {
|
|
327
326
|
if (typeof this._streams[i] !== 'function') {
|
|
328
|
-
|
|
329
327
|
// Add content to the buffer.
|
|
330
|
-
if(Buffer.isBuffer(this._streams[i])) {
|
|
331
|
-
dataBuffer = Buffer.concat(
|
|
332
|
-
}else {
|
|
333
|
-
dataBuffer = Buffer.concat(
|
|
328
|
+
if (Buffer.isBuffer(this._streams[i])) {
|
|
329
|
+
dataBuffer = Buffer.concat([dataBuffer, this._streams[i]]);
|
|
330
|
+
} else {
|
|
331
|
+
dataBuffer = Buffer.concat([dataBuffer, Buffer.from(this._streams[i])]);
|
|
334
332
|
}
|
|
335
333
|
|
|
336
334
|
// Add break after content.
|
|
337
|
-
if (typeof this._streams[i] !== 'string' || this._streams[i].substring(
|
|
338
|
-
dataBuffer = Buffer.concat(
|
|
335
|
+
if (typeof this._streams[i] !== 'string' || this._streams[i].substring(2, boundary.length + 2) !== boundary) {
|
|
336
|
+
dataBuffer = Buffer.concat([dataBuffer, Buffer.from(FormData.LINE_BREAK)]);
|
|
339
337
|
}
|
|
340
338
|
}
|
|
341
339
|
}
|
|
342
340
|
|
|
343
341
|
// Add the footer and return the Buffer object.
|
|
344
|
-
return Buffer.concat(
|
|
342
|
+
return Buffer.concat([dataBuffer, Buffer.from(this._lastBoundary())]);
|
|
345
343
|
};
|
|
346
344
|
|
|
347
|
-
FormData.prototype._generateBoundary = function() {
|
|
345
|
+
FormData.prototype._generateBoundary = function () {
|
|
348
346
|
// This generates a 50 character boundary similar to those used by Firefox.
|
|
349
|
-
// They are optimized for boyer-moore parsing.
|
|
350
|
-
var boundary = '--------------------------';
|
|
351
|
-
for (var i = 0; i < 24; i++) {
|
|
352
|
-
boundary += Math.floor(Math.random() * 10).toString(16);
|
|
353
|
-
}
|
|
354
347
|
|
|
355
|
-
|
|
348
|
+
// They are optimized for boyer-moore parsing.
|
|
349
|
+
this._boundary = '--------------------------' + crypto.randomBytes(12).toString('hex');
|
|
356
350
|
};
|
|
357
351
|
|
|
358
352
|
// Note: getLengthSync DOESN'T calculate streams length
|
|
359
|
-
// As workaround one can calculate file size manually
|
|
360
|
-
|
|
361
|
-
FormData.prototype.getLengthSync = function() {
|
|
353
|
+
// As workaround one can calculate file size manually and add it as knownLength option
|
|
354
|
+
FormData.prototype.getLengthSync = function () {
|
|
362
355
|
var knownLength = this._overheadLength + this._valueLength;
|
|
363
356
|
|
|
364
|
-
// Don't get confused, there are 3 "internal" streams for each keyval pair
|
|
365
|
-
// so it basically checks if there is any value added to the form
|
|
357
|
+
// Don't get confused, there are 3 "internal" streams for each keyval pair so it basically checks if there is any value added to the form
|
|
366
358
|
if (this._streams.length) {
|
|
367
359
|
knownLength += this._lastBoundary().length;
|
|
368
360
|
}
|
|
369
361
|
|
|
370
362
|
// https://github.com/form-data/form-data/issues/40
|
|
371
363
|
if (!this.hasKnownLength()) {
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
364
|
+
/*
|
|
365
|
+
* Some async length retrievers are present
|
|
366
|
+
* therefore synchronous length calculation is false.
|
|
367
|
+
* Please use getLength(callback) to get proper length
|
|
368
|
+
*/
|
|
375
369
|
this._error(new Error('Cannot calculate proper length in synchronous way.'));
|
|
376
370
|
}
|
|
377
371
|
|
|
@@ -381,7 +375,7 @@ FormData.prototype.getLengthSync = function() {
|
|
|
381
375
|
// Public API to check if length of added values is known
|
|
382
376
|
// https://github.com/form-data/form-data/issues/196
|
|
383
377
|
// https://github.com/form-data/form-data/issues/262
|
|
384
|
-
FormData.prototype.hasKnownLength = function() {
|
|
378
|
+
FormData.prototype.hasKnownLength = function () {
|
|
385
379
|
var hasKnownLength = true;
|
|
386
380
|
|
|
387
381
|
if (this._valuesToMeasure.length) {
|
|
@@ -391,7 +385,7 @@ FormData.prototype.hasKnownLength = function() {
|
|
|
391
385
|
return hasKnownLength;
|
|
392
386
|
};
|
|
393
387
|
|
|
394
|
-
FormData.prototype.getLength = function(cb) {
|
|
388
|
+
FormData.prototype.getLength = function (cb) {
|
|
395
389
|
var knownLength = this._overheadLength + this._valueLength;
|
|
396
390
|
|
|
397
391
|
if (this._streams.length) {
|
|
@@ -403,13 +397,13 @@ FormData.prototype.getLength = function(cb) {
|
|
|
403
397
|
return;
|
|
404
398
|
}
|
|
405
399
|
|
|
406
|
-
asynckit.parallel(this._valuesToMeasure, this._lengthRetriever, function(err, values) {
|
|
400
|
+
asynckit.parallel(this._valuesToMeasure, this._lengthRetriever, function (err, values) {
|
|
407
401
|
if (err) {
|
|
408
402
|
cb(err);
|
|
409
403
|
return;
|
|
410
404
|
}
|
|
411
405
|
|
|
412
|
-
values.forEach(function(length) {
|
|
406
|
+
values.forEach(function (length) {
|
|
413
407
|
knownLength += length;
|
|
414
408
|
});
|
|
415
409
|
|
|
@@ -417,31 +411,26 @@ FormData.prototype.getLength = function(cb) {
|
|
|
417
411
|
});
|
|
418
412
|
};
|
|
419
413
|
|
|
420
|
-
FormData.prototype.submit = function(params, cb) {
|
|
421
|
-
var request
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
;
|
|
425
|
-
|
|
426
|
-
// parse provided url if it's string
|
|
427
|
-
// or treat it as options object
|
|
428
|
-
if (typeof params == 'string') {
|
|
414
|
+
FormData.prototype.submit = function (params, cb) {
|
|
415
|
+
var request;
|
|
416
|
+
var options;
|
|
417
|
+
var defaults = { method: 'post' };
|
|
429
418
|
|
|
430
|
-
|
|
419
|
+
// parse provided url if it's string or treat it as options object
|
|
420
|
+
if (typeof params === 'string') {
|
|
421
|
+
params = parseUrl(params); // eslint-disable-line no-param-reassign
|
|
422
|
+
/* eslint sort-keys: 0 */
|
|
431
423
|
options = populate({
|
|
432
424
|
port: params.port,
|
|
433
425
|
path: params.pathname,
|
|
434
426
|
host: params.hostname,
|
|
435
427
|
protocol: params.protocol
|
|
436
428
|
}, defaults);
|
|
437
|
-
|
|
438
|
-
// use custom params
|
|
439
|
-
} else {
|
|
440
|
-
|
|
429
|
+
} else { // use custom params
|
|
441
430
|
options = populate(params, defaults);
|
|
442
431
|
// if no port provided use default one
|
|
443
432
|
if (!options.port) {
|
|
444
|
-
options.port = options.protocol
|
|
433
|
+
options.port = options.protocol === 'https:' ? 443 : 80;
|
|
445
434
|
}
|
|
446
435
|
}
|
|
447
436
|
|
|
@@ -449,14 +438,14 @@ FormData.prototype.submit = function(params, cb) {
|
|
|
449
438
|
options.headers = this.getHeaders(params.headers);
|
|
450
439
|
|
|
451
440
|
// https if specified, fallback to http in any other case
|
|
452
|
-
if (options.protocol
|
|
441
|
+
if (options.protocol === 'https:') {
|
|
453
442
|
request = https.request(options);
|
|
454
443
|
} else {
|
|
455
444
|
request = http.request(options);
|
|
456
445
|
}
|
|
457
446
|
|
|
458
447
|
// get content length and fire away
|
|
459
|
-
this.getLength(function(err, length) {
|
|
448
|
+
this.getLength(function (err, length) {
|
|
460
449
|
if (err && err !== 'Unknown stream') {
|
|
461
450
|
this._error(err);
|
|
462
451
|
return;
|
|
@@ -475,7 +464,7 @@ FormData.prototype.submit = function(params, cb) {
|
|
|
475
464
|
request.removeListener('error', callback);
|
|
476
465
|
request.removeListener('response', onResponse);
|
|
477
466
|
|
|
478
|
-
return cb.call(this, error, responce);
|
|
467
|
+
return cb.call(this, error, responce); // eslint-disable-line no-invalid-this
|
|
479
468
|
};
|
|
480
469
|
|
|
481
470
|
onResponse = callback.bind(this, null);
|
|
@@ -488,7 +477,7 @@ FormData.prototype.submit = function(params, cb) {
|
|
|
488
477
|
return request;
|
|
489
478
|
};
|
|
490
479
|
|
|
491
|
-
FormData.prototype._error = function(err) {
|
|
480
|
+
FormData.prototype._error = function (err) {
|
|
492
481
|
if (!this.error) {
|
|
493
482
|
this.error = err;
|
|
494
483
|
this.pause();
|
|
@@ -499,3 +488,7 @@ FormData.prototype._error = function(err) {
|
|
|
499
488
|
FormData.prototype.toString = function () {
|
|
500
489
|
return '[object FormData]';
|
|
501
490
|
};
|
|
491
|
+
setToStringTag(FormData, 'FormData');
|
|
492
|
+
|
|
493
|
+
// Public API
|
|
494
|
+
module.exports = FormData;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
module.exports = function(dst, src) {
|
|
1
|
+
'use strict';
|
|
3
2
|
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
3
|
+
// populates missing values
|
|
4
|
+
module.exports = function (dst, src) {
|
|
5
|
+
Object.keys(src).forEach(function (prop) {
|
|
6
|
+
dst[prop] = dst[prop] || src[prop]; // eslint-disable-line no-param-reassign
|
|
7
7
|
});
|
|
8
8
|
|
|
9
9
|
return dst;
|