@moqtap/codec 0.1.0 → 0.1.1

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 (67) hide show
  1. package/dist/{chunk-YBSEOSSP.js → chunk-A27S7HW7.js} +5 -1
  2. package/dist/{chunk-5WFXFLL4.cjs → chunk-FUFTMAQD.cjs} +96 -63
  3. package/dist/{chunk-2NARXGVA.cjs → chunk-FWISIR26.cjs} +5 -1
  4. package/dist/{chunk-23YG7F46.js → chunk-IXHOBNXA.js} +117 -17
  5. package/dist/{chunk-3BSZ55L3.cjs → chunk-NLYTRGXA.cjs} +153 -19
  6. package/dist/{chunk-GDRGWFEK.cjs → chunk-NPWHHWXT.cjs} +249 -37
  7. package/dist/{chunk-IQPDRQVC.js → chunk-U2B3B42P.js} +62 -29
  8. package/dist/{chunk-WNTXF3DE.cjs → chunk-YBZD3DU5.cjs} +127 -27
  9. package/dist/{chunk-DC4L6ZIT.js → chunk-YTXLWKOR.js} +153 -19
  10. package/dist/{chunk-YPXLV5YK.js → chunk-Z66WDWHI.js} +249 -37
  11. package/dist/{codec-qPzfmLNu.d.ts → codec-B2mc2g3i.d.ts} +5 -5
  12. package/dist/{codec-CTvFtQQI.d.cts → codec-Bvr7rFtj.d.cts} +5 -5
  13. package/dist/draft14-session.cjs +2 -2
  14. package/dist/draft14-session.d.cts +4 -4
  15. package/dist/draft14-session.d.ts +4 -4
  16. package/dist/draft14-session.js +1 -1
  17. package/dist/draft14.cjs +4 -4
  18. package/dist/draft14.d.cts +15 -15
  19. package/dist/draft14.d.ts +15 -15
  20. package/dist/draft14.js +3 -3
  21. package/dist/draft7-session.cjs +2 -2
  22. package/dist/draft7-session.d.cts +3 -3
  23. package/dist/draft7-session.d.ts +3 -3
  24. package/dist/draft7-session.js +1 -1
  25. package/dist/draft7.cjs +5 -5
  26. package/dist/draft7.d.cts +10 -10
  27. package/dist/draft7.d.ts +10 -10
  28. package/dist/draft7.js +2 -2
  29. package/dist/index.cjs +6 -6
  30. package/dist/index.d.cts +6 -6
  31. package/dist/index.d.ts +6 -6
  32. package/dist/index.js +3 -3
  33. package/dist/{session-types-B9NIf7_F.d.ts → session-types-DFjMk4HH.d.ts} +20 -20
  34. package/dist/{session-types-CCo-oA-d.d.cts → session-types-DW1RSZX_.d.cts} +20 -20
  35. package/dist/session.cjs +4 -4
  36. package/dist/session.d.cts +3 -3
  37. package/dist/session.d.ts +3 -3
  38. package/dist/session.js +2 -2
  39. package/dist/{types-CIk5W10V.d.ts → types-BTFeKYCb.d.cts} +37 -37
  40. package/dist/{types-CIk5W10V.d.cts → types-BTFeKYCb.d.ts} +37 -37
  41. package/dist/{types-ClXELFGN.d.cts → types-DPYE49t0.d.cts} +36 -36
  42. package/dist/{types-ClXELFGN.d.ts → types-DPYE49t0.d.ts} +36 -36
  43. package/package.json +7 -7
  44. package/src/core/buffer-reader.ts +16 -9
  45. package/src/core/buffer-writer.ts +2 -2
  46. package/src/core/errors.ts +1 -1
  47. package/src/core/session-types.ts +28 -41
  48. package/src/core/types.ts +70 -70
  49. package/src/drafts/draft07/announce-fsm.ts +1 -1
  50. package/src/drafts/draft07/codec.ts +195 -86
  51. package/src/drafts/draft07/index.ts +43 -44
  52. package/src/drafts/draft07/messages.ts +1 -1
  53. package/src/drafts/draft07/parameters.ts +2 -2
  54. package/src/drafts/draft07/rules.ts +68 -37
  55. package/src/drafts/draft07/session-fsm.ts +330 -117
  56. package/src/drafts/draft07/session.ts +10 -10
  57. package/src/drafts/draft07/subscription-fsm.ts +1 -1
  58. package/src/drafts/draft07/varint.ts +4 -4
  59. package/src/drafts/draft14/codec.ts +339 -189
  60. package/src/drafts/draft14/index.ts +103 -108
  61. package/src/drafts/draft14/messages.ts +61 -61
  62. package/src/drafts/draft14/rules.ts +77 -34
  63. package/src/drafts/draft14/session-fsm.ts +458 -146
  64. package/src/drafts/draft14/session.ts +13 -13
  65. package/src/drafts/draft14/types.ts +68 -68
  66. package/src/index.ts +66 -31
  67. package/src/session.ts +20 -20
@@ -31,12 +31,8 @@ var CONTROL_MESSAGES = /* @__PURE__ */ new Set([
31
31
  "max_request_id",
32
32
  "requests_blocked"
33
33
  ]);
34
- var CLIENT_ONLY_MESSAGES = /* @__PURE__ */ new Set([
35
- "client_setup"
36
- ]);
37
- var SERVER_ONLY_MESSAGES = /* @__PURE__ */ new Set([
38
- "server_setup"
39
- ]);
34
+ var CLIENT_ONLY_MESSAGES = /* @__PURE__ */ new Set(["client_setup"]);
35
+ var SERVER_ONLY_MESSAGES = /* @__PURE__ */ new Set(["server_setup"]);
40
36
  var BIDIRECTIONAL_MESSAGES = /* @__PURE__ */ new Set([
41
37
  "subscribe",
42
38
  "subscribe_ok",
@@ -135,22 +131,42 @@ var Draft14SessionFSM = class {
135
131
  checkRole(message, direction) {
136
132
  const senderRole = direction === "outbound" ? this._role : this._role === "client" ? "server" : "client";
137
133
  if (CLIENT_ONLY_MESSAGES.has(message.type) && senderRole !== "client") {
138
- return violation("ROLE_VIOLATION", `${message.type} can only be sent by client`, this._phase, message.type);
134
+ return violation(
135
+ "ROLE_VIOLATION",
136
+ `${message.type} can only be sent by client`,
137
+ this._phase,
138
+ message.type
139
+ );
139
140
  }
140
141
  if (SERVER_ONLY_MESSAGES.has(message.type) && senderRole !== "server") {
141
- return violation("ROLE_VIOLATION", `${message.type} can only be sent by server`, this._phase, message.type);
142
+ return violation(
143
+ "ROLE_VIOLATION",
144
+ `${message.type} can only be sent by server`,
145
+ this._phase,
146
+ message.type
147
+ );
142
148
  }
143
149
  return null;
144
150
  }
145
151
  checkDuplicateRequestId(requestId, msgType) {
146
152
  if (this._requestIds.has(requestId)) {
147
- return violation("DUPLICATE_REQUEST_ID", `Request ID ${requestId} already in use`, this._phase, msgType);
153
+ return violation(
154
+ "DUPLICATE_REQUEST_ID",
155
+ `Request ID ${requestId} already in use`,
156
+ this._phase,
157
+ msgType
158
+ );
148
159
  }
149
160
  return null;
150
161
  }
151
162
  checkKnownRequestId(requestId, msgType) {
152
163
  if (!this._requestIds.has(requestId)) {
153
- return violation("UNKNOWN_REQUEST_ID", `No request with ID ${requestId}`, this._phase, msgType);
164
+ return violation(
165
+ "UNKNOWN_REQUEST_ID",
166
+ `No request with ID ${requestId}`,
167
+ this._phase,
168
+ msgType
169
+ );
154
170
  }
155
171
  return null;
156
172
  }
@@ -225,27 +241,67 @@ var Draft14SessionFSM = class {
225
241
  }
226
242
  handleClientSetup(_message, direction) {
227
243
  if (this._phase !== "idle") {
228
- return { ok: false, violation: violation("SETUP_VIOLATION", "CLIENT_SETUP already sent/received", this._phase, "client_setup") };
244
+ return {
245
+ ok: false,
246
+ violation: violation(
247
+ "SETUP_VIOLATION",
248
+ "CLIENT_SETUP already sent/received",
249
+ this._phase,
250
+ "client_setup"
251
+ )
252
+ };
229
253
  }
230
254
  if (direction === "outbound" && this._role !== "client") {
231
- return { ok: false, violation: violation("ROLE_VIOLATION", "Only client can send CLIENT_SETUP", this._phase, "client_setup") };
255
+ return {
256
+ ok: false,
257
+ violation: violation(
258
+ "ROLE_VIOLATION",
259
+ "Only client can send CLIENT_SETUP",
260
+ this._phase,
261
+ "client_setup"
262
+ )
263
+ };
232
264
  }
233
265
  this._phase = "setup";
234
266
  return { ok: true, phase: this._phase, sideEffects: [] };
235
267
  }
236
268
  handleServerSetup(_message, direction) {
237
269
  if (this._phase !== "setup") {
238
- return { ok: false, violation: violation("SETUP_VIOLATION", "SERVER_SETUP before CLIENT_SETUP", this._phase, "server_setup") };
270
+ return {
271
+ ok: false,
272
+ violation: violation(
273
+ "SETUP_VIOLATION",
274
+ "SERVER_SETUP before CLIENT_SETUP",
275
+ this._phase,
276
+ "server_setup"
277
+ )
278
+ };
239
279
  }
240
280
  if (direction === "outbound" && this._role !== "server") {
241
- return { ok: false, violation: violation("ROLE_VIOLATION", "Only server can send SERVER_SETUP", this._phase, "server_setup") };
281
+ return {
282
+ ok: false,
283
+ violation: violation(
284
+ "ROLE_VIOLATION",
285
+ "Only server can send SERVER_SETUP",
286
+ this._phase,
287
+ "server_setup"
288
+ )
289
+ };
242
290
  }
243
291
  this._phase = "ready";
244
292
  return { ok: true, phase: this._phase, sideEffects: [{ type: "session-ready" }] };
245
293
  }
246
294
  handleGoAway(message, _direction, sideEffects) {
247
295
  if (this._phase !== "ready" && this._phase !== "draining") {
248
- return { ok: false, violation: violation("UNEXPECTED_MESSAGE", `GOAWAY not valid in phase ${this._phase}`, this._phase, "goaway") };
296
+ return {
297
+ ok: false,
298
+ violation: violation(
299
+ "UNEXPECTED_MESSAGE",
300
+ `GOAWAY not valid in phase ${this._phase}`,
301
+ this._phase,
302
+ "goaway"
303
+ )
304
+ };
249
305
  }
250
306
  this._phase = "draining";
251
307
  const goaway = message;
@@ -287,10 +343,26 @@ var Draft14SessionFSM = class {
287
343
  if (idErr) return { ok: false, violation: idErr };
288
344
  const existing = this._subscriptions.get(ok.request_id);
289
345
  if (!existing) {
290
- return { ok: false, violation: violation("UNKNOWN_REQUEST_ID", `No subscription with request ID ${ok.request_id}`, this._phase, message.type) };
346
+ return {
347
+ ok: false,
348
+ violation: violation(
349
+ "UNKNOWN_REQUEST_ID",
350
+ `No subscription with request ID ${ok.request_id}`,
351
+ this._phase,
352
+ message.type
353
+ )
354
+ };
291
355
  }
292
356
  if (existing.phase !== "pending") {
293
- return { ok: false, violation: violation("STATE_VIOLATION", `Subscription ${ok.request_id} is ${existing.phase}, not pending`, this._phase, message.type) };
357
+ return {
358
+ ok: false,
359
+ violation: violation(
360
+ "STATE_VIOLATION",
361
+ `Subscription ${ok.request_id} is ${existing.phase}, not pending`,
362
+ this._phase,
363
+ message.type
364
+ )
365
+ };
294
366
  }
295
367
  this._subscriptions.set(ok.request_id, { ...existing, phase: "active" });
296
368
  sideEffects.push({ type: "subscription-activated", subscribeId: ok.request_id });
@@ -304,13 +376,33 @@ var Draft14SessionFSM = class {
304
376
  if (idErr) return { ok: false, violation: idErr };
305
377
  const existing = this._subscriptions.get(subErr.request_id);
306
378
  if (!existing) {
307
- return { ok: false, violation: violation("UNKNOWN_REQUEST_ID", `No subscription with request ID ${subErr.request_id}`, this._phase, message.type) };
379
+ return {
380
+ ok: false,
381
+ violation: violation(
382
+ "UNKNOWN_REQUEST_ID",
383
+ `No subscription with request ID ${subErr.request_id}`,
384
+ this._phase,
385
+ message.type
386
+ )
387
+ };
308
388
  }
309
389
  if (existing.phase !== "pending") {
310
- return { ok: false, violation: violation("STATE_VIOLATION", `Subscription ${subErr.request_id} is ${existing.phase}, not pending`, this._phase, message.type) };
390
+ return {
391
+ ok: false,
392
+ violation: violation(
393
+ "STATE_VIOLATION",
394
+ `Subscription ${subErr.request_id} is ${existing.phase}, not pending`,
395
+ this._phase,
396
+ message.type
397
+ )
398
+ };
311
399
  }
312
400
  this._subscriptions.set(subErr.request_id, { ...existing, phase: "error" });
313
- sideEffects.push({ type: "subscription-ended", subscribeId: subErr.request_id, reason: subErr.reason_phrase });
401
+ sideEffects.push({
402
+ type: "subscription-ended",
403
+ subscribeId: subErr.request_id,
404
+ reason: subErr.reason_phrase
405
+ });
314
406
  return { ok: true, phase: this._phase, sideEffects };
315
407
  }
316
408
  handleSubscribeUpdate(message, _direction, sideEffects) {
@@ -321,10 +413,26 @@ var Draft14SessionFSM = class {
321
413
  if (idErr) return { ok: false, violation: idErr };
322
414
  const existing = this._subscriptions.get(update.request_id);
323
415
  if (!existing) {
324
- return { ok: false, violation: violation("UNKNOWN_REQUEST_ID", `No subscription with request ID ${update.request_id}`, this._phase, message.type) };
416
+ return {
417
+ ok: false,
418
+ violation: violation(
419
+ "UNKNOWN_REQUEST_ID",
420
+ `No subscription with request ID ${update.request_id}`,
421
+ this._phase,
422
+ message.type
423
+ )
424
+ };
325
425
  }
326
426
  if (existing.phase !== "active") {
327
- return { ok: false, violation: violation("STATE_VIOLATION", `Subscription ${update.request_id} is ${existing.phase}, not active`, this._phase, message.type) };
427
+ return {
428
+ ok: false,
429
+ violation: violation(
430
+ "STATE_VIOLATION",
431
+ `Subscription ${update.request_id} is ${existing.phase}, not active`,
432
+ this._phase,
433
+ message.type
434
+ )
435
+ };
328
436
  }
329
437
  return { ok: true, phase: this._phase, sideEffects };
330
438
  }
@@ -336,10 +444,22 @@ var Draft14SessionFSM = class {
336
444
  if (idErr) return { ok: false, violation: idErr };
337
445
  const existing = this._subscriptions.get(unsub.request_id);
338
446
  if (!existing) {
339
- return { ok: false, violation: violation("UNKNOWN_REQUEST_ID", `No subscription with request ID ${unsub.request_id}`, this._phase, message.type) };
447
+ return {
448
+ ok: false,
449
+ violation: violation(
450
+ "UNKNOWN_REQUEST_ID",
451
+ `No subscription with request ID ${unsub.request_id}`,
452
+ this._phase,
453
+ message.type
454
+ )
455
+ };
340
456
  }
341
457
  this._subscriptions.set(unsub.request_id, { ...existing, phase: "done" });
342
- sideEffects.push({ type: "subscription-ended", subscribeId: unsub.request_id, reason: "unsubscribed" });
458
+ sideEffects.push({
459
+ type: "subscription-ended",
460
+ subscribeId: unsub.request_id,
461
+ reason: "unsubscribed"
462
+ });
343
463
  return { ok: true, phase: this._phase, sideEffects };
344
464
  }
345
465
  // ─── Publish lifecycle ────────────────────────────────────────────────────────
@@ -364,10 +484,26 @@ var Draft14SessionFSM = class {
364
484
  if (idErr) return { ok: false, violation: idErr };
365
485
  const existing = this._publishes.get(ok.request_id);
366
486
  if (!existing) {
367
- return { ok: false, violation: violation("UNKNOWN_REQUEST_ID", `No publish with request ID ${ok.request_id}`, this._phase, message.type) };
487
+ return {
488
+ ok: false,
489
+ violation: violation(
490
+ "UNKNOWN_REQUEST_ID",
491
+ `No publish with request ID ${ok.request_id}`,
492
+ this._phase,
493
+ message.type
494
+ )
495
+ };
368
496
  }
369
497
  if (existing.phase !== "pending") {
370
- return { ok: false, violation: violation("STATE_VIOLATION", `Publish ${ok.request_id} is ${existing.phase}, not pending`, this._phase, message.type) };
498
+ return {
499
+ ok: false,
500
+ violation: violation(
501
+ "STATE_VIOLATION",
502
+ `Publish ${ok.request_id} is ${existing.phase}, not pending`,
503
+ this._phase,
504
+ message.type
505
+ )
506
+ };
371
507
  }
372
508
  this._publishes.set(ok.request_id, { ...existing, phase: "active" });
373
509
  sideEffects.push({ type: "publish-activated", requestId: ok.request_id });
@@ -381,13 +517,33 @@ var Draft14SessionFSM = class {
381
517
  if (idErr) return { ok: false, violation: idErr };
382
518
  const existing = this._publishes.get(pubErr.request_id);
383
519
  if (!existing) {
384
- return { ok: false, violation: violation("UNKNOWN_REQUEST_ID", `No publish with request ID ${pubErr.request_id}`, this._phase, message.type) };
520
+ return {
521
+ ok: false,
522
+ violation: violation(
523
+ "UNKNOWN_REQUEST_ID",
524
+ `No publish with request ID ${pubErr.request_id}`,
525
+ this._phase,
526
+ message.type
527
+ )
528
+ };
385
529
  }
386
530
  if (existing.phase !== "pending") {
387
- return { ok: false, violation: violation("STATE_VIOLATION", `Publish ${pubErr.request_id} is ${existing.phase}, not pending`, this._phase, message.type) };
531
+ return {
532
+ ok: false,
533
+ violation: violation(
534
+ "STATE_VIOLATION",
535
+ `Publish ${pubErr.request_id} is ${existing.phase}, not pending`,
536
+ this._phase,
537
+ message.type
538
+ )
539
+ };
388
540
  }
389
541
  this._publishes.set(pubErr.request_id, { ...existing, phase: "error" });
390
- sideEffects.push({ type: "publish-ended", requestId: pubErr.request_id, reason: pubErr.reason_phrase });
542
+ sideEffects.push({
543
+ type: "publish-ended",
544
+ requestId: pubErr.request_id,
545
+ reason: pubErr.reason_phrase
546
+ });
391
547
  return { ok: true, phase: this._phase, sideEffects };
392
548
  }
393
549
  handlePublishDone(message, _direction, sideEffects) {
@@ -398,10 +554,22 @@ var Draft14SessionFSM = class {
398
554
  if (idErr) return { ok: false, violation: idErr };
399
555
  const existing = this._publishes.get(done.request_id);
400
556
  if (!existing) {
401
- return { ok: false, violation: violation("UNKNOWN_REQUEST_ID", `No publish with request ID ${done.request_id}`, this._phase, message.type) };
557
+ return {
558
+ ok: false,
559
+ violation: violation(
560
+ "UNKNOWN_REQUEST_ID",
561
+ `No publish with request ID ${done.request_id}`,
562
+ this._phase,
563
+ message.type
564
+ )
565
+ };
402
566
  }
403
567
  this._publishes.set(done.request_id, { ...existing, phase: "done" });
404
- sideEffects.push({ type: "publish-ended", requestId: done.request_id, reason: done.reason_phrase });
568
+ sideEffects.push({
569
+ type: "publish-ended",
570
+ requestId: done.request_id,
571
+ reason: done.reason_phrase
572
+ });
405
573
  return { ok: true, phase: this._phase, sideEffects };
406
574
  }
407
575
  // ─── Fetch lifecycle ──────────────────────────────────────────────────────────
@@ -426,10 +594,26 @@ var Draft14SessionFSM = class {
426
594
  if (idErr) return { ok: false, violation: idErr };
427
595
  const existing = this._fetches.get(ok.request_id);
428
596
  if (!existing) {
429
- return { ok: false, violation: violation("UNKNOWN_REQUEST_ID", `No fetch with request ID ${ok.request_id}`, this._phase, message.type) };
597
+ return {
598
+ ok: false,
599
+ violation: violation(
600
+ "UNKNOWN_REQUEST_ID",
601
+ `No fetch with request ID ${ok.request_id}`,
602
+ this._phase,
603
+ message.type
604
+ )
605
+ };
430
606
  }
431
607
  if (existing.phase !== "pending") {
432
- return { ok: false, violation: violation("STATE_VIOLATION", `Fetch ${ok.request_id} is ${existing.phase}, not pending`, this._phase, message.type) };
608
+ return {
609
+ ok: false,
610
+ violation: violation(
611
+ "STATE_VIOLATION",
612
+ `Fetch ${ok.request_id} is ${existing.phase}, not pending`,
613
+ this._phase,
614
+ message.type
615
+ )
616
+ };
433
617
  }
434
618
  this._fetches.set(ok.request_id, { ...existing, phase: "active" });
435
619
  sideEffects.push({ type: "fetch-activated", requestId: ok.request_id });
@@ -443,13 +627,33 @@ var Draft14SessionFSM = class {
443
627
  if (idErr) return { ok: false, violation: idErr };
444
628
  const existing = this._fetches.get(fetchErr.request_id);
445
629
  if (!existing) {
446
- return { ok: false, violation: violation("UNKNOWN_REQUEST_ID", `No fetch with request ID ${fetchErr.request_id}`, this._phase, message.type) };
630
+ return {
631
+ ok: false,
632
+ violation: violation(
633
+ "UNKNOWN_REQUEST_ID",
634
+ `No fetch with request ID ${fetchErr.request_id}`,
635
+ this._phase,
636
+ message.type
637
+ )
638
+ };
447
639
  }
448
640
  if (existing.phase !== "pending") {
449
- return { ok: false, violation: violation("STATE_VIOLATION", `Fetch ${fetchErr.request_id} is ${existing.phase}, not pending`, this._phase, message.type) };
641
+ return {
642
+ ok: false,
643
+ violation: violation(
644
+ "STATE_VIOLATION",
645
+ `Fetch ${fetchErr.request_id} is ${existing.phase}, not pending`,
646
+ this._phase,
647
+ message.type
648
+ )
649
+ };
450
650
  }
451
651
  this._fetches.set(fetchErr.request_id, { ...existing, phase: "error" });
452
- sideEffects.push({ type: "fetch-ended", requestId: fetchErr.request_id, reason: fetchErr.reason_phrase });
652
+ sideEffects.push({
653
+ type: "fetch-ended",
654
+ requestId: fetchErr.request_id,
655
+ reason: fetchErr.reason_phrase
656
+ });
453
657
  return { ok: true, phase: this._phase, sideEffects };
454
658
  }
455
659
  handleFetchCancel(message, _direction, sideEffects) {
@@ -460,7 +664,15 @@ var Draft14SessionFSM = class {
460
664
  if (idErr) return { ok: false, violation: idErr };
461
665
  const existing = this._fetches.get(cancel.request_id);
462
666
  if (!existing) {
463
- return { ok: false, violation: violation("UNKNOWN_REQUEST_ID", `No fetch with request ID ${cancel.request_id}`, this._phase, message.type) };
667
+ return {
668
+ ok: false,
669
+ violation: violation(
670
+ "UNKNOWN_REQUEST_ID",
671
+ `No fetch with request ID ${cancel.request_id}`,
672
+ this._phase,
673
+ message.type
674
+ )
675
+ };
464
676
  }
465
677
  this._fetches.set(cancel.request_id, { ...existing, phase: "cancelled" });
466
678
  sideEffects.push({ type: "fetch-ended", requestId: cancel.request_id, reason: "cancelled" });
@@ -1,5 +1,5 @@
1
- import { B as BaseCodec, g as DecodeResult } from './types-ClXELFGN.js';
2
- import { a as Draft14Message, S as SubgroupStream, f as DatagramObject, M as FetchStream, D as Draft14DataStream, P as SubgroupStreamHeader, O as ObjectPayload, N as FetchStreamHeader, d as DataStreamEvent } from './types-CIk5W10V.js';
1
+ import { B as BaseCodec, g as DecodeResult } from './types-DPYE49t0.js';
2
+ import { a as Draft14Message, S as SubgroupStream, f as DatagramObject, M as FetchStream, D as Draft14DataStream, P as SubgroupStreamHeader, O as ObjectPayload, N as FetchStreamHeader, d as DataStreamEvent } from './types-BTFeKYCb.js';
3
3
 
4
4
  /**
5
5
  * Encode a draft-14 control message with type(varint) + length(uint16 BE) + payload.
@@ -36,7 +36,7 @@ declare function decodeFetchStream(bytes: Uint8Array): DecodeResult<FetchStream>
36
36
  /**
37
37
  * Decode a data stream, dispatching by stream type.
38
38
  */
39
- declare function decodeDataStream(streamType: 'subgroup' | 'datagram' | 'fetch', bytes: Uint8Array): DecodeResult<Draft14DataStream>;
39
+ declare function decodeDataStream(streamType: "subgroup" | "datagram" | "fetch", bytes: Uint8Array): DecodeResult<Draft14DataStream>;
40
40
  /**
41
41
  * Create a TransformStream that decodes a continuous byte stream (e.g. the
42
42
  * WebTransport bidirectional control stream) into individual Draft14Message
@@ -68,14 +68,14 @@ declare function createFetchStreamDecoder(): TransformStream<Uint8Array, FetchSt
68
68
  */
69
69
  declare function createDataStreamDecoder(): TransformStream<Uint8Array, DataStreamEvent>;
70
70
  interface Draft14Codec extends BaseCodec<Draft14Message> {
71
- readonly draft: 'draft-ietf-moq-transport-14';
71
+ readonly draft: "draft-ietf-moq-transport-14";
72
72
  encodeSubgroupStream(stream: SubgroupStream): Uint8Array;
73
73
  encodeDatagram(dg: DatagramObject): Uint8Array;
74
74
  encodeFetchStream(stream: FetchStream): Uint8Array;
75
75
  decodeSubgroupStream(bytes: Uint8Array): DecodeResult<SubgroupStream>;
76
76
  decodeDatagram(bytes: Uint8Array): DecodeResult<DatagramObject>;
77
77
  decodeFetchStream(bytes: Uint8Array): DecodeResult<FetchStream>;
78
- decodeDataStream(streamType: 'subgroup' | 'datagram' | 'fetch', bytes: Uint8Array): DecodeResult<Draft14DataStream>;
78
+ decodeDataStream(streamType: "subgroup" | "datagram" | "fetch", bytes: Uint8Array): DecodeResult<Draft14DataStream>;
79
79
  createStreamDecoder(): TransformStream<Uint8Array, Draft14Message>;
80
80
  createSubgroupStreamDecoder(): TransformStream<Uint8Array, SubgroupStreamHeader | ObjectPayload>;
81
81
  createFetchStreamDecoder(): TransformStream<Uint8Array, FetchStreamHeader | ObjectPayload>;
@@ -1,5 +1,5 @@
1
- import { B as BaseCodec, g as DecodeResult } from './types-ClXELFGN.cjs';
2
- import { a as Draft14Message, S as SubgroupStream, f as DatagramObject, M as FetchStream, D as Draft14DataStream, P as SubgroupStreamHeader, O as ObjectPayload, N as FetchStreamHeader, d as DataStreamEvent } from './types-CIk5W10V.cjs';
1
+ import { B as BaseCodec, g as DecodeResult } from './types-DPYE49t0.cjs';
2
+ import { a as Draft14Message, S as SubgroupStream, f as DatagramObject, M as FetchStream, D as Draft14DataStream, P as SubgroupStreamHeader, O as ObjectPayload, N as FetchStreamHeader, d as DataStreamEvent } from './types-BTFeKYCb.cjs';
3
3
 
4
4
  /**
5
5
  * Encode a draft-14 control message with type(varint) + length(uint16 BE) + payload.
@@ -36,7 +36,7 @@ declare function decodeFetchStream(bytes: Uint8Array): DecodeResult<FetchStream>
36
36
  /**
37
37
  * Decode a data stream, dispatching by stream type.
38
38
  */
39
- declare function decodeDataStream(streamType: 'subgroup' | 'datagram' | 'fetch', bytes: Uint8Array): DecodeResult<Draft14DataStream>;
39
+ declare function decodeDataStream(streamType: "subgroup" | "datagram" | "fetch", bytes: Uint8Array): DecodeResult<Draft14DataStream>;
40
40
  /**
41
41
  * Create a TransformStream that decodes a continuous byte stream (e.g. the
42
42
  * WebTransport bidirectional control stream) into individual Draft14Message
@@ -68,14 +68,14 @@ declare function createFetchStreamDecoder(): TransformStream<Uint8Array, FetchSt
68
68
  */
69
69
  declare function createDataStreamDecoder(): TransformStream<Uint8Array, DataStreamEvent>;
70
70
  interface Draft14Codec extends BaseCodec<Draft14Message> {
71
- readonly draft: 'draft-ietf-moq-transport-14';
71
+ readonly draft: "draft-ietf-moq-transport-14";
72
72
  encodeSubgroupStream(stream: SubgroupStream): Uint8Array;
73
73
  encodeDatagram(dg: DatagramObject): Uint8Array;
74
74
  encodeFetchStream(stream: FetchStream): Uint8Array;
75
75
  decodeSubgroupStream(bytes: Uint8Array): DecodeResult<SubgroupStream>;
76
76
  decodeDatagram(bytes: Uint8Array): DecodeResult<DatagramObject>;
77
77
  decodeFetchStream(bytes: Uint8Array): DecodeResult<FetchStream>;
78
- decodeDataStream(streamType: 'subgroup' | 'datagram' | 'fetch', bytes: Uint8Array): DecodeResult<Draft14DataStream>;
78
+ decodeDataStream(streamType: "subgroup" | "datagram" | "fetch", bytes: Uint8Array): DecodeResult<Draft14DataStream>;
79
79
  createStreamDecoder(): TransformStream<Uint8Array, Draft14Message>;
80
80
  createSubgroupStreamDecoder(): TransformStream<Uint8Array, SubgroupStreamHeader | ObjectPayload>;
81
81
  createFetchStreamDecoder(): TransformStream<Uint8Array, FetchStreamHeader | ObjectPayload>;
@@ -1,6 +1,6 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
2
 
3
- var _chunkGDRGWFEKcjs = require('./chunk-GDRGWFEK.cjs');
3
+ var _chunkNPWHHWXTcjs = require('./chunk-NPWHHWXT.cjs');
4
4
 
5
5
 
6
- exports.createDraft14SessionState = _chunkGDRGWFEKcjs.createDraft14SessionState;
6
+ exports.createDraft14SessionState = _chunkNPWHHWXTcjs.createDraft14SessionState;
@@ -1,7 +1,7 @@
1
- import { a as Draft14Message, c as Draft14MessageType } from './types-CIk5W10V.cjs';
2
- import { S as SessionStateOptions, a as SessionState } from './session-types-CCo-oA-d.cjs';
3
- export { F as FetchPhase, c as FetchState, P as ProtocolViolation, d as ProtocolViolationCode, e as PublishPhase, f as PublishState, g as SessionPhase, h as SideEffect, i as SubscriptionPhase, j as SubscriptionState, T as TransitionResult, V as ValidationResult } from './session-types-CCo-oA-d.cjs';
4
- import './types-ClXELFGN.cjs';
1
+ import { S as SessionStateOptions, a as SessionState } from './session-types-DW1RSZX_.cjs';
2
+ export { F as FetchPhase, c as FetchState, P as ProtocolViolation, d as ProtocolViolationCode, e as PublishPhase, f as PublishState, g as SessionPhase, h as SideEffect, i as SubscriptionPhase, j as SubscriptionState, T as TransitionResult, V as ValidationResult } from './session-types-DW1RSZX_.cjs';
3
+ import { a as Draft14Message, c as Draft14MessageType } from './types-BTFeKYCb.cjs';
4
+ import './types-DPYE49t0.cjs';
5
5
 
6
6
  declare function createDraft14SessionState(options: SessionStateOptions): SessionState<Draft14Message, Draft14MessageType>;
7
7
 
@@ -1,7 +1,7 @@
1
- import { a as Draft14Message, c as Draft14MessageType } from './types-CIk5W10V.js';
2
- import { S as SessionStateOptions, a as SessionState } from './session-types-B9NIf7_F.js';
3
- export { F as FetchPhase, c as FetchState, P as ProtocolViolation, d as ProtocolViolationCode, e as PublishPhase, f as PublishState, g as SessionPhase, h as SideEffect, i as SubscriptionPhase, j as SubscriptionState, T as TransitionResult, V as ValidationResult } from './session-types-B9NIf7_F.js';
4
- import './types-ClXELFGN.js';
1
+ import { S as SessionStateOptions, a as SessionState } from './session-types-DFjMk4HH.js';
2
+ export { F as FetchPhase, c as FetchState, P as ProtocolViolation, d as ProtocolViolationCode, e as PublishPhase, f as PublishState, g as SessionPhase, h as SideEffect, i as SubscriptionPhase, j as SubscriptionState, T as TransitionResult, V as ValidationResult } from './session-types-DFjMk4HH.js';
3
+ import { a as Draft14Message, c as Draft14MessageType } from './types-BTFeKYCb.js';
4
+ import './types-DPYE49t0.js';
5
5
 
6
6
  declare function createDraft14SessionState(options: SessionStateOptions): SessionState<Draft14Message, Draft14MessageType>;
7
7
 
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  createDraft14SessionState
3
- } from "./chunk-YPXLV5YK.js";
3
+ } from "./chunk-Z66WDWHI.js";
4
4
  export {
5
5
  createDraft14SessionState
6
6
  };
package/dist/draft14.cjs CHANGED
@@ -48,8 +48,8 @@
48
48
 
49
49
 
50
50
 
51
- var _chunk5WFXFLL4cjs = require('./chunk-5WFXFLL4.cjs');
52
- require('./chunk-2NARXGVA.cjs');
51
+ var _chunkFUFTMAQDcjs = require('./chunk-FUFTMAQD.cjs');
52
+ require('./chunk-FWISIR26.cjs');
53
53
 
54
54
 
55
55
 
@@ -59,7 +59,7 @@ require('./chunk-2NARXGVA.cjs');
59
59
 
60
60
 
61
61
 
62
- var _chunkGDRGWFEKcjs = require('./chunk-GDRGWFEK.cjs');
62
+ var _chunkNPWHHWXTcjs = require('./chunk-NPWHHWXT.cjs');
63
63
 
64
64
 
65
65
 
@@ -118,4 +118,4 @@ var _chunkGDRGWFEKcjs = require('./chunk-GDRGWFEK.cjs');
118
118
 
119
119
 
120
120
 
121
- exports.BIDIRECTIONAL_MESSAGES = _chunkGDRGWFEKcjs.BIDIRECTIONAL_MESSAGES; exports.CLIENT_ONLY_MESSAGES = _chunkGDRGWFEKcjs.CLIENT_ONLY_MESSAGES; exports.CONTROL_MESSAGES = _chunkGDRGWFEKcjs.CONTROL_MESSAGES; exports.Draft14SessionFSM = _chunkGDRGWFEKcjs.Draft14SessionFSM; exports.MESSAGE_ID_MAP = _chunk5WFXFLL4cjs.MESSAGE_ID_MAP; exports.MESSAGE_TYPE_MAP = _chunk5WFXFLL4cjs.MESSAGE_TYPE_MAP; exports.MSG_CLIENT_SETUP = _chunk5WFXFLL4cjs.MSG_CLIENT_SETUP; exports.MSG_FETCH = _chunk5WFXFLL4cjs.MSG_FETCH; exports.MSG_FETCH_CANCEL = _chunk5WFXFLL4cjs.MSG_FETCH_CANCEL; exports.MSG_FETCH_ERROR = _chunk5WFXFLL4cjs.MSG_FETCH_ERROR; exports.MSG_FETCH_OK = _chunk5WFXFLL4cjs.MSG_FETCH_OK; exports.MSG_GOAWAY = _chunk5WFXFLL4cjs.MSG_GOAWAY; exports.MSG_MAX_REQUEST_ID = _chunk5WFXFLL4cjs.MSG_MAX_REQUEST_ID; exports.MSG_PUBLISH = _chunk5WFXFLL4cjs.MSG_PUBLISH; exports.MSG_PUBLISH_DONE = _chunk5WFXFLL4cjs.MSG_PUBLISH_DONE; exports.MSG_PUBLISH_ERROR = _chunk5WFXFLL4cjs.MSG_PUBLISH_ERROR; exports.MSG_PUBLISH_NAMESPACE = _chunk5WFXFLL4cjs.MSG_PUBLISH_NAMESPACE; exports.MSG_PUBLISH_NAMESPACE_CANCEL = _chunk5WFXFLL4cjs.MSG_PUBLISH_NAMESPACE_CANCEL; exports.MSG_PUBLISH_NAMESPACE_DONE = _chunk5WFXFLL4cjs.MSG_PUBLISH_NAMESPACE_DONE; exports.MSG_PUBLISH_NAMESPACE_ERROR = _chunk5WFXFLL4cjs.MSG_PUBLISH_NAMESPACE_ERROR; exports.MSG_PUBLISH_NAMESPACE_OK = _chunk5WFXFLL4cjs.MSG_PUBLISH_NAMESPACE_OK; exports.MSG_PUBLISH_OK = _chunk5WFXFLL4cjs.MSG_PUBLISH_OK; exports.MSG_REQUESTS_BLOCKED = _chunk5WFXFLL4cjs.MSG_REQUESTS_BLOCKED; exports.MSG_SERVER_SETUP = _chunk5WFXFLL4cjs.MSG_SERVER_SETUP; exports.MSG_SUBSCRIBE = _chunk5WFXFLL4cjs.MSG_SUBSCRIBE; exports.MSG_SUBSCRIBE_ERROR = _chunk5WFXFLL4cjs.MSG_SUBSCRIBE_ERROR; exports.MSG_SUBSCRIBE_NAMESPACE = _chunk5WFXFLL4cjs.MSG_SUBSCRIBE_NAMESPACE; exports.MSG_SUBSCRIBE_NAMESPACE_ERROR = _chunk5WFXFLL4cjs.MSG_SUBSCRIBE_NAMESPACE_ERROR; exports.MSG_SUBSCRIBE_NAMESPACE_OK = _chunk5WFXFLL4cjs.MSG_SUBSCRIBE_NAMESPACE_OK; exports.MSG_SUBSCRIBE_OK = _chunk5WFXFLL4cjs.MSG_SUBSCRIBE_OK; exports.MSG_SUBSCRIBE_UPDATE = _chunk5WFXFLL4cjs.MSG_SUBSCRIBE_UPDATE; exports.MSG_TRACK_STATUS = _chunk5WFXFLL4cjs.MSG_TRACK_STATUS; exports.MSG_TRACK_STATUS_ERROR = _chunk5WFXFLL4cjs.MSG_TRACK_STATUS_ERROR; exports.MSG_TRACK_STATUS_OK = _chunk5WFXFLL4cjs.MSG_TRACK_STATUS_OK; exports.MSG_UNSUBSCRIBE = _chunk5WFXFLL4cjs.MSG_UNSUBSCRIBE; exports.MSG_UNSUBSCRIBE_NAMESPACE = _chunk5WFXFLL4cjs.MSG_UNSUBSCRIBE_NAMESPACE; exports.PARAM_MAX_REQUEST_ID = _chunk5WFXFLL4cjs.PARAM_MAX_REQUEST_ID; exports.PARAM_PATH = _chunk5WFXFLL4cjs.PARAM_PATH; exports.PARAM_ROLE = _chunk5WFXFLL4cjs.PARAM_ROLE; exports.SERVER_ONLY_MESSAGES = _chunkGDRGWFEKcjs.SERVER_ONLY_MESSAGES; exports.createDataStreamDecoder = _chunk5WFXFLL4cjs.createDataStreamDecoder; exports.createDraft14Codec = _chunk5WFXFLL4cjs.createDraft14Codec; exports.createDraft14SessionState = _chunkGDRGWFEKcjs.createDraft14SessionState; exports.createFetchStreamDecoder = _chunk5WFXFLL4cjs.createFetchStreamDecoder; exports.createStreamDecoder = _chunk5WFXFLL4cjs.createStreamDecoder; exports.createSubgroupStreamDecoder = _chunk5WFXFLL4cjs.createSubgroupStreamDecoder; exports.decodeDataStream = _chunk5WFXFLL4cjs.decodeDataStream; exports.decodeDatagram = _chunk5WFXFLL4cjs.decodeDatagram; exports.decodeFetchStream = _chunk5WFXFLL4cjs.decodeFetchStream; exports.decodeMessage = _chunk5WFXFLL4cjs.decodeMessage; exports.decodeSubgroupStream = _chunk5WFXFLL4cjs.decodeSubgroupStream; exports.encodeDatagram = _chunk5WFXFLL4cjs.encodeDatagram; exports.encodeFetchStream = _chunk5WFXFLL4cjs.encodeFetchStream; exports.encodeMessage = _chunk5WFXFLL4cjs.encodeMessage; exports.encodeSubgroupStream = _chunk5WFXFLL4cjs.encodeSubgroupStream; exports.getLegalIncoming = _chunkGDRGWFEKcjs.getLegalIncoming; exports.getLegalOutgoing = _chunkGDRGWFEKcjs.getLegalOutgoing;
121
+ exports.BIDIRECTIONAL_MESSAGES = _chunkNPWHHWXTcjs.BIDIRECTIONAL_MESSAGES; exports.CLIENT_ONLY_MESSAGES = _chunkNPWHHWXTcjs.CLIENT_ONLY_MESSAGES; exports.CONTROL_MESSAGES = _chunkNPWHHWXTcjs.CONTROL_MESSAGES; exports.Draft14SessionFSM = _chunkNPWHHWXTcjs.Draft14SessionFSM; exports.MESSAGE_ID_MAP = _chunkFUFTMAQDcjs.MESSAGE_ID_MAP; exports.MESSAGE_TYPE_MAP = _chunkFUFTMAQDcjs.MESSAGE_TYPE_MAP; exports.MSG_CLIENT_SETUP = _chunkFUFTMAQDcjs.MSG_CLIENT_SETUP; exports.MSG_FETCH = _chunkFUFTMAQDcjs.MSG_FETCH; exports.MSG_FETCH_CANCEL = _chunkFUFTMAQDcjs.MSG_FETCH_CANCEL; exports.MSG_FETCH_ERROR = _chunkFUFTMAQDcjs.MSG_FETCH_ERROR; exports.MSG_FETCH_OK = _chunkFUFTMAQDcjs.MSG_FETCH_OK; exports.MSG_GOAWAY = _chunkFUFTMAQDcjs.MSG_GOAWAY; exports.MSG_MAX_REQUEST_ID = _chunkFUFTMAQDcjs.MSG_MAX_REQUEST_ID; exports.MSG_PUBLISH = _chunkFUFTMAQDcjs.MSG_PUBLISH; exports.MSG_PUBLISH_DONE = _chunkFUFTMAQDcjs.MSG_PUBLISH_DONE; exports.MSG_PUBLISH_ERROR = _chunkFUFTMAQDcjs.MSG_PUBLISH_ERROR; exports.MSG_PUBLISH_NAMESPACE = _chunkFUFTMAQDcjs.MSG_PUBLISH_NAMESPACE; exports.MSG_PUBLISH_NAMESPACE_CANCEL = _chunkFUFTMAQDcjs.MSG_PUBLISH_NAMESPACE_CANCEL; exports.MSG_PUBLISH_NAMESPACE_DONE = _chunkFUFTMAQDcjs.MSG_PUBLISH_NAMESPACE_DONE; exports.MSG_PUBLISH_NAMESPACE_ERROR = _chunkFUFTMAQDcjs.MSG_PUBLISH_NAMESPACE_ERROR; exports.MSG_PUBLISH_NAMESPACE_OK = _chunkFUFTMAQDcjs.MSG_PUBLISH_NAMESPACE_OK; exports.MSG_PUBLISH_OK = _chunkFUFTMAQDcjs.MSG_PUBLISH_OK; exports.MSG_REQUESTS_BLOCKED = _chunkFUFTMAQDcjs.MSG_REQUESTS_BLOCKED; exports.MSG_SERVER_SETUP = _chunkFUFTMAQDcjs.MSG_SERVER_SETUP; exports.MSG_SUBSCRIBE = _chunkFUFTMAQDcjs.MSG_SUBSCRIBE; exports.MSG_SUBSCRIBE_ERROR = _chunkFUFTMAQDcjs.MSG_SUBSCRIBE_ERROR; exports.MSG_SUBSCRIBE_NAMESPACE = _chunkFUFTMAQDcjs.MSG_SUBSCRIBE_NAMESPACE; exports.MSG_SUBSCRIBE_NAMESPACE_ERROR = _chunkFUFTMAQDcjs.MSG_SUBSCRIBE_NAMESPACE_ERROR; exports.MSG_SUBSCRIBE_NAMESPACE_OK = _chunkFUFTMAQDcjs.MSG_SUBSCRIBE_NAMESPACE_OK; exports.MSG_SUBSCRIBE_OK = _chunkFUFTMAQDcjs.MSG_SUBSCRIBE_OK; exports.MSG_SUBSCRIBE_UPDATE = _chunkFUFTMAQDcjs.MSG_SUBSCRIBE_UPDATE; exports.MSG_TRACK_STATUS = _chunkFUFTMAQDcjs.MSG_TRACK_STATUS; exports.MSG_TRACK_STATUS_ERROR = _chunkFUFTMAQDcjs.MSG_TRACK_STATUS_ERROR; exports.MSG_TRACK_STATUS_OK = _chunkFUFTMAQDcjs.MSG_TRACK_STATUS_OK; exports.MSG_UNSUBSCRIBE = _chunkFUFTMAQDcjs.MSG_UNSUBSCRIBE; exports.MSG_UNSUBSCRIBE_NAMESPACE = _chunkFUFTMAQDcjs.MSG_UNSUBSCRIBE_NAMESPACE; exports.PARAM_MAX_REQUEST_ID = _chunkFUFTMAQDcjs.PARAM_MAX_REQUEST_ID; exports.PARAM_PATH = _chunkFUFTMAQDcjs.PARAM_PATH; exports.PARAM_ROLE = _chunkFUFTMAQDcjs.PARAM_ROLE; exports.SERVER_ONLY_MESSAGES = _chunkNPWHHWXTcjs.SERVER_ONLY_MESSAGES; exports.createDataStreamDecoder = _chunkFUFTMAQDcjs.createDataStreamDecoder; exports.createDraft14Codec = _chunkFUFTMAQDcjs.createDraft14Codec; exports.createDraft14SessionState = _chunkNPWHHWXTcjs.createDraft14SessionState; exports.createFetchStreamDecoder = _chunkFUFTMAQDcjs.createFetchStreamDecoder; exports.createStreamDecoder = _chunkFUFTMAQDcjs.createStreamDecoder; exports.createSubgroupStreamDecoder = _chunkFUFTMAQDcjs.createSubgroupStreamDecoder; exports.decodeDataStream = _chunkFUFTMAQDcjs.decodeDataStream; exports.decodeDatagram = _chunkFUFTMAQDcjs.decodeDatagram; exports.decodeFetchStream = _chunkFUFTMAQDcjs.decodeFetchStream; exports.decodeMessage = _chunkFUFTMAQDcjs.decodeMessage; exports.decodeSubgroupStream = _chunkFUFTMAQDcjs.decodeSubgroupStream; exports.encodeDatagram = _chunkFUFTMAQDcjs.encodeDatagram; exports.encodeFetchStream = _chunkFUFTMAQDcjs.encodeFetchStream; exports.encodeMessage = _chunkFUFTMAQDcjs.encodeMessage; exports.encodeSubgroupStream = _chunkFUFTMAQDcjs.encodeSubgroupStream; exports.getLegalIncoming = _chunkNPWHHWXTcjs.getLegalIncoming; exports.getLegalOutgoing = _chunkNPWHHWXTcjs.getLegalOutgoing;
@@ -1,10 +1,10 @@
1
- export { D as Draft14Codec, c as createDataStreamDecoder, a as createDraft14Codec, b as createFetchStreamDecoder, d as createStreamDecoder, e as createSubgroupStreamDecoder, f as decodeDataStream, g as decodeDatagram, h as decodeFetchStream, i as decodeMessage, j as decodeSubgroupStream, k as encodeDatagram, l as encodeFetchStream, m as encodeMessage, n as encodeSubgroupStream } from './codec-CTvFtQQI.cjs';
2
- import { c as Draft14MessageType, a as Draft14Message } from './types-CIk5W10V.cjs';
3
- export { d as DataStreamEvent, e as DataStreamHeader, f as DatagramObject, g as Draft14BaseMessage, h as Draft14ClientSetup, D as Draft14DataStream, i as Draft14Fetch, j as Draft14FetchCancel, k as Draft14FetchError, l as Draft14FetchOk, m as Draft14GoAway, n as Draft14MaxRequestId, b as Draft14Params, o as Draft14Publish, p as Draft14PublishDone, q as Draft14PublishError, r as Draft14PublishNamespace, s as Draft14PublishNamespaceCancel, t as Draft14PublishNamespaceDone, u as Draft14PublishNamespaceError, v as Draft14PublishNamespaceOk, w as Draft14PublishOk, x as Draft14RequestsBlocked, y as Draft14ServerSetup, z as Draft14Subscribe, A as Draft14SubscribeError, B as Draft14SubscribeNamespace, C as Draft14SubscribeNamespaceError, E as Draft14SubscribeNamespaceOk, F as Draft14SubscribeOk, G as Draft14SubscribeUpdate, H as Draft14TrackStatus, I as Draft14TrackStatusError, J as Draft14TrackStatusOk, K as Draft14Unsubscribe, L as Draft14UnsubscribeNamespace, M as FetchStream, N as FetchStreamHeader, O as ObjectPayload, S as SubgroupStream, P as SubgroupStreamHeader, U as UnknownParam } from './types-CIk5W10V.cjs';
1
+ export { D as Draft14Codec, c as createDataStreamDecoder, a as createDraft14Codec, b as createFetchStreamDecoder, d as createStreamDecoder, e as createSubgroupStreamDecoder, f as decodeDataStream, g as decodeDatagram, h as decodeFetchStream, i as decodeMessage, j as decodeSubgroupStream, k as encodeDatagram, l as encodeFetchStream, m as encodeMessage, n as encodeSubgroupStream } from './codec-Bvr7rFtj.cjs';
2
+ import { c as Draft14MessageType, a as Draft14Message } from './types-BTFeKYCb.cjs';
3
+ export { d as DataStreamEvent, e as DataStreamHeader, f as DatagramObject, g as Draft14BaseMessage, h as Draft14ClientSetup, D as Draft14DataStream, i as Draft14Fetch, j as Draft14FetchCancel, k as Draft14FetchError, l as Draft14FetchOk, m as Draft14GoAway, n as Draft14MaxRequestId, b as Draft14Params, o as Draft14Publish, p as Draft14PublishDone, q as Draft14PublishError, r as Draft14PublishNamespace, s as Draft14PublishNamespaceCancel, t as Draft14PublishNamespaceDone, u as Draft14PublishNamespaceError, v as Draft14PublishNamespaceOk, w as Draft14PublishOk, x as Draft14RequestsBlocked, y as Draft14ServerSetup, z as Draft14Subscribe, A as Draft14SubscribeError, B as Draft14SubscribeNamespace, C as Draft14SubscribeNamespaceError, E as Draft14SubscribeNamespaceOk, F as Draft14SubscribeOk, G as Draft14SubscribeUpdate, H as Draft14TrackStatus, I as Draft14TrackStatusError, J as Draft14TrackStatusOk, K as Draft14Unsubscribe, L as Draft14UnsubscribeNamespace, M as FetchStream, N as FetchStreamHeader, O as ObjectPayload, S as SubgroupStream, P as SubgroupStreamHeader, U as UnknownParam } from './types-BTFeKYCb.cjs';
4
4
  export { createDraft14SessionState } from './draft14-session.cjs';
5
- import { g as SessionPhase, j as SubscriptionState, b as AnnounceState, f as PublishState, c as FetchState, V as ValidationResult, T as TransitionResult } from './session-types-CCo-oA-d.cjs';
6
- export { F as FetchPhase, P as ProtocolViolation, d as ProtocolViolationCode, e as PublishPhase, a as SessionState, S as SessionStateOptions, h as SideEffect, i as SubscriptionPhase } from './session-types-CCo-oA-d.cjs';
7
- import './types-ClXELFGN.cjs';
5
+ import { g as SessionPhase, j as SubscriptionState, b as AnnounceState, f as PublishState, c as FetchState, V as ValidationResult, T as TransitionResult } from './session-types-DW1RSZX_.cjs';
6
+ export { F as FetchPhase, P as ProtocolViolation, d as ProtocolViolationCode, e as PublishPhase, a as SessionState, S as SessionStateOptions, h as SideEffect, i as SubscriptionPhase } from './session-types-DW1RSZX_.cjs';
7
+ import './types-DPYE49t0.cjs';
8
8
 
9
9
  declare const MSG_SUBSCRIBE_UPDATE = 2n;
10
10
  declare const MSG_SUBSCRIBE = 3n;
@@ -42,6 +42,13 @@ declare const PARAM_MAX_REQUEST_ID = 2n;
42
42
  declare const MESSAGE_TYPE_MAP: ReadonlyMap<bigint, string>;
43
43
  declare const MESSAGE_ID_MAP: ReadonlyMap<string, bigint>;
44
44
 
45
+ declare const CONTROL_MESSAGES: ReadonlySet<Draft14MessageType>;
46
+ declare const CLIENT_ONLY_MESSAGES: ReadonlySet<Draft14MessageType>;
47
+ declare const SERVER_ONLY_MESSAGES: ReadonlySet<Draft14MessageType>;
48
+ declare const BIDIRECTIONAL_MESSAGES: ReadonlySet<Draft14MessageType>;
49
+ declare function getLegalOutgoing(phase: string, role: "client" | "server"): Set<Draft14MessageType>;
50
+ declare function getLegalIncoming(phase: string, role: "client" | "server"): Set<Draft14MessageType>;
51
+
45
52
  declare class Draft14SessionFSM {
46
53
  private _phase;
47
54
  private _role;
@@ -49,9 +56,9 @@ declare class Draft14SessionFSM {
49
56
  private _publishes;
50
57
  private _fetches;
51
58
  private _requestIds;
52
- constructor(role: 'client' | 'server');
59
+ constructor(role: "client" | "server");
53
60
  get phase(): SessionPhase;
54
- get role(): 'client' | 'server';
61
+ get role(): "client" | "server";
55
62
  get subscriptions(): ReadonlyMap<bigint, SubscriptionState>;
56
63
  get announces(): ReadonlyMap<string, AnnounceState>;
57
64
  get publishes(): ReadonlyMap<bigint, PublishState>;
@@ -86,11 +93,4 @@ declare class Draft14SessionFSM {
86
93
  reset(): void;
87
94
  }
88
95
 
89
- declare const CONTROL_MESSAGES: ReadonlySet<Draft14MessageType>;
90
- declare const CLIENT_ONLY_MESSAGES: ReadonlySet<Draft14MessageType>;
91
- declare const SERVER_ONLY_MESSAGES: ReadonlySet<Draft14MessageType>;
92
- declare const BIDIRECTIONAL_MESSAGES: ReadonlySet<Draft14MessageType>;
93
- declare function getLegalOutgoing(phase: string, role: 'client' | 'server'): Set<Draft14MessageType>;
94
- declare function getLegalIncoming(phase: string, role: 'client' | 'server'): Set<Draft14MessageType>;
95
-
96
96
  export { BIDIRECTIONAL_MESSAGES, CLIENT_ONLY_MESSAGES, CONTROL_MESSAGES, Draft14Message, Draft14MessageType, Draft14SessionFSM, FetchState, MESSAGE_ID_MAP, MESSAGE_TYPE_MAP, MSG_CLIENT_SETUP, MSG_FETCH, MSG_FETCH_CANCEL, MSG_FETCH_ERROR, MSG_FETCH_OK, MSG_GOAWAY, MSG_MAX_REQUEST_ID, MSG_PUBLISH, MSG_PUBLISH_DONE, MSG_PUBLISH_ERROR, MSG_PUBLISH_NAMESPACE, MSG_PUBLISH_NAMESPACE_CANCEL, MSG_PUBLISH_NAMESPACE_DONE, MSG_PUBLISH_NAMESPACE_ERROR, MSG_PUBLISH_NAMESPACE_OK, MSG_PUBLISH_OK, MSG_REQUESTS_BLOCKED, MSG_SERVER_SETUP, MSG_SUBSCRIBE, MSG_SUBSCRIBE_ERROR, MSG_SUBSCRIBE_NAMESPACE, MSG_SUBSCRIBE_NAMESPACE_ERROR, MSG_SUBSCRIBE_NAMESPACE_OK, MSG_SUBSCRIBE_OK, MSG_SUBSCRIBE_UPDATE, MSG_TRACK_STATUS, MSG_TRACK_STATUS_ERROR, MSG_TRACK_STATUS_OK, MSG_UNSUBSCRIBE, MSG_UNSUBSCRIBE_NAMESPACE, PARAM_MAX_REQUEST_ID, PARAM_PATH, PARAM_ROLE, PublishState, SERVER_ONLY_MESSAGES, SessionPhase, SubscriptionState, TransitionResult, ValidationResult, getLegalIncoming, getLegalOutgoing };