@@ -11,22 +11,69 @@ import {
1111
1212// Inferred Interfaces from results
1313interface CheckDetail {
14+ // Whether this individual check instance passed or failed — lowercase in actual output
15+ // e.g. "failed", "passed", "warning"
1416 status : string ;
17+
18+ // XPath-like path to the PDF object that triggered this check
19+ // e.g. "root/document[0]/pages[0]/page[0]/annots[0]/annot[0]"
1520 context : string ;
21+
22+ // Human-readable error message, with errorArguments substituted in
1623 errorMessage : string ;
17- errorArguments : string [ ] ;
24+
25+ // Arguments substituted into the error message template; entries may be null
26+ errorArguments : ( string | null ) [ ] ;
27+
28+ // Present in some veraPDF versions — secondary location info
29+ location ?: {
30+ level : string ;
31+ context : string ;
32+ } ;
1833}
1934
2035interface RuleSummary {
21- ruleStatus : "FAILED" | "PASSED" | "WARNING" ;
22- specification : string ; // Maps to Blocker.source
23- tags ?: string [ ] | null ; // Maps to Blocker.tags
24- description : string ; // Maps to Blocker.description
36+ // Lowercase status matching CheckDetail — e.g. "failed", "passed"
37+ status : string ;
38+
39+ // Uppercase aggregate status for the rule as a whole - "FAILED" | "PASSED" | "WARNING";
40+ ruleStatus : string ;
41+
42+ // The standards body document — e.g. "ISO 14289-2:2024", "WCAG 2.1"
43+ specification : string ;
44+
45+ // Section/clause within the specification — e.g. "7.1", "Table 1", "Annex A"
46+ clause : string ;
47+
48+ // Test number within the clause — e.g. 1, 2
49+ testNumber : number ;
50+
51+ // Human-readable description of what the rule checks
52+ description : string ;
53+
54+ // The PDF object type this rule operates on
55+ // e.g. "PDDocument", "PDPage", "PDAnnot", "CosStream", "PDStructElem"
56+ object : string ;
57+
58+ // The actual validation test expression evaluated against the object
59+ // e.g. "hasTag" or a boolean XPath expression — often highly technical
60+ test : string ;
61+
62+ // Classification tags — e.g. ["PDF/UA-2"], ["WCAG21", "PDF/UA-2"]
63+ tags ?: string [ ] | null ;
64+
65+ // Absent (not 0) when recordPasses=false and no passes were recorded
66+ passedChecks ?: number ;
67+ failedChecks : number ;
68+
69+ // Individual check instances — only present for FAILED rules when recordPasses=false
2570 checks ?: CheckDetail [ ] ;
2671}
2772
2873interface ValidationResult {
2974 details : {
75+ // Aggregate of all tags across all rule summaries in this validation result
76+ tags : string [ ] ;
3077 ruleSummaries : RuleSummary [ ] ;
3178 } ;
3279}
@@ -48,9 +95,9 @@ function convertVeraToEqualifyV2(reportData: ReportData, job: any): StreamResult
4895 try {
4996 // Ensure the path to jobs exists before proceeding
5097 if ( ! reportData ?. report ?. jobs ) {
51- console . warn (
98+ /* console.warn(
5299 "Input JSON structure error!"
53- ) ;
100+ ); */
54101 throw new Error ;
55102 }
56103
@@ -77,7 +124,7 @@ function convertVeraToEqualifyV2(reportData: ReportData, job: any): StreamResult
77124 description : ruleSummary . description ,
78125
79126 // Fields specific to the individual CheckDetail instance
80- test : ruleSummary . specification ,
127+ test : ruleSummary . specification + " - " + ruleSummary . clause , // This ultimately maps to category
81128 summary : check . errorMessage ,
82129 node : check . context ,
83130 } ;
0 commit comments