@veripublica/epubveri-wasm 0.28.0 → 0.29.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 CHANGED
@@ -86,9 +86,10 @@ function version(): string;
86
86
  epubcheck has no verdict on, in two families, both at `usage` severity:
87
87
 
88
88
  - **`NEXT-*`** — a published specification requires it and epubcheck has not implemented it
89
- yet, so it becomes an ordinary error the day it catches up. **Empty at present:** the four
90
- EPUB 3.4 rules that were here graduated when epubcheck 5.4.0 implemented them, and now
91
- report under its own ids without this flag.
89
+ yet, so it becomes an ordinary error the day it catches up: a `mimetype` file that is
90
+ compressed (EPUB 3.3 forbids it; epubcheck compares only its contents). The four EPUB 3.4
91
+ rules that were here first graduated when epubcheck 5.4.0 implemented them, and now report
92
+ under its own ids without this flag.
92
93
  - **`ADV-*`** — no specification requires it, but the book is still probably wrong
93
94
  (unknown CSS property and descriptor names, a type selector naming no known element, an
94
95
  EPUB 2 package written in EPUB 3, two navigation entries landing on one document, an
package/epubveri.d.ts CHANGED
@@ -9,14 +9,14 @@ export interface Position {
9
9
  }
10
10
 
11
11
  /**
12
- * One EPUB\'s validation result — the envelope\'s `inputs[i]` object without
12
+ * One EPUB's validation result — the envelope's `inputs[i]` object without
13
13
  * `path`/`error` (a wasm caller has no path, and in-memory bytes are always
14
- * readable, so there is no unprocessable/`\"error\"` case here).
14
+ * readable, so there is no unprocessable/`"error"` case here).
15
15
  */
16
16
  export interface Report {
17
17
  /**
18
- * `\"ok\"` (valid) or `\"problems\"` (error/fatal findings remain). The
19
- * warning/info/usage-only case is `\"ok\"` — those never fail a book.
18
+ * `"ok"` (valid) or `"problems"` (error/fatal findings remain). The
19
+ * warning/info/usage-only case is `"ok"` — those never fail a book.
20
20
  */
21
21
  status: string;
22
22
  summary: Summary;
@@ -28,19 +28,19 @@ export interface Report {
28
28
  */
29
29
  export interface Item {
30
30
  /**
31
- * Always `\"finding\"` for a verifier.
31
+ * Always `"finding"` for a verifier.
32
32
  */
33
33
  type: string;
34
34
  /**
35
- * epubcheck-compatible message ID, e.g. `\"RSC-005\"`.
35
+ * epubcheck-compatible message ID, e.g. `"RSC-005"`.
36
36
  */
37
37
  code: string;
38
38
  /**
39
- * epubveri\'s finer semantic sub-code, when the site carries one.
39
+ * epubveri's finer semantic sub-code, when the site carries one.
40
40
  */
41
41
  rule: string | undefined;
42
42
  /**
43
- * Lowercase severity: `\"fatal\" | \"error\" | \"warning\" | \"info\" | \"usage\"`.
43
+ * Lowercase severity: `"fatal" | "error" | "warning" | "info" | "usage"`.
44
44
  */
45
45
  severity: string;
46
46
  /**
@@ -52,21 +52,21 @@ export interface Item {
52
52
  */
53
53
  position: Position | undefined;
54
54
  /**
55
- * Human-readable message text (epubveri\'s own wording).
55
+ * Human-readable message text (epubveri's own wording).
56
56
  */
57
57
  message: string;
58
58
  /**
59
- * Tool-specific extras — carries the message\'s interpolation `params`.
59
+ * Tool-specific extras — carries the message's interpolation `params`.
60
60
  */
61
61
  data: Data | undefined;
62
62
  }
63
63
 
64
64
  /**
65
- * Small aggregate counts, mirroring the envelope\'s per-input `summary`
65
+ * Small aggregate counts, mirroring the envelope's per-input `summary`
66
66
  * exactly — same singular key names, and **every counter present, including
67
67
  * zero**.
68
68
  *
69
- * **These counts are never filtered**, unlike the CLI\'s, where `-u` decides
69
+ * **These counts are never filtered**, unlike the CLI's, where `-u` decides
70
70
  * what the output contains and the counts describe the output. This binding
71
71
  * has no such flag: it is a machine interface and always returns everything,
72
72
  * so its counts always describe the whole report.
@@ -86,7 +86,7 @@ export interface Summary {
86
86
  }
87
87
 
88
88
  /**
89
- * Tool-specific item extras — the same slot the CLI\'s `--format json` fills,
89
+ * Tool-specific item extras — the same slot the CLI's `--format json` fills,
90
90
  * with the same contents.
91
91
  *
92
92
  * Kept in step with [`epubveri::envelope::Data`] deliberately: a browser
@@ -111,9 +111,9 @@ export interface Data {
111
111
  *
112
112
  * **This arrives in JavaScript as a `Map`, not a plain object** — that is
113
113
  * how serde-wasm-bindgen renders a map, and it is the one place this
114
- * binding\'s shape differs from the CLI\'s JSON, where the same field is an
115
- * object. So `data.namespaces.get(\"opf\")`, never
116
- * `data.namespaces[\"opf\"]`, which would silently be `undefined`.
114
+ * binding's shape differs from the CLI's JSON, where the same field is an
115
+ * object. So `data.namespaces.get("opf")`, never
116
+ * `data.namespaces["opf"]`, which would silently be `undefined`.
117
117
  */
118
118
  namespaces: Map<string, string>;
119
119
  /**
package/epubveri_bg.js CHANGED
@@ -39,7 +39,10 @@ export function validate(bytes, profile, advisory, epub_version) {
39
39
  var ptr2 = isLikeNone(epub_version) ? 0 : passStringToWasm0(epub_version, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
40
40
  var len2 = WASM_VECTOR_LEN;
41
41
  const ret = wasm.validate(ptr0, len0, ptr1, len1, isLikeNone(advisory) ? 0xFFFFFF : advisory ? 1 : 0, ptr2, len2);
42
- return ret;
42
+ if (ret[2]) {
43
+ throw takeFromExternrefTable0(ret[1]);
44
+ }
45
+ return takeFromExternrefTable0(ret[0]);
43
46
  }
44
47
 
45
48
  /**
@@ -60,7 +63,7 @@ export function version() {
60
63
  wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
61
64
  }
62
65
  }
63
- export function __wbg_Error_67e7344beaa85059(arg0, arg1) {
66
+ export function __wbg_Error_30c8987f7c2ed4e2(arg0, arg1) {
64
67
  const ret = Error(getStringFromWasm0(arg0, arg1));
65
68
  return ret;
66
69
  }
@@ -71,34 +74,34 @@ export function __wbg_String_8564e559799eccda(arg0, arg1) {
71
74
  getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
72
75
  getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
73
76
  }
74
- export function __wbg___wbindgen_is_string_c4f7cb494a2a21f1(arg0) {
77
+ export function __wbg___wbindgen_is_string_90b56bc79aad6f6c(arg0) {
75
78
  const ret = typeof(arg0) === 'string';
76
79
  return ret;
77
80
  }
78
- export function __wbg___wbindgen_throw_5d9e815e6fdf150f(arg0, arg1) {
81
+ export function __wbg___wbindgen_throw_41e9ee4f547fc59a(arg0, arg1) {
79
82
  throw new Error(getStringFromWasm0(arg0, arg1));
80
83
  }
81
- export function __wbg_new_8d36e20aa758e411() {
84
+ export function __wbg_new_28744009d011f847() {
82
85
  const ret = new Map();
83
86
  return ret;
84
87
  }
85
- export function __wbg_new_bebc3f4757acf305() {
88
+ export function __wbg_new_617a8cdb8bb1130e() {
86
89
  const ret = new Object();
87
90
  return ret;
88
91
  }
89
- export function __wbg_new_ffa92086ea89f79c() {
92
+ export function __wbg_new_ee2291f50781bf1d() {
90
93
  const ret = new Array();
91
94
  return ret;
92
95
  }
93
- export function __wbg_set_13d25b81ab403f5e(arg0, arg1, arg2) {
94
- arg0[arg1 >>> 0] = arg2;
96
+ export function __wbg_set_6ae97e73113c4f0b(arg0, arg1, arg2) {
97
+ const ret = arg0.set(arg1, arg2);
98
+ return ret;
95
99
  }
96
100
  export function __wbg_set_6be42768c690e380(arg0, arg1, arg2) {
97
101
  arg0[arg1] = arg2;
98
102
  }
99
- export function __wbg_set_bf6dde4923b9b059(arg0, arg1, arg2) {
100
- const ret = arg0.set(arg1, arg2);
101
- return ret;
103
+ export function __wbg_set_bea140a88be9b277(arg0, arg1, arg2) {
104
+ arg0[arg1 >>> 0] = arg2;
102
105
  }
103
106
  export function __wbindgen_generic_0000000000000001(arg0) {
104
107
  // Cast intrinsic for `F64 -> Externref`.
@@ -192,6 +195,12 @@ function passStringToWasm0(arg, malloc, realloc) {
192
195
  return ptr;
193
196
  }
194
197
 
198
+ function takeFromExternrefTable0(idx) {
199
+ const value = wasm.__wbindgen_externrefs.get(idx);
200
+ wasm.__externref_table_dealloc(idx);
201
+ return value;
202
+ }
203
+
195
204
  let cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
196
205
  cachedTextDecoder.decode();
197
206
  const MAX_SAFARI_DECODE_BYTES = 2146435072;
package/epubveri_bg.wasm CHANGED
Binary file
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@veripublica/epubveri-wasm",
3
3
  "type": "module",
4
4
  "description": "WebAssembly bindings for epubveri — a pure-Rust, JVM-free EPUB validator that runs in the browser.",
5
- "version": "0.28.0",
5
+ "version": "0.29.0",
6
6
  "license": "AGPL-3.0-only OR LicenseRef-veripublica-Commercial",
7
7
  "repository": {
8
8
  "type": "git",