@blockcast/mmt-base 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.
|
@@ -2,7 +2,7 @@ export interface EventTimelineTrack {
|
|
|
2
2
|
readonly name: string;
|
|
3
3
|
readonly namespace?: string;
|
|
4
4
|
readonly eventType: string;
|
|
5
|
-
/**
|
|
5
|
+
/** Tracks whose timeline the records index; [] when the track declares none (msf-02 8.3). */
|
|
6
6
|
readonly depends: readonly string[];
|
|
7
7
|
}
|
|
8
8
|
export type EventTimelineTrackIssueCode = 'track_event_type' | 'track_event_mime_type' | 'track_event_depends';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"event-timeline-catalog.d.ts","sourceRoot":"","sources":["../src/event-timeline-catalog.ts"],"names":[],"mappings":"AAIA,MAAM,WAAW,kBAAkB;IACjC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;IACrB,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAA;IAC3B,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAA;IAC1B,
|
|
1
|
+
{"version":3,"file":"event-timeline-catalog.d.ts","sourceRoot":"","sources":["../src/event-timeline-catalog.ts"],"names":[],"mappings":"AAIA,MAAM,WAAW,kBAAkB;IACjC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;IACrB,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAA;IAC3B,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAA;IAC1B,6FAA6F;IAC7F,QAAQ,CAAC,OAAO,EAAE,SAAS,MAAM,EAAE,CAAA;CACpC;AACD,MAAM,MAAM,2BAA2B,GAAG,kBAAkB,GAAG,uBAAuB,GAAG,qBAAqB,CAAA;AAC9G,MAAM,WAAW,uBAAuB;IACtC,QAAQ,CAAC,IAAI,EAAE,2BAA2B,CAAA;IAC1C,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;IACrB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;IACrB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;CACvB;AAOD;wEACwE;AACxE,wBAAgB,0BAA0B,CAAC,OAAO,EAAE,OAAO,EAAE,UAAU,CAAC,EAAE,SAAS,MAAM,EAAE,GAAG;IAC5F,MAAM,EAAE,kBAAkB,EAAE,CAAA;IAC5B,MAAM,EAAE,uBAAuB,EAAE,CAAA;CAClC,CA+BA"}
|
|
@@ -1,6 +1,8 @@
|
|
|
1
|
-
// The Event Timeline tracks of an MSF catalog (draft-ietf-moq-msf-
|
|
1
|
+
// The Event Timeline tracks of an MSF catalog (draft-ietf-moq-msf-02 8.3), read once for every
|
|
2
2
|
// consumer: the container's ad-creative receiver, the transport's join selection, the players.
|
|
3
3
|
// Track-level, like mmtpTrackIssues: a bad entry costs that track, never the catalog.
|
|
4
|
+
/** draft-riedl-moq-ad-creative-signaling-01 3, R3: this type always indexes a media timeline. */
|
|
5
|
+
const RIEDL_AD_CREATIVE = 'urn:svta:advertising-wg:ad-creative-signaling';
|
|
4
6
|
const isObject = (v) => typeof v === 'object' && v !== null && !Array.isArray(v);
|
|
5
7
|
/** Tracks of packaging "eventtimeline", only those of `eventTypes` when given. `issues` names every
|
|
6
8
|
* eventtimeline track a consumer must skip, whatever its eventType. */
|
|
@@ -8,7 +10,7 @@ export function catalogEventTimelineTracks(catalog, eventTypes) {
|
|
|
8
10
|
const tracks = [];
|
|
9
11
|
const issues = [];
|
|
10
12
|
const list = isObject(catalog) && Array.isArray(catalog['tracks']) ? catalog['tracks'] : [];
|
|
11
|
-
// msf-01 5.2.14: a depends name resolves in the namespace of the track that declares it.
|
|
13
|
+
// msf-02 5.2.15 (msf-01 5.2.14): a depends name resolves in the namespace of the track that declares it.
|
|
12
14
|
const named = new Set(list.filter(isObject).map((t) => `${String(t['namespace'] ?? '')}\u0000${String(t['name'])}`));
|
|
13
15
|
list.forEach((t, index) => {
|
|
14
16
|
if (!isObject(t) || t['packaging'] !== 'eventtimeline' || typeof t['name'] !== 'string')
|
|
@@ -20,13 +22,16 @@ export function catalogEventTimelineTracks(catalog, eventTypes) {
|
|
|
20
22
|
const eventType = t['eventType'];
|
|
21
23
|
if (typeof eventType !== 'string' || eventType.length === 0)
|
|
22
24
|
return issue('track_event_type', 'eventType');
|
|
23
|
-
// msf-01 8.2 requires application/json
|
|
25
|
+
// msf-01 8.2 requires application/json, msf-02 8.3 drops the requirement: only another value rejects.
|
|
24
26
|
if (t['mimeType'] !== undefined && t['mimeType'] !== 'application/json')
|
|
25
27
|
return issue('track_event_mime_type', 'mimeType');
|
|
26
|
-
const depends = t['depends'];
|
|
27
28
|
const namespace = String(t['namespace'] ?? '');
|
|
28
|
-
// riedl 3 (R3):
|
|
29
|
-
|
|
29
|
+
// riedl 3 (R3): the ad-creative type indexes a media timeline, so depends is required and non-empty.
|
|
30
|
+
// msf-02 8.3: any other type needs depends only when its index refers to a media timeline, which the
|
|
31
|
+
// catalog does not state, so an absent depends is accepted; a present one must resolve (msf-02 5.2.15).
|
|
32
|
+
// shortcut: renderGroup (Number) entries are rejected, as the schema does; accept them when a publisher emits one.
|
|
33
|
+
const depends = t['depends'] ?? [];
|
|
34
|
+
if (!Array.isArray(depends) || (eventType === RIEDL_AD_CREATIVE && depends.length === 0) ||
|
|
30
35
|
!depends.every((d) => typeof d === 'string' && d !== name && named.has(`${namespace}\u0000${d}`))) {
|
|
31
36
|
return issue('track_event_depends', 'depends');
|
|
32
37
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"event-timeline-catalog.js","sourceRoot":"","sources":["../src/event-timeline-catalog.ts"],"names":[],"mappings":"AAAA,+FAA+F;AAC/F,+FAA+F;AAC/F,sFAAsF;AAiBtF,MAAM,QAAQ,GAAG,CAAC,CAAU,EAAgC,EAAE,CAAC,OAAO,CAAC,KAAK,QAAQ,IAAI,CAAC,KAAK,IAAI,IAAI,CAAC,KAAK,CAAC,OAA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AM,KAAK,CAAC,CAAC;YACtF,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,OAAO,CAAC,KAAK,QAAQ,IAAI,CAAC,KAAK,IAAI,IAAI,KAAK,CAAC,GAAG,CAAC,GAAG,SAAS,SAAS,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC;YACpG,OAAO,KAAK,CAAC,qBAAqB,EAAE,SAAS,CAAC,CAAA;QAChD,CAAC;QACD,IAAI,UAAU,KAAK,SAAS,IAAI,CAAC,UAAU,CAAC,QAAQ,CAAC,SAAS,CAAC;YAAE,OAAM;QACvE,MAAM,EAAE,GAAG,CAAC,CAAC,WAAW,CAAC,CAAA;QACzB,MAAM,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,GAAG,CAAC,OAAO,EAAE,KAAK,QAAQ,CAAC,CAAC,CAAC,EAAE,SAAS,EAAE,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,SAAS,EAAE,OAAO,EAAE,OAAmB,EAAE,CAAC,CAAA;IACtH,CAAC,CAAC,CAAA;IACF,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,CAAA;AAC3B,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@blockcast/mmt-base",
|
|
3
|
-
"version": "2.2.0-main.
|
|
3
|
+
"version": "2.2.0-main.91bb48a4c793",
|
|
4
4
|
"description": "Shared MMTP parsing primitives and protocol constants (zero FEC dependency). Hosts MMTP_HEADER_SIZE, parseMMTPHeader, extractMFUPayload and friends, plus wire constants such as DEFAULT_AMT_RELAY_PORT, so @blockcast/mmt-fec, @blockcast/mmt-container and @blockcast/mmt-transport can share one definition without a circular dep.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// The Event Timeline tracks of an MSF catalog (draft-ietf-moq-msf-
|
|
1
|
+
// The Event Timeline tracks of an MSF catalog (draft-ietf-moq-msf-02 8.3), read once for every
|
|
2
2
|
// consumer: the container's ad-creative receiver, the transport's join selection, the players.
|
|
3
3
|
// Track-level, like mmtpTrackIssues: a bad entry costs that track, never the catalog.
|
|
4
4
|
|
|
@@ -6,7 +6,7 @@ export interface EventTimelineTrack {
|
|
|
6
6
|
readonly name: string
|
|
7
7
|
readonly namespace?: string
|
|
8
8
|
readonly eventType: string
|
|
9
|
-
/**
|
|
9
|
+
/** Tracks whose timeline the records index; [] when the track declares none (msf-02 8.3). */
|
|
10
10
|
readonly depends: readonly string[]
|
|
11
11
|
}
|
|
12
12
|
export type EventTimelineTrackIssueCode = 'track_event_type' | 'track_event_mime_type' | 'track_event_depends'
|
|
@@ -17,6 +17,9 @@ export interface EventTimelineTrackIssue {
|
|
|
17
17
|
readonly index: number
|
|
18
18
|
}
|
|
19
19
|
|
|
20
|
+
/** draft-riedl-moq-ad-creative-signaling-01 3, R3: this type always indexes a media timeline. */
|
|
21
|
+
const RIEDL_AD_CREATIVE = 'urn:svta:advertising-wg:ad-creative-signaling'
|
|
22
|
+
|
|
20
23
|
const isObject = (v: unknown): v is Record<string, unknown> => typeof v === 'object' && v !== null && !Array.isArray(v)
|
|
21
24
|
|
|
22
25
|
/** Tracks of packaging "eventtimeline", only those of `eventTypes` when given. `issues` names every
|
|
@@ -28,7 +31,7 @@ export function catalogEventTimelineTracks(catalog: unknown, eventTypes?: readon
|
|
|
28
31
|
const tracks: EventTimelineTrack[] = []
|
|
29
32
|
const issues: EventTimelineTrackIssue[] = []
|
|
30
33
|
const list: unknown[] = isObject(catalog) && Array.isArray(catalog['tracks']) ? catalog['tracks'] : []
|
|
31
|
-
// msf-01 5.2.14: a depends name resolves in the namespace of the track that declares it.
|
|
34
|
+
// msf-02 5.2.15 (msf-01 5.2.14): a depends name resolves in the namespace of the track that declares it.
|
|
32
35
|
const named = new Set(list.filter(isObject).map((t) => `${String(t['namespace'] ?? '')}\u0000${String(t['name'])}`))
|
|
33
36
|
list.forEach((t, index) => {
|
|
34
37
|
if (!isObject(t) || t['packaging'] !== 'eventtimeline' || typeof t['name'] !== 'string') return
|
|
@@ -38,12 +41,15 @@ export function catalogEventTimelineTracks(catalog: unknown, eventTypes?: readon
|
|
|
38
41
|
}
|
|
39
42
|
const eventType = t['eventType']
|
|
40
43
|
if (typeof eventType !== 'string' || eventType.length === 0) return issue('track_event_type', 'eventType')
|
|
41
|
-
// msf-01 8.2 requires application/json
|
|
44
|
+
// msf-01 8.2 requires application/json, msf-02 8.3 drops the requirement: only another value rejects.
|
|
42
45
|
if (t['mimeType'] !== undefined && t['mimeType'] !== 'application/json') return issue('track_event_mime_type', 'mimeType')
|
|
43
|
-
const depends = t['depends']
|
|
44
46
|
const namespace = String(t['namespace'] ?? '')
|
|
45
|
-
// riedl 3 (R3):
|
|
46
|
-
|
|
47
|
+
// riedl 3 (R3): the ad-creative type indexes a media timeline, so depends is required and non-empty.
|
|
48
|
+
// msf-02 8.3: any other type needs depends only when its index refers to a media timeline, which the
|
|
49
|
+
// catalog does not state, so an absent depends is accepted; a present one must resolve (msf-02 5.2.15).
|
|
50
|
+
// shortcut: renderGroup (Number) entries are rejected, as the schema does; accept them when a publisher emits one.
|
|
51
|
+
const depends = t['depends'] ?? []
|
|
52
|
+
if (!Array.isArray(depends) || (eventType === RIEDL_AD_CREATIVE && depends.length === 0) ||
|
|
47
53
|
!depends.every((d) => typeof d === 'string' && d !== name && named.has(`${namespace}\u0000${d}`))) {
|
|
48
54
|
return issue('track_event_depends', 'depends')
|
|
49
55
|
}
|