@blockcast/mmt-container 2.2.0-main.903951da2b3d → 2.2.0-main.91bb48a4c793

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.
Files changed (41) hide show
  1. package/dist/__tests__/ad-creative-signer.d.ts +11 -0
  2. package/dist/__tests__/ad-creative-signer.d.ts.map +1 -0
  3. package/dist/ad-creative-timeline.d.ts +102 -0
  4. package/dist/ad-creative-timeline.d.ts.map +1 -0
  5. package/dist/ad-creative-timeline.js +2528 -0
  6. package/dist/ad-creative-timeline.js.map +7 -0
  7. package/dist/browser-runtime.js +51 -26
  8. package/dist/browser-runtime.js.map +2 -2
  9. package/dist/carp-catalog.js +3 -2
  10. package/dist/carp-catalog.js.map +2 -2
  11. package/dist/event-timeline-mmtp.d.ts +17 -0
  12. package/dist/event-timeline-mmtp.d.ts.map +1 -0
  13. package/dist/event-timeline-mmtp.js +3117 -0
  14. package/dist/event-timeline-mmtp.js.map +7 -0
  15. package/dist/mfu-reassembler.d.ts +2 -0
  16. package/dist/mfu-reassembler.d.ts.map +1 -1
  17. package/dist/mfu-reassembler.js +4 -2
  18. package/dist/mfu-reassembler.js.map +2 -2
  19. package/dist/mmtp-container-parser.js +4 -2
  20. package/dist/mmtp-container-parser.js.map +2 -2
  21. package/dist/mmtp-container-parser.no-modules.js +4 -2
  22. package/dist/mmtp-container-parser.no-modules.js.map +2 -2
  23. package/dist/mmtp-decode-pipeline.js +4 -2
  24. package/dist/mmtp-decode-pipeline.js.map +2 -2
  25. package/dist/mmtp-router.js +4 -2
  26. package/dist/mmtp-router.js.map +2 -2
  27. package/dist/multicast-manager.js +48 -24
  28. package/dist/multicast-manager.js.map +2 -2
  29. package/dist/multicast-transport.js +44 -22
  30. package/dist/multicast-transport.js.map +2 -2
  31. package/dist/no-modules.js +4 -2
  32. package/dist/no-modules.js.map +2 -2
  33. package/dist/wasm-mfu-reassembler.js.map +2 -2
  34. package/dist/wasm-mmtp-container-parser.js +4 -2
  35. package/dist/wasm-mmtp-container-parser.js.map +2 -2
  36. package/package.json +13 -5
  37. package/schemas/catalog.schema.json +1 -1
  38. package/src/ad-creative-timeline.ts +407 -0
  39. package/src/event-timeline-mmtp.ts +55 -0
  40. package/src/mfu-reassembler.ts +4 -0
  41. package/test-vectors/catalog/positive/event-timeline-wallclock-no-depends.json +38 -0
@@ -0,0 +1,11 @@
1
+ import { type AdCreativeKeys } from '../ad-creative-record.js';
2
+ /**
3
+ * A fixed Ed25519 test key and a riedl 4.5 signer for tests that need signed records
4
+ * (supersede, late join, multicast). It shares canonicalJson with the verifier, so it proves
5
+ * nothing about wire compatibility: vectors/ad-creative-signaling-01 does.
6
+ */
7
+ export declare function testSigner(kid?: string, seed?: number): {
8
+ keys: AdCreativeKeys;
9
+ sign(record: Record<string, unknown>): Record<string, unknown>;
10
+ };
11
+ //# sourceMappingURL=ad-creative-signer.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ad-creative-signer.d.ts","sourceRoot":"","sources":["../../src/__tests__/ad-creative-signer.ts"],"names":[],"mappings":"AACA,OAAO,EAAuC,KAAK,cAAc,EAAE,MAAM,0BAA0B,CAAA;AAKnG;;;;GAIG;AACH,wBAAgB,UAAU,CAAC,GAAG,SAAmB,EAAE,IAAI,SAAI,GAAG;IAC5D,IAAI,EAAE,cAAc,CAAA;IACpB,IAAI,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;CAC/D,CAYA"}
@@ -0,0 +1,102 @@
1
+ import { type AdCreativeKeys, type AdCreativeRecord, type AdIndex, type AdObjectDrop, type AdRecordDrop } from './ad-creative-record.js';
2
+ export * from './ad-creative-record.js';
3
+ export interface AdScheduledEvent {
4
+ /** Unique within a record: container key, tracking type and its occurrence. */
5
+ readonly eventKey: string;
6
+ /** The slot's key (riedl 10 item 8: identifiers plus occurrence), or null for a pod or record event. */
7
+ readonly slotKey: string | null;
8
+ readonly eventType: string;
9
+ readonly urls: readonly string[];
10
+ readonly dueMs: number;
11
+ /** podStart only: the pod's end, so a joiner inside the pod still fires it (riedl 11). Absent when the pod has no duration. */
12
+ readonly podEndMs?: number;
13
+ }
14
+ export interface AdSlotWindow {
15
+ readonly slotKey: string;
16
+ readonly startMs: number;
17
+ }
18
+ export interface AdSchedule {
19
+ /** Sorted by dueMs; among equal times podStart first and podEnd last. */
20
+ readonly events: readonly AdScheduledEvent[];
21
+ readonly slots: readonly AdSlotWindow[];
22
+ }
23
+ /**
24
+ * Place a record's events. `startMs` is the record index on the depends track's media time (for
25
+ * `m`, the index itself; riedl 5.1). Interior times are seconds relative to their container
26
+ * (riedl 4.3, 5.4); in a slot or trackingEvent envelope the record index stands in for the Pod.
27
+ */
28
+ export declare function scheduleAdRecord(record: AdCreativeRecord, startMs: number): AdSchedule;
29
+ /** Where an Object came from: its MoQ Location, or on multicast its MPU sequence number and Item_ID. */
30
+ export interface AdObjectLocation {
31
+ readonly groupId: number;
32
+ readonly objectId: number;
33
+ }
34
+ export type AdTimelineEvent = {
35
+ readonly type: 'record';
36
+ readonly status: 'added' | 'superseded' | 'removed';
37
+ readonly key: string;
38
+ readonly verified: true;
39
+ /** Only a verified record's contents ever leave the timeline (riedl 4.5). */
40
+ readonly record: AdCreativeRecord;
41
+ }
42
+ /** observeUnverified only: an unverified record's key, never its contents (riedl 4.5: it is absent). */
43
+ | {
44
+ readonly type: 'record';
45
+ readonly status: 'added' | 'superseded' | 'removed';
46
+ readonly key: string;
47
+ readonly verified: false;
48
+ } | {
49
+ readonly type: 'rejected';
50
+ readonly reason: AdObjectDrop | AdRecordDrop | 'unmappable' | 'stale-group' | 'replayed';
51
+ readonly key?: string;
52
+ readonly location: AdObjectLocation;
53
+ } | {
54
+ readonly type: 'track';
55
+ readonly key: string;
56
+ readonly slotKey: string | null;
57
+ readonly eventType: string;
58
+ readonly urls: readonly string[];
59
+ readonly dueMs: number;
60
+ readonly mediaTimeMs: number;
61
+ } | {
62
+ /** observeUnverified only: an event of an unsigned or unknown-key record. It carries no URL. */
63
+ readonly type: 'observed';
64
+ readonly key: string;
65
+ readonly slotKey: string | null;
66
+ readonly eventType: string;
67
+ readonly dueMs: number;
68
+ readonly mediaTimeMs: number;
69
+ };
70
+ export type AdTrackEvent = Extract<AdTimelineEvent, {
71
+ type: 'track';
72
+ }>;
73
+ export type AdTimelineObserver = (event: AdTimelineEvent) => void;
74
+ export interface AdCreativeTimelineOptions {
75
+ /** The channel's key set (importAdCreativeJwks with the channel's kids). */
76
+ keys: AdCreativeKeys;
77
+ /** Media ms of a t or l index on the depends track's timeline, or null. Default: only m maps (riedl 4.2). */
78
+ mapIndex?: (index: AdIndex) => number | null;
79
+ /** An event due longer ago than this is skipped, never burst; a forward jump this long is a seek. Default 2000. */
80
+ maxLateMs?: number;
81
+ /** Schedule unsigned and unknown-key records as 'observed' events, which carry no URL (live interop). Default false. */
82
+ observeUnverified?: boolean;
83
+ }
84
+ /**
85
+ * Takes Object payloads only. The MSF_EVENT_TIMELINE_HEADER track property (msf-02 8.1, 0x7B) is
86
+ * the subscriber's to read: riedl -01 defines no header, so a present one is a diagnostic there and
87
+ * never a reason to accept a record the signature check drops. It assumes the msf-02 8.4 sequence mapping
88
+ * (Object 0 holds every accessible record, later Objects add); under the "independent of its history"
89
+ * mapping every Group's Object 0 would remove the previous Group's records.
90
+ */
91
+ export declare class AdCreativeTimeline {
92
+ #private;
93
+ /** Replace to rotate keys (riedl 4.5); a verified record stays until an independent Object drops it. */
94
+ keys: AdCreativeKeys;
95
+ constructor(options: AdCreativeTimelineOptions);
96
+ addObserver(observer: AdTimelineObserver): () => void;
97
+ /** One Object of the track, from MoQ or from the multicast data path (EventTimelineMmtpReader). */
98
+ ingest(bytes: Uint8Array, location: AdObjectLocation): void;
99
+ /** Drive with the media time being presented, in ms on the depends track's timeline (riedl 5.1, 11). */
100
+ advance(mediaTimeMs: number): void;
101
+ }
102
+ //# sourceMappingURL=ad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