@imferno/schema 3.0.2-beta.af1c617 → 3.0.2-beta.b86ffac

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 CHANGED
@@ -29,6 +29,8 @@ if (validate(data)) {
29
29
 
30
30
  | Export | Description |
31
31
  |--------|-------------|
32
+ | `validationResult` | `{ package, validation }` as returned by `validate()` in `@imferno/node` |
33
+ | `imfernoPackage` | Full parsed package as returned by `parsePackage()` in `@imferno/node` |
32
34
  | `imfReport` | Full IMF package report (metadata + validation + CPL analysis) |
33
35
  | `validationReport` | Validation issues and diagnostics |
34
36
  | `compositionPlaylist` | SMPTE ST 2067-3 Composition Playlist |
package/index.d.ts CHANGED
@@ -1,6 +1,10 @@
1
1
  /** A JSON Schema object (Draft 7). */
2
2
  type JsonSchema = Record<string, unknown>;
3
3
 
4
+ /** `{ package, validation }` as returned by `validate()` in @imferno/node. */
5
+ export declare const validationResult: JsonSchema;
6
+ /** The full parsed package (`Imferno`) as returned by `parsePackage()` in @imferno/node. */
7
+ export declare const imfernoPackage: JsonSchema;
4
8
  export declare const imfReport: JsonSchema;
5
9
  export declare const validationReport: JsonSchema;
6
10
  export declare const compositionPlaylist: JsonSchema;
@@ -10,6 +14,8 @@ export declare const volumeIndex: JsonSchema;
10
14
  export declare const rulesConfig: JsonSchema;
11
15
 
12
16
  export declare const schemas: {
17
+ validationResult: JsonSchema;
18
+ imfernoPackage: JsonSchema;
13
19
  imfReport: JsonSchema;
14
20
  validationReport: JsonSchema;
15
21
  compositionPlaylist: JsonSchema;
package/index.js CHANGED
@@ -9,6 +9,8 @@ function loadSchema(name) {
9
9
  return JSON.parse(readFileSync(join(schemasDir, `${name}.json`), "utf-8"));
10
10
  }
11
11
 
12
+ export const validationResult = loadSchema("validation-result");
13
+ export const imfernoPackage = loadSchema("imferno-package");
12
14
  export const imfReport = loadSchema("imf-report");
13
15
  export const validationReport = loadSchema("validation-report");
14
16
  export const compositionPlaylist = loadSchema("composition-playlist");
@@ -18,6 +20,8 @@ export const volumeIndex = loadSchema("volume-index");
18
20
  export const rulesConfig = loadSchema("rules-config");
19
21
 
20
22
  export const schemas = {
23
+ validationResult,
24
+ imfernoPackage,
21
25
  imfReport,
22
26
  validationReport,
23
27
  compositionPlaylist,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@imferno/schema",
3
- "version": "3.0.2-beta.af1c617",
3
+ "version": "3.0.2-beta.b86ffac",
4
4
  "description": "JSON Schema definitions for SMPTE ST 2067 IMF types — validates imferno export output",
5
5
  "main": "index.js",
6
6
  "types": "index.d.ts",
@@ -1353,6 +1353,21 @@
1353
1353
  }
1354
1354
  }
1355
1355
  },
1356
+ "J2KCcapi": {
1357
+ "description": "`Ccapi` array of `J2KExtendedCapabilities`.",
1358
+ "type": "object",
1359
+ "properties": {
1360
+ "UInt16": {
1361
+ "default": [],
1362
+ "type": "array",
1363
+ "items": {
1364
+ "type": "integer",
1365
+ "format": "uint16",
1366
+ "minimum": 0.0
1367
+ }
1368
+ }
1369
+ }
1370
+ },
1356
1371
  "J2KComponentSizing": {
1357
1372
  "description": "Individual J2K component sizing",
1358
1373
  "type": "object",
@@ -1393,6 +1408,18 @@
1393
1408
  "description": "J2K Extended Capabilities (ISO/IEC 15444-15)",
1394
1409
  "type": "object",
1395
1410
  "properties": {
1411
+ "Ccapi": {
1412
+ "description": "Codestream capabilities (Ccap^i), one UInt16 per Pcap bit set, in increasing order of i (ISO/IEC 15444-1 CAP marker).",
1413
+ "default": null,
1414
+ "anyOf": [
1415
+ {
1416
+ "$ref": "#/definitions/J2KCcapi"
1417
+ },
1418
+ {
1419
+ "type": "null"
1420
+ }
1421
+ ]
1422
+ },
1396
1423
  "Pcap": {
1397
1424
  "description": "Profile capabilities (Pcap)",
1398
1425
  "default": null,
@@ -2600,6 +2627,13 @@
2600
2627
  "Jpeg2000Imf4k"
2601
2628
  ]
2602
2629
  },
2630
+ {
2631
+ "description": "JPEG 2000 — IMF 8K profiles (byte [14]=0x04 Single Tile Lossy, 0x07 Single/Multi-Tile Reversible), at the Mainlevel/Sublevel combinations ST 2067-21:2026 §6.5.2 Table 5 lists. Only the 2026 edition of ST 2067-21 permits them.",
2632
+ "type": "string",
2633
+ "enum": [
2634
+ "Jpeg2000Imf8k"
2635
+ ]
2636
+ },
2603
2637
  {
2604
2638
  "description": "JPEG 2000 — Broadcast Contribution profile (ST 422 §A.1, byte [14]=0x01, sub-levels 0x11–0x17). Supports stored widths ≤ 3840 per ST 2067-21.",
2605
2639
  "type": "string",
@@ -335,7 +335,7 @@
335
335
  "format": "uuid"
336
336
  },
337
337
  "IssueSource": {
338
- "description": "Which authority produced a validation finding.\n\nEncodes the \"prose vs XSD\" provenance distinction that SMPTE ST 2067-3 §5.1 calls out (\"the prose document takes precedence on conflict\"), so callers can filter, group, or apply per-source severity overrides without inspecting the code string.\n\nCurrently *inferred* from the code prefix on a `ValidationIssue` (see `ValidationIssue::source`) — no engine code needs to set it explicitly. If inference ever becomes ambiguous (e.g. a non-XSD engine internal rule that wants the `XSD/` prefix for catalogue reasons), we can add a `with_source()` builder without changing the public shape.",
338
+ "description": "Which authority produced a validation finding.\n\nEncodes the \"prose vs XSD\" provenance distinction that SMPTE ST 2067-3 §5.1 calls out (\"the prose document takes precedence on conflict\"), so callers can filter, group, or apply per-source severity overrides without inspecting the code string.\n\nDerived from the rule's spec ([`Spec::source`]): `XSD` rules are `XsdLayer`, `IMFERNO` rules `EngineInternal`, SMPTE specs `ProseRule`.",
339
339
  "oneOf": [
340
340
  {
341
341
  "description": "Came from the runtime XSD validator (uppsala). Schema-layer: the structural subset of the spec that the XSD DSL can express.",
@@ -428,6 +428,13 @@
428
428
  "format": "uint",
429
429
  "minimum": 0.0
430
430
  },
431
+ "segment_id": {
432
+ "description": "Segment Id (`urn:uuid:…`) if applicable",
433
+ "type": [
434
+ "string",
435
+ "null"
436
+ ]
437
+ },
431
438
  "sequence_id": {
432
439
  "description": "Sequence UUID if applicable",
433
440
  "type": [
@@ -547,6 +554,128 @@
547
554
  }
548
555
  ]
549
556
  },
557
+ "Spec": {
558
+ "description": "A document whose rules imferno checks.",
559
+ "oneOf": [
560
+ {
561
+ "description": "SMPTE ST 377-1 — MXF File Format.",
562
+ "type": "string",
563
+ "enum": [
564
+ "ST377-1"
565
+ ]
566
+ },
567
+ {
568
+ "description": "SMPTE ST 377-4 — MXF Multichannel Audio Labeling.",
569
+ "type": "string",
570
+ "enum": [
571
+ "ST377-4"
572
+ ]
573
+ },
574
+ {
575
+ "description": "SMPTE ST 429-8 — Packing List.",
576
+ "type": "string",
577
+ "enum": [
578
+ "ST429-8"
579
+ ]
580
+ },
581
+ {
582
+ "description": "SMPTE ST 429-9 — Asset Mapping and File Segmentation.",
583
+ "type": "string",
584
+ "enum": [
585
+ "ST429-9"
586
+ ]
587
+ },
588
+ {
589
+ "description": "SMPTE ST 2067-2 — IMF Core Constraints.",
590
+ "type": "string",
591
+ "enum": [
592
+ "ST2067-2"
593
+ ]
594
+ },
595
+ {
596
+ "description": "SMPTE ST 2067-3 — IMF Composition Playlist.",
597
+ "type": "string",
598
+ "enum": [
599
+ "ST2067-3"
600
+ ]
601
+ },
602
+ {
603
+ "description": "SMPTE ST 2067-9 — IMF Sidecar Composition Map.",
604
+ "type": "string",
605
+ "enum": [
606
+ "ST2067-9"
607
+ ]
608
+ },
609
+ {
610
+ "description": "SMPTE ST 2067-21 — IMF Application #2E.",
611
+ "type": "string",
612
+ "enum": [
613
+ "ST2067-21"
614
+ ]
615
+ },
616
+ {
617
+ "description": "SMPTE ST 2067-201 — IMF IAB Level 0 Plug-in.",
618
+ "type": "string",
619
+ "enum": [
620
+ "ST2067-201"
621
+ ]
622
+ },
623
+ {
624
+ "description": "SMPTE ST 2067-202 — IMF ISXD Plug-in.",
625
+ "type": "string",
626
+ "enum": [
627
+ "ST2067-202"
628
+ ]
629
+ },
630
+ {
631
+ "description": "The XML Schema layer: findings of the runtime XSD validator against the vendored schema of a document's namespace.",
632
+ "type": "string",
633
+ "enum": [
634
+ "XSD"
635
+ ]
636
+ },
637
+ {
638
+ "description": "imferno's own checks (parse failures, package scanning) that no single SMPTE clause defines.",
639
+ "type": "string",
640
+ "enum": [
641
+ "IMFERNO"
642
+ ]
643
+ }
644
+ ]
645
+ },
646
+ "Strength": {
647
+ "description": "Normative strength of a rule in an edition's text.",
648
+ "oneOf": [
649
+ {
650
+ "description": "A requirement (\"shall\").",
651
+ "type": "string",
652
+ "enum": [
653
+ "shall"
654
+ ]
655
+ },
656
+ {
657
+ "description": "A recommendation (\"should\").",
658
+ "type": "string",
659
+ "enum": [
660
+ "should"
661
+ ]
662
+ },
663
+ {
664
+ "description": "A permission or an observation (\"may\").",
665
+ "type": "string",
666
+ "enum": [
667
+ "may"
668
+ ]
669
+ },
670
+ {
671
+ "description": "Deprecated in this edition.",
672
+ "type": "string",
673
+ "enum": [
674
+ "deprecated"
675
+ ]
676
+ }
677
+ ]
678
+ },
550
679
  "UnreferencedAsset": {
551
680
  "type": "object",
552
681
  "required": [
@@ -563,19 +692,25 @@
563
692
  }
564
693
  },
565
694
  "ValidationIssue": {
566
- "description": "A single validation issue",
695
+ "description": "A single validation finding.\n\nCreated only through [`ValidationIssue::from_rule`]: severity, category, clause and display code all come from the rule table row of the edition that was applied.",
567
696
  "type": "object",
568
697
  "required": [
569
698
  "category",
699
+ "clause",
570
700
  "code",
571
701
  "context",
702
+ "edition",
572
703
  "location",
573
704
  "message",
574
- "severity"
705
+ "rule",
706
+ "severity",
707
+ "source",
708
+ "spec",
709
+ "strength"
575
710
  ],
576
711
  "properties": {
577
712
  "additional_instances": {
578
- "description": "Other `Location`s when this issue represents an aggregation of multiple identical-code occurrences (see [`ValidationReport::aggregate`]). Empty for fresh, un-aggregated issues. Skipped during serialisation when empty so the on-wire shape stays back-compatible for callers that don't aggregate.",
713
+ "description": "Other `Location`s when this issue represents an aggregation of multiple identical-code occurrences (see [`ValidationReport::aggregate`]). Empty for fresh, un-aggregated issues. Skipped during serialisation when empty.",
579
714
  "type": "array",
580
715
  "items": {
581
716
  "$ref": "#/definitions/Location"
@@ -589,8 +724,12 @@
589
724
  }
590
725
  ]
591
726
  },
727
+ "clause": {
728
+ "description": "Clause of that edition the rule comes from (empty for pseudo-specs without clauses).",
729
+ "type": "string"
730
+ },
592
731
  "code": {
593
- "description": "Error code (e.g., \"ST2067-2:2020:8.3/FileNotFound\")",
732
+ "description": "Display code: `SPEC:EDITION:CLAUSE/Name`, with the edition actually applied (e.g. `ST2067-3:2016:7.2.2/SegmentDuration`).",
594
733
  "type": "string"
595
734
  },
596
735
  "context": {
@@ -600,6 +739,10 @@
600
739
  "type": "string"
601
740
  }
602
741
  },
742
+ "edition": {
743
+ "description": "Edition of the spec that was applied (`\"2016\"`; empty for single-edition pseudo-specs).",
744
+ "type": "string"
745
+ },
603
746
  "location": {
604
747
  "description": "Location where issue was found",
605
748
  "allOf": [
@@ -612,8 +755,12 @@
612
755
  "description": "Human-readable message",
613
756
  "type": "string"
614
757
  },
758
+ "rule": {
759
+ "description": "Stable, edition-free rule id (`ST2067-3/SegmentDuration`).",
760
+ "type": "string"
761
+ },
615
762
  "severity": {
616
- "description": "Severity level",
763
+ "description": "Severity level (the table default, possibly remapped by a rules config).",
617
764
  "allOf": [
618
765
  {
619
766
  "$ref": "#/definitions/Severity"
@@ -621,14 +768,29 @@
621
768
  ]
622
769
  },
623
770
  "source": {
624
- "description": "Authority that emitted this issue (XSD layer, prose rule, engine internal). Inferred from `code` at construction time so the field is always consistent with the code prefix — JS consumers can filter on `issue.source` directly without re-implementing the inference. Deserialised with a default so old reports without the field round-trip cleanly.",
625
- "default": "EngineInternal",
771
+ "description": "Authority that emitted this issue (XSD layer, prose rule, engine internal), derived from the rule's spec.",
626
772
  "allOf": [
627
773
  {
628
774
  "$ref": "#/definitions/IssueSource"
629
775
  }
630
776
  ]
631
777
  },
778
+ "spec": {
779
+ "description": "Spec the rule belongs to.",
780
+ "allOf": [
781
+ {
782
+ "$ref": "#/definitions/Spec"
783
+ }
784
+ ]
785
+ },
786
+ "strength": {
787
+ "description": "Normative strength of the rule in that edition.",
788
+ "allOf": [
789
+ {
790
+ "$ref": "#/definitions/Strength"
791
+ }
792
+ ]
793
+ },
632
794
  "suggestion": {
633
795
  "description": "Suggestion for how to fix",
634
796
  "type": [