@openclaw/feishu 2026.6.8-beta.2 → 2026.6.9-beta.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (281) hide show
  1. package/dist/api.js +78 -23
  2. package/dist/{channel-DwygSth-.js → channel-C9mW5kaS.js} +2 -2
  3. package/dist/channel-plugin-api.js +1 -1
  4. package/dist/{channel.runtime-CrqKcXaU.js → channel.runtime-BgUhHAja.js} +3 -3
  5. package/dist/{drive-8o3Omlnd.js → drive-9UfpmY27.js} +15 -2
  6. package/dist/{monitor-_1eNsUVp.js → monitor-BayUOr_U.js} +1 -1
  7. package/dist/{monitor.account-BhoLA1Y0.js → monitor.account-DzZWj0ob.js} +92 -48
  8. package/dist/{send-B3kteMF8.js → send-BozRcrbz.js} +32 -24
  9. package/dist/setup-api.js +1 -1
  10. package/node_modules/@protobufjs/aspromise/LICENSE +26 -0
  11. package/node_modules/@protobufjs/aspromise/README.md +13 -0
  12. package/node_modules/{protobufjs/src/util/aspromise.d.ts → @protobufjs/aspromise/index.d.ts} +13 -13
  13. package/node_modules/{protobufjs/src/util/aspromise.js → @protobufjs/aspromise/index.js} +52 -52
  14. package/node_modules/@protobufjs/aspromise/package.json +21 -0
  15. package/node_modules/@protobufjs/aspromise/tests/index.js +130 -0
  16. package/node_modules/@protobufjs/base64/LICENSE +26 -0
  17. package/node_modules/@protobufjs/base64/README.md +19 -0
  18. package/node_modules/{protobufjs/src/util/base64.d.ts → @protobufjs/base64/index.d.ts} +32 -32
  19. package/node_modules/{protobufjs/src/util/base64.js → @protobufjs/base64/index.js} +139 -146
  20. package/node_modules/@protobufjs/base64/package.json +21 -0
  21. package/node_modules/@protobufjs/base64/tests/index.js +46 -0
  22. package/node_modules/@protobufjs/codegen/LICENSE +26 -0
  23. package/node_modules/@protobufjs/codegen/README.md +49 -0
  24. package/node_modules/{protobufjs/src/util/codegen.d.ts → @protobufjs/codegen/index.d.ts} +31 -31
  25. package/node_modules/{protobufjs/src/util/codegen.js → @protobufjs/codegen/index.js} +112 -113
  26. package/node_modules/@protobufjs/codegen/package.json +13 -0
  27. package/node_modules/@protobufjs/codegen/tests/index.js +13 -0
  28. package/node_modules/@protobufjs/eventemitter/CHANGELOG.md +8 -0
  29. package/node_modules/@protobufjs/eventemitter/LICENSE +26 -0
  30. package/node_modules/@protobufjs/eventemitter/README.md +22 -0
  31. package/node_modules/{protobufjs/src/util/eventemitter.d.ts → @protobufjs/eventemitter/index.d.ts} +45 -45
  32. package/node_modules/{protobufjs/src/util/eventemitter.js → @protobufjs/eventemitter/index.js} +86 -86
  33. package/node_modules/@protobufjs/eventemitter/package.json +21 -0
  34. package/node_modules/@protobufjs/eventemitter/tests/index.js +83 -0
  35. package/node_modules/@protobufjs/fetch/CHANGELOG.md +8 -0
  36. package/node_modules/@protobufjs/fetch/LICENSE +26 -0
  37. package/node_modules/@protobufjs/fetch/README.md +13 -0
  38. package/node_modules/{protobufjs/src/util/fetch.d.ts → @protobufjs/fetch/index.d.ts} +56 -56
  39. package/node_modules/{protobufjs/src/util/fetch.js → @protobufjs/fetch/index.js} +112 -112
  40. package/node_modules/@protobufjs/fetch/package.json +27 -0
  41. package/node_modules/@protobufjs/fetch/tests/data/file.txt +1 -0
  42. package/node_modules/@protobufjs/fetch/tests/index.js +158 -0
  43. package/node_modules/@protobufjs/fetch/util/fs.js +11 -0
  44. package/node_modules/@protobufjs/float/LICENSE +26 -0
  45. package/node_modules/@protobufjs/float/README.md +102 -0
  46. package/node_modules/@protobufjs/float/bench/index.js +87 -0
  47. package/node_modules/@protobufjs/float/bench/suite.js +46 -0
  48. package/node_modules/{protobufjs/src/util/float.js → @protobufjs/float/index.js} +335 -335
  49. package/node_modules/@protobufjs/float/package.json +26 -0
  50. package/node_modules/@protobufjs/float/tests/index.js +100 -0
  51. package/node_modules/@protobufjs/inquire/CHANGELOG.md +8 -0
  52. package/node_modules/@protobufjs/inquire/LICENSE +26 -0
  53. package/node_modules/@protobufjs/inquire/README.md +13 -0
  54. package/node_modules/{protobufjs/src/util/inquire.d.ts → @protobufjs/inquire/index.d.ts} +10 -10
  55. package/node_modules/{protobufjs/src/util/inquire.js → @protobufjs/inquire/index.js} +38 -38
  56. package/node_modules/@protobufjs/inquire/package.json +21 -0
  57. package/node_modules/@protobufjs/inquire/tests/data/array.js +1 -0
  58. package/node_modules/@protobufjs/inquire/tests/data/emptyArray.js +1 -0
  59. package/node_modules/@protobufjs/inquire/tests/data/emptyObject.js +1 -0
  60. package/node_modules/@protobufjs/inquire/tests/data/object.js +1 -0
  61. package/node_modules/@protobufjs/inquire/tests/index.js +20 -0
  62. package/node_modules/@protobufjs/path/LICENSE +26 -0
  63. package/node_modules/@protobufjs/path/README.md +19 -0
  64. package/node_modules/{protobufjs/src/util/path.d.ts → @protobufjs/path/index.d.ts} +22 -22
  65. package/node_modules/{protobufjs/src/util/path.js → @protobufjs/path/index.js} +65 -72
  66. package/node_modules/@protobufjs/path/package.json +21 -0
  67. package/node_modules/@protobufjs/path/tests/index.js +60 -0
  68. package/node_modules/@protobufjs/pool/.npmignore +3 -0
  69. package/node_modules/@protobufjs/pool/LICENSE +26 -0
  70. package/node_modules/@protobufjs/pool/README.md +13 -0
  71. package/node_modules/{protobufjs/src/util/pool.d.ts → @protobufjs/pool/index.d.ts} +32 -32
  72. package/node_modules/{protobufjs/src/util/pool.js → @protobufjs/pool/index.js} +48 -48
  73. package/node_modules/@protobufjs/pool/package.json +21 -0
  74. package/node_modules/@protobufjs/pool/tests/index.js +33 -0
  75. package/node_modules/@protobufjs/utf8/LICENSE +26 -0
  76. package/node_modules/@protobufjs/utf8/README.md +20 -0
  77. package/node_modules/{protobufjs/src/util/utf8.d.ts → @protobufjs/utf8/index.d.ts} +24 -24
  78. package/node_modules/{protobufjs/src/util/utf8.js → @protobufjs/utf8/index.js} +104 -130
  79. package/node_modules/@protobufjs/utf8/package.json +21 -0
  80. package/node_modules/@protobufjs/utf8/tests/data/surrogate_pair_bug.txt +207 -0
  81. package/node_modules/@protobufjs/utf8/tests/data/utf8.txt +216 -0
  82. package/node_modules/@protobufjs/utf8/tests/index.js +74 -0
  83. package/node_modules/@types/node/LICENSE +21 -0
  84. package/node_modules/@types/node/README.md +15 -0
  85. package/node_modules/@types/node/assert/strict.d.ts +59 -0
  86. package/node_modules/@types/node/assert.d.ts +950 -0
  87. package/node_modules/@types/node/async_hooks.d.ts +711 -0
  88. package/node_modules/@types/node/buffer.buffer.d.ts +466 -0
  89. package/node_modules/@types/node/buffer.d.ts +1765 -0
  90. package/node_modules/@types/node/child_process.d.ts +1366 -0
  91. package/node_modules/@types/node/cluster.d.ts +432 -0
  92. package/node_modules/@types/node/compatibility/iterators.d.ts +21 -0
  93. package/node_modules/@types/node/console.d.ts +93 -0
  94. package/node_modules/@types/node/constants.d.ts +14 -0
  95. package/node_modules/@types/node/crypto.d.ts +4058 -0
  96. package/node_modules/@types/node/dgram.d.ts +537 -0
  97. package/node_modules/@types/node/diagnostics_channel.d.ts +552 -0
  98. package/node_modules/@types/node/dns/promises.d.ts +497 -0
  99. package/node_modules/@types/node/dns.d.ts +876 -0
  100. package/node_modules/@types/node/domain.d.ts +150 -0
  101. package/node_modules/@types/node/events.d.ts +1008 -0
  102. package/node_modules/@types/node/fs/promises.d.ts +1468 -0
  103. package/node_modules/@types/node/fs.d.ts +4780 -0
  104. package/node_modules/@types/node/globals.d.ts +150 -0
  105. package/node_modules/@types/node/globals.typedarray.d.ts +101 -0
  106. package/node_modules/@types/node/http.d.ts +2147 -0
  107. package/node_modules/@types/node/http2.d.ts +2485 -0
  108. package/node_modules/@types/node/https.d.ts +400 -0
  109. package/node_modules/@types/node/index.d.ts +117 -0
  110. package/node_modules/@types/node/inspector/promises.d.ts +35 -0
  111. package/node_modules/@types/node/inspector.d.ts +264 -0
  112. package/node_modules/@types/node/inspector.generated.d.ts +4406 -0
  113. package/node_modules/@types/node/module.d.ts +755 -0
  114. package/node_modules/@types/node/net.d.ts +970 -0
  115. package/node_modules/@types/node/os.d.ts +498 -0
  116. package/node_modules/@types/node/package.json +155 -0
  117. package/node_modules/@types/node/path/posix.d.ts +8 -0
  118. package/node_modules/@types/node/path/win32.d.ts +8 -0
  119. package/node_modules/@types/node/path.d.ts +178 -0
  120. package/node_modules/@types/node/perf_hooks.d.ts +612 -0
  121. package/node_modules/@types/node/process.d.ts +2204 -0
  122. package/node_modules/@types/node/punycode.d.ts +89 -0
  123. package/node_modules/@types/node/querystring.d.ts +139 -0
  124. package/node_modules/@types/node/quic.d.ts +897 -0
  125. package/node_modules/@types/node/readline/promises.d.ts +158 -0
  126. package/node_modules/@types/node/readline.d.ts +507 -0
  127. package/node_modules/@types/node/repl.d.ts +420 -0
  128. package/node_modules/@types/node/sea.d.ts +47 -0
  129. package/node_modules/@types/node/sqlite.d.ts +1068 -0
  130. package/node_modules/@types/node/stream/consumers.d.ts +114 -0
  131. package/node_modules/@types/node/stream/iter.d.ts +301 -0
  132. package/node_modules/@types/node/stream/promises.d.ts +211 -0
  133. package/node_modules/@types/node/stream/web.d.ts +300 -0
  134. package/node_modules/@types/node/stream.d.ts +1774 -0
  135. package/node_modules/@types/node/string_decoder.d.ts +27 -0
  136. package/node_modules/@types/node/test/reporters.d.ts +59 -0
  137. package/node_modules/@types/node/test.d.ts +2279 -0
  138. package/node_modules/@types/node/timers/promises.d.ts +93 -0
  139. package/node_modules/@types/node/timers.d.ts +149 -0
  140. package/node_modules/@types/node/tls.d.ts +1193 -0
  141. package/node_modules/@types/node/trace_events.d.ts +103 -0
  142. package/node_modules/@types/node/ts5.6/buffer.buffer.d.ts +462 -0
  143. package/node_modules/@types/node/ts5.6/compatibility/float16array.d.ts +71 -0
  144. package/node_modules/@types/node/ts5.6/globals.typedarray.d.ts +36 -0
  145. package/node_modules/@types/node/ts5.6/index.d.ts +119 -0
  146. package/node_modules/@types/node/ts5.7/compatibility/float16array.d.ts +72 -0
  147. package/node_modules/@types/node/ts5.7/index.d.ts +119 -0
  148. package/node_modules/@types/node/tty.d.ts +225 -0
  149. package/node_modules/@types/node/url.d.ts +556 -0
  150. package/node_modules/@types/node/util/types.d.ts +558 -0
  151. package/node_modules/@types/node/util.d.ts +1677 -0
  152. package/node_modules/@types/node/v8.d.ts +980 -0
  153. package/node_modules/@types/node/vm.d.ts +1136 -0
  154. package/node_modules/@types/node/wasi.d.ts +131 -0
  155. package/node_modules/@types/node/web-globals/abortcontroller.d.ts +59 -0
  156. package/node_modules/@types/node/web-globals/blob.d.ts +23 -0
  157. package/node_modules/@types/node/web-globals/console.d.ts +9 -0
  158. package/node_modules/@types/node/web-globals/crypto.d.ts +39 -0
  159. package/node_modules/@types/node/web-globals/domexception.d.ts +68 -0
  160. package/node_modules/@types/node/web-globals/encoding.d.ts +11 -0
  161. package/node_modules/@types/node/web-globals/events.d.ts +106 -0
  162. package/node_modules/@types/node/web-globals/fetch.d.ts +69 -0
  163. package/node_modules/@types/node/web-globals/importmeta.d.ts +13 -0
  164. package/node_modules/@types/node/web-globals/messaging.d.ts +23 -0
  165. package/node_modules/@types/node/web-globals/navigator.d.ts +25 -0
  166. package/node_modules/@types/node/web-globals/performance.d.ts +45 -0
  167. package/node_modules/@types/node/web-globals/storage.d.ts +24 -0
  168. package/node_modules/@types/node/web-globals/streams.d.ts +115 -0
  169. package/node_modules/@types/node/web-globals/timers.d.ts +44 -0
  170. package/node_modules/@types/node/web-globals/url.d.ts +24 -0
  171. package/node_modules/@types/node/worker_threads.d.ts +671 -0
  172. package/node_modules/@types/node/zlib/iter.d.ts +131 -0
  173. package/node_modules/@types/node/zlib.d.ts +589 -0
  174. package/node_modules/protobufjs/README.md +556 -263
  175. package/node_modules/protobufjs/dist/light/protobuf.js +1569 -1919
  176. package/node_modules/protobufjs/dist/light/protobuf.js.map +1 -1
  177. package/node_modules/protobufjs/dist/light/protobuf.min.js +3 -3
  178. package/node_modules/protobufjs/dist/light/protobuf.min.js.map +1 -1
  179. package/node_modules/protobufjs/dist/minimal/protobuf.js +906 -1132
  180. package/node_modules/protobufjs/dist/minimal/protobuf.js.map +1 -1
  181. package/node_modules/protobufjs/dist/minimal/protobuf.min.js +3 -3
  182. package/node_modules/protobufjs/dist/minimal/protobuf.min.js.map +1 -1
  183. package/node_modules/protobufjs/dist/protobuf.js +1576 -1993
  184. package/node_modules/protobufjs/dist/protobuf.js.map +1 -1
  185. package/node_modules/protobufjs/dist/protobuf.min.js +3 -3
  186. package/node_modules/protobufjs/dist/protobuf.min.js.map +1 -1
  187. package/node_modules/protobufjs/ext/descriptor/README.md +70 -3
  188. package/node_modules/protobufjs/ext/descriptor/index.d.ts +193 -0
  189. package/node_modules/protobufjs/ext/descriptor/index.js +1185 -1
  190. package/node_modules/protobufjs/ext/descriptor/test.js +54 -0
  191. package/node_modules/protobufjs/index.d.ts +720 -834
  192. package/node_modules/protobufjs/package.json +44 -20
  193. package/node_modules/protobufjs/src/converter.js +36 -60
  194. package/node_modules/protobufjs/src/decoder.js +53 -124
  195. package/node_modules/protobufjs/src/encoder.js +2 -10
  196. package/node_modules/protobufjs/src/enum.js +3 -8
  197. package/node_modules/protobufjs/src/field.js +11 -13
  198. package/node_modules/protobufjs/src/index-light.js +1 -1
  199. package/node_modules/protobufjs/src/mapfield.js +0 -1
  200. package/node_modules/protobufjs/src/message.js +11 -5
  201. package/node_modules/protobufjs/src/method.js +4 -5
  202. package/node_modules/protobufjs/src/namespace.js +3 -10
  203. package/node_modules/protobufjs/src/object.js +20 -20
  204. package/node_modules/protobufjs/src/oneof.js +0 -3
  205. package/node_modules/protobufjs/src/parse.js +16 -78
  206. package/node_modules/protobufjs/src/reader.js +31 -136
  207. package/node_modules/protobufjs/src/reader_buffer.js +3 -24
  208. package/node_modules/protobufjs/src/root.js +3 -7
  209. package/node_modules/protobufjs/src/roots.js +1 -1
  210. package/node_modules/protobufjs/src/service.js +6 -13
  211. package/node_modules/protobufjs/src/tokenize.js +1 -6
  212. package/node_modules/protobufjs/src/type.js +30 -44
  213. package/node_modules/protobufjs/src/typescript.jsdoc +15 -0
  214. package/node_modules/protobufjs/src/util/minimal.js +12 -36
  215. package/node_modules/protobufjs/src/util.js +17 -6
  216. package/node_modules/protobufjs/src/verifier.js +6 -6
  217. package/node_modules/protobufjs/src/wrappers.js +1 -0
  218. package/node_modules/protobufjs/src/writer.js +16 -42
  219. package/node_modules/protobufjs/src/writer_buffer.js +1 -18
  220. package/node_modules/protobufjs/tsconfig.json +5 -3
  221. package/node_modules/undici-types/LICENSE +21 -0
  222. package/node_modules/undici-types/README.md +6 -0
  223. package/node_modules/undici-types/agent.d.ts +32 -0
  224. package/node_modules/undici-types/api.d.ts +43 -0
  225. package/node_modules/undici-types/balanced-pool.d.ts +30 -0
  226. package/node_modules/undici-types/cache-interceptor.d.ts +179 -0
  227. package/node_modules/undici-types/cache.d.ts +36 -0
  228. package/node_modules/undici-types/client-stats.d.ts +15 -0
  229. package/node_modules/undici-types/client.d.ts +123 -0
  230. package/node_modules/undici-types/connector.d.ts +36 -0
  231. package/node_modules/undici-types/content-type.d.ts +21 -0
  232. package/node_modules/undici-types/cookies.d.ts +30 -0
  233. package/node_modules/undici-types/diagnostics-channel.d.ts +74 -0
  234. package/node_modules/undici-types/dispatcher.d.ts +279 -0
  235. package/node_modules/undici-types/env-http-proxy-agent.d.ts +22 -0
  236. package/node_modules/undici-types/errors.d.ts +177 -0
  237. package/node_modules/undici-types/eventsource.d.ts +66 -0
  238. package/node_modules/undici-types/fetch.d.ts +211 -0
  239. package/node_modules/undici-types/formdata.d.ts +108 -0
  240. package/node_modules/undici-types/global-dispatcher.d.ts +9 -0
  241. package/node_modules/undici-types/global-origin.d.ts +7 -0
  242. package/node_modules/undici-types/h2c-client.d.ts +73 -0
  243. package/node_modules/undici-types/handlers.d.ts +15 -0
  244. package/node_modules/undici-types/header.d.ts +160 -0
  245. package/node_modules/undici-types/index.d.ts +91 -0
  246. package/node_modules/undici-types/interceptors.d.ts +80 -0
  247. package/node_modules/undici-types/mock-agent.d.ts +68 -0
  248. package/node_modules/undici-types/mock-call-history.d.ts +111 -0
  249. package/node_modules/undici-types/mock-client.d.ts +27 -0
  250. package/node_modules/undici-types/mock-errors.d.ts +12 -0
  251. package/node_modules/undici-types/mock-interceptor.d.ts +94 -0
  252. package/node_modules/undici-types/mock-pool.d.ts +27 -0
  253. package/node_modules/undici-types/package.json +55 -0
  254. package/node_modules/undici-types/patch.d.ts +29 -0
  255. package/node_modules/undici-types/pool-stats.d.ts +19 -0
  256. package/node_modules/undici-types/pool.d.ts +41 -0
  257. package/node_modules/undici-types/proxy-agent.d.ts +29 -0
  258. package/node_modules/undici-types/readable.d.ts +68 -0
  259. package/node_modules/undici-types/retry-agent.d.ts +8 -0
  260. package/node_modules/undici-types/retry-handler.d.ts +125 -0
  261. package/node_modules/undici-types/round-robin-pool.d.ts +41 -0
  262. package/node_modules/undici-types/snapshot-agent.d.ts +109 -0
  263. package/node_modules/undici-types/socks5-proxy-agent.d.ts +25 -0
  264. package/node_modules/undici-types/util.d.ts +18 -0
  265. package/node_modules/undici-types/utility.d.ts +7 -0
  266. package/node_modules/undici-types/webidl.d.ts +347 -0
  267. package/node_modules/undici-types/websocket.d.ts +188 -0
  268. package/npm-shrinkwrap.json +95 -6
  269. package/package.json +4 -4
  270. package/skills/feishu-wiki/SKILL.md +10 -1
  271. package/node_modules/protobufjs/ext/README.md +0 -81
  272. package/node_modules/protobufjs/ext/descriptor.d.ts +0 -86
  273. package/node_modules/protobufjs/ext/descriptor.generated.d.ts +0 -409
  274. package/node_modules/protobufjs/ext/descriptor.js +0 -1266
  275. package/node_modules/protobufjs/ext/textformat.d.ts +0 -19
  276. package/node_modules/protobufjs/ext/textformat.generated.d.ts +0 -11
  277. package/node_modules/protobufjs/ext/textformat.js +0 -1235
  278. package/node_modules/protobufjs/google/protobuf/compiler/plugin.json +0 -126
  279. package/node_modules/protobufjs/google/protobuf/compiler/plugin.proto +0 -47
  280. package/node_modules/protobufjs/src/typescript.js +0 -25
  281. /package/node_modules/{protobufjs/src/util/float.d.ts → @protobufjs/float/index.d.ts} +0 -0
@@ -11,7 +11,7 @@ var Enum = require("./enum"),
11
11
 
12
12
  var Type; // cyclic
13
13
 
14
- var ruleRe = /^(?:required|optional|repeated)$/;
14
+ var ruleRe = /^required|optional|repeated$/;
15
15
 
16
16
  /**
17
17
  * Constructs a new message field instance. Note that {@link MapField|map fields} have their own class.
@@ -86,6 +86,9 @@ function Field(name, id, type, rule, extend, options, comment) {
86
86
  * Field rule, if any.
87
87
  * @type {string|undefined}
88
88
  */
89
+ if (rule === "proto3_optional") {
90
+ rule = "optional";
91
+ }
89
92
  this.rule = rule && rule !== "optional" ? rule : undefined; // toJSON
90
93
 
91
94
  /**
@@ -256,12 +259,10 @@ Field.prototype.setOption = function setOption(name, value, ifNotSet) {
256
259
  /**
257
260
  * Field descriptor.
258
261
  * @interface IField
259
- * @property {string} [edition] Edition
260
262
  * @property {string} [rule="optional"] Field rule
261
263
  * @property {string} type Field type
262
264
  * @property {number} id Field id
263
265
  * @property {Object.<string,*>} [options] Field options
264
- * @property {string|null} [comment] Field comment
265
266
  */
266
267
 
267
268
  /**
@@ -351,8 +352,8 @@ Field.prototype.resolve = function resolve() {
351
352
  this.defaultValue = this.typeDefault;
352
353
 
353
354
  // ensure proper value on prototype
354
- if (this.parent instanceof Type && this.parent._ctor)
355
- this.parent._ctor.prototype[this.name] = this.defaultValue;
355
+ if (this.parent instanceof Type)
356
+ this.parent.ctor.prototype[this.name] = this.defaultValue;
356
357
 
357
358
  return ReflectionObject.prototype.resolve.call(this);
358
359
  };
@@ -404,7 +405,6 @@ Field.prototype._resolveFeatures = function _resolveFeatures(edition) {
404
405
  * @param {Object} prototype Target prototype
405
406
  * @param {string} fieldName Field name
406
407
  * @returns {undefined}
407
- * @deprecated Legacy TypeScript decorator support. Will be removed in a future release.
408
408
  */
409
409
 
410
410
  /**
@@ -417,7 +417,6 @@ Field.prototype._resolveFeatures = function _resolveFeatures(edition) {
417
417
  * @param {T} [defaultValue] Default value
418
418
  * @returns {FieldDecorator} Decorator function
419
419
  * @template T extends number | number[] | Long | Long[] | string | string[] | boolean | boolean[] | Uint8Array | Uint8Array[] | Buffer | Buffer[]
420
- * @deprecated Legacy TypeScript decorator support. Will be removed in a future release.
421
420
  */
422
421
  Field.d = function decorateField(fieldId, fieldType, fieldRule, defaultValue) {
423
422
 
@@ -435,11 +434,6 @@ Field.d = function decorateField(fieldId, fieldType, fieldRule, defaultValue) {
435
434
  };
436
435
  };
437
436
 
438
- // Sets up cyclic dependencies (called in index-light)
439
- Field._configure = function configure(Type_) {
440
- Type = Type_;
441
- };
442
-
443
437
  /**
444
438
  * Field decorator (TypeScript).
445
439
  * @name Field.d
@@ -450,6 +444,10 @@ Field._configure = function configure(Type_) {
450
444
  * @returns {FieldDecorator} Decorator function
451
445
  * @template T extends Message<T>
452
446
  * @variation 2
453
- * @deprecated Legacy TypeScript decorator support. Will be removed in a future release.
454
447
  */
455
448
  // like Field.d but without a default value
449
+
450
+ // Sets up cyclic dependencies (called in index-light)
451
+ Field._configure = function configure(Type_) {
452
+ Type = Type_;
453
+ };
@@ -100,5 +100,5 @@ protobuf.util = require("./util");
100
100
  // Set up possibly cyclic reflection dependencies
101
101
  protobuf.ReflectionObject._configure(protobuf.Root);
102
102
  protobuf.Namespace._configure(protobuf.Type, protobuf.Service, protobuf.Enum);
103
- protobuf.Root._configure(protobuf.Type, undefined, {});
103
+ protobuf.Root._configure(protobuf.Type);
104
104
  protobuf.Field._configure(protobuf.Type);
@@ -108,7 +108,6 @@ MapField.prototype.resolve = function resolve() {
108
108
  * @param {"double"|"float"|"int32"|"uint32"|"sint32"|"fixed32"|"sfixed32"|"int64"|"uint64"|"sint64"|"fixed64"|"sfixed64"|"bool"|"string"|"bytes"|Object|Constructor<{}>} fieldValueType Field value type
109
109
  * @returns {FieldDecorator} Decorator function
110
110
  * @template T extends { [key: string]: number | Long | string | boolean | Uint8Array | Buffer | number[] | Message<{}> }
111
- * @deprecated Legacy TypeScript decorator support. Will be removed in a future release.
112
111
  */
113
112
  MapField.d = function decorateMapField(fieldId, fieldKeyType, fieldValueType) {
114
113
 
@@ -8,15 +8,17 @@ var util = require("./util/minimal");
8
8
  * @classdesc Abstract runtime message.
9
9
  * @constructor
10
10
  * @param {Properties<T>} [properties] Properties to set
11
- * @property {Array.<Uint8Array>} [$unknowns] Unknown fields preserved while decoding
12
11
  * @template T extends object = object
13
12
  */
14
13
  function Message(properties) {
15
14
  // not used internally
16
15
  if (properties)
17
- for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
18
- if (properties[keys[i]] != null && keys[i] !== "__proto__")
19
- this[keys[i]] = properties[keys[i]];
16
+ for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) {
17
+ var key = keys[i];
18
+ if (key === "__proto__")
19
+ continue;
20
+ this[key] = properties[key];
21
+ }
20
22
  }
21
23
 
22
24
  /**
@@ -33,10 +35,12 @@ function Message(properties) {
33
35
  * @readonly
34
36
  */
35
37
 
38
+ /*eslint-disable valid-jsdoc*/
39
+
36
40
  /**
37
41
  * Creates a new message of this type using the specified properties.
38
42
  * @param {Object.<string,*>} [properties] Properties to set
39
- * @returns {T} Message instance
43
+ * @returns {Message<T>} Message instance
40
44
  * @template T extends Message<T>
41
45
  * @this Constructor<T>
42
46
  */
@@ -135,3 +139,5 @@ Message.toObject = function toObject(message, options) {
135
139
  Message.prototype.toJSON = function toJSON() {
136
140
  return this.$type.toObject(this, util.toJSONOptions);
137
141
  };
142
+
143
+ /*eslint-enable valid-jsdoc*/
@@ -20,7 +20,7 @@ var util = require("./util");
20
20
  * @param {boolean|Object.<string,*>} [responseStream] Whether the response is streamed
21
21
  * @param {Object.<string,*>} [options] Declared options
22
22
  * @param {string} [comment] The comment for this method
23
- * @param {Array.<Object.<string,*>>} [parsedOptions] Declared options, properly parsed into objects
23
+ * @param {Object.<string,*>} [parsedOptions] Declared options, properly parsed into an object
24
24
  */
25
25
  function Method(name, type, requestType, responseType, requestStream, responseStream, options, comment, parsedOptions) {
26
26
 
@@ -96,8 +96,7 @@ function Method(name, type, requestType, responseType, requestStream, responseSt
96
96
  this.comment = comment;
97
97
 
98
98
  /**
99
- * Options properly parsed into objects
100
- * @type {Array.<Object.<string,*>>|undefined}
99
+ * Options properly parsed into an object
101
100
  */
102
101
  this.parsedOptions = parsedOptions;
103
102
  }
@@ -111,8 +110,8 @@ function Method(name, type, requestType, responseType, requestStream, responseSt
111
110
  * @property {boolean} [requestStream=false] Whether requests are streamed
112
111
  * @property {boolean} [responseStream=false] Whether responses are streamed
113
112
  * @property {Object.<string,*>} [options] Method options
114
- * @property {string|null} [comment] Method comment
115
- * @property {Array.<Object.<string,*>>} [parsedOptions] Method options properly parsed into objects
113
+ * @property {string} comment Method comments
114
+ * @property {Object.<string,*>} [parsedOptions] Method options properly parsed into an object
116
115
  */
117
116
 
118
117
  /**
@@ -34,10 +34,7 @@ var Type, // cyclic
34
34
  * @throws {TypeError} If arguments are invalid
35
35
  */
36
36
  Namespace.fromJSON = function fromJSON(name, json, depth) {
37
- if (depth === undefined)
38
- depth = 0;
39
- if (depth > util.recursionLimit)
40
- throw Error("max depth exceeded");
37
+ depth = util.checkDepth(depth);
41
38
  return new Namespace(name, json.options).addJSON(json.nested, depth);
42
39
  };
43
40
 
@@ -200,10 +197,7 @@ Namespace.prototype.toJSON = function toJSON(toJSONOptions) {
200
197
  * @returns {Namespace} `this`
201
198
  */
202
199
  Namespace.prototype.addJSON = function addJSON(nestedJson, depth) {
203
- if (depth === undefined)
204
- depth = 0;
205
- if (depth > util.recursionLimit)
206
- throw Error("max depth exceeded");
200
+ depth = util.checkDepth(depth);
207
201
  var ns = this;
208
202
  /* istanbul ignore else */
209
203
  if (nestedJson) {
@@ -368,8 +362,7 @@ Namespace.prototype.define = function define(path, json) {
368
362
  Namespace.prototype.resolveAll = function resolveAll() {
369
363
  if (!this._needsRecursiveResolve) return this;
370
364
 
371
- if (this._needsRecursiveFeatureResolution)
372
- this._resolveFeaturesRecursive(this._edition);
365
+ this._resolveFeaturesRecursive(this._edition);
373
366
 
374
367
  var nested = this.nestedArray, i = 0;
375
368
  this.resolve();
@@ -10,10 +10,9 @@ var Root; // cyclic
10
10
 
11
11
  /* eslint-disable no-warning-comments */
12
12
  // TODO: Replace with embedded proto.
13
- var editions2024Defaults = {enum_type: "OPEN", field_presence: "EXPLICIT", json_format: "ALLOW", message_encoding: "LENGTH_PREFIXED", repeated_field_encoding: "PACKED", utf8_validation: "VERIFY", enforce_naming_style: "STYLE2024", default_symbol_visibility: "EXPORT_TOP_LEVEL" };
14
- var editions2023Defaults = {enum_type: "OPEN", field_presence: "EXPLICIT", json_format: "ALLOW", message_encoding: "LENGTH_PREFIXED", repeated_field_encoding: "PACKED", utf8_validation: "VERIFY", enforce_naming_style: "STYLE_LEGACY", default_symbol_visibility: "EXPORT_ALL" };
15
- var proto2Defaults = {enum_type: "CLOSED", field_presence: "EXPLICIT", json_format: "LEGACY_BEST_EFFORT", message_encoding: "LENGTH_PREFIXED", repeated_field_encoding: "EXPANDED", utf8_validation: "NONE", enforce_naming_style: "STYLE_LEGACY", default_symbol_visibility: "EXPORT_ALL" };
16
- var proto3Defaults = {enum_type: "OPEN", field_presence: "IMPLICIT", json_format: "ALLOW", message_encoding: "LENGTH_PREFIXED", repeated_field_encoding: "PACKED", utf8_validation: "VERIFY", enforce_naming_style: "STYLE_LEGACY", default_symbol_visibility: "EXPORT_ALL" };
13
+ var editions2023Defaults = {enum_type: "OPEN", field_presence: "EXPLICIT", json_format: "ALLOW", message_encoding: "LENGTH_PREFIXED", repeated_field_encoding: "PACKED", utf8_validation: "VERIFY"};
14
+ var proto2Defaults = {enum_type: "CLOSED", field_presence: "EXPLICIT", json_format: "LEGACY_BEST_EFFORT", message_encoding: "LENGTH_PREFIXED", repeated_field_encoding: "EXPANDED", utf8_validation: "NONE"};
15
+ var proto3Defaults = {enum_type: "OPEN", field_presence: "IMPLICIT", json_format: "ALLOW", message_encoding: "LENGTH_PREFIXED", repeated_field_encoding: "PACKED", utf8_validation: "VERIFY"};
17
16
 
18
17
  /**
19
18
  * Constructs a new reflection object instance.
@@ -142,6 +141,7 @@ Object.defineProperties(ReflectionObject.prototype, {
142
141
  /**
143
142
  * Converts this reflection object to its descriptor representation.
144
143
  * @returns {Object.<string,*>} Descriptor
144
+ * @abstract
145
145
  */
146
146
  ReflectionObject.prototype.toJSON = /* istanbul ignore next */ function toJSON() {
147
147
  throw Error(); // not implemented, shouldn't happen
@@ -225,27 +225,27 @@ ReflectionObject.prototype._resolveFeatures = function _resolveFeatures(edition)
225
225
  defaults = Object.assign({}, proto3Defaults);
226
226
  } else if (edition === "2023") {
227
227
  defaults = Object.assign({}, editions2023Defaults);
228
- } else if (edition === "2024") {
229
- defaults = Object.assign({}, editions2024Defaults);
230
228
  } else {
231
229
  throw new Error("Unknown edition: " + edition);
232
230
  }
233
231
  this._features = util.merge(defaults, protoFeatures);
232
+ this._featuresResolved = true;
233
+ return;
234
+ }
235
+
236
+ // fields in Oneofs aren't actually children of them, so we have to
237
+ // special-case it
238
+ /* istanbul ignore else */
239
+ if (this.partOf instanceof OneOf) {
240
+ var lexicalParentFeaturesCopy = util.merge({}, this.partOf._features);
241
+ this._features = util.merge(lexicalParentFeaturesCopy, protoFeatures);
242
+ } else if (this.declaringField) {
243
+ // Skip feature resolution of sister fields.
244
+ } else if (this.parent) {
245
+ var parentFeaturesCopy = util.merge({}, this.parent._features);
246
+ this._features = util.merge(parentFeaturesCopy, protoFeatures);
234
247
  } else {
235
- // fields in Oneofs aren't actually children of them, so we have to
236
- // special-case it
237
- /* istanbul ignore else */
238
- if (this.partOf instanceof OneOf) {
239
- var lexicalParentFeaturesCopy = util.merge({}, this.partOf._features);
240
- this._features = util.merge(lexicalParentFeaturesCopy, protoFeatures);
241
- } else if (this.declaringField) {
242
- // Skip feature resolution of sister fields.
243
- } else if (this.parent) {
244
- var parentFeaturesCopy = util.merge({}, this.parent._features);
245
- this._features = util.merge(parentFeaturesCopy, protoFeatures);
246
- } else {
247
- throw new Error("Unable to find a parent for " + this.fullName);
248
- }
248
+ throw new Error("Unable to find a parent for " + this.fullName);
249
249
  }
250
250
  if (this.extensionField) {
251
251
  // Sister fields should have the same features as their extensions.
@@ -54,7 +54,6 @@ function OneOf(name, fieldNames, options, comment) {
54
54
  * @interface IOneOf
55
55
  * @property {Array.<string>} oneof Oneof field names
56
56
  * @property {Object.<string,*>} [options] Oneof options
57
- * @property {string|null} [comment] Oneof comment
58
57
  */
59
58
 
60
59
  /**
@@ -198,7 +197,6 @@ Object.defineProperty(OneOf.prototype, "isProto3Optional", {
198
197
  * @param {Object} prototype Target prototype
199
198
  * @param {string} oneofName OneOf name
200
199
  * @returns {undefined}
201
- * @deprecated Legacy TypeScript decorator support. Will be removed in a future release.
202
200
  */
203
201
 
204
202
  /**
@@ -207,7 +205,6 @@ Object.defineProperty(OneOf.prototype, "isProto3Optional", {
207
205
  * @param {...string} fieldNames Field names
208
206
  * @returns {OneOfDecorator} Decorator function
209
207
  * @template T extends string
210
- * @deprecated Legacy TypeScript decorator support. Will be removed in a future release.
211
208
  */
212
209
  OneOf.d = function decorateOneOf() {
213
210
  var fieldNames = new Array(arguments.length),
@@ -261,16 +261,6 @@ function parse(source, root, options) {
261
261
  var token = peek();
262
262
  var whichImports;
263
263
  switch (token) {
264
- case "option":
265
- if (edition < "2024") {
266
- throw illegal("option");
267
- }
268
- // Import options are only used for resolving options, which we don't
269
- // do. We can just throw them out.
270
- next();
271
- readString();
272
- skip(";");
273
- return;
274
264
  case "weak":
275
265
  whichImports = weakImports || (weakImports = []);
276
266
  next();
@@ -301,7 +291,7 @@ function parse(source, root, options) {
301
291
  function parseEdition() {
302
292
  skip("=");
303
293
  edition = readString();
304
- const supportedEditions = ["2023", "2024"];
294
+ const supportedEditions = ["2023"];
305
295
 
306
296
  /* istanbul ignore if */
307
297
  if (!supportedEditions.includes(edition))
@@ -330,22 +320,6 @@ function parse(source, root, options) {
330
320
  parseEnum(parent, token);
331
321
  return true;
332
322
 
333
- case "export":
334
- case "local":
335
- if (edition < "2024") {
336
- return false;
337
- }
338
- token = next();
339
- if (token === "export" || token === "local") {
340
- return false;
341
- }
342
- if (token !== "message" && token !== "enum") {
343
- return false;
344
- }
345
- /* eslint-disable no-warning-comments */
346
- // TODO: actually enforce visiblity modifiers like protoc does.
347
- return parseCommon(parent, token, depth);
348
-
349
323
  case "service":
350
324
  parseService(parent, token, depth + 1);
351
325
  return true;
@@ -396,9 +370,6 @@ function parse(source, root, options) {
396
370
 
397
371
  switch (token) {
398
372
 
399
- case ";":
400
- break;
401
-
402
373
  case "map":
403
374
  parseMapField(type, token);
404
375
  break;
@@ -454,7 +425,7 @@ function parse(source, root, options) {
454
425
  function parseField(parent, rule, extend, depth) {
455
426
  var type = next();
456
427
  if (type === "group") {
457
- parseGroup(parent, rule, extend, depth);
428
+ parseGroup(parent, rule, depth);
458
429
  return;
459
430
  }
460
431
  // Type names can consume multiple tokens, in multiple variants:
@@ -482,7 +453,7 @@ function parse(source, root, options) {
482
453
  name = applyCase(name);
483
454
  skip("=");
484
455
 
485
- var field = new Field(name, parseId(next()), type, rule === "proto3_optional" ? "optional" : rule, extend);
456
+ var field = new Field(name, parseId(next()), type, rule, extend);
486
457
 
487
458
  ifBlock(field, function parseField_block(token) {
488
459
 
@@ -511,7 +482,7 @@ function parse(source, root, options) {
511
482
  }
512
483
  }
513
484
 
514
- function parseGroup(parent, rule, extend, depth) {
485
+ function parseGroup(parent, rule, depth) {
515
486
  if (depth === undefined)
516
487
  depth = 0;
517
488
  if (depth > util.nestingLimit)
@@ -532,14 +503,11 @@ function parse(source, root, options) {
532
503
  var id = parseId(next());
533
504
  var type = new Type(name);
534
505
  type.group = true;
535
- var field = new Field(fieldName, id, name, rule, extend);
506
+ var field = new Field(fieldName, id, name, rule);
536
507
  field.filename = parse.filename;
537
508
  ifBlock(type, function parseGroup_block(token) {
538
509
  switch (token) {
539
510
 
540
- case ";":
541
- break;
542
-
543
511
  case "option":
544
512
  parseOption(type, token);
545
513
  skip(";");
@@ -570,24 +538,6 @@ function parse(source, root, options) {
570
538
  readRanges(type.reserved || (type.reserved = []), true);
571
539
  break;
572
540
 
573
- case "export":
574
- case "local":
575
- if (edition < "2024") {
576
- throw illegal(token);
577
- }
578
- token = next();
579
- switch (token) {
580
- case "message":
581
- parseType(type, token, depth + 1);
582
- break;
583
- case "enum":
584
- parseType(type, token, depth + 1);
585
- break;
586
- default:
587
- throw illegal(token);
588
- }
589
- break;
590
-
591
541
  /* istanbul ignore next */
592
542
  default:
593
543
  throw illegal(token); // there are no groups with proto3 semantics
@@ -595,10 +545,6 @@ function parse(source, root, options) {
595
545
  });
596
546
  parent.add(type)
597
547
  .add(field);
598
- if (parent === ptr) {
599
- topLevelObjects.push(type);
600
- topLevelObjects.push(field);
601
- }
602
548
  }
603
549
 
604
550
  function parseMapField(parent) {
@@ -668,9 +614,6 @@ function parse(source, root, options) {
668
614
  var enm = new Enum(token);
669
615
  ifBlock(enm, function parseEnum_block(token) {
670
616
  switch(token) {
671
- case ";":
672
- break;
673
-
674
617
  case "option":
675
618
  parseOption(enm, token);
676
619
  skip(";");
@@ -793,15 +736,13 @@ function parse(source, root, options) {
793
736
  value = [];
794
737
  var lastValue;
795
738
  if (skip("[", true)) {
796
- if (!skip("]", true)) {
797
- do {
798
- lastValue = readValue(true);
799
- value.push(lastValue);
800
- } while (skip(",", true));
801
- skip("]");
802
- if (typeof lastValue !== "undefined") {
803
- setOption(parent, name + "." + token, lastValue);
804
- }
739
+ do {
740
+ lastValue = readValue(true);
741
+ value.push(lastValue);
742
+ } while (skip(",", true));
743
+ skip("]");
744
+ if (typeof lastValue !== "undefined") {
745
+ setOption(parent, name + "." + token, lastValue);
805
746
  }
806
747
  }
807
748
  } else {
@@ -872,8 +813,6 @@ function parse(source, root, options) {
872
813
  }
873
814
 
874
815
  /* istanbul ignore else */
875
- if (token === ";")
876
- return;
877
816
  if (token === "rpc")
878
817
  parseMethod(service, token);
879
818
  else
@@ -925,8 +864,6 @@ function parse(source, root, options) {
925
864
  ifBlock(method, function parseMethod_block(token) {
926
865
 
927
866
  /* istanbul ignore else */
928
- if (token === ";")
929
- return;
930
867
  if (token === "option") {
931
868
  parseOption(method, token);
932
869
  skip(";");
@@ -976,9 +913,6 @@ function parse(source, root, options) {
976
913
  while ((token = next()) !== null) {
977
914
  switch (token) {
978
915
 
979
- case ";":
980
- break;
981
-
982
916
  case "package":
983
917
 
984
918
  /* istanbul ignore if */
@@ -990,6 +924,10 @@ function parse(source, root, options) {
990
924
 
991
925
  case "import":
992
926
 
927
+ /* istanbul ignore if */
928
+ if (!head)
929
+ throw illegal(token);
930
+
993
931
  parseImport();
994
932
  break;
995
933