@moqtap/codec 0.2.3 → 0.3.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.
- package/LICENSE +21 -21
- package/README.md +100 -99
- package/dist/{chunk-RZHAPEXO.js → chunk-2A57DRXV.js} +36 -10
- package/dist/{chunk-73MWUKSJ.js → chunk-2UTVXWFF.js} +190 -102
- package/dist/{chunk-JTVCOMBI.cjs → chunk-3XKO6PCR.cjs} +290 -183
- package/dist/{chunk-ACQ4CUJP.cjs → chunk-4BDEU3D4.cjs} +237 -158
- package/dist/{chunk-4N4INRE7.cjs → chunk-4HBKHNU2.cjs} +144 -110
- package/dist/{chunk-2ZT6CVSE.js → chunk-4IVZZOY3.js} +269 -162
- package/dist/{chunk-GLBQDG4L.cjs → chunk-5O764MBD.cjs} +508 -117
- package/dist/chunk-7KBAWOBA.js +1212 -0
- package/dist/{chunk-JSQM2MG3.js → chunk-7QOPNSDF.js} +44 -12
- package/dist/{chunk-SYHW3FLI.cjs → chunk-7RE6KSIY.cjs} +28 -8
- package/dist/{chunk-YG5KJESI.js → chunk-AY6IAHUM.js} +28 -8
- package/dist/{chunk-EFM5T7OM.js → chunk-BLQDWOSG.js} +36 -10
- package/dist/{chunk-UYXTY6ZQ.cjs → chunk-E65QKRSN.cjs} +20 -12
- package/dist/{chunk-BISI45MN.cjs → chunk-EAHE3IOG.cjs} +44 -12
- package/dist/{chunk-PZBPH2D7.js → chunk-GCBFHZW6.js} +216 -137
- package/dist/{chunk-GXEW4COZ.cjs → chunk-H5NSL4MO.cjs} +36 -10
- package/dist/chunk-HZHSO7EW.cjs +1212 -0
- package/dist/{chunk-KZCYQ7ED.cjs → chunk-IILNSDEQ.cjs} +69 -41
- package/dist/{chunk-4XYGE53S.cjs → chunk-J3XCPBW3.cjs} +36 -10
- package/dist/{chunk-6AEHWULA.cjs → chunk-JKOEJZ5B.cjs} +28 -8
- package/dist/{chunk-RUPCJTC3.cjs → chunk-JL3NEW3O.cjs} +23 -1
- package/dist/{chunk-G7GI7LJA.js → chunk-LORZMJJB.js} +36 -10
- package/dist/{chunk-DUBCL3WF.cjs → chunk-LV5C6MEC.cjs} +36 -10
- package/dist/{chunk-ENURAVHI.cjs → chunk-MYXAD5JC.cjs} +44 -12
- package/dist/{chunk-FXZ2MYKJ.js → chunk-MZ7HUCGJ.js} +20 -12
- package/dist/{chunk-S74DWJE2.cjs → chunk-OKG2HT25.cjs} +277 -88
- package/dist/{chunk-BGWGVINJ.cjs → chunk-PKEOQSSZ.cjs} +144 -110
- package/dist/{chunk-2GODRVT5.js → chunk-Q46ZURKX.js} +325 -48
- package/dist/{chunk-UR6JKS56.js → chunk-Q7IGWV3P.js} +41 -9
- package/dist/{chunk-XSNX2IUJ.js → chunk-RW4UG7CN.js} +121 -87
- package/dist/{chunk-DWK5ZQZ4.js → chunk-RZTLQAKF.js} +28 -8
- package/dist/{chunk-UNS34PTA.cjs → chunk-S6IPIN66.cjs} +44 -12
- package/dist/{chunk-YIG2C3LF.cjs → chunk-SDWRXXOO.cjs} +214 -126
- package/dist/{chunk-CEH7ESNC.js → chunk-SHMA4PBY.js} +121 -87
- package/dist/{chunk-MC7W6PMI.js → chunk-U3ZVLT5L.js} +483 -135
- package/dist/{chunk-VJUUZ4W2.cjs → chunk-UJU63EFY.cjs} +374 -97
- package/dist/{chunk-7L43FE6P.js → chunk-VOU7PNHI.js} +23 -1
- package/dist/{chunk-E6E3NQYU.js → chunk-WRHGCVYN.js} +44 -12
- package/dist/{chunk-FPISPJ5N.cjs → chunk-XNWYLVGU.cjs} +529 -181
- package/dist/{chunk-U3IPZYPX.js → chunk-XS77RBY7.js} +228 -39
- package/dist/{chunk-JGG7CMSZ.cjs → chunk-XZE5R57R.cjs} +144 -110
- package/dist/{chunk-77MNXX3M.js → chunk-Y6KCSM3V.js} +121 -87
- package/dist/{chunk-TLYNOOQP.cjs → chunk-YTPZZI2M.cjs} +41 -9
- package/dist/{chunk-7DUBLRXC.js → chunk-YWRCSQBA.js} +44 -12
- package/dist/{chunk-MRJWLGYH.js → chunk-Z3VKP3PJ.js} +69 -41
- package/dist/{chunk-E6P74GDT.js → chunk-Z6U26IRI.js} +464 -73
- package/dist/{codec-FvGCxIhr.d.ts → codec-25u4_1HS.d.ts} +4 -4
- package/dist/{codec-DRcsBCsb.d.ts → codec-3Ppy_5Gd.d.ts} +4 -4
- package/dist/{codec-BdVMRMOI.d.ts → codec-BB0U8MF2.d.cts} +4 -4
- package/dist/{codec-B2cH-f5V.d.cts → codec-BHHfBTnV.d.ts} +4 -4
- package/dist/{codec-B5K73Bdj.d.ts → codec-BN6jk0Td.d.cts} +4 -4
- package/dist/{codec-R8GrCPt2.d.ts → codec-BU0gaSZm.d.ts} +4 -4
- package/dist/{codec-Bq-tLtfP.d.ts → codec-C-Yk2RNa.d.ts} +4 -4
- package/dist/codec-CFWQY9Lj.d.cts +18 -0
- package/dist/{codec-CPlK3Pi5.d.ts → codec-COy4uuPO.d.cts} +4 -4
- package/dist/codec-CewFCsEy.d.ts +18 -0
- package/dist/{codec-KXHvXZVb.d.cts → codec-Ck7ZwFF1.d.cts} +4 -4
- package/dist/{codec-DZhZSIii.d.cts → codec-D2QVSH9D.d.ts} +4 -4
- package/dist/{codec-BwFgpeQu.d.ts → codec-DDUBJGn0.d.cts} +4 -4
- package/dist/{codec-BFeliJFc.d.ts → codec-DNfml-se.d.ts} +4 -4
- package/dist/{codec-C4n1PS09.d.cts → codec-DoOGjjDq.d.cts} +4 -4
- package/dist/{codec-Bap882Fh.d.cts → codec-J7ekOSMc.d.ts} +4 -4
- package/dist/{codec-SKBeHQk7.d.ts → codec-R9TJCq-E.d.cts} +4 -4
- package/dist/{codec-DNUIgLqc.d.cts → codec-ZwV-Njt6.d.ts} +4 -4
- package/dist/{codec-HgBgHkFI.d.cts → codec-j819z_hL.d.cts} +4 -4
- package/dist/{codec-DY4QH364.d.cts → codec-w8z2j_uo.d.cts} +4 -4
- package/dist/{codec-CPvPq0sb.d.cts → codec-wtt6WF1K.d.ts} +4 -4
- package/dist/{codec-BUMjz0J4.d.cts → codec-z6_2PSzi.d.cts} +4 -4
- package/dist/draft10-session.cjs +2 -2
- package/dist/draft10-session.d.cts +6 -6
- package/dist/draft10-session.d.ts +6 -6
- package/dist/draft10-session.js +1 -1
- package/dist/draft10.cjs +8 -5
- package/dist/draft10.d.cts +14 -12
- package/dist/draft10.d.ts +14 -12
- package/dist/draft10.js +16 -13
- package/dist/draft11-session.cjs +2 -2
- package/dist/draft11-session.d.cts +6 -6
- package/dist/draft11-session.d.ts +6 -6
- package/dist/draft11-session.js +1 -1
- package/dist/draft11.cjs +8 -5
- package/dist/draft11.d.cts +14 -12
- package/dist/draft11.d.ts +14 -12
- package/dist/draft11.js +16 -13
- package/dist/draft12-session.cjs +2 -2
- package/dist/draft12-session.d.cts +6 -6
- package/dist/draft12-session.d.ts +6 -6
- package/dist/draft12-session.js +1 -1
- package/dist/draft12.cjs +8 -5
- package/dist/draft12.d.cts +16 -14
- package/dist/draft12.d.ts +16 -14
- package/dist/draft12.js +16 -13
- package/dist/draft13-session.cjs +2 -2
- package/dist/draft13-session.d.cts +6 -6
- package/dist/draft13-session.d.ts +6 -6
- package/dist/draft13-session.js +1 -1
- package/dist/draft13.cjs +8 -5
- package/dist/draft13.d.cts +16 -14
- package/dist/draft13.d.ts +16 -14
- package/dist/draft13.js +16 -13
- package/dist/draft14-session.cjs +2 -2
- package/dist/draft14-session.d.cts +6 -6
- package/dist/draft14-session.d.ts +6 -6
- package/dist/draft14-session.js +1 -1
- package/dist/draft14.cjs +14 -5
- package/dist/draft14.d.cts +14 -12
- package/dist/draft14.d.ts +14 -12
- package/dist/draft14.js +13 -4
- package/dist/draft15-session.cjs +2 -2
- package/dist/draft15-session.d.cts +6 -6
- package/dist/draft15-session.d.ts +6 -6
- package/dist/draft15-session.js +1 -1
- package/dist/draft15.cjs +8 -5
- package/dist/draft15.d.cts +14 -12
- package/dist/draft15.d.ts +14 -12
- package/dist/draft15.js +16 -13
- package/dist/draft16-session.cjs +2 -2
- package/dist/draft16-session.d.cts +6 -6
- package/dist/draft16-session.d.ts +6 -6
- package/dist/draft16-session.js +1 -1
- package/dist/draft16.cjs +8 -5
- package/dist/draft16.d.cts +14 -12
- package/dist/draft16.d.ts +14 -12
- package/dist/draft16.js +16 -13
- package/dist/draft17-session.cjs +2 -2
- package/dist/draft17-session.d.cts +7 -7
- package/dist/draft17-session.d.ts +7 -7
- package/dist/draft17-session.js +1 -1
- package/dist/draft17.cjs +8 -5
- package/dist/draft17.d.cts +11 -9
- package/dist/draft17.d.ts +11 -9
- package/dist/draft17.js +16 -13
- package/dist/draft7-session.cjs +2 -2
- package/dist/draft7-session.d.cts +6 -5
- package/dist/draft7-session.d.ts +6 -5
- package/dist/draft7-session.js +1 -1
- package/dist/draft7.cjs +71 -14
- package/dist/draft7.d.cts +53 -134
- package/dist/draft7.d.ts +53 -134
- package/dist/draft7.js +76 -19
- package/dist/draft8-session.cjs +2 -2
- package/dist/draft8-session.d.cts +6 -6
- package/dist/draft8-session.d.ts +6 -6
- package/dist/draft8-session.js +1 -1
- package/dist/draft8.cjs +8 -5
- package/dist/draft8.d.cts +14 -12
- package/dist/draft8.d.ts +14 -12
- package/dist/draft8.js +7 -4
- package/dist/draft9-session.cjs +2 -2
- package/dist/draft9-session.d.cts +6 -6
- package/dist/draft9-session.d.ts +6 -6
- package/dist/draft9-session.js +1 -1
- package/dist/draft9.cjs +8 -5
- package/dist/draft9.d.cts +14 -12
- package/dist/draft9.d.ts +14 -12
- package/dist/draft9.js +7 -4
- package/dist/index.cjs +52 -74
- package/dist/index.d.cts +41 -60
- package/dist/index.d.ts +41 -60
- package/dist/index.js +40 -62
- package/dist/{session-types-CJIFbTPd.d.ts → session-types-C7UONex5.d.cts} +28 -27
- package/dist/{session-types-Cbq8IGCP.d.cts → session-types-X-IYEGoG.d.ts} +28 -27
- package/dist/session.cjs +46 -13
- package/dist/session.d.cts +28 -9
- package/dist/session.d.ts +28 -9
- package/dist/session.js +46 -13
- package/dist/{types-DxSFvL2b.d.cts → types--Q7_DcvP.d.cts} +43 -39
- package/dist/{types-DxSFvL2b.d.ts → types--Q7_DcvP.d.ts} +43 -39
- package/dist/{types-B0FT5Qs2.d.ts → types-0IWbU9Z_.d.cts} +36 -36
- package/dist/{types-B0FT5Qs2.d.cts → types-0IWbU9Z_.d.ts} +36 -36
- package/dist/{types-gQsr0AAA.d.cts → types-B3g5G9KP.d.cts} +36 -36
- package/dist/{types-gQsr0AAA.d.ts → types-B3g5G9KP.d.ts} +36 -36
- package/dist/{types-Pme7sua0.d.cts → types-BFpFNM_m.d.cts} +57 -32
- package/dist/{types-Pme7sua0.d.ts → types-BFpFNM_m.d.ts} +57 -32
- package/dist/{types-8gUGeMgs.d.ts → types-Br7fm2mf.d.cts} +48 -26
- package/dist/{types-8gUGeMgs.d.cts → types-Br7fm2mf.d.ts} +48 -26
- package/dist/{types-BeAVNU-F.d.cts → types-C2qKTRR_.d.cts} +50 -45
- package/dist/{types-BeAVNU-F.d.ts → types-C2qKTRR_.d.ts} +50 -45
- package/dist/{types-DKpsfD3i.d.cts → types-DEaypVsD.d.cts} +115 -55
- package/dist/{types-DKpsfD3i.d.ts → types-DEaypVsD.d.ts} +115 -55
- package/dist/types-Dl4IaAHR.d.cts +282 -0
- package/dist/types-Dl4IaAHR.d.ts +282 -0
- package/dist/{types-CDa7F5ct.d.cts → types-DrQpTW1G.d.cts} +58 -50
- package/dist/{types-CDa7F5ct.d.ts → types-DrQpTW1G.d.ts} +58 -50
- package/dist/types-DuIO7cWK.d.cts +25 -0
- package/dist/types-DuIO7cWK.d.ts +25 -0
- package/dist/{types-B9A2g05r.d.cts → types-DuxfOYiO.d.cts} +47 -31
- package/dist/{types-B9A2g05r.d.ts → types-DuxfOYiO.d.ts} +47 -31
- package/dist/{types-D1dI_oTX.d.cts → types-jV1yDDBA.d.cts} +36 -36
- package/dist/{types-D1dI_oTX.d.ts → types-jV1yDDBA.d.ts} +36 -36
- package/package.json +192 -192
- package/src/core/buffer-reader.ts +130 -130
- package/src/core/buffer-writer.ts +100 -100
- package/src/core/errors.ts +1 -1
- package/src/core/hex.ts +21 -21
- package/src/core/session-types.ts +61 -59
- package/src/core/types.ts +18 -361
- package/src/drafts/draft07/codec.ts +1058 -938
- package/src/drafts/draft07/data-streams.ts +240 -240
- package/src/drafts/draft07/index.ts +124 -89
- package/src/drafts/draft07/messages.ts +76 -42
- package/src/drafts/draft07/rules.ts +107 -101
- package/src/drafts/draft07/session-fsm.ts +315 -287
- package/src/drafts/draft07/session.ts +8 -6
- package/src/drafts/draft07/types.ts +406 -72
- package/src/drafts/draft07/varint.ts +51 -51
- package/src/drafts/draft08/codec.ts +985 -953
- package/src/drafts/draft08/data-streams.ts +363 -359
- package/src/drafts/draft08/index.ts +10 -9
- package/src/drafts/draft08/messages.ts +59 -59
- package/src/drafts/draft08/rules.ts +73 -73
- package/src/drafts/draft08/session-fsm.ts +335 -303
- package/src/drafts/draft08/session.ts +6 -7
- package/src/drafts/draft08/types.ts +380 -384
- package/src/drafts/draft09/codec.ts +977 -945
- package/src/drafts/draft09/data-streams.ts +336 -332
- package/src/drafts/draft09/index.ts +10 -9
- package/src/drafts/draft09/messages.ts +59 -59
- package/src/drafts/draft09/rules.ts +73 -73
- package/src/drafts/draft09/session-fsm.ts +335 -303
- package/src/drafts/draft09/session.ts +6 -7
- package/src/drafts/draft09/types.ts +380 -384
- package/src/drafts/draft10/codec.ts +977 -945
- package/src/drafts/draft10/data-streams.ts +336 -332
- package/src/drafts/draft10/index.ts +10 -9
- package/src/drafts/draft10/messages.ts +59 -59
- package/src/drafts/draft10/rules.ts +73 -73
- package/src/drafts/draft10/session-fsm.ts +335 -303
- package/src/drafts/draft10/session.ts +6 -7
- package/src/drafts/draft10/types.ts +380 -384
- package/src/drafts/draft11/codec.ts +1054 -988
- package/src/drafts/draft11/data-streams.ts +316 -269
- package/src/drafts/draft11/index.ts +10 -9
- package/src/drafts/draft11/messages.ts +60 -59
- package/src/drafts/draft11/rules.ts +73 -73
- package/src/drafts/draft11/session-fsm.ts +359 -333
- package/src/drafts/draft11/session.ts +6 -7
- package/src/drafts/draft11/types.ts +385 -381
- package/src/drafts/draft12/codec.ts +1178 -1122
- package/src/drafts/draft12/data-streams.ts +324 -275
- package/src/drafts/draft12/index.ts +10 -9
- package/src/drafts/draft12/messages.ts +67 -66
- package/src/drafts/draft12/rules.ts +79 -79
- package/src/drafts/draft12/session-fsm.ts +384 -358
- package/src/drafts/draft12/session.ts +6 -7
- package/src/drafts/draft12/types.ts +424 -419
- package/src/drafts/draft13/codec.ts +1296 -1206
- package/src/drafts/draft13/data-streams.ts +326 -275
- package/src/drafts/draft13/index.ts +10 -9
- package/src/drafts/draft13/messages.ts +73 -68
- package/src/drafts/draft13/rules.ts +81 -81
- package/src/drafts/draft13/session-fsm.ts +392 -366
- package/src/drafts/draft13/session.ts +6 -7
- package/src/drafts/draft13/types.ts +447 -438
- package/src/drafts/draft14/codec.ts +1347 -1043
- package/src/drafts/draft14/data-streams.ts +831 -813
- package/src/drafts/draft14/index.ts +17 -9
- package/src/drafts/draft14/messages.ts +65 -65
- package/src/drafts/draft14/rules.ts +81 -81
- package/src/drafts/draft14/session-fsm.ts +415 -405
- package/src/drafts/draft14/session.ts +6 -7
- package/src/drafts/draft14/types.ts +451 -381
- package/src/drafts/draft15/codec.ts +1138 -978
- package/src/drafts/draft15/data-streams.ts +842 -794
- package/src/drafts/draft15/index.ts +10 -9
- package/src/drafts/draft15/messages.ts +54 -53
- package/src/drafts/draft15/rules.ts +67 -67
- package/src/drafts/draft15/session-fsm.ts +319 -299
- package/src/drafts/draft15/session.ts +6 -7
- package/src/drafts/draft15/types.ts +357 -339
- package/src/drafts/draft16/codec.ts +1242 -966
- package/src/drafts/draft16/data-streams.ts +835 -789
- package/src/drafts/draft16/index.ts +10 -9
- package/src/drafts/draft16/messages.ts +56 -55
- package/src/drafts/draft16/rules.ts +69 -69
- package/src/drafts/draft16/session-fsm.ts +319 -299
- package/src/drafts/draft16/session.ts +6 -7
- package/src/drafts/draft16/types.ts +386 -357
- package/src/drafts/draft17/codec.ts +1209 -971
- package/src/drafts/draft17/data-streams.ts +969 -758
- package/src/drafts/draft17/index.ts +9 -7
- package/src/drafts/draft17/messages.ts +43 -42
- package/src/drafts/draft17/rules.ts +58 -58
- package/src/drafts/draft17/session-fsm.ts +248 -216
- package/src/drafts/draft17/session.ts +5 -5
- package/src/drafts/draft17/types.ts +337 -313
- package/src/index.ts +85 -274
- package/src/session.ts +62 -23
- package/dist/chunk-FZDIEHQL.cjs +0 -1042
- package/dist/chunk-HDWJ2GDE.js +0 -24
- package/dist/chunk-KNDYS3DK.cjs +0 -24
- package/dist/chunk-N2KBF5Q2.js +0 -1042
- package/dist/types-QNXoxC9Y.d.cts +0 -236
- package/dist/types-QNXoxC9Y.d.ts +0 -236
- package/src/drafts/draft07/announce-fsm.ts +0 -2
- package/src/drafts/draft07/parameters.ts +0 -12
- package/src/drafts/draft07/subscription-fsm.ts +0 -3
package/dist/draft7.cjs
CHANGED
|
@@ -10,7 +10,6 @@
|
|
|
10
10
|
|
|
11
11
|
|
|
12
12
|
|
|
13
|
-
var _chunkFZDIEHQLcjs = require('./chunk-FZDIEHQL.cjs');
|
|
14
13
|
|
|
15
14
|
|
|
16
15
|
|
|
@@ -18,24 +17,49 @@ var _chunkFZDIEHQLcjs = require('./chunk-FZDIEHQL.cjs');
|
|
|
18
17
|
|
|
19
18
|
|
|
20
19
|
|
|
21
|
-
var _chunkMZ7VU52Ocjs = require('./chunk-MZ7VU52O.cjs');
|
|
22
20
|
|
|
23
21
|
|
|
24
22
|
|
|
25
|
-
var _chunkRUPCJTC3cjs = require('./chunk-RUPCJTC3.cjs');
|
|
26
23
|
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
var _chunkHZHSO7EWcjs = require('./chunk-HZHSO7EW.cjs');
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
var _chunkMZ7VU52Ocjs = require('./chunk-MZ7VU52O.cjs');
|
|
56
|
+
|
|
57
|
+
|
|
58
|
+
var _chunkJL3NEW3Ocjs = require('./chunk-JL3NEW3O.cjs');
|
|
36
59
|
|
|
37
60
|
// src/drafts/draft07/index.ts
|
|
38
|
-
var
|
|
61
|
+
var DRAFT_VERSION = 0xff000007n;
|
|
62
|
+
var defaultCodec = _chunkHZHSO7EWcjs.createDraft07Codec.call(void 0, );
|
|
39
63
|
function encodeMessage(message) {
|
|
40
64
|
return defaultCodec.encodeMessage(message);
|
|
41
65
|
}
|
|
@@ -69,4 +93,37 @@ function createStreamDecoder() {
|
|
|
69
93
|
|
|
70
94
|
|
|
71
95
|
|
|
72
|
-
|
|
96
|
+
|
|
97
|
+
|
|
98
|
+
|
|
99
|
+
|
|
100
|
+
|
|
101
|
+
|
|
102
|
+
|
|
103
|
+
|
|
104
|
+
|
|
105
|
+
|
|
106
|
+
|
|
107
|
+
|
|
108
|
+
|
|
109
|
+
|
|
110
|
+
|
|
111
|
+
|
|
112
|
+
|
|
113
|
+
|
|
114
|
+
|
|
115
|
+
|
|
116
|
+
|
|
117
|
+
|
|
118
|
+
|
|
119
|
+
|
|
120
|
+
|
|
121
|
+
|
|
122
|
+
|
|
123
|
+
|
|
124
|
+
|
|
125
|
+
|
|
126
|
+
|
|
127
|
+
|
|
128
|
+
|
|
129
|
+
exports.CLIENT_ONLY_MESSAGES = _chunkMZ7VU52Ocjs.CLIENT_ONLY_MESSAGES; exports.CONTROL_MESSAGES = _chunkMZ7VU52Ocjs.CONTROL_MESSAGES; exports.DATA_MESSAGES = _chunkMZ7VU52Ocjs.DATA_MESSAGES; exports.DRAFT_VERSION = DRAFT_VERSION; exports.DecodeError = _chunkJL3NEW3Ocjs.DecodeError; exports.MESSAGE_ID_MAP = _chunkHZHSO7EWcjs.MESSAGE_ID_MAP; exports.MESSAGE_TYPE_MAP = _chunkHZHSO7EWcjs.MESSAGE_TYPE_MAP; exports.MSG_ANNOUNCE = _chunkHZHSO7EWcjs.MSG_ANNOUNCE; exports.MSG_ANNOUNCE_CANCEL = _chunkHZHSO7EWcjs.MSG_ANNOUNCE_CANCEL; exports.MSG_ANNOUNCE_ERROR = _chunkHZHSO7EWcjs.MSG_ANNOUNCE_ERROR; exports.MSG_ANNOUNCE_OK = _chunkHZHSO7EWcjs.MSG_ANNOUNCE_OK; exports.MSG_CLIENT_SETUP = _chunkHZHSO7EWcjs.MSG_CLIENT_SETUP; exports.MSG_FETCH = _chunkHZHSO7EWcjs.MSG_FETCH; exports.MSG_FETCH_CANCEL = _chunkHZHSO7EWcjs.MSG_FETCH_CANCEL; exports.MSG_FETCH_ERROR = _chunkHZHSO7EWcjs.MSG_FETCH_ERROR; exports.MSG_FETCH_HEADER = _chunkHZHSO7EWcjs.MSG_FETCH_HEADER; exports.MSG_FETCH_OK = _chunkHZHSO7EWcjs.MSG_FETCH_OK; exports.MSG_GOAWAY = _chunkHZHSO7EWcjs.MSG_GOAWAY; exports.MSG_MAX_SUBSCRIBE_ID = _chunkHZHSO7EWcjs.MSG_MAX_SUBSCRIBE_ID; exports.MSG_OBJECT_DATAGRAM = _chunkHZHSO7EWcjs.MSG_OBJECT_DATAGRAM; exports.MSG_SERVER_SETUP = _chunkHZHSO7EWcjs.MSG_SERVER_SETUP; exports.MSG_STREAM_HEADER_SUBGROUP = _chunkHZHSO7EWcjs.MSG_STREAM_HEADER_SUBGROUP; exports.MSG_SUBSCRIBE = _chunkHZHSO7EWcjs.MSG_SUBSCRIBE; exports.MSG_SUBSCRIBE_ANNOUNCES = _chunkHZHSO7EWcjs.MSG_SUBSCRIBE_ANNOUNCES; exports.MSG_SUBSCRIBE_ANNOUNCES_ERROR = _chunkHZHSO7EWcjs.MSG_SUBSCRIBE_ANNOUNCES_ERROR; exports.MSG_SUBSCRIBE_ANNOUNCES_OK = _chunkHZHSO7EWcjs.MSG_SUBSCRIBE_ANNOUNCES_OK; exports.MSG_SUBSCRIBE_DONE = _chunkHZHSO7EWcjs.MSG_SUBSCRIBE_DONE; exports.MSG_SUBSCRIBE_ERROR = _chunkHZHSO7EWcjs.MSG_SUBSCRIBE_ERROR; exports.MSG_SUBSCRIBE_OK = _chunkHZHSO7EWcjs.MSG_SUBSCRIBE_OK; exports.MSG_SUBSCRIBE_UPDATE = _chunkHZHSO7EWcjs.MSG_SUBSCRIBE_UPDATE; exports.MSG_TRACK_STATUS = _chunkHZHSO7EWcjs.MSG_TRACK_STATUS; exports.MSG_TRACK_STATUS_REQUEST = _chunkHZHSO7EWcjs.MSG_TRACK_STATUS_REQUEST; exports.MSG_UNANNOUNCE = _chunkHZHSO7EWcjs.MSG_UNANNOUNCE; exports.MSG_UNSUBSCRIBE = _chunkHZHSO7EWcjs.MSG_UNSUBSCRIBE; exports.MSG_UNSUBSCRIBE_ANNOUNCES = _chunkHZHSO7EWcjs.MSG_UNSUBSCRIBE_ANNOUNCES; exports.PARAM_AUTHORIZATION_INFO = _chunkHZHSO7EWcjs.PARAM_AUTHORIZATION_INFO; exports.PARAM_DELIVERY_TIMEOUT = _chunkHZHSO7EWcjs.PARAM_DELIVERY_TIMEOUT; exports.PARAM_MAX_CACHE_DURATION = _chunkHZHSO7EWcjs.PARAM_MAX_CACHE_DURATION; exports.SERVER_ONLY_MESSAGES = _chunkMZ7VU52Ocjs.SERVER_ONLY_MESSAGES; exports.SETUP_PARAM_MAX_SUBSCRIBE_ID = _chunkHZHSO7EWcjs.SETUP_PARAM_MAX_SUBSCRIBE_ID; exports.SETUP_PARAM_PATH = _chunkHZHSO7EWcjs.SETUP_PARAM_PATH; exports.SETUP_PARAM_ROLE = _chunkHZHSO7EWcjs.SETUP_PARAM_ROLE; exports.createDraft07Codec = _chunkHZHSO7EWcjs.createDraft07Codec; exports.createStreamDecoder = createStreamDecoder; exports.decodeDatagram = _chunkHZHSO7EWcjs.decodeDatagram; exports.decodeFetchStream = _chunkHZHSO7EWcjs.decodeFetchStream; exports.decodeMessage = decodeMessage; exports.decodeSubgroupStream = _chunkHZHSO7EWcjs.decodeSubgroupStream; exports.decodeVarInt = _chunkHZHSO7EWcjs.decodeVarInt; exports.encodeDatagram = _chunkHZHSO7EWcjs.encodeDatagram; exports.encodeFetchStream = _chunkHZHSO7EWcjs.encodeFetchStream; exports.encodeMessage = encodeMessage; exports.encodeSubgroupStream = _chunkHZHSO7EWcjs.encodeSubgroupStream; exports.encodeVarInt = _chunkHZHSO7EWcjs.encodeVarInt; exports.getLegalIncoming = _chunkMZ7VU52Ocjs.getLegalIncoming; exports.getLegalOutgoing = _chunkMZ7VU52Ocjs.getLegalOutgoing;
|
package/dist/draft7.d.cts
CHANGED
|
@@ -1,83 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
private readonly view;
|
|
7
|
-
private pos;
|
|
8
|
-
constructor(buffer: Uint8Array, offset?: number);
|
|
9
|
-
get offset(): number;
|
|
10
|
-
get remaining(): number;
|
|
11
|
-
readUint8(): number;
|
|
12
|
-
readBytes(length: number): Uint8Array<ArrayBuffer>;
|
|
13
|
-
/** Zero-copy read: returns a view into the underlying buffer. */
|
|
14
|
-
readBytesView(length: number): Uint8Array<ArrayBuffer>;
|
|
15
|
-
readVarInt(): bigint;
|
|
16
|
-
readString(): string;
|
|
17
|
-
readTuple(): string[];
|
|
18
|
-
readParameters(): Map<bigint, Uint8Array>;
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
interface ObjectPayload {
|
|
22
|
-
readonly type: "object";
|
|
23
|
-
readonly objectId: bigint;
|
|
24
|
-
readonly payloadLength: number;
|
|
25
|
-
readonly status?: bigint;
|
|
26
|
-
readonly payload: Uint8Array;
|
|
27
|
-
readonly byteOffset: number;
|
|
28
|
-
readonly payloadByteOffset: number;
|
|
29
|
-
}
|
|
30
|
-
interface SubgroupStream {
|
|
31
|
-
readonly type: "subgroup";
|
|
32
|
-
readonly streamTypeId: 0x04;
|
|
33
|
-
readonly trackAlias: bigint;
|
|
34
|
-
readonly groupId: bigint;
|
|
35
|
-
readonly subgroupId: bigint;
|
|
36
|
-
readonly publisherPriority: number;
|
|
37
|
-
readonly objects: ObjectPayload[];
|
|
38
|
-
}
|
|
39
|
-
interface DatagramObject {
|
|
40
|
-
readonly type: "datagram";
|
|
41
|
-
readonly streamTypeId: 0x01;
|
|
42
|
-
readonly trackAlias: bigint;
|
|
43
|
-
readonly groupId: bigint;
|
|
44
|
-
readonly objectId: bigint;
|
|
45
|
-
readonly publisherPriority: number;
|
|
46
|
-
readonly payloadLength: number;
|
|
47
|
-
readonly status?: bigint;
|
|
48
|
-
readonly payload: Uint8Array;
|
|
49
|
-
}
|
|
50
|
-
interface FetchObjectPayload {
|
|
51
|
-
readonly type: "object";
|
|
52
|
-
readonly groupId: bigint;
|
|
53
|
-
readonly subgroupId: bigint;
|
|
54
|
-
readonly objectId: bigint;
|
|
55
|
-
readonly publisherPriority: number;
|
|
56
|
-
readonly payloadLength: number;
|
|
57
|
-
readonly status?: bigint;
|
|
58
|
-
readonly payload: Uint8Array;
|
|
59
|
-
readonly byteOffset: number;
|
|
60
|
-
readonly payloadByteOffset: number;
|
|
61
|
-
}
|
|
62
|
-
interface FetchStream {
|
|
63
|
-
readonly type: "fetch";
|
|
64
|
-
readonly subscribeId: bigint;
|
|
65
|
-
readonly objects: FetchObjectPayload[];
|
|
66
|
-
}
|
|
67
|
-
type Draft07DataStream = SubgroupStream | DatagramObject | FetchStream;
|
|
68
|
-
interface SubgroupStreamHeader {
|
|
69
|
-
readonly type: "subgroup_header";
|
|
70
|
-
readonly trackAlias: bigint;
|
|
71
|
-
readonly groupId: bigint;
|
|
72
|
-
readonly subgroupId: bigint;
|
|
73
|
-
readonly publisherPriority: number;
|
|
74
|
-
}
|
|
75
|
-
interface FetchStreamHeader {
|
|
76
|
-
readonly type: "fetch_header";
|
|
77
|
-
readonly subscribeId: bigint;
|
|
78
|
-
}
|
|
79
|
-
type DataStreamHeader = SubgroupStreamHeader | FetchStreamHeader;
|
|
80
|
-
type DataStreamEvent = DataStreamHeader | ObjectPayload;
|
|
1
|
+
import { b as DecodeResult } from './types-DuIO7cWK.cjs';
|
|
2
|
+
export { D as DecodeError, a as DecodeErrorCode } from './types-DuIO7cWK.cjs';
|
|
3
|
+
export { D as Draft07Codec, c as createDraft07Codec } from './codec-CFWQY9Lj.cjs';
|
|
4
|
+
import { b as DatagramObject, F as FetchStream, S as SubgroupStream, a as Draft07MessageType, D as Draft07Message } from './types-Dl4IaAHR.cjs';
|
|
5
|
+
export { A as Announce, c as AnnounceCancel, d as AnnounceError, e as AnnounceOk, C as ClientSetup, f as DataStreamEvent, g as DataStreamHeader, h as Draft07DataStream, i as Draft07Params, j as Draft07SetupParams, k as Fetch, l as FetchCancel, m as FetchError, n as FetchObjectPayload, o as FetchOk, p as FetchStreamHeader, G as GoAway, M as MaxSubscribeId, O as ObjectDatagram, q as ObjectPayload, r as ServerSetup, s as StreamHeaderSubgroup, t as SubgroupStreamHeader, u as Subscribe, v as SubscribeAnnounces, w as SubscribeAnnouncesError, x as SubscribeAnnouncesOk, y as SubscribeDone, z as SubscribeError, B as SubscribeOk, E as SubscribeUpdate, T as TrackStatus, H as TrackStatusRequest, U as Unannounce, I as UnknownParam, J as Unsubscribe, K as UnsubscribeAnnounces } from './types-Dl4IaAHR.cjs';
|
|
81
6
|
|
|
82
7
|
declare function encodeSubgroupStream(stream: SubgroupStream): Uint8Array;
|
|
83
8
|
declare function encodeDatagram(dg: DatagramObject): Uint8Array;
|
|
@@ -86,63 +11,57 @@ declare function decodeSubgroupStream(bytes: Uint8Array): DecodeResult<SubgroupS
|
|
|
86
11
|
declare function decodeDatagram(bytes: Uint8Array): DecodeResult<DatagramObject>;
|
|
87
12
|
declare function decodeFetchStream(bytes: Uint8Array): DecodeResult<FetchStream>;
|
|
88
13
|
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
declare
|
|
98
|
-
|
|
99
|
-
declare const
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
readonly object_datagram: 1n;
|
|
126
|
-
readonly stream_header_subgroup: 4n;
|
|
127
|
-
readonly fetch_header: 5n;
|
|
128
|
-
};
|
|
129
|
-
declare const MESSAGE_ID_TO_TYPE: Map<bigint, string>;
|
|
14
|
+
declare const MSG_SUBSCRIBE_UPDATE = 2n;
|
|
15
|
+
declare const MSG_SUBSCRIBE = 3n;
|
|
16
|
+
declare const MSG_SUBSCRIBE_OK = 4n;
|
|
17
|
+
declare const MSG_SUBSCRIBE_ERROR = 5n;
|
|
18
|
+
declare const MSG_ANNOUNCE = 6n;
|
|
19
|
+
declare const MSG_ANNOUNCE_OK = 7n;
|
|
20
|
+
declare const MSG_ANNOUNCE_ERROR = 8n;
|
|
21
|
+
declare const MSG_UNANNOUNCE = 9n;
|
|
22
|
+
declare const MSG_UNSUBSCRIBE = 10n;
|
|
23
|
+
declare const MSG_SUBSCRIBE_DONE = 11n;
|
|
24
|
+
declare const MSG_ANNOUNCE_CANCEL = 12n;
|
|
25
|
+
declare const MSG_TRACK_STATUS_REQUEST = 13n;
|
|
26
|
+
declare const MSG_TRACK_STATUS = 14n;
|
|
27
|
+
declare const MSG_GOAWAY = 16n;
|
|
28
|
+
declare const MSG_SUBSCRIBE_ANNOUNCES = 17n;
|
|
29
|
+
declare const MSG_SUBSCRIBE_ANNOUNCES_OK = 18n;
|
|
30
|
+
declare const MSG_SUBSCRIBE_ANNOUNCES_ERROR = 19n;
|
|
31
|
+
declare const MSG_UNSUBSCRIBE_ANNOUNCES = 20n;
|
|
32
|
+
declare const MSG_MAX_SUBSCRIBE_ID = 21n;
|
|
33
|
+
declare const MSG_FETCH = 22n;
|
|
34
|
+
declare const MSG_FETCH_CANCEL = 23n;
|
|
35
|
+
declare const MSG_FETCH_OK = 24n;
|
|
36
|
+
declare const MSG_FETCH_ERROR = 25n;
|
|
37
|
+
declare const MSG_CLIENT_SETUP = 64n;
|
|
38
|
+
declare const MSG_SERVER_SETUP = 65n;
|
|
39
|
+
declare const SETUP_PARAM_ROLE = 0n;
|
|
40
|
+
declare const SETUP_PARAM_PATH = 1n;
|
|
41
|
+
declare const SETUP_PARAM_MAX_SUBSCRIBE_ID = 2n;
|
|
42
|
+
declare const PARAM_AUTHORIZATION_INFO = 2n;
|
|
43
|
+
declare const PARAM_DELIVERY_TIMEOUT = 3n;
|
|
44
|
+
declare const PARAM_MAX_CACHE_DURATION = 4n;
|
|
45
|
+
declare const MSG_OBJECT_DATAGRAM = 1n;
|
|
46
|
+
declare const MSG_STREAM_HEADER_SUBGROUP = 4n;
|
|
47
|
+
declare const MSG_FETCH_HEADER = 5n;
|
|
48
|
+
declare const MESSAGE_TYPE_MAP: ReadonlyMap<bigint, string>;
|
|
49
|
+
declare const MESSAGE_ID_MAP: ReadonlyMap<string, bigint>;
|
|
130
50
|
|
|
131
|
-
declare
|
|
132
|
-
declare
|
|
133
|
-
|
|
134
|
-
declare const
|
|
135
|
-
declare
|
|
136
|
-
declare
|
|
137
|
-
declare const SERVER_ONLY_MESSAGES: ReadonlySet<MoqtMessageType>;
|
|
138
|
-
declare function getLegalOutgoing(phase: string, role: "client" | "server"): Set<MoqtMessageType>;
|
|
139
|
-
declare function getLegalIncoming(phase: string, role: "client" | "server"): Set<MoqtMessageType>;
|
|
51
|
+
declare const CONTROL_MESSAGES: ReadonlySet<Draft07MessageType>;
|
|
52
|
+
declare const DATA_MESSAGES: ReadonlySet<Draft07MessageType>;
|
|
53
|
+
declare const CLIENT_ONLY_MESSAGES: ReadonlySet<Draft07MessageType>;
|
|
54
|
+
declare const SERVER_ONLY_MESSAGES: ReadonlySet<Draft07MessageType>;
|
|
55
|
+
declare function getLegalOutgoing(phase: string, role: 'client' | 'server'): Set<Draft07MessageType>;
|
|
56
|
+
declare function getLegalIncoming(phase: string, role: 'client' | 'server'): Set<Draft07MessageType>;
|
|
140
57
|
|
|
141
58
|
declare function encodeVarInt(value: number | bigint): Uint8Array;
|
|
142
59
|
declare function decodeVarInt(bytes: Uint8Array, offset?: number): DecodeResult<bigint>;
|
|
143
60
|
|
|
144
|
-
declare
|
|
145
|
-
|
|
146
|
-
declare function
|
|
61
|
+
declare const DRAFT_VERSION = 4278190087n;
|
|
62
|
+
|
|
63
|
+
declare function encodeMessage(message: Draft07Message): Uint8Array;
|
|
64
|
+
declare function decodeMessage(bytes: Uint8Array): DecodeResult<Draft07Message>;
|
|
65
|
+
declare function createStreamDecoder(): TransformStream<Uint8Array, Draft07Message>;
|
|
147
66
|
|
|
148
|
-
export { CLIENT_ONLY_MESSAGES, CONTROL_MESSAGES, DATA_MESSAGES,
|
|
67
|
+
export { CLIENT_ONLY_MESSAGES, CONTROL_MESSAGES, DATA_MESSAGES, DRAFT_VERSION, DecodeResult, DatagramObject as Draft07DatagramObject, Draft07Message, Draft07MessageType, FetchStream, MESSAGE_ID_MAP, MESSAGE_TYPE_MAP, MSG_ANNOUNCE, MSG_ANNOUNCE_CANCEL, MSG_ANNOUNCE_ERROR, MSG_ANNOUNCE_OK, MSG_CLIENT_SETUP, MSG_FETCH, MSG_FETCH_CANCEL, MSG_FETCH_ERROR, MSG_FETCH_HEADER, MSG_FETCH_OK, MSG_GOAWAY, MSG_MAX_SUBSCRIBE_ID, MSG_OBJECT_DATAGRAM, MSG_SERVER_SETUP, MSG_STREAM_HEADER_SUBGROUP, MSG_SUBSCRIBE, MSG_SUBSCRIBE_ANNOUNCES, MSG_SUBSCRIBE_ANNOUNCES_ERROR, MSG_SUBSCRIBE_ANNOUNCES_OK, MSG_SUBSCRIBE_DONE, MSG_SUBSCRIBE_ERROR, MSG_SUBSCRIBE_OK, MSG_SUBSCRIBE_UPDATE, MSG_TRACK_STATUS, MSG_TRACK_STATUS_REQUEST, MSG_UNANNOUNCE, MSG_UNSUBSCRIBE, MSG_UNSUBSCRIBE_ANNOUNCES, PARAM_AUTHORIZATION_INFO, PARAM_DELIVERY_TIMEOUT, PARAM_MAX_CACHE_DURATION, SERVER_ONLY_MESSAGES, SETUP_PARAM_MAX_SUBSCRIBE_ID, SETUP_PARAM_PATH, SETUP_PARAM_ROLE, SubgroupStream, createStreamDecoder, decodeDatagram, decodeFetchStream, decodeMessage, decodeSubgroupStream, decodeVarInt, encodeDatagram, encodeFetchStream, encodeMessage, encodeSubgroupStream, encodeVarInt, getLegalIncoming, getLegalOutgoing };
|
package/dist/draft7.d.ts
CHANGED
|
@@ -1,83 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
private readonly view;
|
|
7
|
-
private pos;
|
|
8
|
-
constructor(buffer: Uint8Array, offset?: number);
|
|
9
|
-
get offset(): number;
|
|
10
|
-
get remaining(): number;
|
|
11
|
-
readUint8(): number;
|
|
12
|
-
readBytes(length: number): Uint8Array<ArrayBuffer>;
|
|
13
|
-
/** Zero-copy read: returns a view into the underlying buffer. */
|
|
14
|
-
readBytesView(length: number): Uint8Array<ArrayBuffer>;
|
|
15
|
-
readVarInt(): bigint;
|
|
16
|
-
readString(): string;
|
|
17
|
-
readTuple(): string[];
|
|
18
|
-
readParameters(): Map<bigint, Uint8Array>;
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
interface ObjectPayload {
|
|
22
|
-
readonly type: "object";
|
|
23
|
-
readonly objectId: bigint;
|
|
24
|
-
readonly payloadLength: number;
|
|
25
|
-
readonly status?: bigint;
|
|
26
|
-
readonly payload: Uint8Array;
|
|
27
|
-
readonly byteOffset: number;
|
|
28
|
-
readonly payloadByteOffset: number;
|
|
29
|
-
}
|
|
30
|
-
interface SubgroupStream {
|
|
31
|
-
readonly type: "subgroup";
|
|
32
|
-
readonly streamTypeId: 0x04;
|
|
33
|
-
readonly trackAlias: bigint;
|
|
34
|
-
readonly groupId: bigint;
|
|
35
|
-
readonly subgroupId: bigint;
|
|
36
|
-
readonly publisherPriority: number;
|
|
37
|
-
readonly objects: ObjectPayload[];
|
|
38
|
-
}
|
|
39
|
-
interface DatagramObject {
|
|
40
|
-
readonly type: "datagram";
|
|
41
|
-
readonly streamTypeId: 0x01;
|
|
42
|
-
readonly trackAlias: bigint;
|
|
43
|
-
readonly groupId: bigint;
|
|
44
|
-
readonly objectId: bigint;
|
|
45
|
-
readonly publisherPriority: number;
|
|
46
|
-
readonly payloadLength: number;
|
|
47
|
-
readonly status?: bigint;
|
|
48
|
-
readonly payload: Uint8Array;
|
|
49
|
-
}
|
|
50
|
-
interface FetchObjectPayload {
|
|
51
|
-
readonly type: "object";
|
|
52
|
-
readonly groupId: bigint;
|
|
53
|
-
readonly subgroupId: bigint;
|
|
54
|
-
readonly objectId: bigint;
|
|
55
|
-
readonly publisherPriority: number;
|
|
56
|
-
readonly payloadLength: number;
|
|
57
|
-
readonly status?: bigint;
|
|
58
|
-
readonly payload: Uint8Array;
|
|
59
|
-
readonly byteOffset: number;
|
|
60
|
-
readonly payloadByteOffset: number;
|
|
61
|
-
}
|
|
62
|
-
interface FetchStream {
|
|
63
|
-
readonly type: "fetch";
|
|
64
|
-
readonly subscribeId: bigint;
|
|
65
|
-
readonly objects: FetchObjectPayload[];
|
|
66
|
-
}
|
|
67
|
-
type Draft07DataStream = SubgroupStream | DatagramObject | FetchStream;
|
|
68
|
-
interface SubgroupStreamHeader {
|
|
69
|
-
readonly type: "subgroup_header";
|
|
70
|
-
readonly trackAlias: bigint;
|
|
71
|
-
readonly groupId: bigint;
|
|
72
|
-
readonly subgroupId: bigint;
|
|
73
|
-
readonly publisherPriority: number;
|
|
74
|
-
}
|
|
75
|
-
interface FetchStreamHeader {
|
|
76
|
-
readonly type: "fetch_header";
|
|
77
|
-
readonly subscribeId: bigint;
|
|
78
|
-
}
|
|
79
|
-
type DataStreamHeader = SubgroupStreamHeader | FetchStreamHeader;
|
|
80
|
-
type DataStreamEvent = DataStreamHeader | ObjectPayload;
|
|
1
|
+
import { b as DecodeResult } from './types-DuIO7cWK.js';
|
|
2
|
+
export { D as DecodeError, a as DecodeErrorCode } from './types-DuIO7cWK.js';
|
|
3
|
+
export { D as Draft07Codec, c as createDraft07Codec } from './codec-CewFCsEy.js';
|
|
4
|
+
import { b as DatagramObject, F as FetchStream, S as SubgroupStream, a as Draft07MessageType, D as Draft07Message } from './types-Dl4IaAHR.js';
|
|
5
|
+
export { A as Announce, c as AnnounceCancel, d as AnnounceError, e as AnnounceOk, C as ClientSetup, f as DataStreamEvent, g as DataStreamHeader, h as Draft07DataStream, i as Draft07Params, j as Draft07SetupParams, k as Fetch, l as FetchCancel, m as FetchError, n as FetchObjectPayload, o as FetchOk, p as FetchStreamHeader, G as GoAway, M as MaxSubscribeId, O as ObjectDatagram, q as ObjectPayload, r as ServerSetup, s as StreamHeaderSubgroup, t as SubgroupStreamHeader, u as Subscribe, v as SubscribeAnnounces, w as SubscribeAnnouncesError, x as SubscribeAnnouncesOk, y as SubscribeDone, z as SubscribeError, B as SubscribeOk, E as SubscribeUpdate, T as TrackStatus, H as TrackStatusRequest, U as Unannounce, I as UnknownParam, J as Unsubscribe, K as UnsubscribeAnnounces } from './types-Dl4IaAHR.js';
|
|
81
6
|
|
|
82
7
|
declare function encodeSubgroupStream(stream: SubgroupStream): Uint8Array;
|
|
83
8
|
declare function encodeDatagram(dg: DatagramObject): Uint8Array;
|
|
@@ -86,63 +11,57 @@ declare function decodeSubgroupStream(bytes: Uint8Array): DecodeResult<SubgroupS
|
|
|
86
11
|
declare function decodeDatagram(bytes: Uint8Array): DecodeResult<DatagramObject>;
|
|
87
12
|
declare function decodeFetchStream(bytes: Uint8Array): DecodeResult<FetchStream>;
|
|
88
13
|
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
declare
|
|
98
|
-
|
|
99
|
-
declare const
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
readonly object_datagram: 1n;
|
|
126
|
-
readonly stream_header_subgroup: 4n;
|
|
127
|
-
readonly fetch_header: 5n;
|
|
128
|
-
};
|
|
129
|
-
declare const MESSAGE_ID_TO_TYPE: Map<bigint, string>;
|
|
14
|
+
declare const MSG_SUBSCRIBE_UPDATE = 2n;
|
|
15
|
+
declare const MSG_SUBSCRIBE = 3n;
|
|
16
|
+
declare const MSG_SUBSCRIBE_OK = 4n;
|
|
17
|
+
declare const MSG_SUBSCRIBE_ERROR = 5n;
|
|
18
|
+
declare const MSG_ANNOUNCE = 6n;
|
|
19
|
+
declare const MSG_ANNOUNCE_OK = 7n;
|
|
20
|
+
declare const MSG_ANNOUNCE_ERROR = 8n;
|
|
21
|
+
declare const MSG_UNANNOUNCE = 9n;
|
|
22
|
+
declare const MSG_UNSUBSCRIBE = 10n;
|
|
23
|
+
declare const MSG_SUBSCRIBE_DONE = 11n;
|
|
24
|
+
declare const MSG_ANNOUNCE_CANCEL = 12n;
|
|
25
|
+
declare const MSG_TRACK_STATUS_REQUEST = 13n;
|
|
26
|
+
declare const MSG_TRACK_STATUS = 14n;
|
|
27
|
+
declare const MSG_GOAWAY = 16n;
|
|
28
|
+
declare const MSG_SUBSCRIBE_ANNOUNCES = 17n;
|
|
29
|
+
declare const MSG_SUBSCRIBE_ANNOUNCES_OK = 18n;
|
|
30
|
+
declare const MSG_SUBSCRIBE_ANNOUNCES_ERROR = 19n;
|
|
31
|
+
declare const MSG_UNSUBSCRIBE_ANNOUNCES = 20n;
|
|
32
|
+
declare const MSG_MAX_SUBSCRIBE_ID = 21n;
|
|
33
|
+
declare const MSG_FETCH = 22n;
|
|
34
|
+
declare const MSG_FETCH_CANCEL = 23n;
|
|
35
|
+
declare const MSG_FETCH_OK = 24n;
|
|
36
|
+
declare const MSG_FETCH_ERROR = 25n;
|
|
37
|
+
declare const MSG_CLIENT_SETUP = 64n;
|
|
38
|
+
declare const MSG_SERVER_SETUP = 65n;
|
|
39
|
+
declare const SETUP_PARAM_ROLE = 0n;
|
|
40
|
+
declare const SETUP_PARAM_PATH = 1n;
|
|
41
|
+
declare const SETUP_PARAM_MAX_SUBSCRIBE_ID = 2n;
|
|
42
|
+
declare const PARAM_AUTHORIZATION_INFO = 2n;
|
|
43
|
+
declare const PARAM_DELIVERY_TIMEOUT = 3n;
|
|
44
|
+
declare const PARAM_MAX_CACHE_DURATION = 4n;
|
|
45
|
+
declare const MSG_OBJECT_DATAGRAM = 1n;
|
|
46
|
+
declare const MSG_STREAM_HEADER_SUBGROUP = 4n;
|
|
47
|
+
declare const MSG_FETCH_HEADER = 5n;
|
|
48
|
+
declare const MESSAGE_TYPE_MAP: ReadonlyMap<bigint, string>;
|
|
49
|
+
declare const MESSAGE_ID_MAP: ReadonlyMap<string, bigint>;
|
|
130
50
|
|
|
131
|
-
declare
|
|
132
|
-
declare
|
|
133
|
-
|
|
134
|
-
declare const
|
|
135
|
-
declare
|
|
136
|
-
declare
|
|
137
|
-
declare const SERVER_ONLY_MESSAGES: ReadonlySet<MoqtMessageType>;
|
|
138
|
-
declare function getLegalOutgoing(phase: string, role: "client" | "server"): Set<MoqtMessageType>;
|
|
139
|
-
declare function getLegalIncoming(phase: string, role: "client" | "server"): Set<MoqtMessageType>;
|
|
51
|
+
declare const CONTROL_MESSAGES: ReadonlySet<Draft07MessageType>;
|
|
52
|
+
declare const DATA_MESSAGES: ReadonlySet<Draft07MessageType>;
|
|
53
|
+
declare const CLIENT_ONLY_MESSAGES: ReadonlySet<Draft07MessageType>;
|
|
54
|
+
declare const SERVER_ONLY_MESSAGES: ReadonlySet<Draft07MessageType>;
|
|
55
|
+
declare function getLegalOutgoing(phase: string, role: 'client' | 'server'): Set<Draft07MessageType>;
|
|
56
|
+
declare function getLegalIncoming(phase: string, role: 'client' | 'server'): Set<Draft07MessageType>;
|
|
140
57
|
|
|
141
58
|
declare function encodeVarInt(value: number | bigint): Uint8Array;
|
|
142
59
|
declare function decodeVarInt(bytes: Uint8Array, offset?: number): DecodeResult<bigint>;
|
|
143
60
|
|
|
144
|
-
declare
|
|
145
|
-
|
|
146
|
-
declare function
|
|
61
|
+
declare const DRAFT_VERSION = 4278190087n;
|
|
62
|
+
|
|
63
|
+
declare function encodeMessage(message: Draft07Message): Uint8Array;
|
|
64
|
+
declare function decodeMessage(bytes: Uint8Array): DecodeResult<Draft07Message>;
|
|
65
|
+
declare function createStreamDecoder(): TransformStream<Uint8Array, Draft07Message>;
|
|
147
66
|
|
|
148
|
-
export { CLIENT_ONLY_MESSAGES, CONTROL_MESSAGES, DATA_MESSAGES,
|
|
67
|
+
export { CLIENT_ONLY_MESSAGES, CONTROL_MESSAGES, DATA_MESSAGES, DRAFT_VERSION, DecodeResult, DatagramObject as Draft07DatagramObject, Draft07Message, Draft07MessageType, FetchStream, MESSAGE_ID_MAP, MESSAGE_TYPE_MAP, MSG_ANNOUNCE, MSG_ANNOUNCE_CANCEL, MSG_ANNOUNCE_ERROR, MSG_ANNOUNCE_OK, MSG_CLIENT_SETUP, MSG_FETCH, MSG_FETCH_CANCEL, MSG_FETCH_ERROR, MSG_FETCH_HEADER, MSG_FETCH_OK, MSG_GOAWAY, MSG_MAX_SUBSCRIBE_ID, MSG_OBJECT_DATAGRAM, MSG_SERVER_SETUP, MSG_STREAM_HEADER_SUBGROUP, MSG_SUBSCRIBE, MSG_SUBSCRIBE_ANNOUNCES, MSG_SUBSCRIBE_ANNOUNCES_ERROR, MSG_SUBSCRIBE_ANNOUNCES_OK, MSG_SUBSCRIBE_DONE, MSG_SUBSCRIBE_ERROR, MSG_SUBSCRIBE_OK, MSG_SUBSCRIBE_UPDATE, MSG_TRACK_STATUS, MSG_TRACK_STATUS_REQUEST, MSG_UNANNOUNCE, MSG_UNSUBSCRIBE, MSG_UNSUBSCRIBE_ANNOUNCES, PARAM_AUTHORIZATION_INFO, PARAM_DELIVERY_TIMEOUT, PARAM_MAX_CACHE_DURATION, SERVER_ONLY_MESSAGES, SETUP_PARAM_MAX_SUBSCRIBE_ID, SETUP_PARAM_PATH, SETUP_PARAM_ROLE, SubgroupStream, createStreamDecoder, decodeDatagram, decodeFetchStream, decodeMessage, decodeSubgroupStream, decodeVarInt, encodeDatagram, encodeFetchStream, encodeMessage, encodeSubgroupStream, encodeVarInt, getLegalIncoming, getLegalOutgoing };
|
package/dist/draft7.js
CHANGED
|
@@ -1,6 +1,40 @@
|
|
|
1
1
|
import {
|
|
2
|
-
|
|
3
|
-
|
|
2
|
+
MESSAGE_ID_MAP,
|
|
3
|
+
MESSAGE_TYPE_MAP,
|
|
4
|
+
MSG_ANNOUNCE,
|
|
5
|
+
MSG_ANNOUNCE_CANCEL,
|
|
6
|
+
MSG_ANNOUNCE_ERROR,
|
|
7
|
+
MSG_ANNOUNCE_OK,
|
|
8
|
+
MSG_CLIENT_SETUP,
|
|
9
|
+
MSG_FETCH,
|
|
10
|
+
MSG_FETCH_CANCEL,
|
|
11
|
+
MSG_FETCH_ERROR,
|
|
12
|
+
MSG_FETCH_HEADER,
|
|
13
|
+
MSG_FETCH_OK,
|
|
14
|
+
MSG_GOAWAY,
|
|
15
|
+
MSG_MAX_SUBSCRIBE_ID,
|
|
16
|
+
MSG_OBJECT_DATAGRAM,
|
|
17
|
+
MSG_SERVER_SETUP,
|
|
18
|
+
MSG_STREAM_HEADER_SUBGROUP,
|
|
19
|
+
MSG_SUBSCRIBE,
|
|
20
|
+
MSG_SUBSCRIBE_ANNOUNCES,
|
|
21
|
+
MSG_SUBSCRIBE_ANNOUNCES_ERROR,
|
|
22
|
+
MSG_SUBSCRIBE_ANNOUNCES_OK,
|
|
23
|
+
MSG_SUBSCRIBE_DONE,
|
|
24
|
+
MSG_SUBSCRIBE_ERROR,
|
|
25
|
+
MSG_SUBSCRIBE_OK,
|
|
26
|
+
MSG_SUBSCRIBE_UPDATE,
|
|
27
|
+
MSG_TRACK_STATUS,
|
|
28
|
+
MSG_TRACK_STATUS_REQUEST,
|
|
29
|
+
MSG_UNANNOUNCE,
|
|
30
|
+
MSG_UNSUBSCRIBE,
|
|
31
|
+
MSG_UNSUBSCRIBE_ANNOUNCES,
|
|
32
|
+
PARAM_AUTHORIZATION_INFO,
|
|
33
|
+
PARAM_DELIVERY_TIMEOUT,
|
|
34
|
+
PARAM_MAX_CACHE_DURATION,
|
|
35
|
+
SETUP_PARAM_MAX_SUBSCRIBE_ID,
|
|
36
|
+
SETUP_PARAM_PATH,
|
|
37
|
+
SETUP_PARAM_ROLE,
|
|
4
38
|
createDraft07Codec,
|
|
5
39
|
decodeDatagram,
|
|
6
40
|
decodeFetchStream,
|
|
@@ -10,7 +44,7 @@ import {
|
|
|
10
44
|
encodeFetchStream,
|
|
11
45
|
encodeSubgroupStream,
|
|
12
46
|
encodeVarInt
|
|
13
|
-
} from "./chunk-
|
|
47
|
+
} from "./chunk-7KBAWOBA.js";
|
|
14
48
|
import {
|
|
15
49
|
CLIENT_ONLY_MESSAGES,
|
|
16
50
|
CONTROL_MESSAGES,
|
|
@@ -20,21 +54,11 @@ import {
|
|
|
20
54
|
getLegalOutgoing
|
|
21
55
|
} from "./chunk-C6KUWLQC.js";
|
|
22
56
|
import {
|
|
23
|
-
BufferWriter,
|
|
24
57
|
DecodeError
|
|
25
|
-
} from "./chunk-
|
|
26
|
-
|
|
27
|
-
// src/drafts/draft07/parameters.ts
|
|
28
|
-
function encodeParameters(params) {
|
|
29
|
-
const writer = new BufferWriter();
|
|
30
|
-
writer.writeParameters(params);
|
|
31
|
-
return writer.finish();
|
|
32
|
-
}
|
|
33
|
-
function decodeParameters(reader) {
|
|
34
|
-
return reader.readParameters();
|
|
35
|
-
}
|
|
58
|
+
} from "./chunk-VOU7PNHI.js";
|
|
36
59
|
|
|
37
60
|
// src/drafts/draft07/index.ts
|
|
61
|
+
var DRAFT_VERSION = 0xff000007n;
|
|
38
62
|
var defaultCodec = createDraft07Codec();
|
|
39
63
|
function encodeMessage(message) {
|
|
40
64
|
return defaultCodec.encodeMessage(message);
|
|
@@ -49,22 +73,55 @@ export {
|
|
|
49
73
|
CLIENT_ONLY_MESSAGES,
|
|
50
74
|
CONTROL_MESSAGES,
|
|
51
75
|
DATA_MESSAGES,
|
|
76
|
+
DRAFT_VERSION,
|
|
52
77
|
DecodeError,
|
|
53
|
-
|
|
54
|
-
|
|
78
|
+
MESSAGE_ID_MAP,
|
|
79
|
+
MESSAGE_TYPE_MAP,
|
|
80
|
+
MSG_ANNOUNCE,
|
|
81
|
+
MSG_ANNOUNCE_CANCEL,
|
|
82
|
+
MSG_ANNOUNCE_ERROR,
|
|
83
|
+
MSG_ANNOUNCE_OK,
|
|
84
|
+
MSG_CLIENT_SETUP,
|
|
85
|
+
MSG_FETCH,
|
|
86
|
+
MSG_FETCH_CANCEL,
|
|
87
|
+
MSG_FETCH_ERROR,
|
|
88
|
+
MSG_FETCH_HEADER,
|
|
89
|
+
MSG_FETCH_OK,
|
|
90
|
+
MSG_GOAWAY,
|
|
91
|
+
MSG_MAX_SUBSCRIBE_ID,
|
|
92
|
+
MSG_OBJECT_DATAGRAM,
|
|
93
|
+
MSG_SERVER_SETUP,
|
|
94
|
+
MSG_STREAM_HEADER_SUBGROUP,
|
|
95
|
+
MSG_SUBSCRIBE,
|
|
96
|
+
MSG_SUBSCRIBE_ANNOUNCES,
|
|
97
|
+
MSG_SUBSCRIBE_ANNOUNCES_ERROR,
|
|
98
|
+
MSG_SUBSCRIBE_ANNOUNCES_OK,
|
|
99
|
+
MSG_SUBSCRIBE_DONE,
|
|
100
|
+
MSG_SUBSCRIBE_ERROR,
|
|
101
|
+
MSG_SUBSCRIBE_OK,
|
|
102
|
+
MSG_SUBSCRIBE_UPDATE,
|
|
103
|
+
MSG_TRACK_STATUS,
|
|
104
|
+
MSG_TRACK_STATUS_REQUEST,
|
|
105
|
+
MSG_UNANNOUNCE,
|
|
106
|
+
MSG_UNSUBSCRIBE,
|
|
107
|
+
MSG_UNSUBSCRIBE_ANNOUNCES,
|
|
108
|
+
PARAM_AUTHORIZATION_INFO,
|
|
109
|
+
PARAM_DELIVERY_TIMEOUT,
|
|
110
|
+
PARAM_MAX_CACHE_DURATION,
|
|
55
111
|
SERVER_ONLY_MESSAGES,
|
|
112
|
+
SETUP_PARAM_MAX_SUBSCRIBE_ID,
|
|
113
|
+
SETUP_PARAM_PATH,
|
|
114
|
+
SETUP_PARAM_ROLE,
|
|
56
115
|
createDraft07Codec,
|
|
57
116
|
createStreamDecoder,
|
|
58
117
|
decodeDatagram,
|
|
59
118
|
decodeFetchStream,
|
|
60
119
|
decodeMessage,
|
|
61
|
-
decodeParameters,
|
|
62
120
|
decodeSubgroupStream,
|
|
63
121
|
decodeVarInt,
|
|
64
122
|
encodeDatagram,
|
|
65
123
|
encodeFetchStream,
|
|
66
124
|
encodeMessage,
|
|
67
|
-
encodeParameters,
|
|
68
125
|
encodeSubgroupStream,
|
|
69
126
|
encodeVarInt,
|
|
70
127
|
getLegalIncoming,
|