moqtail 0.7.0 → 0.8.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.
@@ -477,27 +477,37 @@ var ReasonPhrase = class _ReasonPhrase {
477
477
 
478
478
  // src/model/data/constant.ts
479
479
  var ObjectDatagramStatusType = /* @__PURE__ */ ((ObjectDatagramStatusType2) => {
480
- ObjectDatagramStatusType2[ObjectDatagramStatusType2["WithoutExtensions"] = 2] = "WithoutExtensions";
481
- ObjectDatagramStatusType2[ObjectDatagramStatusType2["WithExtensions"] = 3] = "WithExtensions";
480
+ ObjectDatagramStatusType2[ObjectDatagramStatusType2["WithoutExtensions"] = 32] = "WithoutExtensions";
481
+ ObjectDatagramStatusType2[ObjectDatagramStatusType2["WithExtensions"] = 33] = "WithExtensions";
482
482
  return ObjectDatagramStatusType2;
483
483
  })(ObjectDatagramStatusType || {});
484
484
  ((ObjectDatagramStatusType2) => {
485
485
  function tryFrom(value) {
486
486
  const v = typeof value === "bigint" ? Number(value) : value;
487
487
  switch (v) {
488
- case 2:
489
- return 2 /* WithoutExtensions */;
490
- case 3:
491
- return 3 /* WithExtensions */;
488
+ case 32:
489
+ return 32 /* WithoutExtensions */;
490
+ case 33:
491
+ return 33 /* WithExtensions */;
492
492
  default:
493
493
  throw new Error(`Invalid ObjectDatagramStatusType: ${value}`);
494
494
  }
495
495
  }
496
496
  ObjectDatagramStatusType2.tryFrom = tryFrom;
497
+ function hasExtensions(t) {
498
+ return t === 33 /* WithExtensions */;
499
+ }
500
+ ObjectDatagramStatusType2.hasExtensions = hasExtensions;
497
501
  })(ObjectDatagramStatusType || (ObjectDatagramStatusType = {}));
498
502
  var ObjectDatagramType = /* @__PURE__ */ ((ObjectDatagramType2) => {
499
- ObjectDatagramType2[ObjectDatagramType2["WithoutExtensions"] = 0] = "WithoutExtensions";
500
- ObjectDatagramType2[ObjectDatagramType2["WithExtensions"] = 1] = "WithExtensions";
503
+ ObjectDatagramType2[ObjectDatagramType2["Type0x00"] = 0] = "Type0x00";
504
+ ObjectDatagramType2[ObjectDatagramType2["Type0x01"] = 1] = "Type0x01";
505
+ ObjectDatagramType2[ObjectDatagramType2["Type0x02"] = 2] = "Type0x02";
506
+ ObjectDatagramType2[ObjectDatagramType2["Type0x03"] = 3] = "Type0x03";
507
+ ObjectDatagramType2[ObjectDatagramType2["Type0x04"] = 4] = "Type0x04";
508
+ ObjectDatagramType2[ObjectDatagramType2["Type0x05"] = 5] = "Type0x05";
509
+ ObjectDatagramType2[ObjectDatagramType2["Type0x06"] = 6] = "Type0x06";
510
+ ObjectDatagramType2[ObjectDatagramType2["Type0x07"] = 7] = "Type0x07";
501
511
  return ObjectDatagramType2;
502
512
  })(ObjectDatagramType || {});
503
513
  ((ObjectDatagramType2) => {
@@ -505,14 +515,46 @@ var ObjectDatagramType = /* @__PURE__ */ ((ObjectDatagramType2) => {
505
515
  const v = typeof value === "bigint" ? Number(value) : value;
506
516
  switch (v) {
507
517
  case 0:
508
- return 0 /* WithoutExtensions */;
518
+ return 0 /* Type0x00 */;
509
519
  case 1:
510
- return 1 /* WithExtensions */;
520
+ return 1 /* Type0x01 */;
521
+ case 2:
522
+ return 2 /* Type0x02 */;
523
+ case 3:
524
+ return 3 /* Type0x03 */;
525
+ case 4:
526
+ return 4 /* Type0x04 */;
527
+ case 5:
528
+ return 5 /* Type0x05 */;
529
+ case 6:
530
+ return 6 /* Type0x06 */;
531
+ case 7:
532
+ return 7 /* Type0x07 */;
511
533
  default:
512
534
  throw new Error(`Invalid ObjectDatagramType: ${value}`);
513
535
  }
514
536
  }
515
537
  ObjectDatagramType2.tryFrom = tryFrom;
538
+ function hasExtensions(t) {
539
+ return (t & 1) !== 0;
540
+ }
541
+ ObjectDatagramType2.hasExtensions = hasExtensions;
542
+ function isEndOfGroup(t) {
543
+ return (t & 2) !== 0;
544
+ }
545
+ ObjectDatagramType2.isEndOfGroup = isEndOfGroup;
546
+ function hasObjectId(t) {
547
+ return (t & 4) === 0;
548
+ }
549
+ ObjectDatagramType2.hasObjectId = hasObjectId;
550
+ function fromProperties(hasExtensions2, endOfGroup, objectIdIsZero) {
551
+ let type = 0;
552
+ if (hasExtensions2) type |= 1;
553
+ if (endOfGroup) type |= 2;
554
+ if (objectIdIsZero) type |= 4;
555
+ return type;
556
+ }
557
+ ObjectDatagramType2.fromProperties = fromProperties;
516
558
  })(ObjectDatagramType || (ObjectDatagramType = {}));
517
559
  var FetchHeaderType = /* @__PURE__ */ ((FetchHeaderType2) => {
518
560
  FetchHeaderType2[FetchHeaderType2["Type0x05"] = 5] = "Type0x05";
@@ -1750,40 +1792,4 @@ var ClockNormalizer = class _ClockNormalizer {
1750
1792
  }
1751
1793
  };
1752
1794
 
1753
- // src/util/get_akamai_offset.ts
1754
- var AkamaiOffset = class _AkamaiOffset {
1755
- static _offset = null;
1756
- static _promise = null;
1757
- static async getClockSkew() {
1758
- if (_AkamaiOffset._offset !== null) {
1759
- return _AkamaiOffset._offset;
1760
- }
1761
- if (_AkamaiOffset._promise) {
1762
- return _AkamaiOffset._promise;
1763
- }
1764
- _AkamaiOffset._promise = _AkamaiOffset.ClockSkew().then((offset2) => {
1765
- _AkamaiOffset._offset = offset2;
1766
- return offset2;
1767
- });
1768
- const offset = await _AkamaiOffset._promise;
1769
- return Math.round(offset);
1770
- }
1771
- static async ClockSkew() {
1772
- const akamaiUrl = "https://time.akamai.com?ms";
1773
- performance.clearResourceTimings();
1774
- const response = await fetch(akamaiUrl);
1775
- const text = await response.text();
1776
- const TR = parseFloat(text.trim()) * 1e3;
1777
- const entry = performance.getEntriesByType("resource").find((e) => e.name.includes("time.akamai.com"));
1778
- if (!entry) {
1779
- console.warn("No resource entry found for Akamai time request");
1780
- return 0;
1781
- }
1782
- const T0 = entry.fetchStart + performance.timeOrigin;
1783
- const T1 = entry.responseStart + performance.timeOrigin;
1784
- const offset = (T0 + T1) / 2 - TR;
1785
- return offset;
1786
- }
1787
- };
1788
-
1789
- export { AkamaiOffset, ClockNormalizer, NetworkTelemetry, PlayoutBuffer, PullPlayoutBuffer };
1795
+ export { ClockNormalizer, NetworkTelemetry, PlayoutBuffer, PullPlayoutBuffer };
@@ -1,4 +1,4 @@
1
- import { e as FetchHeaderType, F as FrozenByteBuffer, B as BaseByteBuffer, S as SubgroupHeaderType, m as FullTrackName, c as Tuple, K as KeyValuePair, R as ReasonPhrase, L as Location } from './byte_buffer-BOK6VPTF.js';
1
+ import { e as FetchHeaderType, F as FrozenByteBuffer, B as BaseByteBuffer, S as SubgroupHeaderType, m as FullTrackName, c as Tuple, K as KeyValuePair, L as Location, R as ReasonPhrase } from './byte_buffer-BM4uNj4n.cjs';
2
2
 
3
3
  /**
4
4
  * Copyright 2025 The MOQtail Authors
@@ -504,14 +504,23 @@ declare class PublishNamespace {
504
504
  * limitations under the License.
505
505
  */
506
506
 
507
- declare class PublishNamespaceCancel {
508
- readonly trackNamespace: Tuple;
509
- readonly errorCode: PublishNamespaceErrorCode;
510
- readonly reasonPhrase: ReasonPhrase;
511
- constructor(trackNamespace: Tuple, errorCode: PublishNamespaceErrorCode, reasonPhrase: ReasonPhrase);
512
- getType(): ControlMessageType;
507
+ declare class Subscribe {
508
+ requestId: bigint;
509
+ fullTrackName: FullTrackName;
510
+ subscriberPriority: number;
511
+ groupOrder: GroupOrder;
512
+ forward: boolean;
513
+ filterType: FilterType;
514
+ startLocation: Location | undefined;
515
+ endGroup: bigint | undefined;
516
+ parameters: KeyValuePair[];
517
+ private constructor();
518
+ static newNextGroupStart(requestId: bigint, fullTrackName: FullTrackName, subscriberPriority: number, groupOrder: GroupOrder, forward: boolean, parameters: KeyValuePair[]): Subscribe;
519
+ static newLatestObject(requestId: bigint, fullTrackName: FullTrackName, subscriberPriority: number, groupOrder: GroupOrder, forward: boolean, parameters: KeyValuePair[]): Subscribe;
520
+ static newAbsoluteStart(requestId: bigint, fullTrackName: FullTrackName, subscriberPriority: number, groupOrder: GroupOrder, forward: boolean, startLocation: Location, parameters: KeyValuePair[]): Subscribe;
521
+ static newAbsoluteRange(requestId: bigint, fullTrackName: FullTrackName, subscriberPriority: number, groupOrder: GroupOrder, forward: boolean, startLocation: Location, endGroup: bigint, parameters: KeyValuePair[]): Subscribe;
513
522
  serialize(): FrozenByteBuffer;
514
- static parsePayload(buf: BaseByteBuffer): PublishNamespaceCancel;
523
+ static parsePayload(buf: BaseByteBuffer): Subscribe;
515
524
  }
516
525
 
517
526
  /**
@@ -564,6 +573,32 @@ declare class PublishNamespaceOk {
564
573
  static parsePayload(buf: BaseByteBuffer): PublishNamespaceOk;
565
574
  }
566
575
 
576
+ /**
577
+ * Copyright 2025 The MOQtail Authors
578
+ *
579
+ * Licensed under the Apache License, Version 2.0 (the "License");
580
+ * you may not use this file except in compliance with the License.
581
+ * You may obtain a copy of the License at
582
+ *
583
+ * http://www.apache.org/licenses/LICENSE-2.0
584
+ *
585
+ * Unless required by applicable law or agreed to in writing, software
586
+ * distributed under the License is distributed on an "AS IS" BASIS,
587
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
588
+ * See the License for the specific language governing permissions and
589
+ * limitations under the License.
590
+ */
591
+
592
+ declare class PublishNamespaceCancel {
593
+ readonly trackNamespace: Tuple;
594
+ readonly errorCode: PublishNamespaceErrorCode;
595
+ readonly reasonPhrase: ReasonPhrase;
596
+ constructor(trackNamespace: Tuple, errorCode: PublishNamespaceErrorCode, reasonPhrase: ReasonPhrase);
597
+ getType(): ControlMessageType;
598
+ serialize(): FrozenByteBuffer;
599
+ static parsePayload(buf: BaseByteBuffer): PublishNamespaceCancel;
600
+ }
601
+
567
602
  /**
568
603
  * Copyright 2025 The MOQtail Authors
569
604
  *
@@ -807,41 +842,6 @@ declare class ServerSetup {
807
842
  static parsePayload(buf: BaseByteBuffer): ServerSetup;
808
843
  }
809
844
 
810
- /**
811
- * Copyright 2025 The MOQtail Authors
812
- *
813
- * Licensed under the Apache License, Version 2.0 (the "License");
814
- * you may not use this file except in compliance with the License.
815
- * You may obtain a copy of the License at
816
- *
817
- * http://www.apache.org/licenses/LICENSE-2.0
818
- *
819
- * Unless required by applicable law or agreed to in writing, software
820
- * distributed under the License is distributed on an "AS IS" BASIS,
821
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
822
- * See the License for the specific language governing permissions and
823
- * limitations under the License.
824
- */
825
-
826
- declare class Subscribe {
827
- requestId: bigint;
828
- fullTrackName: FullTrackName;
829
- subscriberPriority: number;
830
- groupOrder: GroupOrder;
831
- forward: boolean;
832
- filterType: FilterType;
833
- startLocation: Location | undefined;
834
- endGroup: bigint | undefined;
835
- parameters: KeyValuePair[];
836
- private constructor();
837
- static newNextGroupStart(requestId: bigint, fullTrackName: FullTrackName, subscriberPriority: number, groupOrder: GroupOrder, forward: boolean, parameters: KeyValuePair[]): Subscribe;
838
- static newLatestObject(requestId: bigint, fullTrackName: FullTrackName, subscriberPriority: number, groupOrder: GroupOrder, forward: boolean, parameters: KeyValuePair[]): Subscribe;
839
- static newAbsoluteStart(requestId: bigint, fullTrackName: FullTrackName, subscriberPriority: number, groupOrder: GroupOrder, forward: boolean, startLocation: Location, parameters: KeyValuePair[]): Subscribe;
840
- static newAbsoluteRange(requestId: bigint, fullTrackName: FullTrackName, subscriberPriority: number, groupOrder: GroupOrder, forward: boolean, startLocation: Location, endGroup: bigint, parameters: KeyValuePair[]): Subscribe;
841
- serialize(): FrozenByteBuffer;
842
- static parsePayload(buf: BaseByteBuffer): Subscribe;
843
- }
844
-
845
845
  /**
846
846
  * Copyright 2025 The MOQtail Authors
847
847
  *
@@ -888,16 +888,15 @@ declare class PublishDone {
888
888
 
889
889
  declare class Publish {
890
890
  readonly requestId: bigint;
891
- readonly trackNamespace: Tuple;
892
- readonly trackName: string;
891
+ readonly fullTrackName: FullTrackName;
893
892
  readonly trackAlias: bigint;
894
893
  readonly groupOrder: number;
895
894
  readonly contentExists: number;
896
895
  readonly largestLocation: Location | undefined;
897
896
  readonly forward: number;
898
897
  readonly parameters: KeyValuePair[];
899
- constructor(requestId: bigint, trackNamespace: Tuple, trackName: string, trackAlias: bigint, groupOrder: number, contentExists: number, largestLocation: Location | undefined, forward: number, parameters: KeyValuePair[]);
900
- static new(requestId: bigint | number, trackNamespace: Tuple, trackName: string, trackAlias: bigint | number, groupOrder: number, contentExists: number, largestLocation: Location | undefined, forward: number, parameters: KeyValuePair[]): Publish;
898
+ constructor(requestId: bigint, fullTrackName: FullTrackName, trackAlias: bigint, groupOrder: number, contentExists: number, largestLocation: Location | undefined, forward: number, parameters: KeyValuePair[]);
899
+ static new(requestId: bigint | number, fullTrackName: FullTrackName, trackAlias: bigint | number, groupOrder: number, contentExists: number, largestLocation: Location | undefined, forward: number, parameters: KeyValuePair[]): Publish;
901
900
  getType(): ControlMessageType;
902
901
  serialize(): FrozenByteBuffer;
903
902
  static parsePayload(buf: BaseByteBuffer): Publish;
@@ -1,4 +1,4 @@
1
- import { e as FetchHeaderType, F as FrozenByteBuffer, B as BaseByteBuffer, S as SubgroupHeaderType, m as FullTrackName, c as Tuple, K as KeyValuePair, R as ReasonPhrase, L as Location } from './byte_buffer-BOK6VPTF.cjs';
1
+ import { e as FetchHeaderType, F as FrozenByteBuffer, B as BaseByteBuffer, S as SubgroupHeaderType, m as FullTrackName, c as Tuple, K as KeyValuePair, L as Location, R as ReasonPhrase } from './byte_buffer-BM4uNj4n.js';
2
2
 
3
3
  /**
4
4
  * Copyright 2025 The MOQtail Authors
@@ -504,14 +504,23 @@ declare class PublishNamespace {
504
504
  * limitations under the License.
505
505
  */
506
506
 
507
- declare class PublishNamespaceCancel {
508
- readonly trackNamespace: Tuple;
509
- readonly errorCode: PublishNamespaceErrorCode;
510
- readonly reasonPhrase: ReasonPhrase;
511
- constructor(trackNamespace: Tuple, errorCode: PublishNamespaceErrorCode, reasonPhrase: ReasonPhrase);
512
- getType(): ControlMessageType;
507
+ declare class Subscribe {
508
+ requestId: bigint;
509
+ fullTrackName: FullTrackName;
510
+ subscriberPriority: number;
511
+ groupOrder: GroupOrder;
512
+ forward: boolean;
513
+ filterType: FilterType;
514
+ startLocation: Location | undefined;
515
+ endGroup: bigint | undefined;
516
+ parameters: KeyValuePair[];
517
+ private constructor();
518
+ static newNextGroupStart(requestId: bigint, fullTrackName: FullTrackName, subscriberPriority: number, groupOrder: GroupOrder, forward: boolean, parameters: KeyValuePair[]): Subscribe;
519
+ static newLatestObject(requestId: bigint, fullTrackName: FullTrackName, subscriberPriority: number, groupOrder: GroupOrder, forward: boolean, parameters: KeyValuePair[]): Subscribe;
520
+ static newAbsoluteStart(requestId: bigint, fullTrackName: FullTrackName, subscriberPriority: number, groupOrder: GroupOrder, forward: boolean, startLocation: Location, parameters: KeyValuePair[]): Subscribe;
521
+ static newAbsoluteRange(requestId: bigint, fullTrackName: FullTrackName, subscriberPriority: number, groupOrder: GroupOrder, forward: boolean, startLocation: Location, endGroup: bigint, parameters: KeyValuePair[]): Subscribe;
513
522
  serialize(): FrozenByteBuffer;
514
- static parsePayload(buf: BaseByteBuffer): PublishNamespaceCancel;
523
+ static parsePayload(buf: BaseByteBuffer): Subscribe;
515
524
  }
516
525
 
517
526
  /**
@@ -564,6 +573,32 @@ declare class PublishNamespaceOk {
564
573
  static parsePayload(buf: BaseByteBuffer): PublishNamespaceOk;
565
574
  }
566
575
 
576
+ /**
577
+ * Copyright 2025 The MOQtail Authors
578
+ *
579
+ * Licensed under the Apache License, Version 2.0 (the "License");
580
+ * you may not use this file except in compliance with the License.
581
+ * You may obtain a copy of the License at
582
+ *
583
+ * http://www.apache.org/licenses/LICENSE-2.0
584
+ *
585
+ * Unless required by applicable law or agreed to in writing, software
586
+ * distributed under the License is distributed on an "AS IS" BASIS,
587
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
588
+ * See the License for the specific language governing permissions and
589
+ * limitations under the License.
590
+ */
591
+
592
+ declare class PublishNamespaceCancel {
593
+ readonly trackNamespace: Tuple;
594
+ readonly errorCode: PublishNamespaceErrorCode;
595
+ readonly reasonPhrase: ReasonPhrase;
596
+ constructor(trackNamespace: Tuple, errorCode: PublishNamespaceErrorCode, reasonPhrase: ReasonPhrase);
597
+ getType(): ControlMessageType;
598
+ serialize(): FrozenByteBuffer;
599
+ static parsePayload(buf: BaseByteBuffer): PublishNamespaceCancel;
600
+ }
601
+
567
602
  /**
568
603
  * Copyright 2025 The MOQtail Authors
569
604
  *
@@ -807,41 +842,6 @@ declare class ServerSetup {
807
842
  static parsePayload(buf: BaseByteBuffer): ServerSetup;
808
843
  }
809
844
 
810
- /**
811
- * Copyright 2025 The MOQtail Authors
812
- *
813
- * Licensed under the Apache License, Version 2.0 (the "License");
814
- * you may not use this file except in compliance with the License.
815
- * You may obtain a copy of the License at
816
- *
817
- * http://www.apache.org/licenses/LICENSE-2.0
818
- *
819
- * Unless required by applicable law or agreed to in writing, software
820
- * distributed under the License is distributed on an "AS IS" BASIS,
821
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
822
- * See the License for the specific language governing permissions and
823
- * limitations under the License.
824
- */
825
-
826
- declare class Subscribe {
827
- requestId: bigint;
828
- fullTrackName: FullTrackName;
829
- subscriberPriority: number;
830
- groupOrder: GroupOrder;
831
- forward: boolean;
832
- filterType: FilterType;
833
- startLocation: Location | undefined;
834
- endGroup: bigint | undefined;
835
- parameters: KeyValuePair[];
836
- private constructor();
837
- static newNextGroupStart(requestId: bigint, fullTrackName: FullTrackName, subscriberPriority: number, groupOrder: GroupOrder, forward: boolean, parameters: KeyValuePair[]): Subscribe;
838
- static newLatestObject(requestId: bigint, fullTrackName: FullTrackName, subscriberPriority: number, groupOrder: GroupOrder, forward: boolean, parameters: KeyValuePair[]): Subscribe;
839
- static newAbsoluteStart(requestId: bigint, fullTrackName: FullTrackName, subscriberPriority: number, groupOrder: GroupOrder, forward: boolean, startLocation: Location, parameters: KeyValuePair[]): Subscribe;
840
- static newAbsoluteRange(requestId: bigint, fullTrackName: FullTrackName, subscriberPriority: number, groupOrder: GroupOrder, forward: boolean, startLocation: Location, endGroup: bigint, parameters: KeyValuePair[]): Subscribe;
841
- serialize(): FrozenByteBuffer;
842
- static parsePayload(buf: BaseByteBuffer): Subscribe;
843
- }
844
-
845
845
  /**
846
846
  * Copyright 2025 The MOQtail Authors
847
847
  *
@@ -888,16 +888,15 @@ declare class PublishDone {
888
888
 
889
889
  declare class Publish {
890
890
  readonly requestId: bigint;
891
- readonly trackNamespace: Tuple;
892
- readonly trackName: string;
891
+ readonly fullTrackName: FullTrackName;
893
892
  readonly trackAlias: bigint;
894
893
  readonly groupOrder: number;
895
894
  readonly contentExists: number;
896
895
  readonly largestLocation: Location | undefined;
897
896
  readonly forward: number;
898
897
  readonly parameters: KeyValuePair[];
899
- constructor(requestId: bigint, trackNamespace: Tuple, trackName: string, trackAlias: bigint, groupOrder: number, contentExists: number, largestLocation: Location | undefined, forward: number, parameters: KeyValuePair[]);
900
- static new(requestId: bigint | number, trackNamespace: Tuple, trackName: string, trackAlias: bigint | number, groupOrder: number, contentExists: number, largestLocation: Location | undefined, forward: number, parameters: KeyValuePair[]): Publish;
898
+ constructor(requestId: bigint, fullTrackName: FullTrackName, trackAlias: bigint, groupOrder: number, contentExists: number, largestLocation: Location | undefined, forward: number, parameters: KeyValuePair[]);
899
+ static new(requestId: bigint | number, fullTrackName: FullTrackName, trackAlias: bigint | number, groupOrder: number, contentExists: number, largestLocation: Location | undefined, forward: number, parameters: KeyValuePair[]): Publish;
901
900
  getType(): ControlMessageType;
902
901
  serialize(): FrozenByteBuffer;
903
902
  static parsePayload(buf: BaseByteBuffer): Publish;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "moqtail",
3
- "version": "0.7.0",
3
+ "version": "0.8.1",
4
4
  "description": "Media Over QUIC Transport client implementation",
5
5
  "type": "module",
6
6
  "license": "Apache-2.0",