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,6 +1,6 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* protobuf.js v7.
|
|
3
|
-
* compiled
|
|
2
|
+
* protobuf.js v7.5.3 (c) 2016, daniel wirtz
|
|
3
|
+
* compiled wed, 28 may 2025 22:23:47 utc
|
|
4
4
|
* licensed under the bsd-3-clause license
|
|
5
5
|
* see: https://github.com/dcodeio/protobuf.js for details
|
|
6
6
|
*/
|
|
@@ -1831,16 +1831,14 @@ function missing(field) {
|
|
|
1831
1831
|
*/
|
|
1832
1832
|
function decoder(mtype) {
|
|
1833
1833
|
/* eslint-disable no-unexpected-multiline */
|
|
1834
|
-
var gen = util.codegen(["r", "l"], mtype.name + "$decode")
|
|
1834
|
+
var gen = util.codegen(["r", "l", "e"], mtype.name + "$decode")
|
|
1835
1835
|
("if(!(r instanceof Reader))")
|
|
1836
1836
|
("r=Reader.create(r)")
|
|
1837
1837
|
("var c=l===undefined?r.len:r.pos+l,m=new this.ctor" + (mtype.fieldsArray.filter(function(field) { return field.map; }).length ? ",k,value" : ""))
|
|
1838
1838
|
("while(r.pos<c){")
|
|
1839
|
-
("var t=r.uint32()")
|
|
1840
|
-
|
|
1841
|
-
|
|
1842
|
-
("break");
|
|
1843
|
-
gen
|
|
1839
|
+
("var t=r.uint32()")
|
|
1840
|
+
("if(t===e)")
|
|
1841
|
+
("break")
|
|
1844
1842
|
("switch(t>>>3){");
|
|
1845
1843
|
|
|
1846
1844
|
var i = 0;
|
|
@@ -1906,15 +1904,15 @@ function decoder(mtype) {
|
|
|
1906
1904
|
("}else");
|
|
1907
1905
|
|
|
1908
1906
|
// Non-packed
|
|
1909
|
-
if (types.basic[type] === undefined) gen(field.
|
|
1910
|
-
? "%s.push(types[%i].decode(r))"
|
|
1907
|
+
if (types.basic[type] === undefined) gen(field.delimited
|
|
1908
|
+
? "%s.push(types[%i].decode(r,undefined,((t&~7)|4)))"
|
|
1911
1909
|
: "%s.push(types[%i].decode(r,r.uint32()))", ref, i);
|
|
1912
1910
|
else gen
|
|
1913
1911
|
("%s.push(r.%s())", ref, type);
|
|
1914
1912
|
|
|
1915
1913
|
// Non-repeated
|
|
1916
|
-
} else if (types.basic[type] === undefined) gen(field.
|
|
1917
|
-
? "%s=types[%i].decode(r)"
|
|
1914
|
+
} else if (types.basic[type] === undefined) gen(field.delimited
|
|
1915
|
+
? "%s=types[%i].decode(r,undefined,((t&~7)|4))"
|
|
1918
1916
|
: "%s=types[%i].decode(r,r.uint32())", ref, i);
|
|
1919
1917
|
else gen
|
|
1920
1918
|
("%s=r.%s()", ref, type);
|
|
@@ -1961,7 +1959,7 @@ var Enum = require(15),
|
|
|
1961
1959
|
* @ignore
|
|
1962
1960
|
*/
|
|
1963
1961
|
function genTypePartial(gen, field, fieldIndex, ref) {
|
|
1964
|
-
return field.
|
|
1962
|
+
return field.delimited
|
|
1965
1963
|
? gen("types[%i].encode(%s,w.uint32(%i)).uint32(%i)", fieldIndex, ref, (field.id << 3 | 3) >>> 0, (field.id << 3 | 4) >>> 0)
|
|
1966
1964
|
: gen("types[%i].encode(%s,w.uint32(%i).fork()).ldelim()", fieldIndex, ref, (field.id << 3 | 2) >>> 0);
|
|
1967
1965
|
}
|
|
@@ -2104,6 +2102,12 @@ function Enum(name, values, options, comment, comments, valuesOptions) {
|
|
|
2104
2102
|
*/
|
|
2105
2103
|
this.valuesOptions = valuesOptions;
|
|
2106
2104
|
|
|
2105
|
+
/**
|
|
2106
|
+
* Resolved values features, if any
|
|
2107
|
+
* @type {Object<string, Object<string, *>>|undefined}
|
|
2108
|
+
*/
|
|
2109
|
+
this._valuesFeatures = {};
|
|
2110
|
+
|
|
2107
2111
|
/**
|
|
2108
2112
|
* Reserved ranges, if any.
|
|
2109
2113
|
* @type {Array.<number[]|string>}
|
|
@@ -2120,6 +2124,21 @@ function Enum(name, values, options, comment, comments, valuesOptions) {
|
|
|
2120
2124
|
this.valuesById[ this.values[keys[i]] = values[keys[i]] ] = keys[i];
|
|
2121
2125
|
}
|
|
2122
2126
|
|
|
2127
|
+
/**
|
|
2128
|
+
* @override
|
|
2129
|
+
*/
|
|
2130
|
+
Enum.prototype._resolveFeatures = function _resolveFeatures(edition) {
|
|
2131
|
+
edition = this._edition || edition;
|
|
2132
|
+
ReflectionObject.prototype._resolveFeatures.call(this, edition);
|
|
2133
|
+
|
|
2134
|
+
Object.keys(this.values).forEach(key => {
|
|
2135
|
+
var parentFeaturesCopy = Object.assign({}, this._features);
|
|
2136
|
+
this._valuesFeatures[key] = Object.assign(parentFeaturesCopy, this.valuesOptions && this.valuesOptions[key] && this.valuesOptions[key].features);
|
|
2137
|
+
});
|
|
2138
|
+
|
|
2139
|
+
return this;
|
|
2140
|
+
};
|
|
2141
|
+
|
|
2123
2142
|
/**
|
|
2124
2143
|
* Enum descriptor.
|
|
2125
2144
|
* @interface IEnum
|
|
@@ -2137,6 +2156,9 @@ function Enum(name, values, options, comment, comments, valuesOptions) {
|
|
|
2137
2156
|
Enum.fromJSON = function fromJSON(name, json) {
|
|
2138
2157
|
var enm = new Enum(name, json.values, json.options, json.comment, json.comments);
|
|
2139
2158
|
enm.reserved = json.reserved;
|
|
2159
|
+
if (json.edition)
|
|
2160
|
+
enm._edition = json.edition;
|
|
2161
|
+
enm._defaultEdition = "proto3"; // For backwards-compatibility.
|
|
2140
2162
|
return enm;
|
|
2141
2163
|
};
|
|
2142
2164
|
|
|
@@ -2148,6 +2170,7 @@ Enum.fromJSON = function fromJSON(name, json) {
|
|
|
2148
2170
|
Enum.prototype.toJSON = function toJSON(toJSONOptions) {
|
|
2149
2171
|
var keepComments = toJSONOptions ? Boolean(toJSONOptions.keepComments) : false;
|
|
2150
2172
|
return util.toObject([
|
|
2173
|
+
"edition" , this._editionToJSON(),
|
|
2151
2174
|
"options" , this.options,
|
|
2152
2175
|
"valuesOptions" , this.valuesOptions,
|
|
2153
2176
|
"values" , this.values,
|
|
@@ -2283,7 +2306,11 @@ var ruleRe = /^required|optional|repeated$/;
|
|
|
2283
2306
|
* @throws {TypeError} If arguments are invalid
|
|
2284
2307
|
*/
|
|
2285
2308
|
Field.fromJSON = function fromJSON(name, json) {
|
|
2286
|
-
|
|
2309
|
+
var field = new Field(name, json.id, json.type, json.rule, json.extend, json.options, json.comment);
|
|
2310
|
+
if (json.edition)
|
|
2311
|
+
field._edition = json.edition;
|
|
2312
|
+
field._defaultEdition = "proto3"; // For backwards-compatibility.
|
|
2313
|
+
return field;
|
|
2287
2314
|
};
|
|
2288
2315
|
|
|
2289
2316
|
/**
|
|
@@ -2353,18 +2380,6 @@ function Field(name, id, type, rule, extend, options, comment) {
|
|
|
2353
2380
|
*/
|
|
2354
2381
|
this.extend = extend || undefined; // toJSON
|
|
2355
2382
|
|
|
2356
|
-
/**
|
|
2357
|
-
* Whether this field is required.
|
|
2358
|
-
* @type {boolean}
|
|
2359
|
-
*/
|
|
2360
|
-
this.required = rule === "required";
|
|
2361
|
-
|
|
2362
|
-
/**
|
|
2363
|
-
* Whether this field is optional.
|
|
2364
|
-
* @type {boolean}
|
|
2365
|
-
*/
|
|
2366
|
-
this.optional = !this.required;
|
|
2367
|
-
|
|
2368
2383
|
/**
|
|
2369
2384
|
* Whether this field is repeated.
|
|
2370
2385
|
* @type {boolean}
|
|
@@ -2431,13 +2446,6 @@ function Field(name, id, type, rule, extend, options, comment) {
|
|
|
2431
2446
|
*/
|
|
2432
2447
|
this.declaringField = null;
|
|
2433
2448
|
|
|
2434
|
-
/**
|
|
2435
|
-
* Internally remembers whether this field is packed.
|
|
2436
|
-
* @type {boolean|null}
|
|
2437
|
-
* @private
|
|
2438
|
-
*/
|
|
2439
|
-
this._packed = null;
|
|
2440
|
-
|
|
2441
2449
|
/**
|
|
2442
2450
|
* Comment for this field.
|
|
2443
2451
|
* @type {string|null}
|
|
@@ -2446,17 +2454,69 @@ function Field(name, id, type, rule, extend, options, comment) {
|
|
|
2446
2454
|
}
|
|
2447
2455
|
|
|
2448
2456
|
/**
|
|
2449
|
-
* Determines whether this field is
|
|
2457
|
+
* Determines whether this field is required.
|
|
2458
|
+
* @name Field#required
|
|
2459
|
+
* @type {boolean}
|
|
2460
|
+
* @readonly
|
|
2461
|
+
*/
|
|
2462
|
+
Object.defineProperty(Field.prototype, "required", {
|
|
2463
|
+
get: function() {
|
|
2464
|
+
return this._features.field_presence === "LEGACY_REQUIRED";
|
|
2465
|
+
}
|
|
2466
|
+
});
|
|
2467
|
+
|
|
2468
|
+
/**
|
|
2469
|
+
* Determines whether this field is not required.
|
|
2470
|
+
* @name Field#optional
|
|
2471
|
+
* @type {boolean}
|
|
2472
|
+
* @readonly
|
|
2473
|
+
*/
|
|
2474
|
+
Object.defineProperty(Field.prototype, "optional", {
|
|
2475
|
+
get: function() {
|
|
2476
|
+
return !this.required;
|
|
2477
|
+
}
|
|
2478
|
+
});
|
|
2479
|
+
|
|
2480
|
+
/**
|
|
2481
|
+
* Determines whether this field uses tag-delimited encoding. In proto2 this
|
|
2482
|
+
* corresponded to group syntax.
|
|
2483
|
+
* @name Field#delimited
|
|
2484
|
+
* @type {boolean}
|
|
2485
|
+
* @readonly
|
|
2486
|
+
*/
|
|
2487
|
+
Object.defineProperty(Field.prototype, "delimited", {
|
|
2488
|
+
get: function() {
|
|
2489
|
+
return this.resolvedType instanceof Type &&
|
|
2490
|
+
this._features.message_encoding === "DELIMITED";
|
|
2491
|
+
}
|
|
2492
|
+
});
|
|
2493
|
+
|
|
2494
|
+
/**
|
|
2495
|
+
* Determines whether this field is packed. Only relevant when repeated.
|
|
2450
2496
|
* @name Field#packed
|
|
2451
2497
|
* @type {boolean}
|
|
2452
2498
|
* @readonly
|
|
2453
2499
|
*/
|
|
2454
2500
|
Object.defineProperty(Field.prototype, "packed", {
|
|
2455
2501
|
get: function() {
|
|
2456
|
-
|
|
2457
|
-
|
|
2458
|
-
|
|
2459
|
-
|
|
2502
|
+
return this._features.repeated_field_encoding === "PACKED";
|
|
2503
|
+
}
|
|
2504
|
+
});
|
|
2505
|
+
|
|
2506
|
+
/**
|
|
2507
|
+
* Determines whether this field tracks presence.
|
|
2508
|
+
* @name Field#hasPresence
|
|
2509
|
+
* @type {boolean}
|
|
2510
|
+
* @readonly
|
|
2511
|
+
*/
|
|
2512
|
+
Object.defineProperty(Field.prototype, "hasPresence", {
|
|
2513
|
+
get: function() {
|
|
2514
|
+
if (this.repeated || this.map) {
|
|
2515
|
+
return false;
|
|
2516
|
+
}
|
|
2517
|
+
return this.partOf || // oneofs
|
|
2518
|
+
this.declaringField || this.extensionField || // extensions
|
|
2519
|
+
this._features.field_presence !== "IMPLICIT";
|
|
2460
2520
|
}
|
|
2461
2521
|
});
|
|
2462
2522
|
|
|
@@ -2464,8 +2524,6 @@ Object.defineProperty(Field.prototype, "packed", {
|
|
|
2464
2524
|
* @override
|
|
2465
2525
|
*/
|
|
2466
2526
|
Field.prototype.setOption = function setOption(name, value, ifNotSet) {
|
|
2467
|
-
if (name === "packed") // clear cached before setting
|
|
2468
|
-
this._packed = null;
|
|
2469
2527
|
return ReflectionObject.prototype.setOption.call(this, name, value, ifNotSet);
|
|
2470
2528
|
};
|
|
2471
2529
|
|
|
@@ -2493,6 +2551,7 @@ Field.prototype.setOption = function setOption(name, value, ifNotSet) {
|
|
|
2493
2551
|
Field.prototype.toJSON = function toJSON(toJSONOptions) {
|
|
2494
2552
|
var keepComments = toJSONOptions ? Boolean(toJSONOptions.keepComments) : false;
|
|
2495
2553
|
return util.toObject([
|
|
2554
|
+
"edition" , this._editionToJSON(),
|
|
2496
2555
|
"rule" , this.rule !== "optional" && this.rule || undefined,
|
|
2497
2556
|
"type" , this.type,
|
|
2498
2557
|
"id" , this.id,
|
|
@@ -2532,7 +2591,7 @@ Field.prototype.resolve = function resolve() {
|
|
|
2532
2591
|
|
|
2533
2592
|
// remove unnecessary options
|
|
2534
2593
|
if (this.options) {
|
|
2535
|
-
if (this.options.packed
|
|
2594
|
+
if (this.options.packed !== undefined && this.resolvedType && !(this.resolvedType instanceof Enum))
|
|
2536
2595
|
delete this.options.packed;
|
|
2537
2596
|
if (!Object.keys(this.options).length)
|
|
2538
2597
|
this.options = undefined;
|
|
@@ -2570,6 +2629,46 @@ Field.prototype.resolve = function resolve() {
|
|
|
2570
2629
|
return ReflectionObject.prototype.resolve.call(this);
|
|
2571
2630
|
};
|
|
2572
2631
|
|
|
2632
|
+
/**
|
|
2633
|
+
* Infers field features from legacy syntax that may have been specified differently.
|
|
2634
|
+
* in older editions.
|
|
2635
|
+
* @param {string|undefined} edition The edition this proto is on, or undefined if pre-editions
|
|
2636
|
+
* @returns {object} The feature values to override
|
|
2637
|
+
*/
|
|
2638
|
+
Field.prototype._inferLegacyProtoFeatures = function _inferLegacyProtoFeatures(edition) {
|
|
2639
|
+
if (edition !== "proto2" && edition !== "proto3") {
|
|
2640
|
+
return {};
|
|
2641
|
+
}
|
|
2642
|
+
|
|
2643
|
+
var features = {};
|
|
2644
|
+
|
|
2645
|
+
if (this.rule === "required") {
|
|
2646
|
+
features.field_presence = "LEGACY_REQUIRED";
|
|
2647
|
+
}
|
|
2648
|
+
if (this.parent && types.defaults[this.type] === undefined) {
|
|
2649
|
+
// We can't use resolvedType because types may not have been resolved yet. However,
|
|
2650
|
+
// legacy groups are always in the same scope as the field so we don't have to do a
|
|
2651
|
+
// full scan of the tree.
|
|
2652
|
+
var type = this.parent.get(this.type.split(".").pop());
|
|
2653
|
+
if (type && type instanceof Type && type.group) {
|
|
2654
|
+
features.message_encoding = "DELIMITED";
|
|
2655
|
+
}
|
|
2656
|
+
}
|
|
2657
|
+
if (this.getOption("packed") === true) {
|
|
2658
|
+
features.repeated_field_encoding = "PACKED";
|
|
2659
|
+
} else if (this.getOption("packed") === false) {
|
|
2660
|
+
features.repeated_field_encoding = "EXPANDED";
|
|
2661
|
+
}
|
|
2662
|
+
return features;
|
|
2663
|
+
};
|
|
2664
|
+
|
|
2665
|
+
/**
|
|
2666
|
+
* @override
|
|
2667
|
+
*/
|
|
2668
|
+
Field.prototype._resolveFeatures = function _resolveFeatures(edition) {
|
|
2669
|
+
return ReflectionObject.prototype._resolveFeatures.call(this, this._edition || edition);
|
|
2670
|
+
};
|
|
2671
|
+
|
|
2573
2672
|
/**
|
|
2574
2673
|
* Decorator function as returned by {@link Field.d} and {@link MapField.d} (TypeScript).
|
|
2575
2674
|
* @typedef FieldDecorator
|
|
@@ -3323,10 +3422,40 @@ function Namespace(name, options) {
|
|
|
3323
3422
|
* @private
|
|
3324
3423
|
*/
|
|
3325
3424
|
this._nestedArray = null;
|
|
3425
|
+
|
|
3426
|
+
/**
|
|
3427
|
+
* Cache lookup calls for any objects contains anywhere under this namespace.
|
|
3428
|
+
* This drastically speeds up resolve for large cross-linked protos where the same
|
|
3429
|
+
* types are looked up repeatedly.
|
|
3430
|
+
* @type {Object.<string,ReflectionObject|null>}
|
|
3431
|
+
* @private
|
|
3432
|
+
*/
|
|
3433
|
+
this._lookupCache = {};
|
|
3434
|
+
|
|
3435
|
+
/**
|
|
3436
|
+
* Whether or not objects contained in this namespace need feature resolution.
|
|
3437
|
+
* @type {boolean}
|
|
3438
|
+
* @protected
|
|
3439
|
+
*/
|
|
3440
|
+
this._needsRecursiveFeatureResolution = true;
|
|
3441
|
+
|
|
3442
|
+
/**
|
|
3443
|
+
* Whether or not objects contained in this namespace need a resolve.
|
|
3444
|
+
* @type {boolean}
|
|
3445
|
+
* @protected
|
|
3446
|
+
*/
|
|
3447
|
+
this._needsRecursiveResolve = true;
|
|
3326
3448
|
}
|
|
3327
3449
|
|
|
3328
3450
|
function clearCache(namespace) {
|
|
3329
3451
|
namespace._nestedArray = null;
|
|
3452
|
+
namespace._lookupCache = {};
|
|
3453
|
+
|
|
3454
|
+
// Also clear parent caches, since they include nested lookups.
|
|
3455
|
+
var parent = namespace;
|
|
3456
|
+
while(parent = parent.parent) {
|
|
3457
|
+
parent._lookupCache = {};
|
|
3458
|
+
}
|
|
3330
3459
|
return namespace;
|
|
3331
3460
|
}
|
|
3332
3461
|
|
|
@@ -3455,6 +3584,25 @@ Namespace.prototype.add = function add(object) {
|
|
|
3455
3584
|
}
|
|
3456
3585
|
}
|
|
3457
3586
|
this.nested[object.name] = object;
|
|
3587
|
+
|
|
3588
|
+
if (!(this instanceof Type || this instanceof Service || this instanceof Enum || this instanceof Field)) {
|
|
3589
|
+
// This is a package or a root namespace.
|
|
3590
|
+
if (!object._edition) {
|
|
3591
|
+
// Make sure that some edition is set if it hasn't already been specified.
|
|
3592
|
+
object._edition = object._defaultEdition;
|
|
3593
|
+
}
|
|
3594
|
+
}
|
|
3595
|
+
|
|
3596
|
+
this._needsRecursiveFeatureResolution = true;
|
|
3597
|
+
this._needsRecursiveResolve = true;
|
|
3598
|
+
|
|
3599
|
+
// Also clear parent caches, since they need to recurse down.
|
|
3600
|
+
var parent = this;
|
|
3601
|
+
while(parent = parent.parent) {
|
|
3602
|
+
parent._needsRecursiveFeatureResolution = true;
|
|
3603
|
+
parent._needsRecursiveResolve = true;
|
|
3604
|
+
}
|
|
3605
|
+
|
|
3458
3606
|
object.onAdd(this);
|
|
3459
3607
|
return clearCache(this);
|
|
3460
3608
|
};
|
|
@@ -3516,13 +3664,35 @@ Namespace.prototype.define = function define(path, json) {
|
|
|
3516
3664
|
* @returns {Namespace} `this`
|
|
3517
3665
|
*/
|
|
3518
3666
|
Namespace.prototype.resolveAll = function resolveAll() {
|
|
3667
|
+
if (!this._needsRecursiveResolve) return this;
|
|
3668
|
+
|
|
3669
|
+
this._resolveFeaturesRecursive(this._edition);
|
|
3670
|
+
|
|
3519
3671
|
var nested = this.nestedArray, i = 0;
|
|
3672
|
+
this.resolve();
|
|
3520
3673
|
while (i < nested.length)
|
|
3521
3674
|
if (nested[i] instanceof Namespace)
|
|
3522
3675
|
nested[i++].resolveAll();
|
|
3523
3676
|
else
|
|
3524
3677
|
nested[i++].resolve();
|
|
3525
|
-
|
|
3678
|
+
this._needsRecursiveResolve = false;
|
|
3679
|
+
return this;
|
|
3680
|
+
};
|
|
3681
|
+
|
|
3682
|
+
/**
|
|
3683
|
+
* @override
|
|
3684
|
+
*/
|
|
3685
|
+
Namespace.prototype._resolveFeaturesRecursive = function _resolveFeaturesRecursive(edition) {
|
|
3686
|
+
if (!this._needsRecursiveFeatureResolution) return this;
|
|
3687
|
+
this._needsRecursiveFeatureResolution = false;
|
|
3688
|
+
|
|
3689
|
+
edition = this._edition || edition;
|
|
3690
|
+
|
|
3691
|
+
ReflectionObject.prototype._resolveFeaturesRecursive.call(this, edition);
|
|
3692
|
+
this.nestedArray.forEach(nested => {
|
|
3693
|
+
nested._resolveFeaturesRecursive(edition);
|
|
3694
|
+
});
|
|
3695
|
+
return this;
|
|
3526
3696
|
};
|
|
3527
3697
|
|
|
3528
3698
|
/**
|
|
@@ -3533,7 +3703,6 @@ Namespace.prototype.resolveAll = function resolveAll() {
|
|
|
3533
3703
|
* @returns {ReflectionObject|null} Looked up object or `null` if none could be found
|
|
3534
3704
|
*/
|
|
3535
3705
|
Namespace.prototype.lookup = function lookup(path, filterTypes, parentAlreadyChecked) {
|
|
3536
|
-
|
|
3537
3706
|
/* istanbul ignore next */
|
|
3538
3707
|
if (typeof filterTypes === "boolean") {
|
|
3539
3708
|
parentAlreadyChecked = filterTypes;
|
|
@@ -3548,29 +3717,72 @@ Namespace.prototype.lookup = function lookup(path, filterTypes, parentAlreadyChe
|
|
|
3548
3717
|
} else if (!path.length)
|
|
3549
3718
|
return this;
|
|
3550
3719
|
|
|
3720
|
+
var flatPath = path.join(".");
|
|
3721
|
+
|
|
3551
3722
|
// Start at root if path is absolute
|
|
3552
3723
|
if (path[0] === "")
|
|
3553
3724
|
return this.root.lookup(path.slice(1), filterTypes);
|
|
3554
3725
|
|
|
3726
|
+
// Early bailout for objects with matching absolute paths
|
|
3727
|
+
var found = this.root._fullyQualifiedObjects && this.root._fullyQualifiedObjects["." + flatPath];
|
|
3728
|
+
if (found && (!filterTypes || filterTypes.indexOf(found.constructor) > -1)) {
|
|
3729
|
+
return found;
|
|
3730
|
+
}
|
|
3731
|
+
|
|
3732
|
+
// Do a regular lookup at this namespace and below
|
|
3733
|
+
found = this._lookupImpl(path, flatPath);
|
|
3734
|
+
if (found && (!filterTypes || filterTypes.indexOf(found.constructor) > -1)) {
|
|
3735
|
+
return found;
|
|
3736
|
+
}
|
|
3737
|
+
|
|
3738
|
+
if (parentAlreadyChecked)
|
|
3739
|
+
return null;
|
|
3740
|
+
|
|
3741
|
+
// If there hasn't been a match, walk up the tree and look more broadly
|
|
3742
|
+
var current = this;
|
|
3743
|
+
while (current.parent) {
|
|
3744
|
+
found = current.parent._lookupImpl(path, flatPath);
|
|
3745
|
+
if (found && (!filterTypes || filterTypes.indexOf(found.constructor) > -1)) {
|
|
3746
|
+
return found;
|
|
3747
|
+
}
|
|
3748
|
+
current = current.parent;
|
|
3749
|
+
}
|
|
3750
|
+
return null;
|
|
3751
|
+
};
|
|
3752
|
+
|
|
3753
|
+
/**
|
|
3754
|
+
* Internal helper for lookup that handles searching just at this namespace and below along with caching.
|
|
3755
|
+
* @param {string[]} path Path to look up
|
|
3756
|
+
* @param {string} flatPath Flattened version of the path to use as a cache key
|
|
3757
|
+
* @returns {ReflectionObject|null} Looked up object or `null` if none could be found
|
|
3758
|
+
* @private
|
|
3759
|
+
*/
|
|
3760
|
+
Namespace.prototype._lookupImpl = function lookup(path, flatPath) {
|
|
3761
|
+
if(Object.prototype.hasOwnProperty.call(this._lookupCache, flatPath)) {
|
|
3762
|
+
return this._lookupCache[flatPath];
|
|
3763
|
+
}
|
|
3764
|
+
|
|
3555
3765
|
// Test if the first part matches any nested object, and if so, traverse if path contains more
|
|
3556
3766
|
var found = this.get(path[0]);
|
|
3767
|
+
var exact = null;
|
|
3557
3768
|
if (found) {
|
|
3558
3769
|
if (path.length === 1) {
|
|
3559
|
-
|
|
3560
|
-
|
|
3561
|
-
|
|
3562
|
-
|
|
3770
|
+
exact = found;
|
|
3771
|
+
} else if (found instanceof Namespace) {
|
|
3772
|
+
path = path.slice(1);
|
|
3773
|
+
exact = found._lookupImpl(path, path.join("."));
|
|
3774
|
+
}
|
|
3563
3775
|
|
|
3564
3776
|
// Otherwise try each nested namespace
|
|
3565
|
-
} else
|
|
3777
|
+
} else {
|
|
3566
3778
|
for (var i = 0; i < this.nestedArray.length; ++i)
|
|
3567
|
-
if (this._nestedArray[i] instanceof Namespace && (found = this._nestedArray[i].
|
|
3568
|
-
|
|
3779
|
+
if (this._nestedArray[i] instanceof Namespace && (found = this._nestedArray[i]._lookupImpl(path, flatPath)))
|
|
3780
|
+
exact = found;
|
|
3781
|
+
}
|
|
3569
3782
|
|
|
3570
|
-
//
|
|
3571
|
-
|
|
3572
|
-
|
|
3573
|
-
return this.parent.lookup(path, filterTypes);
|
|
3783
|
+
// Set this even when null, so that when we walk up the tree we can quickly bail on repeated checks back down.
|
|
3784
|
+
this._lookupCache[flatPath] = exact;
|
|
3785
|
+
return exact;
|
|
3574
3786
|
};
|
|
3575
3787
|
|
|
3576
3788
|
/**
|
|
@@ -3653,10 +3865,17 @@ module.exports = ReflectionObject;
|
|
|
3653
3865
|
|
|
3654
3866
|
ReflectionObject.className = "ReflectionObject";
|
|
3655
3867
|
|
|
3868
|
+
const OneOf = require(25);
|
|
3656
3869
|
var util = require(37);
|
|
3657
3870
|
|
|
3658
3871
|
var Root; // cyclic
|
|
3659
3872
|
|
|
3873
|
+
/* eslint-disable no-warning-comments */
|
|
3874
|
+
// TODO: Replace with embedded proto.
|
|
3875
|
+
var editions2023Defaults = {enum_type: "OPEN", field_presence: "EXPLICIT", json_format: "ALLOW", message_encoding: "LENGTH_PREFIXED", repeated_field_encoding: "PACKED", utf8_validation: "VERIFY"};
|
|
3876
|
+
var proto2Defaults = {enum_type: "CLOSED", field_presence: "EXPLICIT", json_format: "LEGACY_BEST_EFFORT", message_encoding: "LENGTH_PREFIXED", repeated_field_encoding: "EXPANDED", utf8_validation: "NONE"};
|
|
3877
|
+
var proto3Defaults = {enum_type: "OPEN", field_presence: "IMPLICIT", json_format: "ALLOW", message_encoding: "LENGTH_PREFIXED", repeated_field_encoding: "PACKED", utf8_validation: "VERIFY"};
|
|
3878
|
+
|
|
3660
3879
|
/**
|
|
3661
3880
|
* Constructs a new reflection object instance.
|
|
3662
3881
|
* @classdesc Base class of all reflection objects.
|
|
@@ -3691,6 +3910,35 @@ function ReflectionObject(name, options) {
|
|
|
3691
3910
|
*/
|
|
3692
3911
|
this.name = name;
|
|
3693
3912
|
|
|
3913
|
+
/**
|
|
3914
|
+
* The edition specified for this object. Only relevant for top-level objects.
|
|
3915
|
+
* @type {string}
|
|
3916
|
+
* @private
|
|
3917
|
+
*/
|
|
3918
|
+
this._edition = null;
|
|
3919
|
+
|
|
3920
|
+
/**
|
|
3921
|
+
* The default edition to use for this object if none is specified. For legacy reasons,
|
|
3922
|
+
* this is proto2 except in the JSON parsing case where it was proto3.
|
|
3923
|
+
* @type {string}
|
|
3924
|
+
* @private
|
|
3925
|
+
*/
|
|
3926
|
+
this._defaultEdition = "proto2";
|
|
3927
|
+
|
|
3928
|
+
/**
|
|
3929
|
+
* Resolved Features.
|
|
3930
|
+
* @type {object}
|
|
3931
|
+
* @private
|
|
3932
|
+
*/
|
|
3933
|
+
this._features = {};
|
|
3934
|
+
|
|
3935
|
+
/**
|
|
3936
|
+
* Whether or not features have been resolved.
|
|
3937
|
+
* @type {boolean}
|
|
3938
|
+
* @private
|
|
3939
|
+
*/
|
|
3940
|
+
this._featuresResolved = false;
|
|
3941
|
+
|
|
3694
3942
|
/**
|
|
3695
3943
|
* Parent namespace.
|
|
3696
3944
|
* @type {Namespace|null}
|
|
@@ -3801,6 +4049,83 @@ ReflectionObject.prototype.resolve = function resolve() {
|
|
|
3801
4049
|
return this;
|
|
3802
4050
|
};
|
|
3803
4051
|
|
|
4052
|
+
/**
|
|
4053
|
+
* Resolves this objects editions features.
|
|
4054
|
+
* @param {string} edition The edition we're currently resolving for.
|
|
4055
|
+
* @returns {ReflectionObject} `this`
|
|
4056
|
+
*/
|
|
4057
|
+
ReflectionObject.prototype._resolveFeaturesRecursive = function _resolveFeaturesRecursive(edition) {
|
|
4058
|
+
return this._resolveFeatures(this._edition || edition);
|
|
4059
|
+
};
|
|
4060
|
+
|
|
4061
|
+
/**
|
|
4062
|
+
* Resolves child features from parent features
|
|
4063
|
+
* @param {string} edition The edition we're currently resolving for.
|
|
4064
|
+
* @returns {undefined}
|
|
4065
|
+
*/
|
|
4066
|
+
ReflectionObject.prototype._resolveFeatures = function _resolveFeatures(edition) {
|
|
4067
|
+
if (this._featuresResolved) {
|
|
4068
|
+
return;
|
|
4069
|
+
}
|
|
4070
|
+
|
|
4071
|
+
var defaults = {};
|
|
4072
|
+
|
|
4073
|
+
/* istanbul ignore if */
|
|
4074
|
+
if (!edition) {
|
|
4075
|
+
throw new Error("Unknown edition for " + this.fullName);
|
|
4076
|
+
}
|
|
4077
|
+
|
|
4078
|
+
var protoFeatures = Object.assign(this.options ? Object.assign({}, this.options.features) : {},
|
|
4079
|
+
this._inferLegacyProtoFeatures(edition));
|
|
4080
|
+
|
|
4081
|
+
if (this._edition) {
|
|
4082
|
+
// For a namespace marked with a specific edition, reset defaults.
|
|
4083
|
+
/* istanbul ignore else */
|
|
4084
|
+
if (edition === "proto2") {
|
|
4085
|
+
defaults = Object.assign({}, proto2Defaults);
|
|
4086
|
+
} else if (edition === "proto3") {
|
|
4087
|
+
defaults = Object.assign({}, proto3Defaults);
|
|
4088
|
+
} else if (edition === "2023") {
|
|
4089
|
+
defaults = Object.assign({}, editions2023Defaults);
|
|
4090
|
+
} else {
|
|
4091
|
+
throw new Error("Unknown edition: " + edition);
|
|
4092
|
+
}
|
|
4093
|
+
this._features = Object.assign(defaults, protoFeatures || {});
|
|
4094
|
+
this._featuresResolved = true;
|
|
4095
|
+
return;
|
|
4096
|
+
}
|
|
4097
|
+
|
|
4098
|
+
// fields in Oneofs aren't actually children of them, so we have to
|
|
4099
|
+
// special-case it
|
|
4100
|
+
/* istanbul ignore else */
|
|
4101
|
+
if (this.partOf instanceof OneOf) {
|
|
4102
|
+
var lexicalParentFeaturesCopy = Object.assign({}, this.partOf._features);
|
|
4103
|
+
this._features = Object.assign(lexicalParentFeaturesCopy, protoFeatures || {});
|
|
4104
|
+
} else if (this.declaringField) {
|
|
4105
|
+
// Skip feature resolution of sister fields.
|
|
4106
|
+
} else if (this.parent) {
|
|
4107
|
+
var parentFeaturesCopy = Object.assign({}, this.parent._features);
|
|
4108
|
+
this._features = Object.assign(parentFeaturesCopy, protoFeatures || {});
|
|
4109
|
+
} else {
|
|
4110
|
+
throw new Error("Unable to find a parent for " + this.fullName);
|
|
4111
|
+
}
|
|
4112
|
+
if (this.extensionField) {
|
|
4113
|
+
// Sister fields should have the same features as their extensions.
|
|
4114
|
+
this.extensionField._features = this._features;
|
|
4115
|
+
}
|
|
4116
|
+
this._featuresResolved = true;
|
|
4117
|
+
};
|
|
4118
|
+
|
|
4119
|
+
/**
|
|
4120
|
+
* Infers features from legacy syntax that may have been specified differently.
|
|
4121
|
+
* in older editions.
|
|
4122
|
+
* @param {string|undefined} edition The edition this proto is on, or undefined if pre-editions
|
|
4123
|
+
* @returns {object} The feature values to override
|
|
4124
|
+
*/
|
|
4125
|
+
ReflectionObject.prototype._inferLegacyProtoFeatures = function _inferLegacyProtoFeatures(/*edition*/) {
|
|
4126
|
+
return {};
|
|
4127
|
+
};
|
|
4128
|
+
|
|
3804
4129
|
/**
|
|
3805
4130
|
* Gets an option value.
|
|
3806
4131
|
* @param {string} name Option name
|
|
@@ -3816,12 +4141,19 @@ ReflectionObject.prototype.getOption = function getOption(name) {
|
|
|
3816
4141
|
* Sets an option.
|
|
3817
4142
|
* @param {string} name Option name
|
|
3818
4143
|
* @param {*} value Option value
|
|
3819
|
-
* @param {boolean} [ifNotSet] Sets the option only if it isn't currently set
|
|
4144
|
+
* @param {boolean|undefined} [ifNotSet] Sets the option only if it isn't currently set
|
|
3820
4145
|
* @returns {ReflectionObject} `this`
|
|
3821
4146
|
*/
|
|
3822
4147
|
ReflectionObject.prototype.setOption = function setOption(name, value, ifNotSet) {
|
|
3823
|
-
if (!
|
|
3824
|
-
|
|
4148
|
+
if (!this.options)
|
|
4149
|
+
this.options = {};
|
|
4150
|
+
if (/^features\./.test(name)) {
|
|
4151
|
+
util.setProperty(this.options, name, value, ifNotSet);
|
|
4152
|
+
} else if (!ifNotSet || this.options[name] === undefined) {
|
|
4153
|
+
if (this.getOption(name) !== value) this.resolved = false;
|
|
4154
|
+
this.options[name] = value;
|
|
4155
|
+
}
|
|
4156
|
+
|
|
3825
4157
|
return this;
|
|
3826
4158
|
};
|
|
3827
4159
|
|
|
@@ -3845,10 +4177,11 @@ ReflectionObject.prototype.setParsedOption = function setParsedOption(name, valu
|
|
|
3845
4177
|
});
|
|
3846
4178
|
if (opt) {
|
|
3847
4179
|
// If we found an existing option - just merge the property value
|
|
4180
|
+
// (If it's a feature, will just write over)
|
|
3848
4181
|
var newValue = opt[name];
|
|
3849
4182
|
util.setProperty(newValue, propName, value);
|
|
3850
4183
|
} else {
|
|
3851
|
-
// otherwise, create a new option, set
|
|
4184
|
+
// otherwise, create a new option, set its property and add it to the list
|
|
3852
4185
|
opt = {};
|
|
3853
4186
|
opt[name] = util.setProperty({}, propName, value);
|
|
3854
4187
|
parsedOptions.push(opt);
|
|
@@ -3859,6 +4192,7 @@ ReflectionObject.prototype.setParsedOption = function setParsedOption(name, valu
|
|
|
3859
4192
|
newOpt[name] = value;
|
|
3860
4193
|
parsedOptions.push(newOpt);
|
|
3861
4194
|
}
|
|
4195
|
+
|
|
3862
4196
|
return this;
|
|
3863
4197
|
};
|
|
3864
4198
|
|
|
@@ -3887,12 +4221,25 @@ ReflectionObject.prototype.toString = function toString() {
|
|
|
3887
4221
|
return className;
|
|
3888
4222
|
};
|
|
3889
4223
|
|
|
4224
|
+
/**
|
|
4225
|
+
* Converts the edition this object is pinned to for JSON format.
|
|
4226
|
+
* @returns {string|undefined} The edition string for JSON representation
|
|
4227
|
+
*/
|
|
4228
|
+
ReflectionObject.prototype._editionToJSON = function _editionToJSON() {
|
|
4229
|
+
if (!this._edition || this._edition === "proto3") {
|
|
4230
|
+
// Avoid emitting proto3 since we need to default to it for backwards
|
|
4231
|
+
// compatibility anyway.
|
|
4232
|
+
return undefined;
|
|
4233
|
+
}
|
|
4234
|
+
return this._edition;
|
|
4235
|
+
};
|
|
4236
|
+
|
|
3890
4237
|
// Sets up cyclic dependencies (called in index-light)
|
|
3891
4238
|
ReflectionObject._configure = function(Root_) {
|
|
3892
4239
|
Root = Root_;
|
|
3893
4240
|
};
|
|
3894
4241
|
|
|
3895
|
-
},{"37":37}],25:[function(require,module,exports){
|
|
4242
|
+
},{"25":25,"37":37}],25:[function(require,module,exports){
|
|
3896
4243
|
"use strict";
|
|
3897
4244
|
module.exports = OneOf;
|
|
3898
4245
|
|
|
@@ -4066,6 +4413,25 @@ OneOf.prototype.onRemove = function onRemove(parent) {
|
|
|
4066
4413
|
ReflectionObject.prototype.onRemove.call(this, parent);
|
|
4067
4414
|
};
|
|
4068
4415
|
|
|
4416
|
+
/**
|
|
4417
|
+
* Determines whether this field corresponds to a synthetic oneof created for
|
|
4418
|
+
* a proto3 optional field. No behavioral logic should depend on this, but it
|
|
4419
|
+
* can be relevant for reflection.
|
|
4420
|
+
* @name OneOf#isProto3Optional
|
|
4421
|
+
* @type {boolean}
|
|
4422
|
+
* @readonly
|
|
4423
|
+
*/
|
|
4424
|
+
Object.defineProperty(OneOf.prototype, "isProto3Optional", {
|
|
4425
|
+
get: function() {
|
|
4426
|
+
if (this.fieldsArray == null || this.fieldsArray.length !== 1) {
|
|
4427
|
+
return false;
|
|
4428
|
+
}
|
|
4429
|
+
|
|
4430
|
+
var field = this.fieldsArray[0];
|
|
4431
|
+
return field.options != null && field.options["proto3_optional"] === true;
|
|
4432
|
+
}
|
|
4433
|
+
});
|
|
4434
|
+
|
|
4069
4435
|
/**
|
|
4070
4436
|
* Decorator function as returned by {@link OneOf.d} (TypeScript).
|
|
4071
4437
|
* @typedef OneOfDecorator
|
|
@@ -4113,6 +4479,7 @@ var tokenize = require(34),
|
|
|
4113
4479
|
Enum = require(15),
|
|
4114
4480
|
Service = require(33),
|
|
4115
4481
|
Method = require(22),
|
|
4482
|
+
ReflectionObject = require(24),
|
|
4116
4483
|
types = require(36),
|
|
4117
4484
|
util = require(37);
|
|
4118
4485
|
|
|
@@ -4124,8 +4491,7 @@ var base10Re = /^[1-9][0-9]*$/,
|
|
|
4124
4491
|
base8NegRe = /^-?0[0-7]+$/,
|
|
4125
4492
|
numberRe = /^(?![eE])[0-9]*(?:\.[0-9]*)?(?:[eE][+-]?[0-9]+)?$/,
|
|
4126
4493
|
nameRe = /^[a-zA-Z_][a-zA-Z_0-9]*$/,
|
|
4127
|
-
typeRefRe = /^(?:\.?[a-zA-Z_][a-zA-Z_0-9]*)(?:\.[a-zA-Z_][a-zA-Z_0-9]*)
|
|
4128
|
-
fqTypeRefRe = /^(?:\.[a-zA-Z_][a-zA-Z_0-9]*)+$/;
|
|
4494
|
+
typeRefRe = /^(?:\.?[a-zA-Z_][a-zA-Z_0-9]*)(?:\.[a-zA-Z_][a-zA-Z_0-9]*)*$/;
|
|
4129
4495
|
|
|
4130
4496
|
/**
|
|
4131
4497
|
* Result object returned from {@link parse}.
|
|
@@ -4133,7 +4499,6 @@ var base10Re = /^[1-9][0-9]*$/,
|
|
|
4133
4499
|
* @property {string|undefined} package Package name, if declared
|
|
4134
4500
|
* @property {string[]|undefined} imports Imports, if any
|
|
4135
4501
|
* @property {string[]|undefined} weakImports Weak imports, if any
|
|
4136
|
-
* @property {string|undefined} syntax Syntax, if specified (either `"proto2"` or `"proto3"`)
|
|
4137
4502
|
* @property {Root} root Populated root instance
|
|
4138
4503
|
*/
|
|
4139
4504
|
|
|
@@ -4181,13 +4546,25 @@ function parse(source, root, options) {
|
|
|
4181
4546
|
pkg,
|
|
4182
4547
|
imports,
|
|
4183
4548
|
weakImports,
|
|
4184
|
-
|
|
4185
|
-
isProto3 = false;
|
|
4549
|
+
edition = "proto2";
|
|
4186
4550
|
|
|
4187
4551
|
var ptr = root;
|
|
4188
4552
|
|
|
4553
|
+
var topLevelObjects = [];
|
|
4554
|
+
var topLevelOptions = {};
|
|
4555
|
+
|
|
4189
4556
|
var applyCase = options.keepCase ? function(name) { return name; } : util.camelCase;
|
|
4190
4557
|
|
|
4558
|
+
function resolveFileFeatures() {
|
|
4559
|
+
topLevelObjects.forEach(obj => {
|
|
4560
|
+
obj._edition = edition;
|
|
4561
|
+
Object.keys(topLevelOptions).forEach(opt => {
|
|
4562
|
+
if (obj.getOption(opt) !== undefined) return;
|
|
4563
|
+
obj.setOption(opt, topLevelOptions[opt], true);
|
|
4564
|
+
});
|
|
4565
|
+
});
|
|
4566
|
+
}
|
|
4567
|
+
|
|
4191
4568
|
/* istanbul ignore next */
|
|
4192
4569
|
function illegal(token, name, insideTryCatch) {
|
|
4193
4570
|
var filename = parse.filename;
|
|
@@ -4226,7 +4603,6 @@ function parse(source, root, options) {
|
|
|
4226
4603
|
try {
|
|
4227
4604
|
return parseNumber(token, /* insideTryCatch */ true);
|
|
4228
4605
|
} catch (e) {
|
|
4229
|
-
|
|
4230
4606
|
/* istanbul ignore else */
|
|
4231
4607
|
if (acceptTypeRef && typeRefRe.test(token))
|
|
4232
4608
|
return token;
|
|
@@ -4239,10 +4615,23 @@ function parse(source, root, options) {
|
|
|
4239
4615
|
function readRanges(target, acceptStrings) {
|
|
4240
4616
|
var token, start;
|
|
4241
4617
|
do {
|
|
4242
|
-
if (acceptStrings && ((token = peek()) === "\"" || token === "'"))
|
|
4243
|
-
|
|
4244
|
-
|
|
4245
|
-
|
|
4618
|
+
if (acceptStrings && ((token = peek()) === "\"" || token === "'")) {
|
|
4619
|
+
var str = readString();
|
|
4620
|
+
target.push(str);
|
|
4621
|
+
if (edition >= 2023) {
|
|
4622
|
+
throw illegal(str, "id");
|
|
4623
|
+
}
|
|
4624
|
+
} else {
|
|
4625
|
+
try {
|
|
4626
|
+
target.push([ start = parseId(next()), skip("to", true) ? parseId(next()) : start ]);
|
|
4627
|
+
} catch (err) {
|
|
4628
|
+
if (acceptStrings && typeRefRe.test(token) && edition >= 2023) {
|
|
4629
|
+
target.push(token);
|
|
4630
|
+
} else {
|
|
4631
|
+
throw err;
|
|
4632
|
+
}
|
|
4633
|
+
}
|
|
4634
|
+
}
|
|
4246
4635
|
} while (skip(",", true));
|
|
4247
4636
|
var dummy = {options: undefined};
|
|
4248
4637
|
dummy.setOption = function(name, value) {
|
|
@@ -4319,7 +4708,6 @@ function parse(source, root, options) {
|
|
|
4319
4708
|
}
|
|
4320
4709
|
|
|
4321
4710
|
function parsePackage() {
|
|
4322
|
-
|
|
4323
4711
|
/* istanbul ignore if */
|
|
4324
4712
|
if (pkg !== undefined)
|
|
4325
4713
|
throw illegal("package");
|
|
@@ -4331,6 +4719,7 @@ function parse(source, root, options) {
|
|
|
4331
4719
|
throw illegal(pkg, "name");
|
|
4332
4720
|
|
|
4333
4721
|
ptr = ptr.define(pkg);
|
|
4722
|
+
|
|
4334
4723
|
skip(";");
|
|
4335
4724
|
}
|
|
4336
4725
|
|
|
@@ -4356,20 +4745,28 @@ function parse(source, root, options) {
|
|
|
4356
4745
|
|
|
4357
4746
|
function parseSyntax() {
|
|
4358
4747
|
skip("=");
|
|
4359
|
-
|
|
4360
|
-
isProto3 = syntax === "proto3";
|
|
4748
|
+
edition = readString();
|
|
4361
4749
|
|
|
4362
4750
|
/* istanbul ignore if */
|
|
4363
|
-
if (
|
|
4364
|
-
throw illegal(
|
|
4751
|
+
if (edition < 2023)
|
|
4752
|
+
throw illegal(edition, "syntax");
|
|
4365
4753
|
|
|
4366
|
-
|
|
4367
|
-
|
|
4368
|
-
|
|
4754
|
+
skip(";");
|
|
4755
|
+
}
|
|
4756
|
+
|
|
4757
|
+
function parseEdition() {
|
|
4758
|
+
skip("=");
|
|
4759
|
+
edition = readString();
|
|
4760
|
+
const supportedEditions = ["2023"];
|
|
4761
|
+
|
|
4762
|
+
/* istanbul ignore if */
|
|
4763
|
+
if (!supportedEditions.includes(edition))
|
|
4764
|
+
throw illegal(edition, "edition");
|
|
4369
4765
|
|
|
4370
4766
|
skip(";");
|
|
4371
4767
|
}
|
|
4372
4768
|
|
|
4769
|
+
|
|
4373
4770
|
function parseCommon(parent, token) {
|
|
4374
4771
|
switch (token) {
|
|
4375
4772
|
|
|
@@ -4437,14 +4834,19 @@ function parse(source, root, options) {
|
|
|
4437
4834
|
break;
|
|
4438
4835
|
|
|
4439
4836
|
case "required":
|
|
4837
|
+
if (edition !== "proto2")
|
|
4838
|
+
throw illegal(token);
|
|
4839
|
+
/* eslint-disable no-fallthrough */
|
|
4440
4840
|
case "repeated":
|
|
4441
4841
|
parseField(type, token);
|
|
4442
4842
|
break;
|
|
4443
4843
|
|
|
4444
4844
|
case "optional":
|
|
4445
4845
|
/* istanbul ignore if */
|
|
4446
|
-
if (
|
|
4846
|
+
if (edition === "proto3") {
|
|
4447
4847
|
parseField(type, "proto3_optional");
|
|
4848
|
+
} else if (edition !== "proto2") {
|
|
4849
|
+
throw illegal(token);
|
|
4448
4850
|
} else {
|
|
4449
4851
|
parseField(type, "optional");
|
|
4450
4852
|
}
|
|
@@ -4464,8 +4866,9 @@ function parse(source, root, options) {
|
|
|
4464
4866
|
|
|
4465
4867
|
default:
|
|
4466
4868
|
/* istanbul ignore if */
|
|
4467
|
-
if (
|
|
4869
|
+
if (edition === "proto2" || !typeRefRe.test(token)) {
|
|
4468
4870
|
throw illegal(token);
|
|
4871
|
+
}
|
|
4469
4872
|
|
|
4470
4873
|
push(token);
|
|
4471
4874
|
parseField(type, "optional");
|
|
@@ -4473,6 +4876,9 @@ function parse(source, root, options) {
|
|
|
4473
4876
|
}
|
|
4474
4877
|
});
|
|
4475
4878
|
parent.add(type);
|
|
4879
|
+
if (parent === ptr) {
|
|
4880
|
+
topLevelObjects.push(type);
|
|
4881
|
+
}
|
|
4476
4882
|
}
|
|
4477
4883
|
|
|
4478
4884
|
function parseField(parent, rule, extend) {
|
|
@@ -4499,6 +4905,7 @@ function parse(source, root, options) {
|
|
|
4499
4905
|
var name = next();
|
|
4500
4906
|
|
|
4501
4907
|
/* istanbul ignore if */
|
|
4908
|
+
|
|
4502
4909
|
if (!nameRe.test(name))
|
|
4503
4910
|
throw illegal(name, "name");
|
|
4504
4911
|
|
|
@@ -4506,6 +4913,7 @@ function parse(source, root, options) {
|
|
|
4506
4913
|
skip("=");
|
|
4507
4914
|
|
|
4508
4915
|
var field = new Field(name, parseId(next()), type, rule, extend);
|
|
4916
|
+
|
|
4509
4917
|
ifBlock(field, function parseField_block(token) {
|
|
4510
4918
|
|
|
4511
4919
|
/* istanbul ignore else */
|
|
@@ -4528,15 +4936,15 @@ function parse(source, root, options) {
|
|
|
4528
4936
|
} else {
|
|
4529
4937
|
parent.add(field);
|
|
4530
4938
|
}
|
|
4531
|
-
|
|
4532
|
-
|
|
4533
|
-
|
|
4534
|
-
// all known packable types and anything that could be an enum (= is not a basic type).
|
|
4535
|
-
if (!isProto3 && field.repeated && (types.packed[type] !== undefined || types.basic[type] === undefined))
|
|
4536
|
-
field.setOption("packed", false, /* ifNotSet */ true);
|
|
4939
|
+
if (parent === ptr) {
|
|
4940
|
+
topLevelObjects.push(field);
|
|
4941
|
+
}
|
|
4537
4942
|
}
|
|
4538
4943
|
|
|
4539
4944
|
function parseGroup(parent, rule) {
|
|
4945
|
+
if (edition >= 2023) {
|
|
4946
|
+
throw illegal("group");
|
|
4947
|
+
}
|
|
4540
4948
|
var name = next();
|
|
4541
4949
|
|
|
4542
4950
|
/* istanbul ignore if */
|
|
@@ -4559,7 +4967,6 @@ function parse(source, root, options) {
|
|
|
4559
4967
|
parseOption(type, token);
|
|
4560
4968
|
skip(";");
|
|
4561
4969
|
break;
|
|
4562
|
-
|
|
4563
4970
|
case "required":
|
|
4564
4971
|
case "repeated":
|
|
4565
4972
|
parseField(type, token);
|
|
@@ -4567,7 +4974,7 @@ function parse(source, root, options) {
|
|
|
4567
4974
|
|
|
4568
4975
|
case "optional":
|
|
4569
4976
|
/* istanbul ignore if */
|
|
4570
|
-
if (
|
|
4977
|
+
if (edition === "proto3") {
|
|
4571
4978
|
parseField(type, "proto3_optional");
|
|
4572
4979
|
} else {
|
|
4573
4980
|
parseField(type, "optional");
|
|
@@ -4582,6 +4989,10 @@ function parse(source, root, options) {
|
|
|
4582
4989
|
parseEnum(type, token);
|
|
4583
4990
|
break;
|
|
4584
4991
|
|
|
4992
|
+
case "reserved":
|
|
4993
|
+
readRanges(type.reserved || (type.reserved = []), true);
|
|
4994
|
+
break;
|
|
4995
|
+
|
|
4585
4996
|
/* istanbul ignore next */
|
|
4586
4997
|
default:
|
|
4587
4998
|
throw illegal(token); // there are no groups with proto3 semantics
|
|
@@ -4665,6 +5076,7 @@ function parse(source, root, options) {
|
|
|
4665
5076
|
|
|
4666
5077
|
case "reserved":
|
|
4667
5078
|
readRanges(enm.reserved || (enm.reserved = []), true);
|
|
5079
|
+
if(enm.reserved === undefined) enm.reserved = [];
|
|
4668
5080
|
break;
|
|
4669
5081
|
|
|
4670
5082
|
default:
|
|
@@ -4672,6 +5084,9 @@ function parse(source, root, options) {
|
|
|
4672
5084
|
}
|
|
4673
5085
|
});
|
|
4674
5086
|
parent.add(enm);
|
|
5087
|
+
if (parent === ptr) {
|
|
5088
|
+
topLevelObjects.push(enm);
|
|
5089
|
+
}
|
|
4675
5090
|
}
|
|
4676
5091
|
|
|
4677
5092
|
function parseEnumValue(parent, token) {
|
|
@@ -4685,10 +5100,14 @@ function parse(source, root, options) {
|
|
|
4685
5100
|
dummy = {
|
|
4686
5101
|
options: undefined
|
|
4687
5102
|
};
|
|
5103
|
+
dummy.getOption = function(name) {
|
|
5104
|
+
return this.options[name];
|
|
5105
|
+
};
|
|
4688
5106
|
dummy.setOption = function(name, value) {
|
|
4689
|
-
|
|
4690
|
-
|
|
4691
|
-
|
|
5107
|
+
ReflectionObject.prototype.setOption.call(dummy, name, value);
|
|
5108
|
+
};
|
|
5109
|
+
dummy.setParsedOption = function() {
|
|
5110
|
+
return undefined;
|
|
4692
5111
|
};
|
|
4693
5112
|
ifBlock(dummy, function parseEnumValue_block(token) {
|
|
4694
5113
|
|
|
@@ -4702,34 +5121,42 @@ function parse(source, root, options) {
|
|
|
4702
5121
|
}, function parseEnumValue_line() {
|
|
4703
5122
|
parseInlineOptions(dummy); // skip
|
|
4704
5123
|
});
|
|
4705
|
-
parent.add(token, value, dummy.comment, dummy.options);
|
|
5124
|
+
parent.add(token, value, dummy.comment, dummy.parsedOptions || dummy.options);
|
|
4706
5125
|
}
|
|
4707
5126
|
|
|
4708
5127
|
function parseOption(parent, token) {
|
|
4709
|
-
|
|
4710
|
-
|
|
4711
|
-
|
|
4712
|
-
|
|
4713
|
-
|
|
4714
|
-
|
|
4715
|
-
var name = token;
|
|
4716
|
-
var option = name;
|
|
4717
|
-
var propName;
|
|
5128
|
+
var option;
|
|
5129
|
+
var propName;
|
|
5130
|
+
var isOption = true;
|
|
5131
|
+
if (token === "option") {
|
|
5132
|
+
token = next();
|
|
5133
|
+
}
|
|
4718
5134
|
|
|
4719
|
-
|
|
4720
|
-
|
|
4721
|
-
|
|
4722
|
-
|
|
4723
|
-
|
|
4724
|
-
|
|
4725
|
-
|
|
4726
|
-
|
|
4727
|
-
|
|
5135
|
+
while (token !== "=") {
|
|
5136
|
+
if (token === "(") {
|
|
5137
|
+
var parensValue = next();
|
|
5138
|
+
skip(")");
|
|
5139
|
+
token = "(" + parensValue + ")";
|
|
5140
|
+
}
|
|
5141
|
+
if (isOption) {
|
|
5142
|
+
isOption = false;
|
|
5143
|
+
if (token.includes(".") && !token.includes("(")) {
|
|
5144
|
+
var tokens = token.split(".");
|
|
5145
|
+
option = tokens[0] + ".";
|
|
5146
|
+
token = tokens[1];
|
|
5147
|
+
continue;
|
|
5148
|
+
}
|
|
5149
|
+
option = token;
|
|
5150
|
+
} else {
|
|
5151
|
+
propName = propName ? propName += token : token;
|
|
5152
|
+
}
|
|
5153
|
+
token = next();
|
|
4728
5154
|
}
|
|
4729
|
-
|
|
4730
|
-
|
|
4731
|
-
|
|
4732
|
-
|
|
5155
|
+
var name = propName ? option.concat(propName) : option;
|
|
5156
|
+
var optionValue = parseOptionValue(parent, name);
|
|
5157
|
+
propName = propName && propName[0] === "." ? propName.slice(1) : propName;
|
|
5158
|
+
option = option && option[option.length - 1] === "." ? option.slice(0, -1) : option;
|
|
5159
|
+
setParsedOption(parent, option, optionValue, propName);
|
|
4733
5160
|
}
|
|
4734
5161
|
|
|
4735
5162
|
function parseOptionValue(parent, name) {
|
|
@@ -4751,12 +5178,12 @@ function parse(source, root, options) {
|
|
|
4751
5178
|
|
|
4752
5179
|
skip(":", true);
|
|
4753
5180
|
|
|
4754
|
-
if (peek() === "{")
|
|
4755
|
-
value = parseOptionValue(parent, name + "." + token);
|
|
4756
|
-
else if (peek() === "[") {
|
|
5181
|
+
if (peek() === "{") {
|
|
4757
5182
|
// option (my_option) = {
|
|
4758
5183
|
// repeated_value: [ "foo", "bar" ]
|
|
4759
5184
|
// };
|
|
5185
|
+
value = parseOptionValue(parent, name + "." + token);
|
|
5186
|
+
} else if (peek() === "[") {
|
|
4760
5187
|
value = [];
|
|
4761
5188
|
var lastValue;
|
|
4762
5189
|
if (skip("[", true)) {
|
|
@@ -4796,6 +5223,10 @@ function parse(source, root, options) {
|
|
|
4796
5223
|
}
|
|
4797
5224
|
|
|
4798
5225
|
function setOption(parent, name, value) {
|
|
5226
|
+
if (ptr === parent && /^features\./.test(name)) {
|
|
5227
|
+
topLevelOptions[name] = value;
|
|
5228
|
+
return;
|
|
5229
|
+
}
|
|
4799
5230
|
if (parent.setOption)
|
|
4800
5231
|
parent.setOption(name, value);
|
|
4801
5232
|
}
|
|
@@ -4823,8 +5254,9 @@ function parse(source, root, options) {
|
|
|
4823
5254
|
|
|
4824
5255
|
var service = new Service(token);
|
|
4825
5256
|
ifBlock(service, function parseService_block(token) {
|
|
4826
|
-
if (parseCommon(service, token))
|
|
5257
|
+
if (parseCommon(service, token)) {
|
|
4827
5258
|
return;
|
|
5259
|
+
}
|
|
4828
5260
|
|
|
4829
5261
|
/* istanbul ignore else */
|
|
4830
5262
|
if (token === "rpc")
|
|
@@ -4833,6 +5265,9 @@ function parse(source, root, options) {
|
|
|
4833
5265
|
throw illegal(token);
|
|
4834
5266
|
});
|
|
4835
5267
|
parent.add(service);
|
|
5268
|
+
if (parent === ptr) {
|
|
5269
|
+
topLevelObjects.push(service);
|
|
5270
|
+
}
|
|
4836
5271
|
}
|
|
4837
5272
|
|
|
4838
5273
|
function parseMethod(parent, token) {
|
|
@@ -4902,7 +5337,7 @@ function parse(source, root, options) {
|
|
|
4902
5337
|
|
|
4903
5338
|
case "optional":
|
|
4904
5339
|
/* istanbul ignore if */
|
|
4905
|
-
if (
|
|
5340
|
+
if (edition === "proto3") {
|
|
4906
5341
|
parseField(parent, "proto3_optional", reference);
|
|
4907
5342
|
} else {
|
|
4908
5343
|
parseField(parent, "optional", reference);
|
|
@@ -4911,7 +5346,7 @@ function parse(source, root, options) {
|
|
|
4911
5346
|
|
|
4912
5347
|
default:
|
|
4913
5348
|
/* istanbul ignore if */
|
|
4914
|
-
if (
|
|
5349
|
+
if (edition === "proto2" || !typeRefRe.test(token))
|
|
4915
5350
|
throw illegal(token);
|
|
4916
5351
|
push(token);
|
|
4917
5352
|
parseField(parent, "optional", reference);
|
|
@@ -4951,10 +5386,16 @@ function parse(source, root, options) {
|
|
|
4951
5386
|
parseSyntax();
|
|
4952
5387
|
break;
|
|
4953
5388
|
|
|
4954
|
-
case "
|
|
5389
|
+
case "edition":
|
|
5390
|
+
/* istanbul ignore if */
|
|
5391
|
+
if (!head)
|
|
5392
|
+
throw illegal(token);
|
|
5393
|
+
parseEdition();
|
|
5394
|
+
break;
|
|
4955
5395
|
|
|
5396
|
+
case "option":
|
|
4956
5397
|
parseOption(ptr, token);
|
|
4957
|
-
skip(";");
|
|
5398
|
+
skip(";", true);
|
|
4958
5399
|
break;
|
|
4959
5400
|
|
|
4960
5401
|
default:
|
|
@@ -4970,12 +5411,13 @@ function parse(source, root, options) {
|
|
|
4970
5411
|
}
|
|
4971
5412
|
}
|
|
4972
5413
|
|
|
5414
|
+
resolveFileFeatures();
|
|
5415
|
+
|
|
4973
5416
|
parse.filename = null;
|
|
4974
5417
|
return {
|
|
4975
5418
|
"package" : pkg,
|
|
4976
5419
|
"imports" : imports,
|
|
4977
5420
|
weakImports : weakImports,
|
|
4978
|
-
syntax : syntax,
|
|
4979
5421
|
root : root
|
|
4980
5422
|
};
|
|
4981
5423
|
}
|
|
@@ -4992,7 +5434,7 @@ function parse(source, root, options) {
|
|
|
4992
5434
|
* @variation 2
|
|
4993
5435
|
*/
|
|
4994
5436
|
|
|
4995
|
-
},{"15":15,"16":16,"20":20,"22":22,"25":25,"29":29,"33":33,"34":34,"35":35,"36":36,"37":37}],27:[function(require,module,exports){
|
|
5437
|
+
},{"15":15,"16":16,"20":20,"22":22,"24":24,"25":25,"29":29,"33":33,"34":34,"35":35,"36":36,"37":37}],27:[function(require,module,exports){
|
|
4996
5438
|
"use strict";
|
|
4997
5439
|
module.exports = Reader;
|
|
4998
5440
|
|
|
@@ -5501,11 +5943,25 @@ function Root(options) {
|
|
|
5501
5943
|
* @type {string[]}
|
|
5502
5944
|
*/
|
|
5503
5945
|
this.files = [];
|
|
5946
|
+
|
|
5947
|
+
/**
|
|
5948
|
+
* Edition, defaults to proto2 if unspecified.
|
|
5949
|
+
* @type {string}
|
|
5950
|
+
* @private
|
|
5951
|
+
*/
|
|
5952
|
+
this._edition = "proto2";
|
|
5953
|
+
|
|
5954
|
+
/**
|
|
5955
|
+
* Global lookup cache of fully qualified names.
|
|
5956
|
+
* @type {Object.<string,ReflectionObject>}
|
|
5957
|
+
* @private
|
|
5958
|
+
*/
|
|
5959
|
+
this._fullyQualifiedObjects = {};
|
|
5504
5960
|
}
|
|
5505
5961
|
|
|
5506
5962
|
/**
|
|
5507
5963
|
* Loads a namespace descriptor into a root namespace.
|
|
5508
|
-
* @param {INamespace} json
|
|
5964
|
+
* @param {INamespace} json Namespace descriptor
|
|
5509
5965
|
* @param {Root} [root] Root namespace, defaults to create a new one if omitted
|
|
5510
5966
|
* @returns {Root} Root namespace
|
|
5511
5967
|
*/
|
|
@@ -5514,7 +5970,7 @@ Root.fromJSON = function fromJSON(json, root) {
|
|
|
5514
5970
|
root = new Root();
|
|
5515
5971
|
if (json.options)
|
|
5516
5972
|
root.setOptions(json.options);
|
|
5517
|
-
return root.addJSON(json.nested);
|
|
5973
|
+
return root.addJSON(json.nested).resolveAll();
|
|
5518
5974
|
};
|
|
5519
5975
|
|
|
5520
5976
|
/**
|
|
@@ -5554,18 +6010,24 @@ Root.prototype.load = function load(filename, options, callback) {
|
|
|
5554
6010
|
options = undefined;
|
|
5555
6011
|
}
|
|
5556
6012
|
var self = this;
|
|
5557
|
-
if (!callback)
|
|
6013
|
+
if (!callback) {
|
|
5558
6014
|
return util.asPromise(load, self, filename, options);
|
|
6015
|
+
}
|
|
5559
6016
|
|
|
5560
6017
|
var sync = callback === SYNC; // undocumented
|
|
5561
6018
|
|
|
5562
6019
|
// Finishes loading by calling the callback (exactly once)
|
|
5563
6020
|
function finish(err, root) {
|
|
5564
6021
|
/* istanbul ignore if */
|
|
5565
|
-
if (!callback)
|
|
6022
|
+
if (!callback) {
|
|
5566
6023
|
return;
|
|
5567
|
-
|
|
6024
|
+
}
|
|
6025
|
+
if (sync) {
|
|
5568
6026
|
throw err;
|
|
6027
|
+
}
|
|
6028
|
+
if (root) {
|
|
6029
|
+
root.resolveAll();
|
|
6030
|
+
}
|
|
5569
6031
|
var cb = callback;
|
|
5570
6032
|
callback = null;
|
|
5571
6033
|
cb(err, root);
|
|
@@ -5605,8 +6067,9 @@ Root.prototype.load = function load(filename, options, callback) {
|
|
|
5605
6067
|
} catch (err) {
|
|
5606
6068
|
finish(err);
|
|
5607
6069
|
}
|
|
5608
|
-
if (!sync && !queued)
|
|
6070
|
+
if (!sync && !queued) {
|
|
5609
6071
|
finish(null, self); // only once anyway
|
|
6072
|
+
}
|
|
5610
6073
|
}
|
|
5611
6074
|
|
|
5612
6075
|
// Fetches a single file
|
|
@@ -5614,15 +6077,16 @@ Root.prototype.load = function load(filename, options, callback) {
|
|
|
5614
6077
|
filename = getBundledFileName(filename) || filename;
|
|
5615
6078
|
|
|
5616
6079
|
// Skip if already loaded / attempted
|
|
5617
|
-
if (self.files.indexOf(filename) > -1)
|
|
6080
|
+
if (self.files.indexOf(filename) > -1) {
|
|
5618
6081
|
return;
|
|
6082
|
+
}
|
|
5619
6083
|
self.files.push(filename);
|
|
5620
6084
|
|
|
5621
6085
|
// Shortcut bundled definitions
|
|
5622
6086
|
if (filename in common) {
|
|
5623
|
-
if (sync)
|
|
6087
|
+
if (sync) {
|
|
5624
6088
|
process(filename, common[filename]);
|
|
5625
|
-
else {
|
|
6089
|
+
} else {
|
|
5626
6090
|
++queued;
|
|
5627
6091
|
setTimeout(function() {
|
|
5628
6092
|
--queued;
|
|
@@ -5648,8 +6112,9 @@ Root.prototype.load = function load(filename, options, callback) {
|
|
|
5648
6112
|
self.fetch(filename, function(err, source) {
|
|
5649
6113
|
--queued;
|
|
5650
6114
|
/* istanbul ignore if */
|
|
5651
|
-
if (!callback)
|
|
6115
|
+
if (!callback) {
|
|
5652
6116
|
return; // terminated meanwhile
|
|
6117
|
+
}
|
|
5653
6118
|
if (err) {
|
|
5654
6119
|
/* istanbul ignore else */
|
|
5655
6120
|
if (!weak)
|
|
@@ -5666,17 +6131,21 @@ Root.prototype.load = function load(filename, options, callback) {
|
|
|
5666
6131
|
|
|
5667
6132
|
// Assembling the root namespace doesn't require working type
|
|
5668
6133
|
// references anymore, so we can load everything in parallel
|
|
5669
|
-
if (util.isString(filename))
|
|
6134
|
+
if (util.isString(filename)) {
|
|
5670
6135
|
filename = [ filename ];
|
|
6136
|
+
}
|
|
5671
6137
|
for (var i = 0, resolved; i < filename.length; ++i)
|
|
5672
6138
|
if (resolved = self.resolvePath("", filename[i]))
|
|
5673
6139
|
fetch(resolved);
|
|
5674
|
-
|
|
5675
|
-
|
|
6140
|
+
if (sync) {
|
|
6141
|
+
self.resolveAll();
|
|
5676
6142
|
return self;
|
|
5677
|
-
|
|
6143
|
+
}
|
|
6144
|
+
if (!queued) {
|
|
5678
6145
|
finish(null, self);
|
|
5679
|
-
|
|
6146
|
+
}
|
|
6147
|
+
|
|
6148
|
+
return self;
|
|
5680
6149
|
};
|
|
5681
6150
|
// function load(filename:string, options:IParseOptions, callback:LoadCallback):undefined
|
|
5682
6151
|
|
|
@@ -5718,6 +6187,8 @@ Root.prototype.loadSync = function loadSync(filename, options) {
|
|
|
5718
6187
|
* @override
|
|
5719
6188
|
*/
|
|
5720
6189
|
Root.prototype.resolveAll = function resolveAll() {
|
|
6190
|
+
if (!this._needsRecursiveResolve) return this;
|
|
6191
|
+
|
|
5721
6192
|
if (this.deferred.length)
|
|
5722
6193
|
throw Error("unresolvable extensions: " + this.deferred.map(function(field) {
|
|
5723
6194
|
return "'extend " + field.extend + "' in " + field.parent.fullName;
|
|
@@ -5784,6 +6255,11 @@ Root.prototype._handleAdd = function _handleAdd(object) {
|
|
|
5784
6255
|
object.parent[object.name] = object; // expose namespace as property of its parent
|
|
5785
6256
|
}
|
|
5786
6257
|
|
|
6258
|
+
if (object instanceof Type || object instanceof Enum || object instanceof Field) {
|
|
6259
|
+
// Only store types and enums for quick lookup during resolve.
|
|
6260
|
+
this._fullyQualifiedObjects[object.fullName] = object;
|
|
6261
|
+
}
|
|
6262
|
+
|
|
5787
6263
|
// The above also adds uppercased (and thus conflict-free) nested types, services and enums as
|
|
5788
6264
|
// properties of namespaces just like static code does. This allows using a .d.ts generated for
|
|
5789
6265
|
// a static module with reflection-based solutions where the condition is met.
|
|
@@ -5824,6 +6300,8 @@ Root.prototype._handleRemove = function _handleRemove(object) {
|
|
|
5824
6300
|
delete object.parent[object.name]; // unexpose namespaces
|
|
5825
6301
|
|
|
5826
6302
|
}
|
|
6303
|
+
|
|
6304
|
+
delete this._fullyQualifiedObjects[object.fullName];
|
|
5827
6305
|
};
|
|
5828
6306
|
|
|
5829
6307
|
// Sets up cyclic dependencies (called in index-light)
|
|
@@ -6095,7 +6573,10 @@ Service.fromJSON = function fromJSON(name, json) {
|
|
|
6095
6573
|
service.add(Method.fromJSON(names[i], json.methods[names[i]]));
|
|
6096
6574
|
if (json.nested)
|
|
6097
6575
|
service.addJSON(json.nested);
|
|
6576
|
+
if (json.edition)
|
|
6577
|
+
service._edition = json.edition;
|
|
6098
6578
|
service.comment = json.comment;
|
|
6579
|
+
service._defaultEdition = "proto3"; // For backwards-compatibility.
|
|
6099
6580
|
return service;
|
|
6100
6581
|
};
|
|
6101
6582
|
|
|
@@ -6108,6 +6589,7 @@ Service.prototype.toJSON = function toJSON(toJSONOptions) {
|
|
|
6108
6589
|
var inherited = Namespace.prototype.toJSON.call(this, toJSONOptions);
|
|
6109
6590
|
var keepComments = toJSONOptions ? Boolean(toJSONOptions.keepComments) : false;
|
|
6110
6591
|
return util.toObject([
|
|
6592
|
+
"edition" , this._editionToJSON(),
|
|
6111
6593
|
"options" , inherited && inherited.options || undefined,
|
|
6112
6594
|
"methods" , Namespace.arrayToJSON(this.methodsArray, toJSONOptions) || /* istanbul ignore next */ {},
|
|
6113
6595
|
"nested" , inherited && inherited.nested || undefined,
|
|
@@ -6144,10 +6626,28 @@ Service.prototype.get = function get(name) {
|
|
|
6144
6626
|
* @override
|
|
6145
6627
|
*/
|
|
6146
6628
|
Service.prototype.resolveAll = function resolveAll() {
|
|
6629
|
+
if (!this._needsRecursiveResolve) return this;
|
|
6630
|
+
|
|
6631
|
+
Namespace.prototype.resolve.call(this);
|
|
6147
6632
|
var methods = this.methodsArray;
|
|
6148
6633
|
for (var i = 0; i < methods.length; ++i)
|
|
6149
6634
|
methods[i].resolve();
|
|
6150
|
-
return
|
|
6635
|
+
return this;
|
|
6636
|
+
};
|
|
6637
|
+
|
|
6638
|
+
/**
|
|
6639
|
+
* @override
|
|
6640
|
+
*/
|
|
6641
|
+
Service.prototype._resolveFeaturesRecursive = function _resolveFeaturesRecursive(edition) {
|
|
6642
|
+
if (!this._needsRecursiveFeatureResolution) return this;
|
|
6643
|
+
|
|
6644
|
+
edition = this._edition || edition;
|
|
6645
|
+
|
|
6646
|
+
Namespace.prototype._resolveFeaturesRecursive.call(this, edition);
|
|
6647
|
+
this.methodsArray.forEach(method => {
|
|
6648
|
+
method._resolveFeaturesRecursive(edition);
|
|
6649
|
+
});
|
|
6650
|
+
return this;
|
|
6151
6651
|
};
|
|
6152
6652
|
|
|
6153
6653
|
/**
|
|
@@ -6897,6 +7397,9 @@ Type.fromJSON = function fromJSON(name, json) {
|
|
|
6897
7397
|
type.group = true;
|
|
6898
7398
|
if (json.comment)
|
|
6899
7399
|
type.comment = json.comment;
|
|
7400
|
+
if (json.edition)
|
|
7401
|
+
type._edition = json.edition;
|
|
7402
|
+
type._defaultEdition = "proto3"; // For backwards-compatibility.
|
|
6900
7403
|
return type;
|
|
6901
7404
|
};
|
|
6902
7405
|
|
|
@@ -6909,6 +7412,7 @@ Type.prototype.toJSON = function toJSON(toJSONOptions) {
|
|
|
6909
7412
|
var inherited = Namespace.prototype.toJSON.call(this, toJSONOptions);
|
|
6910
7413
|
var keepComments = toJSONOptions ? Boolean(toJSONOptions.keepComments) : false;
|
|
6911
7414
|
return util.toObject([
|
|
7415
|
+
"edition" , this._editionToJSON(),
|
|
6912
7416
|
"options" , inherited && inherited.options || undefined,
|
|
6913
7417
|
"oneofs" , Namespace.arrayToJSON(this.oneofsArray, toJSONOptions),
|
|
6914
7418
|
"fields" , Namespace.arrayToJSON(this.fieldsArray.filter(function(obj) { return !obj.declaringField; }), toJSONOptions) || {},
|
|
@@ -6924,13 +7428,34 @@ Type.prototype.toJSON = function toJSON(toJSONOptions) {
|
|
|
6924
7428
|
* @override
|
|
6925
7429
|
*/
|
|
6926
7430
|
Type.prototype.resolveAll = function resolveAll() {
|
|
6927
|
-
|
|
6928
|
-
|
|
6929
|
-
|
|
7431
|
+
if (!this._needsRecursiveResolve) return this;
|
|
7432
|
+
|
|
7433
|
+
Namespace.prototype.resolveAll.call(this);
|
|
6930
7434
|
var oneofs = this.oneofsArray; i = 0;
|
|
6931
7435
|
while (i < oneofs.length)
|
|
6932
7436
|
oneofs[i++].resolve();
|
|
6933
|
-
|
|
7437
|
+
var fields = this.fieldsArray, i = 0;
|
|
7438
|
+
while (i < fields.length)
|
|
7439
|
+
fields[i++].resolve();
|
|
7440
|
+
return this;
|
|
7441
|
+
};
|
|
7442
|
+
|
|
7443
|
+
/**
|
|
7444
|
+
* @override
|
|
7445
|
+
*/
|
|
7446
|
+
Type.prototype._resolveFeaturesRecursive = function _resolveFeaturesRecursive(edition) {
|
|
7447
|
+
if (!this._needsRecursiveFeatureResolution) return this;
|
|
7448
|
+
|
|
7449
|
+
edition = this._edition || edition;
|
|
7450
|
+
|
|
7451
|
+
Namespace.prototype._resolveFeaturesRecursive.call(this, edition);
|
|
7452
|
+
this.oneofsArray.forEach(oneof => {
|
|
7453
|
+
oneof._resolveFeatures(edition);
|
|
7454
|
+
});
|
|
7455
|
+
this.fieldsArray.forEach(field => {
|
|
7456
|
+
field._resolveFeatures(edition);
|
|
7457
|
+
});
|
|
7458
|
+
return this;
|
|
6934
7459
|
};
|
|
6935
7460
|
|
|
6936
7461
|
/**
|
|
@@ -7585,9 +8110,10 @@ util.decorateEnum = function decorateEnum(object) {
|
|
|
7585
8110
|
* @param {Object.<string,*>} dst Destination object
|
|
7586
8111
|
* @param {string} path dot '.' delimited path of the property to set
|
|
7587
8112
|
* @param {Object} value the value to set
|
|
8113
|
+
* @param {boolean|undefined} [ifNotSet] Sets the option only if it isn't currently set
|
|
7588
8114
|
* @returns {Object.<string,*>} Destination object
|
|
7589
8115
|
*/
|
|
7590
|
-
util.setProperty = function setProperty(dst, path, value) {
|
|
8116
|
+
util.setProperty = function setProperty(dst, path, value, ifNotSet) {
|
|
7591
8117
|
function setProp(dst, path, value) {
|
|
7592
8118
|
var part = path.shift();
|
|
7593
8119
|
if (part === "__proto__" || part === "prototype") {
|
|
@@ -7597,6 +8123,8 @@ util.setProperty = function setProperty(dst, path, value) {
|
|
|
7597
8123
|
dst[part] = setProp(dst[part] || {}, path, value);
|
|
7598
8124
|
} else {
|
|
7599
8125
|
var prevValue = dst[part];
|
|
8126
|
+
if (prevValue && ifNotSet)
|
|
8127
|
+
return dst;
|
|
7600
8128
|
if (prevValue)
|
|
7601
8129
|
value = [].concat(prevValue).concat(value);
|
|
7602
8130
|
dst[part] = value;
|