@nirs4all/io-wasm 0.1.11 → 0.1.13

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.
@@ -0,0 +1,82 @@
1
+ # Third-Party Notices — nirs4all-io
2
+
3
+ `nirs4all-io` is distributed under `CeCILL-2.1 OR AGPL-3.0-or-later` (plus an optional
4
+ commercial license; see [`LICENSING.md`](LICENSING.md)). It relies on the third-party
5
+ open-source components listed below.
6
+
7
+ The distribution model differs by surface and must not be described as uniformly
8
+ "unvendored":
9
+
10
+ - the pure-Python compatibility package installs its Python dependencies separately;
11
+ - Rust executables, native libraries, Python wheels, and WASM packages contain compiled
12
+ Rust dependencies from the exact closure pinned by `Cargo.lock` (or the binding lock);
13
+ - the R source package deliberately vendors that Rust source closure for an offline CRAN
14
+ build. Its `src/rust/vendor.tar.xz` retains every upstream crate's own license and notice
15
+ files.
16
+
17
+ The release CycloneDX SBOM is the machine-readable component/version/license inventory for
18
+ the shipped Rust closure. `Cargo.lock`, `bindings/python/Cargo.lock`,
19
+ `bindings/wasm/Cargo.lock`, and `bindings/r/Cargo.lock.rust` are the authoritative version
20
+ locks. This notice summarizes direct runtime dependencies; it does not replace the
21
+ transitive inventory, upstream notices in the R vendor bundle, or the SBOM.
22
+
23
+ The staged WASM npm package includes `nirs4all-io-wasm.cdx.json`, a deterministic
24
+ CycloneDX 1.6 document generated from `cargo metadata --locked --offline`. It records
25
+ the exact Cargo components, licenses, purls, dependency graph, and source commit/tree;
26
+ it deliberately contains no timestamp, UUID, or local build path.
27
+
28
+ ## Python runtime dependencies
29
+
30
+ | Component | License (SPDX) | Copyright | Upstream |
31
+ |---|---|---|---|
32
+ | `numpy` | BSD-3-Clause | Copyright (c) 2005-2025, NumPy Developers | https://github.com/numpy/numpy |
33
+ | `pandas` | BSD-3-Clause | Copyright (c) 2008-2025, pandas Development Team | https://github.com/pandas-dev/pandas |
34
+ | `pyyaml` | MIT | Copyright (c) 2006-2025 PyYAML contributors | https://github.com/yaml/pyyaml |
35
+ | `jsonschema` | MIT | Copyright (c) 2013 Julian Berman | https://github.com/python-jsonschema/jsonschema |
36
+
37
+ ## Rust runtime dependencies
38
+
39
+ | Component | License expression | Upstream |
40
+ |---|---|---|
41
+ | `dag-ml-data` | `CeCILL-2.1 OR AGPL-3.0-or-later` | https://github.com/GBeurier/dag-ml-data |
42
+ | `serde`, `serde_json` | `MIT OR Apache-2.0` | https://github.com/serde-rs |
43
+ | `thiserror`, `anyhow` | `MIT OR Apache-2.0` | https://github.com/dtolnay |
44
+ | `sha2` | `MIT OR Apache-2.0` | https://github.com/RustCrypto/hashes |
45
+ | `regex` | `MIT OR Apache-2.0` | https://github.com/rust-lang/regex |
46
+ | `toml` | `MIT OR Apache-2.0` | https://github.com/toml-rs/toml |
47
+ | `indexmap` | `Apache-2.0 OR MIT` | https://github.com/indexmap-rs/indexmap |
48
+ | `csv` | `Unlicense OR MIT` | https://github.com/BurntSushi/rust-csv |
49
+ | `ryu` (transitive through `csv`) | `Apache-2.0` selected from `Apache-2.0 OR BSL-1.0` | https://github.com/dtolnay/ryu |
50
+ | `glob` | `MIT OR Apache-2.0` | https://github.com/rust-lang/glob |
51
+ | `flate2` | `MIT OR Apache-2.0` | https://github.com/rust-lang/flate2-rs |
52
+ | `zip` | `MIT` | https://github.com/zip-rs/zip2 |
53
+ | Apache Arrow Rust (`arrow-*`, `parquet`) | `Apache-2.0` and, for `arrow-array`, `Apache-2.0 AND MIT` | https://github.com/apache/arrow-rs |
54
+ | `clap` | `MIT OR Apache-2.0` | https://github.com/clap-rs/clap |
55
+ | `wasm-bindgen`, `js-sys` | `MIT OR Apache-2.0` | https://github.com/wasm-bindgen/wasm-bindgen |
56
+ | `unicode-ident` (transitive build/runtime support) | `MIT AND Unicode-3.0` selected from `(MIT OR Apache-2.0) AND Unicode-3.0` | https://github.com/dtolnay/unicode-ident |
57
+
58
+ ## Bundled license-family texts (`LICENSES/`)
59
+
60
+ - `LICENSES/Apache-2.0.txt` — Apache-2.0
61
+ - `LICENSES/BSD-3-Clause.txt` — BSD-3-Clause
62
+ - `LICENSES/MIT.txt` — MIT
63
+ - `LICENSES/Unicode-3.0.txt` — Unicode-3.0
64
+
65
+ Binary distributions select the MIT branch for dependencies offered as
66
+ `MIT OR Apache-2.0` or `Unlicense OR MIT`; consequently a separate Unlicense text
67
+ is not required. They select the Apache-2.0 branch for `ryu 1.0.23`, so BSL-1.0
68
+ does not apply to this distribution. The canonical Apache text was imported from
69
+ the exact locked `ryu-1.0.23.crate` (crate SHA-256
70
+ `9774ba4a74de5f7b1c1451ed6cd5285a32eddb5cccb8cc655a4e50009e06477f`;
71
+ license-text SHA-256
72
+ `62c7a1e35f56406896d7aa7ca52d0cc0d272ac022b5d2796e7d6905db8a3636a`).
73
+ The mandatory Unicode-3.0 branch for `unicode-ident 1.0.24` is likewise copied
74
+ from its exact locked crate (crate SHA-256
75
+ `e6e4313cd5fcd3dad5cafa179702e2b244f760991f45397d14d4ebf38247da75`;
76
+ license-text SHA-256
77
+ `f7db81051789b729fea528a63ec4c938fdcb93d9d61d97dc8cc2e9df6d47f2a1`).
78
+
79
+ Additional license families and copyright notices in the transitive Rust closure are
80
+ preserved in the upstream crate sources inside the self-contained R vendor archive and are
81
+ enumerated in the CycloneDX SBOM. Binary redistributors must ship this notice, the release
82
+ SBOM, and the applicable upstream license files together with the binary artifact.
package/idiomatic.d.ts ADDED
@@ -0,0 +1,58 @@
1
+ // SPDX-License-Identifier: CeCILL-2.1 OR AGPL-3.0-or-later
2
+ //
3
+ // Types for the idiomatic ESM wrapper (idiomatic.mjs).
4
+
5
+ import type {
6
+ NamedFile,
7
+ RecordSet,
8
+ InferOptions,
9
+ ProposeOptions,
10
+ DatasetPlan,
11
+ DatasetSpec,
12
+ ProposeResult,
13
+ AssembledDataset,
14
+ } from "./types/nirs4all-io";
15
+
16
+ export interface NioModule {
17
+ inferFiles(files: NamedFile[], options?: InferOptions): DatasetPlan;
18
+ inferRecords(recordSets: RecordSet[]): DatasetPlan;
19
+ inferDataset(files: NamedFile[], recordSets: RecordSet[], options?: InferOptions): DatasetPlan;
20
+ proposeDataset(files: NamedFile[], recordSets: RecordSet[], options?: ProposeOptions): ProposeResult;
21
+ assembleDataset(files: NamedFile[], recordSets: RecordSet[], spec: DatasetSpec | string): AssembledDataset;
22
+ version(): string;
23
+ /** Native-JS convenience: spec object/string in, canonical spec OBJECT out. */
24
+ toSpec(spec: DatasetSpec | Record<string, unknown> | string): DatasetSpec;
25
+ /** Native-JS convenience: spec object/string in; throws when invalid. */
26
+ validateSpec(spec: DatasetSpec | Record<string, unknown> | string): void;
27
+ /** Raw string-JSON surface (cross-binding contract). */
28
+ to_spec(specJson: string): string;
29
+ validate(specJson: string): void;
30
+ }
31
+
32
+ /** Build the idiomatic surface around a wasm-pack module instance. */
33
+ export function wrap(m: unknown): NioModule;
34
+
35
+ export const inferFiles: NioModule["inferFiles"];
36
+ export const inferRecords: NioModule["inferRecords"];
37
+ export const inferDataset: NioModule["inferDataset"];
38
+ export const proposeDataset: NioModule["proposeDataset"];
39
+ export const assembleDataset: NioModule["assembleDataset"];
40
+ export const version: NioModule["version"];
41
+ export const toSpec: NioModule["toSpec"];
42
+ export const validateSpec: NioModule["validateSpec"];
43
+ export const to_spec: NioModule["to_spec"];
44
+ export const validate: NioModule["validate"];
45
+
46
+ declare const nio: NioModule;
47
+ export default nio;
48
+
49
+ export type {
50
+ NamedFile,
51
+ RecordSet,
52
+ InferOptions,
53
+ ProposeOptions,
54
+ DatasetPlan,
55
+ DatasetSpec,
56
+ ProposeResult,
57
+ AssembledDataset,
58
+ };
package/idiomatic.mjs ADDED
@@ -0,0 +1,65 @@
1
+ // SPDX-License-Identifier: CeCILL-2.1 OR AGPL-3.0-or-later
2
+ //
3
+ // Idiomatic ESM wrapper over the wasm-pack module. The raw exports
4
+ // (`inferFiles` / `inferDataset` / `proposeDataset` / `inferRecords` /
5
+ // `assembleDataset`) already return plain JS objects, so they are re-exported
6
+ // unchanged. The string-JSON surface (`to_spec` / `validate`) gets a small
7
+ // native-JS convenience: accept a spec OBJECT and return an OBJECT, doing the
8
+ // JSON.stringify / JSON.parse for you. The raw string functions stay reachable
9
+ // under their original names.
10
+ //
11
+ // Usage:
12
+ // import * as nio from "./idiomatic.mjs"; // resolves the generated module
13
+ // const plan = nio.inferFiles(files, { conventions: ["nirs4all-classic"] });
14
+ // const spec = nio.toSpec({ name: "run", sources: [...] }); // -> object
15
+ // nio.validateSpec(spec); // throws if bad
16
+ //
17
+ // By default this imports the sibling `pkg/nirs4all_io_wasm.js` produced by
18
+ // wasm-pack build bindings/wasm --target nodejs --out-dir pkg
19
+ // Pass a different module to `wrap()` to use another build/target.
20
+
21
+ import * as defaultModule from "./nirs4all_io_wasm.js";
22
+
23
+ /**
24
+ * Build the idiomatic surface around a wasm-pack module instance.
25
+ * @param {object} m the wasm-pack module (its raw exports)
26
+ */
27
+ export function wrap(m) {
28
+ return {
29
+ // Raw, object-returning entry points — re-exported as-is.
30
+ inferFiles: (files, options) => m.inferFiles(files, options ?? {}),
31
+ inferRecords: (recordSets) => m.inferRecords(recordSets),
32
+ inferDataset: (files, recordSets, options) => m.inferDataset(files, recordSets, options ?? {}),
33
+ proposeDataset: (files, recordSets, options) => m.proposeDataset(files, recordSets, options ?? {}),
34
+ assembleDataset: (files, recordSets, spec) =>
35
+ m.assembleDataset(files, recordSets, typeof spec === "string" ? spec : JSON.stringify(spec)),
36
+ version: () => m.version(),
37
+
38
+ // Native-JS conveniences over the string-JSON surface.
39
+ /** Normalize a spec object (or JSON string) into a canonical spec OBJECT. */
40
+ toSpec: (spec) => JSON.parse(m.to_spec(typeof spec === "string" ? spec : JSON.stringify(spec))),
41
+ /** Validate a spec object (or JSON string); throws when invalid. */
42
+ validateSpec: (spec) => m.validate(typeof spec === "string" ? spec : JSON.stringify(spec)),
43
+
44
+ // The raw string functions, unchanged, for the cross-binding JSON contract.
45
+ to_spec: m.to_spec,
46
+ validate: m.validate,
47
+ };
48
+ }
49
+
50
+ const nio = wrap(defaultModule);
51
+
52
+ export const {
53
+ inferFiles,
54
+ inferRecords,
55
+ inferDataset,
56
+ proposeDataset,
57
+ assembleDataset,
58
+ version,
59
+ toSpec,
60
+ validateSpec,
61
+ to_spec,
62
+ validate,
63
+ } = nio;
64
+
65
+ export default nio;