laterite 0.1.0 → 0.4.0
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 +2 -2
- package/dist/index.cjs +4 -4
- package/dist/index.d.mts +4 -4
- package/dist/index.d.ts +4 -4
- package/dist/index.mjs +4 -4
- package/index.d.ts +5 -5
- package/package.json +4 -4
package/README.md
CHANGED
|
@@ -18,7 +18,7 @@ One clean-room Rust AGS4 engine, surfaced for every stack:
|
|
|
18
18
|
|---|---|---|
|
|
19
19
|
| **Python** | [`laterite`](https://pypi.org/project/laterite/) — PyPI | `pip install laterite` |
|
|
20
20
|
| **Node.js** | [`laterite`](https://www.npmjs.com/package/laterite) — npm | `npm install laterite` |
|
|
21
|
-
| **Rust / CLI** | [`
|
|
21
|
+
| **Rust / CLI** | [`lat-db` + `lat-check`](https://github.com/niko86/laterite/releases) | GitHub Releases |
|
|
22
22
|
| **Browser** | [validator + data explorer](https://niko86.github.io/laterite/) — WASM | open in a browser |
|
|
23
23
|
|
|
24
24
|
## Read & validate
|
|
@@ -34,7 +34,7 @@ loca.getChild("LOCA_GL")?.get(0); // → 12.3 (a number)
|
|
|
34
34
|
const report = validate("delivery.ags");
|
|
35
35
|
report.isValid; // boolean
|
|
36
36
|
report.findings; // [{ rule, line?, group, desc, severity? }]
|
|
37
|
-
report.toJson(); // byte-identical to `
|
|
37
|
+
report.toJson(); // byte-identical to `lat-check --json`
|
|
38
38
|
```
|
|
39
39
|
|
|
40
40
|
## Produce AGS4
|
package/dist/index.cjs
CHANGED
|
@@ -144,7 +144,7 @@ var import_apache_arrow = require("apache-arrow");
|
|
|
144
144
|
|
|
145
145
|
// ts/errors.ts
|
|
146
146
|
var Ags4Error = class extends Error {
|
|
147
|
-
/** The validator exit code this failure carries (mirrors `
|
|
147
|
+
/** The validator exit code this failure carries (mirrors `lat-check`). */
|
|
148
148
|
exitCode;
|
|
149
149
|
constructor(message, exitCode = 1) {
|
|
150
150
|
super(message);
|
|
@@ -12320,7 +12320,7 @@ var Report = class {
|
|
|
12320
12320
|
get exitCode() {
|
|
12321
12321
|
return this.#r.exitCode;
|
|
12322
12322
|
}
|
|
12323
|
-
/** All findings, in `
|
|
12323
|
+
/** All findings, in `lat-check` order: `{rule, line?, group, desc, severity?}`. */
|
|
12324
12324
|
get findings() {
|
|
12325
12325
|
return this.#r.findings;
|
|
12326
12326
|
}
|
|
@@ -12334,11 +12334,11 @@ var Report = class {
|
|
|
12334
12334
|
}
|
|
12335
12335
|
return out;
|
|
12336
12336
|
}
|
|
12337
|
-
/** `{file, findings:{…}}` pretty-JSON — byte-identical to `
|
|
12337
|
+
/** `{file, findings:{…}}` pretty-JSON — byte-identical to `lat-check --json`. */
|
|
12338
12338
|
toJson() {
|
|
12339
12339
|
return this.#r.json;
|
|
12340
12340
|
}
|
|
12341
|
-
/** One flat `{rule, …}` per line — byte-identical to `
|
|
12341
|
+
/** One flat `{rule, …}` per line — byte-identical to `lat-check --ndjson`. */
|
|
12342
12342
|
toNdjson() {
|
|
12343
12343
|
return this.#r.ndjson;
|
|
12344
12344
|
}
|
package/dist/index.d.mts
CHANGED
|
@@ -126,14 +126,14 @@ declare class Report {
|
|
|
126
126
|
* only means "validatable"). */
|
|
127
127
|
get isValid(): boolean;
|
|
128
128
|
get exitCode(): number;
|
|
129
|
-
/** All findings, in `
|
|
129
|
+
/** All findings, in `lat-check` order: `{rule, line?, group, desc, severity?}`. */
|
|
130
130
|
get findings(): Finding[];
|
|
131
131
|
/** `{ "AGS Format Rule N": [{line?, group, desc, …}] }` — the spec-rule
|
|
132
132
|
* grouping (mirrors `Report.by_rule`). */
|
|
133
133
|
byRule(): Record<string, RuleFinding[]>;
|
|
134
|
-
/** `{file, findings:{…}}` pretty-JSON — byte-identical to `
|
|
134
|
+
/** `{file, findings:{…}}` pretty-JSON — byte-identical to `lat-check --json`. */
|
|
135
135
|
toJson(): string;
|
|
136
|
-
/** One flat `{rule, …}` per line — byte-identical to `
|
|
136
|
+
/** One flat `{rule, …}` per line — byte-identical to `lat-check --ndjson`. */
|
|
137
137
|
toNdjson(): string;
|
|
138
138
|
toString(): string;
|
|
139
139
|
}
|
|
@@ -2162,7 +2162,7 @@ declare class WSTG extends AgsGroup {
|
|
|
2162
2162
|
}
|
|
2163
2163
|
|
|
2164
2164
|
declare class Ags4Error extends Error {
|
|
2165
|
-
/** The validator exit code this failure carries (mirrors `
|
|
2165
|
+
/** The validator exit code this failure carries (mirrors `lat-check`). */
|
|
2166
2166
|
readonly exitCode: number;
|
|
2167
2167
|
constructor(message: string, exitCode?: number);
|
|
2168
2168
|
}
|
package/dist/index.d.ts
CHANGED
|
@@ -126,14 +126,14 @@ declare class Report {
|
|
|
126
126
|
* only means "validatable"). */
|
|
127
127
|
get isValid(): boolean;
|
|
128
128
|
get exitCode(): number;
|
|
129
|
-
/** All findings, in `
|
|
129
|
+
/** All findings, in `lat-check` order: `{rule, line?, group, desc, severity?}`. */
|
|
130
130
|
get findings(): Finding[];
|
|
131
131
|
/** `{ "AGS Format Rule N": [{line?, group, desc, …}] }` — the spec-rule
|
|
132
132
|
* grouping (mirrors `Report.by_rule`). */
|
|
133
133
|
byRule(): Record<string, RuleFinding[]>;
|
|
134
|
-
/** `{file, findings:{…}}` pretty-JSON — byte-identical to `
|
|
134
|
+
/** `{file, findings:{…}}` pretty-JSON — byte-identical to `lat-check --json`. */
|
|
135
135
|
toJson(): string;
|
|
136
|
-
/** One flat `{rule, …}` per line — byte-identical to `
|
|
136
|
+
/** One flat `{rule, …}` per line — byte-identical to `lat-check --ndjson`. */
|
|
137
137
|
toNdjson(): string;
|
|
138
138
|
toString(): string;
|
|
139
139
|
}
|
|
@@ -2162,7 +2162,7 @@ declare class WSTG extends AgsGroup {
|
|
|
2162
2162
|
}
|
|
2163
2163
|
|
|
2164
2164
|
declare class Ags4Error extends Error {
|
|
2165
|
-
/** The validator exit code this failure carries (mirrors `
|
|
2165
|
+
/** The validator exit code this failure carries (mirrors `lat-check`). */
|
|
2166
2166
|
readonly exitCode: number;
|
|
2167
2167
|
constructor(message: string, exitCode?: number);
|
|
2168
2168
|
}
|
package/dist/index.mjs
CHANGED
|
@@ -16,7 +16,7 @@ import { tableFromIPC } from "apache-arrow";
|
|
|
16
16
|
|
|
17
17
|
// ts/errors.ts
|
|
18
18
|
var Ags4Error = class extends Error {
|
|
19
|
-
/** The validator exit code this failure carries (mirrors `
|
|
19
|
+
/** The validator exit code this failure carries (mirrors `lat-check`). */
|
|
20
20
|
exitCode;
|
|
21
21
|
constructor(message, exitCode = 1) {
|
|
22
22
|
super(message);
|
|
@@ -12205,7 +12205,7 @@ var Report = class {
|
|
|
12205
12205
|
get exitCode() {
|
|
12206
12206
|
return this.#r.exitCode;
|
|
12207
12207
|
}
|
|
12208
|
-
/** All findings, in `
|
|
12208
|
+
/** All findings, in `lat-check` order: `{rule, line?, group, desc, severity?}`. */
|
|
12209
12209
|
get findings() {
|
|
12210
12210
|
return this.#r.findings;
|
|
12211
12211
|
}
|
|
@@ -12219,11 +12219,11 @@ var Report = class {
|
|
|
12219
12219
|
}
|
|
12220
12220
|
return out;
|
|
12221
12221
|
}
|
|
12222
|
-
/** `{file, findings:{…}}` pretty-JSON — byte-identical to `
|
|
12222
|
+
/** `{file, findings:{…}}` pretty-JSON — byte-identical to `lat-check --json`. */
|
|
12223
12223
|
toJson() {
|
|
12224
12224
|
return this.#r.json;
|
|
12225
12225
|
}
|
|
12226
|
-
/** One flat `{rule, …}` per line — byte-identical to `
|
|
12226
|
+
/** One flat `{rule, …}` per line — byte-identical to `lat-check --ndjson`. */
|
|
12227
12227
|
toNdjson() {
|
|
12228
12228
|
return this.#r.ndjson;
|
|
12229
12229
|
}
|
package/index.d.ts
CHANGED
|
@@ -85,7 +85,7 @@ export interface Finding {
|
|
|
85
85
|
* `ok` is **false only for un-validatable input** (the TS `raiseFor` raises
|
|
86
86
|
* then); rule *violations* come back in `findings` with `ok:true`. `Report`'s
|
|
87
87
|
* `isValid` is the separate `count == 0`. `json`/`ndjson` are byte-identical
|
|
88
|
-
* to `
|
|
88
|
+
* to `lat-check --json` / `--ndjson`.
|
|
89
89
|
*/
|
|
90
90
|
export interface ValidationReport {
|
|
91
91
|
ok: boolean
|
|
@@ -96,7 +96,7 @@ export interface ValidationReport {
|
|
|
96
96
|
errorKind?: string
|
|
97
97
|
error?: string
|
|
98
98
|
/**
|
|
99
|
-
* Mirrors the `
|
|
99
|
+
* Mirrors the `lat-check` binary: 0 valid / 1 findings on success;
|
|
100
100
|
* 3 not-found/io, 4 not-utf8/not-ags4/bad-edition, 5 bad-dict on failure.
|
|
101
101
|
*/
|
|
102
102
|
exitCode: number
|
|
@@ -133,12 +133,12 @@ export interface EmitResult {
|
|
|
133
133
|
}
|
|
134
134
|
/**
|
|
135
135
|
* Build valid AGS4 from per-group **Arrow IPC** streams (the columnar
|
|
136
|
-
* producer; the read boundary reversed). = `ags4-wasm`'s `to_ags4_ipc`.
|
|
136
|
+
* producer; the read boundary reversed). = `laterite-ags4-wasm`'s `to_ags4_ipc`.
|
|
137
137
|
*/
|
|
138
138
|
export declare function emitAgs4FromIpc(groups: Array<GroupIpc>, edition?: string | undefined | null, mode?: string | undefined | null): EmitResult
|
|
139
139
|
/**
|
|
140
140
|
* A parsed AGS4 file held native-side — the Node analog of laterite-py's
|
|
141
|
-
* `Reading` handle (and `ags4-wasm`'s `ParsedDataset`). Each group's typed
|
|
141
|
+
* `Reading` handle (and `laterite-ags4-wasm`'s `ParsedDataset`). Each group's typed
|
|
142
142
|
* `RecordBatch` is built lazily on `tableIpc(code)` and dropped after the
|
|
143
143
|
* bytes are returned, so peak residency is one batch.
|
|
144
144
|
*/
|
|
@@ -155,7 +155,7 @@ export declare class Reading {
|
|
|
155
155
|
/**
|
|
156
156
|
* One group's rows as an Arrow **IPC stream** (`Buffer`), columns already
|
|
157
157
|
* correctly typed. The Node analog of the pyo3-arrow capsule: the typed
|
|
158
|
-
* columns come from the one shared emitter (`
|
|
158
|
+
* columns come from the one shared emitter (`laterite_types::arrow_cols`), the
|
|
159
159
|
* SAME casting Python/wasm use — so a file types byte-identically across
|
|
160
160
|
* hosts. Returns `null` if the code isn't in the file.
|
|
161
161
|
*/
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "laterite",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.4.0",
|
|
4
4
|
"description": "AGS4 geotechnical data for Node.js — read, validate, produce, and query (the Node port of the laterite Python toolkit, Rust-backed).",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "niko86",
|
|
@@ -77,9 +77,9 @@
|
|
|
77
77
|
"apache-arrow": "^21.1.0"
|
|
78
78
|
},
|
|
79
79
|
"optionalDependencies": {
|
|
80
|
-
"@laterite/native-linux-x64-gnu": "0.
|
|
81
|
-
"@laterite/native-darwin-arm64": "0.
|
|
82
|
-
"@laterite/native-win32-x64-msvc": "0.
|
|
80
|
+
"@laterite/native-linux-x64-gnu": "0.4.0",
|
|
81
|
+
"@laterite/native-darwin-arm64": "0.4.0",
|
|
82
|
+
"@laterite/native-win32-x64-msvc": "0.4.0"
|
|
83
83
|
},
|
|
84
84
|
"peerDependencies": {
|
|
85
85
|
"@duckdb/node-api": ">=1.5.0"
|