@imferno/node 3.0.2-fix-review-extension-sequences.45e90ea → 3.0.2-fix-review-cli-settings.b024e0d
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 +22 -2
- package/codes.d.ts +11 -4
- package/codes.js +11 -4
- package/index.d.ts +71 -6
- package/index.mjs +4 -0
- package/package.json +7 -7
- package/types.d.ts +29 -43
package/README.md
CHANGED
|
@@ -35,6 +35,19 @@ for (const issue of validation.errors) {
|
|
|
35
35
|
console.log("CPLs:", Object.keys(pkg.compositionPlaylists).length);
|
|
36
36
|
```
|
|
37
37
|
|
|
38
|
+
`validatePath` hashes every asset (several at a time, like the CLI) and
|
|
39
|
+
blocks until done. To keep the event loop running, use the async variant:
|
|
40
|
+
same arguments, same result, on the libuv thread pool.
|
|
41
|
+
|
|
42
|
+
```ts
|
|
43
|
+
import { validatePathAsync } from "@imferno/node";
|
|
44
|
+
|
|
45
|
+
const { validation } = await validatePathAsync("./my-imp");
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
`validateUriAsync`, `buildReportFromPathAsync` and `buildReportFromUriAsync`
|
|
49
|
+
work the same way.
|
|
50
|
+
|
|
38
51
|
### Validate from a URI (filesystem or S3)
|
|
39
52
|
|
|
40
53
|
```js
|
|
@@ -46,6 +59,8 @@ const result2 = validateUri("file:///abs/path/to/my-imp");
|
|
|
46
59
|
|
|
47
60
|
// S3 — prebuilt npm binaries include S3 support; uses the default AWS
|
|
48
61
|
// credential chain (env vars, profile, or EC2/ECS/EKS IMDS)
|
|
62
|
+
// Only the XML is read from S3: presence, size and hash checks do not run,
|
|
63
|
+
// and the result says so (IMFERNO:Package/DiskChecksNotRun).
|
|
49
64
|
const result3 = validateUri("s3://my-bucket/path/to/imp/");
|
|
50
65
|
|
|
51
66
|
// Same options object as validatePath
|
|
@@ -127,13 +142,18 @@ console.log(getVersion()); // e.g. "2.0.0"
|
|
|
127
142
|
| `app2eSpec` | `"auto" \| "none" \| "v2014" \| "v2016" \| "v2020" \| "v2023" \| "v2026"` | Application spec version |
|
|
128
143
|
| `rules` | `Record<string, "off" \| "info" \| "warn" \| "error" \| "critical">` | ESLint-style per-rule severity overrides |
|
|
129
144
|
| `aggregateRepeats` | `boolean` | Collapse repeated identical findings into one issue with `additional_instances` |
|
|
130
|
-
| `skipDiskChecks` | `boolean` | Skip
|
|
145
|
+
| `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) |
|
|
146
|
+
| `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
147
|
| `credentials` | `S3Credentials \| null` | Explicit S3 credentials (URI functions only) |
|
|
132
148
|
|
|
149
|
+
An option the function does not accept, or a value of the wrong type, throws
|
|
150
|
+
(`null` and `undefined` mean not set, for every key).
|
|
151
|
+
|
|
133
152
|
### TypeScript
|
|
134
153
|
|
|
135
154
|
The package ships precise declarations, generated from the Rust types (no
|
|
136
|
-
`any`). Every function is synchronous
|
|
155
|
+
`any`). Every function is synchronous, except the `…Async` variants, which
|
|
156
|
+
return a Promise. All value types are exported from the
|
|
137
157
|
main entry:
|
|
138
158
|
|
|
139
159
|
```ts
|
package/codes.d.ts
CHANGED
|
@@ -12,6 +12,9 @@ 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";
|
|
15
18
|
};
|
|
16
19
|
readonly ST429_8: {
|
|
17
20
|
readonly SizeMismatch: "ST429-8/SizeMismatch";
|
|
@@ -72,6 +75,13 @@ export declare const codes: {
|
|
|
72
75
|
readonly SoundfieldGroupMissingMCATitleVersion: "ST2067-2/SoundfieldGroupMissingMCATitleVersion";
|
|
73
76
|
readonly SoundfieldGroupMissingMCAAudioContentKind: "ST2067-2/SoundfieldGroupMissingMCAAudioContentKind";
|
|
74
77
|
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";
|
|
75
85
|
readonly TimedTextUCSEncodingNotUTF8: "ST2067-2/TimedTextUCSEncodingNotUTF8";
|
|
76
86
|
readonly TimedTextNamespaceNotIMSC: "ST2067-2/TimedTextNamespaceNotIMSC";
|
|
77
87
|
readonly TimedTextResourceMIMETypeUnsupported: "ST2067-2/TimedTextResourceMIMETypeUnsupported";
|
|
@@ -104,9 +114,6 @@ export declare const codes: {
|
|
|
104
114
|
readonly RepeatCount: "ST2067-3/RepeatCount";
|
|
105
115
|
readonly TrackFileId: "ST2067-3/TrackFileId";
|
|
106
116
|
readonly VirtualTrackContinuity: "ST2067-3/VirtualTrackContinuity";
|
|
107
|
-
readonly VirtualTrackSequenceKind: "ST2067-3/VirtualTrackSequenceKind";
|
|
108
|
-
readonly ResourceTypeMixed: "ST2067-3/ResourceTypeMixed";
|
|
109
|
-
readonly MarkerSequenceResourceType: "ST2067-3/MarkerSequenceResourceType";
|
|
110
117
|
readonly DanglingEssenceDescriptor: "ST2067-3/DanglingEssenceDescriptor";
|
|
111
118
|
};
|
|
112
119
|
readonly ST2067_5: {
|
|
@@ -236,12 +243,12 @@ export declare const codes: {
|
|
|
236
243
|
readonly NotValidated: "XSD/NotValidated";
|
|
237
244
|
};
|
|
238
245
|
readonly IMFERNO: {
|
|
239
|
-
readonly ExtensionSequenceNotValidated: "IMFERNO/ExtensionSequenceNotValidated";
|
|
240
246
|
readonly EditionAssumed: "IMFERNO/EditionAssumed";
|
|
241
247
|
readonly EditionConflict: "IMFERNO/EditionConflict";
|
|
242
248
|
readonly EditionPinned: "IMFERNO/EditionPinned";
|
|
243
249
|
readonly PinNotApplied: "IMFERNO/PinNotApplied";
|
|
244
250
|
readonly DeliveryNotChecked: "IMFERNO/DeliveryNotChecked";
|
|
251
|
+
readonly DiskChecksNotRun: "IMFERNO/DiskChecksNotRun";
|
|
245
252
|
readonly OpenFailed: "IMFERNO/OpenFailed";
|
|
246
253
|
readonly PartitionPackParseFailed: "IMFERNO/PartitionPackParseFailed";
|
|
247
254
|
readonly RegXmlConversionFailed: "IMFERNO/RegXmlConversionFailed";
|
package/codes.js
CHANGED
|
@@ -12,6 +12,9 @@ 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",
|
|
15
18
|
},
|
|
16
19
|
ST429_8: {
|
|
17
20
|
SizeMismatch: "ST429-8/SizeMismatch",
|
|
@@ -72,6 +75,13 @@ const codes = {
|
|
|
72
75
|
SoundfieldGroupMissingMCATitleVersion: "ST2067-2/SoundfieldGroupMissingMCATitleVersion",
|
|
73
76
|
SoundfieldGroupMissingMCAAudioContentKind: "ST2067-2/SoundfieldGroupMissingMCAAudioContentKind",
|
|
74
77
|
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",
|
|
75
85
|
TimedTextUCSEncodingNotUTF8: "ST2067-2/TimedTextUCSEncodingNotUTF8",
|
|
76
86
|
TimedTextNamespaceNotIMSC: "ST2067-2/TimedTextNamespaceNotIMSC",
|
|
77
87
|
TimedTextResourceMIMETypeUnsupported: "ST2067-2/TimedTextResourceMIMETypeUnsupported",
|
|
@@ -104,9 +114,6 @@ const codes = {
|
|
|
104
114
|
RepeatCount: "ST2067-3/RepeatCount",
|
|
105
115
|
TrackFileId: "ST2067-3/TrackFileId",
|
|
106
116
|
VirtualTrackContinuity: "ST2067-3/VirtualTrackContinuity",
|
|
107
|
-
VirtualTrackSequenceKind: "ST2067-3/VirtualTrackSequenceKind",
|
|
108
|
-
ResourceTypeMixed: "ST2067-3/ResourceTypeMixed",
|
|
109
|
-
MarkerSequenceResourceType: "ST2067-3/MarkerSequenceResourceType",
|
|
110
117
|
DanglingEssenceDescriptor: "ST2067-3/DanglingEssenceDescriptor",
|
|
111
118
|
},
|
|
112
119
|
ST2067_5: {
|
|
@@ -236,12 +243,12 @@ const codes = {
|
|
|
236
243
|
NotValidated: "XSD/NotValidated",
|
|
237
244
|
},
|
|
238
245
|
IMFERNO: {
|
|
239
|
-
ExtensionSequenceNotValidated: "IMFERNO/ExtensionSequenceNotValidated",
|
|
240
246
|
EditionAssumed: "IMFERNO/EditionAssumed",
|
|
241
247
|
EditionConflict: "IMFERNO/EditionConflict",
|
|
242
248
|
EditionPinned: "IMFERNO/EditionPinned",
|
|
243
249
|
PinNotApplied: "IMFERNO/PinNotApplied",
|
|
244
250
|
DeliveryNotChecked: "IMFERNO/DeliveryNotChecked",
|
|
251
|
+
DiskChecksNotRun: "IMFERNO/DiskChecksNotRun",
|
|
245
252
|
OpenFailed: "IMFERNO/OpenFailed",
|
|
246
253
|
PartitionPackParseFailed: "IMFERNO/PartitionPackParseFailed",
|
|
247
254
|
RegXmlConversionFailed: "IMFERNO/RegXmlConversionFailed",
|
package/index.d.ts
CHANGED
|
@@ -13,10 +13,18 @@ import type {
|
|
|
13
13
|
export * from "./types";
|
|
14
14
|
export { codes } from "./codes";
|
|
15
15
|
|
|
16
|
-
/** Options for validating a package on disk (`validatePath`, `buildReportFromPath`). */
|
|
16
|
+
/** Options for validating a package on disk (`validatePath`, `buildReportFromPath` and their `…Async` variants). */
|
|
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. */
|
|
@@ -28,7 +36,12 @@ export interface S3Credentials {
|
|
|
28
36
|
endpoint?: string;
|
|
29
37
|
}
|
|
30
38
|
|
|
31
|
-
/**
|
|
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
|
+
*/
|
|
32
45
|
export interface UriValidateOptions extends PathValidateOptions {
|
|
33
46
|
/** Ignored for filesystem URIs. */
|
|
34
47
|
credentials?: S3Credentials | null;
|
|
@@ -58,13 +71,26 @@ export declare function buildReport(files: Record<string, string>, options?: Val
|
|
|
58
71
|
* Validate an IMF package directory on disk, returning the legacy
|
|
59
72
|
* `ImfReport` summary. Prefer `validatePath` for new code.
|
|
60
73
|
*
|
|
74
|
+
* Hashes the assets in parallel and blocks until done; see
|
|
75
|
+
* `buildReportFromPathAsync`.
|
|
76
|
+
*
|
|
61
77
|
* @param path - Path to the IMP directory
|
|
62
|
-
* @param options - Optional validation options (`coreSpec`, `cplSpec`, `iabSpec`, `app2eSpec`, `skipDiskChecks`, `rules`, `aggregateRepeats`)
|
|
78
|
+
* @param options - Optional validation options (`coreSpec`, `cplSpec`, `iabSpec`, `app2eSpec`, `skipDiskChecks`, `skipHashes`, `rules`, `aggregateRepeats`)
|
|
63
79
|
* @returns An `ImfReport` with `package`, `cpls`, and `validation` fields.
|
|
64
80
|
* @throws If the directory cannot be read, the package cannot be parsed, or the options are invalid.
|
|
65
81
|
*/
|
|
66
82
|
export declare function buildReportFromPath(path: string, options?: PathValidateOptions | undefined | null): ImfReport
|
|
67
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
|
+
|
|
68
94
|
/**
|
|
69
95
|
* Build the legacy `ImfReport` summary from a URI. Accepts the same URI forms
|
|
70
96
|
* as `validateUri`; prefer `validateUri` for new code.
|
|
@@ -76,6 +102,15 @@ export declare function buildReportFromPath(path: string, options?: PathValidate
|
|
|
76
102
|
*/
|
|
77
103
|
export declare function buildReportFromUri(uri: string, options?: UriValidateOptions | undefined | null): ImfReport
|
|
78
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
|
+
|
|
79
114
|
/**
|
|
80
115
|
* Pretty-print a validation result as a human-readable string.
|
|
81
116
|
*
|
|
@@ -139,25 +174,44 @@ export declare function toSarif(report: ValidationResult | ValidationReport): Sa
|
|
|
139
174
|
* @param files - A map of filename to XML content
|
|
140
175
|
* @param options - Optional validation options
|
|
141
176
|
* @returns `{ package, validation }` — the full parsed package and all findings.
|
|
142
|
-
* @throws Only if the options are invalid.
|
|
177
|
+
* @throws Only if the options are invalid (wrong type, unknown key).
|
|
143
178
|
*/
|
|
144
179
|
export declare function validate(files: Record<string, string>, options?: ValidateOptions | undefined | null): ValidationResult
|
|
145
180
|
|
|
146
181
|
/**
|
|
147
182
|
* Parse and validate an IMF package directory on disk.
|
|
148
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
|
+
*
|
|
149
189
|
* @param path - Path to the IMP directory
|
|
150
190
|
* @param options - Optional validation options
|
|
151
191
|
* @returns `{ package, validation }` — the full parsed package and all findings.
|
|
152
|
-
* @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).
|
|
153
194
|
*/
|
|
154
195
|
export declare function validatePath(path: string, options?: PathValidateOptions | undefined | null): ValidationResult
|
|
155
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
|
+
|
|
156
207
|
/**
|
|
157
208
|
* Parse and validate an IMF package from a URI.
|
|
158
209
|
*
|
|
159
210
|
* Accepts `file://` URIs, bare filesystem paths, and (when built with the
|
|
160
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.
|
|
161
215
|
*
|
|
162
216
|
* @param uri - Path or URI to the IMP
|
|
163
217
|
* @param options - Optional validation options (plus `credentials` for S3)
|
|
@@ -165,3 +219,14 @@ export declare function validatePath(path: string, options?: PathValidateOptions
|
|
|
165
219
|
* @throws If the URI cannot be read or the options are invalid.
|
|
166
220
|
*/
|
|
167
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,12 +49,16 @@ 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,
|
|
59
63
|
toSarif,
|
|
60
64
|
} = nativeModule;
|
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.b024e0d",
|
|
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.b024e0d",
|
|
49
|
+
"@imferno/node-darwin-x64": "3.0.2-fix-review-cli-settings.b024e0d",
|
|
50
|
+
"@imferno/node-linux-x64-gnu": "3.0.2-fix-review-cli-settings.b024e0d",
|
|
51
|
+
"@imferno/node-linux-arm64-gnu": "3.0.2-fix-review-cli-settings.b024e0d",
|
|
52
|
+
"@imferno/node-win32-x64-msvc": "3.0.2-fix-review-cli-settings.b024e0d",
|
|
53
|
+
"@imferno/node-win32-arm64-msvc": "3.0.2-fix-review-cli-settings.b024e0d"
|
|
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
|
*/
|
|
@@ -338,10 +354,6 @@ export interface ValidationReport {
|
|
|
338
354
|
* Whether the package is compliant with base SMPTE standards
|
|
339
355
|
*/
|
|
340
356
|
is_compliant: boolean;
|
|
341
|
-
/**
|
|
342
|
-
* Whether everything in the package was validated. False when a finding says part of it was not (e.g. `IMFERNO:Cpl/ExtensionSequenceNotValidated` for S-ADM audio): then `is_compliant` only covers what was checked.
|
|
343
|
-
*/
|
|
344
|
-
is_fully_validated: boolean;
|
|
345
357
|
/**
|
|
346
358
|
* Whether the package is playable despite issues
|
|
347
359
|
*/
|
|
@@ -1141,10 +1153,6 @@ export interface Segment {
|
|
|
1141
1153
|
SequenceList: SequenceList;
|
|
1142
1154
|
}
|
|
1143
1155
|
export interface SequenceList {
|
|
1144
|
-
/**
|
|
1145
|
-
* Sequences whose element imferno does not model (ST 2067-3 §6.9.3 Extension Sequences, e.g. ST 2067-203 `MGASADMSignalSequence` or ST 2067-2 `CommentarySequence`), in document order. Filled by `parse_cpl` from the source XML so their EssenceDescriptor and Track File references resolve; no other rules are applied to them.
|
|
1146
|
-
*/
|
|
1147
|
-
ExtensionSequence?: ExtensionSequence[];
|
|
1148
1156
|
ForcedNarrativeSequence?: ForcedNarrativeSequence[];
|
|
1149
1157
|
HearingImpairedCaptionsSequence?: HearingImpairedCaptionsSequence[];
|
|
1150
1158
|
IABSequence?: IABSequence[];
|
|
@@ -1154,13 +1162,8 @@ export interface SequenceList {
|
|
|
1154
1162
|
MarkerSequence?: MarkerSequence[];
|
|
1155
1163
|
SubtitlesSequence?: SubtitlesSequence[];
|
|
1156
1164
|
}
|
|
1157
|
-
|
|
1158
|
-
* A Sequence of a kind imferno does not model (ST 2067-3 §6.9.3 Extension Sequence). Every Sequence derives from SequenceType, so its Id, TrackId and Resources are kept; the element is named by `name` (local name) and `namespace` (namespace URI, `None` when unbound).
|
|
1159
|
-
*/
|
|
1160
|
-
export interface ExtensionSequence {
|
|
1165
|
+
export interface ForcedNarrativeSequence {
|
|
1161
1166
|
Id: ImfUuid;
|
|
1162
|
-
Name?: string;
|
|
1163
|
-
Namespace?: string | null;
|
|
1164
1167
|
ResourceList: ResourceList;
|
|
1165
1168
|
TrackId: ImfUuid;
|
|
1166
1169
|
}
|
|
@@ -1186,11 +1189,6 @@ export interface MarkerInfo {
|
|
|
1186
1189
|
Label: MarkerLabelElement;
|
|
1187
1190
|
Offset: number;
|
|
1188
1191
|
}
|
|
1189
|
-
export interface ForcedNarrativeSequence {
|
|
1190
|
-
Id: ImfUuid;
|
|
1191
|
-
ResourceList: ResourceList;
|
|
1192
|
-
TrackId: ImfUuid;
|
|
1193
|
-
}
|
|
1194
1192
|
export interface HearingImpairedCaptionsSequence {
|
|
1195
1193
|
Id: ImfUuid;
|
|
1196
1194
|
ResourceList: ResourceList;
|
|
@@ -1462,18 +1460,6 @@ export interface ValidationResult {
|
|
|
1462
1460
|
rule_warnings?: RuleValidationWarning[];
|
|
1463
1461
|
validation: ValidationReport;
|
|
1464
1462
|
}
|
|
1465
|
-
/**
|
|
1466
|
-
* A diagnostic about a `RulesConfig` key that the engine couldn't match.
|
|
1467
|
-
*
|
|
1468
|
-
* Produced by `RulesConfig::validate`. Operators can use these at config-load time to catch typos before any validation work runs.
|
|
1469
|
-
*/
|
|
1470
|
-
export interface RuleValidationWarning {
|
|
1471
|
-
/**
|
|
1472
|
-
* The configured key that triggered the warning.
|
|
1473
|
-
*/
|
|
1474
|
-
key: string;
|
|
1475
|
-
reason: RuleValidationReason;
|
|
1476
|
-
}
|
|
1477
1463
|
|
|
1478
1464
|
/**
|
|
1479
1465
|
* Core constraints (ST 2067-2) edition to validate against. `"auto"` detects
|