moqtail 0.12.1 → 0.13.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/model.d.ts DELETED
@@ -1,442 +0,0 @@
1
- import { u as FullTrackName, K as KeyValuePair, t as FrozenByteBuffer, B as BaseByteBuffer, L as LOCHeaderExtensionId, av as TrackExtensionType, b as ByteBuffer } from './setup_parameter-BgNrJRDS.js';
2
- export { A as AuthTokenVariant, a as AuthorizationToken, C as ClientSetup, c as ControlMessage, d as ControlMessageType, D as Datagram, e as DefaultPublisherGroupOrderExtension, f as DefaultPublisherPriorityExtension, g as DeliveryTimeout, h as DeliveryTimeoutExtension, i as DynamicGroupsExtension, E as EndOfRangeKind, j as Expires, F as Fetch, k as FetchCancel, l as FetchHeader, m as FetchHeaderType, n as FetchObject, o as FetchObjectContext, p as FetchOk, q as FetchType, r as FilterType, s as Forward, G as GoAway, v as GroupOrder, w as GroupOrderParam, H as Header, I as ImmutableExtensionsExtension, x as LargestObject, y as Location, M as MAX_FULL_TRACK_NAME_LENGTH, z as MAX_NAMESPACE_TUPLE_COUNT, J as MAX_REASON_PHRASE_LEN, N as MaxAuthTokenCacheSize, O as MaxCacheDurationExtension, P as MaxRequestId, Q as MaxRequestIdParameter, R as MessageParameter, S as MessageParameterType, T as MessageParameters, U as MoqtObject, V as Namespace, W as NamespaceDone, X as NamespaceSubscribeOptions, Y as NewGroupRequest, Z as ObjectDatagramType, _ as ObjectForwardingPreference, $ as ObjectStatus, a0 as Parameter, a1 as Path, a2 as Publish, a3 as PublishDone, a4 as PublishDoneStatusCode, a5 as PublishNamespace, a6 as PublishNamespaceCancel, a7 as PublishNamespaceDone, a8 as PublishOk, a9 as ReasonPhrase, aa as RequestError, ab as RequestErrorCode, ac as RequestIdMap, ad as RequestOk, ae as RequestUpdate, af as RequestsBlocked, ag as SUPPORTED_VERSIONS, ah as ServerSetup, ai as SetupParameter, aj as SetupParameterType, ak as SetupParameters, al as SubgroupHeader, am as SubgroupHeaderType, an as SubgroupObject, ao as Subscribe, ap as SubscribeNamespace, aq as SubscribeOk, ar as SubscriberPriority, as as SubscriptionFilter, at as TokenAliasType, au as TrackExtension, aw as TrackStatus, ax as TrackStatusCode, ay as Tuple, az as TupleField, aA as UnknownTrackExtension, aB as Unsubscribe, aC as UnsubscribeNamespace, aD as applyMessageParameterUpdate, aE as controlMessageTypeFromBigInt, aF as deserializeKvpList, aG as deserializeKvpListUntilEmpty, aH as fetchTypeFromBigInt, aI as filterTypeFromBigInt, aJ as groupOrderFromNumber, aK as isBytes, aL as isVarInt, aM as locHeaderExtensionIdFromNumber, aN as messageParameterTypeFromNumber, aO as publishDoneStatusCodeFromBigInt, aP as requestErrorCodeFromBigInt, aQ as serializeKvpList, aR as setupParameterTypeFromNumber, aS as tokenAliasTypeFromNumber, aT as trackStatusCodeFromBigInt } from './setup_parameter-BgNrJRDS.js';
3
-
4
- /**
5
- * Copyright 2025 The MOQtail Authors
6
- *
7
- * Licensed under the Apache License, Version 2.0 (the "License");
8
- * you may not use this file except in compliance with the License.
9
- * You may obtain a copy of the License at
10
- *
11
- * http://www.apache.org/licenses/LICENSE-2.0
12
- *
13
- * Unless required by applicable law or agreed to in writing, software
14
- * distributed under the License is distributed on an "AS IS" BASIS,
15
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16
- * See the License for the specific language governing permissions and
17
- * limitations under the License.
18
- */
19
-
20
- declare class Switch {
21
- requestId: bigint;
22
- fullTrackName: FullTrackName;
23
- subscriptionRequestId: bigint;
24
- parameters: KeyValuePair[];
25
- constructor(requestId: bigint, fullTrackName: FullTrackName, subscriptionRequestId: bigint, parameters: KeyValuePair[]);
26
- serialize(): FrozenByteBuffer;
27
- static parsePayload(buf: BaseByteBuffer): Switch;
28
- }
29
-
30
- /**
31
- * Copyright 2026 The MOQtail Authors
32
- *
33
- * Licensed under the Apache License, Version 2.0 (the "License");
34
- * you may not use this file except in compliance with the License.
35
- * You may obtain a copy of the License at
36
- *
37
- * http://www.apache.org/licenses/LICENSE-2.0
38
- *
39
- * Unless required by applicable law or agreed to in writing, software
40
- * distributed under the License is distributed on an "AS IS" BASIS,
41
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
42
- * See the License for the specific language governing permissions and
43
- * limitations under the License.
44
- */
45
- interface CMSFTrack {
46
- name: string;
47
- packaging: 'cmaf' | 'chunk-per-object' | 'timeline';
48
- codec?: string;
49
- role: 'video' | 'audio' | 'timeline';
50
- depends?: string[];
51
- mimeType?: string;
52
- width?: number;
53
- height?: number;
54
- timescale?: number;
55
- bitrate?: number;
56
- initData?: string;
57
- }
58
- interface CMSF {
59
- version: number;
60
- tracks: CMSFTrack[];
61
- }
62
- declare class CMSFCatalog {
63
- #private;
64
- private constructor();
65
- static from(payload: ArrayBufferLike): CMSFCatalog;
66
- getByTrackName(trackName: string): CMSFTrack | undefined;
67
- getTracks(role?: CMSF['tracks'][number]['role']): CMSFTrack[];
68
- getVideo(index?: number): CMSFTrack | undefined;
69
- getAudio(index?: number): CMSFTrack | undefined;
70
- getTimeline(index?: number): CMSFTrack | undefined;
71
- getCodecString(trackName: string): string | undefined;
72
- getRole(trackName: string): "timeline" | "video" | "audio" | undefined;
73
- getPackaging(trackName: string): "cmaf" | "chunk-per-object" | "timeline" | undefined;
74
- isCMAF(trackName: string): boolean;
75
- getTimescale(trackName: string): number | undefined;
76
- getInitData(trackName: string): Uint8Array<ArrayBuffer> | undefined;
77
- private extractTrackName;
78
- }
79
-
80
- /**
81
- * Copyright 2025 The MOQtail Authors
82
- *
83
- * Licensed under the Apache License, Version 2.0 (the "License");
84
- * you may not use this file except in compliance with the License.
85
- * You may obtain a copy of the License at
86
- *
87
- * http://www.apache.org/licenses/LICENSE-2.0
88
- *
89
- * Unless required by applicable law or agreed to in writing, software
90
- * distributed under the License is distributed on an "AS IS" BASIS,
91
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
92
- * See the License for the specific language governing permissions and
93
- * limitations under the License.
94
- */
95
- /**
96
- * Base class for all MOQtail errors.
97
- */
98
- declare class MOQtailError extends Error {
99
- constructor(cause?: string);
100
- }
101
- /**
102
- * Not enough bytes in buffer to satisfy a read.
103
- */
104
- declare class NotEnoughBytesError extends MOQtailError {
105
- context: string;
106
- needed: number;
107
- available: number;
108
- constructor(context: string, needed: number, available: number);
109
- }
110
- /**
111
- * Cannot cast between two incompatible types.
112
- */
113
- declare class CastingError extends MOQtailError {
114
- context: string;
115
- fromType: string;
116
- toType: string;
117
- details: string;
118
- constructor(context: string, fromType: string, toType: string, details: string);
119
- }
120
- /**
121
- * Value too large to encode as varint.
122
- */
123
- declare class VarIntOverflowError extends MOQtailError {
124
- context: string;
125
- value: number;
126
- constructor(context: string, value: number);
127
- }
128
- /**
129
- * Length exceeds maximum allowed by protocol.
130
- */
131
- declare class LengthExceedsMaxError extends MOQtailError {
132
- context: string;
133
- max: number;
134
- len: number;
135
- constructor(context: string, max: number, len: number);
136
- }
137
- /**
138
- * Key/value formatting error.
139
- */
140
- declare class KeyValueFormattingError extends MOQtailError {
141
- context: string;
142
- constructor(context: string);
143
- }
144
- /**
145
- * Invalid discriminant or type tag.
146
- */
147
- declare class InvalidTypeError extends MOQtailError {
148
- context: string;
149
- details: string;
150
- constructor(context: string, details: string);
151
- }
152
- /**
153
- * Invalid UTF-8 encountered in a string or bytes field.
154
- */
155
- declare class InvalidUTF8Error extends MOQtailError {
156
- context: string;
157
- details: string;
158
- constructor(context: string, details: string);
159
- }
160
- /**
161
- * Generic protocol violation.
162
- */
163
- declare class ProtocolViolationError extends MOQtailError {
164
- context: string;
165
- details: string;
166
- constructor(context: string, details: string);
167
- }
168
- /**
169
- * Track naming error.
170
- */
171
- declare class TrackNameError extends MOQtailError {
172
- context: string;
173
- details: string;
174
- constructor(context: string, details: string);
175
- }
176
- /**
177
- * Request ID error.
178
- */
179
- declare class RequestIdError extends MOQtailError {
180
- context: string;
181
- details: string;
182
- constructor(context: string, details: string);
183
- }
184
- /**
185
- * Operation timed out.
186
- */
187
- declare class TimeoutError extends MOQtailError {
188
- context: string;
189
- constructor(context: string);
190
- }
191
- /**
192
- * Internal error.
193
- */
194
- declare class InternalError extends MOQtailError {
195
- context: string;
196
- details: string;
197
- constructor(context: string, details: string);
198
- }
199
- /**
200
- * Connection terminated.
201
- */
202
- declare class TerminationError extends MOQtailError {
203
- context: string;
204
- terminationCode: number;
205
- constructor(context: string, terminationCode: number);
206
- }
207
-
208
- /**
209
- * Copyright 2025 The MOQtail Authors
210
- *
211
- * Licensed under the Apache License, Version 2.0 (the "License");
212
- * you may not use this file except in compliance with the License.
213
- * You may obtain a copy of the License at
214
- *
215
- * http://www.apache.org/licenses/LICENSE-2.0
216
- *
217
- * Unless required by applicable law or agreed to in writing, software
218
- * distributed under the License is distributed on an "AS IS" BASIS,
219
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
220
- * See the License for the specific language governing permissions and
221
- * limitations under the License.
222
- */
223
- declare enum TerminationCode {
224
- NO_ERROR = 0,
225
- INTERNAL_ERROR = 1,
226
- UNAUTHORIZED = 2,
227
- PROTOCOL_VIOLATION = 3,
228
- INVALID_REQUEST_ID = 4,
229
- DUPLICATE_TRACK_ALIAS = 5,
230
- KEY_VALUE_FORMATTING_ERROR = 6,
231
- TOO_MANY_REQUESTS = 7,
232
- INVALID_PATH = 8,
233
- MALFORMED_PATH = 9,
234
- GOAWAY_TIMEOUT = 16,
235
- CONTROL_MESSAGE_TIMEOUT = 17,
236
- DATA_STREAM_TIMEOUT = 18,
237
- AUTH_TOKEN_CACHE_OVERFLOW = 19,
238
- DUPLICATE_AUTH_TOKEN_ALIAS = 20,
239
- VERSION_NEGOTIATION_FAILED = 21,
240
- MALFORMED_AUTH_TOKEN = 22,
241
- UNKNOWN_AUTH_TOKEN_ALIAS = 23,
242
- EXPIRED_AUTH_TOKEN = 24,
243
- INVALID_AUTHORITY = 25,
244
- MALFORMED_AUTHORITY = 26
245
- }
246
- declare namespace TerminationCode {
247
- /**
248
- * Tries to convert a number to a TerminationCode enum member.
249
- *
250
- * @param code - The numeric code to convert.
251
- * @returns The corresponding TerminationCode member, or throws InvalidTypeError if the code is not valid.
252
- */
253
- function tryFrom(code: number): TerminationCode;
254
- }
255
-
256
- /**
257
- * Copyright 2025 The MOQtail Authors
258
- *
259
- * Licensed under the Apache License, Version 2.0 (the "License");
260
- * you may not use this file except in compliance with the License.
261
- * You may obtain a copy of the License at
262
- *
263
- * http://www.apache.org/licenses/LICENSE-2.0
264
- *
265
- * Unless required by applicable law or agreed to in writing, software
266
- * distributed under the License is distributed on an "AS IS" BASIS,
267
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
268
- * See the License for the specific language governing permissions and
269
- * limitations under the License.
270
- */
271
-
272
- declare class CaptureTimestamp {
273
- readonly timestamp: bigint;
274
- static readonly TYPE = LOCHeaderExtensionId.CaptureTimestamp;
275
- constructor(timestamp: bigint);
276
- toKeyValuePair(): KeyValuePair;
277
- static fromKeyValuePair(pair: KeyValuePair): CaptureTimestamp | undefined;
278
- }
279
-
280
- /**
281
- * Copyright 2025 The MOQtail Authors
282
- *
283
- * Licensed under the Apache License, Version 2.0 (the "License");
284
- * you may not use this file except in compliance with the License.
285
- * You may obtain a copy of the License at
286
- *
287
- * http://www.apache.org/licenses/LICENSE-2.0
288
- *
289
- * Unless required by applicable law or agreed to in writing, software
290
- * distributed under the License is distributed on an "AS IS" BASIS,
291
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
292
- * See the License for the specific language governing permissions and
293
- * limitations under the License.
294
- */
295
-
296
- declare class VideoFrameMarking {
297
- readonly value: bigint;
298
- static readonly TYPE = LOCHeaderExtensionId.VideoFrameMarking;
299
- constructor(value: bigint);
300
- toKeyValuePair(): KeyValuePair;
301
- static fromKeyValuePair(pair: KeyValuePair): VideoFrameMarking | undefined;
302
- }
303
-
304
- /**
305
- * Copyright 2025 The MOQtail Authors
306
- *
307
- * Licensed under the Apache License, Version 2.0 (the "License");
308
- * you may not use this file except in compliance with the License.
309
- * You may obtain a copy of the License at
310
- *
311
- * http://www.apache.org/licenses/LICENSE-2.0
312
- *
313
- * Unless required by applicable law or agreed to in writing, software
314
- * distributed under the License is distributed on an "AS IS" BASIS,
315
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
316
- * See the License for the specific language governing permissions and
317
- * limitations under the License.
318
- */
319
-
320
- declare class AudioLevel {
321
- readonly audioLevel: bigint;
322
- static readonly TYPE = LOCHeaderExtensionId.AudioLevel;
323
- constructor(audioLevel: bigint);
324
- toKeyValuePair(): KeyValuePair;
325
- static fromKeyValuePair(pair: KeyValuePair): AudioLevel | undefined;
326
- }
327
-
328
- /**
329
- * Copyright 2025 The MOQtail Authors
330
- *
331
- * Licensed under the Apache License, Version 2.0 (the "License");
332
- * you may not use this file except in compliance with the License.
333
- * You may obtain a copy of the License at
334
- *
335
- * http://www.apache.org/licenses/LICENSE-2.0
336
- *
337
- * Unless required by applicable law or agreed to in writing, software
338
- * distributed under the License is distributed on an "AS IS" BASIS,
339
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
340
- * See the License for the specific language governing permissions and
341
- * limitations under the License.
342
- */
343
-
344
- declare class VideoConfig {
345
- readonly config: Uint8Array;
346
- static readonly TYPE = LOCHeaderExtensionId.VideoConfig;
347
- constructor(config: Uint8Array);
348
- toKeyValuePair(): KeyValuePair;
349
- static fromKeyValuePair(pair: KeyValuePair): VideoConfig | undefined;
350
- }
351
-
352
- /**
353
- * Copyright 2025 The MOQtail Authors
354
- *
355
- * Licensed under the Apache License, Version 2.0 (the "License");
356
- * you may not use this file except in compliance with the License.
357
- * You may obtain a copy of the License at
358
- *
359
- * http://www.apache.org/licenses/LICENSE-2.0
360
- *
361
- * Unless required by applicable law or agreed to in writing, software
362
- * distributed under the License is distributed on an "AS IS" BASIS,
363
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
364
- * See the License for the specific language governing permissions and
365
- * limitations under the License.
366
- */
367
-
368
- type ExtensionHeader = CaptureTimestamp | VideoFrameMarking | AudioLevel | VideoConfig;
369
- declare namespace ExtensionHeader {
370
- function fromKeyValuePair(pair: KeyValuePair): ExtensionHeader | undefined;
371
- function toKeyValuePair(header: ExtensionHeader): KeyValuePair;
372
- function isCaptureTimestamp(header: ExtensionHeader): header is CaptureTimestamp;
373
- function isVideoFrameMarking(header: ExtensionHeader): header is VideoFrameMarking;
374
- function isAudioLevel(header: ExtensionHeader): header is AudioLevel;
375
- function isVideoConfig(header: ExtensionHeader): header is VideoConfig;
376
- }
377
- declare class ExtensionHeaders {
378
- private kvps;
379
- addCaptureTimestamp(timestamp: bigint | number): this;
380
- addVideoFrameMarking(marking: bigint | number): this;
381
- addAudioLevel(audioLevel: bigint | number): this;
382
- addVideoConfig(config: Uint8Array): this;
383
- addRaw(pair: KeyValuePair): this;
384
- build(): KeyValuePair[];
385
- static fromKeyValuePairs(kvps: KeyValuePair[]): ExtensionHeader[];
386
- }
387
-
388
- /**
389
- * Copyright 2026 The MOQtail Authors
390
- *
391
- * Licensed under the Apache License, Version 2.0 (the "License");
392
- * you may not use this file except in compliance with the License.
393
- * You may obtain a copy of the License at
394
- *
395
- * http://www.apache.org/licenses/LICENSE-2.0
396
- *
397
- * Unless required by applicable law or agreed to in writing, software
398
- * distributed under the License is distributed on an "AS IS" BASIS,
399
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
400
- * See the License for the specific language governing permissions and
401
- * limitations under the License.
402
- */
403
-
404
- declare class ImmutableExtensionsObjectExtension {
405
- readonly extensions: KeyValuePair[];
406
- static readonly TYPE = TrackExtensionType.ImmutableExtensions;
407
- constructor(extensions: KeyValuePair[]);
408
- toKeyValuePair(): KeyValuePair;
409
- static fromKeyValuePair(pair: KeyValuePair): ImmutableExtensionsObjectExtension | undefined;
410
- }
411
- declare class PriorGroupIdGapExtension {
412
- readonly gap: bigint;
413
- static readonly TYPE = TrackExtensionType.PriorGroupIdGap;
414
- constructor(gap: bigint);
415
- toKeyValuePair(): KeyValuePair;
416
- static fromKeyValuePair(pair: KeyValuePair): PriorGroupIdGapExtension | undefined;
417
- }
418
- declare class PriorObjectIdGapExtension {
419
- readonly gap: bigint;
420
- static readonly TYPE = TrackExtensionType.PriorObjectIdGap;
421
- constructor(gap: bigint);
422
- toKeyValuePair(): KeyValuePair;
423
- static fromKeyValuePair(pair: KeyValuePair): PriorObjectIdGapExtension | undefined;
424
- }
425
- declare class UnknownObjectExtension {
426
- readonly kvp: KeyValuePair;
427
- constructor(kvp: KeyValuePair);
428
- toKeyValuePair(): KeyValuePair;
429
- }
430
- type ObjectExtension = ImmutableExtensionsObjectExtension | PriorGroupIdGapExtension | PriorObjectIdGapExtension | UnknownObjectExtension;
431
- declare namespace ObjectExtension {
432
- function fromKeyValuePair(pair: KeyValuePair): ObjectExtension;
433
- function toKeyValuePair(ext: ObjectExtension): KeyValuePair;
434
- function deserializeAll(buf: BaseByteBuffer): ObjectExtension[];
435
- function serializeInto(exts: ObjectExtension[], payload: ByteBuffer): void;
436
- function isImmutableExtensions(ext: ObjectExtension): ext is ImmutableExtensionsObjectExtension;
437
- function isPriorGroupIdGap(ext: ObjectExtension): ext is PriorGroupIdGapExtension;
438
- function isPriorObjectIdGap(ext: ObjectExtension): ext is PriorObjectIdGapExtension;
439
- function isUnknown(ext: ObjectExtension): ext is UnknownObjectExtension;
440
- }
441
-
442
- export { AudioLevel, BaseByteBuffer, ByteBuffer, type CMSF, CMSFCatalog, type CMSFTrack, CaptureTimestamp, CastingError, ExtensionHeader, ExtensionHeaders, FrozenByteBuffer, FullTrackName, ImmutableExtensionsObjectExtension, InternalError, InvalidTypeError, InvalidUTF8Error, KeyValueFormattingError, KeyValuePair, LOCHeaderExtensionId, LengthExceedsMaxError, MOQtailError, NotEnoughBytesError, ObjectExtension, PriorGroupIdGapExtension, PriorObjectIdGapExtension, ProtocolViolationError, RequestIdError, Switch, TerminationCode, TerminationError, TimeoutError, TrackExtensionType, TrackNameError, UnknownObjectExtension, VarIntOverflowError, VideoConfig, VideoFrameMarking };