@draftwright/specify-core-wasm 0.1.18 → 0.2.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 +5 -4
- package/package.json +1 -1
- package/specify_core_wasm.d.ts +11 -4
- package/specify_core_wasm.js +18 -13
- package/specify_core_wasm_bg.wasm +0 -0
package/README.md
CHANGED
|
@@ -22,7 +22,8 @@ Shared/generic labels retain geometric matching and are omitted from analysis. K
|
|
|
22
22
|
duplicate names are unresolved without geometric fallback. See
|
|
23
23
|
[face-name matching and compatibility](https://github.com/pzfreo/specify-core/blob/main/docs/face-names.md).
|
|
24
24
|
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
25
|
+
Answer sidecars (with geometry evidence) can be exported before writing:
|
|
26
|
+
`engine.exportAnswers(answersJson, approvalsJson?)` returns an answer map as JSON: the answers
|
|
27
|
+
given plus exactly the defaults approved (`{"<part>": {"<id>": value}}`).
|
|
28
|
+
Open questions and carry blocks do not throw (`writePmi` reports what is open). See
|
|
29
|
+
[answer files](https://github.com/pzfreo/specify-core/blob/main/docs/answers.md#export-a-sidecar).
|
package/package.json
CHANGED
package/specify_core_wasm.d.ts
CHANGED
|
@@ -141,6 +141,10 @@ export interface SavedViewFinding {
|
|
|
141
141
|
/** Report in writePmi JSON; optional diagnostic keys are absent when empty. */
|
|
142
142
|
export interface WriteReport {
|
|
143
143
|
output: string;
|
|
144
|
+
/** False when required questions are still open; the file is written all the same. */
|
|
145
|
+
complete: boolean;
|
|
146
|
+
/** The required question ids still open (as `write` would list them); [] when complete. */
|
|
147
|
+
missing: string[];
|
|
144
148
|
written: string[];
|
|
145
149
|
not_written: string[];
|
|
146
150
|
warnings: string[];
|
|
@@ -175,6 +179,7 @@ export interface PmiItemChange {
|
|
|
175
179
|
old?: string;
|
|
176
180
|
new?: string;
|
|
177
181
|
reason?: string;
|
|
182
|
+
detail?: string;
|
|
178
183
|
}
|
|
179
184
|
export interface DiffPmi {
|
|
180
185
|
items: PmiItemChange[];
|
|
@@ -203,10 +208,12 @@ export class IntentEngine {
|
|
|
203
208
|
*/
|
|
204
209
|
evidence(): string;
|
|
205
210
|
/**
|
|
206
|
-
*
|
|
207
|
-
*
|
|
211
|
+
* Answer map for saving: the answers given, exactly the defaults in `approved`
|
|
212
|
+
* (optional JSON, `{"<part>": {"<id>": value}}` with the values the person saw; none
|
|
213
|
+
* when absent) and `_specify.evidence`. Never every default (ADR P9); open questions
|
|
214
|
+
* stay open. Throws if an approval is not an open question's default as it stands.
|
|
208
215
|
*/
|
|
209
|
-
exportAnswers(answers: string): string;
|
|
216
|
+
exportAnswers(answers: string, approved?: string | null): string;
|
|
210
217
|
/**
|
|
211
218
|
* Part `part` (an index from `IntentEngine.parts`) of any file, an assembly included.
|
|
212
219
|
*/
|
|
@@ -307,7 +314,7 @@ export interface InitOutput {
|
|
|
307
314
|
readonly intentengine_acceptDefaults: (a: number, b: number, c: number) => [number, number, number, number];
|
|
308
315
|
readonly intentengine_bom: (a: number, b: number) => [number, number, number, number];
|
|
309
316
|
readonly intentengine_evidence: (a: number) => [number, number, number, number];
|
|
310
|
-
readonly intentengine_exportAnswers: (a: number, b: number, c: number) => [number, number, number, number];
|
|
317
|
+
readonly intentengine_exportAnswers: (a: number, b: number, c: number, d: number, e: number) => [number, number, number, number];
|
|
311
318
|
readonly intentengine_open: (a: number, b: number, c: number, d: number) => [number, number, number];
|
|
312
319
|
readonly intentengine_openPart: (a: number, b: number, c: number, d: number, e: number) => [number, number, number];
|
|
313
320
|
readonly intentengine_original: (a: number) => [number, number];
|
package/specify_core_wasm.js
CHANGED
|
@@ -89,29 +89,34 @@ export class IntentEngine {
|
|
|
89
89
|
}
|
|
90
90
|
}
|
|
91
91
|
/**
|
|
92
|
-
*
|
|
93
|
-
*
|
|
92
|
+
* Answer map for saving: the answers given, exactly the defaults in `approved`
|
|
93
|
+
* (optional JSON, `{"<part>": {"<id>": value}}` with the values the person saw; none
|
|
94
|
+
* when absent) and `_specify.evidence`. Never every default (ADR P9); open questions
|
|
95
|
+
* stay open. Throws if an approval is not an open question's default as it stands.
|
|
94
96
|
* @param {string} answers
|
|
97
|
+
* @param {string | null} [approved]
|
|
95
98
|
* @returns {string}
|
|
96
99
|
*/
|
|
97
|
-
exportAnswers(answers) {
|
|
98
|
-
let
|
|
99
|
-
let
|
|
100
|
+
exportAnswers(answers, approved) {
|
|
101
|
+
let deferred4_0;
|
|
102
|
+
let deferred4_1;
|
|
100
103
|
try {
|
|
101
104
|
const ptr0 = passStringToWasm0(answers, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
102
105
|
const len0 = WASM_VECTOR_LEN;
|
|
103
|
-
|
|
104
|
-
var
|
|
105
|
-
|
|
106
|
+
var ptr1 = isLikeNone(approved) ? 0 : passStringToWasm0(approved, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
107
|
+
var len1 = WASM_VECTOR_LEN;
|
|
108
|
+
const ret = wasm.intentengine_exportAnswers(this.__wbg_ptr, ptr0, len0, ptr1, len1);
|
|
109
|
+
var ptr3 = ret[0];
|
|
110
|
+
var len3 = ret[1];
|
|
106
111
|
if (ret[3]) {
|
|
107
|
-
|
|
112
|
+
ptr3 = 0; len3 = 0;
|
|
108
113
|
throw takeFromExternrefTable0(ret[2]);
|
|
109
114
|
}
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
return getStringFromWasm0(
|
|
115
|
+
deferred4_0 = ptr3;
|
|
116
|
+
deferred4_1 = len3;
|
|
117
|
+
return getStringFromWasm0(ptr3, len3);
|
|
113
118
|
} finally {
|
|
114
|
-
wasm.__wbindgen_free(
|
|
119
|
+
wasm.__wbindgen_free(deferred4_0, deferred4_1, 1);
|
|
115
120
|
}
|
|
116
121
|
}
|
|
117
122
|
/**
|
|
Binary file
|