@imferno/node 3.0.2-fix-review-mca-audio-labels.4559e83 → 3.0.2-fix-review-cli-settings.8910c9e
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 +5 -1
- package/codes.d.ts +0 -10
- package/codes.js +0 -10
- package/index.d.ts +17 -4
- package/package.json +7 -7
- package/types.d.ts +28 -24
package/README.md
CHANGED
|
@@ -127,9 +127,13 @@ console.log(getVersion()); // e.g. "2.0.0"
|
|
|
127
127
|
| `app2eSpec` | `"auto" \| "none" \| "v2014" \| "v2016" \| "v2020" \| "v2023" \| "v2026"` | Application spec version |
|
|
128
128
|
| `rules` | `Record<string, "off" \| "info" \| "warn" \| "error" \| "critical">` | ESLint-style per-rule severity overrides |
|
|
129
129
|
| `aggregateRepeats` | `boolean` | Collapse repeated identical findings into one issue with `additional_instances` |
|
|
130
|
-
| `skipDiskChecks` | `boolean` | Skip
|
|
130
|
+
| `skipDiskChecks` | `boolean` | Skip every disk read: asset existence, size and hash checks and MXF checks (path / URI functions only; in-memory input never touches disk) |
|
|
131
|
+
| `skipHashes` | `boolean` | Skip hashing the assets; existence and size are still checked (path / URI functions only). Hashes are verified by default, like the CLI |
|
|
131
132
|
| `credentials` | `S3Credentials \| null` | Explicit S3 credentials (URI functions only) |
|
|
132
133
|
|
|
134
|
+
An option the function does not accept, or a value of the wrong type, throws
|
|
135
|
+
(`null` means not set).
|
|
136
|
+
|
|
133
137
|
### TypeScript
|
|
134
138
|
|
|
135
139
|
The package ships precise declarations, generated from the Rust types (no
|
package/codes.d.ts
CHANGED
|
@@ -12,9 +12,6 @@ export declare const codes: {
|
|
|
12
12
|
readonly ST377_4: {
|
|
13
13
|
readonly MCALinkIDMissing: "ST377-4/MCALinkIDMissing";
|
|
14
14
|
readonly SoundfieldGroupLinkIDMismatch: "ST377-4/SoundfieldGroupLinkIDMismatch";
|
|
15
|
-
readonly MCALinkIDNotUnique: "ST377-4/MCALinkIDNotUnique";
|
|
16
|
-
readonly MCATagSymbolSyntax: "ST377-4/MCATagSymbolSyntax";
|
|
17
|
-
readonly SoundfieldGroupUnreferenced: "ST377-4/SoundfieldGroupUnreferenced";
|
|
18
15
|
};
|
|
19
16
|
readonly ST429_8: {
|
|
20
17
|
readonly SizeMismatch: "ST429-8/SizeMismatch";
|
|
@@ -75,13 +72,6 @@ export declare const codes: {
|
|
|
75
72
|
readonly SoundfieldGroupMissingMCATitleVersion: "ST2067-2/SoundfieldGroupMissingMCATitleVersion";
|
|
76
73
|
readonly SoundfieldGroupMissingMCAAudioContentKind: "ST2067-2/SoundfieldGroupMissingMCAAudioContentKind";
|
|
77
74
|
readonly SoundfieldGroupMissingMCAAudioElementKind: "ST2067-2/SoundfieldGroupMissingMCAAudioElementKind";
|
|
78
|
-
readonly MCATagNameMissing: "ST2067-2/MCATagNameMissing";
|
|
79
|
-
readonly GroupOfSoundfieldGroupsMissingMCATitle: "ST2067-2/GroupOfSoundfieldGroupsMissingMCATitle";
|
|
80
|
-
readonly GroupOfSoundfieldGroupsMissingMCATitleVersion: "ST2067-2/GroupOfSoundfieldGroupsMissingMCATitleVersion";
|
|
81
|
-
readonly GroupOfSoundfieldGroupsMissingMCAAudioContentKind: "ST2067-2/GroupOfSoundfieldGroupsMissingMCAAudioContentKind";
|
|
82
|
-
readonly GroupOfSoundfieldGroupsMissingMCAAudioElementKind: "ST2067-2/GroupOfSoundfieldGroupsMissingMCAAudioElementKind";
|
|
83
|
-
readonly AudioEssenceNotHomogeneous: "ST2067-2/AudioEssenceNotHomogeneous";
|
|
84
|
-
readonly AudioVirtualTrackLabelsDiffer: "ST2067-2/AudioVirtualTrackLabelsDiffer";
|
|
85
75
|
readonly TimedTextUCSEncodingNotUTF8: "ST2067-2/TimedTextUCSEncodingNotUTF8";
|
|
86
76
|
readonly TimedTextNamespaceNotIMSC: "ST2067-2/TimedTextNamespaceNotIMSC";
|
|
87
77
|
readonly TimedTextResourceMIMETypeUnsupported: "ST2067-2/TimedTextResourceMIMETypeUnsupported";
|
package/codes.js
CHANGED
|
@@ -12,9 +12,6 @@ const codes = {
|
|
|
12
12
|
ST377_4: {
|
|
13
13
|
MCALinkIDMissing: "ST377-4/MCALinkIDMissing",
|
|
14
14
|
SoundfieldGroupLinkIDMismatch: "ST377-4/SoundfieldGroupLinkIDMismatch",
|
|
15
|
-
MCALinkIDNotUnique: "ST377-4/MCALinkIDNotUnique",
|
|
16
|
-
MCATagSymbolSyntax: "ST377-4/MCATagSymbolSyntax",
|
|
17
|
-
SoundfieldGroupUnreferenced: "ST377-4/SoundfieldGroupUnreferenced",
|
|
18
15
|
},
|
|
19
16
|
ST429_8: {
|
|
20
17
|
SizeMismatch: "ST429-8/SizeMismatch",
|
|
@@ -75,13 +72,6 @@ const codes = {
|
|
|
75
72
|
SoundfieldGroupMissingMCATitleVersion: "ST2067-2/SoundfieldGroupMissingMCATitleVersion",
|
|
76
73
|
SoundfieldGroupMissingMCAAudioContentKind: "ST2067-2/SoundfieldGroupMissingMCAAudioContentKind",
|
|
77
74
|
SoundfieldGroupMissingMCAAudioElementKind: "ST2067-2/SoundfieldGroupMissingMCAAudioElementKind",
|
|
78
|
-
MCATagNameMissing: "ST2067-2/MCATagNameMissing",
|
|
79
|
-
GroupOfSoundfieldGroupsMissingMCATitle: "ST2067-2/GroupOfSoundfieldGroupsMissingMCATitle",
|
|
80
|
-
GroupOfSoundfieldGroupsMissingMCATitleVersion: "ST2067-2/GroupOfSoundfieldGroupsMissingMCATitleVersion",
|
|
81
|
-
GroupOfSoundfieldGroupsMissingMCAAudioContentKind: "ST2067-2/GroupOfSoundfieldGroupsMissingMCAAudioContentKind",
|
|
82
|
-
GroupOfSoundfieldGroupsMissingMCAAudioElementKind: "ST2067-2/GroupOfSoundfieldGroupsMissingMCAAudioElementKind",
|
|
83
|
-
AudioEssenceNotHomogeneous: "ST2067-2/AudioEssenceNotHomogeneous",
|
|
84
|
-
AudioVirtualTrackLabelsDiffer: "ST2067-2/AudioVirtualTrackLabelsDiffer",
|
|
85
75
|
TimedTextUCSEncodingNotUTF8: "ST2067-2/TimedTextUCSEncodingNotUTF8",
|
|
86
76
|
TimedTextNamespaceNotIMSC: "ST2067-2/TimedTextNamespaceNotIMSC",
|
|
87
77
|
TimedTextResourceMIMETypeUnsupported: "ST2067-2/TimedTextResourceMIMETypeUnsupported",
|
package/index.d.ts
CHANGED
|
@@ -15,8 +15,16 @@ export { codes } from "./codes";
|
|
|
15
15
|
|
|
16
16
|
/** Options for validating a package on disk (`validatePath`, `buildReportFromPath`). */
|
|
17
17
|
export interface PathValidateOptions extends ValidateOptions {
|
|
18
|
-
/**
|
|
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
|
+
*/
|
|
19
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;
|
|
20
28
|
}
|
|
21
29
|
|
|
22
30
|
/** Explicit S3 credentials for `s3://` URIs. Omit to use the default AWS credential chain. */
|
|
@@ -59,7 +67,7 @@ export declare function buildReport(files: Record<string, string>, options?: Val
|
|
|
59
67
|
* `ImfReport` summary. Prefer `validatePath` for new code.
|
|
60
68
|
*
|
|
61
69
|
* @param path - Path to the IMP directory
|
|
62
|
-
* @param options - Optional validation options (`coreSpec`, `cplSpec`, `iabSpec`, `app2eSpec`, `skipDiskChecks`, `rules`, `aggregateRepeats`)
|
|
70
|
+
* @param options - Optional validation options (`coreSpec`, `cplSpec`, `iabSpec`, `app2eSpec`, `skipDiskChecks`, `skipHashes`, `rules`, `aggregateRepeats`)
|
|
63
71
|
* @returns An `ImfReport` with `package`, `cpls`, and `validation` fields.
|
|
64
72
|
* @throws If the directory cannot be read, the package cannot be parsed, or the options are invalid.
|
|
65
73
|
*/
|
|
@@ -139,17 +147,22 @@ export declare function toSarif(report: ValidationResult | ValidationReport): Sa
|
|
|
139
147
|
* @param files - A map of filename to XML content
|
|
140
148
|
* @param options - Optional validation options
|
|
141
149
|
* @returns `{ package, validation }` — the full parsed package and all findings.
|
|
142
|
-
* @throws Only if the options are invalid.
|
|
150
|
+
* @throws Only if the options are invalid (wrong type, unknown key).
|
|
143
151
|
*/
|
|
144
152
|
export declare function validate(files: Record<string, string>, options?: ValidateOptions | undefined | null): ValidationResult
|
|
145
153
|
|
|
146
154
|
/**
|
|
147
155
|
* Parse and validate an IMF package directory on disk.
|
|
148
156
|
*
|
|
157
|
+
* Like the CLI, checks every asset's presence and size and hashes it against
|
|
158
|
+
* its Packing List `<Hash>` unless `skipHashes` (or `skipDiskChecks`) is set.
|
|
159
|
+
* Hashing reads every asset and blocks until done.
|
|
160
|
+
*
|
|
149
161
|
* @param path - Path to the IMP directory
|
|
150
162
|
* @param options - Optional validation options
|
|
151
163
|
* @returns `{ package, validation }` — the full parsed package and all findings.
|
|
152
|
-
* @throws If the directory cannot be read or the options are invalid
|
|
164
|
+
* @throws If the directory cannot be read or the options are invalid
|
|
165
|
+
* (wrong type, unknown key).
|
|
153
166
|
*/
|
|
154
167
|
export declare function validatePath(path: string, options?: PathValidateOptions | undefined | null): ValidationResult
|
|
155
168
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@imferno/node",
|
|
3
|
-
"version": "3.0.2-fix-review-
|
|
3
|
+
"version": "3.0.2-fix-review-cli-settings.8910c9e",
|
|
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-fix-review-
|
|
49
|
-
"@imferno/node-darwin-x64": "3.0.2-fix-review-
|
|
50
|
-
"@imferno/node-linux-x64-gnu": "3.0.2-fix-review-
|
|
51
|
-
"@imferno/node-linux-arm64-gnu": "3.0.2-fix-review-
|
|
52
|
-
"@imferno/node-win32-x64-msvc": "3.0.2-fix-review-
|
|
53
|
-
"@imferno/node-win32-arm64-msvc": "3.0.2-fix-review-
|
|
48
|
+
"@imferno/node-darwin-arm64": "3.0.2-fix-review-cli-settings.8910c9e",
|
|
49
|
+
"@imferno/node-darwin-x64": "3.0.2-fix-review-cli-settings.8910c9e",
|
|
50
|
+
"@imferno/node-linux-x64-gnu": "3.0.2-fix-review-cli-settings.8910c9e",
|
|
51
|
+
"@imferno/node-linux-arm64-gnu": "3.0.2-fix-review-cli-settings.8910c9e",
|
|
52
|
+
"@imferno/node-win32-x64-msvc": "3.0.2-fix-review-cli-settings.8910c9e",
|
|
53
|
+
"@imferno/node-win32-arm64-msvc": "3.0.2-fix-review-cli-settings.8910c9e"
|
|
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
|
*/
|
|
@@ -206,18 +218,6 @@ export type MimeType =
|
|
|
206
218
|
* Mirrors ESLint's `"off"` / `"warn"` / `"error"` vocabulary, extended with the two IMF severity levels.
|
|
207
219
|
*/
|
|
208
220
|
export type RuleSeverity = "off" | "info" | "warn" | "error" | "critical";
|
|
209
|
-
export type RuleValidationReason =
|
|
210
|
-
| {
|
|
211
|
-
kind: "unknown_source";
|
|
212
|
-
variant: string;
|
|
213
|
-
}
|
|
214
|
-
| {
|
|
215
|
-
kind: "matches_nothing";
|
|
216
|
-
}
|
|
217
|
-
| {
|
|
218
|
-
hint: string;
|
|
219
|
-
kind: "unsupported_pattern";
|
|
220
|
-
};
|
|
221
221
|
|
|
222
222
|
/**
|
|
223
223
|
* @deprecated
|
|
@@ -228,6 +228,10 @@ export type RuleValidationReason =
|
|
|
228
228
|
export interface ImfReport {
|
|
229
229
|
cpls: CplReport[];
|
|
230
230
|
package: PackageSummary;
|
|
231
|
+
/**
|
|
232
|
+
* Keys of the `rules` option that select no rule (typos, unknown editions); they were ignored. Absent when every key matched.
|
|
233
|
+
*/
|
|
234
|
+
ruleWarnings?: RuleValidationWarning[];
|
|
231
235
|
validation: ValidationReport;
|
|
232
236
|
}
|
|
233
237
|
export interface CplReport {
|
|
@@ -318,6 +322,18 @@ export interface UnreferencedAsset {
|
|
|
318
322
|
id: string;
|
|
319
323
|
path: string;
|
|
320
324
|
}
|
|
325
|
+
/**
|
|
326
|
+
* A diagnostic about a `RulesConfig` key that the engine couldn't match.
|
|
327
|
+
*
|
|
328
|
+
* Produced by `RulesConfig::validate`. Operators can use these at config-load time to catch typos before any validation work runs.
|
|
329
|
+
*/
|
|
330
|
+
export interface RuleValidationWarning {
|
|
331
|
+
/**
|
|
332
|
+
* The configured key that triggered the warning.
|
|
333
|
+
*/
|
|
334
|
+
key: string;
|
|
335
|
+
reason: RuleValidationReason;
|
|
336
|
+
}
|
|
321
337
|
/**
|
|
322
338
|
* Comprehensive validation report
|
|
323
339
|
*/
|
|
@@ -1444,18 +1460,6 @@ export interface ValidationResult {
|
|
|
1444
1460
|
rule_warnings?: RuleValidationWarning[];
|
|
1445
1461
|
validation: ValidationReport;
|
|
1446
1462
|
}
|
|
1447
|
-
/**
|
|
1448
|
-
* A diagnostic about a `RulesConfig` key that the engine couldn't match.
|
|
1449
|
-
*
|
|
1450
|
-
* Produced by `RulesConfig::validate`. Operators can use these at config-load time to catch typos before any validation work runs.
|
|
1451
|
-
*/
|
|
1452
|
-
export interface RuleValidationWarning {
|
|
1453
|
-
/**
|
|
1454
|
-
* The configured key that triggered the warning.
|
|
1455
|
-
*/
|
|
1456
|
-
key: string;
|
|
1457
|
-
reason: RuleValidationReason;
|
|
1458
|
-
}
|
|
1459
1463
|
|
|
1460
1464
|
/**
|
|
1461
1465
|
* Core constraints (ST 2067-2) edition to validate against. `"auto"` detects
|