@moq/net 0.4.8 → 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 (662) 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 -1
  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 -31
  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 -138
  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 -1
  33. package/bandwidth_api.js.map +1 -1
  34. package/broadcast.d.ts +62 -36
  35. package/broadcast.d.ts.map +1 -1
  36. package/broadcast.js +556 -172
  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 +20 -12
  47. package/connection/accept.d.ts.map +1 -1
  48. package/connection/accept.js +97 -129
  49. package/connection/accept.js.map +1 -1
  50. package/connection/browser.d.ts.map +1 -1
  51. package/connection/browser.js +28 -19
  52. package/connection/browser.js.map +1 -1
  53. package/connection/connect.d.ts +119 -23
  54. package/connection/connect.d.ts.map +1 -1
  55. package/connection/connect.js +535 -216
  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 -80
  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 -108
  72. package/connection/goaway.js.map +1 -1
  73. package/connection/handshake.d.ts +32 -6
  74. package/connection/handshake.d.ts.map +1 -1
  75. package/connection/handshake.js +97 -20
  76. package/connection/handshake.js.map +1 -1
  77. package/connection/index.d.ts +3 -6
  78. package/connection/index.d.ts.map +1 -1
  79. package/connection/index.js +1 -2
  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 +137 -58
  86. package/connection/pool.d.ts.map +1 -1
  87. package/connection/pool.js +281 -117
  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 -233
  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 -8
  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 -4
  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 -46
  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 -1
  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 -37
  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 -2
  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 -307
  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 -64
  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 -35
  199. package/ietf/aliases.js.map +1 -1
  200. package/ietf/cluster.d.ts +3 -3
  201. package/ietf/cluster.js +14 -62
  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 -143
  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 -100
  213. package/ietf/error.js.map +1 -1
  214. package/ietf/fetch.d.ts +91 -35
  215. package/ietf/fetch.d.ts.map +1 -1
  216. package/ietf/fetch.js +172 -93
  217. package/ietf/fetch.js.map +1 -1
  218. package/ietf/filter.d.ts +20 -30
  219. package/ietf/filter.d.ts.map +1 -1
  220. package/ietf/filter.js +140 -171
  221. package/ietf/filter.js.map +1 -1
  222. package/ietf/goaway.d.ts +11 -9
  223. package/ietf/goaway.d.ts.map +1 -1
  224. package/ietf/goaway.js +22 -35
  225. package/ietf/goaway.js.map +1 -1
  226. package/ietf/hidden.js +1 -1
  227. package/ietf/hidden.js.map +1 -1
  228. package/ietf/index.d.ts +2 -14
  229. package/ietf/index.d.ts.map +1 -1
  230. package/ietf/index.js +4 -14
  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 -40
  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 +17 -3
  245. package/ietf/namespace.d.ts.map +1 -1
  246. package/ietf/namespace.js +78 -26
  247. package/ietf/namespace.js.map +1 -1
  248. package/ietf/object.d.ts +194 -32
  249. package/ietf/object.d.ts.map +1 -1
  250. package/ietf/object.js +405 -178
  251. package/ietf/object.js.map +1 -1
  252. package/ietf/parameters.d.ts +22 -42
  253. package/ietf/parameters.d.ts.map +1 -1
  254. package/ietf/parameters.js +260 -472
  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 -4
  259. package/ietf/priority.js.map +1 -1
  260. package/ietf/properties.d.ts +5 -4
  261. package/ietf/properties.d.ts.map +1 -1
  262. package/ietf/properties.js +78 -48
  263. package/ietf/properties.js.map +1 -1
  264. package/ietf/publish.d.ts +22 -30
  265. package/ietf/publish.d.ts.map +1 -1
  266. package/ietf/publish.js +45 -139
  267. package/ietf/publish.js.map +1 -1
  268. package/ietf/publish_namespace.d.ts +46 -69
  269. package/ietf/publish_namespace.d.ts.map +1 -1
  270. package/ietf/publish_namespace.js +66 -184
  271. package/ietf/publish_namespace.js.map +1 -1
  272. package/ietf/publisher.js +1800 -600
  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 +3 -27
  279. package/ietf/request.d.ts.map +1 -1
  280. package/ietf/request.js +41 -78
  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 -16
  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 +4 -29
  291. package/ietf/setup.d.ts.map +1 -1
  292. package/ietf/setup.js +6 -117
  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 -14
  299. package/ietf/solicit.js.map +1 -1
  300. package/ietf/subscribe.d.ts +48 -41
  301. package/ietf/subscribe.d.ts.map +1 -1
  302. package/ietf/subscribe.js +118 -239
  303. package/ietf/subscribe.js.map +1 -1
  304. package/ietf/subscribe_namespace.d.ts +13 -76
  305. package/ietf/subscribe_namespace.d.ts.map +1 -1
  306. package/ietf/subscribe_namespace.js +30 -201
  307. package/ietf/subscribe_namespace.js.map +1 -1
  308. package/ietf/subscriber.js +1839 -536
  309. package/ietf/subscriber.js.map +1 -1
  310. package/ietf/token.js +105 -27
  311. package/ietf/token.js.map +1 -1
  312. package/ietf/track.d.ts +25 -22
  313. package/ietf/track.d.ts.map +1 -1
  314. package/ietf/track.js +48 -61
  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 -48
  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 +25 -10
  325. package/index.d.ts.map +1 -1
  326. package/index.js +19 -6
  327. package/index.js.map +1 -1
  328. package/internal.d.ts +1512 -64
  329. package/internal.d.ts.map +1 -1
  330. package/internal.js +557 -79
  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 +124 -63
  341. package/lite/announce.d.ts.map +1 -1
  342. package/lite/announce.js +384 -158
  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 -77
  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 -9
  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 +1 -1
  389. package/lite/goaway.d.ts.map +1 -1
  390. package/lite/goaway.js +5 -13
  391. package/lite/goaway.js.map +1 -1
  392. package/lite/group.d.ts +64 -13
  393. package/lite/group.d.ts.map +1 -1
  394. package/lite/group.js +108 -30
  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 +2 -1
  401. package/lite/index.d.ts.map +1 -1
  402. package/lite/index.js +2 -1
  403. package/lite/index.js.map +1 -1
  404. package/lite/message.d.ts +9 -1
  405. package/lite/message.d.ts.map +1 -1
  406. package/lite/message.js +28 -44
  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 -105
  411. package/lite/priority.js.map +1 -1
  412. package/lite/probe.d.ts.map +1 -1
  413. package/lite/probe.js +9 -0
  414. package/lite/probe.js.map +1 -1
  415. package/lite/publisher.d.ts +10 -1
  416. package/lite/publisher.d.ts.map +1 -1
  417. package/lite/publisher.js +2548 -437
  418. package/lite/publisher.js.map +1 -1
  419. package/lite/routed.d.ts +59 -0
  420. package/lite/routed.d.ts.map +1 -0
  421. package/lite/routed.js +564 -0
  422. package/lite/routed.js.map +1 -0
  423. package/lite/session.d.ts +1 -27
  424. package/lite/session.d.ts.map +1 -1
  425. package/lite/session.js +0 -99
  426. package/lite/session.js.map +1 -1
  427. package/lite/setup.d.ts +29 -2
  428. package/lite/setup.d.ts.map +1 -1
  429. package/lite/setup.js +95 -21
  430. package/lite/setup.js.map +1 -1
  431. package/lite/stream.d.ts +5 -11
  432. package/lite/stream.d.ts.map +1 -1
  433. package/lite/stream.js +5 -1
  434. package/lite/stream.js.map +1 -1
  435. package/lite/subscribe.d.ts +475 -75
  436. package/lite/subscribe.d.ts.map +1 -1
  437. package/lite/subscribe.js +1373 -142
  438. package/lite/subscribe.js.map +1 -1
  439. package/lite/subscriber.d.ts +7 -44
  440. package/lite/subscriber.d.ts.map +1 -1
  441. package/lite/subscriber.js +3290 -515
  442. package/lite/subscriber.js.map +1 -1
  443. package/lite/track.d.ts +24 -9
  444. package/lite/track.d.ts.map +1 -1
  445. package/lite/track.js +116 -37
  446. package/lite/track.js.map +1 -1
  447. package/lite/tracks.d.ts +55 -0
  448. package/lite/tracks.d.ts.map +1 -0
  449. package/lite/tracks.js +114 -0
  450. package/lite/tracks.js.map +1 -0
  451. package/lite/version.d.ts +132 -24
  452. package/lite/version.d.ts.map +1 -1
  453. package/lite/version.js +378 -33
  454. package/lite/version.js.map +1 -1
  455. package/meta.d.ts +77 -0
  456. package/meta.d.ts.map +1 -0
  457. package/meta.js +130 -0
  458. package/meta.js.map +1 -0
  459. package/meta_api.d.ts +7 -0
  460. package/meta_api.d.ts.map +1 -0
  461. package/meta_api.js +7 -0
  462. package/meta_api.js.map +1 -0
  463. package/mint.d.ts +28 -0
  464. package/mint.d.ts.map +1 -0
  465. package/mint.js +66 -0
  466. package/mint.js.map +1 -0
  467. package/open.d.ts +63 -0
  468. package/open.d.ts.map +1 -0
  469. package/open.js +250 -0
  470. package/open.js.map +1 -0
  471. package/origin.d.ts +392 -140
  472. package/origin.d.ts.map +1 -1
  473. package/origin.js +2533 -686
  474. package/origin.js.map +1 -1
  475. package/package.json +8 -13
  476. package/path.d.ts +51 -51
  477. package/path.d.ts.map +1 -1
  478. package/path.js +210 -57
  479. package/path.js.map +1 -1
  480. package/payload.d.ts +33 -0
  481. package/payload.d.ts.map +1 -0
  482. package/payload.js +65 -0
  483. package/payload.js.map +1 -0
  484. package/prefix.d.ts +152 -0
  485. package/prefix.d.ts.map +1 -0
  486. package/prefix.js +349 -0
  487. package/prefix.js.map +1 -0
  488. package/priority.d.ts +8 -0
  489. package/priority.d.ts.map +1 -0
  490. package/priority.js +185 -0
  491. package/priority.js.map +1 -0
  492. package/queue.d.ts +2 -0
  493. package/queue.d.ts.map +1 -0
  494. package/queue.js +46 -0
  495. package/queue.js.map +1 -0
  496. package/ranges.d.ts +36 -0
  497. package/ranges.d.ts.map +1 -0
  498. package/ranges.js +312 -0
  499. package/ranges.js.map +1 -0
  500. package/rescale.d.ts +24 -0
  501. package/rescale.d.ts.map +1 -0
  502. package/rescale.js +39 -0
  503. package/rescale.js.map +1 -0
  504. package/resume.d.ts +55 -0
  505. package/resume.d.ts.map +1 -0
  506. package/resume.js +4173 -0
  507. package/resume.js.map +1 -0
  508. package/resume.test-util.d.ts +2 -0
  509. package/resume.test-util.d.ts.map +1 -0
  510. package/resume.test-util.js +25 -0
  511. package/resume.test-util.js.map +1 -0
  512. package/skips.d.ts +48 -0
  513. package/skips.d.ts.map +1 -0
  514. package/skips.js +182 -0
  515. package/skips.js.map +1 -0
  516. package/stream.d.ts +75 -37
  517. package/stream.d.ts.map +1 -1
  518. package/stream.js +236 -92
  519. package/stream.js.map +1 -1
  520. package/subscription.test-util.d.ts +2 -0
  521. package/subscription.test-util.d.ts.map +1 -0
  522. package/subscription.test-util.js +49 -0
  523. package/subscription.test-util.js.map +1 -0
  524. package/tail.d.ts +23 -14
  525. package/tail.d.ts.map +1 -1
  526. package/tail.js +224 -97
  527. package/tail.js.map +1 -1
  528. package/time.d.ts +41 -102
  529. package/time.d.ts.map +1 -1
  530. package/time.js +129 -91
  531. package/time.js.map +1 -1
  532. package/timed.d.ts +21 -0
  533. package/timed.d.ts.map +1 -0
  534. package/timed.js +2 -0
  535. package/timed.js.map +1 -0
  536. package/track.d.ts +577 -245
  537. package/track.d.ts.map +1 -1
  538. package/track.js +7306 -771
  539. package/track.js.map +1 -1
  540. package/track_api.d.ts +7 -0
  541. package/track_api.d.ts.map +1 -0
  542. package/track_api.js +7 -0
  543. package/track_api.js.map +1 -0
  544. package/util/abort.d.ts +1 -0
  545. package/util/abort.d.ts.map +1 -1
  546. package/util/abort.js +23 -1
  547. package/util/abort.js.map +1 -1
  548. package/util/announce.d.ts +4 -0
  549. package/util/announce.d.ts.map +1 -0
  550. package/util/announce.js +11 -0
  551. package/util/announce.js.map +1 -0
  552. package/util/bigint.d.ts +3 -0
  553. package/util/bigint.d.ts.map +1 -0
  554. package/util/bigint.js +8 -0
  555. package/util/bigint.js.map +1 -0
  556. package/util/change.d.ts +12 -0
  557. package/util/change.d.ts.map +1 -0
  558. package/util/change.js +18 -0
  559. package/util/change.js.map +1 -0
  560. package/util/deadline.d.ts +2 -0
  561. package/util/deadline.d.ts.map +1 -0
  562. package/util/deadline.js +108 -0
  563. package/util/deadline.js.map +1 -0
  564. package/util/decode_error.d.ts +3 -0
  565. package/util/decode_error.d.ts.map +1 -0
  566. package/util/decode_error.js +11 -0
  567. package/util/decode_error.js.map +1 -0
  568. package/util/demand.d.ts +8 -0
  569. package/util/demand.d.ts.map +1 -0
  570. package/util/demand.js +24 -0
  571. package/util/demand.js.map +1 -0
  572. package/util/given_up.d.ts +2 -0
  573. package/util/given_up.d.ts.map +1 -0
  574. package/util/given_up.js +101 -0
  575. package/util/given_up.js.map +1 -0
  576. package/util/hex.d.ts +6 -0
  577. package/util/hex.d.ts.map +1 -1
  578. package/util/hex.js +19 -4
  579. package/util/hex.js.map +1 -1
  580. package/util/key.d.ts +15 -0
  581. package/util/key.d.ts.map +1 -0
  582. package/util/key.js +38 -0
  583. package/util/key.js.map +1 -0
  584. package/util/limits.d.ts +2 -0
  585. package/util/limits.d.ts.map +1 -0
  586. package/util/limits.js +76 -0
  587. package/util/limits.js.map +1 -0
  588. package/util/observed.d.ts +23 -0
  589. package/util/observed.d.ts.map +1 -0
  590. package/util/observed.js +122 -0
  591. package/util/observed.js.map +1 -0
  592. package/util/sorted.d.ts +2 -0
  593. package/util/sorted.d.ts.map +1 -0
  594. package/util/sorted.js +149 -0
  595. package/util/sorted.js.map +1 -0
  596. package/util/timeout.d.ts +2 -1
  597. package/util/timeout.d.ts.map +1 -1
  598. package/util/timeout.js +13 -9
  599. package/util/timeout.js.map +1 -1
  600. package/util/timer.d.ts +2 -0
  601. package/util/timer.d.ts.map +1 -0
  602. package/util/timer.js +19 -0
  603. package/util/timer.js.map +1 -0
  604. package/util/utf8.d.ts +2 -0
  605. package/util/utf8.d.ts.map +1 -1
  606. package/util/utf8.js +7 -1
  607. package/util/utf8.js.map +1 -1
  608. package/util/varint.d.ts.map +1 -1
  609. package/util/varint.js +8 -1
  610. package/util/varint.js.map +1 -1
  611. package/util/watch.d.ts +8 -0
  612. package/util/watch.d.ts.map +1 -0
  613. package/util/watch.js +38 -0
  614. package/util/watch.js.map +1 -0
  615. package/util/yield.d.ts +2 -0
  616. package/util/yield.d.ts.map +1 -0
  617. package/util/yield.js +31 -0
  618. package/util/yield.js.map +1 -0
  619. package/varint.d.ts +0 -29
  620. package/varint.d.ts.map +1 -1
  621. package/varint.js +7 -28
  622. package/varint.js.map +1 -1
  623. package/varint_api.d.ts +7 -0
  624. package/varint_api.d.ts.map +1 -0
  625. package/varint_api.js +7 -0
  626. package/varint_api.js.map +1 -0
  627. package/version.d.ts +2 -0
  628. package/version.d.ts.map +1 -0
  629. package/version.js +4 -0
  630. package/version.js.map +1 -0
  631. package/window.d.ts +570 -0
  632. package/window.d.ts.map +1 -0
  633. package/window.js +1677 -0
  634. package/window.js.map +1 -0
  635. package/wire.d.ts +145 -30
  636. package/wire.d.ts.map +1 -1
  637. package/wire.js +27 -0
  638. package/wire.js.map +1 -1
  639. package/connection/established.d.ts +0 -53
  640. package/connection/established.d.ts.map +0 -1
  641. package/connection/established.js +0 -2
  642. package/connection/established.js.map +0 -1
  643. package/ietf/adapter.d.ts +0 -75
  644. package/ietf/adapter.d.ts.map +0 -1
  645. package/ietf/adapter.js +0 -699
  646. package/ietf/adapter.js.map +0 -1
  647. package/lite/datagram_stream.d.ts +0 -8
  648. package/lite/datagram_stream.d.ts.map +0 -1
  649. package/lite/datagram_stream.js +0 -43
  650. package/lite/datagram_stream.js.map +0 -1
  651. package/lite/fetch.d.ts +0 -28
  652. package/lite/fetch.d.ts.map +0 -1
  653. package/lite/fetch.js +0 -78
  654. package/lite/fetch.js.map +0 -1
  655. package/util/log.d.ts +0 -5
  656. package/util/log.d.ts.map +0 -1
  657. package/util/log.js +0 -16
  658. package/util/log.js.map +0 -1
  659. package/zod.d.ts +0 -13
  660. package/zod.d.ts.map +0 -1
  661. package/zod.js +0 -18
  662. package/zod.js.map +0 -1
package/origin.d.ts CHANGED
@@ -4,54 +4,110 @@
4
4
  * Publish broadcasts into an origin and hand the origin to one or more connections to
5
5
  * serve them; the broadcasts outlive any single session. Hand the same (or another)
6
6
  * origin to a connection's `consume` option and the peer's announced routes appear
7
- * in the table too: each route covers a path prefix, and a request for a path under
8
- * it resolves through the session that announced it. Mirrors the `origin` module in
9
- * `rs/moq-net`.
7
+ * in the table too, under whatever its readers watch: each route covers a path prefix,
8
+ * and a request for a path under it resolves through the session that announced it.
9
+ * Mirrors the `origin` module in `rs/moq-net`.
10
10
  *
11
11
  * @module
12
12
  */
13
13
  import { type GetPromise, type Getter } from "@moq/signals";
14
- import * as announce from "./announced.ts";
14
+ import type * as Announce from "./announce.ts";
15
+ import type { Credential } from "./auth.ts";
15
16
  import * as broadcast from "./broadcast.ts";
16
- import { Route } from "./hop.ts";
17
+ import { type Cost } from "./hop.ts";
18
+ import * as Identity from "./identity.ts";
17
19
  import * as Path from "./path.ts";
18
- export type { Cost, Hop, Route } from "./hop.ts";
19
- export { isAnonymous } from "./hop.ts";
20
+ export type { Cost, RouteInfo } from "./hop.ts";
20
21
  /**
21
- * A non-owning handle on an origin: publish into it and read it, without its lifecycle.
22
+ * The read side of an origin, borrowed: resolve broadcasts by path and watch what is
23
+ * available, without publishing into it or owning its lifecycle.
22
24
  *
23
- * What a shared connection lends out. {@link Producer} implements it, so code that is
24
- * handed an origin rather than owning one should accept this type: closing the origin
25
- * stays the owner's alone, and a borrower cannot express it.
25
+ * Code that only reads an origin should accept this type. {@link Consumer} implements it
26
+ * and {@link Table} extends it, so `producer.consume()`, a borrowed table, and a structural
27
+ * equivalent all fit.
26
28
  *
27
29
  * @public
28
30
  */
29
- export interface Table {
30
- /** Settles once the origin closes; see {@link Producer.closed}. */
31
+ export interface Reader {
32
+ /** Settles once the origin closes; see {@link Consumer.closed}. */
31
33
  readonly closed: GetPromise<Error | null>;
32
34
  /** Whether every attached session announces into the table; see {@link Consumer.discovery}. */
33
35
  readonly discovery: Getter<boolean | undefined>;
34
- /** Create an unannounced broadcast at `path`; see {@link Producer.createBroadcast}. */
35
- createBroadcast(path: Path.Valid): broadcast.Producer;
36
- /** Resolve `path`, optionally waiting for an announcement; see {@link Consumer.request}. */
36
+ /** Resolve one publisher identity at `path`; see {@link Consumer.request}. */
37
37
  request(path: Path.Valid, options?: RequestOptions): Requesting;
38
- /** The available announcements under `scope`, as a live map; see {@link Consumer.broadcasts}. */
39
- broadcasts(scope?: Path.Pattern, options?: announce.Options): Getter<ReadonlyMap<Path.Valid, Route>>;
40
- /** The available broadcasts under `scope`, as a live stream; see {@link Consumer.announced}. */
41
- announced(scope?: Path.Pattern, options?: announce.Options): announce.Consumer;
42
- /** Advertise a prefix and serve requests under it; see {@link Producer.dynamic}. */
43
- dynamic(prefix: Path.Valid, route?: Route | {
44
- hops?: Route["hops"];
45
- cost?: Route["cost"] | bigint;
46
- }): Dynamic;
38
+ /** Follow `path` across publisher identities; see {@link Consumer.follow}. */
39
+ follow(path: Path.Valid, options?: FollowOptions): Following;
40
+ /** The available broadcasts at or beneath `prefix`, as a live stream; see {@link Consumer.announced}. */
41
+ announced(prefix?: Path.Valid, options?: Announce.Options): Announce.Consumer;
42
+ }
43
+ /**
44
+ * A non-owning handle on an origin: publish into it and read it, without its lifecycle.
45
+ *
46
+ * What a shared connection lends out. {@link Producer} implements it, so code that is
47
+ * handed an origin rather than owning one should accept this type: closing the origin
48
+ * stays the owner's alone, and a borrower cannot express it. A borrower that only reads
49
+ * should accept {@link Reader} instead, so `producer.consume()` fits too.
50
+ *
51
+ * @public
52
+ */
53
+ export interface Table extends Reader {
54
+ /** Create a route at exactly `path`, owning a new broadcast; see {@link Producer.route}. */
55
+ route(path: Path.Valid, options?: RouteOptions): Route;
56
+ /** Claim `prefix`, yielding the requests beneath it; see {@link Producer.claim}. */
57
+ claim(prefix: Path.Valid, options?: RouteOptions): Claim;
47
58
  }
48
- /** Options for resolving a broadcast path. */
59
+ /**
60
+ * How an application advertises a {@link Route} or {@link Claim}: its visibility at creation,
61
+ * its price, its credential, and, rarely, a stable identity.
62
+ *
63
+ * The default announces at once, at cost 0, under the session's scope, serving a fresh random
64
+ * identity minted when the route or claim is created.
65
+ */
66
+ export interface RouteOptions {
67
+ /**
68
+ * Create the route hidden: it exists for nobody until it announces. For a
69
+ * publisher that fills its catalog first, or answers a negotiation, before readers may find it.
70
+ */
71
+ hidden?: boolean;
72
+ /**
73
+ * What pulling content via this route costs: lower wins among routes covering the same
74
+ * prefix and anonymity. A publisher prices content it already produces at zero, and content
75
+ * it would have to start producing on demand higher.
76
+ */
77
+ cost?: Cost;
78
+ /**
79
+ * The credential the advertising request carries, from `auth.add()`. Only a session built
80
+ * on the handle that issued it presents it, as the token on its moq-transport
81
+ * PUBLISH_NAMESPACE; every other session advertises the route under its own scope.
82
+ */
83
+ auth?: Credential;
84
+ /**
85
+ * Serve this stable identity `id` at `epoch`, in place of a freshly minted one.
86
+ *
87
+ * Only for a publisher that continues the identity's key space across restarts,
88
+ * announcing a higher `epoch` each time, such as a counter persisted on disk. Readers
89
+ * stitch every route of one identity together, so a publisher that restarts its group
90
+ * keys under an old identity splices unrelated groups into their tracks. The highest
91
+ * epoch wins over every older one of the identity, cheaper or not. Naming an identity grants
92
+ * nothing: publishing still needs the path's grant.
93
+ */
94
+ identity?: {
95
+ id: Identity.Valid;
96
+ epoch: bigint;
97
+ };
98
+ }
99
+ /** Options for resolving one publisher identity with {@link Consumer.request}. */
49
100
  export interface RequestOptions {
50
- /** Wait for a routed announcement when discovery is supported; otherwise subscribe blindly. */
51
- announced?: boolean;
101
+ /** Refuse a different publisher identity, including an asynchronous answer or a retry. */
102
+ identity?: Identity.Valid;
103
+ }
104
+ /** Options for following a broadcast path with {@link Consumer.follow}. */
105
+ export interface FollowOptions {
106
+ /** Follow only this publisher identity, waiting for it to return across gaps. */
107
+ identity?: Identity.Valid;
52
108
  }
53
109
  /**
54
- * The write side of an origin: create broadcasts by path and advertise them.
110
+ * The write side of an origin: route broadcasts into it by path and advertise them.
55
111
  *
56
112
  * Independent of any connection. A connection given this origin (via its `publish` option)
57
113
  * announces and serves the table's originated advertisements for as long as the session
@@ -59,66 +115,108 @@ export interface RequestOptions {
59
115
  * the origin down. A reconnecting session re-announces the table on each attach, so
60
116
  * advertisements made while offline surface on the next connection.
61
117
  *
62
- * Create, attach {@link dynamic} for tracks served on demand, populate, then
63
- * {@link broadcast.Producer.announce}: an exact-path subscribe before the tracks exist is
64
- * refused, and nobody can see or reach a broadcast until it announces.
118
+ * Create a {@link route} at a path and fill its broadcast; create it hidden and
119
+ * {@link Route.announce} it once its first tracks exist, since nobody can see or reach a hidden
120
+ * route. To publish broadcasts on demand instead, {@link claim} a prefix and answer the
121
+ * requests beneath it.
65
122
  *
66
123
  * @public
67
124
  */
68
125
  export declare class Producer implements Table {
69
126
  #private;
70
127
  constructor();
71
- /** Narrow this handle to patterns beneath root, presenting paths relative to that root. */
72
- scope(root: Path.Valid, patterns: Path.Patterns): Producer;
128
+ /**
129
+ * Narrow this handle to `prefixes` beneath `root`, presenting paths relative to that root.
130
+ * Each prefix covers its whole subtree. The result borrows the origin; see {@link close}.
131
+ */
132
+ scope(root: Path.Valid, prefixes: Path.Prefixes): Producer;
133
+ /**
134
+ * Rank the link a session given this handle as its `consume` origin lands its routes
135
+ * through: higher wins, and every handle starts at the neutral 0. An integer from -128 to 127.
136
+ *
137
+ * Only an identity's newest epoch is eligible, but among eligible routes priority decides
138
+ * before cost, so links to different operators rank by this instead of comparing their
139
+ * prices. On moq-lite-07 a route ranks by the lowest priority of any link on its path. The
140
+ * result borrows the origin, as {@link scope}'s does, and its own derived handles keep its
141
+ * priority.
142
+ */
143
+ withPriority(priority: number): Producer;
73
144
  /**
74
145
  * Settles once the origin closes: `null` on a clean close, or the abort {@link Error}.
75
146
  * Peek it synchronously (`undefined` while open), observe it reactively, or `await` it.
76
147
  */
77
148
  get closed(): GetPromise<Error | null>;
78
149
  /**
79
- * Create a broadcast at `path`, returning its producer.
150
+ * Create a route at exactly `path`, owning a new broadcast to fill.
151
+ *
152
+ * This is how local content enters an origin. Fill the broadcast through
153
+ * {@link Route.broadcast}. The route serves a fresh random identity, minted here and kept
154
+ * for its lifetime, across {@link Route.withdraw} and {@link Route.announce}, since its
155
+ * keys continue: a new route is a new stream that never splices into an old one. A
156
+ * publisher that continues one key space across restarts may name a stable identity
157
+ * instead ({@link RouteOptions.identity}).
80
158
  *
81
- * The broadcast exists for nobody until {@link broadcast.Producer.announce}: announce
82
- * streams skip it and requests for its path find nothing, on this origin exactly as at
83
- * a peer. Announce once its tracks exist; {@link broadcast.Producer.unannounce}
84
- * withdraws it from everyone again.
159
+ * Announced at once unless created {@link RouteOptions.hidden | hidden}. A hidden route
160
+ * exists for nobody until {@link Route.announce}: announce streams skip it and a request
161
+ * for its path finds nothing, on this origin exactly as at a peer. Create it hidden when
162
+ * the tracks a subscriber needs first, such as a catalog, are not there yet. To serve paths
163
+ * on demand without publishing each one, use {@link claim}.
85
164
  *
86
- * Close the producer to drop it. Creating a path again supersedes the previous
87
- * broadcast: the origin drops its handle on the old one, which closes it unless the
88
- * application still holds a consumer clone. An announced local broadcast competes with
89
- * a remote route at the same path on cost, winning ties.
165
+ * Closing the route retracts it and closes its broadcast, and so does closing the
166
+ * broadcast. Creating a path again supersedes the previous route: the origin retracts it
167
+ * and closes its broadcast, and tracks already subscribed keep serving until they end. At
168
+ * the same identity, a local broadcast competes on cost and wins ties.
90
169
  */
91
- createBroadcast(path: Path.Valid): broadcast.Producer;
170
+ route(path: Path.Valid, options?: RouteOptions): Route;
92
171
  /**
93
- * Advertise `prefix` and serve the requests beneath it.
172
+ * Claim `prefix`, yielding the requests beneath it.
94
173
  *
95
- * A route is always a prefix: it claims `prefix` and every path beneath it (the
96
- * empty prefix claims every path). A service that only serves some of them
97
- * advertises the covering prefix and rejects the rest as they are requested;
98
- * consumers narrow with a {@link Path.Pattern} locally. The advertisement is
99
- * visible to {@link Consumer.announced} and forwarded by sessions for as long as
100
- * the returned {@link Dynamic} lives. A consumer resolving a path under it that
101
- * no announced local broadcast wins is handed to the handle as a {@link Request}.
102
- */
103
- dynamic(prefix: Path.Valid, route?: Route | {
104
- hops?: Route["hops"];
105
- cost?: Route["cost"] | bigint;
106
- }): Dynamic;
174
+ * A route is always a prefix on the wire: a claim covers `prefix` and every path beneath it
175
+ * (the empty prefix claims every path). A service that only serves some of them advertises
176
+ * the covering prefix and rejects the rest as they are requested; consumers filter
177
+ * announced paths locally. The claim is priced, credentialed and shown like an exact
178
+ * route, and forwarded by sessions while it is visible.
179
+ *
180
+ * A consumer resolving a path under it that no announced local broadcast wins is handed to
181
+ * {@link Claim.requested} as a {@link Request}: answer it by serving a broadcast already held
182
+ * ({@link Request.serve}), under this claim's identity, or by creating the path's own exact
183
+ * route ({@link Request.route}), a job. The claim keeps its identity, minted unless
184
+ * {@link RouteOptions.identity} names one, for as long as it lives: each job's exact route
185
+ * carries its own, so a job that ends and restarts is a new stream at its path without
186
+ * touching the claim or its other paths. A publisher that knows its broadcasts creates each
187
+ * one's exact {@link route} instead, so subscribers can enumerate them.
188
+ */
189
+ claim(prefix: Path.Valid, options?: RouteOptions): Claim;
107
190
  /** A read handle for this origin, the side a connection's `publish` option borrows. */
108
191
  consume(): Consumer;
109
192
  /** Whether every attached session announces into the table; see {@link Consumer.discovery}. */
110
193
  get discovery(): Getter<boolean | undefined>;
111
- /** Resolve `path`, optionally waiting for an announcement; see {@link Consumer.request}. */
194
+ /** Resolve one publisher identity at `path`; see {@link Consumer.request}. */
112
195
  request(path: Path.Valid, options?: RequestOptions): Requesting;
113
- /** The available announcements under `scope`, as a live map; see {@link Consumer.broadcasts}. */
114
- broadcasts(scope?: Path.Pattern, options?: announce.Options): Getter<ReadonlyMap<Path.Valid, Route>>;
115
- /** The available broadcasts under `scope`, as a live stream; see {@link Consumer.announced}. */
116
- announced(scope?: Path.Pattern, options?: announce.Options): announce.Consumer;
117
- /** Close the origin, every broadcast it still routes, and its announcement streams. Idempotent. */
196
+ /** Follow `path` across publisher identities; see {@link Consumer.follow}. */
197
+ follow(path: Path.Valid, options?: FollowOptions): Following;
198
+ /** The available broadcasts at or beneath `prefix`, as a live stream; see {@link Consumer.announced}. */
199
+ announced(prefix?: Path.Valid, options?: Announce.Options): Announce.Consumer;
200
+ /**
201
+ * Close the origin, every broadcast it still routes, and its announcement streams. Idempotent.
202
+ *
203
+ * A handle from {@link scope} borrows the origin: closing it
204
+ * withdraws only the broadcasts, routes, and sessions (with their answers) registered
205
+ * through it and refuses new ones, ignoring `abort`. Only the handle made with `new Producer()` closes the origin.
206
+ */
118
207
  close(abort?: Error): void;
119
208
  }
120
209
  /**
121
- * An open request for a path nothing announced; see {@link Consumer.request}.
210
+ * An owned request for one publisher identity at a broadcast path; see {@link Consumer.request}.
211
+ *
212
+ * Await {@link broadcast} for the broadcast, as Rust awaits `request(path)`; read {@link active} and
213
+ * {@link closed} to follow it reactively instead. The handle is not itself awaitable, so an
214
+ * `await` or an async return never takes the broadcast out from under the request that owns it.
215
+ *
216
+ * ```ts
217
+ * const request = origin.request(Path.from("room"));
218
+ * const broadcast = await request.broadcast();
219
+ * ```
122
220
  *
123
221
  * @public
124
222
  */
@@ -127,38 +225,52 @@ export declare class Requesting {
127
225
  /** The requested path. */
128
226
  readonly path: Path.Valid;
129
227
  /**
130
- * The resolved broadcast, or undefined while nothing provides the path.
131
- *
132
- * The table's route when it has one: a local publish (no round trip) or an announced
133
- * broadcast, swapping when a republish takes the path. Otherwise a session's blind
134
- * answer, which is assumed present rather than known live: a missing broadcast
135
- * surfaces as a reset on the first track subscription, not here. Drops back to
136
- * undefined when the providing route dies and resolves again when another appears.
137
- *
138
- * Yours for as long as the request is open: it is a handle of this request's own, so
139
- * closing it ends your view of the path rather than the route everyone else reads.
140
- * {@link close} releases whatever is current.
228
+ * The accepted broadcast, or undefined while the request is pending.
229
+ * Another route of the same identity taking over keeps
230
+ * this handle: its tracks resume on that route from the first group each reader lacks.
231
+ * Closing this handle affects only this request.
141
232
  */
142
233
  readonly active: Getter<broadcast.Consumer | undefined>;
143
234
  /**
144
- * Whether nothing can serve this path, as opposed to not having served it yet.
145
- *
146
- * True when the origin routes nothing here and nothing is prepared to answer: no session
147
- * attached and no connection reconnecting toward one. False whenever {@link active} is
148
- * set, and false while a connection is still coming up, so the ordinary page-load window
149
- * before the first handshake reads as pending rather than as a missing broadcast. Waiting
150
- * on this is futile by definition; wait for an announcement instead, via the origin's
151
- * `announced`. True once the request is refused.
235
+ * Settles on refusal, origin shutdown, explicit close, or the accepted identity ending.
236
+ * Fails `Unroutable` while pending once discovery syncs without a route for it.
237
+ */
238
+ readonly closed: GetPromise<Error | null>;
239
+ private constructor();
240
+ /**
241
+ * Resolves with the broadcast once {@link active} holds one. Rejects with the error
242
+ * {@link closed} carries if the request ends first, such as `Unroutable`, or with a
243
+ * `StreamCode.Cancel` error if it closed cleanly: this handle or its origin was closed. The
244
+ * answer is fixed by the first call, and every later call gets the same one. The request
245
+ * still owns the broadcast, so close the request, not only the broadcast, when done.
246
+ */
247
+ broadcast(): Promise<broadcast.Consumer>;
248
+ /** Withdraw the request. The path stays routed for any other open request. Idempotent. */
249
+ close(): void;
250
+ }
251
+ /**
252
+ * An owned follower of the publisher identities announced at a broadcast path; see {@link Consumer.follow}.
253
+ *
254
+ * @public
255
+ */
256
+ export declare class Following {
257
+ #private;
258
+ /** The followed path. */
259
+ readonly path: Path.Valid;
260
+ /**
261
+ * The current announced broadcast, or undefined between publisher identities.
262
+ * Moves to each new identity, or waits for the pinned identity when one was requested.
263
+ * Another route of the same identity keeps this handle and resumes its tracks.
264
+ * Closing this handle affects only this follower.
152
265
  */
153
- readonly unroutable: Getter<boolean>;
266
+ readonly active: Getter<broadcast.Consumer | undefined>;
154
267
  /**
155
- * Settles with the error a route's handler refused the path with, or `null` once you
156
- * {@link close} the request. A refusal is final: no other route is asked, and a fresh
157
- * request is needed to try again.
268
+ * Settles on refusal, origin shutdown, or explicit close.
269
+ * Waits through gaps in announcements for a later start, even when pinned to an identity.
158
270
  */
159
271
  readonly closed: GetPromise<Error | null>;
160
272
  private constructor();
161
- /** Withdraw the request. The path stays routed for any other open request. Idempotent. */
273
+ /** Withdraw the follower. The path stays routed for any other open request. Idempotent. */
162
274
  close(): void;
163
275
  }
164
276
  /**
@@ -170,7 +282,7 @@ export declare class Requesting {
170
282
  *
171
283
  * @public
172
284
  */
173
- export declare class Consumer {
285
+ export declare class Consumer implements Reader {
174
286
  #private;
175
287
  private constructor();
176
288
  /** Settles once the origin closes; see {@link Producer.closed}. */
@@ -186,75 +298,185 @@ export declare class Consumer {
186
298
  */
187
299
  get discovery(): Getter<boolean | undefined>;
188
300
  /**
189
- * Resolve `path`, optionally waiting for an announcement.
301
+ * Resolve one publisher identity serving `path`, pinned to `identity` when given.
190
302
  *
191
- * The one way to consume by path. {@link Requesting.active} follows whatever the table
192
- * routes (an announced local publish, or any feeding session's announcement, swapping
193
- * on a republish or a retraction); when nothing does, the request stands and whichever
194
- * attached session answers first provides a blind subscription instead, re-answered
195
- * across reconnects.
196
- * With `announced: true`, an unrouted request waits while discovery is supported and
197
- * falls back to that blind behavior only when discovery is unavailable. Close the request
198
- * when done. On a closed origin it never resolves.
303
+ * The request owns discovery of its path until closed and retries route churn while
304
+ * pending. It fails `Unroutable` once at least one session is attached and every
305
+ * session's discovery has synced without a route for it, and can use a session without
306
+ * discovery instead. With no session attached, such as between reconnects, it waits. Once resolved it keeps
307
+ * that identity, ending when the identity stops serving. Use {@link follow} to move on
308
+ * to the next one. Await the handle for the broadcast, or the error ending it first.
199
309
  *
200
- * With several sessions on one origin the first to answer wins, and it may be one that
201
- * does not carry the path. Nothing corrects that: a missing broadcast surfaces as a reset
202
- * on the first track and deliberately leaves the handle open, since the wire cannot tell
203
- * "not here" from "not yet" and a blind handle is expected to survive until a publisher
204
- * arrives. It matters only on an origin mixing sessions that announce with sessions that
205
- * cannot, where a path only the silent session carries may sit behind another session's
206
- * answer. Prefer {@link unroutable} and announcements over blind requests when the origin
207
- * feeds from more than one connection.
310
+ * A job's exact route ({@link Request.route}) carries its own identity. On this origin, a
311
+ * request waiting on the job's claim resolves onto the job once its route announces. Through
312
+ * a peer's claim, the request resolves the claim's broadcast instead, which is reset once the
313
+ * job's route announces: read an on-demand job across a session with {@link follow}.
208
314
  */
209
315
  request(path: Path.Valid, options?: RequestOptions): Requesting;
210
316
  /**
211
- * The announced routes matching `scope`, as a live map from covered prefix to route.
212
- * Local broadcasts appear once announced; received and dynamic routes retain their
213
- * advertised prefixes. Reads are synchronous, and the getter needs no teardown.
214
- * Hidden routes are left out unless `options.hidden` opts in (see {@link announce.Options}).
215
- * Unscoped readers share one snapshot; each distinct scope filters the table on changes.
317
+ * Follow `path` across publisher identities, pinned to `identity` when given.
318
+ *
319
+ * `active` moves to each identity announced at the path, clears between them, and never
320
+ * closes on a gap: a pinned follower waits for its identity to return. Owns discovery of
321
+ * its path until closed. Requires discovery: a session without it never serves a follower.
322
+ * A selected handler's refusal or the origin closing ends it.
216
323
  */
217
- broadcasts(scope?: Path.Pattern, options?: announce.Options): Getter<ReadonlyMap<Path.Valid, Route>>;
324
+ follow(path: Path.Valid, options?: FollowOptions): Following;
218
325
  /**
219
- * The announced routes matching `scope`, as a live stream: every currently advertised
220
- * route arrives first as active, then additions and retractions as they happen.
221
- * Any pattern is accepted. A local broadcast appears once it announces, exactly as a
222
- * peer sees it. A dynamic or received route announces the prefix it covers when its
223
- * subtree overlaps the scope. The stream ends when the origin closes or the consumer is
224
- * closed. Hidden routes are left out unless `options.hidden` opts in (see {@link announce.Options}).
326
+ * The paths announced at or beneath `prefix`, relative to the root, within this handle's
327
+ * scope, each reported as it becomes present or absent: every currently advertised one
328
+ * arrives first as `present`. Another identity taking a path over keeps it present;
329
+ * {@link follow} it to see the broadcast change. A local broadcast appears once it announces,
330
+ * exactly as a peer sees it. Only routes at or beneath the prefix are listed, unless
331
+ * `options.covering` also asks for every route whose subtree overlaps it, a broadcast
332
+ * included. The stream ends when the origin closes or the consumer is closed. Hidden routes
333
+ * are left out unless `options.hidden` opts in (see {@link Announce.Options}). While open, it
334
+ * watches the prefix: a `consume` session asks its peer for announcements there. Throws
335
+ * {@link Path.InvalidPrefix} for a prefix holding a `*`.
225
336
  */
226
- announced(scope?: Path.Pattern, options?: announce.Options): announce.Consumer;
337
+ announced(prefix?: Path.Valid, options?: Announce.Options): Announce.Consumer;
227
338
  }
228
339
  /**
229
- * A served route from {@link Producer.dynamic}: advertises a prefix and answers the
230
- * requests beneath it.
340
+ * An exact route in an origin, owning its broadcast.
341
+ *
342
+ * Create one with {@link Producer.route}, or a job's with {@link Request.route}.
231
343
  *
232
- * Drop it (or {@link close}) to retract the route and reject anything still waiting
233
- * with {@link StreamCode.NoCapacity}. {@link update} re-prices it in place.
344
+ * ```ts
345
+ * // Fill the catalog before readers can find it.
346
+ * const route = origin.route(Path.from("live/alice"), { hidden: true });
347
+ * route.broadcast.createTrack("catalog.json");
348
+ * route.announce(); // visible now, same identity
349
+ * route.setCost(5n); // re-prices in place
350
+ * route.withdraw(); // hidden; announce() again continues the same stream
351
+ * ```
352
+ *
353
+ * {@link close} retracts it and closes its broadcast, and so does closing the broadcast.
234
354
  *
235
355
  * @public
236
356
  */
237
- export declare class Dynamic {
357
+ export declare class Route {
238
358
  #private;
239
- /** The prefix this handle advertises. */
240
- readonly prefix: Path.Valid;
359
+ /** The broadcast this route owns, to fill with tracks. */
360
+ readonly broadcast: broadcast.Producer;
241
361
  private constructor();
242
- /** Re-price the route in place. The prefix is fixed at announce time. */
243
- update(route: Route | {
244
- hops?: Route["hops"];
245
- cost?: Route["cost"] | bigint;
246
- }): void;
247
- /** Retract the route and reject anything still waiting. Idempotent. */
362
+ /**
363
+ * The stream this route serves, minted when it was created unless {@link RouteOptions.identity}
364
+ * named one, and fixed for the route's life.
365
+ */
366
+ get identity(): Identity.Valid;
367
+ /**
368
+ * Make the route visible, or keep it so. Idempotent.
369
+ *
370
+ * Visible to local consumers before it returns. A job's route ({@link Request.route}) also
371
+ * releases the requesters waiting on its path through the claim, which resolve it afresh: onto
372
+ * this route, under its own identity, unless pinned to the claim's. Throws once the route or its
373
+ * broadcast closed, and, announcing nothing, with {@link StreamCode | StreamCode.Unroutable} when
374
+ * a job's request was released or its claim retracted meanwhile: that route can never announce.
375
+ * A job's route priced above its visible claim at the claim's own prefix (see
376
+ * {@link Request.route}) throws the same way, and its first announce can never be retried.
377
+ */
378
+ announce(): void;
379
+ /**
380
+ * Hide the route from everyone, local and remote alike, keeping its broadcast and identity:
381
+ * {@link announce} brings the same stream back. Requests for the path fail with
382
+ * {@link StreamCode | StreamCode.Unroutable} meanwhile, while tracks already in flight carry
383
+ * on to their own end. Idempotent.
384
+ */
385
+ withdraw(): void;
386
+ /** Whether the route is visible. */
387
+ get announced(): boolean;
388
+ /**
389
+ * Re-price the route: lower wins among routes covering the same prefix and anonymity. A
390
+ * visible route changes in place, as an update to its readers; a hidden one announces at
391
+ * this price. Throws once the route or its broadcast closed, and with
392
+ * {@link StreamCode | StreamCode.Unroutable}, keeping the old price, when a job's route would
393
+ * cost more than its visible claim at the claim's own prefix (see {@link Request.route}).
394
+ */
395
+ setCost(cost: Cost): void;
396
+ /**
397
+ * Swap the credential the advertising request carries; see {@link RouteOptions.auth}.
398
+ * Undefined advertises under the session's scope. Throws once the route or its broadcast closed.
399
+ */
400
+ setAuth(auth?: Credential): void;
401
+ /** Retract the route for good, closing its broadcast and refusing a job's waiting requesters. Idempotent. */
248
402
  close(): void;
249
- /** Requests under this prefix, as they arrive, each to {@link Request.accept} or reject. */
403
+ /** Calls {@link close}, so `using` retracts the route. */
404
+ [Symbol.dispose](): void;
405
+ }
406
+ /**
407
+ * A prefix route in an origin: a claim that every path beneath a prefix can be served,
408
+ * answering each request as it arrives.
409
+ *
410
+ * Create one with {@link Producer.claim}. Requests arrive on {@link requested}; answer each by
411
+ * serving a broadcast already held or by creating the path's own {@link Route}.
412
+ *
413
+ * ```ts
414
+ * const claim = origin.claim(Path.from("room"));
415
+ * for await (const request of claim.requested()) {
416
+ * const route = request.route({ hidden: true });
417
+ * route.broadcast.createTrack("catalog.json");
418
+ * route.announce(); // the requesters read it
419
+ * }
420
+ * ```
421
+ *
422
+ * {@link close} retracts it and rejects the requests still waiting.
423
+ *
424
+ * @public
425
+ */
426
+ export declare class Claim {
427
+ #private;
428
+ private constructor();
429
+ /**
430
+ * The stream this claim serves, minted when it was created unless {@link RouteOptions.identity}
431
+ * named one. A session's claim follows its peer's.
432
+ */
433
+ get identity(): Identity.Valid;
434
+ /**
435
+ * Make the claim visible, or keep it so. Idempotent. Visible to local consumers before it
436
+ * returns. Throws once the claim or the origin closed, and with
437
+ * {@link StreamCode | StreamCode.Unroutable}, staying hidden, when it would cost less than a
438
+ * visible job's route at its own prefix (see {@link Request.route}).
439
+ */
440
+ announce(): void;
441
+ /**
442
+ * Hide the claim from everyone, local and remote alike, keeping its identity: {@link announce}
443
+ * brings it back. Requests beneath it fail with {@link StreamCode | StreamCode.Unroutable}
444
+ * meanwhile. Idempotent.
445
+ */
446
+ withdraw(): void;
447
+ /** Whether the claim is visible. */
448
+ get announced(): boolean;
449
+ /**
450
+ * Re-price the claim: lower wins among routes covering the same prefix and anonymity. A
451
+ * visible claim changes in place, as an update to its readers; a hidden one announces at
452
+ * this price. Throws once the claim or the origin closed, and with
453
+ * {@link StreamCode | StreamCode.Unroutable}, keeping the old price, when the claim would cost
454
+ * less than a visible job's route at its own prefix (see {@link Request.route}).
455
+ */
456
+ setCost(cost: Cost): void;
457
+ /**
458
+ * Swap the credential the advertising request carries; see {@link RouteOptions.auth}.
459
+ * Undefined advertises under the session's scope. Throws once the claim or the origin closed.
460
+ */
461
+ setAuth(auth?: Credential): void;
462
+ /**
463
+ * The requests beneath this claim, as they arrive, each to answer with {@link Request.serve},
464
+ * {@link Request.route} or {@link Request.reject}. Advancing the iterator or closing it without
465
+ * answering rejects the request. Ends once the claim is closed or the origin closes.
466
+ */
250
467
  requested(): AsyncIterableIterator<Request>;
468
+ /** Retract the claim for good, rejecting the requests still waiting. Idempotent. */
469
+ close(): void;
470
+ /** Calls {@link close}, so `using` retracts the claim. */
471
+ [Symbol.dispose](): void;
251
472
  }
252
473
  /**
253
474
  * A pending request for a broadcast to be served on demand.
254
475
  *
255
- * Yielded by {@link Dynamic.requested}. {@link accept} resolves it with a live
256
- * broadcast; {@link reject} resolves it with an error. Advancing the iterator or
257
- * closing it without either rejects the request.
476
+ * Yielded by {@link Claim.requested}. Answer it one of three ways: {@link serve} a broadcast
477
+ * already held, under the claim's identity; create the path's own exact route with
478
+ * {@link route}, a job of its own identity; or {@link reject} it with an error. Advancing the iterator or closing it
479
+ * without answering rejects the request.
258
480
  *
259
481
  * @public
260
482
  */
@@ -264,12 +486,42 @@ export declare class Request {
264
486
  readonly path: Path.Valid;
265
487
  private constructor();
266
488
  /**
267
- * Accept the request, resolving every awaiting requester with `broadcast`.
489
+ * Resolves once no requester waits on the answer any more: each left, or the origin moved
490
+ * them to another route. Final: a later requester gets a new request.
491
+ */
492
+ unwanted(): Promise<void>;
493
+ /**
494
+ * Answer with the path's own exact route, owning a new broadcast.
495
+ *
496
+ * The route mints its own identity unless `options` names one, as {@link Producer.route}
497
+ * does: the job is its own stream, so a job that ends and restarts beneath the same claim is a
498
+ * new stream at its path, and the claim keeps its identity and keeps answering later
499
+ * requests. A reader that resolved the path through the claim moves to the job's identity as a
500
+ * new stream: a follower is handed the job's broadcast, and a request pinned to the claim's
501
+ * identity is refused. Created visible, the route announces now and releases the requesters
502
+ * waiting on its path, which resolve it afresh. Created {@link RouteOptions.hidden | hidden},
503
+ * they wait until {@link Route.announce}, so the job can fill its catalog first; closing the
504
+ * route or its broadcast before then refuses them.
505
+ *
506
+ * At the claim's own prefix, the job may cost no more than the claim: both rank in one tier,
507
+ * where cost comes first, so a pricier job would lose its path to the claim, which would ask for
508
+ * another job. Neither may be re-priced past the other while both are visible.
509
+ *
510
+ * Throws {@link StreamCode | StreamCode.Unroutable} on a request a session forwarded, which can
511
+ * only {@link serve} its peer's broadcast, when `options` price the job above its claim at the
512
+ * claim's own prefix, refusing the requesters, and, announcing nothing, once the request was
513
+ * released or its claim retracted. Otherwise it throws as {@link Producer.route} does.
514
+ */
515
+ route(options?: RouteOptions): Route;
516
+ /**
517
+ * Serve a held broadcast under this claim without announcing an exact route.
268
518
  *
269
- * The caller keeps producing into `broadcast`; repeat requests for the path share
270
- * it for as long as it stays live.
519
+ * Takes ownership of a consumer; a producer stays the caller's. Every answer at this
520
+ * path belongs to the claim's identity and must continue the same keys and
521
+ * bytes. Start a new claim for different content, or use {@link route} for a job
522
+ * that can restart independently, whose route carries its own identity.
271
523
  */
272
- accept(source: broadcast.Producer | broadcast.Consumer): void;
524
+ serve(source: broadcast.Producer | broadcast.Consumer): void;
273
525
  /** Reject the request, resolving every awaiting requester with `err`. */
274
526
  reject(err: Error): void;
275
527
  }