@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
package/dist/draft14.d.ts
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-B2mc2g3i.js';
|
|
2
|
+
import { c as Draft14MessageType, a as Draft14Message } from './types-BTFeKYCb.js';
|
|
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.js';
|
|
4
4
|
export { createDraft14SessionState } from './draft14-session.js';
|
|
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-DFjMk4HH.js';
|
|
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-DFjMk4HH.js';
|
|
7
|
+
import './types-DPYE49t0.js';
|
|
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 };
|
package/dist/draft14.js
CHANGED
|
@@ -48,8 +48,8 @@ import {
|
|
|
48
48
|
encodeFetchStream,
|
|
49
49
|
encodeMessage,
|
|
50
50
|
encodeSubgroupStream
|
|
51
|
-
} from "./chunk-
|
|
52
|
-
import "./chunk-
|
|
51
|
+
} from "./chunk-U2B3B42P.js";
|
|
52
|
+
import "./chunk-A27S7HW7.js";
|
|
53
53
|
import {
|
|
54
54
|
BIDIRECTIONAL_MESSAGES,
|
|
55
55
|
CLIENT_ONLY_MESSAGES,
|
|
@@ -59,7 +59,7 @@ import {
|
|
|
59
59
|
createDraft14SessionState,
|
|
60
60
|
getLegalIncoming,
|
|
61
61
|
getLegalOutgoing
|
|
62
|
-
} from "./chunk-
|
|
62
|
+
} from "./chunk-Z66WDWHI.js";
|
|
63
63
|
export {
|
|
64
64
|
BIDIRECTIONAL_MESSAGES,
|
|
65
65
|
CLIENT_ONLY_MESSAGES,
|
package/dist/draft7-session.cjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _chunkNLYTRGXAcjs = require('./chunk-NLYTRGXA.cjs');
|
|
4
4
|
require('./chunk-QYG6KGOV.cjs');
|
|
5
5
|
|
|
6
6
|
|
|
7
|
-
exports.createDraft07SessionState =
|
|
7
|
+
exports.createDraft07SessionState = _chunkNLYTRGXAcjs.createDraft07SessionState;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { S as SessionStateOptions, a as SessionState } from './session-types-
|
|
2
|
-
export { A as AnnouncePhase, b as AnnounceState, P as ProtocolViolation, d as ProtocolViolationCode, g as SessionPhase, h as SideEffect, i as SubscriptionPhase, j as SubscriptionState, T as TransitionResult, V as ValidationResult } from './session-types-
|
|
3
|
-
import './types-
|
|
1
|
+
import { S as SessionStateOptions, a as SessionState } from './session-types-DW1RSZX_.cjs';
|
|
2
|
+
export { A as AnnouncePhase, b as AnnounceState, P as ProtocolViolation, d as ProtocolViolationCode, 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 './types-DPYE49t0.cjs';
|
|
4
4
|
|
|
5
5
|
declare function createDraft07SessionState(options: SessionStateOptions): SessionState;
|
|
6
6
|
|
package/dist/draft7-session.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { S as SessionStateOptions, a as SessionState } from './session-types-
|
|
2
|
-
export { A as AnnouncePhase, b as AnnounceState, P as ProtocolViolation, d as ProtocolViolationCode, g as SessionPhase, h as SideEffect, i as SubscriptionPhase, j as SubscriptionState, T as TransitionResult, V as ValidationResult } from './session-types-
|
|
3
|
-
import './types-
|
|
1
|
+
import { S as SessionStateOptions, a as SessionState } from './session-types-DFjMk4HH.js';
|
|
2
|
+
export { A as AnnouncePhase, b as AnnounceState, P as ProtocolViolation, d as ProtocolViolationCode, 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 './types-DPYE49t0.js';
|
|
4
4
|
|
|
5
5
|
declare function createDraft07SessionState(options: SessionStateOptions): SessionState;
|
|
6
6
|
|
package/dist/draft7-session.js
CHANGED
package/dist/draft7.cjs
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
|
|
7
|
-
var
|
|
7
|
+
var _chunkYBZD3DU5cjs = require('./chunk-YBZD3DU5.cjs');
|
|
8
8
|
|
|
9
9
|
|
|
10
10
|
|
|
@@ -16,11 +16,11 @@ var _chunkQYG6KGOVcjs = require('./chunk-QYG6KGOV.cjs');
|
|
|
16
16
|
|
|
17
17
|
|
|
18
18
|
|
|
19
|
-
var
|
|
19
|
+
var _chunkFWISIR26cjs = require('./chunk-FWISIR26.cjs');
|
|
20
20
|
|
|
21
21
|
// src/drafts/draft07/parameters.ts
|
|
22
22
|
function encodeParameters(params) {
|
|
23
|
-
const writer = new (0,
|
|
23
|
+
const writer = new (0, _chunkFWISIR26cjs.BufferWriter)();
|
|
24
24
|
writer.writeParameters(params);
|
|
25
25
|
return writer.finish();
|
|
26
26
|
}
|
|
@@ -29,7 +29,7 @@ function decodeParameters(reader) {
|
|
|
29
29
|
}
|
|
30
30
|
|
|
31
31
|
// src/drafts/draft07/index.ts
|
|
32
|
-
var defaultCodec =
|
|
32
|
+
var defaultCodec = _chunkYBZD3DU5cjs.createDraft07Codec.call(void 0, );
|
|
33
33
|
function encodeMessage(message) {
|
|
34
34
|
return defaultCodec.encodeMessage(message);
|
|
35
35
|
}
|
|
@@ -57,4 +57,4 @@ function createStreamDecoder() {
|
|
|
57
57
|
|
|
58
58
|
|
|
59
59
|
|
|
60
|
-
exports.CLIENT_ONLY_MESSAGES = _chunkQYG6KGOVcjs.CLIENT_ONLY_MESSAGES; exports.CONTROL_MESSAGES = _chunkQYG6KGOVcjs.CONTROL_MESSAGES; exports.DATA_MESSAGES = _chunkQYG6KGOVcjs.DATA_MESSAGES; exports.DecodeError =
|
|
60
|
+
exports.CLIENT_ONLY_MESSAGES = _chunkQYG6KGOVcjs.CLIENT_ONLY_MESSAGES; exports.CONTROL_MESSAGES = _chunkQYG6KGOVcjs.CONTROL_MESSAGES; exports.DATA_MESSAGES = _chunkQYG6KGOVcjs.DATA_MESSAGES; exports.DecodeError = _chunkFWISIR26cjs.DecodeError; exports.MESSAGE_ID_TO_TYPE = _chunkYBZD3DU5cjs.MESSAGE_ID_TO_TYPE; exports.MESSAGE_TYPE_IDS = _chunkYBZD3DU5cjs.MESSAGE_TYPE_IDS; exports.SERVER_ONLY_MESSAGES = _chunkQYG6KGOVcjs.SERVER_ONLY_MESSAGES; exports.createDraft07Codec = _chunkYBZD3DU5cjs.createDraft07Codec; exports.createStreamDecoder = createStreamDecoder; exports.decodeMessage = decodeMessage; exports.decodeParameters = decodeParameters; exports.decodeVarInt = _chunkYBZD3DU5cjs.decodeVarInt; exports.encodeMessage = encodeMessage; exports.encodeParameters = encodeParameters; exports.encodeVarInt = _chunkYBZD3DU5cjs.encodeVarInt; exports.getLegalIncoming = _chunkQYG6KGOVcjs.getLegalIncoming; exports.getLegalOutgoing = _chunkQYG6KGOVcjs.getLegalOutgoing;
|
package/dist/draft7.d.cts
CHANGED
|
@@ -1,8 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export { A as Announce, b as AnnounceCancel, c as AnnounceError, d as AnnounceOk, e as ClientSetup, D as DecodeError, f as DecodeErrorCode, F as Fetch, j as FetchCancel, k as FetchError, l as FetchOk, m as FilterType, G as GoAway, n as GroupOrderValue, M as MaxSubscribeId, O as ObjectDatagram, q as ObjectStream, S as ServerSetup, r as StreamHeaderGroup, s as StreamHeaderSubgroup, t as StreamHeaderTrack, u as Subscribe, v as SubscribeAnnounces, w as SubscribeAnnouncesError, x as SubscribeAnnouncesOk, y as SubscribeDone, z as SubscribeError, E as SubscribeOk, H as SubscribeUpdate, T as TrackStatus, I as TrackStatusRequest, U as Unannounce, J as Unsubscribe, K as UnsubscribeAnnounces } from './types-
|
|
3
|
-
|
|
4
|
-
declare function encodeVarInt(value: number | bigint): Uint8Array;
|
|
5
|
-
declare function decodeVarInt(bytes: Uint8Array, offset?: number): DecodeResult<bigint>;
|
|
1
|
+
import { a as Codec, p as MoqtMessageType, g as DecodeResult, o as MoqtMessage } from './types-DPYE49t0.cjs';
|
|
2
|
+
export { A as Announce, b as AnnounceCancel, c as AnnounceError, d as AnnounceOk, e as ClientSetup, D as DecodeError, f as DecodeErrorCode, F as Fetch, j as FetchCancel, k as FetchError, l as FetchOk, m as FilterType, G as GoAway, n as GroupOrderValue, M as MaxSubscribeId, O as ObjectDatagram, q as ObjectStream, S as ServerSetup, r as StreamHeaderGroup, s as StreamHeaderSubgroup, t as StreamHeaderTrack, u as Subscribe, v as SubscribeAnnounces, w as SubscribeAnnouncesError, x as SubscribeAnnouncesOk, y as SubscribeDone, z as SubscribeError, E as SubscribeOk, H as SubscribeUpdate, T as TrackStatus, I as TrackStatusRequest, U as Unannounce, J as Unsubscribe, K as UnsubscribeAnnounces } from './types-DPYE49t0.cjs';
|
|
6
3
|
|
|
7
4
|
declare class BufferReader {
|
|
8
5
|
readonly buffer: Uint8Array;
|
|
@@ -21,9 +18,6 @@ declare class BufferReader {
|
|
|
21
18
|
|
|
22
19
|
declare function createDraft07Codec(): Codec;
|
|
23
20
|
|
|
24
|
-
declare function encodeParameters(params: Map<bigint, Uint8Array>): Uint8Array;
|
|
25
|
-
declare function decodeParameters(reader: BufferReader): Map<bigint, Uint8Array>;
|
|
26
|
-
|
|
27
21
|
declare const MESSAGE_TYPE_IDS: {
|
|
28
22
|
readonly subscribe_update: 2n;
|
|
29
23
|
readonly subscribe: 3n;
|
|
@@ -58,12 +52,18 @@ declare const MESSAGE_TYPE_IDS: {
|
|
|
58
52
|
};
|
|
59
53
|
declare const MESSAGE_ID_TO_TYPE: Map<bigint, string>;
|
|
60
54
|
|
|
55
|
+
declare function encodeParameters(params: Map<bigint, Uint8Array>): Uint8Array;
|
|
56
|
+
declare function decodeParameters(reader: BufferReader): Map<bigint, Uint8Array>;
|
|
57
|
+
|
|
61
58
|
declare const CONTROL_MESSAGES: ReadonlySet<MoqtMessageType>;
|
|
62
59
|
declare const DATA_MESSAGES: ReadonlySet<MoqtMessageType>;
|
|
63
60
|
declare const CLIENT_ONLY_MESSAGES: ReadonlySet<MoqtMessageType>;
|
|
64
61
|
declare const SERVER_ONLY_MESSAGES: ReadonlySet<MoqtMessageType>;
|
|
65
|
-
declare function getLegalOutgoing(phase: string, role:
|
|
66
|
-
declare function getLegalIncoming(phase: string, role:
|
|
62
|
+
declare function getLegalOutgoing(phase: string, role: "client" | "server"): Set<MoqtMessageType>;
|
|
63
|
+
declare function getLegalIncoming(phase: string, role: "client" | "server"): Set<MoqtMessageType>;
|
|
64
|
+
|
|
65
|
+
declare function encodeVarInt(value: number | bigint): Uint8Array;
|
|
66
|
+
declare function decodeVarInt(bytes: Uint8Array, offset?: number): DecodeResult<bigint>;
|
|
67
67
|
|
|
68
68
|
declare function encodeMessage(message: MoqtMessage): Uint8Array;
|
|
69
69
|
declare function decodeMessage(bytes: Uint8Array): DecodeResult<MoqtMessage>;
|
package/dist/draft7.d.ts
CHANGED
|
@@ -1,8 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export { A as Announce, b as AnnounceCancel, c as AnnounceError, d as AnnounceOk, e as ClientSetup, D as DecodeError, f as DecodeErrorCode, F as Fetch, j as FetchCancel, k as FetchError, l as FetchOk, m as FilterType, G as GoAway, n as GroupOrderValue, M as MaxSubscribeId, O as ObjectDatagram, q as ObjectStream, S as ServerSetup, r as StreamHeaderGroup, s as StreamHeaderSubgroup, t as StreamHeaderTrack, u as Subscribe, v as SubscribeAnnounces, w as SubscribeAnnouncesError, x as SubscribeAnnouncesOk, y as SubscribeDone, z as SubscribeError, E as SubscribeOk, H as SubscribeUpdate, T as TrackStatus, I as TrackStatusRequest, U as Unannounce, J as Unsubscribe, K as UnsubscribeAnnounces } from './types-
|
|
3
|
-
|
|
4
|
-
declare function encodeVarInt(value: number | bigint): Uint8Array;
|
|
5
|
-
declare function decodeVarInt(bytes: Uint8Array, offset?: number): DecodeResult<bigint>;
|
|
1
|
+
import { a as Codec, p as MoqtMessageType, g as DecodeResult, o as MoqtMessage } from './types-DPYE49t0.js';
|
|
2
|
+
export { A as Announce, b as AnnounceCancel, c as AnnounceError, d as AnnounceOk, e as ClientSetup, D as DecodeError, f as DecodeErrorCode, F as Fetch, j as FetchCancel, k as FetchError, l as FetchOk, m as FilterType, G as GoAway, n as GroupOrderValue, M as MaxSubscribeId, O as ObjectDatagram, q as ObjectStream, S as ServerSetup, r as StreamHeaderGroup, s as StreamHeaderSubgroup, t as StreamHeaderTrack, u as Subscribe, v as SubscribeAnnounces, w as SubscribeAnnouncesError, x as SubscribeAnnouncesOk, y as SubscribeDone, z as SubscribeError, E as SubscribeOk, H as SubscribeUpdate, T as TrackStatus, I as TrackStatusRequest, U as Unannounce, J as Unsubscribe, K as UnsubscribeAnnounces } from './types-DPYE49t0.js';
|
|
6
3
|
|
|
7
4
|
declare class BufferReader {
|
|
8
5
|
readonly buffer: Uint8Array;
|
|
@@ -21,9 +18,6 @@ declare class BufferReader {
|
|
|
21
18
|
|
|
22
19
|
declare function createDraft07Codec(): Codec;
|
|
23
20
|
|
|
24
|
-
declare function encodeParameters(params: Map<bigint, Uint8Array>): Uint8Array;
|
|
25
|
-
declare function decodeParameters(reader: BufferReader): Map<bigint, Uint8Array>;
|
|
26
|
-
|
|
27
21
|
declare const MESSAGE_TYPE_IDS: {
|
|
28
22
|
readonly subscribe_update: 2n;
|
|
29
23
|
readonly subscribe: 3n;
|
|
@@ -58,12 +52,18 @@ declare const MESSAGE_TYPE_IDS: {
|
|
|
58
52
|
};
|
|
59
53
|
declare const MESSAGE_ID_TO_TYPE: Map<bigint, string>;
|
|
60
54
|
|
|
55
|
+
declare function encodeParameters(params: Map<bigint, Uint8Array>): Uint8Array;
|
|
56
|
+
declare function decodeParameters(reader: BufferReader): Map<bigint, Uint8Array>;
|
|
57
|
+
|
|
61
58
|
declare const CONTROL_MESSAGES: ReadonlySet<MoqtMessageType>;
|
|
62
59
|
declare const DATA_MESSAGES: ReadonlySet<MoqtMessageType>;
|
|
63
60
|
declare const CLIENT_ONLY_MESSAGES: ReadonlySet<MoqtMessageType>;
|
|
64
61
|
declare const SERVER_ONLY_MESSAGES: ReadonlySet<MoqtMessageType>;
|
|
65
|
-
declare function getLegalOutgoing(phase: string, role:
|
|
66
|
-
declare function getLegalIncoming(phase: string, role:
|
|
62
|
+
declare function getLegalOutgoing(phase: string, role: "client" | "server"): Set<MoqtMessageType>;
|
|
63
|
+
declare function getLegalIncoming(phase: string, role: "client" | "server"): Set<MoqtMessageType>;
|
|
64
|
+
|
|
65
|
+
declare function encodeVarInt(value: number | bigint): Uint8Array;
|
|
66
|
+
declare function decodeVarInt(bytes: Uint8Array, offset?: number): DecodeResult<bigint>;
|
|
67
67
|
|
|
68
68
|
declare function encodeMessage(message: MoqtMessage): Uint8Array;
|
|
69
69
|
declare function decodeMessage(bytes: Uint8Array): DecodeResult<MoqtMessage>;
|
package/dist/draft7.js
CHANGED
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
createDraft07Codec,
|
|
5
5
|
decodeVarInt,
|
|
6
6
|
encodeVarInt
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-IXHOBNXA.js";
|
|
8
8
|
import {
|
|
9
9
|
CLIENT_ONLY_MESSAGES,
|
|
10
10
|
CONTROL_MESSAGES,
|
|
@@ -16,7 +16,7 @@ import {
|
|
|
16
16
|
import {
|
|
17
17
|
BufferWriter,
|
|
18
18
|
DecodeError
|
|
19
|
-
} from "./chunk-
|
|
19
|
+
} from "./chunk-A27S7HW7.js";
|
|
20
20
|
|
|
21
21
|
// src/drafts/draft07/parameters.ts
|
|
22
22
|
function encodeParameters(params) {
|
package/dist/index.cjs
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _chunkYBZD3DU5cjs = require('./chunk-YBZD3DU5.cjs');
|
|
4
4
|
|
|
5
5
|
|
|
6
|
-
var
|
|
6
|
+
var _chunkFUFTMAQDcjs = require('./chunk-FUFTMAQD.cjs');
|
|
7
7
|
|
|
8
8
|
|
|
9
|
-
var
|
|
9
|
+
var _chunkFWISIR26cjs = require('./chunk-FWISIR26.cjs');
|
|
10
10
|
|
|
11
11
|
// src/index.ts
|
|
12
12
|
var DRAFT_ALIASES = {
|
|
@@ -27,9 +27,9 @@ Supported draft values: ${Object.keys(DRAFT_ALIASES).join(", ")}`
|
|
|
27
27
|
}
|
|
28
28
|
switch (draft) {
|
|
29
29
|
case "draft-ietf-moq-transport-07":
|
|
30
|
-
return
|
|
30
|
+
return _chunkYBZD3DU5cjs.createDraft07Codec.call(void 0, );
|
|
31
31
|
case "draft-ietf-moq-transport-14":
|
|
32
|
-
return
|
|
32
|
+
return _chunkFUFTMAQDcjs.createDraft14Codec.call(void 0, );
|
|
33
33
|
default:
|
|
34
34
|
throw new Error(`Unsupported draft: ${draft}`);
|
|
35
35
|
}
|
|
@@ -37,4 +37,4 @@ Supported draft values: ${Object.keys(DRAFT_ALIASES).join(", ")}`
|
|
|
37
37
|
|
|
38
38
|
|
|
39
39
|
|
|
40
|
-
exports.DecodeError =
|
|
40
|
+
exports.DecodeError = _chunkFWISIR26cjs.DecodeError; exports.createCodec = createCodec;
|
package/dist/index.d.cts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { C as CodecOptions, a as Codec } from './types-
|
|
2
|
-
export { A as Announce, b as AnnounceCancel, c as AnnounceError, d as AnnounceOk, B as BaseCodec, e as ClientSetup, D as DecodeError, f as DecodeErrorCode, g as DecodeResult, h as Draft, i as DraftShorthand, F as Fetch, j as FetchCancel, k as FetchError, l as FetchOk, m as FilterType, G as GoAway, n as GroupOrderValue, M as MaxSubscribeId, o as MoqtMessage, p as MoqtMessageType, O as ObjectDatagram, q as ObjectStream, S as ServerSetup, r as StreamHeaderGroup, s as StreamHeaderSubgroup, t as StreamHeaderTrack, u as Subscribe, v as SubscribeAnnounces, w as SubscribeAnnouncesError, x as SubscribeAnnouncesOk, y as SubscribeDone, z as SubscribeError, E as SubscribeOk, H as SubscribeUpdate, T as TrackStatus, I as TrackStatusRequest, U as Unannounce, J as Unsubscribe, K as UnsubscribeAnnounces } from './types-
|
|
3
|
-
import { D as Draft14Codec } from './codec-
|
|
4
|
-
export { D as Draft14DataStream, a as Draft14Message, b as Draft14Params } from './types-
|
|
1
|
+
import { C as CodecOptions, a as Codec } from './types-DPYE49t0.cjs';
|
|
2
|
+
export { A as Announce, b as AnnounceCancel, c as AnnounceError, d as AnnounceOk, B as BaseCodec, e as ClientSetup, D as DecodeError, f as DecodeErrorCode, g as DecodeResult, h as Draft, i as DraftShorthand, F as Fetch, j as FetchCancel, k as FetchError, l as FetchOk, m as FilterType, G as GoAway, n as GroupOrderValue, M as MaxSubscribeId, o as MoqtMessage, p as MoqtMessageType, O as ObjectDatagram, q as ObjectStream, S as ServerSetup, r as StreamHeaderGroup, s as StreamHeaderSubgroup, t as StreamHeaderTrack, u as Subscribe, v as SubscribeAnnounces, w as SubscribeAnnouncesError, x as SubscribeAnnouncesOk, y as SubscribeDone, z as SubscribeError, E as SubscribeOk, H as SubscribeUpdate, T as TrackStatus, I as TrackStatusRequest, U as Unannounce, J as Unsubscribe, K as UnsubscribeAnnounces } from './types-DPYE49t0.cjs';
|
|
3
|
+
import { D as Draft14Codec } from './codec-Bvr7rFtj.cjs';
|
|
4
|
+
export { D as Draft14DataStream, a as Draft14Message, b as Draft14Params } from './types-BTFeKYCb.cjs';
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
7
|
* @moqtap/codec — MoQT wire-format codec
|
|
@@ -21,13 +21,13 @@ export { D as Draft14DataStream, a as Draft14Message, b as Draft14Params } from
|
|
|
21
21
|
* Create a codec for draft-07 (returns full Codec with stream decoder).
|
|
22
22
|
*/
|
|
23
23
|
declare function createCodec(options: CodecOptions & {
|
|
24
|
-
draft:
|
|
24
|
+
draft: "draft-ietf-moq-transport-07" | "07";
|
|
25
25
|
}): Codec;
|
|
26
26
|
/**
|
|
27
27
|
* Create a codec for draft-14 (returns Draft14Codec with data stream support).
|
|
28
28
|
*/
|
|
29
29
|
declare function createCodec(options: CodecOptions & {
|
|
30
|
-
draft:
|
|
30
|
+
draft: "draft-ietf-moq-transport-14" | "14";
|
|
31
31
|
}): Draft14Codec;
|
|
32
32
|
/**
|
|
33
33
|
* Create a codec for the specified draft version.
|
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { C as CodecOptions, a as Codec } from './types-
|
|
2
|
-
export { A as Announce, b as AnnounceCancel, c as AnnounceError, d as AnnounceOk, B as BaseCodec, e as ClientSetup, D as DecodeError, f as DecodeErrorCode, g as DecodeResult, h as Draft, i as DraftShorthand, F as Fetch, j as FetchCancel, k as FetchError, l as FetchOk, m as FilterType, G as GoAway, n as GroupOrderValue, M as MaxSubscribeId, o as MoqtMessage, p as MoqtMessageType, O as ObjectDatagram, q as ObjectStream, S as ServerSetup, r as StreamHeaderGroup, s as StreamHeaderSubgroup, t as StreamHeaderTrack, u as Subscribe, v as SubscribeAnnounces, w as SubscribeAnnouncesError, x as SubscribeAnnouncesOk, y as SubscribeDone, z as SubscribeError, E as SubscribeOk, H as SubscribeUpdate, T as TrackStatus, I as TrackStatusRequest, U as Unannounce, J as Unsubscribe, K as UnsubscribeAnnounces } from './types-
|
|
3
|
-
import { D as Draft14Codec } from './codec-
|
|
4
|
-
export { D as Draft14DataStream, a as Draft14Message, b as Draft14Params } from './types-
|
|
1
|
+
import { C as CodecOptions, a as Codec } from './types-DPYE49t0.js';
|
|
2
|
+
export { A as Announce, b as AnnounceCancel, c as AnnounceError, d as AnnounceOk, B as BaseCodec, e as ClientSetup, D as DecodeError, f as DecodeErrorCode, g as DecodeResult, h as Draft, i as DraftShorthand, F as Fetch, j as FetchCancel, k as FetchError, l as FetchOk, m as FilterType, G as GoAway, n as GroupOrderValue, M as MaxSubscribeId, o as MoqtMessage, p as MoqtMessageType, O as ObjectDatagram, q as ObjectStream, S as ServerSetup, r as StreamHeaderGroup, s as StreamHeaderSubgroup, t as StreamHeaderTrack, u as Subscribe, v as SubscribeAnnounces, w as SubscribeAnnouncesError, x as SubscribeAnnouncesOk, y as SubscribeDone, z as SubscribeError, E as SubscribeOk, H as SubscribeUpdate, T as TrackStatus, I as TrackStatusRequest, U as Unannounce, J as Unsubscribe, K as UnsubscribeAnnounces } from './types-DPYE49t0.js';
|
|
3
|
+
import { D as Draft14Codec } from './codec-B2mc2g3i.js';
|
|
4
|
+
export { D as Draft14DataStream, a as Draft14Message, b as Draft14Params } from './types-BTFeKYCb.js';
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
7
|
* @moqtap/codec — MoQT wire-format codec
|
|
@@ -21,13 +21,13 @@ export { D as Draft14DataStream, a as Draft14Message, b as Draft14Params } from
|
|
|
21
21
|
* Create a codec for draft-07 (returns full Codec with stream decoder).
|
|
22
22
|
*/
|
|
23
23
|
declare function createCodec(options: CodecOptions & {
|
|
24
|
-
draft:
|
|
24
|
+
draft: "draft-ietf-moq-transport-07" | "07";
|
|
25
25
|
}): Codec;
|
|
26
26
|
/**
|
|
27
27
|
* Create a codec for draft-14 (returns Draft14Codec with data stream support).
|
|
28
28
|
*/
|
|
29
29
|
declare function createCodec(options: CodecOptions & {
|
|
30
|
-
draft:
|
|
30
|
+
draft: "draft-ietf-moq-transport-14" | "14";
|
|
31
31
|
}): Draft14Codec;
|
|
32
32
|
/**
|
|
33
33
|
* Create a codec for the specified draft version.
|
package/dist/index.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import {
|
|
2
2
|
createDraft07Codec
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-IXHOBNXA.js";
|
|
4
4
|
import {
|
|
5
5
|
createDraft14Codec
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-U2B3B42P.js";
|
|
7
7
|
import {
|
|
8
8
|
DecodeError
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-A27S7HW7.js";
|
|
10
10
|
|
|
11
11
|
// src/index.ts
|
|
12
12
|
var DRAFT_ALIASES = {
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { p as MoqtMessageType, o as MoqtMessage } from './types-
|
|
1
|
+
import { p as MoqtMessageType, o as MoqtMessage } from './types-DPYE49t0.js';
|
|
2
2
|
|
|
3
|
-
type SessionPhase =
|
|
4
|
-
type SubscriptionPhase =
|
|
5
|
-
type AnnouncePhase =
|
|
6
|
-
type PublishPhase =
|
|
7
|
-
type FetchPhase =
|
|
3
|
+
type SessionPhase = "idle" | "setup" | "ready" | "draining" | "closed" | "error";
|
|
4
|
+
type SubscriptionPhase = "pending" | "active" | "error" | "done";
|
|
5
|
+
type AnnouncePhase = "pending" | "active" | "error";
|
|
6
|
+
type PublishPhase = "pending" | "active" | "error" | "done";
|
|
7
|
+
type FetchPhase = "pending" | "active" | "error" | "cancelled";
|
|
8
8
|
interface SubscriptionState {
|
|
9
9
|
readonly subscribeId: bigint;
|
|
10
10
|
readonly phase: SubscriptionPhase;
|
|
@@ -27,11 +27,11 @@ interface SessionStateOptions {
|
|
|
27
27
|
codec: {
|
|
28
28
|
draft: string;
|
|
29
29
|
};
|
|
30
|
-
role:
|
|
30
|
+
role: "client" | "server";
|
|
31
31
|
}
|
|
32
32
|
interface SessionState<M = MoqtMessage, T extends string = MoqtMessageType> {
|
|
33
33
|
readonly phase: SessionPhase;
|
|
34
|
-
readonly role:
|
|
34
|
+
readonly role: "client" | "server";
|
|
35
35
|
receive(message: M): TransitionResult<T>;
|
|
36
36
|
validateOutgoing(message: M): ValidationResult<T>;
|
|
37
37
|
send(message: M): TransitionResult<T>;
|
|
@@ -61,41 +61,41 @@ interface ProtocolViolation<T extends string = MoqtMessageType> {
|
|
|
61
61
|
readonly currentPhase: SessionPhase;
|
|
62
62
|
readonly offendingMessage: T;
|
|
63
63
|
}
|
|
64
|
-
type ProtocolViolationCode =
|
|
64
|
+
type ProtocolViolationCode = "MESSAGE_BEFORE_SETUP" | "UNEXPECTED_MESSAGE" | "DUPLICATE_SUBSCRIBE_ID" | "UNKNOWN_SUBSCRIBE_ID" | "DUPLICATE_REQUEST_ID" | "UNKNOWN_REQUEST_ID" | "ROLE_VIOLATION" | "STATE_VIOLATION" | "SETUP_VIOLATION";
|
|
65
65
|
type SideEffect = {
|
|
66
|
-
type:
|
|
66
|
+
type: "subscription-activated";
|
|
67
67
|
subscribeId: bigint;
|
|
68
68
|
} | {
|
|
69
|
-
type:
|
|
69
|
+
type: "subscription-ended";
|
|
70
70
|
subscribeId: bigint;
|
|
71
71
|
reason: string;
|
|
72
72
|
} | {
|
|
73
|
-
type:
|
|
73
|
+
type: "announce-activated";
|
|
74
74
|
namespace: string[];
|
|
75
75
|
} | {
|
|
76
|
-
type:
|
|
76
|
+
type: "announce-ended";
|
|
77
77
|
namespace: string[];
|
|
78
78
|
} | {
|
|
79
|
-
type:
|
|
79
|
+
type: "publish-activated";
|
|
80
80
|
requestId: bigint;
|
|
81
81
|
} | {
|
|
82
|
-
type:
|
|
82
|
+
type: "publish-ended";
|
|
83
83
|
requestId: bigint;
|
|
84
84
|
reason: string;
|
|
85
85
|
} | {
|
|
86
|
-
type:
|
|
86
|
+
type: "fetch-activated";
|
|
87
87
|
requestId: bigint;
|
|
88
88
|
} | {
|
|
89
|
-
type:
|
|
89
|
+
type: "fetch-ended";
|
|
90
90
|
requestId: bigint;
|
|
91
91
|
reason: string;
|
|
92
92
|
} | {
|
|
93
|
-
type:
|
|
93
|
+
type: "session-ready";
|
|
94
94
|
} | {
|
|
95
|
-
type:
|
|
95
|
+
type: "session-draining";
|
|
96
96
|
goAwayUri: string;
|
|
97
97
|
} | {
|
|
98
|
-
type:
|
|
98
|
+
type: "session-closed";
|
|
99
99
|
};
|
|
100
100
|
|
|
101
101
|
export type { AnnouncePhase as A, FetchPhase as F, ProtocolViolation as P, SessionStateOptions as S, TransitionResult as T, ValidationResult as V, SessionState as a, AnnounceState as b, FetchState as c, ProtocolViolationCode as d, PublishPhase as e, PublishState as f, SessionPhase as g, SideEffect as h, SubscriptionPhase as i, SubscriptionState as j };
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { p as MoqtMessageType, o as MoqtMessage } from './types-
|
|
1
|
+
import { p as MoqtMessageType, o as MoqtMessage } from './types-DPYE49t0.cjs';
|
|
2
2
|
|
|
3
|
-
type SessionPhase =
|
|
4
|
-
type SubscriptionPhase =
|
|
5
|
-
type AnnouncePhase =
|
|
6
|
-
type PublishPhase =
|
|
7
|
-
type FetchPhase =
|
|
3
|
+
type SessionPhase = "idle" | "setup" | "ready" | "draining" | "closed" | "error";
|
|
4
|
+
type SubscriptionPhase = "pending" | "active" | "error" | "done";
|
|
5
|
+
type AnnouncePhase = "pending" | "active" | "error";
|
|
6
|
+
type PublishPhase = "pending" | "active" | "error" | "done";
|
|
7
|
+
type FetchPhase = "pending" | "active" | "error" | "cancelled";
|
|
8
8
|
interface SubscriptionState {
|
|
9
9
|
readonly subscribeId: bigint;
|
|
10
10
|
readonly phase: SubscriptionPhase;
|
|
@@ -27,11 +27,11 @@ interface SessionStateOptions {
|
|
|
27
27
|
codec: {
|
|
28
28
|
draft: string;
|
|
29
29
|
};
|
|
30
|
-
role:
|
|
30
|
+
role: "client" | "server";
|
|
31
31
|
}
|
|
32
32
|
interface SessionState<M = MoqtMessage, T extends string = MoqtMessageType> {
|
|
33
33
|
readonly phase: SessionPhase;
|
|
34
|
-
readonly role:
|
|
34
|
+
readonly role: "client" | "server";
|
|
35
35
|
receive(message: M): TransitionResult<T>;
|
|
36
36
|
validateOutgoing(message: M): ValidationResult<T>;
|
|
37
37
|
send(message: M): TransitionResult<T>;
|
|
@@ -61,41 +61,41 @@ interface ProtocolViolation<T extends string = MoqtMessageType> {
|
|
|
61
61
|
readonly currentPhase: SessionPhase;
|
|
62
62
|
readonly offendingMessage: T;
|
|
63
63
|
}
|
|
64
|
-
type ProtocolViolationCode =
|
|
64
|
+
type ProtocolViolationCode = "MESSAGE_BEFORE_SETUP" | "UNEXPECTED_MESSAGE" | "DUPLICATE_SUBSCRIBE_ID" | "UNKNOWN_SUBSCRIBE_ID" | "DUPLICATE_REQUEST_ID" | "UNKNOWN_REQUEST_ID" | "ROLE_VIOLATION" | "STATE_VIOLATION" | "SETUP_VIOLATION";
|
|
65
65
|
type SideEffect = {
|
|
66
|
-
type:
|
|
66
|
+
type: "subscription-activated";
|
|
67
67
|
subscribeId: bigint;
|
|
68
68
|
} | {
|
|
69
|
-
type:
|
|
69
|
+
type: "subscription-ended";
|
|
70
70
|
subscribeId: bigint;
|
|
71
71
|
reason: string;
|
|
72
72
|
} | {
|
|
73
|
-
type:
|
|
73
|
+
type: "announce-activated";
|
|
74
74
|
namespace: string[];
|
|
75
75
|
} | {
|
|
76
|
-
type:
|
|
76
|
+
type: "announce-ended";
|
|
77
77
|
namespace: string[];
|
|
78
78
|
} | {
|
|
79
|
-
type:
|
|
79
|
+
type: "publish-activated";
|
|
80
80
|
requestId: bigint;
|
|
81
81
|
} | {
|
|
82
|
-
type:
|
|
82
|
+
type: "publish-ended";
|
|
83
83
|
requestId: bigint;
|
|
84
84
|
reason: string;
|
|
85
85
|
} | {
|
|
86
|
-
type:
|
|
86
|
+
type: "fetch-activated";
|
|
87
87
|
requestId: bigint;
|
|
88
88
|
} | {
|
|
89
|
-
type:
|
|
89
|
+
type: "fetch-ended";
|
|
90
90
|
requestId: bigint;
|
|
91
91
|
reason: string;
|
|
92
92
|
} | {
|
|
93
|
-
type:
|
|
93
|
+
type: "session-ready";
|
|
94
94
|
} | {
|
|
95
|
-
type:
|
|
95
|
+
type: "session-draining";
|
|
96
96
|
goAwayUri: string;
|
|
97
97
|
} | {
|
|
98
|
-
type:
|
|
98
|
+
type: "session-closed";
|
|
99
99
|
};
|
|
100
100
|
|
|
101
101
|
export type { AnnouncePhase as A, FetchPhase as F, ProtocolViolation as P, SessionStateOptions as S, TransitionResult as T, ValidationResult as V, SessionState as a, AnnounceState as b, FetchState as c, ProtocolViolationCode as d, PublishPhase as e, PublishState as f, SessionPhase as g, SideEffect as h, SubscriptionPhase as i, SubscriptionState as j };
|
package/dist/session.cjs
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _chunkNLYTRGXAcjs = require('./chunk-NLYTRGXA.cjs');
|
|
4
4
|
require('./chunk-QYG6KGOV.cjs');
|
|
5
5
|
|
|
6
6
|
|
|
7
|
-
var
|
|
7
|
+
var _chunkNPWHHWXTcjs = require('./chunk-NPWHHWXT.cjs');
|
|
8
8
|
|
|
9
9
|
// src/session.ts
|
|
10
10
|
function createSessionState(options) {
|
|
11
11
|
const draft = options.codec.draft;
|
|
12
12
|
switch (draft) {
|
|
13
13
|
case "draft-ietf-moq-transport-07":
|
|
14
|
-
return
|
|
14
|
+
return _chunkNLYTRGXAcjs.createDraft07SessionState.call(void 0, options);
|
|
15
15
|
case "draft-ietf-moq-transport-14":
|
|
16
|
-
return
|
|
16
|
+
return _chunkNPWHHWXTcjs.createDraft14SessionState.call(void 0, options);
|
|
17
17
|
default:
|
|
18
18
|
throw new Error(
|
|
19
19
|
`Unsupported draft for session: "${draft}". Use a draft-scoped import instead:
|
package/dist/session.d.cts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { S as SessionStateOptions, a as SessionState } from './session-types-
|
|
2
|
-
export { A as AnnouncePhase, b as AnnounceState, 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-
|
|
3
|
-
import './types-
|
|
1
|
+
import { S as SessionStateOptions, a as SessionState } from './session-types-DW1RSZX_.cjs';
|
|
2
|
+
export { A as AnnouncePhase, b as AnnounceState, 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 './types-DPYE49t0.cjs';
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* @moqtap/codec/session — MoQT session state machine
|
package/dist/session.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { S as SessionStateOptions, a as SessionState } from './session-types-
|
|
2
|
-
export { A as AnnouncePhase, b as AnnounceState, 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-
|
|
3
|
-
import './types-
|
|
1
|
+
import { S as SessionStateOptions, a as SessionState } from './session-types-DFjMk4HH.js';
|
|
2
|
+
export { A as AnnouncePhase, b as AnnounceState, 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 './types-DPYE49t0.js';
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* @moqtap/codec/session — MoQT session state machine
|
package/dist/session.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
2
|
createDraft07SessionState
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-YTXLWKOR.js";
|
|
4
4
|
import "./chunk-UOBWHJA5.js";
|
|
5
5
|
import {
|
|
6
6
|
createDraft14SessionState
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-Z66WDWHI.js";
|
|
8
8
|
|
|
9
9
|
// src/session.ts
|
|
10
10
|
function createSessionState(options) {
|