@veripublica/epubveri-wasm 0.5.14 → 0.5.16

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
@@ -59,7 +59,11 @@ interface Item {
59
59
  data?: { params: string[] };
60
60
  }
61
61
 
62
- function validate(bytes: Uint8Array, profile?: string | null): Report;
62
+ function validate(
63
+ bytes: Uint8Array,
64
+ profile?: string | null,
65
+ advisory?: boolean | null,
66
+ ): Report;
63
67
  function version(): string;
64
68
  ```
65
69
 
@@ -69,6 +73,14 @@ function version(): string;
69
73
  `"preview"`, or `undefined`/`null` for default behavior. Unknown names are treated as
70
74
  `undefined` (permissive).
71
75
 
76
+ ### Advisory checks
77
+
78
+ `advisory` mirrors the CLI `--advisory` flag: pass `true` to also emit the opt-in advisory
79
+ findings epubcheck has no verdict on — currently unknown CSS property and descriptor names
80
+ (`ADV-001`/`ADV-002`, at `usage` severity). It is **off by default**: leaving the argument
81
+ out, or passing `false`/`undefined`, produces a byte-identical report, so existing
82
+ two-argument callers are unaffected.
83
+
72
84
  ### One CLI-only difference
73
85
 
74
86
  The `PKG-016` check (the `.epub` **file extension** should be lowercase) is filename-
package/epubveri.d.ts CHANGED
@@ -87,11 +87,17 @@ export interface Data {
87
87
  * `"idx"`, `"preview"`, or `undefined`/`null` for default behavior. Unknown
88
88
  * names behave like `undefined` (permissive).
89
89
  *
90
+ * `advisory` mirrors the CLI `--advisory` flag: pass `true` to also emit the
91
+ * opt-in advisory findings epubcheck has no verdict on (unknown CSS
92
+ * property/descriptor names, `ADV-*`, at usage severity). `undefined`/`false`
93
+ * leaves them off, and with them off the report is byte-identical — so
94
+ * existing two-argument callers are unaffected.
95
+ *
90
96
  * Note: the CLI-only PKG-016 check (the `.epub` file extension should be
91
97
  * lowercase) is filename-based and intentionally not reachable here — this
92
98
  * entry point only ever sees bytes, never a filename.
93
99
  */
94
- export function validate(bytes: Uint8Array, profile?: string | null): Report;
100
+ export function validate(bytes: Uint8Array, profile?: string | null, advisory?: boolean | null): Report;
95
101
 
96
102
  /**
97
103
  * The validator version — [`epubveri::VERSION`], the one string the CLI's
package/epubveri_bg.js CHANGED
@@ -6,19 +6,26 @@
6
6
  * `"idx"`, `"preview"`, or `undefined`/`null` for default behavior. Unknown
7
7
  * names behave like `undefined` (permissive).
8
8
  *
9
+ * `advisory` mirrors the CLI `--advisory` flag: pass `true` to also emit the
10
+ * opt-in advisory findings epubcheck has no verdict on (unknown CSS
11
+ * property/descriptor names, `ADV-*`, at usage severity). `undefined`/`false`
12
+ * leaves them off, and with them off the report is byte-identical — so
13
+ * existing two-argument callers are unaffected.
14
+ *
9
15
  * Note: the CLI-only PKG-016 check (the `.epub` file extension should be
10
16
  * lowercase) is filename-based and intentionally not reachable here — this
11
17
  * entry point only ever sees bytes, never a filename.
12
18
  * @param {Uint8Array} bytes
13
19
  * @param {string | null} [profile]
20
+ * @param {boolean | null} [advisory]
14
21
  * @returns {Report}
15
22
  */
16
- export function validate(bytes, profile) {
23
+ export function validate(bytes, profile, advisory) {
17
24
  const ptr0 = passArray8ToWasm0(bytes, wasm.__wbindgen_malloc);
18
25
  const len0 = WASM_VECTOR_LEN;
19
26
  var ptr1 = isLikeNone(profile) ? 0 : passStringToWasm0(profile, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
20
27
  var len1 = WASM_VECTOR_LEN;
21
- const ret = wasm.validate(ptr0, len0, ptr1, len1);
28
+ const ret = wasm.validate(ptr0, len0, ptr1, len1, isLikeNone(advisory) ? 0xFFFFFF : advisory ? 1 : 0);
22
29
  return ret;
23
30
  }
24
31
 
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.5.14",
5
+ "version": "0.5.16",
6
6
  "license": "AGPL-3.0-only OR LicenseRef-veripublica-Commercial",
7
7
  "repository": {
8
8
  "type": "git",