@moqtap/codec 0.5.0 → 0.7.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/README.md +4 -2
- package/dist/{chunk-CXFAQKL3.js → chunk-23KRITJ6.js} +1 -1
- package/dist/{chunk-JL3NEW3O.cjs → chunk-4XLYCT5Q.cjs} +90 -1
- package/dist/{chunk-DLSGOZ6P.js → chunk-5XZKO2U5.js} +34 -34
- package/dist/chunk-APTV6F72.js +2095 -0
- package/dist/{chunk-JB5VDJ2V.cjs → chunk-B56AG5HU.cjs} +37 -37
- package/dist/chunk-CQ65LKPQ.cjs +446 -0
- package/dist/{chunk-4HBKHNU2.cjs → chunk-CZNW3R5E.cjs} +37 -37
- package/dist/{chunk-Q5D6OW6Q.js → chunk-DORX55MO.js} +1 -1
- package/dist/{chunk-OGZTQA24.cjs → chunk-EQAYMCXO.cjs} +64 -64
- package/dist/{chunk-HYI6LFMD.js → chunk-HEO2JG6C.js} +1 -1
- package/dist/{chunk-UP4XPH4J.js → chunk-I55J3KXD.js} +31 -31
- package/dist/{chunk-HZHSO7EW.cjs → chunk-IDV2JYJ6.cjs} +39 -39
- package/dist/{chunk-BAG6YWCP.cjs → chunk-IEJULBKB.cjs} +63 -63
- package/dist/{chunk-Y6KCSM3V.js → chunk-IJAF6PAY.js} +1 -1
- package/dist/{chunk-WMJVSBBE.cjs → chunk-J3ASFPCX.cjs} +57 -57
- package/dist/{chunk-COWGGUL4.js → chunk-JKMYAUGY.js} +1 -1
- package/dist/{chunk-SIYYMFCC.cjs → chunk-KCH4BQXK.cjs} +37 -37
- package/dist/{chunk-VOU7PNHI.js → chunk-KLPWJU6W.js} +89 -0
- package/dist/{chunk-NZ7GYEMT.js → chunk-KNLPX3YA.js} +1 -1
- package/dist/{chunk-A33U4WVS.cjs → chunk-KTVN4P6J.cjs} +67 -67
- package/dist/{chunk-7KBAWOBA.js → chunk-KYVTM5VI.js} +1 -1
- package/dist/{chunk-RZ3UML47.js → chunk-MD2OA7SE.js} +1 -1
- package/dist/chunk-MH7537FB.cjs +2095 -0
- package/dist/{chunk-SHMA4PBY.js → chunk-N2V7Z37J.js} +1 -1
- package/dist/chunk-O5DQ44TM.js +446 -0
- package/dist/{chunk-HO44OANK.cjs → chunk-QGIHC6BA.cjs} +36 -36
- package/dist/{chunk-PKEOQSSZ.cjs → chunk-RIIA4ALQ.cjs} +37 -37
- package/dist/{chunk-XZE5R57R.cjs → chunk-VZHL2U2N.cjs} +37 -37
- package/dist/{chunk-RW4UG7CN.js → chunk-XHAP2YST.js} +1 -1
- package/dist/{chunk-JTRU76JN.cjs → chunk-Y4FRXYX6.cjs} +59 -59
- package/dist/{codec-yJ_axwtp.d.cts → codec-B1snaM9L.d.cts} +1 -1
- package/dist/{codec-Tdey03Bo.d.ts → codec-BLYAy2OP.d.ts} +1 -1
- package/dist/{codec-DqHwYWM-.d.ts → codec-BNS3gS77.d.ts} +1 -1
- package/dist/{codec-CBLLytyP.d.cts → codec-BOtv3R5j.d.cts} +1 -1
- package/dist/{codec-C17JvsEU.d.cts → codec-BOyrk_C9.d.cts} +1 -1
- package/dist/{codec-BsSNjvB3.d.cts → codec-BqqoYdh_.d.cts} +1 -1
- package/dist/{codec-BhW5CGZq.d.ts → codec-CI0BjmHc.d.ts} +1 -1
- package/dist/{codec-BvzKRqiP.d.ts → codec-CWj5iTxA.d.ts} +1 -1
- package/dist/{codec-DbpLHKXN.d.cts → codec-CyApDKwf.d.cts} +1 -1
- package/dist/{codec-6s9d5yZm.d.ts → codec-D2JbI2tp.d.ts} +1 -1
- package/dist/{codec-BzRIVIzS.d.ts → codec-D47r_-Rl.d.ts} +1 -1
- package/dist/{codec-GayA_uN0.d.ts → codec-D49OofBr.d.ts} +1 -1
- package/dist/{codec-MxIhLDR5.d.cts → codec-D89DWXbv.d.cts} +1 -1
- package/dist/{codec-CzBmYisK.d.cts → codec-D95gT98n.d.cts} +1 -1
- package/dist/codec-DAePx2NL.d.ts +30 -0
- package/dist/{codec-D_9X0i31.d.ts → codec-DJmV04i0.d.ts} +1 -1
- package/dist/{codec-Cbv3sG2y.d.ts → codec-DL0njGkL.d.ts} +1 -1
- package/dist/{codec-D2YMCU11.d.cts → codec-DQWQSam3.d.cts} +1 -1
- package/dist/{codec-Bp4HPezr.d.ts → codec-DplRgIKq.d.ts} +1 -1
- package/dist/{codec-3ZgEK-Yj.d.ts → codec-DujHf55Z.d.ts} +1 -1
- package/dist/{codec-DS-As0Pp.d.cts → codec-DvcJgYKq.d.cts} +1 -1
- package/dist/{codec-D5Ss123f.d.cts → codec-NMsTK0GX.d.cts} +1 -1
- package/dist/{codec-BvSmr-Jp.d.ts → codec-WwwUipaU.d.ts} +1 -1
- package/dist/{codec-B6ouUJrm.d.cts → codec-cou9XBMF.d.cts} +1 -1
- package/dist/{codec-R28KwiGM.d.cts → codec-hvkJfCF5.d.cts} +1 -1
- package/dist/codec-xeuGZY77.d.cts +30 -0
- package/dist/draft07-session.d.cts +3 -3
- package/dist/draft07-session.d.ts +3 -3
- package/dist/draft07.cjs +4 -4
- package/dist/draft07.d.cts +3 -3
- package/dist/draft07.d.ts +3 -3
- package/dist/draft07.js +2 -2
- package/dist/draft08-session.d.cts +3 -3
- package/dist/draft08-session.d.ts +3 -3
- package/dist/draft08.cjs +3 -3
- package/dist/draft08.d.cts +4 -4
- package/dist/draft08.d.ts +4 -4
- package/dist/draft08.js +2 -2
- package/dist/draft09-session.d.cts +3 -3
- package/dist/draft09-session.d.ts +3 -3
- package/dist/draft09.cjs +3 -3
- package/dist/draft09.d.cts +4 -4
- package/dist/draft09.d.ts +4 -4
- package/dist/draft09.js +2 -2
- package/dist/draft10-session.d.cts +3 -3
- package/dist/draft10-session.d.ts +3 -3
- package/dist/draft10.cjs +3 -3
- package/dist/draft10.d.cts +4 -4
- package/dist/draft10.d.ts +4 -4
- package/dist/draft10.js +2 -2
- package/dist/draft11-session.d.cts +3 -3
- package/dist/draft11-session.d.ts +3 -3
- package/dist/draft11.cjs +3 -3
- package/dist/draft11.d.cts +4 -4
- package/dist/draft11.d.ts +4 -4
- package/dist/draft11.js +2 -2
- package/dist/draft12-session.d.cts +3 -3
- package/dist/draft12-session.d.ts +3 -3
- package/dist/draft12.cjs +3 -3
- package/dist/draft12.d.cts +4 -4
- package/dist/draft12.d.ts +4 -4
- package/dist/draft12.js +2 -2
- package/dist/draft13-session.d.cts +3 -3
- package/dist/draft13-session.d.ts +3 -3
- package/dist/draft13.cjs +3 -3
- package/dist/draft13.d.cts +4 -4
- package/dist/draft13.d.ts +4 -4
- package/dist/draft13.js +2 -2
- package/dist/draft14-session.d.cts +3 -3
- package/dist/draft14-session.d.ts +3 -3
- package/dist/draft14.cjs +3 -3
- package/dist/draft14.d.cts +4 -4
- package/dist/draft14.d.ts +4 -4
- package/dist/draft14.js +2 -2
- package/dist/draft15-session.d.cts +3 -3
- package/dist/draft15-session.d.ts +3 -3
- package/dist/draft15.cjs +3 -3
- package/dist/draft15.d.cts +4 -4
- package/dist/draft15.d.ts +4 -4
- package/dist/draft15.js +2 -2
- package/dist/draft16-session.d.cts +3 -3
- package/dist/draft16-session.d.ts +3 -3
- package/dist/draft16.cjs +3 -3
- package/dist/draft16.d.cts +4 -4
- package/dist/draft16.d.ts +4 -4
- package/dist/draft16.js +2 -2
- package/dist/draft17-session.d.cts +3 -3
- package/dist/draft17-session.d.ts +3 -3
- package/dist/draft17.cjs +3 -3
- package/dist/draft17.d.cts +3 -3
- package/dist/draft17.d.ts +3 -3
- package/dist/draft17.js +2 -2
- package/dist/draft18-session.d.cts +3 -3
- package/dist/draft18-session.d.ts +3 -3
- package/dist/draft18.cjs +3 -3
- package/dist/draft18.d.cts +3 -3
- package/dist/draft18.d.ts +3 -3
- package/dist/draft18.js +2 -2
- package/dist/draft19-session.cjs +8 -0
- package/dist/draft19-session.d.cts +50 -0
- package/dist/draft19-session.d.ts +50 -0
- package/dist/draft19-session.js +8 -0
- package/dist/draft19.cjs +189 -0
- package/dist/draft19.d.cts +130 -0
- package/dist/draft19.d.ts +130 -0
- package/dist/draft19.js +189 -0
- package/dist/index.cjs +33 -27
- package/dist/index.d.cts +20 -15
- package/dist/index.d.ts +20 -15
- package/dist/index.js +20 -14
- package/dist/{session-types-DBpCRtrL.d.ts → session-types-C0l_-Ups.d.ts} +1 -1
- package/dist/{session-types-sBaTRwDh.d.cts → session-types-KsqyVp6y.d.cts} +1 -1
- package/dist/session.cjs +5 -1
- package/dist/session.d.cts +5 -3
- package/dist/session.d.ts +5 -3
- package/dist/session.js +5 -1
- package/dist/{types-CnBuq68e.d.cts → types-CdCSIfvI.d.cts} +1 -1
- package/dist/{types-CnBuq68e.d.ts → types-CdCSIfvI.d.ts} +1 -1
- package/dist/types-zHgCS6o5.d.cts +265 -0
- package/dist/types-zHgCS6o5.d.ts +265 -0
- package/package.json +14 -2
- package/src/core/buffer-reader.ts +74 -2
- package/src/core/buffer-writer.ts +56 -4
- package/src/core/types.ts +1 -0
- package/src/drafts/draft17/codec.ts +2 -2
- package/src/drafts/draft17/data-streams.ts +2 -2
- package/src/drafts/draft18/codec.ts +2 -2
- package/src/drafts/draft18/data-streams.ts +2 -2
- package/src/drafts/draft19/codec.ts +1425 -0
- package/src/drafts/draft19/data-streams.ts +996 -0
- package/src/drafts/draft19/error-codes.ts +78 -0
- package/src/drafts/draft19/index.ts +126 -0
- package/src/drafts/draft19/messages.ts +58 -0
- package/src/drafts/draft19/rules.ts +85 -0
- package/src/drafts/draft19/session-fsm.ts +451 -0
- package/src/drafts/draft19/session.ts +15 -0
- package/src/drafts/draft19/types.ts +368 -0
- package/src/index.ts +9 -1
- package/src/session.ts +4 -0
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
|
|
7
|
-
var
|
|
7
|
+
var _chunk4XLYCT5Qcjs = require('./chunk-4XLYCT5Q.cjs');
|
|
8
8
|
|
|
9
9
|
// src/drafts/draft14/messages.ts
|
|
10
10
|
var MSG_SUBSCRIBE_UPDATE = 0x02n;
|
|
@@ -101,7 +101,7 @@ function isValidSubgroupType(t) {
|
|
|
101
101
|
return t >= 16 && t <= 21 || t >= 24 && t <= 29;
|
|
102
102
|
}
|
|
103
103
|
function encodeSubgroupStream(stream) {
|
|
104
|
-
const w = new (0,
|
|
104
|
+
const w = new (0, _chunk4XLYCT5Qcjs.BufferWriter)();
|
|
105
105
|
w.writeVarInt(BigInt(stream.headerType));
|
|
106
106
|
w.writeVarInt(stream.trackAlias);
|
|
107
107
|
w.writeVarInt(stream.groupId);
|
|
@@ -133,7 +133,7 @@ function encodeSubgroupStream(stream) {
|
|
|
133
133
|
return w.finish();
|
|
134
134
|
}
|
|
135
135
|
function encodeDatagram(dg) {
|
|
136
|
-
const w = new (0,
|
|
136
|
+
const w = new (0, _chunk4XLYCT5Qcjs.BufferWriter)();
|
|
137
137
|
w.writeVarInt(BigInt(dg.datagramType));
|
|
138
138
|
w.writeVarInt(dg.trackAlias);
|
|
139
139
|
w.writeVarInt(dg.groupId);
|
|
@@ -157,7 +157,7 @@ function encodeDatagram(dg) {
|
|
|
157
157
|
return w.finish();
|
|
158
158
|
}
|
|
159
159
|
function encodeFetchStream(stream) {
|
|
160
|
-
const w = new (0,
|
|
160
|
+
const w = new (0, _chunk4XLYCT5Qcjs.BufferWriter)();
|
|
161
161
|
w.writeVarInt(FETCH_STREAM_TYPE);
|
|
162
162
|
w.writeVarInt(stream.requestId);
|
|
163
163
|
for (const obj of stream.objects) {
|
|
@@ -179,12 +179,12 @@ function encodeFetchStream(stream) {
|
|
|
179
179
|
}
|
|
180
180
|
function decodeSubgroupStream(bytes) {
|
|
181
181
|
try {
|
|
182
|
-
const r = new (0,
|
|
182
|
+
const r = new (0, _chunk4XLYCT5Qcjs.BufferReader)(bytes);
|
|
183
183
|
const streamType = Number(r.readVarInt());
|
|
184
184
|
if (!isValidSubgroupType(streamType)) {
|
|
185
185
|
return {
|
|
186
186
|
ok: false,
|
|
187
|
-
error: new (0,
|
|
187
|
+
error: new (0, _chunk4XLYCT5Qcjs.DecodeError)(
|
|
188
188
|
"CONSTRAINT_VIOLATION",
|
|
189
189
|
`Expected subgroup stream type 0x10-0x1D, got 0x${streamType.toString(16)}`,
|
|
190
190
|
0
|
|
@@ -261,19 +261,19 @@ function decodeSubgroupStream(bytes) {
|
|
|
261
261
|
bytesRead: r.offset
|
|
262
262
|
};
|
|
263
263
|
} catch (e) {
|
|
264
|
-
if (e instanceof
|
|
264
|
+
if (e instanceof _chunk4XLYCT5Qcjs.DecodeError) return { ok: false, error: e };
|
|
265
265
|
throw e;
|
|
266
266
|
}
|
|
267
267
|
}
|
|
268
268
|
function decodeDatagram(bytes) {
|
|
269
269
|
try {
|
|
270
|
-
const r = new (0,
|
|
270
|
+
const r = new (0, _chunk4XLYCT5Qcjs.BufferReader)(bytes);
|
|
271
271
|
const dgType = Number(r.readVarInt());
|
|
272
272
|
const validDatagram = dgType >= 0 && dgType <= 7 || dgType === 32 || dgType === 33;
|
|
273
273
|
if (!validDatagram) {
|
|
274
274
|
return {
|
|
275
275
|
ok: false,
|
|
276
|
-
error: new (0,
|
|
276
|
+
error: new (0, _chunk4XLYCT5Qcjs.DecodeError)(
|
|
277
277
|
"CONSTRAINT_VIOLATION",
|
|
278
278
|
`Expected datagram type 0x00-0x07 or 0x20-0x21, got 0x${dgType.toString(16)}`,
|
|
279
279
|
0
|
|
@@ -322,18 +322,18 @@ function decodeDatagram(bytes) {
|
|
|
322
322
|
result.extensionData = extensionData;
|
|
323
323
|
return { ok: true, value: result, bytesRead: r.offset };
|
|
324
324
|
} catch (e) {
|
|
325
|
-
if (e instanceof
|
|
325
|
+
if (e instanceof _chunk4XLYCT5Qcjs.DecodeError) return { ok: false, error: e };
|
|
326
326
|
throw e;
|
|
327
327
|
}
|
|
328
328
|
}
|
|
329
329
|
function decodeFetchStream(bytes) {
|
|
330
330
|
try {
|
|
331
|
-
const r = new (0,
|
|
331
|
+
const r = new (0, _chunk4XLYCT5Qcjs.BufferReader)(bytes);
|
|
332
332
|
const streamType = r.readVarInt();
|
|
333
333
|
if (streamType !== FETCH_STREAM_TYPE) {
|
|
334
334
|
return {
|
|
335
335
|
ok: false,
|
|
336
|
-
error: new (0,
|
|
336
|
+
error: new (0, _chunk4XLYCT5Qcjs.DecodeError)(
|
|
337
337
|
"CONSTRAINT_VIOLATION",
|
|
338
338
|
`Expected fetch stream type 0x05, got 0x${streamType.toString(16)}`,
|
|
339
339
|
0
|
|
@@ -383,7 +383,7 @@ function decodeFetchStream(bytes) {
|
|
|
383
383
|
bytesRead: r.offset
|
|
384
384
|
};
|
|
385
385
|
} catch (e) {
|
|
386
|
-
if (e instanceof
|
|
386
|
+
if (e instanceof _chunk4XLYCT5Qcjs.DecodeError) return { ok: false, error: e };
|
|
387
387
|
throw e;
|
|
388
388
|
}
|
|
389
389
|
}
|
|
@@ -420,11 +420,11 @@ function createSubgroupStreamDecoder() {
|
|
|
420
420
|
buffer = newBuffer;
|
|
421
421
|
if (!headerEmitted) {
|
|
422
422
|
try {
|
|
423
|
-
const r = new (0,
|
|
423
|
+
const r = new (0, _chunk4XLYCT5Qcjs.BufferReader)(buffer.subarray(offset));
|
|
424
424
|
const streamType = Number(r.readVarInt());
|
|
425
425
|
if (!isValidSubgroupType(streamType)) {
|
|
426
426
|
controller.error(
|
|
427
|
-
new (0,
|
|
427
|
+
new (0, _chunk4XLYCT5Qcjs.DecodeError)(
|
|
428
428
|
"CONSTRAINT_VIOLATION",
|
|
429
429
|
`Expected subgroup stream type 0x10-0x1D, got 0x${streamType.toString(16)}`,
|
|
430
430
|
0
|
|
@@ -452,7 +452,7 @@ function createSubgroupStreamDecoder() {
|
|
|
452
452
|
headerEmitted = true;
|
|
453
453
|
offset += r.offset;
|
|
454
454
|
} catch (e) {
|
|
455
|
-
if (e instanceof
|
|
455
|
+
if (e instanceof _chunk4XLYCT5Qcjs.DecodeError && e.code === "UNEXPECTED_END") {
|
|
456
456
|
return;
|
|
457
457
|
}
|
|
458
458
|
controller.error(e);
|
|
@@ -461,7 +461,7 @@ function createSubgroupStreamDecoder() {
|
|
|
461
461
|
}
|
|
462
462
|
while (offset < buffer.length) {
|
|
463
463
|
try {
|
|
464
|
-
const r = new (0,
|
|
464
|
+
const r = new (0, _chunk4XLYCT5Qcjs.BufferReader)(buffer.subarray(offset));
|
|
465
465
|
const byteOffset = r.offset;
|
|
466
466
|
const delta = r.readVarInt();
|
|
467
467
|
const objectId = firstObject ? delta : prevObjectId + 1n + delta;
|
|
@@ -497,7 +497,7 @@ function createSubgroupStreamDecoder() {
|
|
|
497
497
|
prevObjectId = objectId;
|
|
498
498
|
offset += r.offset;
|
|
499
499
|
} catch (e) {
|
|
500
|
-
if (e instanceof
|
|
500
|
+
if (e instanceof _chunk4XLYCT5Qcjs.DecodeError && e.code === "UNEXPECTED_END") {
|
|
501
501
|
break;
|
|
502
502
|
}
|
|
503
503
|
controller.error(e);
|
|
@@ -507,7 +507,7 @@ function createSubgroupStreamDecoder() {
|
|
|
507
507
|
},
|
|
508
508
|
flush(controller) {
|
|
509
509
|
if (offset < buffer.length) {
|
|
510
|
-
controller.error(new (0,
|
|
510
|
+
controller.error(new (0, _chunk4XLYCT5Qcjs.DecodeError)("UNEXPECTED_END", "Stream ended with incomplete data", 0));
|
|
511
511
|
}
|
|
512
512
|
}
|
|
513
513
|
});
|
|
@@ -528,11 +528,11 @@ function createFetchStreamDecoder() {
|
|
|
528
528
|
buffer = newBuffer;
|
|
529
529
|
if (!headerEmitted) {
|
|
530
530
|
try {
|
|
531
|
-
const r = new (0,
|
|
531
|
+
const r = new (0, _chunk4XLYCT5Qcjs.BufferReader)(buffer.subarray(offset));
|
|
532
532
|
const streamType = r.readVarInt();
|
|
533
533
|
if (streamType !== FETCH_STREAM_TYPE) {
|
|
534
534
|
controller.error(
|
|
535
|
-
new (0,
|
|
535
|
+
new (0, _chunk4XLYCT5Qcjs.DecodeError)(
|
|
536
536
|
"CONSTRAINT_VIOLATION",
|
|
537
537
|
`Expected fetch stream type 0x05, got 0x${streamType.toString(16)}`,
|
|
538
538
|
0
|
|
@@ -545,7 +545,7 @@ function createFetchStreamDecoder() {
|
|
|
545
545
|
headerEmitted = true;
|
|
546
546
|
offset += r.offset;
|
|
547
547
|
} catch (e) {
|
|
548
|
-
if (e instanceof
|
|
548
|
+
if (e instanceof _chunk4XLYCT5Qcjs.DecodeError && e.code === "UNEXPECTED_END") {
|
|
549
549
|
return;
|
|
550
550
|
}
|
|
551
551
|
controller.error(e);
|
|
@@ -554,7 +554,7 @@ function createFetchStreamDecoder() {
|
|
|
554
554
|
}
|
|
555
555
|
while (offset < buffer.length) {
|
|
556
556
|
try {
|
|
557
|
-
const r = new (0,
|
|
557
|
+
const r = new (0, _chunk4XLYCT5Qcjs.BufferReader)(buffer.subarray(offset));
|
|
558
558
|
const byteOffset = r.offset;
|
|
559
559
|
const groupId = r.readVarInt();
|
|
560
560
|
const subgroupId = r.readVarInt();
|
|
@@ -590,7 +590,7 @@ function createFetchStreamDecoder() {
|
|
|
590
590
|
controller.enqueue(obj);
|
|
591
591
|
offset += r.offset;
|
|
592
592
|
} catch (e) {
|
|
593
|
-
if (e instanceof
|
|
593
|
+
if (e instanceof _chunk4XLYCT5Qcjs.DecodeError && e.code === "UNEXPECTED_END") {
|
|
594
594
|
break;
|
|
595
595
|
}
|
|
596
596
|
controller.error(e);
|
|
@@ -600,7 +600,7 @@ function createFetchStreamDecoder() {
|
|
|
600
600
|
},
|
|
601
601
|
flush(controller) {
|
|
602
602
|
if (offset < buffer.length) {
|
|
603
|
-
controller.error(new (0,
|
|
603
|
+
controller.error(new (0, _chunk4XLYCT5Qcjs.DecodeError)("UNEXPECTED_END", "Stream ended with incomplete data", 0));
|
|
604
604
|
}
|
|
605
605
|
}
|
|
606
606
|
});
|
|
@@ -625,7 +625,7 @@ function createDataStreamDecoder() {
|
|
|
625
625
|
buffer = newBuffer;
|
|
626
626
|
if (detectedType === null) {
|
|
627
627
|
try {
|
|
628
|
-
const r = new (0,
|
|
628
|
+
const r = new (0, _chunk4XLYCT5Qcjs.BufferReader)(buffer.subarray(offset));
|
|
629
629
|
const streamType = Number(r.readVarInt());
|
|
630
630
|
if (isValidSubgroupType(streamType)) {
|
|
631
631
|
detectedType = "subgroup";
|
|
@@ -633,7 +633,7 @@ function createDataStreamDecoder() {
|
|
|
633
633
|
detectedType = "fetch";
|
|
634
634
|
} else {
|
|
635
635
|
controller.error(
|
|
636
|
-
new (0,
|
|
636
|
+
new (0, _chunk4XLYCT5Qcjs.DecodeError)(
|
|
637
637
|
"CONSTRAINT_VIOLATION",
|
|
638
638
|
`Unknown data stream type: 0x${streamType.toString(16)}`,
|
|
639
639
|
0
|
|
@@ -642,7 +642,7 @@ function createDataStreamDecoder() {
|
|
|
642
642
|
return;
|
|
643
643
|
}
|
|
644
644
|
} catch (e) {
|
|
645
|
-
if (e instanceof
|
|
645
|
+
if (e instanceof _chunk4XLYCT5Qcjs.DecodeError && e.code === "UNEXPECTED_END") {
|
|
646
646
|
return;
|
|
647
647
|
}
|
|
648
648
|
controller.error(e);
|
|
@@ -652,7 +652,7 @@ function createDataStreamDecoder() {
|
|
|
652
652
|
if (detectedType === "subgroup") {
|
|
653
653
|
if (!headerEmitted) {
|
|
654
654
|
try {
|
|
655
|
-
const r = new (0,
|
|
655
|
+
const r = new (0, _chunk4XLYCT5Qcjs.BufferReader)(buffer.subarray(offset));
|
|
656
656
|
const streamType = Number(r.readVarInt());
|
|
657
657
|
extensionsPresent = (streamType & 1) !== 0;
|
|
658
658
|
const hasSubgroupField = (streamType & 4) !== 0;
|
|
@@ -672,14 +672,14 @@ function createDataStreamDecoder() {
|
|
|
672
672
|
headerEmitted = true;
|
|
673
673
|
offset += r.offset;
|
|
674
674
|
} catch (e) {
|
|
675
|
-
if (e instanceof
|
|
675
|
+
if (e instanceof _chunk4XLYCT5Qcjs.DecodeError && e.code === "UNEXPECTED_END") return;
|
|
676
676
|
controller.error(e);
|
|
677
677
|
return;
|
|
678
678
|
}
|
|
679
679
|
}
|
|
680
680
|
while (offset < buffer.length) {
|
|
681
681
|
try {
|
|
682
|
-
const r = new (0,
|
|
682
|
+
const r = new (0, _chunk4XLYCT5Qcjs.BufferReader)(buffer.subarray(offset));
|
|
683
683
|
const byteOffset = r.offset;
|
|
684
684
|
const delta = r.readVarInt();
|
|
685
685
|
const objectId = firstObject ? delta : prevObjectId + 1n + delta;
|
|
@@ -715,7 +715,7 @@ function createDataStreamDecoder() {
|
|
|
715
715
|
prevObjectId = objectId;
|
|
716
716
|
offset += r.offset;
|
|
717
717
|
} catch (e) {
|
|
718
|
-
if (e instanceof
|
|
718
|
+
if (e instanceof _chunk4XLYCT5Qcjs.DecodeError && e.code === "UNEXPECTED_END") break;
|
|
719
719
|
controller.error(e);
|
|
720
720
|
return;
|
|
721
721
|
}
|
|
@@ -723,21 +723,21 @@ function createDataStreamDecoder() {
|
|
|
723
723
|
} else {
|
|
724
724
|
if (!headerEmitted) {
|
|
725
725
|
try {
|
|
726
|
-
const r = new (0,
|
|
726
|
+
const r = new (0, _chunk4XLYCT5Qcjs.BufferReader)(buffer.subarray(offset));
|
|
727
727
|
r.readVarInt();
|
|
728
728
|
const requestId = r.readVarInt();
|
|
729
729
|
controller.enqueue({ type: "fetch_header", requestId });
|
|
730
730
|
headerEmitted = true;
|
|
731
731
|
offset += r.offset;
|
|
732
732
|
} catch (e) {
|
|
733
|
-
if (e instanceof
|
|
733
|
+
if (e instanceof _chunk4XLYCT5Qcjs.DecodeError && e.code === "UNEXPECTED_END") return;
|
|
734
734
|
controller.error(e);
|
|
735
735
|
return;
|
|
736
736
|
}
|
|
737
737
|
}
|
|
738
738
|
while (offset < buffer.length) {
|
|
739
739
|
try {
|
|
740
|
-
const r = new (0,
|
|
740
|
+
const r = new (0, _chunk4XLYCT5Qcjs.BufferReader)(buffer.subarray(offset));
|
|
741
741
|
const byteOffset = r.offset;
|
|
742
742
|
const groupId = r.readVarInt();
|
|
743
743
|
const subgroupId = r.readVarInt();
|
|
@@ -773,7 +773,7 @@ function createDataStreamDecoder() {
|
|
|
773
773
|
controller.enqueue(obj);
|
|
774
774
|
offset += r.offset;
|
|
775
775
|
} catch (e) {
|
|
776
|
-
if (e instanceof
|
|
776
|
+
if (e instanceof _chunk4XLYCT5Qcjs.DecodeError && e.code === "UNEXPECTED_END") break;
|
|
777
777
|
controller.error(e);
|
|
778
778
|
return;
|
|
779
779
|
}
|
|
@@ -782,7 +782,7 @@ function createDataStreamDecoder() {
|
|
|
782
782
|
},
|
|
783
783
|
flush(controller) {
|
|
784
784
|
if (offset < buffer.length) {
|
|
785
|
-
controller.error(new (0,
|
|
785
|
+
controller.error(new (0, _chunk4XLYCT5Qcjs.DecodeError)("UNEXPECTED_END", "Stream ended with incomplete data", 0));
|
|
786
786
|
}
|
|
787
787
|
}
|
|
788
788
|
});
|
|
@@ -824,7 +824,7 @@ function encodeSetupParams(params, writer) {
|
|
|
824
824
|
if (params.authorization_token !== void 0) {
|
|
825
825
|
writer.writeVarInt(PARAM_AUTHORIZATION_TOKEN);
|
|
826
826
|
const tok = params.authorization_token;
|
|
827
|
-
const tmpWriter = new (0,
|
|
827
|
+
const tmpWriter = new (0, _chunk4XLYCT5Qcjs.BufferWriter)(64);
|
|
828
828
|
tmpWriter.writeVarInt(tok.alias_type);
|
|
829
829
|
if (tok.token_type !== void 0) {
|
|
830
830
|
tmpWriter.writeVarInt(tok.token_type);
|
|
@@ -859,7 +859,7 @@ function encodeSetupParams(params, writer) {
|
|
|
859
859
|
for (const u of params.unknown) {
|
|
860
860
|
const id = BigInt(u.id);
|
|
861
861
|
writer.writeVarInt(id);
|
|
862
|
-
const raw =
|
|
862
|
+
const raw = _chunk4XLYCT5Qcjs.hexToBytes.call(void 0, u.raw_hex);
|
|
863
863
|
writer.writeVarInt(raw.byteLength);
|
|
864
864
|
writer.writeBytes(raw);
|
|
865
865
|
}
|
|
@@ -880,13 +880,13 @@ function decodeSetupParams(reader) {
|
|
|
880
880
|
} else if (paramType === PARAM_MAX_AUTH_TOKEN_CACHE_SIZE) {
|
|
881
881
|
result.max_auth_token_cache_size = value;
|
|
882
882
|
} else {
|
|
883
|
-
const tmpWriter = new (0,
|
|
883
|
+
const tmpWriter = new (0, _chunk4XLYCT5Qcjs.BufferWriter)(16);
|
|
884
884
|
tmpWriter.writeVarInt(value);
|
|
885
885
|
const raw = tmpWriter.finish();
|
|
886
886
|
unknown.push({
|
|
887
887
|
id: `0x${paramType.toString(16)}`,
|
|
888
888
|
length: raw.byteLength,
|
|
889
|
-
raw_hex:
|
|
889
|
+
raw_hex: _chunk4XLYCT5Qcjs.bytesToHex.call(void 0, raw)
|
|
890
890
|
});
|
|
891
891
|
}
|
|
892
892
|
} else {
|
|
@@ -895,7 +895,7 @@ function decodeSetupParams(reader) {
|
|
|
895
895
|
if (paramType === PARAM_PATH) {
|
|
896
896
|
result.path = textDecoder.decode(bytes);
|
|
897
897
|
} else if (paramType === PARAM_AUTHORIZATION_TOKEN) {
|
|
898
|
-
const tokenReader = new (0,
|
|
898
|
+
const tokenReader = new (0, _chunk4XLYCT5Qcjs.BufferReader)(bytes);
|
|
899
899
|
const alias_type = tokenReader.readVarInt();
|
|
900
900
|
const tok = { alias_type };
|
|
901
901
|
if (tokenReader.remaining > 0) {
|
|
@@ -914,7 +914,7 @@ function decodeSetupParams(reader) {
|
|
|
914
914
|
unknown.push({
|
|
915
915
|
id: `0x${paramType.toString(16)}`,
|
|
916
916
|
length,
|
|
917
|
-
raw_hex:
|
|
917
|
+
raw_hex: _chunk4XLYCT5Qcjs.bytesToHex.call(void 0, bytes)
|
|
918
918
|
});
|
|
919
919
|
}
|
|
920
920
|
}
|
|
@@ -936,7 +936,7 @@ function encodeMessageParams(params, writer) {
|
|
|
936
936
|
if (params.authorization_token !== void 0) {
|
|
937
937
|
writer.writeVarInt(PARAM_AUTHORIZATION_TOKEN);
|
|
938
938
|
const tok = params.authorization_token;
|
|
939
|
-
const tmpWriter = new (0,
|
|
939
|
+
const tmpWriter = new (0, _chunk4XLYCT5Qcjs.BufferWriter)(64);
|
|
940
940
|
tmpWriter.writeVarInt(tok.alias_type);
|
|
941
941
|
if (tok.token_type !== void 0) {
|
|
942
942
|
tmpWriter.writeVarInt(tok.token_type);
|
|
@@ -959,7 +959,7 @@ function encodeMessageParams(params, writer) {
|
|
|
959
959
|
for (const u of params.unknown) {
|
|
960
960
|
const id = BigInt(u.id);
|
|
961
961
|
writer.writeVarInt(id);
|
|
962
|
-
const raw =
|
|
962
|
+
const raw = _chunk4XLYCT5Qcjs.hexToBytes.call(void 0, u.raw_hex);
|
|
963
963
|
writer.writeVarInt(raw.byteLength);
|
|
964
964
|
writer.writeBytes(raw);
|
|
965
965
|
}
|
|
@@ -978,20 +978,20 @@ function decodeMessageParams(reader) {
|
|
|
978
978
|
} else if (paramType === PARAM_MAX_CACHE_DURATION) {
|
|
979
979
|
result.max_cache_duration = value;
|
|
980
980
|
} else {
|
|
981
|
-
const tmpWriter = new (0,
|
|
981
|
+
const tmpWriter = new (0, _chunk4XLYCT5Qcjs.BufferWriter)(16);
|
|
982
982
|
tmpWriter.writeVarInt(value);
|
|
983
983
|
const raw = tmpWriter.finish();
|
|
984
984
|
unknown.push({
|
|
985
985
|
id: `0x${paramType.toString(16)}`,
|
|
986
986
|
length: raw.byteLength,
|
|
987
|
-
raw_hex:
|
|
987
|
+
raw_hex: _chunk4XLYCT5Qcjs.bytesToHex.call(void 0, raw)
|
|
988
988
|
});
|
|
989
989
|
}
|
|
990
990
|
} else {
|
|
991
991
|
const length = Number(reader.readVarInt());
|
|
992
992
|
const bytes = reader.readBytes(length);
|
|
993
993
|
if (paramType === PARAM_AUTHORIZATION_TOKEN) {
|
|
994
|
-
const tokenReader = new (0,
|
|
994
|
+
const tokenReader = new (0, _chunk4XLYCT5Qcjs.BufferReader)(bytes);
|
|
995
995
|
const alias_type = tokenReader.readVarInt();
|
|
996
996
|
const tok = { alias_type };
|
|
997
997
|
if (tokenReader.remaining > 0) {
|
|
@@ -1006,7 +1006,7 @@ function decodeMessageParams(reader) {
|
|
|
1006
1006
|
unknown.push({
|
|
1007
1007
|
id: `0x${paramType.toString(16)}`,
|
|
1008
1008
|
length,
|
|
1009
|
-
raw_hex:
|
|
1009
|
+
raw_hex: _chunk4XLYCT5Qcjs.bytesToHex.call(void 0, bytes)
|
|
1010
1010
|
});
|
|
1011
1011
|
}
|
|
1012
1012
|
}
|
|
@@ -1232,7 +1232,7 @@ function encodeRequestsBlockedPayload(msg, w) {
|
|
|
1232
1232
|
function decodeClientSetupPayload(r) {
|
|
1233
1233
|
const numVersions = Number(r.readVarInt());
|
|
1234
1234
|
if (numVersions === 0) {
|
|
1235
|
-
throw new (0,
|
|
1235
|
+
throw new (0, _chunk4XLYCT5Qcjs.DecodeError)(
|
|
1236
1236
|
"CONSTRAINT_VIOLATION",
|
|
1237
1237
|
"CLIENT_SETUP must offer at least one version",
|
|
1238
1238
|
r.offset
|
|
@@ -1259,7 +1259,7 @@ function decodeSubscribePayload(r) {
|
|
|
1259
1259
|
const forward = r.readVarInt();
|
|
1260
1260
|
const filter_type = r.readVarInt();
|
|
1261
1261
|
if (filter_type < FilterType.NextGroupStart || filter_type > FilterType.AbsoluteRange) {
|
|
1262
|
-
throw new (0,
|
|
1262
|
+
throw new (0, _chunk4XLYCT5Qcjs.DecodeError)("CONSTRAINT_VIOLATION", `Invalid filter_type: ${filter_type}`, r.offset);
|
|
1263
1263
|
}
|
|
1264
1264
|
let start_group;
|
|
1265
1265
|
let start_object;
|
|
@@ -1497,7 +1497,7 @@ function decodeFetchPayload(r) {
|
|
|
1497
1497
|
const group_order = BigInt(r.readUint8());
|
|
1498
1498
|
const fetch_type = r.readVarInt();
|
|
1499
1499
|
if (fetch_type < FetchType.Standalone || fetch_type > FetchType.AbsoluteJoining) {
|
|
1500
|
-
throw new (0,
|
|
1500
|
+
throw new (0, _chunk4XLYCT5Qcjs.DecodeError)("CONSTRAINT_VIOLATION", `Invalid fetch_type: ${fetch_type}`, r.offset);
|
|
1501
1501
|
}
|
|
1502
1502
|
if (fetch_type === FetchType.Standalone) {
|
|
1503
1503
|
const track_namespace = r.readTuple();
|
|
@@ -1675,13 +1675,13 @@ function encodeMessage(message) {
|
|
|
1675
1675
|
if (typeId === void 0) {
|
|
1676
1676
|
throw new Error(`Unknown message type: ${message.type}`);
|
|
1677
1677
|
}
|
|
1678
|
-
const payloadWriter = new (0,
|
|
1678
|
+
const payloadWriter = new (0, _chunk4XLYCT5Qcjs.BufferWriter)();
|
|
1679
1679
|
encodePayload(message, payloadWriter);
|
|
1680
1680
|
const payload = payloadWriter.finishView();
|
|
1681
1681
|
if (payload.byteLength > 65535) {
|
|
1682
1682
|
throw new Error(`Payload too large for 16-bit length: ${payload.byteLength}`);
|
|
1683
1683
|
}
|
|
1684
|
-
const writer = new (0,
|
|
1684
|
+
const writer = new (0, _chunk4XLYCT5Qcjs.BufferWriter)(payload.byteLength + 16);
|
|
1685
1685
|
writer.writeVarInt(typeId);
|
|
1686
1686
|
writer.writeUint8(payload.byteLength >> 8 & 255);
|
|
1687
1687
|
writer.writeUint8(payload.byteLength & 255);
|
|
@@ -1758,18 +1758,18 @@ function encodePayload(msg, w) {
|
|
|
1758
1758
|
}
|
|
1759
1759
|
function decodeMessage(bytes) {
|
|
1760
1760
|
try {
|
|
1761
|
-
const reader = new (0,
|
|
1761
|
+
const reader = new (0, _chunk4XLYCT5Qcjs.BufferReader)(bytes);
|
|
1762
1762
|
const typeId = reader.readVarInt();
|
|
1763
1763
|
const lenHi = reader.readUint8();
|
|
1764
1764
|
const lenLo = reader.readUint8();
|
|
1765
1765
|
const payloadLength = lenHi << 8 | lenLo;
|
|
1766
1766
|
const payloadBytes = reader.readBytes(payloadLength);
|
|
1767
|
-
const payloadReader = new (0,
|
|
1767
|
+
const payloadReader = new (0, _chunk4XLYCT5Qcjs.BufferReader)(payloadBytes);
|
|
1768
1768
|
const decoder = payloadDecoders.get(typeId);
|
|
1769
1769
|
if (!decoder) {
|
|
1770
1770
|
return {
|
|
1771
1771
|
ok: false,
|
|
1772
|
-
error: new (0,
|
|
1772
|
+
error: new (0, _chunk4XLYCT5Qcjs.DecodeError)(
|
|
1773
1773
|
"UNKNOWN_MESSAGE_TYPE",
|
|
1774
1774
|
`Unknown message type ID: 0x${typeId.toString(16)}`,
|
|
1775
1775
|
0
|
|
@@ -1779,7 +1779,7 @@ function decodeMessage(bytes) {
|
|
|
1779
1779
|
const message = decoder(payloadReader);
|
|
1780
1780
|
return { ok: true, value: message, bytesRead: reader.offset };
|
|
1781
1781
|
} catch (e) {
|
|
1782
|
-
if (e instanceof
|
|
1782
|
+
if (e instanceof _chunk4XLYCT5Qcjs.DecodeError) {
|
|
1783
1783
|
return { ok: false, error: e };
|
|
1784
1784
|
}
|
|
1785
1785
|
throw e;
|
|
@@ -1814,7 +1814,7 @@ function createStreamDecoder() {
|
|
|
1814
1814
|
flush(controller) {
|
|
1815
1815
|
if (offset < buffer.length) {
|
|
1816
1816
|
controller.error(
|
|
1817
|
-
new (0,
|
|
1817
|
+
new (0, _chunk4XLYCT5Qcjs.DecodeError)("UNEXPECTED_END", "Stream ended with incomplete message data", 0)
|
|
1818
1818
|
);
|
|
1819
1819
|
}
|
|
1820
1820
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { B as BaseCodec, b as DecodeResult } from './types-
|
|
1
|
+
import { B as BaseCodec, b as DecodeResult } from './types-CdCSIfvI.cjs';
|
|
2
2
|
import { D as Draft14Message, f as SubgroupStream, d as DatagramObject, e as FetchStream, c as Draft14DataStream, S as SubgroupStreamHeader, O as ObjectPayload, F as FetchStreamHeader, b as DataStreamEvent } from './types-DjmrHp_s.cjs';
|
|
3
3
|
|
|
4
4
|
/**
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { B as BaseCodec, b as DecodeResult } from './types-
|
|
1
|
+
import { B as BaseCodec, b as DecodeResult } from './types-CdCSIfvI.js';
|
|
2
2
|
import { D as Draft10Message, S as SubgroupStream, c as DatagramObject, d as DatagramStatusObject, F as FetchStream, b as Draft10DataStream } from './types-0IWbU9Z_.js';
|
|
3
3
|
|
|
4
4
|
declare function encodeMessage(message: Draft10Message): Uint8Array;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { B as BaseCodec, b as DecodeResult } from './types-
|
|
1
|
+
import { B as BaseCodec, b as DecodeResult } from './types-CdCSIfvI.js';
|
|
2
2
|
import { D as Draft15Message, f as SubgroupStream, d as DatagramObject, e as FetchStream, c as Draft15DataStream, S as SubgroupStreamHeader, O as ObjectPayload, F as FetchStreamHeader, b as DataStreamEvent } from './types-CPaYBsMG.js';
|
|
3
3
|
|
|
4
4
|
/**
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { B as BaseCodec, b as DecodeResult } from './types-
|
|
1
|
+
import { B as BaseCodec, b as DecodeResult } from './types-CdCSIfvI.cjs';
|
|
2
2
|
import { D as Draft12Message, S as SubgroupStream, c as DatagramObject, F as FetchStream, b as Draft12DataStream } from './types-Bio-91Rt.cjs';
|
|
3
3
|
|
|
4
4
|
/**
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { B as BaseCodec, b as DecodeResult } from './types-
|
|
1
|
+
import { B as BaseCodec, b as DecodeResult } from './types-CdCSIfvI.cjs';
|
|
2
2
|
import { D as Draft10Message, S as SubgroupStream, c as DatagramObject, d as DatagramStatusObject, F as FetchStream, b as Draft10DataStream } from './types-0IWbU9Z_.cjs';
|
|
3
3
|
|
|
4
4
|
declare function encodeMessage(message: Draft10Message): Uint8Array;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { B as BaseCodec, b as DecodeResult } from './types-
|
|
1
|
+
import { B as BaseCodec, b as DecodeResult } from './types-CdCSIfvI.cjs';
|
|
2
2
|
import { D as Draft15Message, f as SubgroupStream, d as DatagramObject, e as FetchStream, c as Draft15DataStream, S as SubgroupStreamHeader, O as ObjectPayload, F as FetchStreamHeader, b as DataStreamEvent } from './types-CPaYBsMG.cjs';
|
|
3
3
|
|
|
4
4
|
/**
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { B as BaseCodec, b as DecodeResult } from './types-
|
|
1
|
+
import { B as BaseCodec, b as DecodeResult } from './types-CdCSIfvI.js';
|
|
2
2
|
import { D as Draft09Message, S as SubgroupStream, c as DatagramObject, d as DatagramStatusObject, F as FetchStream, b as Draft09DataStream } from './types-B3g5G9KP.js';
|
|
3
3
|
|
|
4
4
|
declare function encodeMessage(message: Draft09Message): Uint8Array;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { B as BaseCodec, b as DecodeResult } from './types-
|
|
1
|
+
import { B as BaseCodec, b as DecodeResult } from './types-CdCSIfvI.js';
|
|
2
2
|
import { D as Draft13Message, S as SubgroupStream, c as DatagramObject, F as FetchStream, b as Draft13DataStream } from './types-CXlSn0I9.js';
|
|
3
3
|
|
|
4
4
|
/**
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { B as BaseCodec, b as DecodeResult } from './types-
|
|
1
|
+
import { B as BaseCodec, b as DecodeResult } from './types-CdCSIfvI.cjs';
|
|
2
2
|
import { D as Draft16Message, f as SubgroupStream, d as DatagramObject, e as FetchStream, c as Draft16DataStream, S as SubgroupStreamHeader, O as ObjectPayload, F as FetchStreamHeader, b as DataStreamEvent } from './types-Cm9fjeYC.cjs';
|
|
3
3
|
|
|
4
4
|
/**
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { B as BaseCodec, b as DecodeResult } from './types-
|
|
1
|
+
import { B as BaseCodec, b as DecodeResult } from './types-CdCSIfvI.js';
|
|
2
2
|
import { D as Draft16Message, f as SubgroupStream, d as DatagramObject, e as FetchStream, c as Draft16DataStream, S as SubgroupStreamHeader, O as ObjectPayload, F as FetchStreamHeader, b as DataStreamEvent } from './types-Cm9fjeYC.js';
|
|
3
3
|
|
|
4
4
|
/**
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { B as BaseCodec, b as DecodeResult } from './types-
|
|
1
|
+
import { B as BaseCodec, b as DecodeResult } from './types-CdCSIfvI.js';
|
|
2
2
|
import { D as Draft12Message, S as SubgroupStream, c as DatagramObject, F as FetchStream, b as Draft12DataStream } from './types-Bio-91Rt.js';
|
|
3
3
|
|
|
4
4
|
/**
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { B as BaseCodec, b as DecodeResult } from './types-
|
|
1
|
+
import { B as BaseCodec, b as DecodeResult } from './types-CdCSIfvI.js';
|
|
2
2
|
import { D as Draft14Message, f as SubgroupStream, d as DatagramObject, e as FetchStream, c as Draft14DataStream, S as SubgroupStreamHeader, O as ObjectPayload, F as FetchStreamHeader, b as DataStreamEvent } from './types-DjmrHp_s.js';
|
|
3
3
|
|
|
4
4
|
/**
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { B as BaseCodec, b as DecodeResult } from './types-
|
|
1
|
+
import { B as BaseCodec, b as DecodeResult } from './types-CdCSIfvI.cjs';
|
|
2
2
|
import { D as Draft18Message, f as SubgroupStream, d as DatagramObject, e as FetchStream, c as Draft18DataStream, S as SubgroupStreamHeader, O as ObjectPayload, F as FetchStreamHeader, b as DataStreamEvent } from './types-Cqp10JtB.cjs';
|
|
3
3
|
|
|
4
4
|
/**
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { B as BaseCodec, b as DecodeResult } from './types-
|
|
1
|
+
import { B as BaseCodec, b as DecodeResult } from './types-CdCSIfvI.cjs';
|
|
2
2
|
import { D as Draft08Message, S as SubgroupStream, c as DatagramObject, d as DatagramStatusObject, F as FetchStream, b as Draft08DataStream } from './types-jV1yDDBA.cjs';
|
|
3
3
|
|
|
4
4
|
/**
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { B as BaseCodec, b as DecodeResult } from './types-CdCSIfvI.js';
|
|
2
|
+
import { D as Draft19Message, f as SubgroupStream, d as DatagramObject, e as FetchStream, c as Draft19DataStream, S as SubgroupStreamHeader, O as ObjectPayload, F as FetchStreamHeader, b as DataStreamEvent } from './types-zHgCS6o5.js';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Encode a draft-18 control message with type(varint) + length(uint16 BE) + payload.
|
|
6
|
+
*/
|
|
7
|
+
declare function encodeMessage(message: Draft19Message): Uint8Array;
|
|
8
|
+
/**
|
|
9
|
+
* Decode a draft-18 control message from bytes (type + uint16 length + payload).
|
|
10
|
+
*/
|
|
11
|
+
declare function decodeMessage(bytes: Uint8Array): DecodeResult<Draft19Message>;
|
|
12
|
+
|
|
13
|
+
declare function createStreamDecoder(): TransformStream<Uint8Array, Draft19Message>;
|
|
14
|
+
interface Draft19Codec extends BaseCodec<Draft19Message> {
|
|
15
|
+
readonly draft: '18';
|
|
16
|
+
encodeSubgroupStream(stream: SubgroupStream): Uint8Array;
|
|
17
|
+
encodeDatagram(dg: DatagramObject): Uint8Array;
|
|
18
|
+
encodeFetchStream(stream: FetchStream): Uint8Array;
|
|
19
|
+
decodeSubgroupStream(bytes: Uint8Array): DecodeResult<SubgroupStream>;
|
|
20
|
+
decodeDatagram(bytes: Uint8Array): DecodeResult<DatagramObject>;
|
|
21
|
+
decodeFetchStream(bytes: Uint8Array): DecodeResult<FetchStream>;
|
|
22
|
+
decodeDataStream(streamType: 'subgroup' | 'datagram' | 'fetch', bytes: Uint8Array): DecodeResult<Draft19DataStream>;
|
|
23
|
+
createStreamDecoder(): TransformStream<Uint8Array, Draft19Message>;
|
|
24
|
+
createSubgroupStreamDecoder(): TransformStream<Uint8Array, SubgroupStreamHeader | ObjectPayload>;
|
|
25
|
+
createFetchStreamDecoder(): TransformStream<Uint8Array, FetchStreamHeader | ObjectPayload>;
|
|
26
|
+
createDataStreamDecoder(): TransformStream<Uint8Array, DataStreamEvent>;
|
|
27
|
+
}
|
|
28
|
+
declare function createDraft19Codec(): Draft19Codec;
|
|
29
|
+
|
|
30
|
+
export { type Draft19Codec as D, createStreamDecoder as a, createDraft19Codec as c, decodeMessage as d, encodeMessage as e };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { B as BaseCodec, b as DecodeResult } from './types-
|
|
1
|
+
import { B as BaseCodec, b as DecodeResult } from './types-CdCSIfvI.js';
|
|
2
2
|
import { D as Draft17Message, f as SubgroupStream, d as DatagramObject, e as FetchStream, c as Draft17DataStream, S as SubgroupStreamHeader, O as ObjectPayload, F as FetchStreamHeader, b as DataStreamEvent } from './types-D9eiB_9A.js';
|
|
3
3
|
|
|
4
4
|
/**
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { B as BaseCodec, b as DecodeResult } from './types-
|
|
1
|
+
import { B as BaseCodec, b as DecodeResult } from './types-CdCSIfvI.js';
|
|
2
2
|
import { D as Draft11Message, S as SubgroupStream, c as DatagramObject, F as FetchStream, b as Draft11DataStream } from './types-Ck45Ex5S.js';
|
|
3
3
|
|
|
4
4
|
/**
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { B as BaseCodec, b as DecodeResult } from './types-
|
|
1
|
+
import { B as BaseCodec, b as DecodeResult } from './types-CdCSIfvI.cjs';
|
|
2
2
|
import { D as Draft07Message, S as SubgroupStream, b as DatagramObject, F as FetchStream } from './types-Dl4IaAHR.cjs';
|
|
3
3
|
|
|
4
4
|
interface Draft07Codec extends BaseCodec<Draft07Message> {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { B as BaseCodec, b as DecodeResult } from './types-
|
|
1
|
+
import { B as BaseCodec, b as DecodeResult } from './types-CdCSIfvI.js';
|
|
2
2
|
import { D as Draft08Message, S as SubgroupStream, c as DatagramObject, d as DatagramStatusObject, F as FetchStream, b as Draft08DataStream } from './types-jV1yDDBA.js';
|
|
3
3
|
|
|
4
4
|
/**
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { B as BaseCodec, b as DecodeResult } from './types-
|
|
1
|
+
import { B as BaseCodec, b as DecodeResult } from './types-CdCSIfvI.js';
|
|
2
2
|
import { D as Draft07Message, S as SubgroupStream, b as DatagramObject, F as FetchStream } from './types-Dl4IaAHR.js';
|
|
3
3
|
|
|
4
4
|
interface Draft07Codec extends BaseCodec<Draft07Message> {
|