@imferno/node 3.0.2-beta.2427eb9 → 3.0.2-beta.2b20aac
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 +37 -5
- package/codes.d.ts +279 -466
- package/codes.js +279 -466
- package/index.d.ts +96 -34
- package/index.mjs +5 -0
- package/package.json +7 -7
- package/types.d.ts +213 -13
package/index.d.ts
CHANGED
|
@@ -2,20 +2,29 @@
|
|
|
2
2
|
/* eslint-disable */
|
|
3
3
|
|
|
4
4
|
import type {
|
|
5
|
-
Category,
|
|
6
5
|
ImfReport,
|
|
7
6
|
Imferno,
|
|
7
|
+
RuleInfo,
|
|
8
8
|
ValidateOptions,
|
|
9
|
+
ValidationReport,
|
|
9
10
|
ValidationResult,
|
|
10
11
|
} from "./types";
|
|
11
12
|
|
|
12
13
|
export * from "./types";
|
|
13
14
|
export { codes } from "./codes";
|
|
14
15
|
|
|
15
|
-
/** Options for validating a package on disk (`validatePath`, `buildReportFromPath`). */
|
|
16
|
+
/** Options for validating a package on disk (`validatePath`, `buildReportFromPath` and their `…Async` variants). */
|
|
16
17
|
export interface PathValidateOptions extends ValidateOptions {
|
|
17
|
-
/**
|
|
18
|
+
/**
|
|
19
|
+
* Skip every disk read: asset presence, size and hash checks and MXF
|
|
20
|
+
* header checks (implies `skipHashes`). Only the XML is validated. Default: `false`.
|
|
21
|
+
*/
|
|
18
22
|
skipDiskChecks?: boolean;
|
|
23
|
+
/**
|
|
24
|
+
* Skip hashing the assets against their Packing List `<Hash>`; presence and
|
|
25
|
+
* size are still checked. Hashing reads every asset. Default: `false`.
|
|
26
|
+
*/
|
|
27
|
+
skipHashes?: boolean;
|
|
19
28
|
}
|
|
20
29
|
|
|
21
30
|
/** Explicit S3 credentials for `s3://` URIs. Omit to use the default AWS credential chain. */
|
|
@@ -27,34 +36,22 @@ export interface S3Credentials {
|
|
|
27
36
|
endpoint?: string;
|
|
28
37
|
}
|
|
29
38
|
|
|
30
|
-
/**
|
|
39
|
+
/**
|
|
40
|
+
* Options for `validateUri` / `buildReportFromUri` (and their `…Async` variants).
|
|
41
|
+
* For an `s3://` URI only the XML is read: the disk checks do not run, and the
|
|
42
|
+
* result carries an `IMFERNO:Package/DiskChecksNotRun` notice unless
|
|
43
|
+
* `skipDiskChecks` is set.
|
|
44
|
+
*/
|
|
31
45
|
export interface UriValidateOptions extends PathValidateOptions {
|
|
32
46
|
/** Ignored for filesystem URIs. */
|
|
33
47
|
credentials?: S3Credentials | null;
|
|
34
48
|
}
|
|
35
49
|
|
|
36
|
-
/**
|
|
37
|
-
export
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
| "volindex"
|
|
42
|
-
| "mxf"
|
|
43
|
-
| "scm"
|
|
44
|
-
| "isxd"
|
|
45
|
-
| "iab"
|
|
46
|
-
| "imferno";
|
|
47
|
-
|
|
48
|
-
/** One entry of the `listRules()` catalogue. */
|
|
49
|
-
export interface RuleInfo {
|
|
50
|
-
/** Normalised rule code, usable as a `rules` key. */
|
|
51
|
-
code: string;
|
|
52
|
-
spec: RuleSpec;
|
|
53
|
-
description: string;
|
|
54
|
-
defaultSeverity: "info" | "warning" | "error" | "critical";
|
|
55
|
-
category: Extract<Category, string>;
|
|
56
|
-
/** Present when this edition's code set is identical to an earlier edition's (that edition's prefix). */
|
|
57
|
-
sameAsPreviousEdition?: string;
|
|
50
|
+
/** A SARIF 2.1.0 log (https://docs.oasis-open.org/sarif/sarif/v2.1.0/). */
|
|
51
|
+
export interface SarifLog {
|
|
52
|
+
$schema?: string;
|
|
53
|
+
version: "2.1.0";
|
|
54
|
+
runs: Array<Record<string, unknown>>;
|
|
58
55
|
}
|
|
59
56
|
|
|
60
57
|
/**
|
|
@@ -64,7 +61,7 @@ export interface RuleInfo {
|
|
|
64
61
|
* Disk checks are always skipped (there is no package on disk).
|
|
65
62
|
*
|
|
66
63
|
* @param files - A map of filename to XML content (e.g. `{ "ASSETMAP.xml": "..." }`)
|
|
67
|
-
* @param options - Optional validation options (`coreSpec`, `app2eSpec`, `rules`, `aggregateRepeats`)
|
|
64
|
+
* @param options - Optional validation options (`coreSpec`, `cplSpec`, `iabSpec`, `app2eSpec`, `rules`, `aggregateRepeats`)
|
|
68
65
|
* @returns An `ImfReport` with `package`, `cpls`, and `validation` fields.
|
|
69
66
|
* @throws If the package cannot be parsed or the options are invalid.
|
|
70
67
|
*/
|
|
@@ -74,13 +71,26 @@ export declare function buildReport(files: Record<string, string>, options?: Val
|
|
|
74
71
|
* Validate an IMF package directory on disk, returning the legacy
|
|
75
72
|
* `ImfReport` summary. Prefer `validatePath` for new code.
|
|
76
73
|
*
|
|
74
|
+
* Hashes the assets in parallel and blocks until done; see
|
|
75
|
+
* `buildReportFromPathAsync`.
|
|
76
|
+
*
|
|
77
77
|
* @param path - Path to the IMP directory
|
|
78
|
-
* @param options - Optional validation options (`coreSpec`, `app2eSpec`, `skipDiskChecks`, `rules`, `aggregateRepeats`)
|
|
78
|
+
* @param options - Optional validation options (`coreSpec`, `cplSpec`, `iabSpec`, `app2eSpec`, `skipDiskChecks`, `skipHashes`, `rules`, `aggregateRepeats`)
|
|
79
79
|
* @returns An `ImfReport` with `package`, `cpls`, and `validation` fields.
|
|
80
80
|
* @throws If the directory cannot be read, the package cannot be parsed, or the options are invalid.
|
|
81
81
|
*/
|
|
82
82
|
export declare function buildReportFromPath(path: string, options?: PathValidateOptions | undefined | null): ImfReport
|
|
83
83
|
|
|
84
|
+
/**
|
|
85
|
+
* `buildReportFromPath` on the libuv thread pool: the event loop keeps
|
|
86
|
+
* running while the assets are hashed.
|
|
87
|
+
*
|
|
88
|
+
* @param path - Path to the IMP directory
|
|
89
|
+
* @param options - Optional validation options, as for `buildReportFromPath`
|
|
90
|
+
* @returns A Promise of the `ImfReport`; rejects where `buildReportFromPath` throws.
|
|
91
|
+
*/
|
|
92
|
+
export declare function buildReportFromPathAsync(path: string, options?: PathValidateOptions | undefined | null): Promise<ImfReport>
|
|
93
|
+
|
|
84
94
|
/**
|
|
85
95
|
* Build the legacy `ImfReport` summary from a URI. Accepts the same URI forms
|
|
86
96
|
* as `validateUri`; prefer `validateUri` for new code.
|
|
@@ -92,6 +102,15 @@ export declare function buildReportFromPath(path: string, options?: PathValidate
|
|
|
92
102
|
*/
|
|
93
103
|
export declare function buildReportFromUri(uri: string, options?: UriValidateOptions | undefined | null): ImfReport
|
|
94
104
|
|
|
105
|
+
/**
|
|
106
|
+
* `buildReportFromUri` on the libuv thread pool.
|
|
107
|
+
*
|
|
108
|
+
* @param uri - Path or URI to the IMP
|
|
109
|
+
* @param options - Optional validation options, as for `buildReportFromUri`
|
|
110
|
+
* @returns A Promise of the `ImfReport`; rejects where `buildReportFromUri` throws.
|
|
111
|
+
*/
|
|
112
|
+
export declare function buildReportFromUriAsync(uri: string, options?: UriValidateOptions | undefined | null): Promise<ImfReport>
|
|
113
|
+
|
|
95
114
|
/**
|
|
96
115
|
* Pretty-print a validation result as a human-readable string.
|
|
97
116
|
*
|
|
@@ -105,10 +124,10 @@ export declare function formatReport(report: ValidationResult | ImfReport): stri
|
|
|
105
124
|
export declare function getVersion(): string
|
|
106
125
|
|
|
107
126
|
/**
|
|
108
|
-
* Returns the engine's
|
|
109
|
-
*
|
|
110
|
-
*
|
|
111
|
-
*
|
|
127
|
+
* Returns the engine's rule catalogue: one entry per rule, each with its
|
|
128
|
+
* table of editions (clause, strength, default severity, display code).
|
|
129
|
+
* Useful for building settings UIs; `id`, `name`, `SPEC:EDITION/Name` and
|
|
130
|
+
* the display codes are all usable as `rules` keys.
|
|
112
131
|
*/
|
|
113
132
|
export declare function listRules(): RuleInfo[]
|
|
114
133
|
|
|
@@ -132,6 +151,19 @@ export declare function parsePackage(files: Record<string, string>): Imferno
|
|
|
132
151
|
*/
|
|
133
152
|
export declare function parsePackageFromPath(path: string): Imferno
|
|
134
153
|
|
|
154
|
+
/**
|
|
155
|
+
* Convert a validation result to a SARIF 2.1.0 log.
|
|
156
|
+
*
|
|
157
|
+
* Rules are reported by rule id (`ST2067-3/SegmentDuration`); each finding
|
|
158
|
+
* points at the applied edition's clause in that edition's taxonomy
|
|
159
|
+
* (`ST2067-3:2016`).
|
|
160
|
+
*
|
|
161
|
+
* @param report - The object returned by `validate*` (or its `validation`)
|
|
162
|
+
* @returns A SARIF 2.1.0 log object.
|
|
163
|
+
* @throws If `report` is not a validation result or report.
|
|
164
|
+
*/
|
|
165
|
+
export declare function toSarif(report: ValidationResult | ValidationReport): SarifLog
|
|
166
|
+
|
|
135
167
|
/**
|
|
136
168
|
* Parse and validate an IMF package from in-memory XML strings. This is the
|
|
137
169
|
* recommended entry point.
|
|
@@ -142,25 +174,44 @@ export declare function parsePackageFromPath(path: string): Imferno
|
|
|
142
174
|
* @param files - A map of filename to XML content
|
|
143
175
|
* @param options - Optional validation options
|
|
144
176
|
* @returns `{ package, validation }` — the full parsed package and all findings.
|
|
145
|
-
* @throws Only if the options are invalid.
|
|
177
|
+
* @throws Only if the options are invalid (wrong type, unknown key).
|
|
146
178
|
*/
|
|
147
179
|
export declare function validate(files: Record<string, string>, options?: ValidateOptions | undefined | null): ValidationResult
|
|
148
180
|
|
|
149
181
|
/**
|
|
150
182
|
* Parse and validate an IMF package directory on disk.
|
|
151
183
|
*
|
|
184
|
+
* Like the CLI, checks every asset's presence and size and hashes it against
|
|
185
|
+
* its Packing List `<Hash>` unless `skipHashes` (or `skipDiskChecks`) is set.
|
|
186
|
+
* Hashing reads every asset (several at a time) and blocks until done; use
|
|
187
|
+
* `validatePathAsync` to keep the event loop running.
|
|
188
|
+
*
|
|
152
189
|
* @param path - Path to the IMP directory
|
|
153
190
|
* @param options - Optional validation options
|
|
154
191
|
* @returns `{ package, validation }` — the full parsed package and all findings.
|
|
155
|
-
* @throws If the directory cannot be read or the options are invalid
|
|
192
|
+
* @throws If the directory cannot be read or the options are invalid
|
|
193
|
+
* (wrong type, unknown key).
|
|
156
194
|
*/
|
|
157
195
|
export declare function validatePath(path: string, options?: PathValidateOptions | undefined | null): ValidationResult
|
|
158
196
|
|
|
197
|
+
/**
|
|
198
|
+
* `validatePath` on the libuv thread pool: the event loop keeps running
|
|
199
|
+
* while the assets are hashed. Same result as `validatePath`.
|
|
200
|
+
*
|
|
201
|
+
* @param path - Path to the IMP directory
|
|
202
|
+
* @param options - Optional validation options, as for `validatePath`
|
|
203
|
+
* @returns A Promise of `{ package, validation }`; rejects where `validatePath` throws.
|
|
204
|
+
*/
|
|
205
|
+
export declare function validatePathAsync(path: string, options?: PathValidateOptions | undefined | null): Promise<ValidationResult>
|
|
206
|
+
|
|
159
207
|
/**
|
|
160
208
|
* Parse and validate an IMF package from a URI.
|
|
161
209
|
*
|
|
162
210
|
* Accepts `file://` URIs, bare filesystem paths, and (when built with the
|
|
163
211
|
* `aws-s3` feature, as the prebuilt npm binaries are) `s3://bucket/prefix/`.
|
|
212
|
+
* Local packages get the disk checks of `validatePath`. An `s3://` package
|
|
213
|
+
* has only its XML read: presence, size and hash checks are not run, and the
|
|
214
|
+
* result says so with an `IMFERNO:Package/DiskChecksNotRun` notice.
|
|
164
215
|
*
|
|
165
216
|
* @param uri - Path or URI to the IMP
|
|
166
217
|
* @param options - Optional validation options (plus `credentials` for S3)
|
|
@@ -168,3 +219,14 @@ export declare function validatePath(path: string, options?: PathValidateOptions
|
|
|
168
219
|
* @throws If the URI cannot be read or the options are invalid.
|
|
169
220
|
*/
|
|
170
221
|
export declare function validateUri(uri: string, options?: UriValidateOptions | undefined | null): ValidationResult
|
|
222
|
+
|
|
223
|
+
/**
|
|
224
|
+
* `validateUri` on the libuv thread pool: the event loop keeps running
|
|
225
|
+
* while the package is read and its assets are hashed. Same result as
|
|
226
|
+
* `validateUri`.
|
|
227
|
+
*
|
|
228
|
+
* @param uri - Path or URI to the IMP
|
|
229
|
+
* @param options - Optional validation options (plus `credentials` for S3)
|
|
230
|
+
* @returns A Promise of `{ package, validation }`; rejects where `validateUri` throws.
|
|
231
|
+
*/
|
|
232
|
+
export declare function validateUriAsync(uri: string, options?: UriValidateOptions | undefined | null): Promise<ValidationResult>
|
package/index.mjs
CHANGED
|
@@ -49,13 +49,18 @@ export const {
|
|
|
49
49
|
buildReport,
|
|
50
50
|
buildReportFromPath,
|
|
51
51
|
buildReportFromUri,
|
|
52
|
+
buildReportFromPathAsync,
|
|
53
|
+
buildReportFromUriAsync,
|
|
52
54
|
formatReport,
|
|
53
55
|
parsePackage,
|
|
54
56
|
parsePackageFromPath,
|
|
55
57
|
validate,
|
|
56
58
|
validatePath,
|
|
57
59
|
validateUri,
|
|
60
|
+
validatePathAsync,
|
|
61
|
+
validateUriAsync,
|
|
58
62
|
listRules,
|
|
63
|
+
toSarif,
|
|
59
64
|
} = nativeModule;
|
|
60
65
|
|
|
61
66
|
export { codes } from "./codes.mjs";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@imferno/node",
|
|
3
|
-
"version": "3.0.2-beta.
|
|
3
|
+
"version": "3.0.2-beta.2b20aac",
|
|
4
4
|
"description": "Native Node.js bindings for the imferno SMPTE ST 2067 IMF validator",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"module": "index.mjs",
|
|
@@ -45,12 +45,12 @@
|
|
|
45
45
|
"test": "vitest run"
|
|
46
46
|
},
|
|
47
47
|
"optionalDependencies": {
|
|
48
|
-
"@imferno/node-darwin-arm64": "3.0.2-beta.
|
|
49
|
-
"@imferno/node-darwin-x64": "3.0.2-beta.
|
|
50
|
-
"@imferno/node-linux-x64-gnu": "3.0.2-beta.
|
|
51
|
-
"@imferno/node-linux-arm64-gnu": "3.0.2-beta.
|
|
52
|
-
"@imferno/node-win32-x64-msvc": "3.0.2-beta.
|
|
53
|
-
"@imferno/node-win32-arm64-msvc": "3.0.2-beta.
|
|
48
|
+
"@imferno/node-darwin-arm64": "3.0.2-beta.2b20aac",
|
|
49
|
+
"@imferno/node-darwin-x64": "3.0.2-beta.2b20aac",
|
|
50
|
+
"@imferno/node-linux-x64-gnu": "3.0.2-beta.2b20aac",
|
|
51
|
+
"@imferno/node-linux-arm64-gnu": "3.0.2-beta.2b20aac",
|
|
52
|
+
"@imferno/node-win32-x64-msvc": "3.0.2-beta.2b20aac",
|
|
53
|
+
"@imferno/node-win32-arm64-msvc": "3.0.2-beta.2b20aac"
|
|
54
54
|
},
|
|
55
55
|
"publishConfig": {
|
|
56
56
|
"access": "public"
|
package/types.d.ts
CHANGED
|
@@ -6,6 +6,18 @@
|
|
|
6
6
|
* ship their own copy: the WASM build serialises some CPL fields in camelCase.
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
|
+
export type RuleValidationReason =
|
|
10
|
+
| {
|
|
11
|
+
kind: "unknown_source";
|
|
12
|
+
variant: string;
|
|
13
|
+
}
|
|
14
|
+
| {
|
|
15
|
+
kind: "matches_nothing";
|
|
16
|
+
}
|
|
17
|
+
| {
|
|
18
|
+
hint: string;
|
|
19
|
+
kind: "unsupported_pattern";
|
|
20
|
+
};
|
|
9
21
|
/**
|
|
10
22
|
* A SMPTE IMF UUID, serialised as a bare UUID string (e.g. "0eb3d1b9-b77b-4d3f-bbe5-7c69b15dca85")
|
|
11
23
|
*/
|
|
@@ -39,9 +51,30 @@ export type Severity = "Info" | "Warning" | "Error" | "Critical";
|
|
|
39
51
|
*
|
|
40
52
|
* Encodes 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.
|
|
41
53
|
*
|
|
42
|
-
*
|
|
54
|
+
* Derived from the rule's spec (`Spec::source`): `XSD` rules are `XsdLayer`, `IMFERNO` rules `EngineInternal`, SMPTE specs `ProseRule`.
|
|
43
55
|
*/
|
|
44
56
|
export type IssueSource = "XsdLayer" | "ProseRule" | "EngineInternal";
|
|
57
|
+
/**
|
|
58
|
+
* A document whose rules imferno checks.
|
|
59
|
+
*/
|
|
60
|
+
export type Spec =
|
|
61
|
+
| "ST377-1"
|
|
62
|
+
| "ST377-4"
|
|
63
|
+
| "ST429-8"
|
|
64
|
+
| "ST429-9"
|
|
65
|
+
| "ST2067-2"
|
|
66
|
+
| "ST2067-3"
|
|
67
|
+
| "ST2067-5"
|
|
68
|
+
| "ST2067-9"
|
|
69
|
+
| "ST2067-21"
|
|
70
|
+
| "ST2067-201"
|
|
71
|
+
| "ST2067-202"
|
|
72
|
+
| "XSD"
|
|
73
|
+
| "IMFERNO";
|
|
74
|
+
/**
|
|
75
|
+
* Normative strength of a rule in an edition's text.
|
|
76
|
+
*/
|
|
77
|
+
export type Strength = "shall" | "should" | "may" | "deprecated";
|
|
45
78
|
/**
|
|
46
79
|
* Validation profile determining strictness
|
|
47
80
|
*/
|
|
@@ -99,6 +132,7 @@ export type VideoCodec =
|
|
|
99
132
|
| "Jpeg2000Imf8k"
|
|
100
133
|
| "Jpeg2000Broadcast"
|
|
101
134
|
| "Jpeg2000Ht"
|
|
135
|
+
| "Jpeg2000HtNode"
|
|
102
136
|
| "Vc5"
|
|
103
137
|
| "Mpeg2"
|
|
104
138
|
| "H264"
|
|
@@ -195,6 +229,10 @@ export type RuleSeverity = "off" | "info" | "warn" | "error" | "critical";
|
|
|
195
229
|
export interface ImfReport {
|
|
196
230
|
cpls: CplReport[];
|
|
197
231
|
package: PackageSummary;
|
|
232
|
+
/**
|
|
233
|
+
* Keys of the `rules` option that select no rule (typos, unknown editions); they were ignored. Absent when every key matched.
|
|
234
|
+
*/
|
|
235
|
+
ruleWarnings?: RuleValidationWarning[];
|
|
198
236
|
validation: ValidationReport;
|
|
199
237
|
}
|
|
200
238
|
export interface CplReport {
|
|
@@ -285,6 +323,18 @@ export interface UnreferencedAsset {
|
|
|
285
323
|
id: string;
|
|
286
324
|
path: string;
|
|
287
325
|
}
|
|
326
|
+
/**
|
|
327
|
+
* A diagnostic about a `RulesConfig` key that the engine couldn't match.
|
|
328
|
+
*
|
|
329
|
+
* Produced by `RulesConfig::validate`. Operators can use these at config-load time to catch typos before any validation work runs.
|
|
330
|
+
*/
|
|
331
|
+
export interface RuleValidationWarning {
|
|
332
|
+
/**
|
|
333
|
+
* The configured key that triggered the warning.
|
|
334
|
+
*/
|
|
335
|
+
key: string;
|
|
336
|
+
reason: RuleValidationReason;
|
|
337
|
+
}
|
|
288
338
|
/**
|
|
289
339
|
* Comprehensive validation report
|
|
290
340
|
*/
|
|
@@ -326,16 +376,22 @@ export interface ValidationReport {
|
|
|
326
376
|
warnings: ValidationIssue[];
|
|
327
377
|
}
|
|
328
378
|
/**
|
|
329
|
-
* A single validation
|
|
379
|
+
* A single validation finding.
|
|
380
|
+
*
|
|
381
|
+
* Created only through `ValidationIssue::from_rule`: severity, category, clause and display code all come from the rule table row of the edition that was applied.
|
|
330
382
|
*/
|
|
331
383
|
export interface ValidationIssue {
|
|
332
384
|
/**
|
|
333
|
-
* 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
|
|
385
|
+
* 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.
|
|
334
386
|
*/
|
|
335
387
|
additional_instances?: Location[];
|
|
336
388
|
category: Category;
|
|
337
389
|
/**
|
|
338
|
-
*
|
|
390
|
+
* Clause of that edition the rule comes from (empty for pseudo-specs without clauses).
|
|
391
|
+
*/
|
|
392
|
+
clause: string;
|
|
393
|
+
/**
|
|
394
|
+
* Display code: `SPEC:EDITION:CLAUSE/Name`, with the edition actually applied (e.g. `ST2067-3:2016:7.2/SegmentDuration`).
|
|
339
395
|
*/
|
|
340
396
|
code: string;
|
|
341
397
|
/**
|
|
@@ -344,13 +400,23 @@ export interface ValidationIssue {
|
|
|
344
400
|
context: {
|
|
345
401
|
[k: string]: string | undefined;
|
|
346
402
|
};
|
|
403
|
+
/**
|
|
404
|
+
* Edition of the spec that was applied (`"2016"`; empty for single-edition pseudo-specs).
|
|
405
|
+
*/
|
|
406
|
+
edition: string;
|
|
347
407
|
location: Location;
|
|
348
408
|
/**
|
|
349
409
|
* Human-readable message
|
|
350
410
|
*/
|
|
351
411
|
message: string;
|
|
412
|
+
/**
|
|
413
|
+
* Stable, edition-free rule id (`ST2067-3/SegmentDuration`).
|
|
414
|
+
*/
|
|
415
|
+
rule: string;
|
|
352
416
|
severity: Severity;
|
|
353
|
-
source
|
|
417
|
+
source: IssueSource;
|
|
418
|
+
spec: Spec;
|
|
419
|
+
strength: Strength;
|
|
354
420
|
/**
|
|
355
421
|
* Suggestion for how to fix
|
|
356
422
|
*/
|
|
@@ -392,6 +458,10 @@ export interface Location {
|
|
|
392
458
|
* Segment index (0-based)
|
|
393
459
|
*/
|
|
394
460
|
segment?: number | null;
|
|
461
|
+
/**
|
|
462
|
+
* Segment Id (`urn:uuid:…`) if applicable
|
|
463
|
+
*/
|
|
464
|
+
segment_id?: string | null;
|
|
395
465
|
/**
|
|
396
466
|
* Sequence UUID if applicable
|
|
397
467
|
*/
|
|
@@ -486,10 +556,21 @@ export interface ChunkList {
|
|
|
486
556
|
* A single file path entry in a ChunkList.
|
|
487
557
|
*/
|
|
488
558
|
export interface Chunk {
|
|
559
|
+
/**
|
|
560
|
+
* `<Length>` in bytes, when present.
|
|
561
|
+
*/
|
|
562
|
+
length?: number | null;
|
|
563
|
+
/**
|
|
564
|
+
* `<Offset>` in bytes, when present.
|
|
565
|
+
*/
|
|
566
|
+
offset?: number | null;
|
|
489
567
|
/**
|
|
490
568
|
* File path relative to the IMP root directory.
|
|
491
569
|
*/
|
|
492
570
|
path: string;
|
|
571
|
+
/**
|
|
572
|
+
* `<VolumeIndex>`; 1 when absent.
|
|
573
|
+
*/
|
|
493
574
|
volumeIndex: number;
|
|
494
575
|
}
|
|
495
576
|
/**
|
|
@@ -1109,12 +1190,30 @@ export interface Resource {
|
|
|
1109
1190
|
Id: ImfUuid;
|
|
1110
1191
|
IntrinsicDuration: number;
|
|
1111
1192
|
KeyId?: ImfUuid | null;
|
|
1193
|
+
/**
|
|
1194
|
+
* `LeftEye` of a `cc:StereoImageTrackFileResourceType` resource (ST 2067-2:2013, :2016 and :2020). A stereo resource carries its SourceEncoding and TrackFileId per eye, not on the resource itself.
|
|
1195
|
+
*/
|
|
1196
|
+
LeftEye?: StereoEye | null;
|
|
1112
1197
|
Marker?: MarkerInfo[];
|
|
1113
1198
|
RepeatCount?: number | null;
|
|
1199
|
+
/**
|
|
1200
|
+
* `RightEye` of a `cc:StereoImageTrackFileResourceType` resource.
|
|
1201
|
+
*/
|
|
1202
|
+
RightEye?: StereoEye | null;
|
|
1114
1203
|
SourceDuration?: number | null;
|
|
1115
1204
|
SourceEncoding?: ImfUuid | null;
|
|
1116
1205
|
TrackFileId?: ImfUuid | null;
|
|
1117
1206
|
}
|
|
1207
|
+
/**
|
|
1208
|
+
* One eye of a stereo resource: a `cpl:TrackFileResourceType` (ST 2067-2). Only the track file reference fields are kept; the eye's timing fields are checked by the XSD layer.
|
|
1209
|
+
*/
|
|
1210
|
+
export interface StereoEye {
|
|
1211
|
+
Hash?: string | null;
|
|
1212
|
+
Id?: ImfUuid | null;
|
|
1213
|
+
KeyId?: ImfUuid | null;
|
|
1214
|
+
SourceEncoding?: ImfUuid | null;
|
|
1215
|
+
TrackFileId?: ImfUuid | null;
|
|
1216
|
+
}
|
|
1118
1217
|
export interface MarkerInfo {
|
|
1119
1218
|
Annotation?: string | null;
|
|
1120
1219
|
Label: MarkerLabelElement;
|
|
@@ -1294,13 +1393,86 @@ export interface VolumeIndex {
|
|
|
1294
1393
|
index: number;
|
|
1295
1394
|
}
|
|
1296
1395
|
/**
|
|
1297
|
-
*
|
|
1298
|
-
|
|
1299
|
-
|
|
1300
|
-
|
|
1301
|
-
|
|
1302
|
-
|
|
1303
|
-
|
|
1396
|
+
* Serializable rule description (`listRules()` entry).
|
|
1397
|
+
*/
|
|
1398
|
+
export interface RuleInfo {
|
|
1399
|
+
category: Category;
|
|
1400
|
+
/**
|
|
1401
|
+
* What the rule checks.
|
|
1402
|
+
*/
|
|
1403
|
+
description: string;
|
|
1404
|
+
/**
|
|
1405
|
+
* One row per edition of the spec imferno knows, oldest first.
|
|
1406
|
+
*/
|
|
1407
|
+
editions: EditionInfo[];
|
|
1408
|
+
/**
|
|
1409
|
+
* A minimal illustration of a violation.
|
|
1410
|
+
*/
|
|
1411
|
+
example?: string | null;
|
|
1412
|
+
/**
|
|
1413
|
+
* `<SPEC>/<Name>` — usable as a rules-config key (all editions).
|
|
1414
|
+
*/
|
|
1415
|
+
id: string;
|
|
1416
|
+
/**
|
|
1417
|
+
* Name, unique within the spec; usable as a rules-config key (every rule with that name).
|
|
1418
|
+
*/
|
|
1419
|
+
name: string;
|
|
1420
|
+
spec: Spec;
|
|
1421
|
+
}
|
|
1422
|
+
/**
|
|
1423
|
+
* Serializable edition row of a `RuleInfo`.
|
|
1424
|
+
*/
|
|
1425
|
+
export interface EditionInfo {
|
|
1426
|
+
/**
|
|
1427
|
+
* Clause in this edition; absent when the edition does not contain the rule.
|
|
1428
|
+
*/
|
|
1429
|
+
clause?: string | null;
|
|
1430
|
+
/**
|
|
1431
|
+
* Display code findings carry for this edition (`SPEC:EDITION:CLAUSE/Name`); absent when the edition does not contain the rule.
|
|
1432
|
+
*/
|
|
1433
|
+
code?: string | null;
|
|
1434
|
+
defaultSeverity: Severity;
|
|
1435
|
+
/**
|
|
1436
|
+
* Edition label (`"2016"`; empty for single-edition pseudo-specs).
|
|
1437
|
+
*/
|
|
1438
|
+
edition: string;
|
|
1439
|
+
/**
|
|
1440
|
+
* Interpretation the check follows.
|
|
1441
|
+
*/
|
|
1442
|
+
interpretation?: InterpretationInfo | null;
|
|
1443
|
+
/**
|
|
1444
|
+
* Why the default severity differs from the strength's.
|
|
1445
|
+
*/
|
|
1446
|
+
severityReason?: string | null;
|
|
1447
|
+
strength: Strength;
|
|
1448
|
+
/**
|
|
1449
|
+
* `false` while the strength is derived from the default severity.
|
|
1450
|
+
*/
|
|
1451
|
+
strengthVerified: boolean;
|
|
1452
|
+
/**
|
|
1453
|
+
* The clause is known or suspected to be wrong.
|
|
1454
|
+
*/
|
|
1455
|
+
suspect: boolean;
|
|
1456
|
+
/**
|
|
1457
|
+
* `true` only when the row was checked against this edition's text.
|
|
1458
|
+
*/
|
|
1459
|
+
verified: boolean;
|
|
1460
|
+
}
|
|
1461
|
+
/**
|
|
1462
|
+
* Serializable `Interpretation`.
|
|
1463
|
+
*/
|
|
1464
|
+
export interface InterpretationInfo {
|
|
1465
|
+
/**
|
|
1466
|
+
* What imferno does and why.
|
|
1467
|
+
*/
|
|
1468
|
+
text: string;
|
|
1469
|
+
/**
|
|
1470
|
+
* Link to the issue or finding.
|
|
1471
|
+
*/
|
|
1472
|
+
url?: string | null;
|
|
1473
|
+
}
|
|
1474
|
+
/**
|
|
1475
|
+
* ESLint-style per-rule severity overrides (see the module docs for the key forms and their precedence). An empty map (the default) is a no-op.
|
|
1304
1476
|
*/
|
|
1305
1477
|
export interface RulesConfig {
|
|
1306
1478
|
[k: string]: RuleSeverity | undefined;
|
|
@@ -1312,12 +1484,36 @@ export interface RulesConfig {
|
|
|
1312
1484
|
*/
|
|
1313
1485
|
export interface ValidationResult {
|
|
1314
1486
|
package: Imferno;
|
|
1487
|
+
/**
|
|
1488
|
+
* Keys of the `rules` option that select no rule (typos, unknown editions); they were ignored. Absent when every key matched.
|
|
1489
|
+
*/
|
|
1490
|
+
rule_warnings?: RuleValidationWarning[];
|
|
1315
1491
|
validation: ValidationReport;
|
|
1316
1492
|
}
|
|
1317
1493
|
|
|
1318
|
-
/**
|
|
1494
|
+
/**
|
|
1495
|
+
* Core constraints (ST 2067-2) edition to validate against. `"auto"` detects
|
|
1496
|
+
* it from the package and CPLs. A pinned edition also pins the editions it
|
|
1497
|
+
* cites (ST 2067-3, ST 2067-201 for IAB, ST 377-1/377-4 for MXF), over the
|
|
1498
|
+
* documents' namespaces, unless `cplSpec` / `iabSpec` pin those separately.
|
|
1499
|
+
*/
|
|
1319
1500
|
export type CoreSpec = "auto" | "v2013" | "v2016" | "v2020";
|
|
1320
1501
|
|
|
1502
|
+
/**
|
|
1503
|
+
* Composition Playlist (ST 2067-3) edition to validate against; wins over the
|
|
1504
|
+
* edition `coreSpec` implies. ST 2067-3:2016 and :2020 share one namespace;
|
|
1505
|
+
* `"auto"` applies the newest unless the CPL uses something only one edition
|
|
1506
|
+
* defines, and reports the choice.
|
|
1507
|
+
*/
|
|
1508
|
+
export type CplSpec = "auto" | "v2013" | "v2016" | "v2020";
|
|
1509
|
+
|
|
1510
|
+
/**
|
|
1511
|
+
* IAB plug-in (ST 2067-201) edition to validate against; wins over the edition
|
|
1512
|
+
* `coreSpec` implies. Every edition shares one namespace; `"auto"` applies
|
|
1513
|
+
* the newest and reports the choice.
|
|
1514
|
+
*/
|
|
1515
|
+
export type IabSpec = "auto" | "v2019" | "v2021" | "v2026";
|
|
1516
|
+
|
|
1321
1517
|
/**
|
|
1322
1518
|
* App #2E (ST 2067-21) edition to validate against. `"auto"` uses the CPL's
|
|
1323
1519
|
* ApplicationIdentification; `"none"` skips application-profile validation.
|
|
@@ -1328,6 +1524,10 @@ export type App2eSpec = "auto" | "none" | "v2014" | "v2016" | "v2020" | "v2023"
|
|
|
1328
1524
|
export interface ValidateOptions {
|
|
1329
1525
|
/** Core constraints edition. Default: `"auto"`. */
|
|
1330
1526
|
coreSpec?: CoreSpec;
|
|
1527
|
+
/** Composition Playlist (ST 2067-3) edition. Default: `"auto"`. */
|
|
1528
|
+
cplSpec?: CplSpec;
|
|
1529
|
+
/** IAB plug-in (ST 2067-201) edition. Default: `"auto"`. */
|
|
1530
|
+
iabSpec?: IabSpec;
|
|
1331
1531
|
/** App #2E edition. Default: `"auto"`. */
|
|
1332
1532
|
app2eSpec?: App2eSpec;
|
|
1333
1533
|
/** ESLint-style per-rule severity overrides, keyed by code, rule suffix, glob or `source:<kind>`. */
|