@blockcast/mmt-container 2.2.0-main.d62748c7847f → 2.2.0-main.d79fbb738dc0
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/README.md +125 -2
- package/dist/__tests__/ad-creative-signer.d.ts +11 -0
- package/dist/__tests__/ad-creative-signer.d.ts.map +1 -0
- package/dist/ad-creative-record.d.ts +65 -0
- package/dist/ad-creative-record.d.ts.map +1 -0
- package/dist/ad-creative-record.js +2281 -0
- package/dist/ad-creative-record.js.map +7 -0
- package/dist/ad-creative-timeline.d.ts +102 -0
- package/dist/ad-creative-timeline.d.ts.map +1 -0
- package/dist/ad-creative-timeline.js +2529 -0
- package/dist/ad-creative-timeline.js.map +7 -0
- package/dist/block-policy.d.ts +110 -20
- package/dist/block-policy.d.ts.map +1 -1
- package/dist/block-policy.js +358 -102
- package/dist/block-policy.js.map +2 -2
- package/dist/browser-runtime.js +798 -175
- package/dist/browser-runtime.js.map +4 -4
- package/dist/carp-catalog.d.ts +1 -0
- package/dist/carp-catalog.d.ts.map +1 -1
- package/dist/carp-catalog.js +34 -0
- package/dist/carp-catalog.js.map +4 -4
- package/dist/catalog-fec-params.js.map +1 -1
- package/dist/cmaf-block-assembler.d.ts +10 -2
- package/dist/cmaf-block-assembler.d.ts.map +1 -1
- package/dist/cmaf-block-assembler.js +17 -8
- package/dist/cmaf-block-assembler.js.map +3 -3
- package/dist/conceal-timeline.d.ts +24 -1
- package/dist/conceal-timeline.d.ts.map +1 -1
- package/dist/conceal-timeline.js +201 -4
- package/dist/conceal-timeline.js.map +3 -3
- package/dist/event-timeline-mmtp.d.ts +17 -0
- package/dist/event-timeline-mmtp.d.ts.map +1 -0
- package/dist/event-timeline-mmtp.js +3117 -0
- package/dist/event-timeline-mmtp.js.map +7 -0
- package/dist/fec-manager.d.ts +19 -4
- package/dist/fec-manager.d.ts.map +1 -1
- package/dist/fec-manager.js +391 -117
- package/dist/fec-manager.js.map +2 -2
- package/dist/feed-gate.d.ts +114 -0
- package/dist/feed-gate.d.ts.map +1 -0
- package/dist/feed-gate.js +175 -0
- package/dist/feed-gate.js.map +7 -0
- package/dist/index.d.ts +3 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +13 -1
- package/dist/index.js.map +2 -2
- package/dist/iso-bmff-timing.d.ts +16 -0
- package/dist/iso-bmff-timing.d.ts.map +1 -1
- package/dist/iso-bmff-timing.js +28 -0
- package/dist/iso-bmff-timing.js.map +2 -2
- package/dist/mfu-reassembler.d.ts +2 -0
- package/dist/mfu-reassembler.d.ts.map +1 -1
- package/dist/mfu-reassembler.js +4 -2
- package/dist/mfu-reassembler.js.map +2 -2
- package/dist/mmtp-container-parser.d.ts +10 -0
- package/dist/mmtp-container-parser.d.ts.map +1 -1
- package/dist/mmtp-container-parser.js +58 -2
- package/dist/mmtp-container-parser.js.map +2 -2
- package/dist/mmtp-container-parser.no-modules.js +63 -5
- package/dist/mmtp-container-parser.no-modules.js.map +2 -2
- package/dist/mmtp-decode-pipeline.js +58 -2
- package/dist/mmtp-decode-pipeline.js.map +2 -2
- package/dist/mmtp-router.d.ts +18 -3
- package/dist/mmtp-router.d.ts.map +1 -1
- package/dist/mmtp-router.js +119 -29
- package/dist/mmtp-router.js.map +3 -3
- package/dist/multicast-manager.d.ts +14 -1
- package/dist/multicast-manager.d.ts.map +1 -1
- package/dist/multicast-manager.js +563 -171
- package/dist/multicast-manager.js.map +3 -3
- package/dist/multicast-transport.js +44 -22
- package/dist/multicast-transport.js.map +2 -2
- package/dist/no-modules.js +58 -2
- package/dist/no-modules.js.map +2 -2
- package/dist/repair-fetch.d.ts +7 -2
- package/dist/repair-fetch.d.ts.map +1 -1
- package/dist/repair-fetch.js.map +2 -2
- package/dist/wasm-mfu-reassembler.js.map +2 -2
- package/dist/wasm-mmtp-container-parser.js +58 -2
- package/dist/wasm-mmtp-container-parser.js.map +2 -2
- package/package.json +17 -5
- package/schemas/catalog.schema.json +7 -2
- package/src/ad-creative-record.ts +276 -0
- package/src/ad-creative-timeline.ts +409 -0
- package/src/block-policy.ts +531 -155
- package/src/carp-catalog.ts +9 -0
- package/src/cmaf-block-assembler.ts +17 -0
- package/src/conceal-timeline.ts +60 -5
- package/src/event-timeline-mmtp.ts +55 -0
- package/src/fec-manager.ts +48 -15
- package/src/feed-gate.ts +295 -0
- package/src/index.ts +21 -0
- package/src/iso-bmff-timing.ts +33 -0
- package/src/mfu-reassembler.ts +4 -0
- package/src/mmtp-container-parser.ts +42 -0
- package/src/mmtp-router.ts +81 -17
- package/src/multicast-manager.ts +20 -0
- package/src/repair-fetch.ts +7 -2
- package/test-vectors/catalog/README.md +1 -0
- package/test-vectors/catalog/negative/event-timeline-empty-event-type.json +41 -0
- package/test-vectors/catalog/positive/event-timeline-ad-creative.json +41 -0
- package/test-vectors/catalog/positive/event-timeline-wallclock-no-depends.json +38 -0
- package/test-vectors/catalog/positive/multicast-event-timeline.json +81 -0
- package/test-vectors/catalog/section-codes.json +1 -0
- package/test-vectors/frame-needs-v1.json +295 -0
package/README.md
CHANGED
|
@@ -67,6 +67,7 @@ The package exposes a wide subpath surface so consumers can tree-shake aggressiv
|
|
|
67
67
|
| `./fec-manager` | `FECManager` — per-track FEC decoder lifecycle (sync WASM + Worker variants) |
|
|
68
68
|
| `./block-policy` | Keyframe-protected repair policy — `BlockClassifier`, `repairPriorityForClass`, `decideGap` |
|
|
69
69
|
| `./conceal-timeline` | Sink concealment — `videoConcealModeForCodec`, `HoldLastTimeline`, `AudioGapConcealer` |
|
|
70
|
+
| `./feed-gate` | Per-frame dependency statements — `decodeFrameNeeds`, `decoderTolerance`, `VideoFeedGate` |
|
|
70
71
|
| `./mmtp-router` | `MmtpRouter` — packet routing with two-phase FEC feed |
|
|
71
72
|
| `./multicast-transport` | `MulticastTransport` — `window.multicast` gateway `subscribe({ consume: 'bytes' })` wrapper |
|
|
72
73
|
| `./multicast-manager` | `MulticastManager` — backwards-compat facade composing transport + router + FEC |
|
|
@@ -356,8 +357,12 @@ Every FEC block still gets in-band FEC decode. On top of that:
|
|
|
356
357
|
from the MPU's RAP fragment once two RAPs proved G fragments per MPU, every
|
|
357
358
|
later RAP fragment held to that spacing) against catalog geometry (framerate,
|
|
358
359
|
`interleaveDepthMs`, keyframe interval). Geometry that cannot be derived
|
|
359
|
-
exactly, or any violated invariant, runs the track `all-protected
|
|
360
|
-
|
|
360
|
+
exactly, or any violated invariant, runs the track `all-protected`: that
|
|
361
|
+
rule is off, and only the MPU rule below can still call a block `delta`,
|
|
362
|
+
on a track whose catalog passes its test. This window rule calls a block
|
|
363
|
+
`delta` only on such a track too, and stops for the epoch when the MPU
|
|
364
|
+
rule does (below). Nothing else calls a block `delta`.
|
|
365
|
+
A block every symbol of which vanished is
|
|
361
366
|
materialised from the surrounding block evidence. A frame split across
|
|
362
367
|
ADJACENT blocks (a block closing at K symbols) is expected; only source
|
|
363
368
|
packets whose authored order and block order disagree (a round-robin
|
|
@@ -365,6 +370,108 @@ Every FEC block still gets in-band FEC decode. On top of that:
|
|
|
365
370
|
`configureTrackFec(packetId, config, catalogTrackName)` so ABR rungs that
|
|
366
371
|
share a packetId each classify with their own framerate and GOP; a rung on
|
|
367
372
|
such a packetId without its own geometry runs `stream-geometry-absent`.
|
|
373
|
+
- **The MPU rule.** A publisher starts an MPU at every keyframe, so an MPU
|
|
374
|
+
holds one RAP: its first sample. The rule needs no block geometry and
|
|
375
|
+
runs in both modes. It reads the DU header held last before a block (L)
|
|
376
|
+
and the one held first after it (U); a header that FEC rebuilt counts.
|
|
377
|
+
- **The catalog test.** No packet says that a publisher keeps one RAP to
|
|
378
|
+
an MPU, and a publisher of draft-ramadan-moq-mmt up to -02 could put
|
|
379
|
+
more in one. The rule classes a block only on a track whose catalog
|
|
380
|
+
carries a keyframe interval equal to its group duration. So pass
|
|
381
|
+
`groupDurationMs` (`catalogGroupDurationMs`) to `configureTrackFec` for
|
|
382
|
+
every FEC-protected video track, next to `keyframeIntervalTicks` or
|
|
383
|
+
`keyframeIntervalMs`. A player that takes this version and does not
|
|
384
|
+
pass it gets no `delta` on its track at all: not those the
|
|
385
|
+
`dep_counter` run gave before, and not those of the window rule. Whole
|
|
386
|
+
numbers compare exactly, ticks over the timescale against
|
|
387
|
+
milliseconds; a group duration that came from ticks is a double, and
|
|
388
|
+
equal when the two differ by no more than 2 × `Number.EPSILON` times
|
|
389
|
+
the group duration. Without an interval, without a group duration, or
|
|
390
|
+
with two that differ, no block of the track is `delta`, by this rule or
|
|
391
|
+
by the window rule (draft-ramadan-moq-fec-multicast-01 Block
|
|
392
|
+
Classification: such a track gets no non-keyframe-bearing block). Every
|
|
393
|
+
short block is then repaired at keyframe priority. The classifier mode
|
|
394
|
+
can still read `classifying` on such a track, and an `unknown` block
|
|
395
|
+
then also gets the keyframe repair budget (`keyframeBudgetEligible`).
|
|
396
|
+
A player that sets that budget can then show something else for such
|
|
397
|
+
a block: its FETCH can be admitted where a `delta` one is refused
|
|
398
|
+
(`rtt-exceeds-budget`), its frames are then repaired, and the frames
|
|
399
|
+
behind it wait for the FETCH, up to the budget.
|
|
400
|
+
The stall-or-conceal decision (`decideGap`) does not read the class or
|
|
401
|
+
this test and is unchanged. That is a difference from the draft, which
|
|
402
|
+
has video on such a track wait for the next RAP after a failed repair:
|
|
403
|
+
here a gap inside one MPU still conceals (`delta-lost`) where the
|
|
404
|
+
catalog interval puts no keyframe in it (`mpuBoundsRapsFor`), though a
|
|
405
|
+
keyframe off that interval may be what was lost.
|
|
406
|
+
`BlockClassifier.mpuRuleOff`, `FECManager.mpuRuleOffFor` and
|
|
407
|
+
`BlockPolicyStats.mpuRuleOff` say which (`keyframe-interval-absent`,
|
|
408
|
+
`group-duration-absent`, `keyframe-interval-not-group-duration`), or
|
|
409
|
+
name what the stream showed (below), or are null while the rule runs.
|
|
410
|
+
- **Same MPU:** the block is `delta`, unless L may be part of the MPU's
|
|
411
|
+
first sample (it carries `RAP_flag`, or it is a later data unit of a
|
|
412
|
+
sample). Then it is `delta` only if every packet from L to the next
|
|
413
|
+
sample's DU header arrived, in earlier blocks.
|
|
414
|
+
- **U in the next MPU:** the block may hold that MPU's start and stays
|
|
415
|
+
`unknown`, unless the start arrived whole: every packet from the last
|
|
416
|
+
packet of L's MPU through the next MPU's metadata and first sample.
|
|
417
|
+
- **More than one MPU apart, or no header held on one side yet:**
|
|
418
|
+
`unknown`. The next DU header of the track asks again.
|
|
419
|
+
- "Every packet arrived" is read from the FEC source symbol id (the
|
|
420
|
+
block's SS_Start plus the ESI), which `FECManager.trackBlock` hands to
|
|
421
|
+
`BlockClassifier.observe`. `packet_sequence_number` is not read for it:
|
|
422
|
+
a hop may write it anew on every packet it forwards (cast's bridge
|
|
423
|
+
does), so a packet lost before that hop leaves no gap in it. A packet
|
|
424
|
+
that FEC rebuilt does not count as arrived.
|
|
425
|
+
- `dep_counter` is parsed and passed on (`SourceSymbolEvidence.depCounter`),
|
|
426
|
+
and decides nothing. A reclassification by this rule carries the
|
|
427
|
+
evidence `mpu-rule`; `dependent-run` stays in the type and is never sent.
|
|
428
|
+
- The rule stops for the epoch, the window rule with it, and every
|
|
429
|
+
`delta` class is withdrawn, at the first evidence that the stream does
|
|
430
|
+
not keep one RAP to an MPU:
|
|
431
|
+
- `mpuBoundsRaps` going false (`mpu-bounds-raps-refuted`).
|
|
432
|
+
- A DU header held (arrived or rebuilt) that carries `RAP_flag` and is
|
|
433
|
+
not of its MPU's first sample (`rap-inside-mpu`): it is not the first
|
|
434
|
+
sample of its movie fragment (`sample_number` above 1), or it lies in
|
|
435
|
+
another movie fragment than the first DU header held of its MPU. It
|
|
436
|
+
sees what `mpuBoundsRaps` cannot: a RAP that starts a later movie
|
|
437
|
+
fragment of an MPU whose fragments hold several samples, and a RAP
|
|
438
|
+
known only from a header that FEC rebuilt. A DU header in a
|
|
439
|
+
repair-less span is not held.
|
|
440
|
+
- An MPU longer than the keyframe interval
|
|
441
|
+
(`mpu-longer-than-keyframe-interval`): two of its samples lie an
|
|
442
|
+
interval or more apart by decode time. A track of an earlier revision
|
|
443
|
+
whose interval equals its group duration can hold a second keyframe
|
|
444
|
+
only in such an MPU. The decode times are those of every sample that
|
|
445
|
+
held movie fragment metadata (FT=1) times, arrived or rebuilt, whether
|
|
446
|
+
or not the sample itself is held: the parser reports them
|
|
447
|
+
(`onMovieFragmentTiming`) before the packet's block is tracked, and
|
|
448
|
+
the router hands them to `FECManager.noteSampleDecodeTimes`. The
|
|
449
|
+
router feeds a rebuilt block's FT=1 before it reads that block's
|
|
450
|
+
rebuilt DU headers, so the check comes first there too. They
|
|
451
|
+
decide whether the rule applies, never a block's class. The times of
|
|
452
|
+
the two MPUs of the highest numbers are kept; a report for an MPU
|
|
453
|
+
behind both (a slow repair) is not, and only the span of that one
|
|
454
|
+
report is read.
|
|
455
|
+
Neither of the last two sets `mpuBoundsRaps` or the classifier mode.
|
|
456
|
+
- A block is still checked on its own where the catalog interval, counted
|
|
457
|
+
in frames from the MPU positions of L and U, puts a keyframe between
|
|
458
|
+
them. It reads a frame count where no decode time is known (the movie
|
|
459
|
+
fragment metadata was lost) and covers a header that FEC rebuilt.
|
|
460
|
+
- What is left: on a track that passes the catalog test and still puts a
|
|
461
|
+
second keyframe in an MPU, a block that lost that keyframe can read
|
|
462
|
+
`delta` until one of the three is seen. Movie fragment metadata that
|
|
463
|
+
arrives before the track's first FT=0 times nothing.
|
|
464
|
+
- Only the DU headers of the two newest MPUs are held. If MPU numbers go
|
|
465
|
+
back with no source discontinuity (a restart nothing signalled, or the
|
|
466
|
+
2^32 wrap), the rule gives no class until the next one. A DU header of
|
|
467
|
+
an MPU behind them is read for one thing: `RAP_flag` with a
|
|
468
|
+
`sample_number` above 1 still stops the rule (`rap-inside-mpu`). What it
|
|
469
|
+
would show only next to other headers of its MPU, or a late report next
|
|
470
|
+
to other reports of its MPU, is not seen.
|
|
471
|
+
- DU headers that lie against the block order stop this rule until the
|
|
472
|
+
next source discontinuity (`du-headers-out-of-order`), and every `delta`
|
|
473
|
+
class is withdrawn once. That state does not stop the window rule, which
|
|
474
|
+
reads the order from the packets that arrived (`block-not-contiguous`).
|
|
368
475
|
- **Repair priority.** `wireRepairFetch` dispatches P0 (`keyframe`/`unknown`)
|
|
369
476
|
and P1 (`audio`) immediately; P2 (`delta`) only while no P0/P1 is queued or
|
|
370
477
|
in flight, earliest deadline first, preempted by any new P0/P1. No timers.
|
|
@@ -388,6 +495,22 @@ Every FEC block still gets in-band FEC decode. On top of that:
|
|
|
388
495
|
never stalls. The same object is the manager's `gap` lifecycle event.
|
|
389
496
|
- **Concealment** is hold-last-good-frame (`HoldLastTimeline`) plus exact
|
|
390
497
|
audio sizing (`AudioGapConcealer`). No bitstream is ever synthesised.
|
|
498
|
+
- **The feed gate (`./feed-gate`).** A video frame may state, in the
|
|
499
|
+
`priority` byte of its DU header, the one earlier frame it needs
|
|
500
|
+
(`decodeFrameNeeds`; vectors in `test-vectors/frame-needs-v1.json`). The
|
|
501
|
+
router forwards it as `needs` beside `gapBefore`, on a frame that is the
|
|
502
|
+
one sample of its movie fragment. `VideoFeedGate` feeds a
|
|
503
|
+
frame only if that frame was fed since the last keyframe, so a loss holds
|
|
504
|
+
only the frames it reaches. It answers only inside a GOP whose keyframe
|
|
505
|
+
carried 254 and only for a decoder that does not conceal
|
|
506
|
+
(`decoderTolerance`: every codec but H.264). Everywhere else it answers
|
|
507
|
+
`unread` and the sink runs its own stall and hold. A WebCodecs sink calls
|
|
508
|
+
`admit`, `fed`, `requireKeyframe` and `onDecoderFailure`; an MSE sink passes
|
|
509
|
+
`needs` and `tolerance` to `HoldLastTimeline`, which owns a gate, and
|
|
510
|
+
reports a decoder failure with the timeline's `onDecoderFailure()`. After
|
|
511
|
+
that report the gate withholds the rest of a GOP in which it had withheld a
|
|
512
|
+
frame or fed one across a gap, up to the next keyframe. The gate's counters
|
|
513
|
+
are the timeline's `gateStats`.
|
|
391
514
|
|
|
392
515
|
Typed evidence is `RepairLifecycleEvent` version 2 and
|
|
393
516
|
`MulticastManager.getBlockPolicyStats()`.
|
|
@@ -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,65 @@
|
|
|
1
|
+
/** kid -> raw 32-byte Ed25519 public key: one channel's JWK Set (riedl 4.5). */
|
|
2
|
+
export type AdCreativeKeys = ReadonlyMap<string, Uint8Array>;
|
|
3
|
+
export type AdSigVerdict = 'verified' | 'unsigned' | 'sig' | 'alg' | 'kid' | 'signature';
|
|
4
|
+
/**
|
|
5
|
+
* The host-provisioned JWK Set (RFC 7517): OKP/Ed25519 public keys by kid (RFC 8037). This set is
|
|
6
|
+
* the only key source; jku, jwk, x5u and x5c in a header are never read (riedl 4.5). Never throws:
|
|
7
|
+
* a private, malformed or repeated-kid entry is left out, so records under it fail with 'kid'.
|
|
8
|
+
* `kids` is the channel's kid allowlist: given, only those kids are imported, so a validly signed
|
|
9
|
+
* record substituted from another channel fails with 'kid' too (riedl 4.5).
|
|
10
|
+
*/
|
|
11
|
+
export declare function importAdCreativeJwks(jwks: unknown, kids?: readonly string[]): AdCreativeKeys;
|
|
12
|
+
/** RFC 8785 for JSON.parse output: riedl's reference canonicalize() (scripts/sign-record.mjs at 443f90b2). */
|
|
13
|
+
export declare function canonicalJson(value: unknown): string;
|
|
14
|
+
/** riedl 4.5 for one record as parsed from JSON: the verification entry point. */
|
|
15
|
+
export declare function verifyAdCreativeSig(record: Readonly<Record<string, unknown>>, keys: AdCreativeKeys): AdSigVerdict;
|
|
16
|
+
export declare const AD_CREATIVE_EVENT_TYPE = "urn:svta:advertising-wg:ad-creative-signaling";
|
|
17
|
+
/** riedl 12.3 size limit. An Object of two signed pods is about 4.4 KB. */
|
|
18
|
+
export declare const AD_OBJECT_MAX_BYTES = 65536;
|
|
19
|
+
/** riedl 12.3: records per Object, which bounds the Ed25519 verifies one Object costs. */
|
|
20
|
+
export declare const AD_OBJECT_MAX_RECORDS = 64;
|
|
21
|
+
/** riedl 12.3 nesting limit. A pod record nests 9 deep. */
|
|
22
|
+
export declare const AD_JSON_MAX_DEPTH = 16;
|
|
23
|
+
/** The record index (msf-01 8.1, riedl 4.1): media time or wallclock in ms, or a MOQT Location. */
|
|
24
|
+
export type AdIndex = {
|
|
25
|
+
readonly kind: 'm' | 't';
|
|
26
|
+
readonly ms: number;
|
|
27
|
+
} | {
|
|
28
|
+
readonly kind: 'l';
|
|
29
|
+
readonly group: number;
|
|
30
|
+
readonly object: number;
|
|
31
|
+
};
|
|
32
|
+
/** One SVTA 2053-1 Version 2 carriage envelope (riedl 4.3). Payload members are SVTA's. */
|
|
33
|
+
export interface AdEnvelope {
|
|
34
|
+
readonly version: 2;
|
|
35
|
+
readonly type: 'pod' | 'slot' | 'trackingEvent' | 'verification';
|
|
36
|
+
readonly payload: readonly Readonly<Record<string, unknown>>[];
|
|
37
|
+
readonly features?: Readonly<Record<string, boolean>>;
|
|
38
|
+
}
|
|
39
|
+
export interface AdCreativeRecord {
|
|
40
|
+
readonly index: AdIndex;
|
|
41
|
+
/** Supersede key (riedl 10 item 3): "m:480500", "t:1793016000000", "l:120,0". */
|
|
42
|
+
readonly key: string;
|
|
43
|
+
readonly data: AdEnvelope;
|
|
44
|
+
/** RFC 8785 form of the record without sig: the signed payload and the heartbeat dedup key. */
|
|
45
|
+
readonly canonical: string;
|
|
46
|
+
}
|
|
47
|
+
export type AdRecordDrop = 'shape' | 'depth' | 'index' | 'data' | 'envelope' | 'url' | 'feature' | 'timing' | 'number' | Exclude<AdSigVerdict, 'verified'>;
|
|
48
|
+
export type AdObjectDrop = 'size' | 'utf8' | 'json' | 'not-array' | 'count';
|
|
49
|
+
export interface AdRecordResult {
|
|
50
|
+
readonly verdict: 'verified' | AdRecordDrop;
|
|
51
|
+
/** Set once the index parsed. */
|
|
52
|
+
readonly key?: string;
|
|
53
|
+
/** Set for 'verified', and for 'unsigned' and 'kid': well formed but unverifiable here, so
|
|
54
|
+
* observe-only mode may show them. Never set for a forged or malformed signature. */
|
|
55
|
+
readonly record?: AdCreativeRecord;
|
|
56
|
+
}
|
|
57
|
+
export interface AdObjectResult {
|
|
58
|
+
readonly verdict: 'accepted' | AdObjectDrop;
|
|
59
|
+
readonly records: readonly AdRecordResult[];
|
|
60
|
+
}
|
|
61
|
+
/** One record: riedl 4.1 and 4.3 rules, 12.3 limits, SVTA flags, then the 4.5 signature. */
|
|
62
|
+
export declare function parseAdCreativeRecord(value: unknown, keys: AdCreativeKeys): AdRecordResult;
|
|
63
|
+
/** One MoQ Object of the track (msf-01 8.1: a JSON array of records). A gzip Object (MSF_COMPRESSION, msf 12.1) is not inflated here, so it drops as 'utf8' or 'json'. */
|
|
64
|
+
export declare function parseAdCreativeObject(bytes: Uint8Array, keys: AdCreativeKeys): AdObjectResult;
|
|
65
|
+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