@veripublica/epubsana-wasm 0.29.0 → 0.31.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.
@@ -6,28 +6,28 @@
6
6
  */
7
7
  export interface Fix {
8
8
  /**
9
- * This fix\'s handle in `Session.repair`\'s `approved` list. **0-based** — it
9
+ * This fix's handle in `Session.repair`'s `approved` list. **0-based** — it
10
10
  * indexes this array.
11
11
  *
12
- * The envelope\'s [`Data::index`], on a report item, is the same fix\'s
12
+ * The envelope's [`Data::index`], on a report item, is the same fix's
13
13
  * **1-based** plan position, because that is the handle `epubsana --apply`
14
14
  * takes and the two documents have to agree. Do not pass one where the
15
15
  * other is wanted.
16
16
  */
17
17
  index: number;
18
18
  /**
19
- * `\"AutoSafe\"` (safe to auto-apply) or `\"ConfirmNeeded\"` (a visible change).
20
- * epubsana\'s own axis: how much judgement the fix needs. Orthogonal to
19
+ * `"AutoSafe"` (safe to auto-apply) or `"ConfirmNeeded"` (a visible change).
20
+ * epubsana's own axis: how much judgement the fix needs. Orthogonal to
21
21
  * `severity`, which describes the *defect*.
22
22
  */
23
23
  tier: string;
24
24
  /**
25
- * The epubcheck-compatible ID this addresses, e.g. `\"RSC-016\"`.
25
+ * The epubcheck-compatible ID this addresses, e.g. `"RSC-016"`.
26
26
  */
27
27
  id: string;
28
28
  /**
29
29
  * Lowercase severity of the finding this fix clears, **inherited** from
30
- * epubveri: `\"fatal\" | \"error\" | \"warning\" | \"info\" | \"usage\"`. A fatal is
30
+ * epubveri: `"fatal" | "error" | "warning" | "info" | "usage"`. A fatal is
31
31
  * what stops the book from opening at all.
32
32
  */
33
33
  severity: string;
@@ -44,14 +44,14 @@ export interface Fix {
44
44
  */
45
45
  preview: Change[];
46
46
  /**
47
- * `\"proposed\"` until [`Session::repair`] runs; then `\"applied\"`,
48
- * `\"skipped\"` (not approved) or `\"reverted\"` (approved, applied, and undone
47
+ * `"proposed"` until [`Session::repair`] runs; then `"applied"`,
48
+ * `"skipped"` (not approved) or `"reverted"` (approved, applied, and undone
49
49
  * because it made a finding more frequent).
50
50
  */
51
51
  outcome: string;
52
52
  /**
53
- * For a `\"reverted\"` fix, the finding whose count applying it raised, as
54
- * `\"RSC-005 (opf.package.schema_violation)\"` — the line the CLI prints.
53
+ * For a `"reverted"` fix, the finding whose count applying it raised, as
54
+ * `"RSC-005 (opf.package.schema_violation)"` — the line the CLI prints.
55
55
  */
56
56
  reverted_for: string | undefined;
57
57
  }
@@ -66,7 +66,7 @@ export interface Change {
66
66
 
67
67
  /**
68
68
  * One edit: the container entry it touches, and what it does there. Mirrors the
69
- * CLI\'s JSON exactly, so a browser consumer and a plugin read the same shape.
69
+ * CLI's JSON exactly, so a browser consumer and a plugin read the same shape.
70
70
  */
71
71
  export interface ChangeItem {
72
72
  path: string;
@@ -78,22 +78,22 @@ export interface ChangeItem {
78
78
  */
79
79
  export interface Item {
80
80
  /**
81
- * Always `\"fix\"` for a repairer.
81
+ * Always `"fix"` for a repairer.
82
82
  */
83
83
  type: string;
84
84
  /**
85
- * `\"applied\"`, `\"skipped\"`, `\"proposed\"` or `\"reverted\"` — what became of
85
+ * `"applied"`, `"skipped"`, `"proposed"` or `"reverted"` — what became of
86
86
  * this fix.
87
87
  * Required on a fix item: a report that cannot say which fixes the user
88
88
  * approved is not a report of what changed.
89
89
  */
90
90
  outcome: string;
91
91
  /**
92
- * epubcheck-compatible message ID this fix addresses, e.g. `\"RSC-016\"`.
92
+ * epubcheck-compatible message ID this fix addresses, e.g. `"RSC-016"`.
93
93
  */
94
94
  code: string;
95
95
  /**
96
- * epubveri\'s finer semantic sub-code, when the finding carries one.
96
+ * epubveri's finer semantic sub-code, when the finding carries one.
97
97
  */
98
98
  rule: string | undefined;
99
99
  /**
@@ -109,13 +109,13 @@ export interface Item {
109
109
  }
110
110
 
111
111
  /**
112
- * Per-input counts, mirroring the envelope\'s `summary`.
112
+ * Per-input counts, mirroring the envelope's `summary`.
113
113
  *
114
114
  * Including its naming rule, which is written out on `epubsana::envelope::Summary`:
115
115
  * a severity count here is **plural with a tense**, `<severity>s_before` /
116
- * `<severity>s_after`. Do not follow epubveri\'s singular `summary` keys when
116
+ * `<severity>s_after`. Do not follow epubveri's singular `summary` keys when
117
117
  * adding one — theirs is a histogram of a single report, these are a repair
118
- * run\'s delta, and mixing the two spellings inside one object is the failure
118
+ * run's delta, and mixing the two spellings inside one object is the failure
119
119
  * that note exists to prevent. `Plan::warnings_before` is the shipped
120
120
  * precedent.
121
121
  */
@@ -141,24 +141,24 @@ export interface Summary {
141
141
  proposed: number;
142
142
  /**
143
143
  * Approved and applied, then undone because applying it made a finding
144
- * more frequent, exactly as in the CLI envelope. The identity is the CLI\'s:
144
+ * more frequent, exactly as in the CLI envelope. The identity is the CLI's:
145
145
  * `applied + skipped + proposed + reverted == items.len()`.
146
146
  */
147
147
  reverted: number;
148
148
  /**
149
- * The bar this result was measured against: `\"valid\"` or `\"openable\"`.
149
+ * The bar this result was measured against: `"valid"` or `"openable"`.
150
150
  */
151
151
  goal: string;
152
152
  }
153
153
 
154
154
  /**
155
- * The re-validated result — the envelope\'s `inputs[i]` object without
155
+ * The re-validated result — the envelope's `inputs[i]` object without
156
156
  * `path`/`error` (a wasm caller has no path, and in-memory bytes are always
157
- * readable, so there is no unprocessable/`\"error\"` case here).
157
+ * readable, so there is no unprocessable/`"error"` case here).
158
158
  */
159
159
  export interface Report {
160
160
  /**
161
- * `\"ok\"` (the goal was met) or `\"problems\"` (it was not).
161
+ * `"ok"` (the goal was met) or `"problems"` (it was not).
162
162
  */
163
163
  status: string;
164
164
  summary: Summary;
@@ -166,7 +166,7 @@ export interface Report {
166
166
  }
167
167
 
168
168
  /**
169
- * The session\'s plan: the book\'s state before repair, and every proposed fix.
169
+ * The session's plan: the book's state before repair, and every proposed fix.
170
170
  *
171
171
  * Fatals are counted apart from errors, as epubveri reports them — a book whose
172
172
  * defects are all fatal has `errors_before: 0` and does not even open.
@@ -179,12 +179,12 @@ export interface Plan {
179
179
  }
180
180
 
181
181
  /**
182
- * Tool-specific extras: epubsana\'s tier, and the exact edits.
182
+ * Tool-specific extras: epubsana's tier, and the exact edits.
183
183
  */
184
184
  export interface Data {
185
185
  /**
186
- * This fix\'s **1-based** position in the plan, mirroring the CLI
187
- * envelope\'s `data.index` — the selector `epubsana --apply` accepts.
186
+ * This fix's **1-based** position in the plan, mirroring the CLI
187
+ * envelope's `data.index` — the selector `epubsana --apply` accepts.
188
188
  *
189
189
  * **Not the handle `Session.repair` takes.** That one is [`Fix::index`],
190
190
  * which is 0-based because it indexes the `Plan.fixes` array JS already
@@ -195,7 +195,7 @@ export interface Data {
195
195
  *
196
196
  * It was missing until 2026-08-22 — this struct is hand-written to get a
197
197
  * TypeScript type out of Tsify rather than built on `epubsana::envelope`,
198
- * so \"keep them in step\" (see the module docs) was a comment and not a
198
+ * so "keep them in step" (see the module docs) was a comment and not a
199
199
  * mechanism. epubveri hit the identical gap in its own binding on the same
200
200
  * day and told us to look.
201
201
  */
@@ -39,7 +39,10 @@ export class Session {
39
39
  */
40
40
  plan() {
41
41
  const ret = wasm.session_plan(this.__wbg_ptr);
42
- return ret;
42
+ if (ret[2]) {
43
+ throw takeFromExternrefTable0(ret[1]);
44
+ }
45
+ return takeFromExternrefTable0(ret[0]);
43
46
  }
44
47
  /**
45
48
  * Run the repair with the fixes at `approved` (0-based [`Fix::index`]
@@ -137,7 +140,7 @@ export function version() {
137
140
  wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
138
141
  }
139
142
  }
140
- export function __wbg_Error_92b29b0548f8b746(arg0, arg1) {
143
+ export function __wbg_Error_30c8987f7c2ed4e2(arg0, arg1) {
141
144
  const ret = Error(getStringFromWasm0(arg0, arg1));
142
145
  return ret;
143
146
  }
@@ -148,34 +151,34 @@ export function __wbg_String_8564e559799eccda(arg0, arg1) {
148
151
  getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
149
152
  getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
150
153
  }
151
- export function __wbg___wbindgen_throw_344f42d3211c4765(arg0, arg1) {
154
+ export function __wbg___wbindgen_throw_41e9ee4f547fc59a(arg0, arg1) {
152
155
  throw new Error(getStringFromWasm0(arg0, arg1));
153
156
  }
154
- export function __wbg_new_32b398fb48b6d94a() {
155
- const ret = new Array();
157
+ export function __wbg_new_617a8cdb8bb1130e() {
158
+ const ret = new Object();
156
159
  return ret;
157
160
  }
158
- export function __wbg_new_da52cf8fe3429cb2() {
159
- const ret = new Object();
161
+ export function __wbg_new_ee2291f50781bf1d() {
162
+ const ret = new Array();
160
163
  return ret;
161
164
  }
162
165
  export function __wbg_set_6be42768c690e380(arg0, arg1, arg2) {
163
166
  arg0[arg1] = arg2;
164
167
  }
165
- export function __wbg_set_8a16b38e4805b298(arg0, arg1, arg2) {
168
+ export function __wbg_set_bea140a88be9b277(arg0, arg1, arg2) {
166
169
  arg0[arg1 >>> 0] = arg2;
167
170
  }
168
- export function __wbindgen_cast_0000000000000001(arg0) {
171
+ export function __wbindgen_generic_0000000000000001(arg0) {
169
172
  // Cast intrinsic for `F64 -> Externref`.
170
173
  const ret = arg0;
171
174
  return ret;
172
175
  }
173
- export function __wbindgen_cast_0000000000000002(arg0, arg1) {
176
+ export function __wbindgen_generic_0000000000000002(arg0, arg1) {
174
177
  // Cast intrinsic for `Ref(String) -> Externref`.
175
178
  const ret = getStringFromWasm0(arg0, arg1);
176
179
  return ret;
177
180
  }
178
- export function __wbindgen_cast_0000000000000003(arg0) {
181
+ export function __wbindgen_generic_0000000000000003(arg0) {
179
182
  // Cast intrinsic for `U64 -> Externref`.
180
183
  const ret = BigInt.asUintN(64, arg0);
181
184
  return ret;
Binary file
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@veripublica/epubsana-wasm",
3
3
  "type": "module",
4
4
  "description": "WebAssembly bindings for epubsana — repair EPUB defects in the browser, no upload.",
5
- "version": "0.29.0",
5
+ "version": "0.31.0",
6
6
  "license": "AGPL-3.0-only OR LicenseRef-veripublica-Commercial",
7
7
  "repository": {
8
8
  "type": "git",