moqtail 0.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,362 @@
1
+ import { m as FullTrackName, K as KeyValuePair, F as FrozenByteBuffer, B as BaseByteBuffer } from '../byte_buffer-BOK6VPTF.cjs';
2
+ export { a as ByteBuffer, D as DatagramObject, h as DatagramStatus, e as FetchHeaderType, j as FetchObject, L as Location, l as MAX_FULL_TRACK_NAME_LENGTH, k as MAX_NAMESPACE_TUPLE_COUNT, M as MAX_REASON_PHRASE_LEN, n as MoqtObject, O as ObjectDatagramStatusType, d as ObjectDatagramType, f as ObjectForwardingPreference, g as ObjectStatus, R as ReasonPhrase, S as SubgroupHeaderType, o as SubgroupObject, c as Tuple, T as TupleField, b as isBytes, i as isVarInt } from '../byte_buffer-BOK6VPTF.cjs';
3
+ export { ah as AuthTokenVariant, ai as AuthorizationToken, C as ClientSetup, a9 as CommonType, w as ControlMessage, d as ControlMessageType, D as DRAFT_14, am as DeliveryTimeout, x as Fetch, y as FetchCancel, z as FetchError, l as FetchErrorCode, a0 as FetchHeader, A as FetchOk, h as FetchType, F as FilterType, B as GoAway, G as GroupOrder, a3 as Header, al as MaxAuthTokenCacheSize, an as MaxCacheDuration, M as MaxRequestId, aj as MaxRequestIdParameter, a8 as Parameter, ak as Path, L as Publish, K as PublishDone, q as PublishDoneStatusCode, N as PublishError, u as PublishErrorCode, P as PublishNamespace, c as PublishNamespaceCancel, Z as PublishNamespaceDone, a as PublishNamespaceError, f as PublishNamespaceErrorCode, b as PublishNamespaceOk, O as PublishOk, a2 as RequestIdMap, R as RequestsBlocked, E as ServerSetup, a4 as SetupParameter, ab as SetupParameterType, a5 as SetupParameters, a1 as SubgroupHeader, S as Subscribe, Q as SubscribeError, k as SubscribeErrorCode, H as SubscribeNamespace, I as SubscribeNamespaceError, n as SubscribeNamespaceErrorCode, J as SubscribeNamespaceOk, U as SubscribeOk, V as SubscribeUpdate, af as TokenAliasType, W as TrackStatus, T as TrackStatusCode, X as TrackStatusError, Y as TrackStatusOk, _ as Unsubscribe, $ as UnsubscribeNamespace, a6 as VersionSpecificParameter, ad as VersionSpecificParameterType, a7 as VersionSpecificParameters, aa as commonTypeFromNumber, e as controlMessageTypeFromBigInt, m as fetchErrorCodeFromBigInt, i as fetchTypeFromBigInt, g as filterTypeFromBigInt, j as groupOrderFromNumber, r as publishDoneStatusCodeFromBigInt, v as publishErrorCodeFromBigInt, p as publishNamespaceErrorCodeFromBigInt, ac as setupParameterTypeFromNumber, s as subscribeErrorCodeFromBigInt, o as subscribeNamespaceErrorCodeFromBigInt, ag as tokenAliasTypeFromNumber, t as trackStatusCodeFromBigInt, ae as versionSpecificParameterTypeFromNumber } from '../version_parameter-DCE9_itC.cjs';
4
+
5
+ /**
6
+ * Copyright 2025 The MOQtail Authors
7
+ *
8
+ * Licensed under the Apache License, Version 2.0 (the "License");
9
+ * you may not use this file except in compliance with the License.
10
+ * You may obtain a copy of the License at
11
+ *
12
+ * http://www.apache.org/licenses/LICENSE-2.0
13
+ *
14
+ * Unless required by applicable law or agreed to in writing, software
15
+ * distributed under the License is distributed on an "AS IS" BASIS,
16
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17
+ * See the License for the specific language governing permissions and
18
+ * limitations under the License.
19
+ */
20
+
21
+ declare class Switch {
22
+ requestId: bigint;
23
+ fullTrackName: FullTrackName;
24
+ subscriptionRequestId: bigint;
25
+ parameters: KeyValuePair[];
26
+ constructor(requestId: bigint, fullTrackName: FullTrackName, subscriptionRequestId: bigint, parameters: KeyValuePair[]);
27
+ serialize(): FrozenByteBuffer;
28
+ static parsePayload(buf: BaseByteBuffer): Switch;
29
+ }
30
+
31
+ /**
32
+ * Copyright 2025 The MOQtail Authors
33
+ *
34
+ * Licensed under the Apache License, Version 2.0 (the "License");
35
+ * you may not use this file except in compliance with the License.
36
+ * You may obtain a copy of the License at
37
+ *
38
+ * http://www.apache.org/licenses/LICENSE-2.0
39
+ *
40
+ * Unless required by applicable law or agreed to in writing, software
41
+ * distributed under the License is distributed on an "AS IS" BASIS,
42
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
43
+ * See the License for the specific language governing permissions and
44
+ * limitations under the License.
45
+ */
46
+ /**
47
+ * Base class for all MOQtail errors.
48
+ */
49
+ declare class MOQtailError extends Error {
50
+ constructor(cause?: string);
51
+ }
52
+ /**
53
+ * Not enough bytes in buffer to satisfy a read.
54
+ */
55
+ declare class NotEnoughBytesError extends MOQtailError {
56
+ context: string;
57
+ needed: number;
58
+ available: number;
59
+ constructor(context: string, needed: number, available: number);
60
+ }
61
+ /**
62
+ * Cannot cast between two incompatible types.
63
+ */
64
+ declare class CastingError extends MOQtailError {
65
+ context: string;
66
+ fromType: string;
67
+ toType: string;
68
+ details: string;
69
+ constructor(context: string, fromType: string, toType: string, details: string);
70
+ }
71
+ /**
72
+ * Value too large to encode as varint.
73
+ */
74
+ declare class VarIntOverflowError extends MOQtailError {
75
+ context: string;
76
+ value: number;
77
+ constructor(context: string, value: number);
78
+ }
79
+ /**
80
+ * Length exceeds maximum allowed by protocol.
81
+ */
82
+ declare class LengthExceedsMaxError extends MOQtailError {
83
+ context: string;
84
+ max: number;
85
+ len: number;
86
+ constructor(context: string, max: number, len: number);
87
+ }
88
+ /**
89
+ * Key/value formatting error.
90
+ */
91
+ declare class KeyValueFormattingError extends MOQtailError {
92
+ context: string;
93
+ constructor(context: string);
94
+ }
95
+ /**
96
+ * Invalid discriminant or type tag.
97
+ */
98
+ declare class InvalidTypeError extends MOQtailError {
99
+ context: string;
100
+ details: string;
101
+ constructor(context: string, details: string);
102
+ }
103
+ /**
104
+ * Invalid UTF-8 encountered in a string or bytes field.
105
+ */
106
+ declare class InvalidUTF8Error extends MOQtailError {
107
+ context: string;
108
+ details: string;
109
+ constructor(context: string, details: string);
110
+ }
111
+ /**
112
+ * Generic protocol violation.
113
+ */
114
+ declare class ProtocolViolationError extends MOQtailError {
115
+ context: string;
116
+ details: string;
117
+ constructor(context: string, details: string);
118
+ }
119
+ /**
120
+ * Track naming error.
121
+ */
122
+ declare class TrackNameError extends MOQtailError {
123
+ context: string;
124
+ details: string;
125
+ constructor(context: string, details: string);
126
+ }
127
+ /**
128
+ * Request ID error.
129
+ */
130
+ declare class RequestIdError extends MOQtailError {
131
+ context: string;
132
+ details: string;
133
+ constructor(context: string, details: string);
134
+ }
135
+ /**
136
+ * Operation timed out.
137
+ */
138
+ declare class TimeoutError extends MOQtailError {
139
+ context: string;
140
+ constructor(context: string);
141
+ }
142
+ /**
143
+ * Internal error.
144
+ */
145
+ declare class InternalError extends MOQtailError {
146
+ context: string;
147
+ details: string;
148
+ constructor(context: string, details: string);
149
+ }
150
+ /**
151
+ * Connection terminated.
152
+ */
153
+ declare class TerminationError extends MOQtailError {
154
+ context: string;
155
+ terminationCode: number;
156
+ constructor(context: string, terminationCode: number);
157
+ }
158
+
159
+ /**
160
+ * Copyright 2025 The MOQtail Authors
161
+ *
162
+ * Licensed under the Apache License, Version 2.0 (the "License");
163
+ * you may not use this file except in compliance with the License.
164
+ * You may obtain a copy of the License at
165
+ *
166
+ * http://www.apache.org/licenses/LICENSE-2.0
167
+ *
168
+ * Unless required by applicable law or agreed to in writing, software
169
+ * distributed under the License is distributed on an "AS IS" BASIS,
170
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
171
+ * See the License for the specific language governing permissions and
172
+ * limitations under the License.
173
+ */
174
+ declare enum TerminationCode {
175
+ NO_ERROR = 0,
176
+ INTERNAL_ERROR = 1,
177
+ UNAUTHORIZED = 2,
178
+ PROTOCOL_VIOLATION = 3,
179
+ INVALID_REQUEST_ID = 4,
180
+ DUPLICATE_TRACK_ALIAS = 5,
181
+ KEY_VALUE_FORMATTING_ERROR = 6,
182
+ TOO_MANY_REQUESTS = 7,
183
+ INVALID_PATH = 8,
184
+ MALFORMED_PATH = 9,
185
+ GOAWAY_TIMEOUT = 16,
186
+ CONTROL_MESSAGE_TIMEOUT = 17,
187
+ DATA_STREAM_TIMEOUT = 18,
188
+ AUTH_TOKEN_CACHE_OVERFLOW = 19,
189
+ DUPLICATE_AUTH_TOKEN_ALIAS = 20,
190
+ VERSION_NEGOTIATION_FAILED = 21,
191
+ MALFORMED_AUTH_TOKEN = 22,
192
+ UNKNOWN_AUTH_TOKEN_ALIAS = 23,
193
+ EXPIRED_AUTH_TOKEN = 24,
194
+ INVALID_AUTHORITY = 25,
195
+ MALFORMED_AUTHORITY = 26
196
+ }
197
+ declare namespace TerminationCode {
198
+ /**
199
+ * Tries to convert a number to a TerminationCode enum member.
200
+ *
201
+ * @param code - The numeric code to convert.
202
+ * @returns The corresponding TerminationCode member, or throws InvalidTypeError if the code is not valid.
203
+ */
204
+ function tryFrom(code: number): TerminationCode;
205
+ }
206
+
207
+ /**
208
+ * Copyright 2025 The MOQtail Authors
209
+ *
210
+ * Licensed under the Apache License, Version 2.0 (the "License");
211
+ * you may not use this file except in compliance with the License.
212
+ * You may obtain a copy of the License at
213
+ *
214
+ * http://www.apache.org/licenses/LICENSE-2.0
215
+ *
216
+ * Unless required by applicable law or agreed to in writing, software
217
+ * distributed under the License is distributed on an "AS IS" BASIS,
218
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
219
+ * See the License for the specific language governing permissions and
220
+ * limitations under the License.
221
+ */
222
+ declare enum LOCHeaderExtensionId {
223
+ CaptureTimestamp = 2,
224
+ VideoFrameMarking = 4,
225
+ AudioLevel = 6,
226
+ VideoConfig = 13
227
+ }
228
+ declare function locHeaderExtensionIdFromNumber(value: number): LOCHeaderExtensionId;
229
+
230
+ /**
231
+ * Copyright 2025 The MOQtail Authors
232
+ *
233
+ * Licensed under the Apache License, Version 2.0 (the "License");
234
+ * you may not use this file except in compliance with the License.
235
+ * You may obtain a copy of the License at
236
+ *
237
+ * http://www.apache.org/licenses/LICENSE-2.0
238
+ *
239
+ * Unless required by applicable law or agreed to in writing, software
240
+ * distributed under the License is distributed on an "AS IS" BASIS,
241
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
242
+ * See the License for the specific language governing permissions and
243
+ * limitations under the License.
244
+ */
245
+
246
+ declare class CaptureTimestamp {
247
+ readonly timestamp: bigint;
248
+ static readonly TYPE = LOCHeaderExtensionId.CaptureTimestamp;
249
+ constructor(timestamp: bigint);
250
+ toKeyValuePair(): KeyValuePair;
251
+ static fromKeyValuePair(pair: KeyValuePair): CaptureTimestamp | undefined;
252
+ }
253
+
254
+ /**
255
+ * Copyright 2025 The MOQtail Authors
256
+ *
257
+ * Licensed under the Apache License, Version 2.0 (the "License");
258
+ * you may not use this file except in compliance with the License.
259
+ * You may obtain a copy of the License at
260
+ *
261
+ * http://www.apache.org/licenses/LICENSE-2.0
262
+ *
263
+ * Unless required by applicable law or agreed to in writing, software
264
+ * distributed under the License is distributed on an "AS IS" BASIS,
265
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
266
+ * See the License for the specific language governing permissions and
267
+ * limitations under the License.
268
+ */
269
+
270
+ declare class VideoFrameMarking {
271
+ readonly value: bigint;
272
+ static readonly TYPE = LOCHeaderExtensionId.VideoFrameMarking;
273
+ constructor(value: bigint);
274
+ toKeyValuePair(): KeyValuePair;
275
+ static fromKeyValuePair(pair: KeyValuePair): VideoFrameMarking | undefined;
276
+ }
277
+
278
+ /**
279
+ * Copyright 2025 The MOQtail Authors
280
+ *
281
+ * Licensed under the Apache License, Version 2.0 (the "License");
282
+ * you may not use this file except in compliance with the License.
283
+ * You may obtain a copy of the License at
284
+ *
285
+ * http://www.apache.org/licenses/LICENSE-2.0
286
+ *
287
+ * Unless required by applicable law or agreed to in writing, software
288
+ * distributed under the License is distributed on an "AS IS" BASIS,
289
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
290
+ * See the License for the specific language governing permissions and
291
+ * limitations under the License.
292
+ */
293
+
294
+ declare class AudioLevel {
295
+ readonly audioLevel: bigint;
296
+ static readonly TYPE = LOCHeaderExtensionId.AudioLevel;
297
+ constructor(audioLevel: bigint);
298
+ toKeyValuePair(): KeyValuePair;
299
+ static fromKeyValuePair(pair: KeyValuePair): AudioLevel | undefined;
300
+ }
301
+
302
+ /**
303
+ * Copyright 2025 The MOQtail Authors
304
+ *
305
+ * Licensed under the Apache License, Version 2.0 (the "License");
306
+ * you may not use this file except in compliance with the License.
307
+ * You may obtain a copy of the License at
308
+ *
309
+ * http://www.apache.org/licenses/LICENSE-2.0
310
+ *
311
+ * Unless required by applicable law or agreed to in writing, software
312
+ * distributed under the License is distributed on an "AS IS" BASIS,
313
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
314
+ * See the License for the specific language governing permissions and
315
+ * limitations under the License.
316
+ */
317
+
318
+ declare class VideoConfig {
319
+ readonly config: Uint8Array;
320
+ static readonly TYPE = LOCHeaderExtensionId.VideoConfig;
321
+ constructor(config: Uint8Array);
322
+ toKeyValuePair(): KeyValuePair;
323
+ static fromKeyValuePair(pair: KeyValuePair): VideoConfig | undefined;
324
+ }
325
+
326
+ /**
327
+ * Copyright 2025 The MOQtail Authors
328
+ *
329
+ * Licensed under the Apache License, Version 2.0 (the "License");
330
+ * you may not use this file except in compliance with the License.
331
+ * You may obtain a copy of the License at
332
+ *
333
+ * http://www.apache.org/licenses/LICENSE-2.0
334
+ *
335
+ * Unless required by applicable law or agreed to in writing, software
336
+ * distributed under the License is distributed on an "AS IS" BASIS,
337
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
338
+ * See the License for the specific language governing permissions and
339
+ * limitations under the License.
340
+ */
341
+
342
+ type ExtensionHeader = CaptureTimestamp | VideoFrameMarking | AudioLevel | VideoConfig;
343
+ declare namespace ExtensionHeader {
344
+ function fromKeyValuePair(pair: KeyValuePair): ExtensionHeader | undefined;
345
+ function toKeyValuePair(header: ExtensionHeader): KeyValuePair;
346
+ function isCaptureTimestamp(header: ExtensionHeader): header is CaptureTimestamp;
347
+ function isVideoFrameMarking(header: ExtensionHeader): header is VideoFrameMarking;
348
+ function isAudioLevel(header: ExtensionHeader): header is AudioLevel;
349
+ function isVideoConfig(header: ExtensionHeader): header is VideoConfig;
350
+ }
351
+ declare class ExtensionHeaders {
352
+ private kvps;
353
+ addCaptureTimestamp(timestamp: bigint | number): this;
354
+ addVideoFrameMarking(marking: bigint | number): this;
355
+ addAudioLevel(audioLevel: bigint | number): this;
356
+ addVideoConfig(config: Uint8Array): this;
357
+ addRaw(pair: KeyValuePair): this;
358
+ build(): KeyValuePair[];
359
+ static fromKeyValuePairs(kvps: KeyValuePair[]): ExtensionHeader[];
360
+ }
361
+
362
+ export { AudioLevel, BaseByteBuffer, CaptureTimestamp, CastingError, ExtensionHeader, ExtensionHeaders, FrozenByteBuffer, FullTrackName, InternalError, InvalidTypeError, InvalidUTF8Error, KeyValueFormattingError, KeyValuePair, LOCHeaderExtensionId, LengthExceedsMaxError, MOQtailError, NotEnoughBytesError, ProtocolViolationError, RequestIdError, Switch, TerminationCode, TerminationError, TimeoutError, TrackNameError, VarIntOverflowError, VideoConfig, VideoFrameMarking, locHeaderExtensionIdFromNumber };