@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.
- package/dist/{chunk-YBSEOSSP.js → chunk-A27S7HW7.js} +5 -1
- package/dist/{chunk-5WFXFLL4.cjs → chunk-FUFTMAQD.cjs} +96 -63
- package/dist/{chunk-2NARXGVA.cjs → chunk-FWISIR26.cjs} +5 -1
- package/dist/{chunk-23YG7F46.js → chunk-IXHOBNXA.js} +117 -17
- package/dist/{chunk-3BSZ55L3.cjs → chunk-NLYTRGXA.cjs} +153 -19
- package/dist/{chunk-GDRGWFEK.cjs → chunk-NPWHHWXT.cjs} +249 -37
- package/dist/{chunk-IQPDRQVC.js → chunk-U2B3B42P.js} +62 -29
- package/dist/{chunk-WNTXF3DE.cjs → chunk-YBZD3DU5.cjs} +127 -27
- package/dist/{chunk-DC4L6ZIT.js → chunk-YTXLWKOR.js} +153 -19
- package/dist/{chunk-YPXLV5YK.js → chunk-Z66WDWHI.js} +249 -37
- package/dist/{codec-qPzfmLNu.d.ts → codec-B2mc2g3i.d.ts} +5 -5
- package/dist/{codec-CTvFtQQI.d.cts → codec-Bvr7rFtj.d.cts} +5 -5
- package/dist/draft14-session.cjs +2 -2
- package/dist/draft14-session.d.cts +4 -4
- package/dist/draft14-session.d.ts +4 -4
- package/dist/draft14-session.js +1 -1
- package/dist/draft14.cjs +4 -4
- package/dist/draft14.d.cts +15 -15
- package/dist/draft14.d.ts +15 -15
- package/dist/draft14.js +3 -3
- package/dist/draft7-session.cjs +2 -2
- package/dist/draft7-session.d.cts +3 -3
- package/dist/draft7-session.d.ts +3 -3
- package/dist/draft7-session.js +1 -1
- package/dist/draft7.cjs +5 -5
- package/dist/draft7.d.cts +10 -10
- package/dist/draft7.d.ts +10 -10
- package/dist/draft7.js +2 -2
- package/dist/index.cjs +6 -6
- package/dist/index.d.cts +6 -6
- package/dist/index.d.ts +6 -6
- package/dist/index.js +3 -3
- package/dist/{session-types-B9NIf7_F.d.ts → session-types-DFjMk4HH.d.ts} +20 -20
- package/dist/{session-types-CCo-oA-d.d.cts → session-types-DW1RSZX_.d.cts} +20 -20
- package/dist/session.cjs +4 -4
- package/dist/session.d.cts +3 -3
- package/dist/session.d.ts +3 -3
- package/dist/session.js +2 -2
- package/dist/{types-CIk5W10V.d.ts → types-BTFeKYCb.d.cts} +37 -37
- package/dist/{types-CIk5W10V.d.cts → types-BTFeKYCb.d.ts} +37 -37
- package/dist/{types-ClXELFGN.d.cts → types-DPYE49t0.d.cts} +36 -36
- package/dist/{types-ClXELFGN.d.ts → types-DPYE49t0.d.ts} +36 -36
- package/package.json +7 -7
- package/src/core/buffer-reader.ts +16 -9
- package/src/core/buffer-writer.ts +2 -2
- package/src/core/errors.ts +1 -1
- package/src/core/session-types.ts +28 -41
- package/src/core/types.ts +70 -70
- package/src/drafts/draft07/announce-fsm.ts +1 -1
- package/src/drafts/draft07/codec.ts +195 -86
- package/src/drafts/draft07/index.ts +43 -44
- package/src/drafts/draft07/messages.ts +1 -1
- package/src/drafts/draft07/parameters.ts +2 -2
- package/src/drafts/draft07/rules.ts +68 -37
- package/src/drafts/draft07/session-fsm.ts +330 -117
- package/src/drafts/draft07/session.ts +10 -10
- package/src/drafts/draft07/subscription-fsm.ts +1 -1
- package/src/drafts/draft07/varint.ts +4 -4
- package/src/drafts/draft14/codec.ts +339 -189
- package/src/drafts/draft14/index.ts +103 -108
- package/src/drafts/draft14/messages.ts +61 -61
- package/src/drafts/draft14/rules.ts +77 -34
- package/src/drafts/draft14/session-fsm.ts +458 -146
- package/src/drafts/draft14/session.ts +13 -13
- package/src/drafts/draft14/types.ts +68 -68
- package/src/index.ts +66 -31
- 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
|
-
|
|
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(
|
|
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(
|
|
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(
|
|
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(
|
|
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 {
|
|
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 {
|
|
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 {
|
|
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 {
|
|
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 {
|
|
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 {
|
|
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 {
|
|
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 {
|
|
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 {
|
|
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({
|
|
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 {
|
|
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 {
|
|
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 {
|
|
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({
|
|
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 {
|
|
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 {
|
|
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 {
|
|
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 {
|
|
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({
|
|
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 {
|
|
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({
|
|
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 {
|
|
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 {
|
|
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 {
|
|
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 {
|
|
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({
|
|
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 {
|
|
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-
|
|
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-
|
|
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:
|
|
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:
|
|
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:
|
|
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-
|
|
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-
|
|
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:
|
|
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:
|
|
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:
|
|
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>;
|
package/dist/draft14-session.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _chunkNPWHHWXTcjs = require('./chunk-NPWHHWXT.cjs');
|
|
4
4
|
|
|
5
5
|
|
|
6
|
-
exports.createDraft14SessionState =
|
|
6
|
+
exports.createDraft14SessionState = _chunkNPWHHWXTcjs.createDraft14SessionState;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
import './types-
|
|
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 {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
import './types-
|
|
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
|
|
package/dist/draft14-session.js
CHANGED
package/dist/draft14.cjs
CHANGED
|
@@ -48,8 +48,8 @@
|
|
|
48
48
|
|
|
49
49
|
|
|
50
50
|
|
|
51
|
-
var
|
|
52
|
-
require('./chunk-
|
|
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
|
|
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 =
|
|
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;
|
package/dist/draft14.d.cts
CHANGED
|
@@ -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-
|
|
2
|
-
import { c as Draft14MessageType, a as Draft14Message } from './types-
|
|
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-
|
|
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-
|
|
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-
|
|
7
|
-
import './types-
|
|
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:
|
|
59
|
+
constructor(role: "client" | "server");
|
|
53
60
|
get phase(): SessionPhase;
|
|
54
|
-
get role():
|
|
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 };
|