@moqtap/codec 0.8.1 → 0.10.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 (194) hide show
  1. package/CHANGELOG.md +75 -0
  2. package/README.md +16 -4
  3. package/dist/{chunk-KCH4BQXK.cjs → chunk-AQ445VV7.cjs} +15 -9
  4. package/dist/{chunk-UZO5Z2XT.cjs → chunk-BIBMDTU5.cjs} +12 -6
  5. package/dist/chunk-BMJMY6FX.cjs +868 -0
  6. package/dist/{chunk-23KRITJ6.js → chunk-BX2N7TZM.js} +14 -8
  7. package/dist/{chunk-XQGEOFGE.js → chunk-CF5DDD3Q.js} +14 -8
  8. package/dist/chunk-FT3HDNIB.js +2374 -0
  9. package/dist/{chunk-TMXRYOBS.js → chunk-G53WYUXL.js} +13 -7
  10. package/dist/{chunk-JKMYAUGY.js → chunk-K2B3OVFK.js} +11 -8
  11. package/dist/{chunk-3YAR3I3S.js → chunk-KGDVC4O6.js} +36 -22
  12. package/dist/{chunk-VWXUT5R2.cjs → chunk-KTNERCTZ.cjs} +36 -22
  13. package/dist/{chunk-H6DTAIWM.js → chunk-L5DRACXS.js} +22 -16
  14. package/dist/{chunk-UA5XFP4O.cjs → chunk-OUNN4IQB.cjs} +14 -8
  15. package/dist/{chunk-NH4L6NIY.js → chunk-OZRK73NQ.js} +12 -6
  16. package/dist/{chunk-PU2KV7VP.cjs → chunk-RYKQXBG6.cjs} +12 -6
  17. package/dist/{chunk-EVCPBFSR.cjs → chunk-SDJTSMOW.cjs} +23 -17
  18. package/dist/chunk-T4VWPKDG.cjs +2374 -0
  19. package/dist/{chunk-2XH6PHXR.js → chunk-TSUZ6GJV.js} +12 -6
  20. package/dist/{chunk-QGIHC6BA.cjs → chunk-UKKDOOUO.cjs} +12 -9
  21. package/dist/{chunk-BV6MITLO.js → chunk-WCPENYNE.js} +14 -8
  22. package/dist/{chunk-IADVBKEJ.cjs → chunk-WCTMPDUX.cjs} +15 -9
  23. package/dist/chunk-WX5PU7HF.js +868 -0
  24. package/dist/{chunk-7ENEWAMZ.cjs → chunk-XCRCAUGI.cjs} +15 -9
  25. package/dist/{codec-BLYAy2OP.d.ts → codec--CVeqGQv.d.ts} +1 -1
  26. package/dist/{codec-BNS3gS77.d.ts → codec-08ZOr5wI.d.ts} +2 -2
  27. package/dist/{codec-DujHf55Z.d.ts → codec-BJ7BHuiZ.d.ts} +1 -1
  28. package/dist/{codec-CI0BjmHc.d.ts → codec-BNy5syCU.d.ts} +1 -1
  29. package/dist/{codec-N3g1lxQQ.d.cts → codec-Bd60SGKH.d.cts} +2 -2
  30. package/dist/{codec-xeuGZY77.d.cts → codec-BrTi4K7r.d.cts} +3 -3
  31. package/dist/{codec-DJmV04i0.d.ts → codec-Bux_Q40X.d.ts} +2 -2
  32. package/dist/{codec-BqqoYdh_.d.cts → codec-BxQTybUX.d.cts} +2 -2
  33. package/dist/{codec-D2JbI2tp.d.ts → codec-C3mdsGx3.d.ts} +2 -2
  34. package/dist/{codec-DQWQSam3.d.cts → codec-C6Mx4bwz.d.cts} +1 -1
  35. package/dist/{codec-DAePx2NL.d.ts → codec-CBdOIfMY.d.ts} +3 -3
  36. package/dist/codec-CFWu5KVT.d.cts +49 -0
  37. package/dist/{codec-CyApDKwf.d.cts → codec-CWnf8mn_.d.cts} +2 -2
  38. package/dist/{codec-DvcJgYKq.d.cts → codec-CXCjya_G.d.cts} +1 -1
  39. package/dist/{codec-BOyrk_C9.d.cts → codec-Cfo_z5ET.d.cts} +1 -1
  40. package/dist/{codec-v6Vloc7H.d.ts → codec-Cm3D261p.d.ts} +2 -2
  41. package/dist/codec-CwZ6OCPP.d.ts +49 -0
  42. package/dist/{codec-NMsTK0GX.d.cts → codec-Czejcmxr.d.cts} +2 -2
  43. package/dist/{codec-hvkJfCF5.d.cts → codec-DNmiG2e0.d.cts} +2 -2
  44. package/dist/{codec-CWj5iTxA.d.ts → codec-DOmAmFkI.d.ts} +2 -2
  45. package/dist/{codec-WwwUipaU.d.ts → codec-DaXjRrOV.d.ts} +2 -2
  46. package/dist/{codec-DplRgIKq.d.ts → codec-Dl_QIXMz.d.ts} +1 -1
  47. package/dist/{codec-D95gT98n.d.cts → codec-DzkdW4kO.d.cts} +1 -1
  48. package/dist/{codec-cou9XBMF.d.cts → codec-EvybrBuY.d.cts} +2 -2
  49. package/dist/{codec-DL0njGkL.d.ts → codec-alVA27Uc.d.ts} +2 -2
  50. package/dist/{codec-D89DWXbv.d.cts → codec-f7vxeVIS.d.cts} +2 -2
  51. package/dist/{codec-D47r_-Rl.d.ts → codec-gl4_QEva.d.ts} +2 -2
  52. package/dist/{codec-BOtv3R5j.d.cts → codec-guzqtfMk.d.cts} +2 -2
  53. package/dist/draft07-session.d.cts +3 -3
  54. package/dist/draft07-session.d.ts +3 -3
  55. package/dist/draft07.d.cts +3 -3
  56. package/dist/draft07.d.ts +3 -3
  57. package/dist/draft08-session.d.cts +3 -3
  58. package/dist/draft08-session.d.ts +3 -3
  59. package/dist/draft08.d.cts +4 -4
  60. package/dist/draft08.d.ts +4 -4
  61. package/dist/draft09-session.d.cts +3 -3
  62. package/dist/draft09-session.d.ts +3 -3
  63. package/dist/draft09.d.cts +4 -4
  64. package/dist/draft09.d.ts +4 -4
  65. package/dist/draft10-session.d.cts +3 -3
  66. package/dist/draft10-session.d.ts +3 -3
  67. package/dist/draft10.d.cts +4 -4
  68. package/dist/draft10.d.ts +4 -4
  69. package/dist/draft11-session.d.cts +4 -4
  70. package/dist/draft11-session.d.ts +4 -4
  71. package/dist/draft11.cjs +2 -2
  72. package/dist/draft11.d.cts +6 -6
  73. package/dist/draft11.d.ts +6 -6
  74. package/dist/draft11.js +1 -1
  75. package/dist/draft12-session.d.cts +4 -4
  76. package/dist/draft12-session.d.ts +4 -4
  77. package/dist/draft12.cjs +2 -2
  78. package/dist/draft12.d.cts +6 -6
  79. package/dist/draft12.d.ts +6 -6
  80. package/dist/draft12.js +1 -1
  81. package/dist/draft13-session.d.cts +4 -4
  82. package/dist/draft13-session.d.ts +4 -4
  83. package/dist/draft13.cjs +2 -2
  84. package/dist/draft13.d.cts +6 -6
  85. package/dist/draft13.d.ts +6 -6
  86. package/dist/draft13.js +1 -1
  87. package/dist/draft14-session.d.cts +4 -4
  88. package/dist/draft14-session.d.ts +4 -4
  89. package/dist/draft14.cjs +2 -2
  90. package/dist/draft14.d.cts +6 -6
  91. package/dist/draft14.d.ts +6 -6
  92. package/dist/draft14.js +1 -1
  93. package/dist/draft15-session.d.cts +4 -4
  94. package/dist/draft15-session.d.ts +4 -4
  95. package/dist/draft15.cjs +2 -2
  96. package/dist/draft15.d.cts +6 -6
  97. package/dist/draft15.d.ts +6 -6
  98. package/dist/draft15.js +1 -1
  99. package/dist/draft16-session.d.cts +4 -4
  100. package/dist/draft16-session.d.ts +4 -4
  101. package/dist/draft16.cjs +2 -2
  102. package/dist/draft16.d.cts +6 -6
  103. package/dist/draft16.d.ts +6 -6
  104. package/dist/draft16.js +1 -1
  105. package/dist/draft17-session.d.cts +4 -4
  106. package/dist/draft17-session.d.ts +4 -4
  107. package/dist/draft17.cjs +2 -2
  108. package/dist/draft17.d.cts +5 -5
  109. package/dist/draft17.d.ts +5 -5
  110. package/dist/draft17.js +1 -1
  111. package/dist/draft18-session.d.cts +4 -4
  112. package/dist/draft18-session.d.ts +4 -4
  113. package/dist/draft18.cjs +2 -2
  114. package/dist/draft18.d.cts +5 -5
  115. package/dist/draft18.d.ts +5 -5
  116. package/dist/draft18.js +1 -1
  117. package/dist/draft19-session.d.cts +4 -4
  118. package/dist/draft19-session.d.ts +4 -4
  119. package/dist/draft19.cjs +2 -2
  120. package/dist/draft19.d.cts +5 -5
  121. package/dist/draft19.d.ts +5 -5
  122. package/dist/draft19.js +1 -1
  123. package/dist/draft20-session.cjs +8 -0
  124. package/dist/draft20-session.d.cts +195 -0
  125. package/dist/draft20-session.d.ts +195 -0
  126. package/dist/draft20-session.js +8 -0
  127. package/dist/draft20.cjs +217 -0
  128. package/dist/draft20.d.cts +175 -0
  129. package/dist/draft20.d.ts +175 -0
  130. package/dist/draft20.js +217 -0
  131. package/dist/index.cjs +25 -19
  132. package/dist/index.d.cts +41 -26
  133. package/dist/index.d.ts +41 -26
  134. package/dist/index.js +16 -10
  135. package/dist/{session-types-KsqyVp6y.d.cts → session-types-B9idsih-.d.cts} +13 -1
  136. package/dist/{session-types-C0l_-Ups.d.ts → session-types-Dn7b3RZM.d.ts} +13 -1
  137. package/dist/session.cjs +5 -1
  138. package/dist/session.d.cts +14 -12
  139. package/dist/session.d.ts +14 -12
  140. package/dist/session.js +5 -1
  141. package/dist/{types-Cqp10JtB.d.cts → types-Bg86GGVZ.d.cts} +2 -2
  142. package/dist/{types-Cqp10JtB.d.ts → types-Bg86GGVZ.d.ts} +2 -2
  143. package/dist/{types-zHgCS6o5.d.cts → types-C1rxh-id.d.cts} +7 -7
  144. package/dist/{types-zHgCS6o5.d.ts → types-C1rxh-id.d.ts} +7 -7
  145. package/dist/{types-Bio-91Rt.d.cts → types-CI_SX4Xe.d.cts} +2 -2
  146. package/dist/{types-Bio-91Rt.d.ts → types-CI_SX4Xe.d.ts} +2 -2
  147. package/dist/types-CY-QWxd-.d.cts +359 -0
  148. package/dist/types-CY-QWxd-.d.ts +359 -0
  149. package/dist/{types-Cm9fjeYC.d.cts → types-CZTzbIzQ.d.cts} +2 -2
  150. package/dist/{types-Cm9fjeYC.d.ts → types-CZTzbIzQ.d.ts} +2 -2
  151. package/dist/{types-HI_bbXka.d.cts → types-CmqT0jUf.d.cts} +1 -1
  152. package/dist/{types-HI_bbXka.d.ts → types-CmqT0jUf.d.ts} +1 -1
  153. package/dist/{types-Ck45Ex5S.d.cts → types-D0kTgUuL.d.cts} +1 -1
  154. package/dist/{types-Ck45Ex5S.d.ts → types-D0kTgUuL.d.ts} +1 -1
  155. package/dist/{types-D9eiB_9A.d.cts → types-D4bmW8rY.d.cts} +2 -2
  156. package/dist/{types-D9eiB_9A.d.ts → types-D4bmW8rY.d.ts} +2 -2
  157. package/dist/{types-CdCSIfvI.d.cts → types-DG5_iKuv.d.cts} +1 -1
  158. package/dist/{types-CdCSIfvI.d.ts → types-DG5_iKuv.d.ts} +1 -1
  159. package/dist/{types-CXlSn0I9.d.cts → types-DjxexghA.d.cts} +2 -2
  160. package/dist/{types-CXlSn0I9.d.ts → types-DjxexghA.d.ts} +2 -2
  161. package/dist/{types-CPaYBsMG.d.cts → types-pShrs3fN.d.cts} +2 -2
  162. package/dist/{types-CPaYBsMG.d.ts → types-pShrs3fN.d.ts} +2 -2
  163. package/package.json +16 -3
  164. package/src/core/session-types.ts +7 -0
  165. package/src/core/types.ts +1 -0
  166. package/src/drafts/draft11/codec.ts +11 -8
  167. package/src/drafts/draft11/types.ts +1 -1
  168. package/src/drafts/draft12/codec.ts +22 -16
  169. package/src/drafts/draft12/types.ts +2 -2
  170. package/src/drafts/draft13/codec.ts +14 -8
  171. package/src/drafts/draft13/types.ts +2 -2
  172. package/src/drafts/draft14/codec.ts +14 -8
  173. package/src/drafts/draft14/types.ts +1 -1
  174. package/src/drafts/draft15/codec.ts +14 -8
  175. package/src/drafts/draft15/types.ts +2 -2
  176. package/src/drafts/draft16/codec.ts +13 -7
  177. package/src/drafts/draft16/types.ts +2 -2
  178. package/src/drafts/draft17/codec.ts +12 -6
  179. package/src/drafts/draft17/types.ts +2 -2
  180. package/src/drafts/draft18/codec.ts +12 -6
  181. package/src/drafts/draft18/types.ts +2 -2
  182. package/src/drafts/draft19/codec.ts +37 -23
  183. package/src/drafts/draft19/types.ts +10 -7
  184. package/src/drafts/draft20/codec.ts +1749 -0
  185. package/src/drafts/draft20/data-streams.ts +1291 -0
  186. package/src/drafts/draft20/error-codes.ts +135 -0
  187. package/src/drafts/draft20/index.ts +165 -0
  188. package/src/drafts/draft20/messages.ts +68 -0
  189. package/src/drafts/draft20/rules.ts +107 -0
  190. package/src/drafts/draft20/session-fsm.ts +1063 -0
  191. package/src/drafts/draft20/session.ts +21 -0
  192. package/src/drafts/draft20/types.ts +461 -0
  193. package/src/index.ts +20 -2
  194. package/src/session.ts +4 -0
@@ -0,0 +1,175 @@
1
+ export { D as Draft20Codec, U as UNKNOWN_STREAM_COUNT, c as createDraft20Codec, a as createStreamDecoder, d as decodeMessage, e as encodeMessage } from './codec-CFWu5KVT.cjs';
2
+ import { b as DataStreamEvent, F as FetchStreamHeader, O as ObjectPayload, S as SubgroupStreamHeader, c as Draft20DataStream, d as DatagramObject, e as FetchStream, f as SubgroupStream, a as Draft20MessageType } from './types-CY-QWxd-.cjs';
3
+ export { g as DataStreamHeader, h as Draft20BaseMessage, i as Draft20Fetch, j as Draft20FetchOk, k as Draft20FillParameters, l as Draft20GoAway, D as Draft20Message, m as Draft20Namespace, n as Draft20NamespaceDone, o as Draft20Params, p as Draft20Publish, q as Draft20PublishDone, r as Draft20PublishNamespace, s as Draft20PublishSkipped, t as Draft20PublishStateNotify, u as Draft20RequestError, v as Draft20RequestOk, w as Draft20RequestUpdate, x as Draft20Setup, y as Draft20SetupOptions, z as Draft20Subscribe, A as Draft20SubscribeNamespace, B as Draft20SubscribeOk, C as Draft20SubscribeTracks, E as Draft20TrackProperties, G as Draft20TrackStatus, H as FetchObjectPayload, L as LargestObject, I as LocationFilter, R as RangeFilter, J as RangeFilterRange, K as Redirect, U as UnknownParam } from './types-CY-QWxd-.cjs';
4
+ export { Draft20SessionFSM, FillFetchStreamPhase, FillFetchStreamState, PublisherSide, RequestKind, createDraft20SessionState } from './draft20-session.cjs';
5
+ export { P as ProtocolViolation, g as SessionPhase, h as SideEffect, T as TransitionResult, V as ValidationResult } from './session-types-B9idsih-.cjs';
6
+ import { b as DecodeResult } from './types-DG5_iKuv.cjs';
7
+
8
+ declare function encodeSubgroupStream(stream: SubgroupStream): Uint8Array;
9
+ declare function encodeDatagram(dg: DatagramObject): Uint8Array;
10
+ declare function encodeFetchStream(stream: FetchStream): Uint8Array;
11
+ declare function decodeSubgroupStream(bytes: Uint8Array): DecodeResult<SubgroupStream>;
12
+ declare function decodeDatagram(bytes: Uint8Array): DecodeResult<DatagramObject>;
13
+ declare function decodeFetchStream(bytes: Uint8Array): DecodeResult<FetchStream>;
14
+ declare function decodeDataStream(streamType: 'subgroup' | 'datagram' | 'fetch', bytes: Uint8Array): DecodeResult<Draft20DataStream>;
15
+ declare function createSubgroupStreamDecoder(): TransformStream<Uint8Array, SubgroupStreamHeader | ObjectPayload>;
16
+ declare function createFetchStreamDecoder(): TransformStream<Uint8Array, FetchStreamHeader | ObjectPayload>;
17
+ declare function createDataStreamDecoder(): TransformStream<Uint8Array, DataStreamEvent>;
18
+
19
+ /** draft-20 Section 15.11.1, Table 18 (prose Section 3.5). */
20
+ declare const SessionTerminationCode: {
21
+ readonly NoError: 0n;
22
+ readonly InternalError: 1n;
23
+ readonly Unauthorized: 2n;
24
+ readonly ProtocolViolation: 3n;
25
+ readonly InvalidRequestId: 4n;
26
+ readonly DuplicateTrackAlias: 5n;
27
+ readonly KeyValueFormattingError: 6n;
28
+ readonly InvalidPath: 8n;
29
+ readonly MalformedPath: 9n;
30
+ readonly GoawayTimeout: 16n;
31
+ readonly ControlMessageTimeout: 17n;
32
+ readonly DataStreamTimeout: 18n;
33
+ readonly AuthTokenCacheOverflow: 19n;
34
+ readonly DuplicateAuthTokenAlias: 20n;
35
+ readonly MalformedAuthToken: 22n;
36
+ readonly UnknownAuthTokenAlias: 23n;
37
+ readonly ExpiredAuthToken: 24n;
38
+ readonly InvalidAuthority: 25n;
39
+ readonly MalformedAuthority: 26n;
40
+ readonly TooManyRequestUpdates: 27n;
41
+ };
42
+ type SessionTerminationCodeValue = (typeof SessionTerminationCode)[keyof typeof SessionTerminationCode];
43
+ /** draft-20 Section 15.11.2, Table 19 (prose Section 10.6.2). */
44
+ declare const RequestErrorCode: {
45
+ readonly InternalError: 0n;
46
+ readonly Unauthorized: 1n;
47
+ readonly Timeout: 2n;
48
+ readonly NotSupported: 3n;
49
+ readonly MalformedAuthToken: 4n;
50
+ readonly ExpiredAuthToken: 5n;
51
+ readonly GoingAway: 6n;
52
+ readonly ExcessiveLoad: 9n;
53
+ readonly DoesNotExist: 16n;
54
+ readonly InvalidRange: 17n;
55
+ readonly MalformedTrack: 18n;
56
+ readonly Uninterested: 32n;
57
+ readonly PrefixOverlap: 48n;
58
+ readonly NamespaceTooLarge: 49n;
59
+ readonly UnsupportedExtension: 51n;
60
+ readonly Redirect: 52n;
61
+ readonly ConflictingFilters: 53n;
62
+ readonly InvalidFilter: 54n;
63
+ };
64
+ type RequestErrorCodeValue = (typeof RequestErrorCode)[keyof typeof RequestErrorCode];
65
+ /** draft-20 Section 15.11.3, Table 20 (prose Section 10.12). */
66
+ declare const PublishDoneCode: {
67
+ readonly InternalError: 0n;
68
+ readonly Unauthorized: 1n;
69
+ readonly TrackEnded: 2n;
70
+ readonly GoingAway: 4n;
71
+ readonly TooFarBehind: 5n;
72
+ readonly Expired: 6n;
73
+ readonly UpdateFailed: 8n;
74
+ readonly ExcessiveLoad: 9n;
75
+ readonly MalformedTrack: 18n;
76
+ };
77
+ type PublishDoneCodeValue = (typeof PublishDoneCode)[keyof typeof PublishDoneCode];
78
+ /** draft-20 Section 15.11.4, Table 21 (prose Section 3.3.4) — unchanged from draft-19. */
79
+ declare const DataStreamResetCode: {
80
+ readonly InternalError: 0n;
81
+ readonly Cancelled: 1n;
82
+ readonly DeliveryTimeout: 2n;
83
+ readonly SessionClosed: 3n;
84
+ readonly GoingAway: 4n;
85
+ readonly TooFarBehind: 5n;
86
+ readonly UnknownObjectStatus: 6n;
87
+ readonly ExpiredAuthToken: 7n;
88
+ readonly ExcessiveLoad: 9n;
89
+ readonly MalformedTrack: 18n;
90
+ };
91
+ type DataStreamResetCodeValue = (typeof DataStreamResetCode)[keyof typeof DataStreamResetCode];
92
+ declare const RETIRED_SESSION_TERMINATION_CODES: ReadonlySet<bigint>;
93
+ declare const RETIRED_REQUEST_ERROR_CODES: ReadonlySet<bigint>;
94
+ declare const RETIRED_PUBLISH_DONE_CODES: ReadonlySet<bigint>;
95
+
96
+ declare const MSG_REQUEST_UPDATE = 2n;
97
+ declare const MSG_SUBSCRIBE = 3n;
98
+ declare const MSG_SUBSCRIBE_OK = 4n;
99
+ declare const MSG_REQUEST_ERROR = 5n;
100
+ declare const MSG_PUBLISH_NAMESPACE = 6n;
101
+ declare const MSG_REQUEST_OK = 7n;
102
+ declare const MSG_NAMESPACE = 8n;
103
+ declare const MSG_PUBLISH_DONE = 11n;
104
+ declare const MSG_TRACK_STATUS = 13n;
105
+ declare const MSG_NAMESPACE_DONE = 14n;
106
+ declare const MSG_PUBLISH_SKIPPED = 15n;
107
+ declare const MSG_GOAWAY = 16n;
108
+ declare const MSG_FETCH = 22n;
109
+ declare const MSG_FETCH_OK = 24n;
110
+ declare const MSG_PUBLISH = 29n;
111
+ /** NEW in draft-20 — Section 10.10. Unilateral publisher→subscriber notification. */
112
+ declare const MSG_PUBLISH_STATE_NOTIFY = 34n;
113
+ declare const MSG_PUBLISH_OK = 7n;
114
+ declare const MSG_SUBSCRIBE_NAMESPACE = 80n;
115
+ declare const MSG_SUBSCRIBE_TRACKS = 81n;
116
+ declare const MSG_SETUP = 12032n;
117
+ declare const SETUP_OPT_PATH = 1n;
118
+ declare const SETUP_OPT_AUTHORIZATION_TOKEN = 3n;
119
+ declare const SETUP_OPT_MAX_AUTH_TOKEN_CACHE_SIZE = 4n;
120
+ declare const SETUP_OPT_AUTHORITY = 5n;
121
+ declare const SETUP_OPT_MAX_FILTER_RANGES = 6n;
122
+ declare const SETUP_OPT_MOQT_IMPLEMENTATION = 7n;
123
+ declare const SETUP_OPT_MAX_REQUEST_UPDATES = 8n;
124
+ declare const MESSAGE_TYPE_MAP: ReadonlyMap<bigint, string>;
125
+ declare const MESSAGE_ID_MAP: ReadonlyMap<string, bigint>;
126
+
127
+ declare const CONTROL_MESSAGES: ReadonlySet<Draft20MessageType>;
128
+ declare const CLIENT_ONLY_MESSAGES: ReadonlySet<Draft20MessageType>;
129
+ declare const SERVER_ONLY_MESSAGES: ReadonlySet<Draft20MessageType>;
130
+ declare const BIDIRECTIONAL_MESSAGES: ReadonlySet<Draft20MessageType>;
131
+ /**
132
+ * The seven message types that may be the FIRST message on a new bidirectional
133
+ * (request) stream — draft-20 Section 3.3, and the rows marked "First" in the
134
+ * Section 10 registry. Unchanged from draft-19.
135
+ *
136
+ * "Bidirectional streams MUST NOT begin with any other message type unless
137
+ * negotiated. If they do, the peer MUST close the Session with a
138
+ * PROTOCOL_VIOLATION." Note GOAWAY (0x10) is marked "Control, Request" but not
139
+ * "First": it may travel on either kind of stream but may never open one.
140
+ */
141
+ declare const REQUEST_STREAM_OPENERS: ReadonlySet<Draft20MessageType>;
142
+ declare function getLegalOutgoing(phase: string, _role: 'client' | 'server'): Set<Draft20MessageType>;
143
+ declare function getLegalIncoming(phase: string, role: 'client' | 'server'): Set<Draft20MessageType>;
144
+
145
+ /**
146
+ * Draft-20's real identifier is the protocol string `moqt-20`.
147
+ *
148
+ * draft-20 Section 3.1: "MOQT uses ALPN in QUIC and 'WT-Available-Protocols' in
149
+ * WebTransport to perform version negotiation. […] ALPNs used to identify IETF
150
+ * drafts are created by appending the draft number to 'moqt-'. […] Note: Draft
151
+ * versions prior to -15 all used moq-00 ALPN, followed by version negotiation
152
+ * in the SETUP messages."
153
+ *
154
+ * So this is what a draft-20 peer actually negotiates with, and it is the only
155
+ * identifier that appears anywhere in a draft-20 session.
156
+ */
157
+ declare const PROTOCOL_STRING = "moqt-20";
158
+ /**
159
+ * The `0xff000000 + N` identifier for draft 20.
160
+ *
161
+ * **This is a derived identifier, not an observed wire value.** No draft-20
162
+ * peer ever sends it. The `0xff0000NN` scheme belonged to the SETUP-time
163
+ * version negotiation that drafts before -15 used; from draft-15 on the version
164
+ * is negotiated by ALPN / `WT-Available-Protocols` and no version number
165
+ * appears on the wire at all. It is kept only so that code indexing drafts by a
166
+ * numeric key — {@link DRAFT_VERSIONS} in the package root, trace formats,
167
+ * anything that predates the change — has a stable key for draft-20.
168
+ *
169
+ * Anything that reports a version to a user should report
170
+ * {@link PROTOCOL_STRING} instead, and should not claim to have observed this
171
+ * number.
172
+ */
173
+ declare const DRAFT_VERSION = 4278190100n;
174
+
175
+ export { BIDIRECTIONAL_MESSAGES, CLIENT_ONLY_MESSAGES, CONTROL_MESSAGES, DRAFT_VERSION, DataStreamEvent, DataStreamResetCode, type DataStreamResetCodeValue, DatagramObject, Draft20DataStream, Draft20MessageType, 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,175 @@
1
+ export { D as Draft20Codec, U as UNKNOWN_STREAM_COUNT, c as createDraft20Codec, a as createStreamDecoder, d as decodeMessage, e as encodeMessage } from './codec-CwZ6OCPP.js';
2
+ import { b as DataStreamEvent, F as FetchStreamHeader, O as ObjectPayload, S as SubgroupStreamHeader, c as Draft20DataStream, d as DatagramObject, e as FetchStream, f as SubgroupStream, a as Draft20MessageType } from './types-CY-QWxd-.js';
3
+ export { g as DataStreamHeader, h as Draft20BaseMessage, i as Draft20Fetch, j as Draft20FetchOk, k as Draft20FillParameters, l as Draft20GoAway, D as Draft20Message, m as Draft20Namespace, n as Draft20NamespaceDone, o as Draft20Params, p as Draft20Publish, q as Draft20PublishDone, r as Draft20PublishNamespace, s as Draft20PublishSkipped, t as Draft20PublishStateNotify, u as Draft20RequestError, v as Draft20RequestOk, w as Draft20RequestUpdate, x as Draft20Setup, y as Draft20SetupOptions, z as Draft20Subscribe, A as Draft20SubscribeNamespace, B as Draft20SubscribeOk, C as Draft20SubscribeTracks, E as Draft20TrackProperties, G as Draft20TrackStatus, H as FetchObjectPayload, L as LargestObject, I as LocationFilter, R as RangeFilter, J as RangeFilterRange, K as Redirect, U as UnknownParam } from './types-CY-QWxd-.js';
4
+ export { Draft20SessionFSM, FillFetchStreamPhase, FillFetchStreamState, PublisherSide, RequestKind, createDraft20SessionState } from './draft20-session.js';
5
+ export { P as ProtocolViolation, g as SessionPhase, h as SideEffect, T as TransitionResult, V as ValidationResult } from './session-types-Dn7b3RZM.js';
6
+ import { b as DecodeResult } from './types-DG5_iKuv.js';
7
+
8
+ declare function encodeSubgroupStream(stream: SubgroupStream): Uint8Array;
9
+ declare function encodeDatagram(dg: DatagramObject): Uint8Array;
10
+ declare function encodeFetchStream(stream: FetchStream): Uint8Array;
11
+ declare function decodeSubgroupStream(bytes: Uint8Array): DecodeResult<SubgroupStream>;
12
+ declare function decodeDatagram(bytes: Uint8Array): DecodeResult<DatagramObject>;
13
+ declare function decodeFetchStream(bytes: Uint8Array): DecodeResult<FetchStream>;
14
+ declare function decodeDataStream(streamType: 'subgroup' | 'datagram' | 'fetch', bytes: Uint8Array): DecodeResult<Draft20DataStream>;
15
+ declare function createSubgroupStreamDecoder(): TransformStream<Uint8Array, SubgroupStreamHeader | ObjectPayload>;
16
+ declare function createFetchStreamDecoder(): TransformStream<Uint8Array, FetchStreamHeader | ObjectPayload>;
17
+ declare function createDataStreamDecoder(): TransformStream<Uint8Array, DataStreamEvent>;
18
+
19
+ /** draft-20 Section 15.11.1, Table 18 (prose Section 3.5). */
20
+ declare const SessionTerminationCode: {
21
+ readonly NoError: 0n;
22
+ readonly InternalError: 1n;
23
+ readonly Unauthorized: 2n;
24
+ readonly ProtocolViolation: 3n;
25
+ readonly InvalidRequestId: 4n;
26
+ readonly DuplicateTrackAlias: 5n;
27
+ readonly KeyValueFormattingError: 6n;
28
+ readonly InvalidPath: 8n;
29
+ readonly MalformedPath: 9n;
30
+ readonly GoawayTimeout: 16n;
31
+ readonly ControlMessageTimeout: 17n;
32
+ readonly DataStreamTimeout: 18n;
33
+ readonly AuthTokenCacheOverflow: 19n;
34
+ readonly DuplicateAuthTokenAlias: 20n;
35
+ readonly MalformedAuthToken: 22n;
36
+ readonly UnknownAuthTokenAlias: 23n;
37
+ readonly ExpiredAuthToken: 24n;
38
+ readonly InvalidAuthority: 25n;
39
+ readonly MalformedAuthority: 26n;
40
+ readonly TooManyRequestUpdates: 27n;
41
+ };
42
+ type SessionTerminationCodeValue = (typeof SessionTerminationCode)[keyof typeof SessionTerminationCode];
43
+ /** draft-20 Section 15.11.2, Table 19 (prose Section 10.6.2). */
44
+ declare const RequestErrorCode: {
45
+ readonly InternalError: 0n;
46
+ readonly Unauthorized: 1n;
47
+ readonly Timeout: 2n;
48
+ readonly NotSupported: 3n;
49
+ readonly MalformedAuthToken: 4n;
50
+ readonly ExpiredAuthToken: 5n;
51
+ readonly GoingAway: 6n;
52
+ readonly ExcessiveLoad: 9n;
53
+ readonly DoesNotExist: 16n;
54
+ readonly InvalidRange: 17n;
55
+ readonly MalformedTrack: 18n;
56
+ readonly Uninterested: 32n;
57
+ readonly PrefixOverlap: 48n;
58
+ readonly NamespaceTooLarge: 49n;
59
+ readonly UnsupportedExtension: 51n;
60
+ readonly Redirect: 52n;
61
+ readonly ConflictingFilters: 53n;
62
+ readonly InvalidFilter: 54n;
63
+ };
64
+ type RequestErrorCodeValue = (typeof RequestErrorCode)[keyof typeof RequestErrorCode];
65
+ /** draft-20 Section 15.11.3, Table 20 (prose Section 10.12). */
66
+ declare const PublishDoneCode: {
67
+ readonly InternalError: 0n;
68
+ readonly Unauthorized: 1n;
69
+ readonly TrackEnded: 2n;
70
+ readonly GoingAway: 4n;
71
+ readonly TooFarBehind: 5n;
72
+ readonly Expired: 6n;
73
+ readonly UpdateFailed: 8n;
74
+ readonly ExcessiveLoad: 9n;
75
+ readonly MalformedTrack: 18n;
76
+ };
77
+ type PublishDoneCodeValue = (typeof PublishDoneCode)[keyof typeof PublishDoneCode];
78
+ /** draft-20 Section 15.11.4, Table 21 (prose Section 3.3.4) — unchanged from draft-19. */
79
+ declare const DataStreamResetCode: {
80
+ readonly InternalError: 0n;
81
+ readonly Cancelled: 1n;
82
+ readonly DeliveryTimeout: 2n;
83
+ readonly SessionClosed: 3n;
84
+ readonly GoingAway: 4n;
85
+ readonly TooFarBehind: 5n;
86
+ readonly UnknownObjectStatus: 6n;
87
+ readonly ExpiredAuthToken: 7n;
88
+ readonly ExcessiveLoad: 9n;
89
+ readonly MalformedTrack: 18n;
90
+ };
91
+ type DataStreamResetCodeValue = (typeof DataStreamResetCode)[keyof typeof DataStreamResetCode];
92
+ declare const RETIRED_SESSION_TERMINATION_CODES: ReadonlySet<bigint>;
93
+ declare const RETIRED_REQUEST_ERROR_CODES: ReadonlySet<bigint>;
94
+ declare const RETIRED_PUBLISH_DONE_CODES: ReadonlySet<bigint>;
95
+
96
+ declare const MSG_REQUEST_UPDATE = 2n;
97
+ declare const MSG_SUBSCRIBE = 3n;
98
+ declare const MSG_SUBSCRIBE_OK = 4n;
99
+ declare const MSG_REQUEST_ERROR = 5n;
100
+ declare const MSG_PUBLISH_NAMESPACE = 6n;
101
+ declare const MSG_REQUEST_OK = 7n;
102
+ declare const MSG_NAMESPACE = 8n;
103
+ declare const MSG_PUBLISH_DONE = 11n;
104
+ declare const MSG_TRACK_STATUS = 13n;
105
+ declare const MSG_NAMESPACE_DONE = 14n;
106
+ declare const MSG_PUBLISH_SKIPPED = 15n;
107
+ declare const MSG_GOAWAY = 16n;
108
+ declare const MSG_FETCH = 22n;
109
+ declare const MSG_FETCH_OK = 24n;
110
+ declare const MSG_PUBLISH = 29n;
111
+ /** NEW in draft-20 — Section 10.10. Unilateral publisher→subscriber notification. */
112
+ declare const MSG_PUBLISH_STATE_NOTIFY = 34n;
113
+ declare const MSG_PUBLISH_OK = 7n;
114
+ declare const MSG_SUBSCRIBE_NAMESPACE = 80n;
115
+ declare const MSG_SUBSCRIBE_TRACKS = 81n;
116
+ declare const MSG_SETUP = 12032n;
117
+ declare const SETUP_OPT_PATH = 1n;
118
+ declare const SETUP_OPT_AUTHORIZATION_TOKEN = 3n;
119
+ declare const SETUP_OPT_MAX_AUTH_TOKEN_CACHE_SIZE = 4n;
120
+ declare const SETUP_OPT_AUTHORITY = 5n;
121
+ declare const SETUP_OPT_MAX_FILTER_RANGES = 6n;
122
+ declare const SETUP_OPT_MOQT_IMPLEMENTATION = 7n;
123
+ declare const SETUP_OPT_MAX_REQUEST_UPDATES = 8n;
124
+ declare const MESSAGE_TYPE_MAP: ReadonlyMap<bigint, string>;
125
+ declare const MESSAGE_ID_MAP: ReadonlyMap<string, bigint>;
126
+
127
+ declare const CONTROL_MESSAGES: ReadonlySet<Draft20MessageType>;
128
+ declare const CLIENT_ONLY_MESSAGES: ReadonlySet<Draft20MessageType>;
129
+ declare const SERVER_ONLY_MESSAGES: ReadonlySet<Draft20MessageType>;
130
+ declare const BIDIRECTIONAL_MESSAGES: ReadonlySet<Draft20MessageType>;
131
+ /**
132
+ * The seven message types that may be the FIRST message on a new bidirectional
133
+ * (request) stream — draft-20 Section 3.3, and the rows marked "First" in the
134
+ * Section 10 registry. Unchanged from draft-19.
135
+ *
136
+ * "Bidirectional streams MUST NOT begin with any other message type unless
137
+ * negotiated. If they do, the peer MUST close the Session with a
138
+ * PROTOCOL_VIOLATION." Note GOAWAY (0x10) is marked "Control, Request" but not
139
+ * "First": it may travel on either kind of stream but may never open one.
140
+ */
141
+ declare const REQUEST_STREAM_OPENERS: ReadonlySet<Draft20MessageType>;
142
+ declare function getLegalOutgoing(phase: string, _role: 'client' | 'server'): Set<Draft20MessageType>;
143
+ declare function getLegalIncoming(phase: string, role: 'client' | 'server'): Set<Draft20MessageType>;
144
+
145
+ /**
146
+ * Draft-20's real identifier is the protocol string `moqt-20`.
147
+ *
148
+ * draft-20 Section 3.1: "MOQT uses ALPN in QUIC and 'WT-Available-Protocols' in
149
+ * WebTransport to perform version negotiation. […] ALPNs used to identify IETF
150
+ * drafts are created by appending the draft number to 'moqt-'. […] Note: Draft
151
+ * versions prior to -15 all used moq-00 ALPN, followed by version negotiation
152
+ * in the SETUP messages."
153
+ *
154
+ * So this is what a draft-20 peer actually negotiates with, and it is the only
155
+ * identifier that appears anywhere in a draft-20 session.
156
+ */
157
+ declare const PROTOCOL_STRING = "moqt-20";
158
+ /**
159
+ * The `0xff000000 + N` identifier for draft 20.
160
+ *
161
+ * **This is a derived identifier, not an observed wire value.** No draft-20
162
+ * peer ever sends it. The `0xff0000NN` scheme belonged to the SETUP-time
163
+ * version negotiation that drafts before -15 used; from draft-15 on the version
164
+ * is negotiated by ALPN / `WT-Available-Protocols` and no version number
165
+ * appears on the wire at all. It is kept only so that code indexing drafts by a
166
+ * numeric key — {@link DRAFT_VERSIONS} in the package root, trace formats,
167
+ * anything that predates the change — has a stable key for draft-20.
168
+ *
169
+ * Anything that reports a version to a user should report
170
+ * {@link PROTOCOL_STRING} instead, and should not claim to have observed this
171
+ * number.
172
+ */
173
+ declare const DRAFT_VERSION = 4278190100n;
174
+
175
+ export { BIDIRECTIONAL_MESSAGES, CLIENT_ONLY_MESSAGES, CONTROL_MESSAGES, DRAFT_VERSION, DataStreamEvent, DataStreamResetCode, type DataStreamResetCodeValue, DatagramObject, Draft20DataStream, Draft20MessageType, 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,217 @@
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
+ createDraft20Codec,
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
+ } from "./chunk-FT3HDNIB.js";
47
+ import {
48
+ BIDIRECTIONAL_MESSAGES,
49
+ CLIENT_ONLY_MESSAGES,
50
+ CONTROL_MESSAGES,
51
+ Draft20SessionFSM,
52
+ REQUEST_STREAM_OPENERS,
53
+ SERVER_ONLY_MESSAGES,
54
+ createDraft20SessionState,
55
+ getLegalIncoming,
56
+ getLegalOutgoing
57
+ } from "./chunk-WX5PU7HF.js";
58
+ import "./chunk-KLPWJU6W.js";
59
+
60
+ // src/drafts/draft20/error-codes.ts
61
+ var SessionTerminationCode = {
62
+ NoError: 0x0n,
63
+ InternalError: 0x1n,
64
+ Unauthorized: 0x2n,
65
+ ProtocolViolation: 0x3n,
66
+ InvalidRequestId: 0x4n,
67
+ DuplicateTrackAlias: 0x5n,
68
+ KeyValueFormattingError: 0x6n,
69
+ InvalidPath: 0x8n,
70
+ MalformedPath: 0x9n,
71
+ GoawayTimeout: 0x10n,
72
+ ControlMessageTimeout: 0x11n,
73
+ DataStreamTimeout: 0x12n,
74
+ AuthTokenCacheOverflow: 0x13n,
75
+ DuplicateAuthTokenAlias: 0x14n,
76
+ // 0x15 VERSION_NEGOTIATION_FAILED — REMOVED in draft-20. Version negotiation
77
+ // moved to ALPN / WT-Available-Protocols in draft-15, so there is no longer a
78
+ // SETUP-time negotiation that can fail. See RETIRED_SESSION_TERMINATION_CODES.
79
+ MalformedAuthToken: 0x16n,
80
+ UnknownAuthTokenAlias: 0x17n,
81
+ ExpiredAuthToken: 0x18n,
82
+ InvalidAuthority: 0x19n,
83
+ MalformedAuthority: 0x1an,
84
+ TooManyRequestUpdates: 0x1bn
85
+ };
86
+ var RequestErrorCode = {
87
+ InternalError: 0x0n,
88
+ Unauthorized: 0x1n,
89
+ Timeout: 0x2n,
90
+ NotSupported: 0x3n,
91
+ MalformedAuthToken: 0x4n,
92
+ ExpiredAuthToken: 0x5n,
93
+ GoingAway: 0x6n,
94
+ ExcessiveLoad: 0x9n,
95
+ DoesNotExist: 0x10n,
96
+ InvalidRange: 0x11n,
97
+ MalformedTrack: 0x12n,
98
+ Uninterested: 0x20n,
99
+ PrefixOverlap: 0x30n,
100
+ NamespaceTooLarge: 0x31n,
101
+ // 0x32 INVALID_JOINING_REQUEST_ID — REMOVED in draft-20 along with the whole
102
+ // joining-fetch mechanism (draft-19 Section 10.12.2). A draft-20 FETCH names
103
+ // its own track inline and never references another request, so there is no
104
+ // joining Request ID left to be invalid. See RETIRED_REQUEST_ERROR_CODES.
105
+ UnsupportedExtension: 0x33n,
106
+ Redirect: 0x34n,
107
+ ConflictingFilters: 0x35n,
108
+ InvalidFilter: 0x36n
109
+ };
110
+ var PublishDoneCode = {
111
+ InternalError: 0x0n,
112
+ Unauthorized: 0x1n,
113
+ TrackEnded: 0x2n,
114
+ // 0x3 SUBSCRIPTION_ENDED — REMOVED in draft-20. The behaviour went with it:
115
+ // Section 5.1.2 now says "A publisher does not end a subscription solely
116
+ // because the Largest Object advances past the end of the current Location
117
+ // Filter", which is the only thing this code used to report.
118
+ // See RETIRED_PUBLISH_DONE_CODES.
119
+ GoingAway: 0x4n,
120
+ TooFarBehind: 0x5n,
121
+ Expired: 0x6n,
122
+ UpdateFailed: 0x8n,
123
+ ExcessiveLoad: 0x9n,
124
+ MalformedTrack: 0x12n
125
+ };
126
+ var DataStreamResetCode = {
127
+ InternalError: 0x0n,
128
+ Cancelled: 0x1n,
129
+ DeliveryTimeout: 0x2n,
130
+ SessionClosed: 0x3n,
131
+ GoingAway: 0x4n,
132
+ TooFarBehind: 0x5n,
133
+ UnknownObjectStatus: 0x6n,
134
+ ExpiredAuthToken: 0x7n,
135
+ ExcessiveLoad: 0x9n,
136
+ MalformedTrack: 0x12n
137
+ };
138
+ var RETIRED_SESSION_TERMINATION_CODES = /* @__PURE__ */ new Set([
139
+ 0x15n
140
+ // VERSION_NEGOTIATION_FAILED (draft-19 Section 3.5)
141
+ ]);
142
+ var RETIRED_REQUEST_ERROR_CODES = /* @__PURE__ */ new Set([
143
+ 0x32n
144
+ // INVALID_JOINING_REQUEST_ID (draft-19 Section 10.6.2)
145
+ ]);
146
+ var RETIRED_PUBLISH_DONE_CODES = /* @__PURE__ */ new Set([
147
+ 0x3n
148
+ // SUBSCRIPTION_ENDED (draft-19 Section 10.11)
149
+ ]);
150
+
151
+ // src/drafts/draft20/index.ts
152
+ var PROTOCOL_STRING = "moqt-20";
153
+ var DRAFT_VERSION = 0xff000014n;
154
+ export {
155
+ BIDIRECTIONAL_MESSAGES,
156
+ CLIENT_ONLY_MESSAGES,
157
+ CONTROL_MESSAGES,
158
+ DRAFT_VERSION,
159
+ DataStreamResetCode,
160
+ Draft20SessionFSM,
161
+ MESSAGE_ID_MAP,
162
+ MESSAGE_TYPE_MAP,
163
+ MSG_FETCH,
164
+ MSG_FETCH_OK,
165
+ MSG_GOAWAY,
166
+ MSG_NAMESPACE,
167
+ MSG_NAMESPACE_DONE,
168
+ MSG_PUBLISH,
169
+ MSG_PUBLISH_DONE,
170
+ MSG_PUBLISH_NAMESPACE,
171
+ MSG_PUBLISH_OK,
172
+ MSG_PUBLISH_SKIPPED,
173
+ MSG_PUBLISH_STATE_NOTIFY,
174
+ MSG_REQUEST_ERROR,
175
+ MSG_REQUEST_OK,
176
+ MSG_REQUEST_UPDATE,
177
+ MSG_SETUP,
178
+ MSG_SUBSCRIBE,
179
+ MSG_SUBSCRIBE_NAMESPACE,
180
+ MSG_SUBSCRIBE_OK,
181
+ MSG_SUBSCRIBE_TRACKS,
182
+ MSG_TRACK_STATUS,
183
+ PROTOCOL_STRING,
184
+ PublishDoneCode,
185
+ REQUEST_STREAM_OPENERS,
186
+ RETIRED_PUBLISH_DONE_CODES,
187
+ RETIRED_REQUEST_ERROR_CODES,
188
+ RETIRED_SESSION_TERMINATION_CODES,
189
+ RequestErrorCode,
190
+ SERVER_ONLY_MESSAGES,
191
+ SETUP_OPT_AUTHORITY,
192
+ SETUP_OPT_AUTHORIZATION_TOKEN,
193
+ SETUP_OPT_MAX_AUTH_TOKEN_CACHE_SIZE,
194
+ SETUP_OPT_MAX_FILTER_RANGES,
195
+ SETUP_OPT_MAX_REQUEST_UPDATES,
196
+ SETUP_OPT_MOQT_IMPLEMENTATION,
197
+ SETUP_OPT_PATH,
198
+ SessionTerminationCode,
199
+ UNKNOWN_STREAM_COUNT,
200
+ createDataStreamDecoder,
201
+ createDraft20Codec,
202
+ createDraft20SessionState,
203
+ createFetchStreamDecoder,
204
+ createStreamDecoder,
205
+ createSubgroupStreamDecoder,
206
+ decodeDataStream,
207
+ decodeDatagram,
208
+ decodeFetchStream,
209
+ decodeMessage,
210
+ decodeSubgroupStream,
211
+ encodeDatagram,
212
+ encodeFetchStream,
213
+ encodeMessage,
214
+ encodeSubgroupStream,
215
+ getLegalIncoming,
216
+ getLegalOutgoing
217
+ };
package/dist/index.cjs CHANGED
@@ -1,33 +1,36 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } }
2
2
 
3
- var _chunkUZO5Z2XTcjs = require('./chunk-UZO5Z2XT.cjs');
3
+ var _chunkBIBMDTU5cjs = require('./chunk-BIBMDTU5.cjs');
4
4
 
5
5
 
6
- var _chunkVWXUT5R2cjs = require('./chunk-VWXUT5R2.cjs');
6
+ var _chunkKTNERCTZcjs = require('./chunk-KTNERCTZ.cjs');
7
7
 
8
8
 
9
- var _chunk7ENEWAMZcjs = require('./chunk-7ENEWAMZ.cjs');
9
+ var _chunkT4VWPKDGcjs = require('./chunk-T4VWPKDG.cjs');
10
10
 
11
11
 
12
- var _chunkIADVBKEJcjs = require('./chunk-IADVBKEJ.cjs');
12
+ var _chunkXCRCAUGIcjs = require('./chunk-XCRCAUGI.cjs');
13
13
 
14
14
 
15
- var _chunkUA5XFP4Ocjs = require('./chunk-UA5XFP4O.cjs');
15
+ var _chunkWCTMPDUXcjs = require('./chunk-WCTMPDUX.cjs');
16
16
 
17
17
 
18
- var _chunkPU2KV7VPcjs = require('./chunk-PU2KV7VP.cjs');
18
+ var _chunkOUNN4IQBcjs = require('./chunk-OUNN4IQB.cjs');
19
+
20
+
21
+ var _chunkRYKQXBG6cjs = require('./chunk-RYKQXBG6.cjs');
19
22
 
20
23
 
21
24
  var _chunkRIIA4ALQcjs = require('./chunk-RIIA4ALQ.cjs');
22
25
 
23
26
 
24
- var _chunkQGIHC6BAcjs = require('./chunk-QGIHC6BA.cjs');
27
+ var _chunkUKKDOOUOcjs = require('./chunk-UKKDOOUO.cjs');
25
28
 
26
29
 
27
- var _chunkEVCPBFSRcjs = require('./chunk-EVCPBFSR.cjs');
30
+ var _chunkSDJTSMOWcjs = require('./chunk-SDJTSMOW.cjs');
28
31
 
29
32
 
30
- var _chunkKCH4BQXKcjs = require('./chunk-KCH4BQXK.cjs');
33
+ var _chunkAQ445VV7cjs = require('./chunk-AQ445VV7.cjs');
31
34
 
32
35
 
33
36
  var _chunkIDV2JYJ6cjs = require('./chunk-IDV2JYJ6.cjs');
@@ -103,7 +106,8 @@ var DRAFT_VERSIONS = {
103
106
  "16": 0xff000010n,
104
107
  "17": 0xff000011n,
105
108
  "18": 0xff000012n,
106
- "19": 0xff000013n
109
+ "19": 0xff000013n,
110
+ "20": 0xff000014n
107
111
  };
108
112
  function createCodec(options) {
109
113
  const draft = DRAFT_VERSIONS[options.draft];
@@ -123,23 +127,25 @@ Supported draft values: ${Object.keys(DRAFT_VERSIONS).join(", ")}`
123
127
  case "10":
124
128
  return _chunkRIIA4ALQcjs.createDraft10Codec.call(void 0, );
125
129
  case "11":
126
- return _chunkQGIHC6BAcjs.createDraft11Codec.call(void 0, );
130
+ return _chunkUKKDOOUOcjs.createDraft11Codec.call(void 0, );
127
131
  case "12":
128
- return _chunkEVCPBFSRcjs.createDraft12Codec.call(void 0, );
132
+ return _chunkSDJTSMOWcjs.createDraft12Codec.call(void 0, );
129
133
  case "13":
130
- return _chunkKCH4BQXKcjs.createDraft13Codec.call(void 0, );
134
+ return _chunkAQ445VV7cjs.createDraft13Codec.call(void 0, );
131
135
  case "14":
132
- return _chunk7ENEWAMZcjs.createDraft14Codec.call(void 0, );
136
+ return _chunkXCRCAUGIcjs.createDraft14Codec.call(void 0, );
133
137
  case "15":
134
- return _chunkIADVBKEJcjs.createDraft15Codec.call(void 0, );
138
+ return _chunkWCTMPDUXcjs.createDraft15Codec.call(void 0, );
135
139
  case "16":
136
- return _chunkUA5XFP4Ocjs.createDraft16Codec.call(void 0, );
140
+ return _chunkOUNN4IQBcjs.createDraft16Codec.call(void 0, );
137
141
  case "17":
138
- return _chunkPU2KV7VPcjs.createDraft17Codec.call(void 0, );
142
+ return _chunkRYKQXBG6cjs.createDraft17Codec.call(void 0, );
139
143
  case "18":
140
- return _chunkUZO5Z2XTcjs.createDraft18Codec.call(void 0, );
144
+ return _chunkBIBMDTU5cjs.createDraft18Codec.call(void 0, );
141
145
  case "19":
142
- return _chunkVWXUT5R2cjs.createDraft19Codec.call(void 0, );
146
+ return _chunkKTNERCTZcjs.createDraft19Codec.call(void 0, );
147
+ case "20":
148
+ return _chunkT4VWPKDGcjs.createDraft20Codec.call(void 0, );
143
149
  default:
144
150
  throw new Error(`Unsupported draft: ${draft}`);
145
151
  }