@imferno/wasm 3.0.2-fix-working-group-resolutions.b60b447 → 3.0.2-fix-napi-typescript-types.043fc9b

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/codes.d.ts CHANGED
@@ -3,11 +3,6 @@ export declare const codes: {
3
3
  readonly ST429_9_2014: {
4
4
  readonly VolindexMissing: "ST429-9:2014:7/VolindexMissing";
5
5
  readonly MalformedXml: "ST429-9:2014:7/MalformedXml";
6
- readonly PathNotRelative: "ST429-9:2014:A.2/PathNotRelative";
7
- readonly PathCharacters: "ST429-9:2014:A.2/PathCharacters";
8
- readonly PathTooLong: "ST429-9:2014:A.2/PathTooLong";
9
- readonly PathTooManySegments: "ST429-9:2014:A.2/PathTooManySegments";
10
- readonly PathDuplicate: "ST429-9:2014:A.2/PathDuplicate";
11
6
  };
12
7
  readonly ST377_1_2011: {
13
8
  readonly NotMxf: "ST377-1:2011:5/NotMxf";
@@ -17,7 +12,6 @@ export declare const codes: {
17
12
  readonly NonHeaderFirstPartition: "ST377-1:2011:6.4/NonHeaderFirstPartition";
18
13
  readonly HeaderPartitionOpen: "ST377-1:2011:8.3.3/HeaderPartitionOpen";
19
14
  readonly MissingHeaderMetadata: "ST377-1:2011:8.3.3/MissingHeaderMetadata";
20
- readonly StructuralComponentDurationMissing: "ST377-1:2011:B.8/StructuralComponentDurationMissing";
21
15
  };
22
16
  readonly ST2067_2_2020: {
23
17
  readonly AssetMap: "ST2067-2:2020:7/AssetMap";
@@ -28,7 +22,6 @@ export declare const codes: {
28
22
  readonly FileNotFound: "ST2067-2:2020:8.3/FileNotFound";
29
23
  readonly ChecksumMismatch: "ST2067-2:2020:8.3/ChecksumMismatch";
30
24
  readonly UnresolvedUuid: "ST2067-2:2020:7/UnresolvedUuid";
31
- readonly TrackFileNotInPackage: "ST2067-2:2020:7.1/TrackFileNotInPackage";
32
25
  readonly DuplicateUuid: "ST2067-2:2020:7/DuplicateUuid";
33
26
  readonly IoError: "IMF:General/IoError";
34
27
  readonly EssenceDescriptorList: "ST2067-2:2020:6.4.2/EssenceDescriptorList";
@@ -394,8 +387,6 @@ export declare const codes: {
394
387
  readonly J2CLayout: "ST2067-21:2026:7.5.2/J2CLayout";
395
388
  readonly J2KExtendedCapabilities: "ST2067-21:2026:7.5.1/J2KExtendedCapabilities";
396
389
  readonly JPEG2000SubDescriptor: "ST2067-21:2026:7.5.1/JPEG2000SubDescriptor";
397
- readonly HTIRVParameterBMax: "ST2067-21:2026:H/HT-IRV-ParameterB-Max";
398
- readonly HTIRVParameterBRecommended: "ST2067-21:2026:H/HT-IRV-ParameterB-Recommended";
399
390
  readonly J2K4KResolution: "ST2067-21:2026:7.2.5/J2K-4K-Resolution";
400
391
  readonly J2K2KResolution: "ST2067-21:2026:7.2.5/J2K-2K-Resolution";
401
392
  readonly J2KBCPResolution: "ST2067-21:2026:7.2.5/J2K-BCP-Resolution";
@@ -477,6 +468,5 @@ export declare const codes: {
477
468
  readonly ReadDirError: "IMFERNO:Package/ReadDirError";
478
469
  readonly DirEntryError: "IMFERNO:Package/DirEntryError";
479
470
  readonly PathTraversal: "IMFERNO:Package/PathTraversal";
480
- readonly ApplicationProfileNotValidated: "IMFERNO:Package/ApplicationProfileNotValidated";
481
471
  }
482
472
  };
package/codes.js CHANGED
@@ -3,11 +3,6 @@ export const codes = {
3
3
  ST429_9_2014: {
4
4
  VolindexMissing: "ST429-9:2014:7/VolindexMissing",
5
5
  MalformedXml: "ST429-9:2014:7/MalformedXml",
6
- PathNotRelative: "ST429-9:2014:A.2/PathNotRelative",
7
- PathCharacters: "ST429-9:2014:A.2/PathCharacters",
8
- PathTooLong: "ST429-9:2014:A.2/PathTooLong",
9
- PathTooManySegments: "ST429-9:2014:A.2/PathTooManySegments",
10
- PathDuplicate: "ST429-9:2014:A.2/PathDuplicate",
11
6
  },
12
7
  ST377_1_2011: {
13
8
  NotMxf: "ST377-1:2011:5/NotMxf",
@@ -17,7 +12,6 @@ export const codes = {
17
12
  NonHeaderFirstPartition: "ST377-1:2011:6.4/NonHeaderFirstPartition",
18
13
  HeaderPartitionOpen: "ST377-1:2011:8.3.3/HeaderPartitionOpen",
19
14
  MissingHeaderMetadata: "ST377-1:2011:8.3.3/MissingHeaderMetadata",
20
- StructuralComponentDurationMissing: "ST377-1:2011:B.8/StructuralComponentDurationMissing",
21
15
  },
22
16
  ST2067_2_2020: {
23
17
  AssetMap: "ST2067-2:2020:7/AssetMap",
@@ -28,7 +22,6 @@ export const codes = {
28
22
  FileNotFound: "ST2067-2:2020:8.3/FileNotFound",
29
23
  ChecksumMismatch: "ST2067-2:2020:8.3/ChecksumMismatch",
30
24
  UnresolvedUuid: "ST2067-2:2020:7/UnresolvedUuid",
31
- TrackFileNotInPackage: "ST2067-2:2020:7.1/TrackFileNotInPackage",
32
25
  DuplicateUuid: "ST2067-2:2020:7/DuplicateUuid",
33
26
  IoError: "IMF:General/IoError",
34
27
  EssenceDescriptorList: "ST2067-2:2020:6.4.2/EssenceDescriptorList",
@@ -394,8 +387,6 @@ export const codes = {
394
387
  J2CLayout: "ST2067-21:2026:7.5.2/J2CLayout",
395
388
  J2KExtendedCapabilities: "ST2067-21:2026:7.5.1/J2KExtendedCapabilities",
396
389
  JPEG2000SubDescriptor: "ST2067-21:2026:7.5.1/JPEG2000SubDescriptor",
397
- HTIRVParameterBMax: "ST2067-21:2026:H/HT-IRV-ParameterB-Max",
398
- HTIRVParameterBRecommended: "ST2067-21:2026:H/HT-IRV-ParameterB-Recommended",
399
390
  J2K4KResolution: "ST2067-21:2026:7.2.5/J2K-4K-Resolution",
400
391
  J2K2KResolution: "ST2067-21:2026:7.2.5/J2K-2K-Resolution",
401
392
  J2KBCPResolution: "ST2067-21:2026:7.2.5/J2K-BCP-Resolution",
@@ -477,6 +468,5 @@ export const codes = {
477
468
  ReadDirError: "IMFERNO:Package/ReadDirError",
478
469
  DirEntryError: "IMFERNO:Package/DirEntryError",
479
470
  PathTraversal: "IMFERNO:Package/PathTraversal",
480
- ApplicationProfileNotValidated: "IMFERNO:Package/ApplicationProfileNotValidated",
481
471
  }
482
472
  };
package/imferno_wasm.d.ts CHANGED
@@ -237,10 +237,6 @@ export interface J2CLayout {
237
237
  RGBAComponent?: RGBALayoutComponent[];
238
238
  }
239
239
 
240
- export interface J2KCcapi {
241
- UInt16?: number[];
242
- }
243
-
244
240
  export interface J2KComponentSizing {
245
241
  Ssiz?: number | null;
246
242
  XRSiz?: number | null;
@@ -249,7 +245,6 @@ export interface J2KComponentSizing {
249
245
 
250
246
  export interface J2KExtendedCapabilities {
251
247
  Pcap?: number | null;
252
- Ccapi?: J2KCcapi | null;
253
248
  }
254
249
 
255
250
  export interface JPEG2000SubDescriptor {
Binary file
package/index.d.ts CHANGED
@@ -1,59 +1,49 @@
1
1
  /**
2
- * Auto-initializing IMF Parser TypeScript Definitions
2
+ * Auto-initializing imferno WASM bindings.
3
3
  *
4
- * All functions automatically handle WASM initialization.
4
+ * Every function initialises the WASM module on first use, so all of them
5
+ * return Promises. Value types (`ValidationResult`, `Imferno`, `ImfReport`,
6
+ * `ValidateOptions`, ...) live in ./types.d.ts, generated from the Rust types
7
+ * by `cargo xtask generate-types-ts` and shared verbatim with @imferno/node.
5
8
  */
6
9
 
7
- /** Parse ASSETMAP.xml content */
8
- export function parseAssetmapTyped(xmlContent: string): Promise<any>;
10
+ import type { ImfReport, Imferno, ValidateOptions, ValidationResult } from './types.js';
9
11
 
10
- /** Parse CPL XML content */
11
- export function parseCplTyped(xmlContent: string): Promise<any>;
12
+ export * from './types.js';
12
13
 
13
- /** Parse PKL XML content */
14
- export function parsePklTyped(xmlContent: string): Promise<any>;
15
-
16
- /** Parse VOLINDEX.xml content */
17
- export function parseVolindexTyped(xmlContent: string): Promise<any>;
18
-
19
- /** Options for the validate function */
20
- export interface ValidateOptions {
21
- /** Core constraints spec version: "auto" | "v2013" | "v2016" | "v2020" */
22
- coreSpec?: "auto" | "v2013" | "v2016" | "v2020";
23
- /** Application profile version: "auto" | "none" | "v2014" | "v2016" | "v2020" | "v2023" | "v2026" */
24
- app2eSpec?: "auto" | "none" | "v2014" | "v2016" | "v2020" | "v2023" | "v2026";
25
- /** ESLint-style rules configuration */
26
- rules?: Record<string, string>;
27
- }
14
+ /**
15
+ * Parse and validate an IMF package. This is the recommended entry point.
16
+ *
17
+ * Parse failures are reported as findings in `validation`, not thrown.
18
+ * @param files Object mapping filenames to XML string content
19
+ * @param options Optional validation options (spec selection, rules)
20
+ * @returns `{ package, validation }` — the full parsed package and all findings.
21
+ */
22
+ export function validate(
23
+ files: Record<string, string>,
24
+ options?: ValidateOptions | null,
25
+ ): Promise<ValidationResult>;
28
26
 
29
- /** Result returned by the validate function */
30
- export interface ValidateResult {
31
- /** Validation report with issues, compliance status, and profile */
32
- report: any;
33
- /** Parsed Composition Playlists */
34
- cpls: any[];
35
- /** Parsed AssetMap (null if parsing failed) */
36
- assetMap: any | null;
37
- /** Parsed Packing Lists */
38
- packingLists: any[];
39
- /** Parsed Volume Index (null if parsing failed) */
40
- volumeIndex: any | null;
41
- /** Assets in the AssetMap with no CPL or SCM reference */
42
- unreferencedAssets: { id: string; path: string }[];
43
- /** Sidecar assets declared in SCMs */
44
- declaredSidecars: { id: string; cplIds: string[] }[];
45
- }
27
+ /**
28
+ * Parse an IMF package without validating it.
29
+ * @param files Object mapping filenames to XML string content
30
+ * @returns The full parsed package. Rejects if the package cannot be parsed.
31
+ */
32
+ export function parsePackage(files: Record<string, string>): Promise<Imferno>;
46
33
 
47
34
  /**
48
- * Validate a full IMF package and return both validation report and parsed data.
35
+ * Legacy: validate and return the lossy `ImfReport` summary. Prefer `validate`.
49
36
  * @param files Object mapping filenames to XML string content
50
37
  * @param options Optional validation options (spec selection, rules)
51
- * @returns Validation report + parsed package data
38
+ * @returns Rejects if the package cannot be parsed.
52
39
  */
53
- export function validate(
40
+ export function buildReport(
54
41
  files: Record<string, string>,
55
- options?: ValidateOptions,
56
- ): Promise<ValidateResult>;
42
+ options?: ValidateOptions | null,
43
+ ): Promise<ImfReport>;
44
+
45
+ /** Pretty-print an `ImfReport` as a human-readable string. */
46
+ export function formatReport(report: ImfReport): Promise<string>;
57
47
 
58
48
  /** Get the library version */
59
49
  export function getVersion(): Promise<string>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@imferno/wasm",
3
- "version": "3.0.2-fix-working-group-resolutions.b60b447",
3
+ "version": "3.0.2-fix-napi-typescript-types.043fc9b",
4
4
  "description": "Fast, type-safe SMPTE ST 2067 IMF parser for JavaScript and TypeScript",
5
5
  "main": "index.js",
6
6
  "types": "index.d.ts",
@@ -14,6 +14,7 @@
14
14
  "codes.d.ts",
15
15
  "index.js",
16
16
  "index.d.ts",
17
+ "types.d.ts",
17
18
  "README.md",
18
19
  "LICENSE"
19
20
  ],
@@ -58,6 +59,8 @@
58
59
  },
59
60
  "devDependencies": {
60
61
  "ajv": "^8.18.0",
62
+ "ts-json-schema-generator": "2.9.0",
63
+ "typescript": "^5.9.3",
61
64
  "vitest": "^4.0.18"
62
65
  }
63
66
  }