node-red-contrib-tak-registration 0.14.1 → 0.15.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.
Files changed (447) hide show
  1. package/README.md +1 -1
  2. package/node_modules/@types/geojson/README.md +1 -1
  3. package/node_modules/@types/geojson/index.d.ts +36 -2
  4. package/node_modules/@types/geojson/package.json +2 -2
  5. package/node_modules/@types/node/README.md +2 -2
  6. package/node_modules/@types/node/assert.d.ts +14 -0
  7. package/node_modules/@types/node/async_hooks.d.ts +64 -2
  8. package/node_modules/@types/node/buffer.buffer.d.ts +117 -39
  9. package/node_modules/@types/node/buffer.d.ts +6 -13
  10. package/node_modules/@types/node/cluster.d.ts +1 -1
  11. package/node_modules/@types/node/constants.d.ts +14 -12
  12. package/node_modules/@types/node/crypto.d.ts +44 -10
  13. package/node_modules/@types/node/dgram.d.ts +10 -7
  14. package/node_modules/@types/node/diagnostics_channel.d.ts +20 -1
  15. package/node_modules/@types/node/fs/promises.d.ts +23 -26
  16. package/node_modules/@types/node/fs.d.ts +166 -125
  17. package/node_modules/@types/node/globals.d.ts +141 -338
  18. package/node_modules/@types/node/http.d.ts +25 -3
  19. package/node_modules/@types/node/http2.d.ts +3 -4
  20. package/node_modules/@types/node/https.d.ts +3 -1
  21. package/node_modules/@types/node/inspector.d.ts +36 -0
  22. package/node_modules/@types/node/module.d.ts +599 -236
  23. package/node_modules/@types/node/net.d.ts +44 -13
  24. package/node_modules/@types/node/package.json +9 -4
  25. package/node_modules/@types/node/perf_hooks.d.ts +5 -0
  26. package/node_modules/@types/node/process.d.ts +69 -2
  27. package/node_modules/@types/node/querystring.d.ts +2 -3
  28. package/node_modules/@types/node/readline.d.ts +6 -1
  29. package/node_modules/@types/node/sea.d.ts +1 -1
  30. package/node_modules/@types/node/sqlite.d.ts +291 -17
  31. package/node_modules/@types/node/stream/consumers.d.ts +32 -6
  32. package/node_modules/@types/node/stream/web.d.ts +9 -4
  33. package/node_modules/@types/node/stream.d.ts +936 -1000
  34. package/node_modules/@types/node/test.d.ts +169 -137
  35. package/node_modules/@types/node/timers/promises.d.ts +24 -13
  36. package/node_modules/@types/node/timers.d.ts +159 -112
  37. package/node_modules/@types/node/tls.d.ts +34 -1
  38. package/node_modules/@types/node/ts5.6/buffer.buffer.d.ts +110 -35
  39. package/node_modules/@types/node/util.d.ts +323 -110
  40. package/node_modules/@types/node/v8.d.ts +81 -0
  41. package/node_modules/@types/node/vm.d.ts +21 -6
  42. package/node_modules/@types/node/worker_threads.d.ts +1 -0
  43. package/node_modules/@types/node/zlib.d.ts +167 -36
  44. package/node_modules/axios/CHANGELOG.md +124 -0
  45. package/node_modules/axios/README.md +38 -16
  46. package/node_modules/axios/dist/axios.js +44 -39
  47. package/node_modules/axios/dist/axios.js.map +1 -1
  48. package/node_modules/axios/dist/axios.min.js +2 -1
  49. package/node_modules/axios/dist/axios.min.js.map +1 -1
  50. package/node_modules/axios/dist/browser/axios.cjs +43 -39
  51. package/node_modules/axios/dist/browser/axios.cjs.map +1 -1
  52. package/node_modules/axios/dist/esm/axios.js +43 -39
  53. package/node_modules/axios/dist/esm/axios.js.map +1 -1
  54. package/node_modules/axios/dist/esm/axios.min.js +2 -1
  55. package/node_modules/axios/dist/esm/axios.min.js.map +1 -1
  56. package/node_modules/axios/dist/node/axios.cjs +74 -43
  57. package/node_modules/axios/dist/node/axios.cjs.map +1 -1
  58. package/node_modules/axios/index.d.cts +3 -2
  59. package/node_modules/axios/index.d.ts +5 -2
  60. package/node_modules/axios/lib/adapters/fetch.js +1 -1
  61. package/node_modules/axios/lib/adapters/http.js +1 -1
  62. package/node_modules/axios/lib/core/Axios.js +11 -2
  63. package/node_modules/axios/lib/core/AxiosHeaders.js +15 -3
  64. package/node_modules/axios/lib/core/buildFullPath.js +3 -2
  65. package/node_modules/axios/lib/env/data.js +1 -1
  66. package/node_modules/axios/lib/helpers/formDataToStream.js +4 -3
  67. package/node_modules/axios/lib/helpers/resolveConfig.js +1 -1
  68. package/node_modules/axios/lib/platform/node/index.js +26 -0
  69. package/node_modules/axios/lib/utils.js +12 -28
  70. package/node_modules/axios/package.json +3 -3
  71. package/node_modules/bignumber.js/CHANGELOG.md +82 -1
  72. package/node_modules/bignumber.js/LICENCE.md +1 -1
  73. package/node_modules/bignumber.js/README.md +6 -4
  74. package/node_modules/bignumber.js/bignumber.d.mts +6 -0
  75. package/node_modules/bignumber.js/bignumber.d.ts +3 -1829
  76. package/node_modules/bignumber.js/bignumber.js +3 -3
  77. package/node_modules/bignumber.js/bignumber.mjs +3 -3
  78. package/node_modules/bignumber.js/package.json +17 -7
  79. package/node_modules/bignumber.js/types.d.ts +1821 -0
  80. package/node_modules/call-bind-apply-helpers/.eslintrc +17 -0
  81. package/node_modules/call-bind-apply-helpers/.github/FUNDING.yml +12 -0
  82. package/node_modules/call-bind-apply-helpers/.nycrc +9 -0
  83. package/node_modules/call-bind-apply-helpers/CHANGELOG.md +30 -0
  84. package/node_modules/call-bind-apply-helpers/LICENSE +21 -0
  85. package/node_modules/call-bind-apply-helpers/README.md +62 -0
  86. package/node_modules/call-bind-apply-helpers/actualApply.d.ts +1 -0
  87. package/node_modules/call-bind-apply-helpers/actualApply.js +10 -0
  88. package/node_modules/call-bind-apply-helpers/applyBind.d.ts +19 -0
  89. package/node_modules/call-bind-apply-helpers/applyBind.js +10 -0
  90. package/node_modules/call-bind-apply-helpers/functionApply.d.ts +1 -0
  91. package/node_modules/call-bind-apply-helpers/functionApply.js +4 -0
  92. package/node_modules/call-bind-apply-helpers/functionCall.d.ts +1 -0
  93. package/node_modules/call-bind-apply-helpers/functionCall.js +4 -0
  94. package/node_modules/call-bind-apply-helpers/index.d.ts +64 -0
  95. package/node_modules/call-bind-apply-helpers/index.js +15 -0
  96. package/node_modules/call-bind-apply-helpers/package.json +85 -0
  97. package/node_modules/call-bind-apply-helpers/reflectApply.d.ts +3 -0
  98. package/node_modules/call-bind-apply-helpers/reflectApply.js +4 -0
  99. package/node_modules/call-bind-apply-helpers/test/index.js +63 -0
  100. package/node_modules/call-bind-apply-helpers/tsconfig.json +9 -0
  101. package/node_modules/dunder-proto/.eslintrc +5 -0
  102. package/node_modules/dunder-proto/.github/FUNDING.yml +12 -0
  103. package/node_modules/dunder-proto/.nycrc +13 -0
  104. package/node_modules/dunder-proto/CHANGELOG.md +24 -0
  105. package/node_modules/dunder-proto/LICENSE +21 -0
  106. package/node_modules/dunder-proto/README.md +54 -0
  107. package/node_modules/dunder-proto/get.d.ts +5 -0
  108. package/node_modules/dunder-proto/get.js +30 -0
  109. package/node_modules/dunder-proto/package.json +76 -0
  110. package/node_modules/dunder-proto/set.d.ts +5 -0
  111. package/node_modules/dunder-proto/set.js +35 -0
  112. package/node_modules/dunder-proto/test/get.js +34 -0
  113. package/node_modules/dunder-proto/test/index.js +4 -0
  114. package/node_modules/dunder-proto/test/set.js +50 -0
  115. package/node_modules/dunder-proto/tsconfig.json +9 -0
  116. package/node_modules/es-define-property/.eslintrc +13 -0
  117. package/node_modules/es-define-property/.github/FUNDING.yml +12 -0
  118. package/node_modules/es-define-property/.nycrc +9 -0
  119. package/node_modules/es-define-property/CHANGELOG.md +29 -0
  120. package/node_modules/es-define-property/LICENSE +21 -0
  121. package/node_modules/es-define-property/README.md +49 -0
  122. package/node_modules/es-define-property/index.d.ts +3 -0
  123. package/node_modules/es-define-property/index.js +14 -0
  124. package/node_modules/es-define-property/package.json +81 -0
  125. package/node_modules/es-define-property/test/index.js +56 -0
  126. package/node_modules/es-define-property/tsconfig.json +10 -0
  127. package/node_modules/es-errors/.eslintrc +5 -0
  128. package/node_modules/es-errors/.github/FUNDING.yml +12 -0
  129. package/node_modules/es-errors/CHANGELOG.md +40 -0
  130. package/node_modules/es-errors/LICENSE +21 -0
  131. package/node_modules/es-errors/README.md +55 -0
  132. package/node_modules/es-errors/eval.d.ts +3 -0
  133. package/node_modules/es-errors/eval.js +4 -0
  134. package/node_modules/es-errors/index.d.ts +3 -0
  135. package/node_modules/es-errors/index.js +4 -0
  136. package/node_modules/es-errors/package.json +80 -0
  137. package/node_modules/es-errors/range.d.ts +3 -0
  138. package/node_modules/es-errors/range.js +4 -0
  139. package/node_modules/es-errors/ref.d.ts +3 -0
  140. package/node_modules/es-errors/ref.js +4 -0
  141. package/node_modules/es-errors/syntax.d.ts +3 -0
  142. package/node_modules/es-errors/syntax.js +4 -0
  143. package/node_modules/es-errors/test/index.js +19 -0
  144. package/node_modules/es-errors/tsconfig.json +49 -0
  145. package/node_modules/es-errors/type.d.ts +3 -0
  146. package/node_modules/es-errors/type.js +4 -0
  147. package/node_modules/es-errors/uri.d.ts +3 -0
  148. package/node_modules/es-errors/uri.js +4 -0
  149. package/node_modules/es-object-atoms/.eslintrc +16 -0
  150. package/node_modules/es-object-atoms/.github/FUNDING.yml +12 -0
  151. package/node_modules/es-object-atoms/CHANGELOG.md +37 -0
  152. package/node_modules/es-object-atoms/LICENSE +21 -0
  153. package/node_modules/es-object-atoms/README.md +63 -0
  154. package/node_modules/es-object-atoms/RequireObjectCoercible.d.ts +3 -0
  155. package/node_modules/es-object-atoms/RequireObjectCoercible.js +11 -0
  156. package/node_modules/es-object-atoms/ToObject.d.ts +7 -0
  157. package/node_modules/es-object-atoms/ToObject.js +10 -0
  158. package/node_modules/es-object-atoms/index.d.ts +3 -0
  159. package/node_modules/es-object-atoms/index.js +4 -0
  160. package/node_modules/es-object-atoms/isObject.d.ts +3 -0
  161. package/node_modules/es-object-atoms/isObject.js +6 -0
  162. package/node_modules/es-object-atoms/package.json +80 -0
  163. package/node_modules/es-object-atoms/test/index.js +38 -0
  164. package/node_modules/es-object-atoms/tsconfig.json +6 -0
  165. package/node_modules/es-set-tostringtag/.eslintrc +13 -0
  166. package/node_modules/es-set-tostringtag/.nycrc +9 -0
  167. package/node_modules/es-set-tostringtag/CHANGELOG.md +67 -0
  168. package/node_modules/es-set-tostringtag/LICENSE +21 -0
  169. package/node_modules/es-set-tostringtag/README.md +53 -0
  170. package/node_modules/es-set-tostringtag/index.d.ts +10 -0
  171. package/node_modules/es-set-tostringtag/index.js +35 -0
  172. package/node_modules/es-set-tostringtag/package.json +78 -0
  173. package/node_modules/es-set-tostringtag/test/index.js +85 -0
  174. package/node_modules/es-set-tostringtag/tsconfig.json +9 -0
  175. package/node_modules/fast-xml-parser/CHANGELOG.md +63 -0
  176. package/node_modules/fast-xml-parser/README.md +37 -51
  177. package/node_modules/fast-xml-parser/lib/fxbuilder.min.js +2 -0
  178. package/node_modules/fast-xml-parser/lib/fxbuilder.min.js.map +1 -0
  179. package/node_modules/fast-xml-parser/lib/fxp.cjs +1 -0
  180. package/node_modules/fast-xml-parser/lib/fxp.d.cts +458 -0
  181. package/node_modules/fast-xml-parser/lib/fxp.min.js +2 -0
  182. package/node_modules/fast-xml-parser/lib/fxp.min.js.map +1 -0
  183. package/node_modules/fast-xml-parser/lib/fxparser.min.js +2 -0
  184. package/node_modules/fast-xml-parser/lib/fxparser.min.js.map +1 -0
  185. package/node_modules/fast-xml-parser/lib/fxvalidator.min.js +2 -0
  186. package/node_modules/fast-xml-parser/lib/fxvalidator.min.js.map +1 -0
  187. package/node_modules/fast-xml-parser/package.json +36 -18
  188. package/node_modules/fast-xml-parser/src/cli/cli.js +12 -12
  189. package/node_modules/fast-xml-parser/src/cli/man.js +6 -1
  190. package/node_modules/fast-xml-parser/src/cli/read.js +30 -79
  191. package/node_modules/fast-xml-parser/src/fxp.d.ts +28 -1
  192. package/node_modules/fast-xml-parser/src/fxp.js +11 -8
  193. package/node_modules/fast-xml-parser/src/ignoreAttributes.js +2 -4
  194. package/node_modules/fast-xml-parser/src/util.js +14 -18
  195. package/node_modules/fast-xml-parser/src/{v5 → v6}/CharsSymbol.js +1 -1
  196. package/node_modules/fast-xml-parser/src/{v5 → v6}/EntitiesParser.js +3 -6
  197. package/node_modules/fast-xml-parser/src/{v5 → v6}/OptionsBuilder.js +3 -6
  198. package/node_modules/fast-xml-parser/src/{v5 → v6}/OutputBuilders/BaseOutputBuilder.js +1 -3
  199. package/node_modules/fast-xml-parser/src/{v5 → v6}/OutputBuilders/JsArrBuilder.js +3 -3
  200. package/node_modules/fast-xml-parser/src/{v5 → v6}/OutputBuilders/JsMinArrBuilder.js +3 -5
  201. package/node_modules/fast-xml-parser/src/{v5 → v6}/OutputBuilders/JsObjBuilder.js +3 -5
  202. package/node_modules/fast-xml-parser/src/{v5 → v6}/OutputBuilders/ParserOptionsBuilder.js +6 -11
  203. package/node_modules/fast-xml-parser/src/{v5 → v6}/TagPath.js +1 -1
  204. package/node_modules/fast-xml-parser/src/{v5 → v6}/TagPathMatcher.js +3 -5
  205. package/node_modules/fast-xml-parser/src/{v5 → v6}/XMLParser.js +3 -5
  206. package/node_modules/fast-xml-parser/src/{v5 → v6}/Xml2JsParser.js +8 -10
  207. package/node_modules/fast-xml-parser/src/{v5 → v6}/XmlPartReader.js +4 -10
  208. package/node_modules/fast-xml-parser/src/{v5 → v6}/XmlSpecialTagsReader.js +5 -12
  209. package/node_modules/fast-xml-parser/src/{v5 → v6}/inputSource/BufferSource.js +1 -3
  210. package/node_modules/fast-xml-parser/src/{v5 → v6}/inputSource/StringSource.js +1 -3
  211. package/node_modules/fast-xml-parser/src/{v5 → v6}/valueParsers/EntitiesParser.js +3 -5
  212. package/node_modules/fast-xml-parser/src/{v5 → v6}/valueParsers/booleanParser.js +1 -2
  213. package/node_modules/fast-xml-parser/src/{v5 → v6}/valueParsers/booleanParserExt.js +1 -2
  214. package/node_modules/fast-xml-parser/src/{v5 → v6}/valueParsers/currency.js +1 -3
  215. package/node_modules/fast-xml-parser/src/{v5 → v6}/valueParsers/join.js +1 -2
  216. package/node_modules/fast-xml-parser/src/{v5 → v6}/valueParsers/number.js +2 -4
  217. package/node_modules/fast-xml-parser/src/{v5 → v6}/valueParsers/trim.js +1 -3
  218. package/node_modules/fast-xml-parser/src/validator.js +5 -5
  219. package/node_modules/fast-xml-parser/src/xmlbuilder/json2xml.js +5 -4
  220. package/node_modules/fast-xml-parser/src/xmlbuilder/orderedJs2Xml.js +1 -2
  221. package/node_modules/fast-xml-parser/src/xmlparser/DocTypeReader.js +287 -71
  222. package/node_modules/fast-xml-parser/src/xmlparser/OptionsBuilder.js +3 -5
  223. package/node_modules/fast-xml-parser/src/xmlparser/OrderedObjParser.js +23 -23
  224. package/node_modules/fast-xml-parser/src/xmlparser/XMLParser.js +21 -8
  225. package/node_modules/fast-xml-parser/src/xmlparser/node2json.js +8 -2
  226. package/node_modules/fast-xml-parser/src/xmlparser/xmlNode.js +22 -7
  227. package/node_modules/form-data/lib/form_data.js +24 -22
  228. package/node_modules/form-data/package.json +17 -14
  229. package/node_modules/function-bind/.eslintrc +21 -0
  230. package/node_modules/function-bind/.github/FUNDING.yml +12 -0
  231. package/node_modules/function-bind/.github/SECURITY.md +3 -0
  232. package/node_modules/function-bind/.nycrc +13 -0
  233. package/node_modules/function-bind/CHANGELOG.md +136 -0
  234. package/node_modules/function-bind/LICENSE +20 -0
  235. package/node_modules/function-bind/README.md +46 -0
  236. package/node_modules/function-bind/implementation.js +84 -0
  237. package/node_modules/function-bind/index.js +5 -0
  238. package/node_modules/function-bind/package.json +87 -0
  239. package/node_modules/function-bind/test/.eslintrc +9 -0
  240. package/node_modules/function-bind/test/index.js +252 -0
  241. package/node_modules/get-intrinsic/.eslintrc +42 -0
  242. package/node_modules/get-intrinsic/.github/FUNDING.yml +12 -0
  243. package/node_modules/get-intrinsic/.nycrc +9 -0
  244. package/node_modules/get-intrinsic/CHANGELOG.md +186 -0
  245. package/node_modules/get-intrinsic/LICENSE +21 -0
  246. package/node_modules/get-intrinsic/README.md +71 -0
  247. package/node_modules/get-intrinsic/index.js +378 -0
  248. package/node_modules/get-intrinsic/package.json +97 -0
  249. package/node_modules/get-intrinsic/test/GetIntrinsic.js +274 -0
  250. package/node_modules/get-proto/.eslintrc +10 -0
  251. package/node_modules/get-proto/.github/FUNDING.yml +12 -0
  252. package/node_modules/get-proto/.nycrc +9 -0
  253. package/node_modules/get-proto/CHANGELOG.md +21 -0
  254. package/node_modules/get-proto/LICENSE +21 -0
  255. package/node_modules/get-proto/Object.getPrototypeOf.d.ts +5 -0
  256. package/node_modules/get-proto/Object.getPrototypeOf.js +6 -0
  257. package/node_modules/get-proto/README.md +50 -0
  258. package/node_modules/get-proto/Reflect.getPrototypeOf.d.ts +3 -0
  259. package/node_modules/get-proto/Reflect.getPrototypeOf.js +4 -0
  260. package/node_modules/get-proto/index.d.ts +5 -0
  261. package/node_modules/get-proto/index.js +27 -0
  262. package/node_modules/get-proto/package.json +81 -0
  263. package/node_modules/get-proto/test/index.js +68 -0
  264. package/node_modules/get-proto/tsconfig.json +9 -0
  265. package/node_modules/gopd/.eslintrc +16 -0
  266. package/node_modules/gopd/.github/FUNDING.yml +12 -0
  267. package/node_modules/gopd/CHANGELOG.md +45 -0
  268. package/node_modules/gopd/LICENSE +21 -0
  269. package/node_modules/gopd/README.md +40 -0
  270. package/node_modules/gopd/gOPD.d.ts +1 -0
  271. package/node_modules/gopd/gOPD.js +4 -0
  272. package/node_modules/gopd/index.d.ts +5 -0
  273. package/node_modules/gopd/index.js +15 -0
  274. package/node_modules/gopd/package.json +77 -0
  275. package/node_modules/gopd/test/index.js +36 -0
  276. package/node_modules/gopd/tsconfig.json +9 -0
  277. package/node_modules/has-symbols/.eslintrc +11 -0
  278. package/node_modules/has-symbols/.github/FUNDING.yml +12 -0
  279. package/node_modules/has-symbols/.nycrc +9 -0
  280. package/node_modules/has-symbols/CHANGELOG.md +91 -0
  281. package/node_modules/has-symbols/LICENSE +21 -0
  282. package/node_modules/has-symbols/README.md +46 -0
  283. package/node_modules/has-symbols/index.d.ts +3 -0
  284. package/node_modules/has-symbols/index.js +14 -0
  285. package/node_modules/has-symbols/package.json +111 -0
  286. package/node_modules/has-symbols/shams.d.ts +3 -0
  287. package/node_modules/has-symbols/shams.js +45 -0
  288. package/node_modules/has-symbols/test/index.js +22 -0
  289. package/node_modules/has-symbols/test/shams/core-js.js +29 -0
  290. package/node_modules/has-symbols/test/shams/get-own-property-symbols.js +29 -0
  291. package/node_modules/has-symbols/test/tests.js +58 -0
  292. package/node_modules/has-symbols/tsconfig.json +10 -0
  293. package/node_modules/has-tostringtag/.eslintrc +5 -0
  294. package/node_modules/has-tostringtag/.github/FUNDING.yml +12 -0
  295. package/node_modules/has-tostringtag/.nycrc +13 -0
  296. package/node_modules/has-tostringtag/CHANGELOG.md +42 -0
  297. package/node_modules/has-tostringtag/LICENSE +21 -0
  298. package/node_modules/has-tostringtag/README.md +46 -0
  299. package/node_modules/has-tostringtag/index.d.ts +3 -0
  300. package/node_modules/has-tostringtag/index.js +8 -0
  301. package/node_modules/has-tostringtag/package.json +108 -0
  302. package/node_modules/has-tostringtag/shams.d.ts +3 -0
  303. package/node_modules/has-tostringtag/shams.js +8 -0
  304. package/node_modules/has-tostringtag/test/index.js +21 -0
  305. package/node_modules/has-tostringtag/test/shams/core-js.js +31 -0
  306. package/node_modules/has-tostringtag/test/shams/get-own-property-symbols.js +30 -0
  307. package/node_modules/has-tostringtag/test/tests.js +15 -0
  308. package/node_modules/has-tostringtag/tsconfig.json +49 -0
  309. package/node_modules/hasown/.eslintrc +5 -0
  310. package/node_modules/hasown/.github/FUNDING.yml +12 -0
  311. package/node_modules/hasown/.nycrc +13 -0
  312. package/node_modules/hasown/CHANGELOG.md +40 -0
  313. package/node_modules/hasown/LICENSE +21 -0
  314. package/node_modules/hasown/README.md +40 -0
  315. package/node_modules/hasown/index.d.ts +3 -0
  316. package/node_modules/hasown/index.js +8 -0
  317. package/node_modules/hasown/package.json +92 -0
  318. package/node_modules/hasown/tsconfig.json +6 -0
  319. package/node_modules/long/README.md +93 -87
  320. package/node_modules/long/index.d.ts +2 -2
  321. package/node_modules/long/index.js +360 -246
  322. package/node_modules/long/package.json +12 -4
  323. package/node_modules/long/types.d.ts +474 -0
  324. package/node_modules/long/umd/index.d.ts +2 -456
  325. package/node_modules/long/umd/index.js +1585 -1395
  326. package/node_modules/long/umd/types.d.ts +474 -0
  327. package/node_modules/math-intrinsics/.eslintrc +16 -0
  328. package/node_modules/math-intrinsics/.github/FUNDING.yml +12 -0
  329. package/node_modules/math-intrinsics/CHANGELOG.md +24 -0
  330. package/node_modules/math-intrinsics/LICENSE +21 -0
  331. package/node_modules/math-intrinsics/README.md +50 -0
  332. package/node_modules/math-intrinsics/abs.d.ts +1 -0
  333. package/node_modules/math-intrinsics/abs.js +4 -0
  334. package/node_modules/math-intrinsics/constants/maxArrayLength.d.ts +3 -0
  335. package/node_modules/math-intrinsics/constants/maxArrayLength.js +4 -0
  336. package/node_modules/math-intrinsics/constants/maxSafeInteger.d.ts +3 -0
  337. package/node_modules/math-intrinsics/constants/maxSafeInteger.js +5 -0
  338. package/node_modules/math-intrinsics/constants/maxValue.d.ts +3 -0
  339. package/node_modules/math-intrinsics/constants/maxValue.js +5 -0
  340. package/node_modules/math-intrinsics/floor.d.ts +1 -0
  341. package/node_modules/math-intrinsics/floor.js +4 -0
  342. package/node_modules/math-intrinsics/isFinite.d.ts +3 -0
  343. package/node_modules/math-intrinsics/isFinite.js +12 -0
  344. package/node_modules/math-intrinsics/isInteger.d.ts +3 -0
  345. package/node_modules/math-intrinsics/isInteger.js +16 -0
  346. package/node_modules/math-intrinsics/isNaN.d.ts +1 -0
  347. package/node_modules/math-intrinsics/isNaN.js +6 -0
  348. package/node_modules/math-intrinsics/isNegativeZero.d.ts +3 -0
  349. package/node_modules/math-intrinsics/isNegativeZero.js +6 -0
  350. package/node_modules/math-intrinsics/max.d.ts +1 -0
  351. package/node_modules/math-intrinsics/max.js +4 -0
  352. package/node_modules/math-intrinsics/min.d.ts +1 -0
  353. package/node_modules/math-intrinsics/min.js +4 -0
  354. package/node_modules/math-intrinsics/mod.d.ts +3 -0
  355. package/node_modules/math-intrinsics/mod.js +9 -0
  356. package/node_modules/math-intrinsics/package.json +86 -0
  357. package/node_modules/math-intrinsics/pow.d.ts +1 -0
  358. package/node_modules/math-intrinsics/pow.js +4 -0
  359. package/node_modules/math-intrinsics/round.d.ts +1 -0
  360. package/node_modules/math-intrinsics/round.js +4 -0
  361. package/node_modules/math-intrinsics/sign.d.ts +3 -0
  362. package/node_modules/math-intrinsics/sign.js +11 -0
  363. package/node_modules/math-intrinsics/test/index.js +192 -0
  364. package/node_modules/math-intrinsics/tsconfig.json +3 -0
  365. package/node_modules/protobufjs/dist/light/protobuf.js +531 -80
  366. package/node_modules/protobufjs/dist/light/protobuf.js.map +1 -1
  367. package/node_modules/protobufjs/dist/light/protobuf.min.js +3 -3
  368. package/node_modules/protobufjs/dist/light/protobuf.min.js.map +1 -1
  369. package/node_modules/protobufjs/dist/minimal/protobuf.js +2 -2
  370. package/node_modules/protobufjs/dist/minimal/protobuf.min.js +2 -2
  371. package/node_modules/protobufjs/dist/protobuf.js +671 -144
  372. package/node_modules/protobufjs/dist/protobuf.js.map +1 -1
  373. package/node_modules/protobufjs/dist/protobuf.min.js +3 -3
  374. package/node_modules/protobufjs/dist/protobuf.min.js.map +1 -1
  375. package/node_modules/protobufjs/index.d.ts +71 -13
  376. package/node_modules/protobufjs/package.json +4 -2
  377. package/node_modules/protobufjs/src/decoder.js +8 -10
  378. package/node_modules/protobufjs/src/encoder.js +1 -1
  379. package/node_modules/protobufjs/src/enum.js +25 -0
  380. package/node_modules/protobufjs/src/field.js +104 -28
  381. package/node_modules/protobufjs/src/namespace.js +124 -13
  382. package/node_modules/protobufjs/src/object.js +139 -4
  383. package/node_modules/protobufjs/src/oneof.js +19 -0
  384. package/node_modules/protobufjs/src/parse.js +139 -63
  385. package/node_modules/protobufjs/src/root.js +52 -15
  386. package/node_modules/protobufjs/src/service.js +23 -1
  387. package/node_modules/protobufjs/src/type.js +29 -4
  388. package/node_modules/protobufjs/src/util.js +4 -1
  389. package/node_modules/strnum/.github/SECURITY.md +5 -0
  390. package/node_modules/strnum/CHANGELOG.md +33 -0
  391. package/node_modules/strnum/README.md +14 -3
  392. package/node_modules/strnum/algo.stflow +84 -0
  393. package/node_modules/strnum/package.json +9 -2
  394. package/node_modules/strnum/strnum.js +72 -67
  395. package/node_modules/strnum/strnum.test.js +29 -6
  396. package/node_modules/strnum/test.js +9 -0
  397. package/node_modules/undici-types/dispatcher.d.ts +1 -0
  398. package/node_modules/undici-types/package.json +1 -1
  399. package/node_modules/undici-types/readable.d.ts +5 -0
  400. package/node_modules/undici-types/webidl.d.ts +6 -0
  401. package/node_modules/uuid/README.md +12 -12
  402. package/node_modules/uuid/dist/cjs/types.d.ts +1 -1
  403. package/node_modules/uuid/dist/cjs/v1.d.ts +1 -1
  404. package/node_modules/uuid/dist/cjs/v1.js +1 -1
  405. package/node_modules/uuid/dist/cjs/v3.d.ts +1 -1
  406. package/node_modules/uuid/dist/cjs/v35.d.ts +1 -1
  407. package/node_modules/uuid/dist/cjs/v4.d.ts +1 -1
  408. package/node_modules/uuid/dist/cjs/v5.d.ts +1 -1
  409. package/node_modules/uuid/dist/cjs/v6.d.ts +1 -1
  410. package/node_modules/uuid/dist/cjs/v7.d.ts +1 -1
  411. package/node_modules/uuid/dist/cjs/v7.js +1 -1
  412. package/node_modules/uuid/dist/cjs-browser/types.d.ts +1 -1
  413. package/node_modules/uuid/dist/cjs-browser/v1.d.ts +1 -1
  414. package/node_modules/uuid/dist/cjs-browser/v1.js +1 -1
  415. package/node_modules/uuid/dist/cjs-browser/v3.d.ts +1 -1
  416. package/node_modules/uuid/dist/cjs-browser/v35.d.ts +1 -1
  417. package/node_modules/uuid/dist/cjs-browser/v4.d.ts +1 -1
  418. package/node_modules/uuid/dist/cjs-browser/v5.d.ts +1 -1
  419. package/node_modules/uuid/dist/cjs-browser/v6.d.ts +1 -1
  420. package/node_modules/uuid/dist/cjs-browser/v7.d.ts +1 -1
  421. package/node_modules/uuid/dist/cjs-browser/v7.js +1 -1
  422. package/node_modules/uuid/dist/esm/types.d.ts +1 -1
  423. package/node_modules/uuid/dist/esm/v1.d.ts +1 -1
  424. package/node_modules/uuid/dist/esm/v1.js +1 -1
  425. package/node_modules/uuid/dist/esm/v3.d.ts +1 -1
  426. package/node_modules/uuid/dist/esm/v35.d.ts +1 -1
  427. package/node_modules/uuid/dist/esm/v4.d.ts +1 -1
  428. package/node_modules/uuid/dist/esm/v5.d.ts +1 -1
  429. package/node_modules/uuid/dist/esm/v6.d.ts +1 -1
  430. package/node_modules/uuid/dist/esm/v7.d.ts +1 -1
  431. package/node_modules/uuid/dist/esm/v7.js +1 -1
  432. package/node_modules/uuid/dist/esm-browser/types.d.ts +1 -1
  433. package/node_modules/uuid/dist/esm-browser/v1.d.ts +1 -1
  434. package/node_modules/uuid/dist/esm-browser/v1.js +1 -1
  435. package/node_modules/uuid/dist/esm-browser/v3.d.ts +1 -1
  436. package/node_modules/uuid/dist/esm-browser/v35.d.ts +1 -1
  437. package/node_modules/uuid/dist/esm-browser/v4.d.ts +1 -1
  438. package/node_modules/uuid/dist/esm-browser/v5.d.ts +1 -1
  439. package/node_modules/uuid/dist/esm-browser/v6.d.ts +1 -1
  440. package/node_modules/uuid/dist/esm-browser/v7.d.ts +1 -1
  441. package/node_modules/uuid/dist/esm-browser/v7.js +1 -1
  442. package/node_modules/uuid/package.json +1 -1
  443. package/package.json +7 -7
  444. package/tak-registration.html +4 -4
  445. package/tak-registration.js +13 -6
  446. package/node_modules/axios/SECURITY.md +0 -6
  447. /package/node_modules/fast-xml-parser/src/{v5 → v6}/Report.js +0 -0
@@ -1,6 +1,6 @@
1
1
  /*!
2
- * protobuf.js v7.4.0 (c) 2016, daniel wirtz
3
- * compiled thu, 22 aug 2024 20:30:39 utc
2
+ * protobuf.js v7.5.2 (c) 2016, daniel wirtz
3
+ * compiled wed, 14 may 2025 19:25:30 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
- if (mtype.group) gen
1841
- ("if((t&7)===4)")
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.resolvedType.group
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.resolvedType.group
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.resolvedType.group
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
- return new Field(name, json.id, json.type, json.rule, json.extend, json.options, json.comment);
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 packed. Only relevant when repeated and working with proto2.
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
- // defaults to packed=true if not explicity set to false
2457
- if (this._packed === null)
2458
- this._packed = this.getOption("packed") !== false;
2459
- return this._packed;
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 === true || this.options.packed !== undefined && this.resolvedType && !(this.resolvedType instanceof Enum))
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,33 @@ 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
+
3519
3669
  var nested = this.nestedArray, i = 0;
3670
+ this.resolve();
3520
3671
  while (i < nested.length)
3521
3672
  if (nested[i] instanceof Namespace)
3522
3673
  nested[i++].resolveAll();
3523
3674
  else
3524
3675
  nested[i++].resolve();
3525
- return this.resolve();
3676
+ this._needsRecursiveResolve = false;
3677
+ return this;
3678
+ };
3679
+
3680
+ /**
3681
+ * @override
3682
+ */
3683
+ Namespace.prototype._resolveFeaturesRecursive = function _resolveFeaturesRecursive(edition) {
3684
+ if (!this._needsRecursiveFeatureResolution) return this;
3685
+ this._needsRecursiveFeatureResolution = false;
3686
+
3687
+ edition = this._edition || edition;
3688
+
3689
+ ReflectionObject.prototype._resolveFeaturesRecursive.call(this, edition);
3690
+ this.nestedArray.forEach(nested => {
3691
+ nested._resolveFeaturesRecursive(edition);
3692
+ });
3693
+ return this;
3526
3694
  };
3527
3695
 
3528
3696
  /**
@@ -3533,7 +3701,6 @@ Namespace.prototype.resolveAll = function resolveAll() {
3533
3701
  * @returns {ReflectionObject|null} Looked up object or `null` if none could be found
3534
3702
  */
3535
3703
  Namespace.prototype.lookup = function lookup(path, filterTypes, parentAlreadyChecked) {
3536
-
3537
3704
  /* istanbul ignore next */
3538
3705
  if (typeof filterTypes === "boolean") {
3539
3706
  parentAlreadyChecked = filterTypes;
@@ -3548,29 +3715,72 @@ Namespace.prototype.lookup = function lookup(path, filterTypes, parentAlreadyChe
3548
3715
  } else if (!path.length)
3549
3716
  return this;
3550
3717
 
3718
+ var flatPath = path.join(".");
3719
+
3551
3720
  // Start at root if path is absolute
3552
3721
  if (path[0] === "")
3553
3722
  return this.root.lookup(path.slice(1), filterTypes);
3554
3723
 
3724
+ // Early bailout for objects with matching absolute paths
3725
+ var found = this.root._fullyQualifiedObjects["." + flatPath];
3726
+ if (found && (!filterTypes || filterTypes.indexOf(found.constructor) > -1)) {
3727
+ return found;
3728
+ }
3729
+
3730
+ // Do a regular lookup at this namespace and below
3731
+ found = this._lookupImpl(path, flatPath);
3732
+ if (found && (!filterTypes || filterTypes.indexOf(found.constructor) > -1)) {
3733
+ return found;
3734
+ }
3735
+
3736
+ if (parentAlreadyChecked)
3737
+ return null;
3738
+
3739
+ // If there hasn't been a match, walk up the tree and look more broadly
3740
+ var current = this;
3741
+ while (current.parent) {
3742
+ found = current.parent._lookupImpl(path, flatPath);
3743
+ if (found && (!filterTypes || filterTypes.indexOf(found.constructor) > -1)) {
3744
+ return found;
3745
+ }
3746
+ current = current.parent;
3747
+ }
3748
+ return null;
3749
+ };
3750
+
3751
+ /**
3752
+ * Internal helper for lookup that handles searching just at this namespace and below along with caching.
3753
+ * @param {string[]} path Path to look up
3754
+ * @param {string} flatPath Flattened version of the path to use as a cache key
3755
+ * @returns {ReflectionObject|null} Looked up object or `null` if none could be found
3756
+ * @private
3757
+ */
3758
+ Namespace.prototype._lookupImpl = function lookup(path, flatPath) {
3759
+ if(Object.prototype.hasOwnProperty.call(this._lookupCache, flatPath)) {
3760
+ return this._lookupCache[flatPath];
3761
+ }
3762
+
3555
3763
  // Test if the first part matches any nested object, and if so, traverse if path contains more
3556
3764
  var found = this.get(path[0]);
3765
+ var exact = null;
3557
3766
  if (found) {
3558
3767
  if (path.length === 1) {
3559
- if (!filterTypes || filterTypes.indexOf(found.constructor) > -1)
3560
- return found;
3561
- } else if (found instanceof Namespace && (found = found.lookup(path.slice(1), filterTypes, true)))
3562
- return found;
3768
+ exact = found;
3769
+ } else if (found instanceof Namespace) {
3770
+ path = path.slice(1);
3771
+ exact = found._lookupImpl(path, path.join("."));
3772
+ }
3563
3773
 
3564
3774
  // Otherwise try each nested namespace
3565
- } else
3775
+ } else {
3566
3776
  for (var i = 0; i < this.nestedArray.length; ++i)
3567
- if (this._nestedArray[i] instanceof Namespace && (found = this._nestedArray[i].lookup(path, filterTypes, true)))
3568
- return found;
3777
+ if (this._nestedArray[i] instanceof Namespace && (found = this._nestedArray[i]._lookupImpl(path, flatPath)))
3778
+ exact = found;
3779
+ }
3569
3780
 
3570
- // If there hasn't been a match, try again at the parent
3571
- if (this.parent === null || parentAlreadyChecked)
3572
- return null;
3573
- return this.parent.lookup(path, filterTypes);
3781
+ // Set this even when null, so that when we walk up the tree we can quickly bail on repeated checks back down.
3782
+ this._lookupCache[flatPath] = exact;
3783
+ return exact;
3574
3784
  };
3575
3785
 
3576
3786
  /**
@@ -3653,10 +3863,17 @@ module.exports = ReflectionObject;
3653
3863
 
3654
3864
  ReflectionObject.className = "ReflectionObject";
3655
3865
 
3866
+ const OneOf = require(25);
3656
3867
  var util = require(37);
3657
3868
 
3658
3869
  var Root; // cyclic
3659
3870
 
3871
+ /* eslint-disable no-warning-comments */
3872
+ // TODO: Replace with embedded proto.
3873
+ var editions2023Defaults = {enum_type: "OPEN", field_presence: "EXPLICIT", json_format: "ALLOW", message_encoding: "LENGTH_PREFIXED", repeated_field_encoding: "PACKED", utf8_validation: "VERIFY"};
3874
+ var proto2Defaults = {enum_type: "CLOSED", field_presence: "EXPLICIT", json_format: "LEGACY_BEST_EFFORT", message_encoding: "LENGTH_PREFIXED", repeated_field_encoding: "EXPANDED", utf8_validation: "NONE"};
3875
+ var proto3Defaults = {enum_type: "OPEN", field_presence: "IMPLICIT", json_format: "ALLOW", message_encoding: "LENGTH_PREFIXED", repeated_field_encoding: "PACKED", utf8_validation: "VERIFY"};
3876
+
3660
3877
  /**
3661
3878
  * Constructs a new reflection object instance.
3662
3879
  * @classdesc Base class of all reflection objects.
@@ -3691,6 +3908,35 @@ function ReflectionObject(name, options) {
3691
3908
  */
3692
3909
  this.name = name;
3693
3910
 
3911
+ /**
3912
+ * The edition specified for this object. Only relevant for top-level objects.
3913
+ * @type {string}
3914
+ * @private
3915
+ */
3916
+ this._edition = null;
3917
+
3918
+ /**
3919
+ * The default edition to use for this object if none is specified. For legacy reasons,
3920
+ * this is proto2 except in the JSON parsing case where it was proto3.
3921
+ * @type {string}
3922
+ * @private
3923
+ */
3924
+ this._defaultEdition = "proto2";
3925
+
3926
+ /**
3927
+ * Resolved Features.
3928
+ * @type {object}
3929
+ * @private
3930
+ */
3931
+ this._features = {};
3932
+
3933
+ /**
3934
+ * Whether or not features have been resolved.
3935
+ * @type {boolean}
3936
+ * @private
3937
+ */
3938
+ this._featuresResolved = false;
3939
+
3694
3940
  /**
3695
3941
  * Parent namespace.
3696
3942
  * @type {Namespace|null}
@@ -3801,6 +4047,83 @@ ReflectionObject.prototype.resolve = function resolve() {
3801
4047
  return this;
3802
4048
  };
3803
4049
 
4050
+ /**
4051
+ * Resolves this objects editions features.
4052
+ * @param {string} edition The edition we're currently resolving for.
4053
+ * @returns {ReflectionObject} `this`
4054
+ */
4055
+ ReflectionObject.prototype._resolveFeaturesRecursive = function _resolveFeaturesRecursive(edition) {
4056
+ return this._resolveFeatures(this._edition || edition);
4057
+ };
4058
+
4059
+ /**
4060
+ * Resolves child features from parent features
4061
+ * @param {string} edition The edition we're currently resolving for.
4062
+ * @returns {undefined}
4063
+ */
4064
+ ReflectionObject.prototype._resolveFeatures = function _resolveFeatures(edition) {
4065
+ if (this._featuresResolved) {
4066
+ return;
4067
+ }
4068
+
4069
+ var defaults = {};
4070
+
4071
+ /* istanbul ignore if */
4072
+ if (!edition) {
4073
+ throw new Error("Unknown edition for " + this.fullName);
4074
+ }
4075
+
4076
+ var protoFeatures = Object.assign(this.options ? Object.assign({}, this.options.features) : {},
4077
+ this._inferLegacyProtoFeatures(edition));
4078
+
4079
+ if (this._edition) {
4080
+ // For a namespace marked with a specific edition, reset defaults.
4081
+ /* istanbul ignore else */
4082
+ if (edition === "proto2") {
4083
+ defaults = Object.assign({}, proto2Defaults);
4084
+ } else if (edition === "proto3") {
4085
+ defaults = Object.assign({}, proto3Defaults);
4086
+ } else if (edition === "2023") {
4087
+ defaults = Object.assign({}, editions2023Defaults);
4088
+ } else {
4089
+ throw new Error("Unknown edition: " + edition);
4090
+ }
4091
+ this._features = Object.assign(defaults, protoFeatures || {});
4092
+ this._featuresResolved = true;
4093
+ return;
4094
+ }
4095
+
4096
+ // fields in Oneofs aren't actually children of them, so we have to
4097
+ // special-case it
4098
+ /* istanbul ignore else */
4099
+ if (this.partOf instanceof OneOf) {
4100
+ var lexicalParentFeaturesCopy = Object.assign({}, this.partOf._features);
4101
+ this._features = Object.assign(lexicalParentFeaturesCopy, protoFeatures || {});
4102
+ } else if (this.declaringField) {
4103
+ // Skip feature resolution of sister fields.
4104
+ } else if (this.parent) {
4105
+ var parentFeaturesCopy = Object.assign({}, this.parent._features);
4106
+ this._features = Object.assign(parentFeaturesCopy, protoFeatures || {});
4107
+ } else {
4108
+ throw new Error("Unable to find a parent for " + this.fullName);
4109
+ }
4110
+ if (this.extensionField) {
4111
+ // Sister fields should have the same features as their extensions.
4112
+ this.extensionField._features = this._features;
4113
+ }
4114
+ this._featuresResolved = true;
4115
+ };
4116
+
4117
+ /**
4118
+ * Infers features from legacy syntax that may have been specified differently.
4119
+ * in older editions.
4120
+ * @param {string|undefined} edition The edition this proto is on, or undefined if pre-editions
4121
+ * @returns {object} The feature values to override
4122
+ */
4123
+ ReflectionObject.prototype._inferLegacyProtoFeatures = function _inferLegacyProtoFeatures(/*edition*/) {
4124
+ return {};
4125
+ };
4126
+
3804
4127
  /**
3805
4128
  * Gets an option value.
3806
4129
  * @param {string} name Option name
@@ -3816,12 +4139,19 @@ ReflectionObject.prototype.getOption = function getOption(name) {
3816
4139
  * Sets an option.
3817
4140
  * @param {string} name Option name
3818
4141
  * @param {*} value Option value
3819
- * @param {boolean} [ifNotSet] Sets the option only if it isn't currently set
4142
+ * @param {boolean|undefined} [ifNotSet] Sets the option only if it isn't currently set
3820
4143
  * @returns {ReflectionObject} `this`
3821
4144
  */
3822
4145
  ReflectionObject.prototype.setOption = function setOption(name, value, ifNotSet) {
3823
- if (!ifNotSet || !this.options || this.options[name] === undefined)
3824
- (this.options || (this.options = {}))[name] = value;
4146
+ if (!this.options)
4147
+ this.options = {};
4148
+ if (/^features\./.test(name)) {
4149
+ util.setProperty(this.options, name, value, ifNotSet);
4150
+ } else if (!ifNotSet || this.options[name] === undefined) {
4151
+ if (this.getOption(name) !== value) this.resolved = false;
4152
+ this.options[name] = value;
4153
+ }
4154
+
3825
4155
  return this;
3826
4156
  };
3827
4157
 
@@ -3845,10 +4175,11 @@ ReflectionObject.prototype.setParsedOption = function setParsedOption(name, valu
3845
4175
  });
3846
4176
  if (opt) {
3847
4177
  // If we found an existing option - just merge the property value
4178
+ // (If it's a feature, will just write over)
3848
4179
  var newValue = opt[name];
3849
4180
  util.setProperty(newValue, propName, value);
3850
4181
  } else {
3851
- // otherwise, create a new option, set it's property and add it to the list
4182
+ // otherwise, create a new option, set its property and add it to the list
3852
4183
  opt = {};
3853
4184
  opt[name] = util.setProperty({}, propName, value);
3854
4185
  parsedOptions.push(opt);
@@ -3859,6 +4190,7 @@ ReflectionObject.prototype.setParsedOption = function setParsedOption(name, valu
3859
4190
  newOpt[name] = value;
3860
4191
  parsedOptions.push(newOpt);
3861
4192
  }
4193
+
3862
4194
  return this;
3863
4195
  };
3864
4196
 
@@ -3887,12 +4219,25 @@ ReflectionObject.prototype.toString = function toString() {
3887
4219
  return className;
3888
4220
  };
3889
4221
 
4222
+ /**
4223
+ * Converts the edition this object is pinned to for JSON format.
4224
+ * @returns {string|undefined} The edition string for JSON representation
4225
+ */
4226
+ ReflectionObject.prototype._editionToJSON = function _editionToJSON() {
4227
+ if (!this._edition || this._edition === "proto3") {
4228
+ // Avoid emitting proto3 since we need to default to it for backwards
4229
+ // compatibility anyway.
4230
+ return undefined;
4231
+ }
4232
+ return this._edition;
4233
+ };
4234
+
3890
4235
  // Sets up cyclic dependencies (called in index-light)
3891
4236
  ReflectionObject._configure = function(Root_) {
3892
4237
  Root = Root_;
3893
4238
  };
3894
4239
 
3895
- },{"37":37}],25:[function(require,module,exports){
4240
+ },{"25":25,"37":37}],25:[function(require,module,exports){
3896
4241
  "use strict";
3897
4242
  module.exports = OneOf;
3898
4243
 
@@ -4066,6 +4411,25 @@ OneOf.prototype.onRemove = function onRemove(parent) {
4066
4411
  ReflectionObject.prototype.onRemove.call(this, parent);
4067
4412
  };
4068
4413
 
4414
+ /**
4415
+ * Determines whether this field corresponds to a synthetic oneof created for
4416
+ * a proto3 optional field. No behavioral logic should depend on this, but it
4417
+ * can be relevant for reflection.
4418
+ * @name OneOf#isProto3Optional
4419
+ * @type {boolean}
4420
+ * @readonly
4421
+ */
4422
+ Object.defineProperty(OneOf.prototype, "isProto3Optional", {
4423
+ get: function() {
4424
+ if (this.fieldsArray == null || this.fieldsArray.length !== 1) {
4425
+ return false;
4426
+ }
4427
+
4428
+ var field = this.fieldsArray[0];
4429
+ return field.options != null && field.options["proto3_optional"] === true;
4430
+ }
4431
+ });
4432
+
4069
4433
  /**
4070
4434
  * Decorator function as returned by {@link OneOf.d} (TypeScript).
4071
4435
  * @typedef OneOfDecorator
@@ -4113,6 +4477,7 @@ var tokenize = require(34),
4113
4477
  Enum = require(15),
4114
4478
  Service = require(33),
4115
4479
  Method = require(22),
4480
+ ReflectionObject = require(24),
4116
4481
  types = require(36),
4117
4482
  util = require(37);
4118
4483
 
@@ -4124,8 +4489,7 @@ var base10Re = /^[1-9][0-9]*$/,
4124
4489
  base8NegRe = /^-?0[0-7]+$/,
4125
4490
  numberRe = /^(?![eE])[0-9]*(?:\.[0-9]*)?(?:[eE][+-]?[0-9]+)?$/,
4126
4491
  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]*)+$/;
4492
+ typeRefRe = /^(?:\.?[a-zA-Z_][a-zA-Z_0-9]*)(?:\.[a-zA-Z_][a-zA-Z_0-9]*)*$/;
4129
4493
 
4130
4494
  /**
4131
4495
  * Result object returned from {@link parse}.
@@ -4133,7 +4497,6 @@ var base10Re = /^[1-9][0-9]*$/,
4133
4497
  * @property {string|undefined} package Package name, if declared
4134
4498
  * @property {string[]|undefined} imports Imports, if any
4135
4499
  * @property {string[]|undefined} weakImports Weak imports, if any
4136
- * @property {string|undefined} syntax Syntax, if specified (either `"proto2"` or `"proto3"`)
4137
4500
  * @property {Root} root Populated root instance
4138
4501
  */
4139
4502
 
@@ -4181,13 +4544,25 @@ function parse(source, root, options) {
4181
4544
  pkg,
4182
4545
  imports,
4183
4546
  weakImports,
4184
- syntax,
4185
- isProto3 = false;
4547
+ edition = "proto2";
4186
4548
 
4187
4549
  var ptr = root;
4188
4550
 
4551
+ var topLevelObjects = [];
4552
+ var topLevelOptions = {};
4553
+
4189
4554
  var applyCase = options.keepCase ? function(name) { return name; } : util.camelCase;
4190
4555
 
4556
+ function resolveFileFeatures() {
4557
+ topLevelObjects.forEach(obj => {
4558
+ obj._edition = edition;
4559
+ Object.keys(topLevelOptions).forEach(opt => {
4560
+ if (obj.getOption(opt) !== undefined) return;
4561
+ obj.setOption(opt, topLevelOptions[opt], true);
4562
+ });
4563
+ });
4564
+ }
4565
+
4191
4566
  /* istanbul ignore next */
4192
4567
  function illegal(token, name, insideTryCatch) {
4193
4568
  var filename = parse.filename;
@@ -4226,7 +4601,6 @@ function parse(source, root, options) {
4226
4601
  try {
4227
4602
  return parseNumber(token, /* insideTryCatch */ true);
4228
4603
  } catch (e) {
4229
-
4230
4604
  /* istanbul ignore else */
4231
4605
  if (acceptTypeRef && typeRefRe.test(token))
4232
4606
  return token;
@@ -4239,10 +4613,23 @@ function parse(source, root, options) {
4239
4613
  function readRanges(target, acceptStrings) {
4240
4614
  var token, start;
4241
4615
  do {
4242
- if (acceptStrings && ((token = peek()) === "\"" || token === "'"))
4243
- target.push(readString());
4244
- else
4245
- target.push([ start = parseId(next()), skip("to", true) ? parseId(next()) : start ]);
4616
+ if (acceptStrings && ((token = peek()) === "\"" || token === "'")) {
4617
+ var str = readString();
4618
+ target.push(str);
4619
+ if (edition >= 2023) {
4620
+ throw illegal(str, "id");
4621
+ }
4622
+ } else {
4623
+ try {
4624
+ target.push([ start = parseId(next()), skip("to", true) ? parseId(next()) : start ]);
4625
+ } catch (err) {
4626
+ if (acceptStrings && typeRefRe.test(token) && edition >= 2023) {
4627
+ target.push(token);
4628
+ } else {
4629
+ throw err;
4630
+ }
4631
+ }
4632
+ }
4246
4633
  } while (skip(",", true));
4247
4634
  var dummy = {options: undefined};
4248
4635
  dummy.setOption = function(name, value) {
@@ -4319,7 +4706,6 @@ function parse(source, root, options) {
4319
4706
  }
4320
4707
 
4321
4708
  function parsePackage() {
4322
-
4323
4709
  /* istanbul ignore if */
4324
4710
  if (pkg !== undefined)
4325
4711
  throw illegal("package");
@@ -4331,6 +4717,7 @@ function parse(source, root, options) {
4331
4717
  throw illegal(pkg, "name");
4332
4718
 
4333
4719
  ptr = ptr.define(pkg);
4720
+
4334
4721
  skip(";");
4335
4722
  }
4336
4723
 
@@ -4356,20 +4743,28 @@ function parse(source, root, options) {
4356
4743
 
4357
4744
  function parseSyntax() {
4358
4745
  skip("=");
4359
- syntax = readString();
4360
- isProto3 = syntax === "proto3";
4746
+ edition = readString();
4361
4747
 
4362
4748
  /* istanbul ignore if */
4363
- if (!isProto3 && syntax !== "proto2")
4364
- throw illegal(syntax, "syntax");
4749
+ if (edition < 2023)
4750
+ throw illegal(edition, "syntax");
4365
4751
 
4366
- // Syntax is needed to understand the meaning of the optional field rule
4367
- // Otherwise the meaning is ambiguous between proto2 and proto3
4368
- root.setOption("syntax", syntax);
4752
+ skip(";");
4753
+ }
4754
+
4755
+ function parseEdition() {
4756
+ skip("=");
4757
+ edition = readString();
4758
+ const supportedEditions = ["2023"];
4759
+
4760
+ /* istanbul ignore if */
4761
+ if (!supportedEditions.includes(edition))
4762
+ throw illegal(edition, "edition");
4369
4763
 
4370
4764
  skip(";");
4371
4765
  }
4372
4766
 
4767
+
4373
4768
  function parseCommon(parent, token) {
4374
4769
  switch (token) {
4375
4770
 
@@ -4437,14 +4832,19 @@ function parse(source, root, options) {
4437
4832
  break;
4438
4833
 
4439
4834
  case "required":
4835
+ if (edition !== "proto2")
4836
+ throw illegal(token);
4837
+ /* eslint-disable no-fallthrough */
4440
4838
  case "repeated":
4441
4839
  parseField(type, token);
4442
4840
  break;
4443
4841
 
4444
4842
  case "optional":
4445
4843
  /* istanbul ignore if */
4446
- if (isProto3) {
4844
+ if (edition === "proto3") {
4447
4845
  parseField(type, "proto3_optional");
4846
+ } else if (edition !== "proto2") {
4847
+ throw illegal(token);
4448
4848
  } else {
4449
4849
  parseField(type, "optional");
4450
4850
  }
@@ -4464,8 +4864,9 @@ function parse(source, root, options) {
4464
4864
 
4465
4865
  default:
4466
4866
  /* istanbul ignore if */
4467
- if (!isProto3 || !typeRefRe.test(token))
4867
+ if (edition === "proto2" || !typeRefRe.test(token)) {
4468
4868
  throw illegal(token);
4869
+ }
4469
4870
 
4470
4871
  push(token);
4471
4872
  parseField(type, "optional");
@@ -4473,6 +4874,9 @@ function parse(source, root, options) {
4473
4874
  }
4474
4875
  });
4475
4876
  parent.add(type);
4877
+ if (parent === ptr) {
4878
+ topLevelObjects.push(type);
4879
+ }
4476
4880
  }
4477
4881
 
4478
4882
  function parseField(parent, rule, extend) {
@@ -4499,6 +4903,7 @@ function parse(source, root, options) {
4499
4903
  var name = next();
4500
4904
 
4501
4905
  /* istanbul ignore if */
4906
+
4502
4907
  if (!nameRe.test(name))
4503
4908
  throw illegal(name, "name");
4504
4909
 
@@ -4506,6 +4911,7 @@ function parse(source, root, options) {
4506
4911
  skip("=");
4507
4912
 
4508
4913
  var field = new Field(name, parseId(next()), type, rule, extend);
4914
+
4509
4915
  ifBlock(field, function parseField_block(token) {
4510
4916
 
4511
4917
  /* istanbul ignore else */
@@ -4528,15 +4934,15 @@ function parse(source, root, options) {
4528
4934
  } else {
4529
4935
  parent.add(field);
4530
4936
  }
4531
-
4532
- // JSON defaults to packed=true if not set so we have to set packed=false explicity when
4533
- // parsing proto2 descriptors without the option, where applicable. This must be done for
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);
4937
+ if (parent === ptr) {
4938
+ topLevelObjects.push(field);
4939
+ }
4537
4940
  }
4538
4941
 
4539
4942
  function parseGroup(parent, rule) {
4943
+ if (edition >= 2023) {
4944
+ throw illegal("group");
4945
+ }
4540
4946
  var name = next();
4541
4947
 
4542
4948
  /* istanbul ignore if */
@@ -4559,7 +4965,6 @@ function parse(source, root, options) {
4559
4965
  parseOption(type, token);
4560
4966
  skip(";");
4561
4967
  break;
4562
-
4563
4968
  case "required":
4564
4969
  case "repeated":
4565
4970
  parseField(type, token);
@@ -4567,7 +4972,7 @@ function parse(source, root, options) {
4567
4972
 
4568
4973
  case "optional":
4569
4974
  /* istanbul ignore if */
4570
- if (isProto3) {
4975
+ if (edition === "proto3") {
4571
4976
  parseField(type, "proto3_optional");
4572
4977
  } else {
4573
4978
  parseField(type, "optional");
@@ -4582,6 +4987,10 @@ function parse(source, root, options) {
4582
4987
  parseEnum(type, token);
4583
4988
  break;
4584
4989
 
4990
+ case "reserved":
4991
+ readRanges(type.reserved || (type.reserved = []), true);
4992
+ break;
4993
+
4585
4994
  /* istanbul ignore next */
4586
4995
  default:
4587
4996
  throw illegal(token); // there are no groups with proto3 semantics
@@ -4665,6 +5074,7 @@ function parse(source, root, options) {
4665
5074
 
4666
5075
  case "reserved":
4667
5076
  readRanges(enm.reserved || (enm.reserved = []), true);
5077
+ if(enm.reserved === undefined) enm.reserved = [];
4668
5078
  break;
4669
5079
 
4670
5080
  default:
@@ -4672,6 +5082,9 @@ function parse(source, root, options) {
4672
5082
  }
4673
5083
  });
4674
5084
  parent.add(enm);
5085
+ if (parent === ptr) {
5086
+ topLevelObjects.push(enm);
5087
+ }
4675
5088
  }
4676
5089
 
4677
5090
  function parseEnumValue(parent, token) {
@@ -4685,10 +5098,14 @@ function parse(source, root, options) {
4685
5098
  dummy = {
4686
5099
  options: undefined
4687
5100
  };
5101
+ dummy.getOption = function(name) {
5102
+ return this.options[name];
5103
+ };
4688
5104
  dummy.setOption = function(name, value) {
4689
- if (this.options === undefined)
4690
- this.options = {};
4691
- this.options[name] = value;
5105
+ ReflectionObject.prototype.setOption.call(dummy, name, value);
5106
+ };
5107
+ dummy.setParsedOption = function() {
5108
+ return undefined;
4692
5109
  };
4693
5110
  ifBlock(dummy, function parseEnumValue_block(token) {
4694
5111
 
@@ -4702,34 +5119,42 @@ function parse(source, root, options) {
4702
5119
  }, function parseEnumValue_line() {
4703
5120
  parseInlineOptions(dummy); // skip
4704
5121
  });
4705
- parent.add(token, value, dummy.comment, dummy.options);
5122
+ parent.add(token, value, dummy.comment, dummy.parsedOptions || dummy.options);
4706
5123
  }
4707
5124
 
4708
5125
  function parseOption(parent, token) {
4709
- var isCustom = skip("(", true);
4710
-
4711
- /* istanbul ignore if */
4712
- if (!typeRefRe.test(token = next()))
4713
- throw illegal(token, "name");
4714
-
4715
- var name = token;
4716
- var option = name;
4717
- var propName;
5126
+ var option;
5127
+ var propName;
5128
+ var isOption = true;
5129
+ if (token === "option") {
5130
+ token = next();
5131
+ }
4718
5132
 
4719
- if (isCustom) {
4720
- skip(")");
4721
- name = "(" + name + ")";
4722
- option = name;
4723
- token = peek();
4724
- if (fqTypeRefRe.test(token)) {
4725
- propName = token.slice(1); //remove '.' before property name
4726
- name += token;
4727
- next();
5133
+ while (token !== "=") {
5134
+ if (token === "(") {
5135
+ var parensValue = next();
5136
+ skip(")");
5137
+ token = "(" + parensValue + ")";
5138
+ }
5139
+ if (isOption) {
5140
+ isOption = false;
5141
+ if (token.includes(".") && !token.includes("(")) {
5142
+ var tokens = token.split(".");
5143
+ option = tokens[0] + ".";
5144
+ token = tokens[1];
5145
+ continue;
5146
+ }
5147
+ option = token;
5148
+ } else {
5149
+ propName = propName ? propName += token : token;
5150
+ }
5151
+ token = next();
4728
5152
  }
4729
- }
4730
- skip("=");
4731
- var optionValue = parseOptionValue(parent, name);
4732
- setParsedOption(parent, option, optionValue, propName);
5153
+ var name = propName ? option.concat(propName) : option;
5154
+ var optionValue = parseOptionValue(parent, name);
5155
+ propName = propName && propName[0] === "." ? propName.slice(1) : propName;
5156
+ option = option && option[option.length - 1] === "." ? option.slice(0, -1) : option;
5157
+ setParsedOption(parent, option, optionValue, propName);
4733
5158
  }
4734
5159
 
4735
5160
  function parseOptionValue(parent, name) {
@@ -4751,12 +5176,12 @@ function parse(source, root, options) {
4751
5176
 
4752
5177
  skip(":", true);
4753
5178
 
4754
- if (peek() === "{")
4755
- value = parseOptionValue(parent, name + "." + token);
4756
- else if (peek() === "[") {
5179
+ if (peek() === "{") {
4757
5180
  // option (my_option) = {
4758
5181
  // repeated_value: [ "foo", "bar" ]
4759
5182
  // };
5183
+ value = parseOptionValue(parent, name + "." + token);
5184
+ } else if (peek() === "[") {
4760
5185
  value = [];
4761
5186
  var lastValue;
4762
5187
  if (skip("[", true)) {
@@ -4796,6 +5221,10 @@ function parse(source, root, options) {
4796
5221
  }
4797
5222
 
4798
5223
  function setOption(parent, name, value) {
5224
+ if (ptr === parent && /^features\./.test(name)) {
5225
+ topLevelOptions[name] = value;
5226
+ return;
5227
+ }
4799
5228
  if (parent.setOption)
4800
5229
  parent.setOption(name, value);
4801
5230
  }
@@ -4823,8 +5252,9 @@ function parse(source, root, options) {
4823
5252
 
4824
5253
  var service = new Service(token);
4825
5254
  ifBlock(service, function parseService_block(token) {
4826
- if (parseCommon(service, token))
5255
+ if (parseCommon(service, token)) {
4827
5256
  return;
5257
+ }
4828
5258
 
4829
5259
  /* istanbul ignore else */
4830
5260
  if (token === "rpc")
@@ -4833,6 +5263,9 @@ function parse(source, root, options) {
4833
5263
  throw illegal(token);
4834
5264
  });
4835
5265
  parent.add(service);
5266
+ if (parent === ptr) {
5267
+ topLevelObjects.push(service);
5268
+ }
4836
5269
  }
4837
5270
 
4838
5271
  function parseMethod(parent, token) {
@@ -4902,7 +5335,7 @@ function parse(source, root, options) {
4902
5335
 
4903
5336
  case "optional":
4904
5337
  /* istanbul ignore if */
4905
- if (isProto3) {
5338
+ if (edition === "proto3") {
4906
5339
  parseField(parent, "proto3_optional", reference);
4907
5340
  } else {
4908
5341
  parseField(parent, "optional", reference);
@@ -4911,7 +5344,7 @@ function parse(source, root, options) {
4911
5344
 
4912
5345
  default:
4913
5346
  /* istanbul ignore if */
4914
- if (!isProto3 || !typeRefRe.test(token))
5347
+ if (edition === "proto2" || !typeRefRe.test(token))
4915
5348
  throw illegal(token);
4916
5349
  push(token);
4917
5350
  parseField(parent, "optional", reference);
@@ -4951,10 +5384,16 @@ function parse(source, root, options) {
4951
5384
  parseSyntax();
4952
5385
  break;
4953
5386
 
4954
- case "option":
5387
+ case "edition":
5388
+ /* istanbul ignore if */
5389
+ if (!head)
5390
+ throw illegal(token);
5391
+ parseEdition();
5392
+ break;
4955
5393
 
5394
+ case "option":
4956
5395
  parseOption(ptr, token);
4957
- skip(";");
5396
+ skip(";", true);
4958
5397
  break;
4959
5398
 
4960
5399
  default:
@@ -4970,12 +5409,13 @@ function parse(source, root, options) {
4970
5409
  }
4971
5410
  }
4972
5411
 
5412
+ resolveFileFeatures();
5413
+
4973
5414
  parse.filename = null;
4974
5415
  return {
4975
5416
  "package" : pkg,
4976
5417
  "imports" : imports,
4977
5418
  weakImports : weakImports,
4978
- syntax : syntax,
4979
5419
  root : root
4980
5420
  };
4981
5421
  }
@@ -4992,7 +5432,7 @@ function parse(source, root, options) {
4992
5432
  * @variation 2
4993
5433
  */
4994
5434
 
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){
5435
+ },{"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
5436
  "use strict";
4997
5437
  module.exports = Reader;
4998
5438
 
@@ -5501,11 +5941,25 @@ function Root(options) {
5501
5941
  * @type {string[]}
5502
5942
  */
5503
5943
  this.files = [];
5944
+
5945
+ /**
5946
+ * Edition, defaults to proto2 if unspecified.
5947
+ * @type {string}
5948
+ * @private
5949
+ */
5950
+ this._edition = "proto2";
5951
+
5952
+ /**
5953
+ * Global lookup cache of fully qualified names.
5954
+ * @type {Object.<string,ReflectionObject>}
5955
+ * @private
5956
+ */
5957
+ this._fullyQualifiedObjects = {};
5504
5958
  }
5505
5959
 
5506
5960
  /**
5507
5961
  * Loads a namespace descriptor into a root namespace.
5508
- * @param {INamespace} json Nameespace descriptor
5962
+ * @param {INamespace} json Namespace descriptor
5509
5963
  * @param {Root} [root] Root namespace, defaults to create a new one if omitted
5510
5964
  * @returns {Root} Root namespace
5511
5965
  */
@@ -5514,7 +5968,7 @@ Root.fromJSON = function fromJSON(json, root) {
5514
5968
  root = new Root();
5515
5969
  if (json.options)
5516
5970
  root.setOptions(json.options);
5517
- return root.addJSON(json.nested);
5971
+ return root.addJSON(json.nested).resolveAll();
5518
5972
  };
5519
5973
 
5520
5974
  /**
@@ -5554,18 +6008,24 @@ Root.prototype.load = function load(filename, options, callback) {
5554
6008
  options = undefined;
5555
6009
  }
5556
6010
  var self = this;
5557
- if (!callback)
6011
+ if (!callback) {
5558
6012
  return util.asPromise(load, self, filename, options);
6013
+ }
5559
6014
 
5560
6015
  var sync = callback === SYNC; // undocumented
5561
6016
 
5562
6017
  // Finishes loading by calling the callback (exactly once)
5563
6018
  function finish(err, root) {
6019
+ if (root) {
6020
+ root.resolveAll();
6021
+ }
5564
6022
  /* istanbul ignore if */
5565
- if (!callback)
6023
+ if (!callback) {
5566
6024
  return;
5567
- if (sync)
6025
+ }
6026
+ if (sync) {
5568
6027
  throw err;
6028
+ }
5569
6029
  var cb = callback;
5570
6030
  callback = null;
5571
6031
  cb(err, root);
@@ -5605,8 +6065,9 @@ Root.prototype.load = function load(filename, options, callback) {
5605
6065
  } catch (err) {
5606
6066
  finish(err);
5607
6067
  }
5608
- if (!sync && !queued)
6068
+ if (!sync && !queued) {
5609
6069
  finish(null, self); // only once anyway
6070
+ }
5610
6071
  }
5611
6072
 
5612
6073
  // Fetches a single file
@@ -5614,15 +6075,16 @@ Root.prototype.load = function load(filename, options, callback) {
5614
6075
  filename = getBundledFileName(filename) || filename;
5615
6076
 
5616
6077
  // Skip if already loaded / attempted
5617
- if (self.files.indexOf(filename) > -1)
6078
+ if (self.files.indexOf(filename) > -1) {
5618
6079
  return;
6080
+ }
5619
6081
  self.files.push(filename);
5620
6082
 
5621
6083
  // Shortcut bundled definitions
5622
6084
  if (filename in common) {
5623
- if (sync)
6085
+ if (sync) {
5624
6086
  process(filename, common[filename]);
5625
- else {
6087
+ } else {
5626
6088
  ++queued;
5627
6089
  setTimeout(function() {
5628
6090
  --queued;
@@ -5648,8 +6110,9 @@ Root.prototype.load = function load(filename, options, callback) {
5648
6110
  self.fetch(filename, function(err, source) {
5649
6111
  --queued;
5650
6112
  /* istanbul ignore if */
5651
- if (!callback)
6113
+ if (!callback) {
5652
6114
  return; // terminated meanwhile
6115
+ }
5653
6116
  if (err) {
5654
6117
  /* istanbul ignore else */
5655
6118
  if (!weak)
@@ -5666,17 +6129,21 @@ Root.prototype.load = function load(filename, options, callback) {
5666
6129
 
5667
6130
  // Assembling the root namespace doesn't require working type
5668
6131
  // references anymore, so we can load everything in parallel
5669
- if (util.isString(filename))
6132
+ if (util.isString(filename)) {
5670
6133
  filename = [ filename ];
6134
+ }
5671
6135
  for (var i = 0, resolved; i < filename.length; ++i)
5672
6136
  if (resolved = self.resolvePath("", filename[i]))
5673
6137
  fetch(resolved);
5674
-
5675
- if (sync)
6138
+ if (sync) {
6139
+ self.resolveAll();
5676
6140
  return self;
5677
- if (!queued)
6141
+ }
6142
+ if (!queued) {
5678
6143
  finish(null, self);
5679
- return undefined;
6144
+ }
6145
+
6146
+ return self;
5680
6147
  };
5681
6148
  // function load(filename:string, options:IParseOptions, callback:LoadCallback):undefined
5682
6149
 
@@ -5718,10 +6185,13 @@ Root.prototype.loadSync = function loadSync(filename, options) {
5718
6185
  * @override
5719
6186
  */
5720
6187
  Root.prototype.resolveAll = function resolveAll() {
6188
+ if (!this._needsRecursiveResolve) return this;
6189
+
5721
6190
  if (this.deferred.length)
5722
6191
  throw Error("unresolvable extensions: " + this.deferred.map(function(field) {
5723
6192
  return "'extend " + field.extend + "' in " + field.parent.fullName;
5724
6193
  }).join(", "));
6194
+ this._resolveFeaturesRecursive(this._edition);
5725
6195
  return Namespace.prototype.resolveAll.call(this);
5726
6196
  };
5727
6197
 
@@ -5784,6 +6254,11 @@ Root.prototype._handleAdd = function _handleAdd(object) {
5784
6254
  object.parent[object.name] = object; // expose namespace as property of its parent
5785
6255
  }
5786
6256
 
6257
+ if (object instanceof Type || object instanceof Enum || object instanceof Field) {
6258
+ // Only store types and enums for quick lookup during resolve.
6259
+ this._fullyQualifiedObjects[object.fullName] = object;
6260
+ }
6261
+
5787
6262
  // The above also adds uppercased (and thus conflict-free) nested types, services and enums as
5788
6263
  // properties of namespaces just like static code does. This allows using a .d.ts generated for
5789
6264
  // a static module with reflection-based solutions where the condition is met.
@@ -5824,6 +6299,8 @@ Root.prototype._handleRemove = function _handleRemove(object) {
5824
6299
  delete object.parent[object.name]; // unexpose namespaces
5825
6300
 
5826
6301
  }
6302
+
6303
+ delete this._fullyQualifiedObjects[object.fullName];
5827
6304
  };
5828
6305
 
5829
6306
  // Sets up cyclic dependencies (called in index-light)
@@ -6095,7 +6572,10 @@ Service.fromJSON = function fromJSON(name, json) {
6095
6572
  service.add(Method.fromJSON(names[i], json.methods[names[i]]));
6096
6573
  if (json.nested)
6097
6574
  service.addJSON(json.nested);
6575
+ if (json.edition)
6576
+ service._edition = json.edition;
6098
6577
  service.comment = json.comment;
6578
+ service._defaultEdition = "proto3"; // For backwards-compatibility.
6099
6579
  return service;
6100
6580
  };
6101
6581
 
@@ -6108,6 +6588,7 @@ Service.prototype.toJSON = function toJSON(toJSONOptions) {
6108
6588
  var inherited = Namespace.prototype.toJSON.call(this, toJSONOptions);
6109
6589
  var keepComments = toJSONOptions ? Boolean(toJSONOptions.keepComments) : false;
6110
6590
  return util.toObject([
6591
+ "edition" , this._editionToJSON(),
6111
6592
  "options" , inherited && inherited.options || undefined,
6112
6593
  "methods" , Namespace.arrayToJSON(this.methodsArray, toJSONOptions) || /* istanbul ignore next */ {},
6113
6594
  "nested" , inherited && inherited.nested || undefined,
@@ -6144,10 +6625,28 @@ Service.prototype.get = function get(name) {
6144
6625
  * @override
6145
6626
  */
6146
6627
  Service.prototype.resolveAll = function resolveAll() {
6628
+ if (!this._needsRecursiveResolve) return this;
6629
+
6630
+ Namespace.prototype.resolve.call(this);
6147
6631
  var methods = this.methodsArray;
6148
6632
  for (var i = 0; i < methods.length; ++i)
6149
6633
  methods[i].resolve();
6150
- return Namespace.prototype.resolve.call(this);
6634
+ return this;
6635
+ };
6636
+
6637
+ /**
6638
+ * @override
6639
+ */
6640
+ Service.prototype._resolveFeaturesRecursive = function _resolveFeaturesRecursive(edition) {
6641
+ if (!this._needsRecursiveFeatureResolution) return this;
6642
+
6643
+ edition = this._edition || edition;
6644
+
6645
+ Namespace.prototype._resolveFeaturesRecursive.call(this, edition);
6646
+ this.methodsArray.forEach(method => {
6647
+ method._resolveFeaturesRecursive(edition);
6648
+ });
6649
+ return this;
6151
6650
  };
6152
6651
 
6153
6652
  /**
@@ -6897,6 +7396,9 @@ Type.fromJSON = function fromJSON(name, json) {
6897
7396
  type.group = true;
6898
7397
  if (json.comment)
6899
7398
  type.comment = json.comment;
7399
+ if (json.edition)
7400
+ type._edition = json.edition;
7401
+ type._defaultEdition = "proto3"; // For backwards-compatibility.
6900
7402
  return type;
6901
7403
  };
6902
7404
 
@@ -6909,6 +7411,7 @@ Type.prototype.toJSON = function toJSON(toJSONOptions) {
6909
7411
  var inherited = Namespace.prototype.toJSON.call(this, toJSONOptions);
6910
7412
  var keepComments = toJSONOptions ? Boolean(toJSONOptions.keepComments) : false;
6911
7413
  return util.toObject([
7414
+ "edition" , this._editionToJSON(),
6912
7415
  "options" , inherited && inherited.options || undefined,
6913
7416
  "oneofs" , Namespace.arrayToJSON(this.oneofsArray, toJSONOptions),
6914
7417
  "fields" , Namespace.arrayToJSON(this.fieldsArray.filter(function(obj) { return !obj.declaringField; }), toJSONOptions) || {},
@@ -6924,13 +7427,34 @@ Type.prototype.toJSON = function toJSON(toJSONOptions) {
6924
7427
  * @override
6925
7428
  */
6926
7429
  Type.prototype.resolveAll = function resolveAll() {
6927
- var fields = this.fieldsArray, i = 0;
6928
- while (i < fields.length)
6929
- fields[i++].resolve();
7430
+ if (!this._needsRecursiveResolve) return this;
7431
+
7432
+ Namespace.prototype.resolveAll.call(this);
6930
7433
  var oneofs = this.oneofsArray; i = 0;
6931
7434
  while (i < oneofs.length)
6932
7435
  oneofs[i++].resolve();
6933
- return Namespace.prototype.resolveAll.call(this);
7436
+ var fields = this.fieldsArray, i = 0;
7437
+ while (i < fields.length)
7438
+ fields[i++].resolve();
7439
+ return this;
7440
+ };
7441
+
7442
+ /**
7443
+ * @override
7444
+ */
7445
+ Type.prototype._resolveFeaturesRecursive = function _resolveFeaturesRecursive(edition) {
7446
+ if (!this._needsRecursiveFeatureResolution) return this;
7447
+
7448
+ edition = this._edition || edition;
7449
+
7450
+ Namespace.prototype._resolveFeaturesRecursive.call(this, edition);
7451
+ this.oneofsArray.forEach(oneof => {
7452
+ oneof._resolveFeatures(edition);
7453
+ });
7454
+ this.fieldsArray.forEach(field => {
7455
+ field._resolveFeatures(edition);
7456
+ });
7457
+ return this;
6934
7458
  };
6935
7459
 
6936
7460
  /**
@@ -7585,9 +8109,10 @@ util.decorateEnum = function decorateEnum(object) {
7585
8109
  * @param {Object.<string,*>} dst Destination object
7586
8110
  * @param {string} path dot '.' delimited path of the property to set
7587
8111
  * @param {Object} value the value to set
8112
+ * @param {boolean|undefined} [ifNotSet] Sets the option only if it isn't currently set
7588
8113
  * @returns {Object.<string,*>} Destination object
7589
8114
  */
7590
- util.setProperty = function setProperty(dst, path, value) {
8115
+ util.setProperty = function setProperty(dst, path, value, ifNotSet) {
7591
8116
  function setProp(dst, path, value) {
7592
8117
  var part = path.shift();
7593
8118
  if (part === "__proto__" || part === "prototype") {
@@ -7597,6 +8122,8 @@ util.setProperty = function setProperty(dst, path, value) {
7597
8122
  dst[part] = setProp(dst[part] || {}, path, value);
7598
8123
  } else {
7599
8124
  var prevValue = dst[part];
8125
+ if (prevValue && ifNotSet)
8126
+ return dst;
7600
8127
  if (prevValue)
7601
8128
  value = [].concat(prevValue).concat(value);
7602
8129
  dst[part] = value;