@moq/net 0.4.7 → 0.22.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 (664) hide show
  1. package/README.md +7 -1
  2. package/announce.d.ts +1 -1
  3. package/announce.d.ts.map +1 -1
  4. package/announce.js +1 -2
  5. package/announce.js.map +1 -1
  6. package/announced.d.ts +51 -47
  7. package/announced.d.ts.map +1 -1
  8. package/announced.js +183 -32
  9. package/announced.js.map +1 -1
  10. package/announced.test-util.d.ts +2 -0
  11. package/announced.test-util.d.ts.map +1 -0
  12. package/announced.test-util.js +27 -0
  13. package/announced.test-util.js.map +1 -0
  14. package/auth.d.ts +64 -0
  15. package/auth.d.ts.map +1 -0
  16. package/auth.js +20 -0
  17. package/auth.js.map +1 -0
  18. package/auth_gate.d.ts +2 -0
  19. package/auth_gate.d.ts.map +1 -0
  20. package/auth_gate.js +24 -0
  21. package/auth_gate.js.map +1 -0
  22. package/auth_session.d.ts +49 -0
  23. package/auth_session.d.ts.map +1 -0
  24. package/auth_session.js +1097 -0
  25. package/auth_session.js.map +1 -0
  26. package/bandwidth.d.ts +129 -25
  27. package/bandwidth.d.ts.map +1 -1
  28. package/bandwidth.js +410 -139
  29. package/bandwidth.js.map +1 -1
  30. package/bandwidth_api.d.ts +1 -1
  31. package/bandwidth_api.d.ts.map +1 -1
  32. package/bandwidth_api.js +1 -2
  33. package/bandwidth_api.js.map +1 -1
  34. package/broadcast.d.ts +64 -38
  35. package/broadcast.d.ts.map +1 -1
  36. package/broadcast.js +556 -173
  37. package/broadcast.js.map +1 -1
  38. package/cache.d.ts +103 -0
  39. package/cache.d.ts.map +1 -0
  40. package/cache.js +254 -0
  41. package/cache.js.map +1 -0
  42. package/claim.test-util.d.ts +5 -0
  43. package/claim.test-util.d.ts.map +1 -0
  44. package/claim.test-util.js +13 -0
  45. package/claim.test-util.js.map +1 -0
  46. package/connection/accept.d.ts +21 -13
  47. package/connection/accept.d.ts.map +1 -1
  48. package/connection/accept.js +97 -130
  49. package/connection/accept.js.map +1 -1
  50. package/connection/browser.d.ts.map +1 -1
  51. package/connection/browser.js +28 -20
  52. package/connection/browser.js.map +1 -1
  53. package/connection/connect.d.ts +120 -24
  54. package/connection/connect.d.ts.map +1 -1
  55. package/connection/connect.js +535 -217
  56. package/connection/connect.js.map +1 -1
  57. package/connection/dials.d.ts +45 -0
  58. package/connection/dials.d.ts.map +1 -0
  59. package/connection/dials.js +109 -0
  60. package/connection/dials.js.map +1 -0
  61. package/connection/endpoint.d.ts +60 -0
  62. package/connection/endpoint.d.ts.map +1 -0
  63. package/connection/endpoint.js +114 -0
  64. package/connection/endpoint.js.map +1 -0
  65. package/connection/forward.d.ts +7 -1
  66. package/connection/forward.d.ts.map +1 -1
  67. package/connection/forward.js +265 -81
  68. package/connection/forward.js.map +1 -1
  69. package/connection/goaway.d.ts +16 -9
  70. package/connection/goaway.d.ts.map +1 -1
  71. package/connection/goaway.js +22 -95
  72. package/connection/goaway.js.map +1 -1
  73. package/connection/handshake.d.ts +34 -8
  74. package/connection/handshake.d.ts.map +1 -1
  75. package/connection/handshake.js +97 -21
  76. package/connection/handshake.js.map +1 -1
  77. package/connection/index.d.ts +4 -7
  78. package/connection/index.d.ts.map +1 -1
  79. package/connection/index.js +1 -3
  80. package/connection/index.js.map +1 -1
  81. package/connection/liveness.d.ts +14 -0
  82. package/connection/liveness.d.ts.map +1 -0
  83. package/connection/liveness.js +30 -0
  84. package/connection/liveness.js.map +1 -0
  85. package/connection/pool.d.ts +142 -63
  86. package/connection/pool.d.ts.map +1 -1
  87. package/connection/pool.js +281 -118
  88. package/connection/pool.js.map +1 -1
  89. package/connection/reload.d.ts +60 -12
  90. package/connection/reload.d.ts.map +1 -1
  91. package/connection/reload.js +859 -234
  92. package/connection/reload.js.map +1 -1
  93. package/connection/session.d.ts +91 -0
  94. package/connection/session.d.ts.map +1 -0
  95. package/connection/session.js +2 -0
  96. package/connection/session.js.map +1 -0
  97. package/connection/stats.d.ts +20 -11
  98. package/connection/stats.d.ts.map +1 -1
  99. package/connection/stats.js +64 -9
  100. package/connection/stats.js.map +1 -1
  101. package/connection/ticker.d.ts +4 -0
  102. package/connection/ticker.d.ts.map +1 -0
  103. package/connection/ticker.js +66 -0
  104. package/connection/ticker.js.map +1 -0
  105. package/connection/tokens.d.ts +2 -0
  106. package/connection/tokens.d.ts.map +1 -0
  107. package/connection/tokens.js +404 -0
  108. package/connection/tokens.js.map +1 -0
  109. package/connection/transport.d.ts.map +1 -1
  110. package/connection/transport.js +4 -5
  111. package/connection/transport.js.map +1 -1
  112. package/connection/withdrawal.d.ts +2 -0
  113. package/connection/withdrawal.d.ts.map +1 -0
  114. package/connection/withdrawal.js +23 -0
  115. package/connection/withdrawal.js.map +1 -0
  116. package/consume.js +213 -47
  117. package/consume.js.map +1 -1
  118. package/cover.d.ts +59 -0
  119. package/cover.d.ts.map +1 -0
  120. package/cover.js +375 -0
  121. package/cover.js.map +1 -0
  122. package/datagram.d.ts +70 -11
  123. package/datagram.d.ts.map +1 -1
  124. package/datagram.js +317 -2
  125. package/datagram.js.map +1 -1
  126. package/datagram_stream.d.ts +18 -0
  127. package/datagram_stream.d.ts.map +1 -0
  128. package/datagram_stream.js +67 -0
  129. package/datagram_stream.js.map +1 -0
  130. package/defined.test-util.d.ts +2 -0
  131. package/defined.test-util.d.ts.map +1 -0
  132. package/defined.test-util.js +7 -0
  133. package/defined.test-util.js.map +1 -0
  134. package/delivered.d.ts +75 -0
  135. package/delivered.d.ts.map +1 -0
  136. package/delivered.js +228 -0
  137. package/delivered.js.map +1 -0
  138. package/demand.d.ts +173 -0
  139. package/demand.d.ts.map +1 -0
  140. package/demand.js +582 -0
  141. package/demand.js.map +1 -0
  142. package/drops.d.ts +93 -0
  143. package/drops.d.ts.map +1 -0
  144. package/drops.js +283 -0
  145. package/drops.js.map +1 -0
  146. package/error.d.ts +120 -21
  147. package/error.d.ts.map +1 -1
  148. package/error.js +230 -38
  149. package/error.js.map +1 -1
  150. package/errors.d.ts +2 -2
  151. package/errors.d.ts.map +1 -1
  152. package/errors.js +2 -3
  153. package/errors.js.map +1 -1
  154. package/fill.d.ts +174 -0
  155. package/fill.d.ts.map +1 -0
  156. package/fill.js +760 -0
  157. package/fill.js.map +1 -0
  158. package/flate/decoder.d.ts +2 -0
  159. package/flate/decoder.d.ts.map +1 -0
  160. package/flate/decoder.js +63 -0
  161. package/flate/decoder.js.map +1 -0
  162. package/flate/encoder.d.ts +2 -0
  163. package/flate/encoder.d.ts.map +1 -0
  164. package/flate/encoder.js +64 -0
  165. package/flate/encoder.js.map +1 -0
  166. package/flate/group.d.ts +34 -0
  167. package/flate/group.d.ts.map +1 -0
  168. package/flate/group.js +140 -0
  169. package/flate/group.js.map +1 -0
  170. package/frame.d.ts +80 -0
  171. package/frame.d.ts.map +1 -0
  172. package/frame.js +296 -0
  173. package/frame.js.map +1 -0
  174. package/frame.test-util.d.ts +5 -0
  175. package/frame.test-util.d.ts.map +1 -0
  176. package/frame.test-util.js +9 -0
  177. package/frame.test-util.js.map +1 -0
  178. package/group.d.ts +108 -45
  179. package/group.d.ts.map +1 -1
  180. package/group.js +1616 -308
  181. package/group.js.map +1 -1
  182. package/group_api.d.ts +7 -0
  183. package/group_api.d.ts.map +1 -0
  184. package/group_api.js +7 -0
  185. package/group_api.js.map +1 -0
  186. package/hop.d.ts +62 -76
  187. package/hop.d.ts.map +1 -1
  188. package/hop.js +92 -65
  189. package/hop.js.map +1 -1
  190. package/identity.d.ts +39 -0
  191. package/identity.d.ts.map +1 -0
  192. package/identity.js +47 -0
  193. package/identity.js.map +1 -0
  194. package/ietf/active_count.d.ts +2 -0
  195. package/ietf/active_count.d.ts.map +1 -0
  196. package/ietf/active_count.js +30 -0
  197. package/ietf/active_count.js.map +1 -0
  198. package/ietf/aliases.js +69 -36
  199. package/ietf/aliases.js.map +1 -1
  200. package/ietf/cluster.d.ts +3 -3
  201. package/ietf/cluster.js +14 -55
  202. package/ietf/cluster.js.map +1 -1
  203. package/ietf/connection.d.ts +1 -31
  204. package/ietf/connection.d.ts.map +1 -1
  205. package/ietf/connection.js +305 -144
  206. package/ietf/connection.js.map +1 -1
  207. package/ietf/datagram.d.ts +60 -0
  208. package/ietf/datagram.d.ts.map +1 -0
  209. package/ietf/datagram.js +152 -0
  210. package/ietf/datagram.js.map +1 -0
  211. package/ietf/error.d.ts +3 -3
  212. package/ietf/error.js +82 -101
  213. package/ietf/error.js.map +1 -1
  214. package/ietf/fetch.d.ts +93 -37
  215. package/ietf/fetch.d.ts.map +1 -1
  216. package/ietf/fetch.js +172 -94
  217. package/ietf/fetch.js.map +1 -1
  218. package/ietf/filter.d.ts +21 -31
  219. package/ietf/filter.d.ts.map +1 -1
  220. package/ietf/filter.js +140 -172
  221. package/ietf/filter.js.map +1 -1
  222. package/ietf/goaway.d.ts +12 -10
  223. package/ietf/goaway.d.ts.map +1 -1
  224. package/ietf/goaway.js +22 -36
  225. package/ietf/goaway.js.map +1 -1
  226. package/ietf/hidden.js +1 -2
  227. package/ietf/hidden.js.map +1 -1
  228. package/ietf/index.d.ts +8 -20
  229. package/ietf/index.d.ts.map +1 -1
  230. package/ietf/index.js +4 -15
  231. package/ietf/index.js.map +1 -1
  232. package/ietf/join.d.ts +7 -0
  233. package/ietf/join.d.ts.map +1 -0
  234. package/ietf/join.js +234 -0
  235. package/ietf/join.js.map +1 -0
  236. package/ietf/message.d.ts +18 -2
  237. package/ietf/message.d.ts.map +1 -1
  238. package/ietf/message.js +60 -41
  239. package/ietf/message.js.map +1 -1
  240. package/ietf/message.test-util.d.ts +6 -0
  241. package/ietf/message.test-util.d.ts.map +1 -0
  242. package/ietf/message.test-util.js +13 -0
  243. package/ietf/message.test-util.js.map +1 -0
  244. package/ietf/namespace.d.ts +19 -5
  245. package/ietf/namespace.d.ts.map +1 -1
  246. package/ietf/namespace.js +78 -27
  247. package/ietf/namespace.js.map +1 -1
  248. package/ietf/object.d.ts +195 -33
  249. package/ietf/object.d.ts.map +1 -1
  250. package/ietf/object.js +405 -179
  251. package/ietf/object.js.map +1 -1
  252. package/ietf/parameters.d.ts +25 -45
  253. package/ietf/parameters.d.ts.map +1 -1
  254. package/ietf/parameters.js +260 -473
  255. package/ietf/parameters.js.map +1 -1
  256. package/ietf/priority.d.ts +17 -2
  257. package/ietf/priority.d.ts.map +1 -1
  258. package/ietf/priority.js +19 -5
  259. package/ietf/priority.js.map +1 -1
  260. package/ietf/properties.d.ts +6 -5
  261. package/ietf/properties.d.ts.map +1 -1
  262. package/ietf/properties.js +78 -49
  263. package/ietf/properties.js.map +1 -1
  264. package/ietf/publish.d.ts +25 -33
  265. package/ietf/publish.d.ts.map +1 -1
  266. package/ietf/publish.js +45 -140
  267. package/ietf/publish.js.map +1 -1
  268. package/ietf/publish_namespace.d.ts +49 -72
  269. package/ietf/publish_namespace.d.ts.map +1 -1
  270. package/ietf/publish_namespace.js +66 -185
  271. package/ietf/publish_namespace.js.map +1 -1
  272. package/ietf/publisher.js +1800 -601
  273. package/ietf/publisher.js.map +1 -1
  274. package/ietf/range.d.ts +2 -0
  275. package/ietf/range.d.ts.map +1 -0
  276. package/ietf/range.js +222 -0
  277. package/ietf/range.js.map +1 -0
  278. package/ietf/request.d.ts +6 -30
  279. package/ietf/request.d.ts.map +1 -1
  280. package/ietf/request.js +41 -79
  281. package/ietf/request.js.map +1 -1
  282. package/ietf/request_stream.d.ts +1 -6
  283. package/ietf/request_stream.d.ts.map +1 -1
  284. package/ietf/request_stream.js +306 -17
  285. package/ietf/request_stream.js.map +1 -1
  286. package/ietf/session.d.ts +41 -0
  287. package/ietf/session.d.ts.map +1 -0
  288. package/ietf/session.js +65 -0
  289. package/ietf/session.js.map +1 -0
  290. package/ietf/setup.d.ts +5 -30
  291. package/ietf/setup.d.ts.map +1 -1
  292. package/ietf/setup.js +6 -118
  293. package/ietf/setup.js.map +1 -1
  294. package/ietf/setup_options.d.ts +31 -0
  295. package/ietf/setup_options.d.ts.map +1 -0
  296. package/ietf/setup_options.js +138 -0
  297. package/ietf/setup_options.js.map +1 -0
  298. package/ietf/solicit.js +4 -15
  299. package/ietf/solicit.js.map +1 -1
  300. package/ietf/subscribe.d.ts +52 -45
  301. package/ietf/subscribe.d.ts.map +1 -1
  302. package/ietf/subscribe.js +118 -240
  303. package/ietf/subscribe.js.map +1 -1
  304. package/ietf/subscribe_namespace.d.ts +16 -79
  305. package/ietf/subscribe_namespace.d.ts.map +1 -1
  306. package/ietf/subscribe_namespace.js +30 -202
  307. package/ietf/subscribe_namespace.js.map +1 -1
  308. package/ietf/subscriber.js +1839 -537
  309. package/ietf/subscriber.js.map +1 -1
  310. package/ietf/token.js +105 -28
  311. package/ietf/token.js.map +1 -1
  312. package/ietf/track.d.ts +27 -24
  313. package/ietf/track.d.ts.map +1 -1
  314. package/ietf/track.js +48 -62
  315. package/ietf/track.js.map +1 -1
  316. package/ietf/version.d.ts +13 -42
  317. package/ietf/version.d.ts.map +1 -1
  318. package/ietf/version.js +22 -49
  319. package/ietf/version.js.map +1 -1
  320. package/implementation.d.ts +2 -0
  321. package/implementation.d.ts.map +1 -0
  322. package/implementation.js +5 -0
  323. package/implementation.js.map +1 -0
  324. package/index.d.ts +34 -19
  325. package/index.d.ts.map +1 -1
  326. package/index.js +19 -7
  327. package/index.js.map +1 -1
  328. package/internal.d.ts +1515 -67
  329. package/internal.d.ts.map +1 -1
  330. package/internal.js +557 -80
  331. package/internal.js.map +1 -1
  332. package/ledger.d.ts +23 -0
  333. package/ledger.d.ts.map +1 -0
  334. package/ledger.js +247 -0
  335. package/ledger.js.map +1 -0
  336. package/listing.d.ts +132 -0
  337. package/listing.d.ts.map +1 -0
  338. package/listing.js +486 -0
  339. package/listing.js.map +1 -0
  340. package/lite/announce.d.ts +127 -66
  341. package/lite/announce.d.ts.map +1 -1
  342. package/lite/announce.js +384 -159
  343. package/lite/announce.js.map +1 -1
  344. package/lite/announce_stream.d.ts +2 -0
  345. package/lite/announce_stream.d.ts.map +1 -0
  346. package/lite/announce_stream.js +92 -0
  347. package/lite/announce_stream.js.map +1 -0
  348. package/lite/answer.d.ts +22 -0
  349. package/lite/answer.d.ts.map +1 -0
  350. package/lite/answer.js +301 -0
  351. package/lite/answer.js.map +1 -0
  352. package/lite/auth.d.ts +45 -0
  353. package/lite/auth.d.ts.map +1 -0
  354. package/lite/auth.js +204 -0
  355. package/lite/auth.js.map +1 -0
  356. package/lite/compat.d.ts +31 -0
  357. package/lite/compat.d.ts.map +1 -0
  358. package/lite/compat.js +86 -0
  359. package/lite/compat.js.map +1 -0
  360. package/lite/connection.d.ts +1 -45
  361. package/lite/connection.d.ts.map +1 -1
  362. package/lite/connection.js +360 -78
  363. package/lite/connection.js.map +1 -1
  364. package/lite/datagram-end.d.ts +26 -0
  365. package/lite/datagram-end.d.ts.map +1 -0
  366. package/lite/datagram-end.js +30 -0
  367. package/lite/datagram-end.js.map +1 -0
  368. package/lite/datagram.d.ts +73 -8
  369. package/lite/datagram.d.ts.map +1 -1
  370. package/lite/datagram.js +144 -10
  371. package/lite/datagram.js.map +1 -1
  372. package/lite/duration.d.ts +6 -0
  373. package/lite/duration.d.ts.map +1 -0
  374. package/lite/duration.js +14 -0
  375. package/lite/duration.js.map +1 -0
  376. package/lite/error.d.ts +9 -0
  377. package/lite/error.d.ts.map +1 -0
  378. package/lite/error.js +24 -0
  379. package/lite/error.js.map +1 -0
  380. package/lite/fills.d.ts +162 -0
  381. package/lite/fills.d.ts.map +1 -0
  382. package/lite/fills.js +486 -0
  383. package/lite/fills.js.map +1 -0
  384. package/lite/fit.d.ts +49 -0
  385. package/lite/fit.d.ts.map +1 -0
  386. package/lite/fit.js +305 -0
  387. package/lite/fit.js.map +1 -0
  388. package/lite/goaway.d.ts +2 -2
  389. package/lite/goaway.d.ts.map +1 -1
  390. package/lite/goaway.js +5 -14
  391. package/lite/goaway.js.map +1 -1
  392. package/lite/group.d.ts +67 -16
  393. package/lite/group.d.ts.map +1 -1
  394. package/lite/group.js +108 -31
  395. package/lite/group.js.map +1 -1
  396. package/lite/identity.d.ts +25 -0
  397. package/lite/identity.d.ts.map +1 -0
  398. package/lite/identity.js +79 -0
  399. package/lite/identity.js.map +1 -0
  400. package/lite/index.d.ts +14 -13
  401. package/lite/index.d.ts.map +1 -1
  402. package/lite/index.js +2 -2
  403. package/lite/index.js.map +1 -1
  404. package/lite/message.d.ts +10 -2
  405. package/lite/message.d.ts.map +1 -1
  406. package/lite/message.js +28 -45
  407. package/lite/message.js.map +1 -1
  408. package/lite/priority.d.ts +9 -2
  409. package/lite/priority.d.ts.map +1 -1
  410. package/lite/priority.js +11 -106
  411. package/lite/priority.js.map +1 -1
  412. package/lite/probe.d.ts +2 -2
  413. package/lite/probe.d.ts.map +1 -1
  414. package/lite/probe.js +9 -1
  415. package/lite/probe.js.map +1 -1
  416. package/lite/publisher.d.ts +10 -1
  417. package/lite/publisher.d.ts.map +1 -1
  418. package/lite/publisher.js +2548 -438
  419. package/lite/publisher.js.map +1 -1
  420. package/lite/routed.d.ts +59 -0
  421. package/lite/routed.d.ts.map +1 -0
  422. package/lite/routed.js +564 -0
  423. package/lite/routed.js.map +1 -0
  424. package/lite/session.d.ts +2 -28
  425. package/lite/session.d.ts.map +1 -1
  426. package/lite/session.js +0 -100
  427. package/lite/session.js.map +1 -1
  428. package/lite/setup.d.ts +32 -5
  429. package/lite/setup.d.ts.map +1 -1
  430. package/lite/setup.js +95 -22
  431. package/lite/setup.js.map +1 -1
  432. package/lite/stream.d.ts +5 -11
  433. package/lite/stream.d.ts.map +1 -1
  434. package/lite/stream.js +5 -2
  435. package/lite/stream.js.map +1 -1
  436. package/lite/subscribe.d.ts +478 -78
  437. package/lite/subscribe.d.ts.map +1 -1
  438. package/lite/subscribe.js +1373 -143
  439. package/lite/subscribe.js.map +1 -1
  440. package/lite/subscriber.d.ts +7 -44
  441. package/lite/subscriber.d.ts.map +1 -1
  442. package/lite/subscriber.js +3290 -516
  443. package/lite/subscriber.js.map +1 -1
  444. package/lite/track.d.ts +27 -12
  445. package/lite/track.d.ts.map +1 -1
  446. package/lite/track.js +116 -38
  447. package/lite/track.js.map +1 -1
  448. package/lite/tracks.d.ts +55 -0
  449. package/lite/tracks.d.ts.map +1 -0
  450. package/lite/tracks.js +114 -0
  451. package/lite/tracks.js.map +1 -0
  452. package/lite/version.d.ts +132 -24
  453. package/lite/version.d.ts.map +1 -1
  454. package/lite/version.js +378 -34
  455. package/lite/version.js.map +1 -1
  456. package/meta.d.ts +77 -0
  457. package/meta.d.ts.map +1 -0
  458. package/meta.js +130 -0
  459. package/meta.js.map +1 -0
  460. package/meta_api.d.ts +7 -0
  461. package/meta_api.d.ts.map +1 -0
  462. package/meta_api.js +7 -0
  463. package/meta_api.js.map +1 -0
  464. package/mint.d.ts +28 -0
  465. package/mint.d.ts.map +1 -0
  466. package/mint.js +66 -0
  467. package/mint.js.map +1 -0
  468. package/open.d.ts +63 -0
  469. package/open.d.ts.map +1 -0
  470. package/open.js +250 -0
  471. package/open.js.map +1 -0
  472. package/origin.d.ts +394 -142
  473. package/origin.d.ts.map +1 -1
  474. package/origin.js +2533 -687
  475. package/origin.js.map +1 -1
  476. package/package.json +8 -13
  477. package/path.d.ts +51 -51
  478. package/path.d.ts.map +1 -1
  479. package/path.js +210 -58
  480. package/path.js.map +1 -1
  481. package/payload.d.ts +33 -0
  482. package/payload.d.ts.map +1 -0
  483. package/payload.js +65 -0
  484. package/payload.js.map +1 -0
  485. package/prefix.d.ts +152 -0
  486. package/prefix.d.ts.map +1 -0
  487. package/prefix.js +349 -0
  488. package/prefix.js.map +1 -0
  489. package/priority.d.ts +8 -0
  490. package/priority.d.ts.map +1 -0
  491. package/priority.js +185 -0
  492. package/priority.js.map +1 -0
  493. package/queue.d.ts +2 -0
  494. package/queue.d.ts.map +1 -0
  495. package/queue.js +46 -0
  496. package/queue.js.map +1 -0
  497. package/ranges.d.ts +36 -0
  498. package/ranges.d.ts.map +1 -0
  499. package/ranges.js +312 -0
  500. package/ranges.js.map +1 -0
  501. package/rescale.d.ts +24 -0
  502. package/rescale.d.ts.map +1 -0
  503. package/rescale.js +39 -0
  504. package/rescale.js.map +1 -0
  505. package/resume.d.ts +55 -0
  506. package/resume.d.ts.map +1 -0
  507. package/resume.js +4173 -0
  508. package/resume.js.map +1 -0
  509. package/resume.test-util.d.ts +2 -0
  510. package/resume.test-util.d.ts.map +1 -0
  511. package/resume.test-util.js +25 -0
  512. package/resume.test-util.js.map +1 -0
  513. package/skips.d.ts +48 -0
  514. package/skips.d.ts.map +1 -0
  515. package/skips.js +182 -0
  516. package/skips.js.map +1 -0
  517. package/stream.d.ts +78 -40
  518. package/stream.d.ts.map +1 -1
  519. package/stream.js +236 -93
  520. package/stream.js.map +1 -1
  521. package/subscription.test-util.d.ts +2 -0
  522. package/subscription.test-util.d.ts.map +1 -0
  523. package/subscription.test-util.js +49 -0
  524. package/subscription.test-util.js.map +1 -0
  525. package/tail.d.ts +23 -14
  526. package/tail.d.ts.map +1 -1
  527. package/tail.js +224 -98
  528. package/tail.js.map +1 -1
  529. package/time.d.ts +41 -102
  530. package/time.d.ts.map +1 -1
  531. package/time.js +129 -92
  532. package/time.js.map +1 -1
  533. package/timed.d.ts +21 -0
  534. package/timed.d.ts.map +1 -0
  535. package/timed.js +2 -0
  536. package/timed.js.map +1 -0
  537. package/track.d.ts +578 -246
  538. package/track.d.ts.map +1 -1
  539. package/track.js +7306 -772
  540. package/track.js.map +1 -1
  541. package/track_api.d.ts +7 -0
  542. package/track_api.d.ts.map +1 -0
  543. package/track_api.js +7 -0
  544. package/track_api.js.map +1 -0
  545. package/util/abort.d.ts +1 -0
  546. package/util/abort.d.ts.map +1 -1
  547. package/util/abort.js +23 -2
  548. package/util/abort.js.map +1 -1
  549. package/util/announce.d.ts +4 -0
  550. package/util/announce.d.ts.map +1 -0
  551. package/util/announce.js +11 -0
  552. package/util/announce.js.map +1 -0
  553. package/util/bigint.d.ts +3 -0
  554. package/util/bigint.d.ts.map +1 -0
  555. package/util/bigint.js +8 -0
  556. package/util/bigint.js.map +1 -0
  557. package/util/change.d.ts +12 -0
  558. package/util/change.d.ts.map +1 -0
  559. package/util/change.js +18 -0
  560. package/util/change.js.map +1 -0
  561. package/util/deadline.d.ts +2 -0
  562. package/util/deadline.d.ts.map +1 -0
  563. package/util/deadline.js +108 -0
  564. package/util/deadline.js.map +1 -0
  565. package/util/decode_error.d.ts +3 -0
  566. package/util/decode_error.d.ts.map +1 -0
  567. package/util/decode_error.js +11 -0
  568. package/util/decode_error.js.map +1 -0
  569. package/util/demand.d.ts +8 -0
  570. package/util/demand.d.ts.map +1 -0
  571. package/util/demand.js +24 -0
  572. package/util/demand.js.map +1 -0
  573. package/util/given_up.d.ts +2 -0
  574. package/util/given_up.d.ts.map +1 -0
  575. package/util/given_up.js +101 -0
  576. package/util/given_up.js.map +1 -0
  577. package/util/hex.d.ts +6 -0
  578. package/util/hex.d.ts.map +1 -1
  579. package/util/hex.js +19 -5
  580. package/util/hex.js.map +1 -1
  581. package/util/key.d.ts +15 -0
  582. package/util/key.d.ts.map +1 -0
  583. package/util/key.js +38 -0
  584. package/util/key.js.map +1 -0
  585. package/util/limits.d.ts +2 -0
  586. package/util/limits.d.ts.map +1 -0
  587. package/util/limits.js +76 -0
  588. package/util/limits.js.map +1 -0
  589. package/util/observed.d.ts +23 -0
  590. package/util/observed.d.ts.map +1 -0
  591. package/util/observed.js +122 -0
  592. package/util/observed.js.map +1 -0
  593. package/util/sorted.d.ts +2 -0
  594. package/util/sorted.d.ts.map +1 -0
  595. package/util/sorted.js +149 -0
  596. package/util/sorted.js.map +1 -0
  597. package/util/timeout.d.ts +2 -1
  598. package/util/timeout.d.ts.map +1 -1
  599. package/util/timeout.js +13 -10
  600. package/util/timeout.js.map +1 -1
  601. package/util/timer.d.ts +2 -0
  602. package/util/timer.d.ts.map +1 -0
  603. package/util/timer.js +19 -0
  604. package/util/timer.js.map +1 -0
  605. package/util/u64.js +0 -1
  606. package/util/utf8.d.ts +2 -0
  607. package/util/utf8.d.ts.map +1 -1
  608. package/util/utf8.js +7 -2
  609. package/util/utf8.js.map +1 -1
  610. package/util/varint.d.ts.map +1 -1
  611. package/util/varint.js +8 -2
  612. package/util/varint.js.map +1 -1
  613. package/util/watch.d.ts +8 -0
  614. package/util/watch.d.ts.map +1 -0
  615. package/util/watch.js +38 -0
  616. package/util/watch.js.map +1 -0
  617. package/util/yield.d.ts +2 -0
  618. package/util/yield.d.ts.map +1 -0
  619. package/util/yield.js +31 -0
  620. package/util/yield.js.map +1 -0
  621. package/varint.d.ts +0 -29
  622. package/varint.d.ts.map +1 -1
  623. package/varint.js +7 -29
  624. package/varint.js.map +1 -1
  625. package/varint_api.d.ts +7 -0
  626. package/varint_api.d.ts.map +1 -0
  627. package/varint_api.js +7 -0
  628. package/varint_api.js.map +1 -0
  629. package/version.d.ts +2 -0
  630. package/version.d.ts.map +1 -0
  631. package/version.js +4 -0
  632. package/version.js.map +1 -0
  633. package/window.d.ts +570 -0
  634. package/window.d.ts.map +1 -0
  635. package/window.js +1677 -0
  636. package/window.js.map +1 -0
  637. package/wire.d.ts +150 -35
  638. package/wire.d.ts.map +1 -1
  639. package/wire.js +27 -1
  640. package/wire.js.map +1 -1
  641. package/connection/established.d.ts +0 -53
  642. package/connection/established.d.ts.map +0 -1
  643. package/connection/established.js +0 -3
  644. package/connection/established.js.map +0 -1
  645. package/ietf/adapter.d.ts +0 -75
  646. package/ietf/adapter.d.ts.map +0 -1
  647. package/ietf/adapter.js +0 -700
  648. package/ietf/adapter.js.map +0 -1
  649. package/lite/datagram_stream.d.ts +0 -8
  650. package/lite/datagram_stream.d.ts.map +0 -1
  651. package/lite/datagram_stream.js +0 -44
  652. package/lite/datagram_stream.js.map +0 -1
  653. package/lite/fetch.d.ts +0 -28
  654. package/lite/fetch.d.ts.map +0 -1
  655. package/lite/fetch.js +0 -79
  656. package/lite/fetch.js.map +0 -1
  657. package/util/log.d.ts +0 -5
  658. package/util/log.d.ts.map +0 -1
  659. package/util/log.js +0 -17
  660. package/util/log.js.map +0 -1
  661. package/zod.d.ts +0 -13
  662. package/zod.d.ts.map +0 -1
  663. package/zod.js +0 -19
  664. package/zod.js.map +0 -1
package/listing.js.map ADDED
@@ -0,0 +1 @@
1
+ {"version":3,"file":"listing.js","sourceRoot":"","sources":["../src/listing.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AACH,OAAO,EAAgC,MAAM,EAAE,MAAM,cAAc,CAAC;AAEpE,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AACrD,OAAO,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AA0CtC;;;;GAIG;AACH,SAAS,QAAQ,CAAC,GAAQ;IACzB,IAAI,GAAG,CAAC,IAAI,KAAK,WAAW;QAAE,OAAO,GAAG,CAAC,QAAQ,CAAC,MAAM,CAAC,IAAI,EAAE,KAAK,IAAI,CAAC;IACzE,MAAM,QAAQ,GAAG,KAAK,CAAC,aAAa,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC,IAAI,EAAE,CAAC;IAC1D,OAAO,QAAQ,KAAK,IAAI,IAAI,CAAC,QAAQ,KAAK,SAAS,IAAI,KAAK,CAAC,aAAa,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC,CAAC;AAC3F,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,KAAK,CAAC,IAAY,EAAE,IAAU;IAC7C,OAAO,CAAC,IAAI,KAAK,WAAW,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,IAAI,CAAC;AAClD,CAAC;AAED,+DAA+D;AAC/D,SAAS,OAAO,CAAC,GAAW,EAAE,QAAiB;IAC9C,MAAM,IAAI,GAAG,QAAQ,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,SAAS,CAAC;IAC/C,MAAM,IAAI,GAAG,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;IAC1B,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,GAAG,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to each reader in order.\n *\n * A track is listed while its producer holds it: created by its producer (a track of groups until\n * it is released, aborted, or removed, a datagram track until it ends), or answered by a\n * {@link Lister}, as a session lists its peer's tracks. A track served only on request is never\n * listed, and listing never requests one.\n *\n * Datagram tracks are a namespace apart from tracks of groups, so a name is listed at most once\n * per kind.\n *\n * Each {@link Tracks} reader keeps its own queue, keyed by kind and name in insertion order, so a\n * stalled reader holds at most one pending change per listed track: an add and a removal it has\n * not reached cancel, and a removal and re-add of a track it saw collapse in place. Its state is\n * bounded by the tracks it saw plus the live set, however long it stalls.\n *\n * @module\n */\nimport { type GetPromise, type Getter, Signal } from \"@moq/signals\";\nimport type * as datagram from \"./datagram.ts\";\nimport { StreamCode, StreamError } from \"./error.ts\";\nimport { hooks } from \"./internal.ts\";\nimport type * as track from \"./track.ts\";\n\n/**\n * Which of a broadcast's two namespaces a listed track is in: a track of groups, or a datagram\n * track. A name is unique within its kind.\n *\n * @public\n */\nexport type Kind = \"track\" | \"datagrams\";\n\n/**\n * A listed track's {@link Kind} and fixed properties: a track of groups with its\n * {@link track.Info}, or a datagram track with its {@link datagram.Info}.\n *\n * @public\n */\nexport type Listed = { type: \"track\"; info: track.Info } | { type: \"datagrams\"; info: datagram.Info };\n\n/**\n * What a {@link Tracks} listing reports, in order.\n *\n * `added`: a track the broadcast lists, with its kind and fixed properties. `synced`: every\n * track listed once the listing was complete (at once for a local broadcast, on its moq-lite\n * upstream's SYNCED for a session's copy), and still listed, was reported; sent once, and later\n * events are live. A session over moq-transport fails the listing instead, since that upstream\n * never signals a complete list. `removed`: a track an earlier `added` reported is no longer listed,\n * unfinished: its producer aborted, or the answer that listed it withdrew it; a handler may still\n * serve its name on request. `finished`: a track an earlier `added` reported is no longer listed\n * because it finished. A removal carries the `type` its `added` did.\n *\n * @public\n */\nexport type TracksEvent =\n\t| ({ kind: \"added\"; name: string } & Listed)\n\t| { kind: \"synced\" }\n\t| { kind: \"removed\"; name: string; type: Kind }\n\t| { kind: \"finished\"; name: string; type: Kind };\n\n/** A producer whose track the listing lists. */\ntype Own = { type: \"track\"; producer: track.Producer } | { type: \"datagrams\"; producer: datagram.Producer };\n\n/**\n * Whether `own` leaves the listing as finished: it closed cleanly, or a track of groups declared\n * its end and is still open, as the Rust listing counts a producer that finished but still holds\n * its track.\n */\nfunction finished(own: Own): boolean {\n\tif (own.type === \"datagrams\") return own.producer.closed.peek() === null;\n\tconst released = hooks.trackReleased(own.producer).peek();\n\treturn released === null || (released === undefined && hooks.trackFinished(own.producer));\n}\n\n/**\n * The key a listed track is held under: its kind, then its name, so the kinds never collide.\n *\n * @internal\n */\nexport function keyOf(name: string, type: Kind): string {\n\treturn (type === \"datagrams\" ? \"d\" : \"t\") + name;\n}\n\n/** The event for the track under `key` leaving the listing. */\nfunction removal(key: string, finished: boolean): TracksEvent {\n\tconst kind = finished ? \"finished\" : \"removed\";\n\tconst name = key.slice(1);\n\treturn { kind, name, type: key[0] === \"d\" ? \"datagrams\" : \"track\" };\n}\n\n/** One listed track and who lists it. */\ninterface Entry {\n\tlisted: Listed;\n\t/** The producer whose track lists it, so a stale unlist never removes a later track of the name. */\n\town?: Own;\n\t/** Whether the lister's answer lists it. */\n\tanswered: boolean;\n}\n\n/**\n * A change a reader has yet to read. `readd` is a removal of a track it saw, then a track of the\n * same kind and name listed again. A removal carries whether the track finished.\n */\ntype Pending =\n\t| { kind: \"add\"; listed: Listed }\n\t| { kind: \"remove\"; finished: boolean }\n\t| { kind: \"readd\"; finished: boolean; listed: Listed };\n\n/**\n * Where one reader's SYNCED stands: the listing has not synced, SYNCED went out, or the keys of the\n * changes queued when it synced. Those lead the queue, so SYNCED goes out once they were read, and\n * a change queued later never postpones it.\n */\ntype Sync = \"waiting\" | \"sent\" | Set<string>;\n\n/** One reader's pending changes, keyed by kind and name in the order they happened. */\nclass Queue {\n\tpending = new Map<string, Pending>();\n\tsync: Sync = \"waiting\";\n\t/** `null` once the listing ended, or the error that ended it. */\n\tend?: Error | null;\n\t/** The reader left the listing, or a newer reader of its owner replaced it. */\n\tdetached = false;\n\tchanged = new Signal(0);\n\n\twake() {\n\t\tthis.changed.update((n) => n + 1);\n\t}\n\n\tadd(key: string, listed: Listed) {\n\t\t// A track is listed once at a time, so only its removal can be pending.\n\t\tconst pending = this.pending.get(key);\n\t\tif (pending?.kind === \"remove\") this.pending.set(key, { kind: \"readd\", finished: pending.finished, listed });\n\t\telse this.pending.set(key, { kind: \"add\", listed });\n\t\tthis.wake();\n\t}\n\n\tremove(key: string, finished: boolean) {\n\t\t// Never read: the two cancel. Otherwise the removal replaces a pending re-add in place.\n\t\tif (this.pending.get(key)?.kind === \"add\") this.dequeue(key);\n\t\telse this.pending.set(key, { kind: \"remove\", finished });\n\t\tthis.wake();\n\t}\n\n\t/** Drop the change queued under `key`, so SYNCED no longer waits on it. */\n\tdequeue(key: string) {\n\t\tthis.pending.delete(key);\n\t\tif (this.sync instanceof Set) this.sync.delete(key);\n\t}\n\n\t/** The listing synced: SYNCED goes out once what is queued now was read. */\n\tsynced() {\n\t\tif (this.sync !== \"waiting\") return;\n\t\tthis.sync = new Set(this.pending.keys());\n\t\tthis.wake();\n\t}\n\n\t/** The listing's answer restarted before this reader was told it synced. */\n\tunsync() {\n\t\tif (this.sync instanceof Set) this.sync = \"waiting\";\n\t}\n\n\tfinish(end: Error | null) {\n\t\tthis.end ??= end;\n\t\tthis.detached = true;\n\t\tthis.wake();\n\t}\n\n\tready(): boolean {\n\t\treturn this.end !== undefined || this.pending.size > 0 || this.sync instanceof Set;\n\t}\n\n\tnext(): TracksEvent | undefined {\n\t\tif (this.end) throw this.end;\n\t\tif (this.end === null) {\n\t\t\t// A clean end still reports each track that left before it, and how; an add the\n\t\t\t// reader never read is dropped.\n\t\t\tfor (const [key, pending] of this.pending) {\n\t\t\t\tthis.pending.delete(key);\n\t\t\t\tif (pending.kind !== \"add\") return removal(key, pending.finished);\n\t\t\t}\n\t\t\treturn undefined;\n\t\t}\n\t\tif (this.sync instanceof Set && this.sync.size === 0) {\n\t\t\tthis.sync = \"sent\";\n\t\t\treturn { kind: \"synced\" };\n\t\t}\n\t\tconst first = this.pending.entries().next();\n\t\tif (first.done) throw new Error(\"a ready queue has a pending change\");\n\t\tconst [key, pending] = first.value;\n\t\tswitch (pending.kind) {\n\t\t\tcase \"add\":\n\t\t\t\tthis.dequeue(key);\n\t\t\t\treturn { kind: \"added\", name: key.slice(1), ...pending.listed };\n\t\t\tcase \"remove\":\n\t\t\t\tthis.dequeue(key);\n\t\t\t\treturn removal(key, pending.finished);\n\t\t\tcase \"readd\":\n\t\t\t\t// Setting an existing key keeps its place, so the add is read next, and SYNCED\n\t\t\t\t// still waits on it if it did.\n\t\t\t\tthis.pending.set(key, { kind: \"add\", listed: pending.listed });\n\t\t\t\treturn removal(key, pending.finished);\n\t\t}\n\t}\n}\n\n/**\n * The listing half of a broadcast's state.\n *\n * @internal\n */\nexport class Listing {\n\t/** Every listed track, in the order it was listed. */\n\t#live = new Map<string, Entry>();\n\t/** The queue of every reader of the current answer. */\n\t#readers = new Set<Queue>();\n\t/** Each owner's reader. */\n\t#owners = new Map<object, Queue>();\n\t/** Whether a {@link Lister} exists. While one does, readers wait for its answer to sync. */\n\t#lister = false;\n\t/** Whether the lister's answer has synced. */\n\t#answered = false;\n\t#wanted = new Signal(false);\n\t#closed: GetPromise<null>;\n\n\tconstructor(closed: GetPromise<null>) {\n\t\tthis.#closed = closed;\n\t}\n\n\t/** Whether anyone lists the broadcast. */\n\tget wanted(): Getter<boolean> {\n\t\treturn this.#wanted;\n\t}\n\n\t/** Settles once the broadcast ended. */\n\tget closed(): GetPromise<null> {\n\t\treturn this.#closed;\n\t}\n\n\t#synced(): boolean {\n\t\treturn !this.#lister || this.#answered;\n\t}\n\n\t#counted() {\n\t\tthis.#wanted.set(this.#readers.size > 0);\n\t}\n\n\t/** Re-evaluate whether the listing has synced, telling readers when it changed. */\n\t#resync(was: boolean) {\n\t\tconst now = this.#synced();\n\t\tif (!was && now) for (const queue of this.#readers) queue.synced();\n\t\tif (was && !now) for (const queue of this.#readers) queue.unsync();\n\t}\n\n\t#insert(key: string, entry: Entry) {\n\t\tthis.#live.set(key, entry);\n\t\tfor (const queue of this.#readers) queue.add(key, entry.listed);\n\t}\n\n\t/** Unlist the track under `key`, telling readers whether it `finished`. */\n\t#remove(key: string, finished: boolean) {\n\t\tif (!this.#live.delete(key)) return;\n\t\tfor (const queue of this.#readers) queue.remove(key, finished);\n\t}\n\n\t/**\n\t * A reader with every listed track queued, ending `owner`'s older one with CANCELLED so an\n\t * owner's listings cost one queue per broadcast however many requests reach it.\n\t */\n\tread(owner?: object): Queue {\n\t\tif (this.#closed.peek() !== undefined) {\n\t\t\tthrow new StreamError(StreamCode.Unroutable, { message: \"broadcast is closed\" });\n\t\t}\n\t\tconst queue = new Queue();\n\t\tfor (const [key, entry] of this.#live) queue.pending.set(key, { kind: \"add\", listed: entry.listed });\n\t\tif (this.#synced()) queue.sync = new Set(queue.pending.keys());\n\t\tthis.#readers.add(queue);\n\t\tif (owner) {\n\t\t\tconst older = this.#owners.get(owner);\n\t\t\tthis.#owners.set(owner, queue);\n\t\t\tif (older) {\n\t\t\t\tthis.#readers.delete(older);\n\t\t\t\tolder.finish(new StreamError(StreamCode.Cancel, { message: \"replaced by a newer listing\" }));\n\t\t\t}\n\t\t}\n\t\tthis.#counted();\n\t\treturn queue;\n\t}\n\n\t/** A reader left, so it reads nothing more. A replaced or ended one already did. */\n\trelease(queue: Queue, owner?: object) {\n\t\tqueue.pending.clear();\n\t\tif (queue.detached) return;\n\t\tqueue.finish(null);\n\t\tthis.#readers.delete(queue);\n\t\tif (owner && this.#owners.get(owner) === queue) this.#owners.delete(owner);\n\t\tthis.#counted();\n\t}\n\n\t/** List the track of groups `producer` created. */\n\tlistTrack(producer: track.Producer, info: track.Info) {\n\t\tthis.#listOwn(producer.name, { type: \"track\", producer }, { type: \"track\", info });\n\t}\n\n\t/** List the datagram track `producer` created. */\n\tlistDatagrams(producer: datagram.Producer, info: datagram.Info) {\n\t\tthis.#listOwn(producer.name, { type: \"datagrams\", producer }, { type: \"datagrams\", info });\n\t}\n\n\t#listOwn(name: string, own: Own, listed: Listed) {\n\t\tconst key = keyOf(name, listed.type);\n\t\tconst entry = this.#live.get(key);\n\t\tif (!entry) {\n\t\t\tthis.#insert(key, { listed, own, answered: false });\n\t\t} else if (entry.own && !entry.answered) {\n\t\t\t// The earlier track of the name has not unlisted yet, but it left the table for this\n\t\t\t// one: readers see it go, as it ended, and the new one arrive.\n\t\t\tthis.#remove(key, finished(entry.own));\n\t\t\tthis.#insert(key, { listed, own, answered: false });\n\t\t} else {\n\t\t\t// Listed already by the answer, and it never stopped being listed: only the owner moves.\n\t\t\tentry.own = own;\n\t\t}\n\t}\n\n\t/**\n\t * Unlist the track `producer` created, as one that `finished` or left unfinished (by default,\n\t * as it ended), unless a later one took its name.\n\t */\n\tunlistOwn(producer: track.Producer | datagram.Producer, type: Kind = \"track\", done?: boolean) {\n\t\tconst entry = this.#live.get(keyOf(producer.name, type));\n\t\tif (!entry?.own || entry.own.producer !== producer) return;\n\t\tconst own = entry.own;\n\t\tentry.own = undefined;\n\t\tif (!entry.answered) this.#remove(keyOf(producer.name, type), done ?? finished(own));\n\t}\n\n\t/** Lister support; see {@link Lister}. */\n\tattach() {\n\t\tif (this.#lister) throw new Error(\"the broadcast already has a lister\");\n\t\tconst was = this.#synced();\n\t\tthis.#lister = true;\n\t\tthis.#resync(was);\n\t}\n\n\tdetachLister() {\n\t\tconst was = this.#synced();\n\t\tthis.#lister = false;\n\t\t// Synced from here on, with only the producer's tracks.\n\t\tthis.#unanswer();\n\t\tthis.#resync(was);\n\t}\n\n\tanswerAdd(name: string, listed: Listed) {\n\t\tconst key = keyOf(name, listed.type);\n\t\tconst entry = this.#live.get(key);\n\t\tif (entry?.answered) throw new Error(`duplicate listed track: ${name}`);\n\t\tif (entry) entry.answered = true;\n\t\t// Copied, so an event forwarded as the answer lends it nothing else.\n\t\telse\n\t\t\tthis.#insert(key, {\n\t\t\t\tlisted:\n\t\t\t\t\tlisted.type === \"datagrams\"\n\t\t\t\t\t\t? { type: \"datagrams\", info: listed.info }\n\t\t\t\t\t\t: { type: \"track\", info: listed.info },\n\t\t\t\tanswered: true,\n\t\t\t});\n\t}\n\n\tanswerRemove(name: string, finished: boolean, type: Kind = \"track\") {\n\t\tthis.#answerRemove(keyOf(name, type), finished);\n\t}\n\n\t#answerRemove(key: string, finished: boolean) {\n\t\tconst entry = this.#live.get(key);\n\t\tif (!entry?.answered) throw new Error(`track not listed: ${key.slice(1)}`);\n\t\tentry.answered = false;\n\t\tif (!entry.own) this.#remove(key, finished);\n\t}\n\n\tanswerSynced() {\n\t\tconst was = this.#synced();\n\t\tthis.#answered = true;\n\t\tthis.#resync(was);\n\t}\n\n\t/** Drop the answer: every track it listed, and its sync. */\n\tanswerClear() {\n\t\tconst was = this.#synced();\n\t\tthis.#unanswer();\n\t\tthis.#resync(was);\n\t}\n\n\t#unanswer() {\n\t\tfor (const [key, entry] of [...this.#live]) {\n\t\t\tif (entry.answered) this.#answerRemove(key, false);\n\t\t}\n\t\tthis.#answered = false;\n\t}\n\n\t/**\n\t * The broadcast ended: so does every listing of it, first unlisting each of its producer's tracks\n\t * that finished. A handler's answer of the same name does not keep it live, since the producer's\n\t * track is what served it.\n\t */\n\tclose() {\n\t\tfor (const [key, entry] of [...this.#live]) {\n\t\t\tif (entry.own && finished(entry.own)) this.#remove(key, true);\n\t\t}\n\t\tthis.detach(null);\n\t}\n\n\t/** End every reader with `end` and detach them. */\n\tdetach(end: Error | null) {\n\t\tfor (const queue of this.#readers) queue.finish(end);\n\t\tthis.#readers.clear();\n\t\tthis.#owners.clear();\n\t\tthis.#counted();\n\t}\n}\n\nlet makeTracks: (listing: Listing, owner?: object) => Tracks;\n\n/**\n * List a broadcast's tracks, ending `owner`'s older listing of it with CANCELLED.\n *\n * @internal\n */\nexport function listTracks(listing: Listing, owner?: object): Tracks {\n\treturn makeTracks(listing, owner);\n}\n\n/**\n * The tracks a broadcast lists, from its consumer's `tracks()`.\n *\n * Reports every track listed once the listing is complete, then `synced`, then each change as it\n * happens, until the broadcast ends: a clean end comes after each track that left before it, and\n * a track still listed then ends unfinished. Listing a broadcast never requests a track: subscribe to\n * each listed one through the consumer's `track(name)`.\n *\n * @public\n */\nexport class Tracks {\n\t#listing: Listing;\n\t#queue: Queue;\n\t#owner?: object;\n\n\tprivate constructor(listing: Listing, owner?: object) {\n\t\tthis.#listing = listing;\n\t\tthis.#queue = listing.read(owner);\n\t\tthis.#owner = owner;\n\t}\n\n\tstatic {\n\t\tmakeTracks = (listing, owner) => new Tracks(listing, owner);\n\t}\n\n\t/**\n\t * The next event, or undefined once the broadcast ended or this listing closed. Throws the\n\t * error that ended the listing, such as the peer refusing it.\n\t */\n\tasync next(): Promise<TracksEvent | undefined> {\n\t\tfor (;;) {\n\t\t\tif (this.#queue.ready()) return this.#queue.next();\n\t\t\tawait Signal.race(this.#queue.changed);\n\t\t}\n\t}\n\n\t/** The events as they arrive; leaving the loop early closes the listing. */\n\tasync *[Symbol.asyncIterator](): AsyncGenerator<TracksEvent, void, undefined> {\n\t\ttry {\n\t\t\tfor (;;) {\n\t\t\t\tconst event = await this.next();\n\t\t\t\tif (!event) return;\n\t\t\t\tyield event;\n\t\t\t}\n\t\t} finally {\n\t\t\tthis.close();\n\t\t}\n\t}\n\n\t/** Stop listing. Idempotent. */\n\tclose(): void {\n\t\tthis.#listing.release(this.#queue, this.#owner);\n\t}\n}\n\n/** Make the lister attached to a broadcast's listing state. @internal */\nexport let makeLister: (listing: Listing) => Lister;\n\n/**\n * Answers a broadcast's listings for a handler that knows the tracks it would serve, as a\n * session lists its peer's. A broadcast has at most one.\n *\n * While it exists, readers wait for it to {@link synced} before reporting `synced`. Answer\n * while {@link wanted}: list what the publisher behind it holds and keep it current, then\n * {@link clear} once unwanted. {@link close} withdraws what it listed; a closed lister answers\n * nothing more.\n */\nexport class Lister {\n\treadonly #listing: Listing;\n\t// The listing this lister answers into, until it closes.\n\t#answering?: Listing;\n\n\tprivate constructor(listing: Listing) {\n\t\tlisting.attach();\n\t\tthis.#listing = listing;\n\t\tthis.#answering = listing;\n\t}\n\n\tstatic {\n\t\tmakeLister = (listing) => new Lister(listing);\n\t}\n\n\t/** Whether anyone lists the broadcast. */\n\tget wanted(): Getter<boolean> {\n\t\treturn this.#listing.wanted;\n\t}\n\n\t/** Settles once the broadcast ended, as every listing of it does. */\n\tget closed(): GetPromise<null> {\n\t\treturn this.#listing.closed;\n\t}\n\n\t/** List a track of the kind `listed` says. Throws if this answer already lists that kind and name. */\n\tadd(name: string, listed: Listed): void {\n\t\tthis.#answering?.answerAdd(name, listed);\n\t}\n\n\t/**\n\t * Stop listing a track of `type` that left unfinished, reported as `removed`. Throws if this\n\t * answer does not list that kind and name.\n\t */\n\tremove(name: string, type: Kind = \"track\"): void {\n\t\tthis.#answering?.answerRemove(name, false, type);\n\t}\n\n\t/**\n\t * Stop listing a track of `type` that finished, reported as `finished`. Throws if this answer\n\t * does not list that kind and name.\n\t */\n\tfinish(name: string, type: Kind = \"track\"): void {\n\t\tthis.#answering?.answerRemove(name, true, type);\n\t}\n\n\t/** The answer holds everything this hop knows now; later changes are live. */\n\tsynced(): void {\n\t\tthis.#answering?.answerSynced();\n\t}\n\n\t/** Withdraw the answer: every track it listed, and its sync. */\n\tclear(): void {\n\t\tthis.#answering?.answerClear();\n\t}\n\n\t/** End every current reader as if the broadcast ended, and withdraw the answer. A later reader asks again. */\n\tend(): void {\n\t\tconst listing = this.#answering;\n\t\tlisting?.detach(null);\n\t\tlisting?.answerClear();\n\t}\n\n\t/** Fail every current reader with `err`, and withdraw the answer. A later reader asks again. */\n\tabort(err: Error): void {\n\t\tconst listing = this.#answering;\n\t\tlisting?.detach(err);\n\t\tlisting?.answerClear();\n\t}\n\n\t/** Stop answering: the broadcast lists only its producer's tracks from here on. Idempotent. */\n\tclose(): void {\n\t\tthis.#answering?.detachLister();\n\t\tthis.#answering = undefined;\n\t}\n}\n"]}
@@ -1,116 +1,175 @@
1
- import { type Cost, type Hop } from "../hop";
2
- import * as Path from "../path";
3
- import type { Reader, Writer } from "../stream";
4
- import { Version } from "./version";
5
- export type { Cost };
6
- /**
7
- * Lite-07: copy `keep` path segments (from the head) or hops (from the tail) of the
8
- * live announcement `distance` back from the stream's next Announce ID, where 1 is the
9
- * latest ANNOUNCE_START. Resolved by {@link AnnounceHistory}.
10
- */
1
+ import { type Cost, type Hop } from "../hop.ts";
2
+ import type * as Identity from "../identity.ts";
3
+ import * as Path from "../path.ts";
4
+ import { type Reader, type Writer } from "../stream.ts";
5
+ import { Version } from "./version.ts";
6
+ /** Lite-07: copy the first `keep` path segments of the live announcement `distance` back from
7
+ * the stream's next Announce ID, where 1 is the latest ANNOUNCE_START. Resolved by
8
+ * {@link AnnounceHistory}. */
11
9
  export type Base = {
12
10
  distance: bigint;
13
11
  keep: number;
14
12
  };
13
+ /** The most nodes a lite-07 claim's chain may name: one that would reach 32 is never taken. */
14
+ export declare const CHAIN_MAX = 31;
15
15
  /**
16
- * An announcement on the Announce Stream, advertising or retracting a broadcast.
16
+ * What a lite-07 claim says beside its path and identity. Mirrors `route::relay::Claim` in
17
+ * rs/moq-net.
18
+ */
19
+ export interface Claim {
20
+ /** Which incarnation of the identity this is. */
21
+ epoch: bigint;
22
+ /** The sender's cost to the claim's publisher. */
23
+ cost: Cost;
24
+ /** How many segments broader the claim is than the path it is presented at. */
25
+ above: bigint;
26
+ /** No route reaches the claim from the node that told it: requests for it fail until one does. */
27
+ unavailable: boolean;
28
+ /** A node on the way to its publisher sent GOAWAY. */
29
+ draining: boolean;
30
+ /** A marked session lies on the way to its publisher, so a relay never tells it over another. */
31
+ marked: boolean;
32
+ /** The lowest link priority on the way to its publisher. */
33
+ priority: number;
34
+ /** The Relay of each relay the claim entered or left a routing domain by, oldest first. */
35
+ chain: bigint[];
36
+ }
37
+ /** A claim this origin publishes itself: no cost, at the top priority, announced again by no one. */
38
+ export declare function ownClaim(epoch: bigint, above?: bigint): Claim;
39
+ /** Whether two claims say the same. */
40
+ export declare function claimsEqual(a: Claim, b: Claim): boolean;
41
+ /**
42
+ * A message on the Announce Stream.
43
+ *
44
+ * Lite-07 carries everything one side says about its claims on its one unidirectional stream:
45
+ * the edits of the prefixes it wants (`request`), and the markers (`ok`, `synced`) and claims
46
+ * answering the prefixes its peer wants. Two nodes that both declared a Node ID also exchange
47
+ * routes there, which an endpoint never sends and refuses to receive.
17
48
  *
18
- * On lite-06+ these are three independently-typed messages (`ANNOUNCE_START`,
19
- * `ANNOUNCE_END`, `ANNOUNCE_RESTART`), each framed as `Type | Length | Body` like the
20
- * subscribe stream's responses. Each `active` (ANNOUNCE_START) implicitly assigns the
21
- * next announce id (a per-stream ordinal starting at 0); `endedId`/`restart` reference
22
- * that id instead of repeating the path. Older versions send a single ANNOUNCE_BROADCAST
23
- * message that retracts by path (`ended`).
49
+ * On lite-06+ these are independently-typed messages, each framed as `Type | Length | Body`
50
+ * like the subscribe stream's responses. Each ANNOUNCE_START implicitly assigns the next
51
+ * announce id (a per-stream ordinal starting at 0); the others reference it. Older versions send
52
+ * a single ANNOUNCE_BROADCAST message that retracts by path (`ended`).
24
53
  */
25
54
  export type AnnounceBroadcast =
26
- /** A broadcast is now available, carrying the path suffix, the hop chain, and
27
- * (lite-06+) the route cost. An absent cost encodes as zero; it decodes as
28
- * `undefined` on a wire with no room for one. On lite-07, `suffix` follows the
29
- * segments `pathBase` copies and `hops` precede the ones `hopBase` copies. */
55
+ /** Before lite-07: a broadcast is now available, carrying the path suffix relative to the
56
+ * requested prefix, the hop chain, and (lite-06) the cost. An absent cost encodes as zero; it
57
+ * decodes as `undefined` on a wire with no room for one. */
30
58
  {
31
59
  status: "active";
32
60
  suffix: Path.Valid;
33
- hops: Hop[];
61
+ hops?: Hop[];
34
62
  cost?: Cost;
35
- pathBase?: Base;
36
- hopBase?: Base;
37
63
  }
38
64
  /** Pre-lite-06: a broadcast is no longer available, retracted by path. */
39
65
  | {
40
66
  status: "ended";
41
67
  suffix: Path.Valid;
42
68
  }
43
- /** Lite06+: a broadcast is no longer available, retracted by announce id.
44
- * The id is retired; referencing it again is a protocol violation. */
69
+ /** Lite06+: the claim with this announce id is gone, and the id retired; referencing it again
70
+ * is a protocol violation. On lite-07 its publisher withdrew it unless `lost`, when the
71
+ * sender only lost its way to it. */
45
72
  | {
46
73
  status: "endedId";
47
74
  id: bigint;
75
+ lost?: boolean;
48
76
  }
49
- /** Lite06+: atomically replace the announcement with this id (e.g. a new hop
50
- * chain after a relay failover, or a route whose cost moved). The id stays live. */
77
+ /** Lite06 only: atomically replace the hop chain and cost of the announcement with this id.
78
+ * The id stays live. */
51
79
  | {
52
- status: "restart";
80
+ status: "update";
53
81
  id: bigint;
54
- hops: Hop[];
82
+ hops?: Hop[];
55
83
  cost?: Cost;
56
- hopBase?: Base;
57
84
  }
58
- /** An unknown lite-06+ announce type, skipped by length. Does not assign an id. */
85
+ /** Lite07+ ANNOUNCE_START: a claim of the broadcast at `suffix`, relative to the session,
86
+ * serving `identity`, which assigns it the next announce id. */
87
+ | {
88
+ status: "start";
89
+ suffix: Path.Valid;
90
+ pathBase?: Base;
91
+ identity: Identity.Valid;
92
+ claim: Claim;
93
+ }
94
+ /** Lite07+ ANNOUNCE_UPDATE: the claim with this id now stands as `claim`. */
95
+ | {
96
+ status: "change";
97
+ id: bigint;
98
+ claim: Claim;
99
+ }
100
+ /** An unknown lite-06 announce type, skipped by length. Does not assign an id. lite-07 rejects it instead. */
59
101
  | {
60
102
  status: "skipped";
103
+ }
104
+ /** Lite07+ SYNCED: the initial set of the prefix the receiver assigned this Prefix ID has been
105
+ * delivered. */
106
+ | {
107
+ status: "synced";
108
+ prefix: bigint;
109
+ }
110
+ /** Lite07+ ANNOUNCE_REQUEST: the sender edits the prefixes it wants claims for, removing those
111
+ * with the Prefix IDs in `remove` and then adding each of `add`, which assigns it the next
112
+ * Prefix ID. With `more`, the edit continues in the next message, and takes effect whole with
113
+ * its last (see `requestParts`). */
114
+ | {
115
+ status: "request";
116
+ more: boolean;
117
+ remove: bigint[];
118
+ add: Add[];
119
+ }
120
+ /** Lite07+ ANNOUNCE_OK: the receiver's oldest unanswered edit takes effect here. */
121
+ | {
122
+ status: "ok";
61
123
  };
124
+ /** A prefix an ANNOUNCE_REQUEST adds, relative to the session, and whether it also wants the
125
+ * hidden claims beneath it. */
126
+ export interface Add {
127
+ prefix: Path.Valid;
128
+ hidden: boolean;
129
+ }
130
+ /** Whether the prefixes `set` fit the Adds of one ANNOUNCE_REQUEST, as a subscriber's whole set
131
+ * must. */
132
+ export declare function requestFits(set: Iterable<Path.Valid>, version: Version): boolean;
62
133
  /** Encode one announcement, including its type discriminator (lite-06+) and length prefix. */
63
134
  export declare function encodeAnnounceBroadcast(w: Writer, msg: AnnounceBroadcast, version: Version): Promise<void>;
64
135
  /** Decode one announcement, including its type discriminator (lite-06+) and length prefix. */
65
136
  export declare function decodeAnnounceBroadcast(r: Reader, version: Version): Promise<AnnounceBroadcast>;
66
137
  /** Like {@link decodeAnnounceBroadcast} but resolves `undefined` on a clean FIN. */
67
138
  export declare function decodeAnnounceBroadcastMaybe(r: Reader, version: Version): Promise<AnnounceBroadcast | undefined>;
68
- type Advertised = {
69
- suffix: Path.Valid;
70
- hops: Hop[];
71
- };
72
139
  /**
73
- * The live announcements on one lite-06+ announce stream, by Announce ID: what
74
- * ANNOUNCE_END and ANNOUNCE_UPDATE reference, and what a lite-07 base copies from.
75
- * Every violation throws {@link ProtocolViolation}.
140
+ * The live announcements on one lite-06+ announce stream, by Announce ID: what ANNOUNCE_END
141
+ * and ANNOUNCE_UPDATE reference, and what a lite-07 base copies from. Every
142
+ * violation throws {@link ProtocolViolation}.
76
143
  */
77
144
  export declare class AnnounceHistory {
78
145
  #private;
79
- /** An ANNOUNCE_START: resolve it and assign it the next id. */
146
+ /** The Announce ID the next ANNOUNCE_START is assigned. */
147
+ get next(): bigint;
148
+ /** An ANNOUNCE_START: assign it the next id, and resolve its suffix, or undefined when that
149
+ * suffix, or the base it names, is no path this node can hold. */
80
150
  start(msg: {
81
151
  suffix: Path.Valid;
82
- hops: Hop[];
83
152
  pathBase?: Base;
84
- hopBase?: Base;
85
- }): Advertised;
86
- /** An ANNOUNCE_UPDATE: resolve its chain before replacing the old one, which it may be based on. */
87
- update(msg: {
88
- id: bigint;
89
- hops: Hop[];
90
- hopBase?: Base;
91
- }): Advertised;
92
- /** An ANNOUNCE_END: retire the id, returning its suffix. */
93
- end(id: bigint): Path.Valid;
153
+ } | undefined): Path.Valid | undefined;
154
+ /** The suffix of the live announcement `id`, which an update references. */
155
+ get(id: bigint): Path.Valid;
156
+ /** An ANNOUNCE_END: retire the id, returning its suffix, or undefined if it was refused. */
157
+ end(id: bigint): Path.Valid | undefined;
94
158
  }
95
159
  /**
96
- * ANNOUNCE_REQUEST: sent by the subscriber to request ANNOUNCE_BROADCAST messages
97
- * for a path prefix. Renamed from `AnnounceInterest` in lite-05.
160
+ * ANNOUNCE_REQUEST before lite-07: sent by the subscriber to request ANNOUNCE_BROADCAST messages
161
+ * for a path prefix, opening a bidirectional Announce Stream. Renamed from `AnnounceInterest` in
162
+ * lite-05. Lite-07 edits a set of prefixes on its one stream instead (the `request` message).
98
163
  */
99
164
  export declare class AnnounceRequest {
100
165
  #private;
101
166
  prefix: Path.Valid;
102
- /** Lite04/05 only: the 62-bit Hop id of the peer asking for announces, which the
103
- * publisher uses to skip announces that already passed through it. Zero means "no
104
- * exclusion". Not on the wire elsewhere, so a value set here is ignored when encoding
105
- * for another version and decodes as zero.
106
- *
107
- * Must be a bigint: peer origins are up to 62 bits and overflow u53. */
108
- excludeHop: bigint;
109
- /** Lite07+: also announce routes with a `.`-prefixed segment below the prefix. Not on
110
- * the wire earlier, so a value set here is ignored when encoding for an older version
111
- * and decodes as false. */
112
- hidden: boolean;
113
- constructor(prefix: Path.Valid, excludeHop?: bigint, hidden?: boolean);
167
+ /** Lite04/05 only: the Hop id of the peer asking for announces, which the publisher
168
+ * uses to skip announces that already passed through it. {@link UNKNOWN_HOP} means
169
+ * "no exclusion". Not on the wire elsewhere, so a value set here is ignored when
170
+ * encoding for another version and decodes as unknown. */
171
+ excludeHop: Hop;
172
+ constructor(prefix: Path.Valid, excludeHop?: Hop);
114
173
  encode(w: Writer, version: Version): Promise<void>;
115
174
  static decode(r: Reader, version: Version): Promise<AnnounceRequest>;
116
175
  }
@@ -118,8 +177,10 @@ export declare class AnnounceInit {
118
177
  #private;
119
178
  suffixes: Path.Valid[];
120
179
  constructor(paths: Path.Valid[]);
180
+ static readonly MAX_SIZE: number;
121
181
  encode(w: Writer, version: Version): Promise<void>;
122
- static decode(r: Reader, version: Version): Promise<AnnounceInit>;
182
+ /** Decode the initial set, refusing one that lists more than `budget` broadcasts. */
183
+ static decode(r: Reader, version: Version, budget: number): Promise<AnnounceInit>;
123
184
  }
124
185
  export declare class AnnounceOk {
125
186
  #private;
@@ -1 +1 @@
1
- {"version":3,"file":"announce.d.ts","sourceRoot":"","sources":["../../src/lite/announce.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,IAAI,EAAE,KAAK,GAAG,EAAoC,MAAM,WAAW,CAAC;AAClF,OAAO,KAAK,IAAI,MAAM,YAAY,CAAC;AACnC,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAEnD,OAAO,EAON,OAAO,EACP,MAAM,cAAc,CAAC;AActB,YAAY,EAAE,IAAI,EAAE,CAAC;AAErB;;;;GAIG;AACH,MAAM,MAAM,IAAI,GAAG;IAAE,QAAQ,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,CAAC;AAEtD;;;;;;;;;GASG;AACH,MAAM,MAAM,iBAAiB;AAC5B;;;8EAG8E;AAC5E;IAAE,MAAM,EAAE,QAAQ,CAAC;IAAC,MAAM,EAAE,IAAI,CAAC,KAAK,CAAC;IAAC,IAAI,EAAE,GAAG,EAAE,CAAC;IAAC,IAAI,CAAC,EAAE,IAAI,CA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