moqtail 0.10.1 → 0.12.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/client.d.cts CHANGED
@@ -1,4 +1,4 @@
1
- import { c as ControlMessage, U as MoqtObject, y as Location, u as FullTrackName, _ as ObjectForwardingPreference, au as TrackExtension, ao as Subscribe, a4 as PublishDoneStatusCode, ae as RequestUpdate, F as Fetch, a2 as Publish, ad as RequestOk, aa as RequestError, a5 as PublishNamespace, p as FetchOk, aq as SubscribeOk, R as MessageParameter, ap as SubscribeNamespace, a8 as PublishOk, v as GroupOrder, q as FetchType, ak as SetupParameters, D as Datagram, r as FilterType, ay as Tuple, ac as RequestIdMap, a7 as PublishNamespaceDone, G as GoAway, an as SubgroupObject, al as SubgroupHeader, n as FetchObject, l as FetchHeader, a3 as PublishDone, ah as ServerSetup, a6 as PublishNamespaceCancel, X as NamespaceSubscribeOptions, aC as UnsubscribeNamespace, aw as TrackStatus, H as Header } from './setup_parameter-BOeGq6Mv.cjs';
1
+ import { c as ControlMessage, U as MoqtObject, y as Location, u as FullTrackName, au as TrackExtension, ao as Subscribe, a4 as PublishDoneStatusCode, ae as RequestUpdate, F as Fetch, a2 as Publish, ad as RequestOk, aa as RequestError, a5 as PublishNamespace, p as FetchOk, aq as SubscribeOk, R as MessageParameter, ap as SubscribeNamespace, a8 as PublishOk, v as GroupOrder, q as FetchType, ak as SetupParameters, D as Datagram, r as FilterType, ay as Tuple, ac as RequestIdMap, a7 as PublishNamespaceDone, G as GoAway, an as SubgroupObject, al as SubgroupHeader, n as FetchObject, l as FetchHeader, a3 as PublishDone, ah as ServerSetup, a6 as PublishNamespaceCancel, X as NamespaceSubscribeOptions, aC as UnsubscribeNamespace, aw as TrackStatus, H as Header } from './setup_parameter-BgNrJRDS.cjs';
2
2
  import { L as LogLevel } from './logger-C6QS408Z.cjs';
3
3
 
4
4
  /**
@@ -206,7 +206,6 @@ declare class HybridTrackSource implements TrackSource {
206
206
  * const liveStream: ReadableStream<MoqtObject> = buildCameraStream()
207
207
  * const track: Track = {
208
208
  * fullTrackName,
209
- * forwardingPreference: ObjectForwardingPreference.Latest,
210
209
  * trackSource: { live: liveStream },
211
210
  * publisherPriority: 0
212
211
  * }
@@ -219,7 +218,6 @@ declare class HybridTrackSource implements TrackSource {
219
218
  * recording.forEach(obj => cache.add(obj))
220
219
  * const track: Track = {
221
220
  * fullTrackName,
222
- * forwardingPreference: ObjectForwardingPreference.All,
223
221
  * trackSource: { past: cache },
224
222
  * publisherPriority: 64
225
223
  * }
@@ -232,7 +230,6 @@ declare class HybridTrackSource implements TrackSource {
232
230
  * const liveStream = buildLiveReadableStream()
233
231
  * const track: Track = {
234
232
  * fullTrackName,
235
- * forwardingPreference: ObjectForwardingPreference.Latest,
236
233
  * trackSource: { past: cache, live: liveStream },
237
234
  * publisherPriority: 8
238
235
  * }
@@ -244,10 +241,6 @@ type Track = {
244
241
  * Globally unique identifier for the track.
245
242
  */
246
243
  fullTrackName: FullTrackName;
247
- /**
248
- * Hint controlling which objects SHOULD be forwarded / prioritized.
249
- */
250
- forwardingPreference: ObjectForwardingPreference;
251
244
  /**
252
245
  * Accessors for live and/or past objects belonging to this track.
253
246
  */
@@ -494,6 +487,7 @@ declare class SubscribeRequest implements PromiseLike<SubscribeOk | RequestError
494
487
  priority: number;
495
488
  forward: boolean;
496
489
  subscribeParameters: MessageParameter[];
490
+ earlyDiscardPolicy: EarlyDiscardPolicyConfig | undefined;
497
491
  largestLocation: Location | undefined;
498
492
  streamsAccepted: bigint;
499
493
  expectedStreams: bigint | undefined;
@@ -716,6 +710,8 @@ type SubscribeOptions = {
716
710
  startLocation?: Location;
717
711
  /** Required for {@link FilterType.AbsoluteRange}; exclusive upper group boundary (coerced to bigint if number provided). */
718
712
  endGroup?: bigint | number;
713
+ /** Per-subscription early discard policy. Overrides the client-level default set via {@link MOQtailClient.setEarlyDiscardPolicy}. */
714
+ earlyDiscardPolicy?: EarlyDiscardPolicyConfig;
719
715
  };
720
716
  /**
721
717
  * Narrowing update constraints applied to an existing SUBSCRIBE via {@link MOQtailClient.subscribeUpdate}.
@@ -1285,14 +1281,17 @@ declare class MOQtailClient {
1285
1281
  */
1286
1282
  sendDatagram(trackAlias: bigint, object: MoqtObject): Promise<void>;
1287
1283
  /**
1288
- * Sets (or replaces) the early discard policy for incoming subgroup streams.
1284
+ * Sets (or replaces) the client-level default early discard policy for incoming subgroup streams.
1289
1285
  *
1290
1286
  * When set, each incoming subgroup QUIC stream is given a deadline of `subgroupReceiveTimeout` ms to
1291
1287
  * complete. If the stream has not finished within that window it is cancelled — objects already
1292
1288
  * delivered to the subscription are kept, but no further objects arrive from that stream.
1293
1289
  *
1290
+ * This is a client-wide default. Individual subscriptions can override it via the `earlyDiscardPolicy`
1291
+ * field in {@link SubscribeOptions}, which takes precedence over this setting.
1292
+ *
1294
1293
  * The policy takes effect on the next stream accepted after this call. Passing a new config
1295
- * replaces the previous one. Pass `undefined` to remove the policy.
1294
+ * replaces the previous one. Pass `undefined` to remove the default.
1296
1295
  *
1297
1296
  * @example
1298
1297
  * ```ts
@@ -1356,7 +1355,6 @@ declare class MOQtailClient {
1356
1355
  * // Register the track for live subscription
1357
1356
  * client.addOrUpdateTrack({
1358
1357
  * fullTrackName: { namespace: ["camera"], name: "main" },
1359
- * forwardingPreference: ObjectForwardingPreference.Latest,
1360
1358
  * trackSource: { live: liveReadableStream },
1361
1359
  * publisherPriority: 0 // highest priority
1362
1360
  * });
@@ -1366,7 +1364,6 @@ declare class MOQtailClient {
1366
1364
  * const cache = new MemoryObjectCache(); // Caches are not yet fully supported
1367
1365
  * client.addOrUpdateTrack({
1368
1366
  * fullTrackName: { namespace: ["camera"], name: "main" },
1369
- * forwardingPreference: ObjectForwardingPreference.Latest,
1370
1367
  * trackSource: { live: liveReadableStream, past: cache },
1371
1368
  * publisherPriority: 8
1372
1369
  * });
package/dist/client.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { c as ControlMessage, U as MoqtObject, y as Location, u as FullTrackName, _ as ObjectForwardingPreference, au as TrackExtension, ao as Subscribe, a4 as PublishDoneStatusCode, ae as RequestUpdate, F as Fetch, a2 as Publish, ad as RequestOk, aa as RequestError, a5 as PublishNamespace, p as FetchOk, aq as SubscribeOk, R as MessageParameter, ap as SubscribeNamespace, a8 as PublishOk, v as GroupOrder, q as FetchType, ak as SetupParameters, D as Datagram, r as FilterType, ay as Tuple, ac as RequestIdMap, a7 as PublishNamespaceDone, G as GoAway, an as SubgroupObject, al as SubgroupHeader, n as FetchObject, l as FetchHeader, a3 as PublishDone, ah as ServerSetup, a6 as PublishNamespaceCancel, X as NamespaceSubscribeOptions, aC as UnsubscribeNamespace, aw as TrackStatus, H as Header } from './setup_parameter-BOeGq6Mv.js';
1
+ import { c as ControlMessage, U as MoqtObject, y as Location, u as FullTrackName, au as TrackExtension, ao as Subscribe, a4 as PublishDoneStatusCode, ae as RequestUpdate, F as Fetch, a2 as Publish, ad as RequestOk, aa as RequestError, a5 as PublishNamespace, p as FetchOk, aq as SubscribeOk, R as MessageParameter, ap as SubscribeNamespace, a8 as PublishOk, v as GroupOrder, q as FetchType, ak as SetupParameters, D as Datagram, r as FilterType, ay as Tuple, ac as RequestIdMap, a7 as PublishNamespaceDone, G as GoAway, an as SubgroupObject, al as SubgroupHeader, n as FetchObject, l as FetchHeader, a3 as PublishDone, ah as ServerSetup, a6 as PublishNamespaceCancel, X as NamespaceSubscribeOptions, aC as UnsubscribeNamespace, aw as TrackStatus, H as Header } from './setup_parameter-BgNrJRDS.js';
2
2
  import { L as LogLevel } from './logger-C6QS408Z.js';
3
3
 
4
4
  /**
@@ -206,7 +206,6 @@ declare class HybridTrackSource implements TrackSource {
206
206
  * const liveStream: ReadableStream<MoqtObject> = buildCameraStream()
207
207
  * const track: Track = {
208
208
  * fullTrackName,
209
- * forwardingPreference: ObjectForwardingPreference.Latest,
210
209
  * trackSource: { live: liveStream },
211
210
  * publisherPriority: 0
212
211
  * }
@@ -219,7 +218,6 @@ declare class HybridTrackSource implements TrackSource {
219
218
  * recording.forEach(obj => cache.add(obj))
220
219
  * const track: Track = {
221
220
  * fullTrackName,
222
- * forwardingPreference: ObjectForwardingPreference.All,
223
221
  * trackSource: { past: cache },
224
222
  * publisherPriority: 64
225
223
  * }
@@ -232,7 +230,6 @@ declare class HybridTrackSource implements TrackSource {
232
230
  * const liveStream = buildLiveReadableStream()
233
231
  * const track: Track = {
234
232
  * fullTrackName,
235
- * forwardingPreference: ObjectForwardingPreference.Latest,
236
233
  * trackSource: { past: cache, live: liveStream },
237
234
  * publisherPriority: 8
238
235
  * }
@@ -244,10 +241,6 @@ type Track = {
244
241
  * Globally unique identifier for the track.
245
242
  */
246
243
  fullTrackName: FullTrackName;
247
- /**
248
- * Hint controlling which objects SHOULD be forwarded / prioritized.
249
- */
250
- forwardingPreference: ObjectForwardingPreference;
251
244
  /**
252
245
  * Accessors for live and/or past objects belonging to this track.
253
246
  */
@@ -494,6 +487,7 @@ declare class SubscribeRequest implements PromiseLike<SubscribeOk | RequestError
494
487
  priority: number;
495
488
  forward: boolean;
496
489
  subscribeParameters: MessageParameter[];
490
+ earlyDiscardPolicy: EarlyDiscardPolicyConfig | undefined;
497
491
  largestLocation: Location | undefined;
498
492
  streamsAccepted: bigint;
499
493
  expectedStreams: bigint | undefined;
@@ -716,6 +710,8 @@ type SubscribeOptions = {
716
710
  startLocation?: Location;
717
711
  /** Required for {@link FilterType.AbsoluteRange}; exclusive upper group boundary (coerced to bigint if number provided). */
718
712
  endGroup?: bigint | number;
713
+ /** Per-subscription early discard policy. Overrides the client-level default set via {@link MOQtailClient.setEarlyDiscardPolicy}. */
714
+ earlyDiscardPolicy?: EarlyDiscardPolicyConfig;
719
715
  };
720
716
  /**
721
717
  * Narrowing update constraints applied to an existing SUBSCRIBE via {@link MOQtailClient.subscribeUpdate}.
@@ -1285,14 +1281,17 @@ declare class MOQtailClient {
1285
1281
  */
1286
1282
  sendDatagram(trackAlias: bigint, object: MoqtObject): Promise<void>;
1287
1283
  /**
1288
- * Sets (or replaces) the early discard policy for incoming subgroup streams.
1284
+ * Sets (or replaces) the client-level default early discard policy for incoming subgroup streams.
1289
1285
  *
1290
1286
  * When set, each incoming subgroup QUIC stream is given a deadline of `subgroupReceiveTimeout` ms to
1291
1287
  * complete. If the stream has not finished within that window it is cancelled — objects already
1292
1288
  * delivered to the subscription are kept, but no further objects arrive from that stream.
1293
1289
  *
1290
+ * This is a client-wide default. Individual subscriptions can override it via the `earlyDiscardPolicy`
1291
+ * field in {@link SubscribeOptions}, which takes precedence over this setting.
1292
+ *
1294
1293
  * The policy takes effect on the next stream accepted after this call. Passing a new config
1295
- * replaces the previous one. Pass `undefined` to remove the policy.
1294
+ * replaces the previous one. Pass `undefined` to remove the default.
1296
1295
  *
1297
1296
  * @example
1298
1297
  * ```ts
@@ -1356,7 +1355,6 @@ declare class MOQtailClient {
1356
1355
  * // Register the track for live subscription
1357
1356
  * client.addOrUpdateTrack({
1358
1357
  * fullTrackName: { namespace: ["camera"], name: "main" },
1359
- * forwardingPreference: ObjectForwardingPreference.Latest,
1360
1358
  * trackSource: { live: liveReadableStream },
1361
1359
  * publisherPriority: 0 // highest priority
1362
1360
  * });
@@ -1366,7 +1364,6 @@ declare class MOQtailClient {
1366
1364
  * const cache = new MemoryObjectCache(); // Caches are not yet fully supported
1367
1365
  * client.addOrUpdateTrack({
1368
1366
  * fullTrackName: { namespace: ["camera"], name: "main" },
1369
- * forwardingPreference: ObjectForwardingPreference.Latest,
1370
1367
  * trackSource: { live: liveReadableStream, past: cache },
1371
1368
  * publisherPriority: 8
1372
1369
  * });