@moqtap/codec 0.10.0 → 0.12.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 (262) hide show
  1. package/CHANGELOG.md +175 -0
  2. package/README.md +3 -2
  3. package/dist/auth-redaction-B9JJOlIY.d.cts +100 -0
  4. package/dist/auth-redaction-B9JJOlIY.d.ts +100 -0
  5. package/dist/{chunk-RYKQXBG6.cjs → chunk-27K5BUAG.cjs} +481 -517
  6. package/dist/{chunk-WCPENYNE.js → chunk-3RNQMGKA.js} +359 -390
  7. package/dist/{chunk-TSUZ6GJV.js → chunk-5AWIXOLB.js} +438 -469
  8. package/dist/{chunk-4XLYCT5Q.cjs → chunk-5IMHJIAZ.cjs} +52 -2
  9. package/dist/{chunk-KTNERCTZ.cjs → chunk-5JGZCKJO.cjs} +488 -518
  10. package/dist/{chunk-WCTMPDUX.cjs → chunk-73K4OSAN.cjs} +401 -432
  11. package/dist/{chunk-N2V7Z37J.js → chunk-7VQKRGRD.js} +19 -3
  12. package/dist/{chunk-BIBMDTU5.cjs → chunk-A3UCQOIB.cjs} +486 -517
  13. package/dist/{chunk-K2B3OVFK.js → chunk-A7PDMVXM.js} +24 -3
  14. package/dist/{chunk-VZHL2U2N.cjs → chunk-A7VQO6YC.cjs} +54 -38
  15. package/dist/{chunk-AQ445VV7.cjs → chunk-ACQHZLRZ.cjs} +66 -46
  16. package/dist/{chunk-L5DRACXS.js → chunk-BBICOMW6.js} +25 -3
  17. package/dist/{chunk-T4VWPKDG.cjs → chunk-BNIUVOCJ.cjs} +529 -599
  18. package/dist/{chunk-UKKDOOUO.cjs → chunk-CNC6ANS4.cjs} +58 -37
  19. package/dist/{chunk-OZRK73NQ.js → chunk-FDLQSWHK.js} +433 -469
  20. package/dist/{chunk-IJAF6PAY.js → chunk-FFNOE4UR.js} +19 -3
  21. package/dist/{chunk-CZNW3R5E.cjs → chunk-GMENT63T.cjs} +54 -38
  22. package/dist/{chunk-XCRCAUGI.cjs → chunk-HM7BLRVP.cjs} +291 -297
  23. package/dist/{chunk-XHAP2YST.js → chunk-HZONHFNO.js} +19 -3
  24. package/dist/{chunk-SDJTSMOW.cjs → chunk-ILYABWDK.cjs} +60 -38
  25. package/dist/{chunk-IDV2JYJ6.cjs → chunk-KRSFTZVO.cjs} +56 -40
  26. package/dist/{chunk-RIIA4ALQ.cjs → chunk-KSPH6KMH.cjs} +54 -38
  27. package/dist/{chunk-OUNN4IQB.cjs → chunk-KTY4LAUV.cjs} +482 -497
  28. package/dist/chunk-OBATJBNL.cjs +868 -0
  29. package/dist/{chunk-RZTLQAKF.js → chunk-OJNLJT5D.js} +0 -1
  30. package/dist/{chunk-FT3HDNIB.js → chunk-PJK2ZS3I.js} +467 -537
  31. package/dist/{chunk-G53WYUXL.js → chunk-PSMZKHOC.js} +441 -456
  32. package/dist/{chunk-7RE6KSIY.cjs → chunk-Q5JQGHWY.cjs} +0 -1
  33. package/dist/{chunk-BX2N7TZM.js → chunk-SQTUQY5E.js} +31 -11
  34. package/dist/chunk-T2TCLZZV.js +2304 -0
  35. package/dist/chunk-WB65UG7G.cjs +2304 -0
  36. package/dist/{chunk-CF5DDD3Q.js → chunk-WCRLAKDW.js} +239 -245
  37. package/dist/{chunk-KYVTM5VI.js → chunk-WL2YUEXH.js} +19 -3
  38. package/dist/chunk-XPCBPACE.js +868 -0
  39. package/dist/{chunk-KGDVC4O6.js → chunk-YCNIVZS7.js} +439 -469
  40. package/dist/{chunk-KLPWJU6W.js → chunk-YRZQVNZO.js} +50 -0
  41. package/dist/{codec-DOmAmFkI.d.ts → codec-B-oUU-cp.d.ts} +21 -2
  42. package/dist/{codec-DNmiG2e0.d.cts → codec-B3RpCI9k.d.cts} +21 -2
  43. package/dist/codec-B5pcOS3m.d.cts +38 -0
  44. package/dist/{codec-BNy5syCU.d.ts → codec-BLjxwK2f.d.ts} +21 -2
  45. package/dist/{codec-alVA27Uc.d.ts → codec-BV3CL_3m.d.ts} +21 -2
  46. package/dist/{codec-Czejcmxr.d.cts → codec-BYCDWgED.d.ts} +22 -3
  47. package/dist/{codec-DaXjRrOV.d.ts → codec-Bwqq7ZQT.d.ts} +22 -3
  48. package/dist/{codec-CFWu5KVT.d.cts → codec-BzWxOFby.d.cts} +22 -3
  49. package/dist/codec-C-nJhNNl.d.ts +38 -0
  50. package/dist/{codec-EvybrBuY.d.cts → codec-C11VEPbQ.d.cts} +21 -2
  51. package/dist/codec-C9U0Vzy9.d.cts +68 -0
  52. package/dist/{codec-Cm3D261p.d.ts → codec-CCx22jnd.d.ts} +21 -2
  53. package/dist/{codec-CwZ6OCPP.d.ts → codec-CP3zkfTv.d.ts} +22 -3
  54. package/dist/{codec-BxQTybUX.d.cts → codec-CRmOLDpt.d.ts} +22 -3
  55. package/dist/{codec-DzkdW4kO.d.cts → codec-CUu56DDU.d.cts} +21 -2
  56. package/dist/codec-Cb8mUre3.d.ts +68 -0
  57. package/dist/{codec-f7vxeVIS.d.cts → codec-CemqAQdR.d.cts} +22 -3
  58. package/dist/{codec-gl4_QEva.d.ts → codec-CxMvsVMS.d.ts} +21 -2
  59. package/dist/{codec-Bd60SGKH.d.cts → codec-DIgMVTi4.d.cts} +21 -2
  60. package/dist/{codec--CVeqGQv.d.ts → codec-DYzozF68.d.ts} +21 -2
  61. package/dist/{codec-CWnf8mn_.d.cts → codec-D_O9zxax.d.ts} +22 -3
  62. package/dist/{codec-08ZOr5wI.d.ts → codec-Ddc-QxV6.d.cts} +22 -3
  63. package/dist/{codec-CBdOIfMY.d.ts → codec-DoojMl2z.d.cts} +22 -3
  64. package/dist/{codec-BrTi4K7r.d.cts → codec-DqdjiOQF.d.ts} +22 -3
  65. package/dist/{codec-CXCjya_G.d.cts → codec-Dstemwrq.d.cts} +21 -2
  66. package/dist/{codec-Dl_QIXMz.d.ts → codec-Dt6nuejp.d.ts} +21 -2
  67. package/dist/{codec-Bux_Q40X.d.ts → codec-DuYhd8fP.d.cts} +22 -3
  68. package/dist/{codec-Cfo_z5ET.d.cts → codec-DwNOFgPU.d.cts} +21 -2
  69. package/dist/{codec-guzqtfMk.d.cts → codec-l01BpNhF.d.cts} +21 -2
  70. package/dist/{codec-C3mdsGx3.d.ts → codec-psN2vB6I.d.cts} +22 -3
  71. package/dist/draft07-session.d.cts +3 -3
  72. package/dist/draft07-session.d.ts +3 -3
  73. package/dist/draft07.cjs +48 -4
  74. package/dist/draft07.d.cts +44 -4
  75. package/dist/draft07.d.ts +44 -4
  76. package/dist/draft07.js +49 -5
  77. package/dist/draft08-session.d.cts +3 -3
  78. package/dist/draft08-session.d.ts +3 -3
  79. package/dist/draft08.cjs +76 -3
  80. package/dist/draft08.d.cts +73 -5
  81. package/dist/draft08.d.ts +73 -5
  82. package/dist/draft08.js +77 -4
  83. package/dist/draft09-session.d.cts +3 -3
  84. package/dist/draft09-session.d.ts +3 -3
  85. package/dist/draft09.cjs +76 -3
  86. package/dist/draft09.d.cts +73 -5
  87. package/dist/draft09.d.ts +73 -5
  88. package/dist/draft09.js +77 -4
  89. package/dist/draft10-session.d.cts +3 -3
  90. package/dist/draft10-session.d.ts +3 -3
  91. package/dist/draft10.cjs +76 -3
  92. package/dist/draft10.d.cts +73 -5
  93. package/dist/draft10.d.ts +73 -5
  94. package/dist/draft10.js +77 -4
  95. package/dist/draft11-session.d.cts +3 -3
  96. package/dist/draft11-session.d.ts +3 -3
  97. package/dist/draft11.cjs +104 -3
  98. package/dist/draft11.d.cts +101 -5
  99. package/dist/draft11.d.ts +101 -5
  100. package/dist/draft11.js +105 -4
  101. package/dist/draft12-session.d.cts +3 -3
  102. package/dist/draft12-session.d.ts +3 -3
  103. package/dist/draft12.cjs +113 -3
  104. package/dist/draft12.d.cts +110 -5
  105. package/dist/draft12.d.ts +110 -5
  106. package/dist/draft12.js +114 -4
  107. package/dist/draft13-session.d.cts +3 -3
  108. package/dist/draft13-session.d.ts +3 -3
  109. package/dist/draft13.cjs +105 -3
  110. package/dist/draft13.d.cts +102 -5
  111. package/dist/draft13.d.ts +102 -5
  112. package/dist/draft13.js +106 -4
  113. package/dist/draft14-session.d.cts +3 -3
  114. package/dist/draft14-session.d.ts +3 -3
  115. package/dist/draft14.cjs +107 -3
  116. package/dist/draft14.d.cts +104 -31
  117. package/dist/draft14.d.ts +104 -31
  118. package/dist/draft14.js +108 -4
  119. package/dist/draft15-session.d.cts +4 -4
  120. package/dist/draft15-session.d.ts +4 -4
  121. package/dist/draft15.cjs +69 -3
  122. package/dist/draft15.d.cts +68 -25
  123. package/dist/draft15.d.ts +68 -25
  124. package/dist/draft15.js +70 -4
  125. package/dist/draft16-session.cjs +2 -2
  126. package/dist/draft16-session.d.cts +4 -4
  127. package/dist/draft16-session.d.ts +4 -4
  128. package/dist/draft16-session.js +1 -1
  129. package/dist/draft16.cjs +76 -8
  130. package/dist/draft16.d.cts +70 -16
  131. package/dist/draft16.d.ts +70 -16
  132. package/dist/draft16.js +73 -5
  133. package/dist/draft17-session.d.cts +4 -4
  134. package/dist/draft17-session.d.ts +4 -4
  135. package/dist/draft17.cjs +77 -3
  136. package/dist/draft17.d.cts +75 -6
  137. package/dist/draft17.d.ts +75 -6
  138. package/dist/draft17.js +78 -4
  139. package/dist/draft18-session.d.cts +4 -4
  140. package/dist/draft18-session.d.ts +4 -4
  141. package/dist/draft18.cjs +8 -3
  142. package/dist/draft18.d.cts +6 -5
  143. package/dist/draft18.d.ts +6 -5
  144. package/dist/draft18.js +9 -4
  145. package/dist/draft19-session.d.cts +4 -4
  146. package/dist/draft19-session.d.ts +4 -4
  147. package/dist/draft19.cjs +11 -4
  148. package/dist/draft19.d.cts +6 -5
  149. package/dist/draft19.d.ts +6 -5
  150. package/dist/draft19.js +12 -5
  151. package/dist/draft20-session.d.cts +4 -4
  152. package/dist/draft20-session.d.ts +4 -4
  153. package/dist/draft20.cjs +8 -3
  154. package/dist/draft20.d.cts +6 -5
  155. package/dist/draft20.d.ts +6 -5
  156. package/dist/draft20.js +9 -4
  157. package/dist/draft21-session.cjs +8 -0
  158. package/dist/draft21-session.d.cts +195 -0
  159. package/dist/draft21-session.d.ts +195 -0
  160. package/dist/draft21-session.js +8 -0
  161. package/dist/draft21.cjs +222 -0
  162. package/dist/draft21.d.cts +176 -0
  163. package/dist/draft21.d.ts +176 -0
  164. package/dist/draft21.js +222 -0
  165. package/dist/index.cjs +37 -31
  166. package/dist/index.d.cts +29 -23
  167. package/dist/index.d.ts +29 -23
  168. package/dist/index.js +22 -16
  169. package/dist/{session-types-Dn7b3RZM.d.ts → session-types-Cxx7W8zZ.d.ts} +1 -1
  170. package/dist/{session-types-B9idsih-.d.cts → session-types-DZkI_qFG.d.cts} +1 -1
  171. package/dist/session.cjs +7 -3
  172. package/dist/session.d.cts +11 -9
  173. package/dist/session.d.ts +11 -9
  174. package/dist/session.js +6 -2
  175. package/dist/{types-DG5_iKuv.d.cts → types-2NisMA8_.d.cts} +1 -1
  176. package/dist/{types-DG5_iKuv.d.ts → types-2NisMA8_.d.ts} +1 -1
  177. package/dist/{types-C1rxh-id.d.cts → types-Btp416jt.d.cts} +8 -0
  178. package/dist/{types-C1rxh-id.d.ts → types-Btp416jt.d.ts} +8 -0
  179. package/dist/{types-CZTzbIzQ.d.cts → types-BxTL1NXw.d.cts} +7 -0
  180. package/dist/{types-CZTzbIzQ.d.ts → types-BxTL1NXw.d.ts} +7 -0
  181. package/dist/{types-pShrs3fN.d.cts → types-CuibHYcf.d.cts} +7 -0
  182. package/dist/{types-pShrs3fN.d.ts → types-CuibHYcf.d.ts} +7 -0
  183. package/dist/{types-CY-QWxd-.d.cts → types-CwN7AEoL.d.cts} +13 -1
  184. package/dist/{types-CY-QWxd-.d.ts → types-CwN7AEoL.d.ts} +13 -1
  185. package/dist/{types-D4bmW8rY.d.cts → types-DAnalt5K.d.cts} +7 -0
  186. package/dist/{types-D4bmW8rY.d.ts → types-DAnalt5K.d.ts} +7 -0
  187. package/dist/types-DDwidj2d.d.cts +371 -0
  188. package/dist/types-DDwidj2d.d.ts +371 -0
  189. package/dist/{types-Bg86GGVZ.d.cts → types-DxXNP32l.d.cts} +8 -0
  190. package/dist/{types-Bg86GGVZ.d.ts → types-DxXNP32l.d.ts} +8 -0
  191. package/package.json +15 -3
  192. package/src/core/auth-redaction.ts +190 -0
  193. package/src/core/types.ts +1 -0
  194. package/src/drafts/draft07/codec.ts +40 -0
  195. package/src/drafts/draft07/error-codes.ts +44 -0
  196. package/src/drafts/draft07/index.ts +15 -0
  197. package/src/drafts/draft08/codec.ts +40 -0
  198. package/src/drafts/draft08/error-codes.ts +76 -0
  199. package/src/drafts/draft08/index.ts +21 -0
  200. package/src/drafts/draft09/codec.ts +40 -0
  201. package/src/drafts/draft09/error-codes.ts +76 -0
  202. package/src/drafts/draft09/index.ts +21 -0
  203. package/src/drafts/draft10/codec.ts +40 -0
  204. package/src/drafts/draft10/error-codes.ts +76 -0
  205. package/src/drafts/draft10/index.ts +21 -0
  206. package/src/drafts/draft11/codec.ts +60 -0
  207. package/src/drafts/draft11/error-codes.ts +106 -0
  208. package/src/drafts/draft11/index.ts +23 -0
  209. package/src/drafts/draft12/codec.ts +61 -0
  210. package/src/drafts/draft12/error-codes.ts +116 -0
  211. package/src/drafts/draft12/index.ts +25 -0
  212. package/src/drafts/draft13/codec.ts +69 -11
  213. package/src/drafts/draft13/error-codes.ts +107 -0
  214. package/src/drafts/draft13/index.ts +23 -0
  215. package/src/drafts/draft13/types.ts +1 -1
  216. package/src/drafts/draft14/codec.ts +65 -4
  217. package/src/drafts/draft14/data-streams.ts +331 -259
  218. package/src/drafts/draft14/error-codes.ts +109 -0
  219. package/src/drafts/draft14/index.ts +23 -0
  220. package/src/drafts/draft15/codec.ts +65 -8
  221. package/src/drafts/draft15/data-streams.ts +489 -444
  222. package/src/drafts/draft15/error-codes.ts +66 -0
  223. package/src/drafts/draft15/index.ts +15 -0
  224. package/src/drafts/draft15/types.ts +7 -0
  225. package/src/drafts/draft16/codec.ts +146 -52
  226. package/src/drafts/draft16/data-streams.ts +513 -442
  227. package/src/drafts/draft16/error-codes.ts +68 -0
  228. package/src/drafts/draft16/index.ts +15 -0
  229. package/src/drafts/draft16/messages.ts +4 -4
  230. package/src/drafts/draft16/session-fsm.ts +0 -1
  231. package/src/drafts/draft16/types.ts +22 -8
  232. package/src/drafts/draft17/codec.ts +73 -12
  233. package/src/drafts/draft17/data-streams.ts +567 -488
  234. package/src/drafts/draft17/index.ts +15 -0
  235. package/src/drafts/draft17/types.ts +7 -0
  236. package/src/drafts/draft18/codec.ts +66 -9
  237. package/src/drafts/draft18/data-streams.ts +570 -482
  238. package/src/drafts/draft18/index.ts +3 -0
  239. package/src/drafts/draft18/types.ts +16 -8
  240. package/src/drafts/draft19/codec.ts +70 -10
  241. package/src/drafts/draft19/data-streams.ts +570 -482
  242. package/src/drafts/draft19/error-codes.ts +3 -1
  243. package/src/drafts/draft19/index.ts +3 -0
  244. package/src/drafts/draft19/messages.ts +3 -1
  245. package/src/drafts/draft19/types.ts +22 -11
  246. package/src/drafts/draft20/codec.ts +90 -23
  247. package/src/drafts/draft20/data-streams.ts +610 -563
  248. package/src/drafts/draft20/index.ts +3 -0
  249. package/src/drafts/draft20/types.ts +14 -2
  250. package/src/drafts/draft21/codec.ts +1816 -0
  251. package/src/drafts/draft21/data-streams.ts +1338 -0
  252. package/src/drafts/draft21/error-codes.ts +135 -0
  253. package/src/drafts/draft21/index.ts +168 -0
  254. package/src/drafts/draft21/messages.ts +68 -0
  255. package/src/drafts/draft21/rules.ts +107 -0
  256. package/src/drafts/draft21/session-fsm.ts +1063 -0
  257. package/src/drafts/draft21/session.ts +21 -0
  258. package/src/drafts/draft21/types.ts +473 -0
  259. package/src/index.ts +9 -1
  260. package/src/session.ts +4 -0
  261. package/dist/codec-BJ7BHuiZ.d.ts +0 -18
  262. package/dist/codec-C6Mx4bwz.d.cts +0 -18
@@ -0,0 +1,176 @@
1
+ export { A as AuthRedaction, R as REDACTION_FILL } from './auth-redaction-B9JJOlIY.cjs';
2
+ export { D as Draft21Codec, U as UNKNOWN_STREAM_COUNT, c as createDraft21Codec, a as createStreamDecoder, d as decodeMessage, e as encodeMessage, r as redactAuthTokens } from './codec-C9U0Vzy9.cjs';
3
+ import { b as DataStreamEvent, F as FetchStreamHeader, O as ObjectPayload, S as SubgroupStreamHeader, c as Draft21DataStream, d as DatagramObject, e as FetchStream, f as SubgroupStream, a as Draft21MessageType } from './types-DDwidj2d.cjs';
4
+ export { g as DataStreamHeader, h as Draft21BaseMessage, i as Draft21Fetch, j as Draft21FetchOk, k as Draft21FillParameters, l as Draft21GoAway, D as Draft21Message, m as Draft21Namespace, n as Draft21NamespaceDone, o as Draft21Params, p as Draft21Publish, q as Draft21PublishDone, r as Draft21PublishNamespace, s as Draft21PublishSkipped, t as Draft21PublishStateNotify, u as Draft21RequestError, v as Draft21RequestOk, w as Draft21RequestUpdate, x as Draft21Setup, y as Draft21SetupOptions, z as Draft21Subscribe, A as Draft21SubscribeNamespace, B as Draft21SubscribeOk, C as Draft21SubscribeTracks, E as Draft21TrackProperties, G as Draft21TrackStatus, H as FetchObjectPayload, L as LargestObject, I as LocationFilter, R as RangeFilter, J as RangeFilterRange, K as Redirect, U as UnknownParam } from './types-DDwidj2d.cjs';
5
+ export { Draft21SessionFSM, FillFetchStreamPhase, FillFetchStreamState, PublisherSide, RequestKind, createDraft21SessionState } from './draft21-session.cjs';
6
+ export { P as ProtocolViolation, g as SessionPhase, h as SideEffect, T as TransitionResult, V as ValidationResult } from './session-types-DZkI_qFG.cjs';
7
+ import { b as DecodeResult } from './types-2NisMA8_.cjs';
8
+
9
+ declare function encodeSubgroupStream(stream: SubgroupStream): Uint8Array;
10
+ declare function encodeDatagram(dg: DatagramObject): Uint8Array;
11
+ declare function encodeFetchStream(stream: FetchStream): Uint8Array;
12
+ declare function decodeSubgroupStream(bytes: Uint8Array): DecodeResult<SubgroupStream>;
13
+ declare function decodeDatagram(bytes: Uint8Array): DecodeResult<DatagramObject>;
14
+ declare function decodeFetchStream(bytes: Uint8Array): DecodeResult<FetchStream>;
15
+ declare function decodeDataStream(streamType: 'subgroup' | 'datagram' | 'fetch', bytes: Uint8Array): DecodeResult<Draft21DataStream>;
16
+ declare function createSubgroupStreamDecoder(): TransformStream<Uint8Array, SubgroupStreamHeader | ObjectPayload>;
17
+ declare function createFetchStreamDecoder(): TransformStream<Uint8Array, FetchStreamHeader | ObjectPayload>;
18
+ declare function createDataStreamDecoder(): TransformStream<Uint8Array, DataStreamEvent>;
19
+
20
+ /** draft-21 Section 16.11.1, Table 18 (prose Section 6.6). */
21
+ declare const SessionTerminationCode: {
22
+ readonly NoError: 0n;
23
+ readonly InternalError: 1n;
24
+ readonly Unauthorized: 2n;
25
+ readonly ProtocolViolation: 3n;
26
+ readonly InvalidRequestId: 4n;
27
+ readonly DuplicateTrackAlias: 5n;
28
+ readonly KeyValueFormattingError: 6n;
29
+ readonly InvalidPath: 8n;
30
+ readonly MalformedPath: 9n;
31
+ readonly GoawayTimeout: 16n;
32
+ readonly ControlMessageTimeout: 17n;
33
+ readonly DataStreamTimeout: 18n;
34
+ readonly AuthTokenCacheOverflow: 19n;
35
+ readonly DuplicateAuthTokenAlias: 20n;
36
+ readonly MalformedAuthToken: 22n;
37
+ readonly UnknownAuthTokenAlias: 23n;
38
+ readonly ExpiredAuthToken: 24n;
39
+ readonly InvalidAuthority: 25n;
40
+ readonly MalformedAuthority: 26n;
41
+ readonly TooManyRequestUpdates: 27n;
42
+ };
43
+ type SessionTerminationCodeValue = (typeof SessionTerminationCode)[keyof typeof SessionTerminationCode];
44
+ /** draft-21 Section 16.11.2, Table 19 (prose Section 9.4.2). */
45
+ declare const RequestErrorCode: {
46
+ readonly InternalError: 0n;
47
+ readonly Unauthorized: 1n;
48
+ readonly Timeout: 2n;
49
+ readonly NotSupported: 3n;
50
+ readonly MalformedAuthToken: 4n;
51
+ readonly ExpiredAuthToken: 5n;
52
+ readonly GoingAway: 6n;
53
+ readonly ExcessiveLoad: 9n;
54
+ readonly DoesNotExist: 16n;
55
+ readonly InvalidRange: 17n;
56
+ readonly MalformedTrack: 18n;
57
+ readonly Uninterested: 32n;
58
+ readonly PrefixOverlap: 48n;
59
+ readonly NamespaceTooLarge: 49n;
60
+ readonly UnsupportedExtension: 51n;
61
+ readonly Redirect: 52n;
62
+ readonly ConflictingFilters: 53n;
63
+ readonly InvalidFilter: 54n;
64
+ };
65
+ type RequestErrorCodeValue = (typeof RequestErrorCode)[keyof typeof RequestErrorCode];
66
+ /** draft-21 Section 16.11.3, Table 20 (prose Section 9.9). */
67
+ declare const PublishDoneCode: {
68
+ readonly InternalError: 0n;
69
+ readonly Unauthorized: 1n;
70
+ readonly TrackEnded: 2n;
71
+ readonly GoingAway: 4n;
72
+ readonly TooFarBehind: 5n;
73
+ readonly Expired: 6n;
74
+ readonly UpdateFailed: 8n;
75
+ readonly ExcessiveLoad: 9n;
76
+ readonly MalformedTrack: 18n;
77
+ };
78
+ type PublishDoneCodeValue = (typeof PublishDoneCode)[keyof typeof PublishDoneCode];
79
+ /** draft-21 Section 16.11.4, Table 21 (prose Section 12.5) — unchanged from draft-19. */
80
+ declare const DataStreamResetCode: {
81
+ readonly InternalError: 0n;
82
+ readonly Cancelled: 1n;
83
+ readonly DeliveryTimeout: 2n;
84
+ readonly SessionClosed: 3n;
85
+ readonly GoingAway: 4n;
86
+ readonly TooFarBehind: 5n;
87
+ readonly UnknownObjectStatus: 6n;
88
+ readonly ExpiredAuthToken: 7n;
89
+ readonly ExcessiveLoad: 9n;
90
+ readonly MalformedTrack: 18n;
91
+ };
92
+ type DataStreamResetCodeValue = (typeof DataStreamResetCode)[keyof typeof DataStreamResetCode];
93
+ declare const RETIRED_SESSION_TERMINATION_CODES: ReadonlySet<bigint>;
94
+ declare const RETIRED_REQUEST_ERROR_CODES: ReadonlySet<bigint>;
95
+ declare const RETIRED_PUBLISH_DONE_CODES: ReadonlySet<bigint>;
96
+
97
+ declare const MSG_REQUEST_UPDATE = 2n;
98
+ declare const MSG_SUBSCRIBE = 3n;
99
+ declare const MSG_SUBSCRIBE_OK = 4n;
100
+ declare const MSG_REQUEST_ERROR = 5n;
101
+ declare const MSG_PUBLISH_NAMESPACE = 6n;
102
+ declare const MSG_REQUEST_OK = 7n;
103
+ declare const MSG_NAMESPACE = 8n;
104
+ declare const MSG_PUBLISH_DONE = 11n;
105
+ declare const MSG_TRACK_STATUS = 13n;
106
+ declare const MSG_NAMESPACE_DONE = 14n;
107
+ declare const MSG_PUBLISH_SKIPPED = 15n;
108
+ declare const MSG_GOAWAY = 16n;
109
+ declare const MSG_FETCH = 22n;
110
+ declare const MSG_FETCH_OK = 24n;
111
+ declare const MSG_PUBLISH = 29n;
112
+ /** NEW in draft-20 — Section 9.10. Unilateral publisher→subscriber notification. */
113
+ declare const MSG_PUBLISH_STATE_NOTIFY = 34n;
114
+ declare const MSG_PUBLISH_OK = 7n;
115
+ declare const MSG_SUBSCRIBE_NAMESPACE = 80n;
116
+ declare const MSG_SUBSCRIBE_TRACKS = 81n;
117
+ declare const MSG_SETUP = 12032n;
118
+ declare const SETUP_OPT_PATH = 1n;
119
+ declare const SETUP_OPT_AUTHORIZATION_TOKEN = 3n;
120
+ declare const SETUP_OPT_MAX_AUTH_TOKEN_CACHE_SIZE = 4n;
121
+ declare const SETUP_OPT_AUTHORITY = 5n;
122
+ declare const SETUP_OPT_MAX_FILTER_RANGES = 6n;
123
+ declare const SETUP_OPT_MOQT_IMPLEMENTATION = 7n;
124
+ declare const SETUP_OPT_MAX_REQUEST_UPDATES = 8n;
125
+ declare const MESSAGE_TYPE_MAP: ReadonlyMap<bigint, string>;
126
+ declare const MESSAGE_ID_MAP: ReadonlyMap<string, bigint>;
127
+
128
+ declare const CONTROL_MESSAGES: ReadonlySet<Draft21MessageType>;
129
+ declare const CLIENT_ONLY_MESSAGES: ReadonlySet<Draft21MessageType>;
130
+ declare const SERVER_ONLY_MESSAGES: ReadonlySet<Draft21MessageType>;
131
+ declare const BIDIRECTIONAL_MESSAGES: ReadonlySet<Draft21MessageType>;
132
+ /**
133
+ * The seven message types that may be the FIRST message on a new bidirectional
134
+ * (request) stream — draft-21 Section 6.3, and the rows marked "First" in the
135
+ * Section 9 registry. Unchanged from draft-19.
136
+ *
137
+ * "Bidirectional streams MUST NOT begin with any other message type unless
138
+ * negotiated. If they do, the peer MUST close the Session with a
139
+ * PROTOCOL_VIOLATION." Note GOAWAY (0x10) is marked "Control, Request" but not
140
+ * "First": it may travel on either kind of stream but may never open one.
141
+ */
142
+ declare const REQUEST_STREAM_OPENERS: ReadonlySet<Draft21MessageType>;
143
+ declare function getLegalOutgoing(phase: string, _role: 'client' | 'server'): Set<Draft21MessageType>;
144
+ declare function getLegalIncoming(phase: string, role: 'client' | 'server'): Set<Draft21MessageType>;
145
+
146
+ /**
147
+ * Draft-21's real identifier is the protocol string `moqt-21`.
148
+ *
149
+ * draft-21 Section 6.2: "MOQT uses ALPN in QUIC and 'WT-Available-Protocols' in
150
+ * WebTransport to perform version negotiation. […] ALPNs used to identify IETF
151
+ * drafts are created by appending the draft number to 'moqt-'. […] Note: Draft
152
+ * versions prior to -15 all used moq-00 ALPN, followed by version negotiation
153
+ * in the SETUP messages."
154
+ *
155
+ * So this is what a draft-21 peer actually negotiates with, and it is the only
156
+ * identifier that appears anywhere in a draft-21 session.
157
+ */
158
+ declare const PROTOCOL_STRING = "moqt-21";
159
+ /**
160
+ * The `0xff000000 + N` identifier for draft 20.
161
+ *
162
+ * **This is a derived identifier, not an observed wire value.** No draft-21
163
+ * peer ever sends it. The `0xff0000NN` scheme belonged to the SETUP-time
164
+ * version negotiation that drafts before -15 used; from draft-15 on the version
165
+ * is negotiated by ALPN / `WT-Available-Protocols` and no version number
166
+ * appears on the wire at all. It is kept only so that code indexing drafts by a
167
+ * numeric key — {@link DRAFT_VERSIONS} in the package root, trace formats,
168
+ * anything that predates the change — has a stable key for draft-21.
169
+ *
170
+ * Anything that reports a version to a user should report
171
+ * {@link PROTOCOL_STRING} instead, and should not claim to have observed this
172
+ * number.
173
+ */
174
+ declare const DRAFT_VERSION = 4278190101n;
175
+
176
+ export { BIDIRECTIONAL_MESSAGES, CLIENT_ONLY_MESSAGES, CONTROL_MESSAGES, DRAFT_VERSION, DataStreamEvent, DataStreamResetCode, type DataStreamResetCodeValue, DatagramObject, Draft21DataStream, Draft21MessageType, FetchStream, FetchStreamHeader, MESSAGE_ID_MAP, MESSAGE_TYPE_MAP, MSG_FETCH, MSG_FETCH_OK, MSG_GOAWAY, MSG_NAMESPACE, MSG_NAMESPACE_DONE, MSG_PUBLISH, MSG_PUBLISH_DONE, MSG_PUBLISH_NAMESPACE, MSG_PUBLISH_OK, MSG_PUBLISH_SKIPPED, MSG_PUBLISH_STATE_NOTIFY, MSG_REQUEST_ERROR, MSG_REQUEST_OK, MSG_REQUEST_UPDATE, MSG_SETUP, MSG_SUBSCRIBE, MSG_SUBSCRIBE_NAMESPACE, MSG_SUBSCRIBE_OK, MSG_SUBSCRIBE_TRACKS, MSG_TRACK_STATUS, ObjectPayload, PROTOCOL_STRING, PublishDoneCode, type PublishDoneCodeValue, REQUEST_STREAM_OPENERS, RETIRED_PUBLISH_DONE_CODES, RETIRED_REQUEST_ERROR_CODES, RETIRED_SESSION_TERMINATION_CODES, RequestErrorCode, type RequestErrorCodeValue, SERVER_ONLY_MESSAGES, SETUP_OPT_AUTHORITY, SETUP_OPT_AUTHORIZATION_TOKEN, SETUP_OPT_MAX_AUTH_TOKEN_CACHE_SIZE, SETUP_OPT_MAX_FILTER_RANGES, SETUP_OPT_MAX_REQUEST_UPDATES, SETUP_OPT_MOQT_IMPLEMENTATION, SETUP_OPT_PATH, SessionTerminationCode, type SessionTerminationCodeValue, SubgroupStream, SubgroupStreamHeader, createDataStreamDecoder, createFetchStreamDecoder, createSubgroupStreamDecoder, decodeDataStream, decodeDatagram, decodeFetchStream, decodeSubgroupStream, encodeDatagram, encodeFetchStream, encodeSubgroupStream, getLegalIncoming, getLegalOutgoing };
@@ -0,0 +1,176 @@
1
+ export { A as AuthRedaction, R as REDACTION_FILL } from './auth-redaction-B9JJOlIY.js';
2
+ export { D as Draft21Codec, U as UNKNOWN_STREAM_COUNT, c as createDraft21Codec, a as createStreamDecoder, d as decodeMessage, e as encodeMessage, r as redactAuthTokens } from './codec-Cb8mUre3.js';
3
+ import { b as DataStreamEvent, F as FetchStreamHeader, O as ObjectPayload, S as SubgroupStreamHeader, c as Draft21DataStream, d as DatagramObject, e as FetchStream, f as SubgroupStream, a as Draft21MessageType } from './types-DDwidj2d.js';
4
+ export { g as DataStreamHeader, h as Draft21BaseMessage, i as Draft21Fetch, j as Draft21FetchOk, k as Draft21FillParameters, l as Draft21GoAway, D as Draft21Message, m as Draft21Namespace, n as Draft21NamespaceDone, o as Draft21Params, p as Draft21Publish, q as Draft21PublishDone, r as Draft21PublishNamespace, s as Draft21PublishSkipped, t as Draft21PublishStateNotify, u as Draft21RequestError, v as Draft21RequestOk, w as Draft21RequestUpdate, x as Draft21Setup, y as Draft21SetupOptions, z as Draft21Subscribe, A as Draft21SubscribeNamespace, B as Draft21SubscribeOk, C as Draft21SubscribeTracks, E as Draft21TrackProperties, G as Draft21TrackStatus, H as FetchObjectPayload, L as LargestObject, I as LocationFilter, R as RangeFilter, J as RangeFilterRange, K as Redirect, U as UnknownParam } from './types-DDwidj2d.js';
5
+ export { Draft21SessionFSM, FillFetchStreamPhase, FillFetchStreamState, PublisherSide, RequestKind, createDraft21SessionState } from './draft21-session.js';
6
+ export { P as ProtocolViolation, g as SessionPhase, h as SideEffect, T as TransitionResult, V as ValidationResult } from './session-types-Cxx7W8zZ.js';
7
+ import { b as DecodeResult } from './types-2NisMA8_.js';
8
+
9
+ declare function encodeSubgroupStream(stream: SubgroupStream): Uint8Array;
10
+ declare function encodeDatagram(dg: DatagramObject): Uint8Array;
11
+ declare function encodeFetchStream(stream: FetchStream): Uint8Array;
12
+ declare function decodeSubgroupStream(bytes: Uint8Array): DecodeResult<SubgroupStream>;
13
+ declare function decodeDatagram(bytes: Uint8Array): DecodeResult<DatagramObject>;
14
+ declare function decodeFetchStream(bytes: Uint8Array): DecodeResult<FetchStream>;
15
+ declare function decodeDataStream(streamType: 'subgroup' | 'datagram' | 'fetch', bytes: Uint8Array): DecodeResult<Draft21DataStream>;
16
+ declare function createSubgroupStreamDecoder(): TransformStream<Uint8Array, SubgroupStreamHeader | ObjectPayload>;
17
+ declare function createFetchStreamDecoder(): TransformStream<Uint8Array, FetchStreamHeader | ObjectPayload>;
18
+ declare function createDataStreamDecoder(): TransformStream<Uint8Array, DataStreamEvent>;
19
+
20
+ /** draft-21 Section 16.11.1, Table 18 (prose Section 6.6). */
21
+ declare const SessionTerminationCode: {
22
+ readonly NoError: 0n;
23
+ readonly InternalError: 1n;
24
+ readonly Unauthorized: 2n;
25
+ readonly ProtocolViolation: 3n;
26
+ readonly InvalidRequestId: 4n;
27
+ readonly DuplicateTrackAlias: 5n;
28
+ readonly KeyValueFormattingError: 6n;
29
+ readonly InvalidPath: 8n;
30
+ readonly MalformedPath: 9n;
31
+ readonly GoawayTimeout: 16n;
32
+ readonly ControlMessageTimeout: 17n;
33
+ readonly DataStreamTimeout: 18n;
34
+ readonly AuthTokenCacheOverflow: 19n;
35
+ readonly DuplicateAuthTokenAlias: 20n;
36
+ readonly MalformedAuthToken: 22n;
37
+ readonly UnknownAuthTokenAlias: 23n;
38
+ readonly ExpiredAuthToken: 24n;
39
+ readonly InvalidAuthority: 25n;
40
+ readonly MalformedAuthority: 26n;
41
+ readonly TooManyRequestUpdates: 27n;
42
+ };
43
+ type SessionTerminationCodeValue = (typeof SessionTerminationCode)[keyof typeof SessionTerminationCode];
44
+ /** draft-21 Section 16.11.2, Table 19 (prose Section 9.4.2). */
45
+ declare const RequestErrorCode: {
46
+ readonly InternalError: 0n;
47
+ readonly Unauthorized: 1n;
48
+ readonly Timeout: 2n;
49
+ readonly NotSupported: 3n;
50
+ readonly MalformedAuthToken: 4n;
51
+ readonly ExpiredAuthToken: 5n;
52
+ readonly GoingAway: 6n;
53
+ readonly ExcessiveLoad: 9n;
54
+ readonly DoesNotExist: 16n;
55
+ readonly InvalidRange: 17n;
56
+ readonly MalformedTrack: 18n;
57
+ readonly Uninterested: 32n;
58
+ readonly PrefixOverlap: 48n;
59
+ readonly NamespaceTooLarge: 49n;
60
+ readonly UnsupportedExtension: 51n;
61
+ readonly Redirect: 52n;
62
+ readonly ConflictingFilters: 53n;
63
+ readonly InvalidFilter: 54n;
64
+ };
65
+ type RequestErrorCodeValue = (typeof RequestErrorCode)[keyof typeof RequestErrorCode];
66
+ /** draft-21 Section 16.11.3, Table 20 (prose Section 9.9). */
67
+ declare const PublishDoneCode: {
68
+ readonly InternalError: 0n;
69
+ readonly Unauthorized: 1n;
70
+ readonly TrackEnded: 2n;
71
+ readonly GoingAway: 4n;
72
+ readonly TooFarBehind: 5n;
73
+ readonly Expired: 6n;
74
+ readonly UpdateFailed: 8n;
75
+ readonly ExcessiveLoad: 9n;
76
+ readonly MalformedTrack: 18n;
77
+ };
78
+ type PublishDoneCodeValue = (typeof PublishDoneCode)[keyof typeof PublishDoneCode];
79
+ /** draft-21 Section 16.11.4, Table 21 (prose Section 12.5) — unchanged from draft-19. */
80
+ declare const DataStreamResetCode: {
81
+ readonly InternalError: 0n;
82
+ readonly Cancelled: 1n;
83
+ readonly DeliveryTimeout: 2n;
84
+ readonly SessionClosed: 3n;
85
+ readonly GoingAway: 4n;
86
+ readonly TooFarBehind: 5n;
87
+ readonly UnknownObjectStatus: 6n;
88
+ readonly ExpiredAuthToken: 7n;
89
+ readonly ExcessiveLoad: 9n;
90
+ readonly MalformedTrack: 18n;
91
+ };
92
+ type DataStreamResetCodeValue = (typeof DataStreamResetCode)[keyof typeof DataStreamResetCode];
93
+ declare const RETIRED_SESSION_TERMINATION_CODES: ReadonlySet<bigint>;
94
+ declare const RETIRED_REQUEST_ERROR_CODES: ReadonlySet<bigint>;
95
+ declare const RETIRED_PUBLISH_DONE_CODES: ReadonlySet<bigint>;
96
+
97
+ declare const MSG_REQUEST_UPDATE = 2n;
98
+ declare const MSG_SUBSCRIBE = 3n;
99
+ declare const MSG_SUBSCRIBE_OK = 4n;
100
+ declare const MSG_REQUEST_ERROR = 5n;
101
+ declare const MSG_PUBLISH_NAMESPACE = 6n;
102
+ declare const MSG_REQUEST_OK = 7n;
103
+ declare const MSG_NAMESPACE = 8n;
104
+ declare const MSG_PUBLISH_DONE = 11n;
105
+ declare const MSG_TRACK_STATUS = 13n;
106
+ declare const MSG_NAMESPACE_DONE = 14n;
107
+ declare const MSG_PUBLISH_SKIPPED = 15n;
108
+ declare const MSG_GOAWAY = 16n;
109
+ declare const MSG_FETCH = 22n;
110
+ declare const MSG_FETCH_OK = 24n;
111
+ declare const MSG_PUBLISH = 29n;
112
+ /** NEW in draft-20 — Section 9.10. Unilateral publisher→subscriber notification. */
113
+ declare const MSG_PUBLISH_STATE_NOTIFY = 34n;
114
+ declare const MSG_PUBLISH_OK = 7n;
115
+ declare const MSG_SUBSCRIBE_NAMESPACE = 80n;
116
+ declare const MSG_SUBSCRIBE_TRACKS = 81n;
117
+ declare const MSG_SETUP = 12032n;
118
+ declare const SETUP_OPT_PATH = 1n;
119
+ declare const SETUP_OPT_AUTHORIZATION_TOKEN = 3n;
120
+ declare const SETUP_OPT_MAX_AUTH_TOKEN_CACHE_SIZE = 4n;
121
+ declare const SETUP_OPT_AUTHORITY = 5n;
122
+ declare const SETUP_OPT_MAX_FILTER_RANGES = 6n;
123
+ declare const SETUP_OPT_MOQT_IMPLEMENTATION = 7n;
124
+ declare const SETUP_OPT_MAX_REQUEST_UPDATES = 8n;
125
+ declare const MESSAGE_TYPE_MAP: ReadonlyMap<bigint, string>;
126
+ declare const MESSAGE_ID_MAP: ReadonlyMap<string, bigint>;
127
+
128
+ declare const CONTROL_MESSAGES: ReadonlySet<Draft21MessageType>;
129
+ declare const CLIENT_ONLY_MESSAGES: ReadonlySet<Draft21MessageType>;
130
+ declare const SERVER_ONLY_MESSAGES: ReadonlySet<Draft21MessageType>;
131
+ declare const BIDIRECTIONAL_MESSAGES: ReadonlySet<Draft21MessageType>;
132
+ /**
133
+ * The seven message types that may be the FIRST message on a new bidirectional
134
+ * (request) stream — draft-21 Section 6.3, and the rows marked "First" in the
135
+ * Section 9 registry. Unchanged from draft-19.
136
+ *
137
+ * "Bidirectional streams MUST NOT begin with any other message type unless
138
+ * negotiated. If they do, the peer MUST close the Session with a
139
+ * PROTOCOL_VIOLATION." Note GOAWAY (0x10) is marked "Control, Request" but not
140
+ * "First": it may travel on either kind of stream but may never open one.
141
+ */
142
+ declare const REQUEST_STREAM_OPENERS: ReadonlySet<Draft21MessageType>;
143
+ declare function getLegalOutgoing(phase: string, _role: 'client' | 'server'): Set<Draft21MessageType>;
144
+ declare function getLegalIncoming(phase: string, role: 'client' | 'server'): Set<Draft21MessageType>;
145
+
146
+ /**
147
+ * Draft-21's real identifier is the protocol string `moqt-21`.
148
+ *
149
+ * draft-21 Section 6.2: "MOQT uses ALPN in QUIC and 'WT-Available-Protocols' in
150
+ * WebTransport to perform version negotiation. […] ALPNs used to identify IETF
151
+ * drafts are created by appending the draft number to 'moqt-'. […] Note: Draft
152
+ * versions prior to -15 all used moq-00 ALPN, followed by version negotiation
153
+ * in the SETUP messages."
154
+ *
155
+ * So this is what a draft-21 peer actually negotiates with, and it is the only
156
+ * identifier that appears anywhere in a draft-21 session.
157
+ */
158
+ declare const PROTOCOL_STRING = "moqt-21";
159
+ /**
160
+ * The `0xff000000 + N` identifier for draft 20.
161
+ *
162
+ * **This is a derived identifier, not an observed wire value.** No draft-21
163
+ * peer ever sends it. The `0xff0000NN` scheme belonged to the SETUP-time
164
+ * version negotiation that drafts before -15 used; from draft-15 on the version
165
+ * is negotiated by ALPN / `WT-Available-Protocols` and no version number
166
+ * appears on the wire at all. It is kept only so that code indexing drafts by a
167
+ * numeric key — {@link DRAFT_VERSIONS} in the package root, trace formats,
168
+ * anything that predates the change — has a stable key for draft-21.
169
+ *
170
+ * Anything that reports a version to a user should report
171
+ * {@link PROTOCOL_STRING} instead, and should not claim to have observed this
172
+ * number.
173
+ */
174
+ declare const DRAFT_VERSION = 4278190101n;
175
+
176
+ export { BIDIRECTIONAL_MESSAGES, CLIENT_ONLY_MESSAGES, CONTROL_MESSAGES, DRAFT_VERSION, DataStreamEvent, DataStreamResetCode, type DataStreamResetCodeValue, DatagramObject, Draft21DataStream, Draft21MessageType, FetchStream, FetchStreamHeader, MESSAGE_ID_MAP, MESSAGE_TYPE_MAP, MSG_FETCH, MSG_FETCH_OK, MSG_GOAWAY, MSG_NAMESPACE, MSG_NAMESPACE_DONE, MSG_PUBLISH, MSG_PUBLISH_DONE, MSG_PUBLISH_NAMESPACE, MSG_PUBLISH_OK, MSG_PUBLISH_SKIPPED, MSG_PUBLISH_STATE_NOTIFY, MSG_REQUEST_ERROR, MSG_REQUEST_OK, MSG_REQUEST_UPDATE, MSG_SETUP, MSG_SUBSCRIBE, MSG_SUBSCRIBE_NAMESPACE, MSG_SUBSCRIBE_OK, MSG_SUBSCRIBE_TRACKS, MSG_TRACK_STATUS, ObjectPayload, PROTOCOL_STRING, PublishDoneCode, type PublishDoneCodeValue, REQUEST_STREAM_OPENERS, RETIRED_PUBLISH_DONE_CODES, RETIRED_REQUEST_ERROR_CODES, RETIRED_SESSION_TERMINATION_CODES, RequestErrorCode, type RequestErrorCodeValue, SERVER_ONLY_MESSAGES, SETUP_OPT_AUTHORITY, SETUP_OPT_AUTHORIZATION_TOKEN, SETUP_OPT_MAX_AUTH_TOKEN_CACHE_SIZE, SETUP_OPT_MAX_FILTER_RANGES, SETUP_OPT_MAX_REQUEST_UPDATES, SETUP_OPT_MOQT_IMPLEMENTATION, SETUP_OPT_PATH, SessionTerminationCode, type SessionTerminationCodeValue, SubgroupStream, SubgroupStreamHeader, createDataStreamDecoder, createFetchStreamDecoder, createSubgroupStreamDecoder, decodeDataStream, decodeDatagram, decodeFetchStream, decodeSubgroupStream, encodeDatagram, encodeFetchStream, encodeSubgroupStream, getLegalIncoming, getLegalOutgoing };
@@ -0,0 +1,222 @@
1
+ import {
2
+ MESSAGE_ID_MAP,
3
+ MESSAGE_TYPE_MAP,
4
+ MSG_FETCH,
5
+ MSG_FETCH_OK,
6
+ MSG_GOAWAY,
7
+ MSG_NAMESPACE,
8
+ MSG_NAMESPACE_DONE,
9
+ MSG_PUBLISH,
10
+ MSG_PUBLISH_DONE,
11
+ MSG_PUBLISH_NAMESPACE,
12
+ MSG_PUBLISH_OK,
13
+ MSG_PUBLISH_SKIPPED,
14
+ MSG_PUBLISH_STATE_NOTIFY,
15
+ MSG_REQUEST_ERROR,
16
+ MSG_REQUEST_OK,
17
+ MSG_REQUEST_UPDATE,
18
+ MSG_SETUP,
19
+ MSG_SUBSCRIBE,
20
+ MSG_SUBSCRIBE_NAMESPACE,
21
+ MSG_SUBSCRIBE_OK,
22
+ MSG_SUBSCRIBE_TRACKS,
23
+ MSG_TRACK_STATUS,
24
+ SETUP_OPT_AUTHORITY,
25
+ SETUP_OPT_AUTHORIZATION_TOKEN,
26
+ SETUP_OPT_MAX_AUTH_TOKEN_CACHE_SIZE,
27
+ SETUP_OPT_MAX_FILTER_RANGES,
28
+ SETUP_OPT_MAX_REQUEST_UPDATES,
29
+ SETUP_OPT_MOQT_IMPLEMENTATION,
30
+ SETUP_OPT_PATH,
31
+ UNKNOWN_STREAM_COUNT,
32
+ createDataStreamDecoder,
33
+ createDraft21Codec,
34
+ createFetchStreamDecoder,
35
+ createStreamDecoder,
36
+ createSubgroupStreamDecoder,
37
+ decodeDataStream,
38
+ decodeDatagram,
39
+ decodeFetchStream,
40
+ decodeMessage,
41
+ decodeSubgroupStream,
42
+ encodeDatagram,
43
+ encodeFetchStream,
44
+ encodeMessage,
45
+ encodeSubgroupStream,
46
+ redactAuthTokens
47
+ } from "./chunk-T2TCLZZV.js";
48
+ import {
49
+ BIDIRECTIONAL_MESSAGES,
50
+ CLIENT_ONLY_MESSAGES,
51
+ CONTROL_MESSAGES,
52
+ Draft21SessionFSM,
53
+ REQUEST_STREAM_OPENERS,
54
+ SERVER_ONLY_MESSAGES,
55
+ createDraft21SessionState,
56
+ getLegalIncoming,
57
+ getLegalOutgoing
58
+ } from "./chunk-XPCBPACE.js";
59
+ import {
60
+ REDACTION_FILL
61
+ } from "./chunk-YRZQVNZO.js";
62
+
63
+ // src/drafts/draft21/error-codes.ts
64
+ var SessionTerminationCode = {
65
+ NoError: 0x0n,
66
+ InternalError: 0x1n,
67
+ Unauthorized: 0x2n,
68
+ ProtocolViolation: 0x3n,
69
+ InvalidRequestId: 0x4n,
70
+ DuplicateTrackAlias: 0x5n,
71
+ KeyValueFormattingError: 0x6n,
72
+ InvalidPath: 0x8n,
73
+ MalformedPath: 0x9n,
74
+ GoawayTimeout: 0x10n,
75
+ ControlMessageTimeout: 0x11n,
76
+ DataStreamTimeout: 0x12n,
77
+ AuthTokenCacheOverflow: 0x13n,
78
+ DuplicateAuthTokenAlias: 0x14n,
79
+ // 0x15 VERSION_NEGOTIATION_FAILED — REMOVED in draft-20. Version negotiation
80
+ // moved to ALPN / WT-Available-Protocols in draft-15, so there is no longer a
81
+ // SETUP-time negotiation that can fail. See RETIRED_SESSION_TERMINATION_CODES.
82
+ MalformedAuthToken: 0x16n,
83
+ UnknownAuthTokenAlias: 0x17n,
84
+ ExpiredAuthToken: 0x18n,
85
+ InvalidAuthority: 0x19n,
86
+ MalformedAuthority: 0x1an,
87
+ TooManyRequestUpdates: 0x1bn
88
+ };
89
+ var RequestErrorCode = {
90
+ InternalError: 0x0n,
91
+ Unauthorized: 0x1n,
92
+ Timeout: 0x2n,
93
+ NotSupported: 0x3n,
94
+ MalformedAuthToken: 0x4n,
95
+ ExpiredAuthToken: 0x5n,
96
+ GoingAway: 0x6n,
97
+ ExcessiveLoad: 0x9n,
98
+ DoesNotExist: 0x10n,
99
+ InvalidRange: 0x11n,
100
+ MalformedTrack: 0x12n,
101
+ Uninterested: 0x20n,
102
+ PrefixOverlap: 0x30n,
103
+ NamespaceTooLarge: 0x31n,
104
+ // 0x32 INVALID_JOINING_REQUEST_ID — REMOVED in draft-20 along with the whole
105
+ // joining-fetch mechanism (draft-19 Section 10.12.2). A draft-21 FETCH names
106
+ // its own track inline and never references another request, so there is no
107
+ // joining Request ID left to be invalid. See RETIRED_REQUEST_ERROR_CODES.
108
+ UnsupportedExtension: 0x33n,
109
+ Redirect: 0x34n,
110
+ ConflictingFilters: 0x35n,
111
+ InvalidFilter: 0x36n
112
+ };
113
+ var PublishDoneCode = {
114
+ InternalError: 0x0n,
115
+ Unauthorized: 0x1n,
116
+ TrackEnded: 0x2n,
117
+ // 0x3 SUBSCRIPTION_ENDED — REMOVED in draft-20. The behaviour went with it:
118
+ // Section 3.3.1 now says "A publisher does not end a subscription solely
119
+ // because the Largest Object advances past the end of the current Location
120
+ // Filter", which is the only thing this code used to report.
121
+ // See RETIRED_PUBLISH_DONE_CODES.
122
+ GoingAway: 0x4n,
123
+ TooFarBehind: 0x5n,
124
+ Expired: 0x6n,
125
+ UpdateFailed: 0x8n,
126
+ ExcessiveLoad: 0x9n,
127
+ MalformedTrack: 0x12n
128
+ };
129
+ var DataStreamResetCode = {
130
+ InternalError: 0x0n,
131
+ Cancelled: 0x1n,
132
+ DeliveryTimeout: 0x2n,
133
+ SessionClosed: 0x3n,
134
+ GoingAway: 0x4n,
135
+ TooFarBehind: 0x5n,
136
+ UnknownObjectStatus: 0x6n,
137
+ ExpiredAuthToken: 0x7n,
138
+ ExcessiveLoad: 0x9n,
139
+ MalformedTrack: 0x12n
140
+ };
141
+ var RETIRED_SESSION_TERMINATION_CODES = /* @__PURE__ */ new Set([
142
+ 0x15n
143
+ // VERSION_NEGOTIATION_FAILED (draft-19 Section 3.5)
144
+ ]);
145
+ var RETIRED_REQUEST_ERROR_CODES = /* @__PURE__ */ new Set([
146
+ 0x32n
147
+ // INVALID_JOINING_REQUEST_ID (draft-19 Section 10.6.2)
148
+ ]);
149
+ var RETIRED_PUBLISH_DONE_CODES = /* @__PURE__ */ new Set([
150
+ 0x3n
151
+ // SUBSCRIPTION_ENDED (draft-19 Section 10.11)
152
+ ]);
153
+
154
+ // src/drafts/draft21/index.ts
155
+ var PROTOCOL_STRING = "moqt-21";
156
+ var DRAFT_VERSION = 0xff000015n;
157
+ export {
158
+ BIDIRECTIONAL_MESSAGES,
159
+ CLIENT_ONLY_MESSAGES,
160
+ CONTROL_MESSAGES,
161
+ DRAFT_VERSION,
162
+ DataStreamResetCode,
163
+ Draft21SessionFSM,
164
+ MESSAGE_ID_MAP,
165
+ MESSAGE_TYPE_MAP,
166
+ MSG_FETCH,
167
+ MSG_FETCH_OK,
168
+ MSG_GOAWAY,
169
+ MSG_NAMESPACE,
170
+ MSG_NAMESPACE_DONE,
171
+ MSG_PUBLISH,
172
+ MSG_PUBLISH_DONE,
173
+ MSG_PUBLISH_NAMESPACE,
174
+ MSG_PUBLISH_OK,
175
+ MSG_PUBLISH_SKIPPED,
176
+ MSG_PUBLISH_STATE_NOTIFY,
177
+ MSG_REQUEST_ERROR,
178
+ MSG_REQUEST_OK,
179
+ MSG_REQUEST_UPDATE,
180
+ MSG_SETUP,
181
+ MSG_SUBSCRIBE,
182
+ MSG_SUBSCRIBE_NAMESPACE,
183
+ MSG_SUBSCRIBE_OK,
184
+ MSG_SUBSCRIBE_TRACKS,
185
+ MSG_TRACK_STATUS,
186
+ PROTOCOL_STRING,
187
+ PublishDoneCode,
188
+ REDACTION_FILL,
189
+ REQUEST_STREAM_OPENERS,
190
+ RETIRED_PUBLISH_DONE_CODES,
191
+ RETIRED_REQUEST_ERROR_CODES,
192
+ RETIRED_SESSION_TERMINATION_CODES,
193
+ RequestErrorCode,
194
+ SERVER_ONLY_MESSAGES,
195
+ SETUP_OPT_AUTHORITY,
196
+ SETUP_OPT_AUTHORIZATION_TOKEN,
197
+ SETUP_OPT_MAX_AUTH_TOKEN_CACHE_SIZE,
198
+ SETUP_OPT_MAX_FILTER_RANGES,
199
+ SETUP_OPT_MAX_REQUEST_UPDATES,
200
+ SETUP_OPT_MOQT_IMPLEMENTATION,
201
+ SETUP_OPT_PATH,
202
+ SessionTerminationCode,
203
+ UNKNOWN_STREAM_COUNT,
204
+ createDataStreamDecoder,
205
+ createDraft21Codec,
206
+ createDraft21SessionState,
207
+ createFetchStreamDecoder,
208
+ createStreamDecoder,
209
+ createSubgroupStreamDecoder,
210
+ decodeDataStream,
211
+ decodeDatagram,
212
+ decodeFetchStream,
213
+ decodeMessage,
214
+ decodeSubgroupStream,
215
+ encodeDatagram,
216
+ encodeFetchStream,
217
+ encodeMessage,
218
+ encodeSubgroupStream,
219
+ getLegalIncoming,
220
+ getLegalOutgoing,
221
+ redactAuthTokens
222
+ };