@json-eval-rs/bundler 0.0.71 → 0.0.73
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/package.json +2 -2
- package/pkg/json_eval_rs.d.ts +541 -535
- package/pkg/json_eval_rs.js +5 -1
- package/pkg/json_eval_rs_bg.js +1222 -1261
- package/pkg/json_eval_rs_bg.wasm +0 -0
- package/pkg/json_eval_rs_bg.wasm.d.ts +4 -4
package/pkg/json_eval_rs_bg.js
CHANGED
|
@@ -1,231 +1,7 @@
|
|
|
1
|
-
let wasm;
|
|
2
|
-
export function __wbg_set_wasm(val) {
|
|
3
|
-
wasm = val;
|
|
4
|
-
}
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
let cachedUint8ArrayMemory0 = null;
|
|
8
|
-
|
|
9
|
-
function getUint8ArrayMemory0() {
|
|
10
|
-
if (cachedUint8ArrayMemory0 === null || cachedUint8ArrayMemory0.byteLength === 0) {
|
|
11
|
-
cachedUint8ArrayMemory0 = new Uint8Array(wasm.memory.buffer);
|
|
12
|
-
}
|
|
13
|
-
return cachedUint8ArrayMemory0;
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
let cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
|
|
17
|
-
|
|
18
|
-
cachedTextDecoder.decode();
|
|
19
|
-
|
|
20
|
-
const MAX_SAFARI_DECODE_BYTES = 2146435072;
|
|
21
|
-
let numBytesDecoded = 0;
|
|
22
|
-
function decodeText(ptr, len) {
|
|
23
|
-
numBytesDecoded += len;
|
|
24
|
-
if (numBytesDecoded >= MAX_SAFARI_DECODE_BYTES) {
|
|
25
|
-
cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
|
|
26
|
-
cachedTextDecoder.decode();
|
|
27
|
-
numBytesDecoded = len;
|
|
28
|
-
}
|
|
29
|
-
return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len));
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
function getStringFromWasm0(ptr, len) {
|
|
33
|
-
ptr = ptr >>> 0;
|
|
34
|
-
return decodeText(ptr, len);
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
let heap = new Array(128).fill(undefined);
|
|
38
|
-
|
|
39
|
-
heap.push(undefined, null, true, false);
|
|
40
|
-
|
|
41
|
-
let heap_next = heap.length;
|
|
42
|
-
|
|
43
|
-
function addHeapObject(obj) {
|
|
44
|
-
if (heap_next === heap.length) heap.push(heap.length + 1);
|
|
45
|
-
const idx = heap_next;
|
|
46
|
-
heap_next = heap[idx];
|
|
47
|
-
|
|
48
|
-
heap[idx] = obj;
|
|
49
|
-
return idx;
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
function getObject(idx) { return heap[idx]; }
|
|
53
|
-
|
|
54
|
-
let WASM_VECTOR_LEN = 0;
|
|
55
|
-
|
|
56
|
-
const cachedTextEncoder = new TextEncoder();
|
|
57
|
-
|
|
58
|
-
if (!('encodeInto' in cachedTextEncoder)) {
|
|
59
|
-
cachedTextEncoder.encodeInto = function (arg, view) {
|
|
60
|
-
const buf = cachedTextEncoder.encode(arg);
|
|
61
|
-
view.set(buf);
|
|
62
|
-
return {
|
|
63
|
-
read: arg.length,
|
|
64
|
-
written: buf.length
|
|
65
|
-
};
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
function passStringToWasm0(arg, malloc, realloc) {
|
|
70
|
-
|
|
71
|
-
if (realloc === undefined) {
|
|
72
|
-
const buf = cachedTextEncoder.encode(arg);
|
|
73
|
-
const ptr = malloc(buf.length, 1) >>> 0;
|
|
74
|
-
getUint8ArrayMemory0().subarray(ptr, ptr + buf.length).set(buf);
|
|
75
|
-
WASM_VECTOR_LEN = buf.length;
|
|
76
|
-
return ptr;
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
let len = arg.length;
|
|
80
|
-
let ptr = malloc(len, 1) >>> 0;
|
|
81
|
-
|
|
82
|
-
const mem = getUint8ArrayMemory0();
|
|
83
|
-
|
|
84
|
-
let offset = 0;
|
|
85
|
-
|
|
86
|
-
for (; offset < len; offset++) {
|
|
87
|
-
const code = arg.charCodeAt(offset);
|
|
88
|
-
if (code > 0x7F) break;
|
|
89
|
-
mem[ptr + offset] = code;
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
if (offset !== len) {
|
|
93
|
-
if (offset !== 0) {
|
|
94
|
-
arg = arg.slice(offset);
|
|
95
|
-
}
|
|
96
|
-
ptr = realloc(ptr, len, len = offset + arg.length * 3, 1) >>> 0;
|
|
97
|
-
const view = getUint8ArrayMemory0().subarray(ptr + offset, ptr + len);
|
|
98
|
-
const ret = cachedTextEncoder.encodeInto(arg, view);
|
|
99
|
-
|
|
100
|
-
offset += ret.written;
|
|
101
|
-
ptr = realloc(ptr, len, offset, 1) >>> 0;
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
WASM_VECTOR_LEN = offset;
|
|
105
|
-
return ptr;
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
let cachedDataViewMemory0 = null;
|
|
109
|
-
|
|
110
|
-
function getDataViewMemory0() {
|
|
111
|
-
if (cachedDataViewMemory0 === null || cachedDataViewMemory0.buffer.detached === true || (cachedDataViewMemory0.buffer.detached === undefined && cachedDataViewMemory0.buffer !== wasm.memory.buffer)) {
|
|
112
|
-
cachedDataViewMemory0 = new DataView(wasm.memory.buffer);
|
|
113
|
-
}
|
|
114
|
-
return cachedDataViewMemory0;
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
function getArrayU8FromWasm0(ptr, len) {
|
|
118
|
-
ptr = ptr >>> 0;
|
|
119
|
-
return getUint8ArrayMemory0().subarray(ptr / 1, ptr / 1 + len);
|
|
120
|
-
}
|
|
121
|
-
|
|
122
|
-
function handleError(f, args) {
|
|
123
|
-
try {
|
|
124
|
-
return f.apply(this, args);
|
|
125
|
-
} catch (e) {
|
|
126
|
-
wasm.__wbindgen_export_3(addHeapObject(e));
|
|
127
|
-
}
|
|
128
|
-
}
|
|
129
|
-
|
|
130
|
-
function dropObject(idx) {
|
|
131
|
-
if (idx < 132) return;
|
|
132
|
-
heap[idx] = heap_next;
|
|
133
|
-
heap_next = idx;
|
|
134
|
-
}
|
|
135
|
-
|
|
136
|
-
function takeObject(idx) {
|
|
137
|
-
const ret = getObject(idx);
|
|
138
|
-
dropObject(idx);
|
|
139
|
-
return ret;
|
|
140
|
-
}
|
|
141
|
-
|
|
142
|
-
function isLikeNone(x) {
|
|
143
|
-
return x === undefined || x === null;
|
|
144
|
-
}
|
|
145
|
-
|
|
146
|
-
function passArrayJsValueToWasm0(array, malloc) {
|
|
147
|
-
const ptr = malloc(array.length * 4, 4) >>> 0;
|
|
148
|
-
const mem = getDataViewMemory0();
|
|
149
|
-
for (let i = 0; i < array.length; i++) {
|
|
150
|
-
mem.setUint32(ptr + 4 * i, addHeapObject(array[i]), true);
|
|
151
|
-
}
|
|
152
|
-
WASM_VECTOR_LEN = array.length;
|
|
153
|
-
return ptr;
|
|
154
|
-
}
|
|
155
|
-
/**
|
|
156
|
-
* Get library version (alias)
|
|
157
|
-
* @returns {string}
|
|
158
|
-
*/
|
|
159
|
-
export function version() {
|
|
160
|
-
let deferred1_0;
|
|
161
|
-
let deferred1_1;
|
|
162
|
-
try {
|
|
163
|
-
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
164
|
-
wasm.getVersion(retptr);
|
|
165
|
-
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
166
|
-
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
167
|
-
deferred1_0 = r0;
|
|
168
|
-
deferred1_1 = r1;
|
|
169
|
-
return getStringFromWasm0(r0, r1);
|
|
170
|
-
} finally {
|
|
171
|
-
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
172
|
-
wasm.__wbindgen_export_2(deferred1_0, deferred1_1, 1);
|
|
173
|
-
}
|
|
174
|
-
}
|
|
175
|
-
|
|
176
|
-
/**
|
|
177
|
-
* Get the library version
|
|
178
|
-
* @returns {string}
|
|
179
|
-
*/
|
|
180
|
-
export function getVersion() {
|
|
181
|
-
let deferred1_0;
|
|
182
|
-
let deferred1_1;
|
|
183
|
-
try {
|
|
184
|
-
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
185
|
-
wasm.getVersion(retptr);
|
|
186
|
-
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
187
|
-
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
188
|
-
deferred1_0 = r0;
|
|
189
|
-
deferred1_1 = r1;
|
|
190
|
-
return getStringFromWasm0(r0, r1);
|
|
191
|
-
} finally {
|
|
192
|
-
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
193
|
-
wasm.__wbindgen_export_2(deferred1_0, deferred1_1, 1);
|
|
194
|
-
}
|
|
195
|
-
}
|
|
196
|
-
|
|
197
|
-
/**
|
|
198
|
-
* Initialize the library (sets up panic hook)
|
|
199
|
-
*/
|
|
200
|
-
export function init() {
|
|
201
|
-
wasm.init();
|
|
202
|
-
}
|
|
203
|
-
|
|
204
|
-
function passArray8ToWasm0(arg, malloc) {
|
|
205
|
-
const ptr = malloc(arg.length * 1, 1) >>> 0;
|
|
206
|
-
getUint8ArrayMemory0().set(arg, ptr / 1);
|
|
207
|
-
WASM_VECTOR_LEN = arg.length;
|
|
208
|
-
return ptr;
|
|
209
|
-
}
|
|
210
|
-
|
|
211
|
-
function getArrayJsValueFromWasm0(ptr, len) {
|
|
212
|
-
ptr = ptr >>> 0;
|
|
213
|
-
const mem = getDataViewMemory0();
|
|
214
|
-
const result = [];
|
|
215
|
-
for (let i = ptr; i < ptr + 4 * len; i += 4) {
|
|
216
|
-
result.push(takeObject(mem.getUint32(i, true)));
|
|
217
|
-
}
|
|
218
|
-
return result;
|
|
219
|
-
}
|
|
220
|
-
|
|
221
|
-
const JSONEvalWasmFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
222
|
-
? { register: () => {}, unregister: () => {} }
|
|
223
|
-
: new FinalizationRegistry(ptr => wasm.__wbg_jsonevalwasm_free(ptr >>> 0, 1));
|
|
224
1
|
/**
|
|
225
2
|
* WebAssembly wrapper for JSONEval
|
|
226
3
|
*/
|
|
227
4
|
export class JSONEvalWasm {
|
|
228
|
-
|
|
229
5
|
static __wrap(ptr) {
|
|
230
6
|
ptr = ptr >>> 0;
|
|
231
7
|
const obj = Object.create(JSONEvalWasm.prototype);
|
|
@@ -233,39 +9,80 @@ export class JSONEvalWasm {
|
|
|
233
9
|
JSONEvalWasmFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
234
10
|
return obj;
|
|
235
11
|
}
|
|
236
|
-
|
|
237
12
|
__destroy_into_raw() {
|
|
238
13
|
const ptr = this.__wbg_ptr;
|
|
239
14
|
this.__wbg_ptr = 0;
|
|
240
15
|
JSONEvalWasmFinalization.unregister(this);
|
|
241
16
|
return ptr;
|
|
242
17
|
}
|
|
243
|
-
|
|
244
18
|
free() {
|
|
245
19
|
const ptr = this.__destroy_into_raw();
|
|
246
20
|
wasm.__wbg_jsonevalwasm_free(ptr, 0);
|
|
247
21
|
}
|
|
248
22
|
/**
|
|
249
|
-
*
|
|
23
|
+
* Get the number of cached entries
|
|
250
24
|
*
|
|
251
|
-
* @
|
|
252
|
-
* @
|
|
253
|
-
|
|
254
|
-
|
|
25
|
+
* @returns Number of cached entries
|
|
26
|
+
* @returns {number}
|
|
27
|
+
*/
|
|
28
|
+
cacheLen() {
|
|
29
|
+
const ret = wasm.jsonevalwasm_cacheLen(this.__wbg_ptr);
|
|
30
|
+
return ret >>> 0;
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Get cache statistics
|
|
34
|
+
*
|
|
35
|
+
* @returns Cache statistics as JavaScript object with hits, misses, and entries
|
|
36
|
+
* @returns {any}
|
|
37
|
+
*/
|
|
38
|
+
cacheStats() {
|
|
39
|
+
try {
|
|
40
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
41
|
+
wasm.jsonevalwasm_cacheStats(retptr, this.__wbg_ptr);
|
|
42
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
43
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
44
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
45
|
+
if (r2) {
|
|
46
|
+
throw takeObject(r1);
|
|
47
|
+
}
|
|
48
|
+
return takeObject(r0);
|
|
49
|
+
} finally {
|
|
50
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* Cancel any currently running operation
|
|
55
|
+
*/
|
|
56
|
+
cancel() {
|
|
57
|
+
wasm.jsonevalwasm_cancel(this.__wbg_ptr);
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* Clear the evaluation cache
|
|
61
|
+
*/
|
|
62
|
+
clearCache() {
|
|
63
|
+
wasm.jsonevalwasm_clearCache(this.__wbg_ptr);
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* Compile and run JSON logic from a JSON logic string
|
|
67
|
+
* @param logic_str - JSON logic expression as a string
|
|
68
|
+
* @param data - Optional JSON data string
|
|
69
|
+
* @param context - Optional JSON context string
|
|
70
|
+
* @returns Result as JavaScript object
|
|
71
|
+
* @param {string} logic_str
|
|
72
|
+
* @param {string | null} [data]
|
|
255
73
|
* @param {string | null} [context]
|
|
256
|
-
* @param {string[] | null} [paths]
|
|
257
74
|
* @returns {any}
|
|
258
75
|
*/
|
|
259
|
-
|
|
76
|
+
compileAndRunLogic(logic_str, data, context) {
|
|
260
77
|
try {
|
|
261
78
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
262
|
-
const ptr0 = passStringToWasm0(
|
|
79
|
+
const ptr0 = passStringToWasm0(logic_str, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
263
80
|
const len0 = WASM_VECTOR_LEN;
|
|
264
|
-
var ptr1 = isLikeNone(
|
|
81
|
+
var ptr1 = isLikeNone(data) ? 0 : passStringToWasm0(data, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
265
82
|
var len1 = WASM_VECTOR_LEN;
|
|
266
|
-
var ptr2 = isLikeNone(
|
|
83
|
+
var ptr2 = isLikeNone(context) ? 0 : passStringToWasm0(context, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
267
84
|
var len2 = WASM_VECTOR_LEN;
|
|
268
|
-
wasm.
|
|
85
|
+
wasm.jsonevalwasm_compileAndRunLogic(retptr, this.__wbg_ptr, ptr0, len0, ptr1, len1, ptr2, len2);
|
|
269
86
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
270
87
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
271
88
|
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
@@ -287,7 +104,7 @@ export class JSONEvalWasm {
|
|
|
287
104
|
compileLogic(logic_str) {
|
|
288
105
|
try {
|
|
289
106
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
290
|
-
const ptr0 = passStringToWasm0(logic_str, wasm.
|
|
107
|
+
const ptr0 = passStringToWasm0(logic_str, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
291
108
|
const len0 = WASM_VECTOR_LEN;
|
|
292
109
|
wasm.jsonevalwasm_compileLogic(retptr, this.__wbg_ptr, ptr0, len0);
|
|
293
110
|
var r0 = getDataViewMemory0().getFloat64(retptr + 8 * 0, true);
|
|
@@ -302,110 +119,90 @@ export class JSONEvalWasm {
|
|
|
302
119
|
}
|
|
303
120
|
}
|
|
304
121
|
/**
|
|
305
|
-
*
|
|
306
|
-
*
|
|
307
|
-
*
|
|
308
|
-
* @param data - Optional updated JSON data string
|
|
309
|
-
* @param context - Optional context data JSON string
|
|
310
|
-
* @returns Array of dependent change objects as JSON string
|
|
311
|
-
* @param {string} changed_path
|
|
312
|
-
* @param {string | null | undefined} data
|
|
313
|
-
* @param {string | null | undefined} context
|
|
314
|
-
* @param {boolean} re_evaluate
|
|
315
|
-
* @returns {string}
|
|
122
|
+
* Disable evaluation caching
|
|
123
|
+
* Useful for web API usage where each request creates a new JSONEval instance
|
|
124
|
+
* Improves performance by skipping cache operations that have no benefit for single-use instances
|
|
316
125
|
*/
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
let deferred5_1;
|
|
320
|
-
try {
|
|
321
|
-
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
322
|
-
const ptr0 = passStringToWasm0(changed_path, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
323
|
-
const len0 = WASM_VECTOR_LEN;
|
|
324
|
-
var ptr1 = isLikeNone(data) ? 0 : passStringToWasm0(data, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
325
|
-
var len1 = WASM_VECTOR_LEN;
|
|
326
|
-
var ptr2 = isLikeNone(context) ? 0 : passStringToWasm0(context, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
327
|
-
var len2 = WASM_VECTOR_LEN;
|
|
328
|
-
wasm.jsonevalwasm_evaluateDependents(retptr, this.__wbg_ptr, ptr0, len0, ptr1, len1, ptr2, len2, re_evaluate);
|
|
329
|
-
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
330
|
-
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
331
|
-
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
332
|
-
var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
|
|
333
|
-
var ptr4 = r0;
|
|
334
|
-
var len4 = r1;
|
|
335
|
-
if (r3) {
|
|
336
|
-
ptr4 = 0; len4 = 0;
|
|
337
|
-
throw takeObject(r2);
|
|
338
|
-
}
|
|
339
|
-
deferred5_0 = ptr4;
|
|
340
|
-
deferred5_1 = len4;
|
|
341
|
-
return getStringFromWasm0(ptr4, len4);
|
|
342
|
-
} finally {
|
|
343
|
-
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
344
|
-
wasm.__wbindgen_export_2(deferred5_0, deferred5_1, 1);
|
|
345
|
-
}
|
|
126
|
+
disableCache() {
|
|
127
|
+
wasm.jsonevalwasm_disableCache(this.__wbg_ptr);
|
|
346
128
|
}
|
|
347
129
|
/**
|
|
348
|
-
*
|
|
349
|
-
*
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
130
|
+
* Enable evaluation caching
|
|
131
|
+
* Useful for reusing JSONEval instances with different data
|
|
132
|
+
*/
|
|
133
|
+
enableCache() {
|
|
134
|
+
wasm.jsonevalwasm_enableCache(this.__wbg_ptr);
|
|
135
|
+
}
|
|
136
|
+
/**
|
|
137
|
+
* Evaluate schema with provided data (does not return schema - use getEvaluatedSchema() for that)
|
|
138
|
+
*
|
|
139
|
+
* @param data - JSON data string
|
|
140
|
+
* @param context - Optional context data JSON string
|
|
141
|
+
* @throws Error if evaluation fails
|
|
142
|
+
* @param {string} data
|
|
355
143
|
* @param {string | null} [context]
|
|
356
|
-
* @
|
|
144
|
+
* @param {string[] | null} [paths]
|
|
357
145
|
*/
|
|
358
|
-
|
|
146
|
+
evaluate(data, context, paths) {
|
|
359
147
|
try {
|
|
360
148
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
361
|
-
const ptr0 = passStringToWasm0(
|
|
149
|
+
const ptr0 = passStringToWasm0(data, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
362
150
|
const len0 = WASM_VECTOR_LEN;
|
|
363
|
-
var ptr1 = isLikeNone(
|
|
151
|
+
var ptr1 = isLikeNone(context) ? 0 : passStringToWasm0(context, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
364
152
|
var len1 = WASM_VECTOR_LEN;
|
|
365
|
-
var ptr2 = isLikeNone(
|
|
153
|
+
var ptr2 = isLikeNone(paths) ? 0 : passArrayJsValueToWasm0(paths, wasm.__wbindgen_export);
|
|
366
154
|
var len2 = WASM_VECTOR_LEN;
|
|
367
|
-
wasm.
|
|
155
|
+
wasm.jsonevalwasm_evaluate(retptr, this.__wbg_ptr, ptr0, len0, ptr1, len1, ptr2, len2);
|
|
368
156
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
369
157
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
throw takeObject(r1);
|
|
158
|
+
if (r1) {
|
|
159
|
+
throw takeObject(r0);
|
|
373
160
|
}
|
|
374
|
-
return takeObject(r0);
|
|
375
161
|
} finally {
|
|
376
162
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
377
163
|
}
|
|
378
|
-
}
|
|
379
|
-
/**
|
|
380
|
-
*
|
|
381
|
-
*
|
|
382
|
-
* @param
|
|
383
|
-
* @param
|
|
384
|
-
* @
|
|
385
|
-
* @
|
|
386
|
-
* @param {string
|
|
387
|
-
* @param {string | null}
|
|
388
|
-
* @
|
|
164
|
+
}
|
|
165
|
+
/**
|
|
166
|
+
* Evaluate dependents when a field changes (returns array of changes as JSON string)
|
|
167
|
+
*
|
|
168
|
+
* @param changedPath - Path of the field that changed
|
|
169
|
+
* @param data - Optional updated JSON data string
|
|
170
|
+
* @param context - Optional context data JSON string
|
|
171
|
+
* @returns Array of dependent change objects as JSON string
|
|
172
|
+
* @param {string} changed_path
|
|
173
|
+
* @param {string | null | undefined} data
|
|
174
|
+
* @param {string | null | undefined} context
|
|
175
|
+
* @param {boolean} re_evaluate
|
|
176
|
+
* @returns {string}
|
|
389
177
|
*/
|
|
390
|
-
|
|
178
|
+
evaluateDependents(changed_path, data, context, re_evaluate) {
|
|
179
|
+
let deferred5_0;
|
|
180
|
+
let deferred5_1;
|
|
391
181
|
try {
|
|
392
182
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
393
|
-
const ptr0 = passStringToWasm0(
|
|
183
|
+
const ptr0 = passStringToWasm0(changed_path, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
394
184
|
const len0 = WASM_VECTOR_LEN;
|
|
395
|
-
var ptr1 = isLikeNone(data) ? 0 : passStringToWasm0(data, wasm.
|
|
185
|
+
var ptr1 = isLikeNone(data) ? 0 : passStringToWasm0(data, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
396
186
|
var len1 = WASM_VECTOR_LEN;
|
|
397
|
-
var ptr2 = isLikeNone(context) ? 0 : passStringToWasm0(context, wasm.
|
|
187
|
+
var ptr2 = isLikeNone(context) ? 0 : passStringToWasm0(context, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
398
188
|
var len2 = WASM_VECTOR_LEN;
|
|
399
|
-
wasm.
|
|
189
|
+
wasm.jsonevalwasm_evaluateDependents(retptr, this.__wbg_ptr, ptr0, len0, ptr1, len1, ptr2, len2, re_evaluate);
|
|
400
190
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
401
191
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
402
192
|
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
403
|
-
|
|
404
|
-
|
|
193
|
+
var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
|
|
194
|
+
var ptr4 = r0;
|
|
195
|
+
var len4 = r1;
|
|
196
|
+
if (r3) {
|
|
197
|
+
ptr4 = 0; len4 = 0;
|
|
198
|
+
throw takeObject(r2);
|
|
405
199
|
}
|
|
406
|
-
|
|
200
|
+
deferred5_0 = ptr4;
|
|
201
|
+
deferred5_1 = len4;
|
|
202
|
+
return getStringFromWasm0(ptr4, len4);
|
|
407
203
|
} finally {
|
|
408
204
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
205
|
+
wasm.__wbindgen_export3(deferred5_0, deferred5_1, 1);
|
|
409
206
|
}
|
|
410
207
|
}
|
|
411
208
|
/**
|
|
@@ -425,11 +222,11 @@ export class JSONEvalWasm {
|
|
|
425
222
|
evaluateDependentsJS(changed_paths_json, data, context, re_evaluate) {
|
|
426
223
|
try {
|
|
427
224
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
428
|
-
const ptr0 = passStringToWasm0(changed_paths_json, wasm.
|
|
225
|
+
const ptr0 = passStringToWasm0(changed_paths_json, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
429
226
|
const len0 = WASM_VECTOR_LEN;
|
|
430
|
-
var ptr1 = isLikeNone(data) ? 0 : passStringToWasm0(data, wasm.
|
|
227
|
+
var ptr1 = isLikeNone(data) ? 0 : passStringToWasm0(data, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
431
228
|
var len1 = WASM_VECTOR_LEN;
|
|
432
|
-
var ptr2 = isLikeNone(context) ? 0 : passStringToWasm0(context, wasm.
|
|
229
|
+
var ptr2 = isLikeNone(context) ? 0 : passStringToWasm0(context, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
433
230
|
var len2 = WASM_VECTOR_LEN;
|
|
434
231
|
wasm.jsonevalwasm_evaluateDependentsJS(retptr, this.__wbg_ptr, ptr0, len0, ptr1, len1, ptr2, len2, re_evaluate);
|
|
435
232
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
@@ -444,82 +241,79 @@ export class JSONEvalWasm {
|
|
|
444
241
|
}
|
|
445
242
|
}
|
|
446
243
|
/**
|
|
447
|
-
* Evaluate
|
|
244
|
+
* Evaluate dependents in subform when fields change
|
|
448
245
|
*
|
|
449
|
-
* @param
|
|
246
|
+
* @param subformPath - Path to the subform
|
|
247
|
+
* @param changedPaths - JSON array of paths that changed
|
|
248
|
+
* @param data - Optional updated JSON data string
|
|
450
249
|
* @param context - Optional context data JSON string
|
|
451
|
-
* @
|
|
452
|
-
* @param {string}
|
|
453
|
-
* @param {string
|
|
454
|
-
* @param {string
|
|
250
|
+
* @returns Array of dependent change objects as JSON string
|
|
251
|
+
* @param {string} subform_path
|
|
252
|
+
* @param {string} changed_paths_json
|
|
253
|
+
* @param {string | null | undefined} data
|
|
254
|
+
* @param {string | null | undefined} context
|
|
255
|
+
* @param {boolean} re_evaluate
|
|
256
|
+
* @returns {string}
|
|
455
257
|
*/
|
|
456
|
-
|
|
258
|
+
evaluateDependentsSubform(subform_path, changed_paths_json, data, context, re_evaluate) {
|
|
259
|
+
let deferred6_0;
|
|
260
|
+
let deferred6_1;
|
|
457
261
|
try {
|
|
458
262
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
459
|
-
const ptr0 = passStringToWasm0(
|
|
263
|
+
const ptr0 = passStringToWasm0(subform_path, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
460
264
|
const len0 = WASM_VECTOR_LEN;
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
var ptr2 = isLikeNone(
|
|
265
|
+
const ptr1 = passStringToWasm0(changed_paths_json, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
266
|
+
const len1 = WASM_VECTOR_LEN;
|
|
267
|
+
var ptr2 = isLikeNone(data) ? 0 : passStringToWasm0(data, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
464
268
|
var len2 = WASM_VECTOR_LEN;
|
|
465
|
-
|
|
466
|
-
var
|
|
467
|
-
|
|
468
|
-
if (r1) {
|
|
469
|
-
throw takeObject(r0);
|
|
470
|
-
}
|
|
471
|
-
} finally {
|
|
472
|
-
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
473
|
-
}
|
|
474
|
-
}
|
|
475
|
-
/**
|
|
476
|
-
* Run pre-compiled logic by ID
|
|
477
|
-
* @param logic_id - Compiled logic ID from compileLogic
|
|
478
|
-
* @param data - Optional JSON data string
|
|
479
|
-
* @param context - Optional JSON context string
|
|
480
|
-
* @returns Result as JavaScript object
|
|
481
|
-
* @param {number} logic_id
|
|
482
|
-
* @param {string | null} [data]
|
|
483
|
-
* @param {string | null} [context]
|
|
484
|
-
* @returns {any}
|
|
485
|
-
*/
|
|
486
|
-
runLogic(logic_id, data, context) {
|
|
487
|
-
try {
|
|
488
|
-
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
489
|
-
var ptr0 = isLikeNone(data) ? 0 : passStringToWasm0(data, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
490
|
-
var len0 = WASM_VECTOR_LEN;
|
|
491
|
-
var ptr1 = isLikeNone(context) ? 0 : passStringToWasm0(context, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
492
|
-
var len1 = WASM_VECTOR_LEN;
|
|
493
|
-
wasm.jsonevalwasm_runLogic(retptr, this.__wbg_ptr, logic_id, ptr0, len0, ptr1, len1);
|
|
269
|
+
var ptr3 = isLikeNone(context) ? 0 : passStringToWasm0(context, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
270
|
+
var len3 = WASM_VECTOR_LEN;
|
|
271
|
+
wasm.jsonevalwasm_evaluateDependentsSubform(retptr, this.__wbg_ptr, ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3, re_evaluate);
|
|
494
272
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
495
273
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
496
274
|
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
497
|
-
|
|
498
|
-
|
|
275
|
+
var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
|
|
276
|
+
var ptr5 = r0;
|
|
277
|
+
var len5 = r1;
|
|
278
|
+
if (r3) {
|
|
279
|
+
ptr5 = 0; len5 = 0;
|
|
280
|
+
throw takeObject(r2);
|
|
499
281
|
}
|
|
500
|
-
|
|
282
|
+
deferred6_0 = ptr5;
|
|
283
|
+
deferred6_1 = len5;
|
|
284
|
+
return getStringFromWasm0(ptr5, len5);
|
|
501
285
|
} finally {
|
|
502
286
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
287
|
+
wasm.__wbindgen_export3(deferred6_0, deferred6_1, 1);
|
|
503
288
|
}
|
|
504
289
|
}
|
|
505
290
|
/**
|
|
506
|
-
*
|
|
291
|
+
* Evaluate dependents in subform and return as JavaScript object
|
|
507
292
|
*
|
|
508
|
-
* @param
|
|
293
|
+
* @param subformPath - Path to the subform
|
|
294
|
+
* @param changedPath - Path of the field that changed
|
|
295
|
+
* @param data - Optional updated JSON data string
|
|
509
296
|
* @param context - Optional context data JSON string
|
|
510
|
-
* @returns
|
|
511
|
-
* @param {string}
|
|
512
|
-
* @param {string
|
|
297
|
+
* @returns Array of dependent change objects as JavaScript object
|
|
298
|
+
* @param {string} subform_path
|
|
299
|
+
* @param {string} changed_paths_json
|
|
300
|
+
* @param {string | null | undefined} data
|
|
301
|
+
* @param {string | null | undefined} context
|
|
302
|
+
* @param {boolean} re_evaluate
|
|
513
303
|
* @returns {any}
|
|
514
304
|
*/
|
|
515
|
-
|
|
305
|
+
evaluateDependentsSubformJS(subform_path, changed_paths_json, data, context, re_evaluate) {
|
|
516
306
|
try {
|
|
517
307
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
518
|
-
const ptr0 = passStringToWasm0(
|
|
308
|
+
const ptr0 = passStringToWasm0(subform_path, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
519
309
|
const len0 = WASM_VECTOR_LEN;
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
310
|
+
const ptr1 = passStringToWasm0(changed_paths_json, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
311
|
+
const len1 = WASM_VECTOR_LEN;
|
|
312
|
+
var ptr2 = isLikeNone(data) ? 0 : passStringToWasm0(data, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
313
|
+
var len2 = WASM_VECTOR_LEN;
|
|
314
|
+
var ptr3 = isLikeNone(context) ? 0 : passStringToWasm0(context, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
315
|
+
var len3 = WASM_VECTOR_LEN;
|
|
316
|
+
wasm.jsonevalwasm_evaluateDependentsSubformJS(retptr, this.__wbg_ptr, ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3, re_evaluate);
|
|
523
317
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
524
318
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
525
319
|
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
@@ -532,60 +326,58 @@ export class JSONEvalWasm {
|
|
|
532
326
|
}
|
|
533
327
|
}
|
|
534
328
|
/**
|
|
535
|
-
*
|
|
329
|
+
* Evaluate and return as JsValue for direct JavaScript object access
|
|
536
330
|
*
|
|
537
331
|
* @param data - JSON data string
|
|
538
332
|
* @param context - Optional context data JSON string
|
|
539
|
-
* @
|
|
540
|
-
* @returns ValidationResult
|
|
333
|
+
* @returns Evaluated schema as JavaScript object
|
|
541
334
|
* @param {string} data
|
|
542
335
|
* @param {string | null} [context]
|
|
543
336
|
* @param {string[] | null} [paths]
|
|
544
|
-
* @returns {
|
|
337
|
+
* @returns {any}
|
|
545
338
|
*/
|
|
546
|
-
|
|
339
|
+
evaluateJS(data, context, paths) {
|
|
547
340
|
try {
|
|
548
341
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
549
|
-
const ptr0 = passStringToWasm0(data, wasm.
|
|
342
|
+
const ptr0 = passStringToWasm0(data, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
550
343
|
const len0 = WASM_VECTOR_LEN;
|
|
551
|
-
var ptr1 = isLikeNone(context) ? 0 : passStringToWasm0(context, wasm.
|
|
344
|
+
var ptr1 = isLikeNone(context) ? 0 : passStringToWasm0(context, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
552
345
|
var len1 = WASM_VECTOR_LEN;
|
|
553
|
-
var ptr2 = isLikeNone(paths) ? 0 : passArrayJsValueToWasm0(paths, wasm.
|
|
346
|
+
var ptr2 = isLikeNone(paths) ? 0 : passArrayJsValueToWasm0(paths, wasm.__wbindgen_export);
|
|
554
347
|
var len2 = WASM_VECTOR_LEN;
|
|
555
|
-
wasm.
|
|
348
|
+
wasm.jsonevalwasm_evaluateJS(retptr, this.__wbg_ptr, ptr0, len0, ptr1, len1, ptr2, len2);
|
|
556
349
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
557
350
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
558
351
|
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
559
352
|
if (r2) {
|
|
560
353
|
throw takeObject(r1);
|
|
561
354
|
}
|
|
562
|
-
return
|
|
355
|
+
return takeObject(r0);
|
|
563
356
|
} finally {
|
|
564
357
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
565
358
|
}
|
|
566
359
|
}
|
|
567
360
|
/**
|
|
568
|
-
*
|
|
569
|
-
*
|
|
570
|
-
* @param data - JSON data string
|
|
571
|
-
* @param context - Optional context
|
|
572
|
-
* @
|
|
573
|
-
* @
|
|
574
|
-
* @param {string} data
|
|
361
|
+
* Static helper to evaluate logic without creating an instance
|
|
362
|
+
* @param logic_str - JSON logic expression string
|
|
363
|
+
* @param data - Optional JSON data string
|
|
364
|
+
* @param context - Optional JSON context string
|
|
365
|
+
* @returns Result as JavaScript object
|
|
366
|
+
* @param {string} logic_str
|
|
367
|
+
* @param {string | null} [data]
|
|
575
368
|
* @param {string | null} [context]
|
|
576
|
-
* @param {string[] | null} [paths]
|
|
577
369
|
* @returns {any}
|
|
578
370
|
*/
|
|
579
|
-
|
|
371
|
+
static evaluateLogic(logic_str, data, context) {
|
|
580
372
|
try {
|
|
581
373
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
582
|
-
const ptr0 = passStringToWasm0(
|
|
374
|
+
const ptr0 = passStringToWasm0(logic_str, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
583
375
|
const len0 = WASM_VECTOR_LEN;
|
|
584
|
-
var ptr1 = isLikeNone(
|
|
376
|
+
var ptr1 = isLikeNone(data) ? 0 : passStringToWasm0(data, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
585
377
|
var len1 = WASM_VECTOR_LEN;
|
|
586
|
-
var ptr2 = isLikeNone(
|
|
378
|
+
var ptr2 = isLikeNone(context) ? 0 : passStringToWasm0(context, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
587
379
|
var len2 = WASM_VECTOR_LEN;
|
|
588
|
-
wasm.
|
|
380
|
+
wasm.jsonevalwasm_evaluateLogic(retptr, ptr0, len0, ptr1, len1, ptr2, len2);
|
|
589
381
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
590
382
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
591
383
|
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
@@ -598,157 +390,170 @@ export class JSONEvalWasm {
|
|
|
598
390
|
}
|
|
599
391
|
}
|
|
600
392
|
/**
|
|
601
|
-
*
|
|
393
|
+
* Evaluate a subform with data
|
|
602
394
|
*
|
|
603
|
-
* @param
|
|
395
|
+
* @param subformPath - Path to the subform (e.g., "#/riders")
|
|
396
|
+
* @param data - JSON data string for the subform
|
|
604
397
|
* @param context - Optional context data JSON string
|
|
605
|
-
* @
|
|
398
|
+
* @param paths - Optional array of paths to evaluate (JSON string array)
|
|
399
|
+
* @throws Error if evaluation fails
|
|
400
|
+
* @param {string} subform_path
|
|
606
401
|
* @param {string} data
|
|
607
402
|
* @param {string | null} [context]
|
|
608
|
-
* @
|
|
403
|
+
* @param {string[] | null} [paths]
|
|
609
404
|
*/
|
|
610
|
-
|
|
405
|
+
evaluateSubform(subform_path, data, context, paths) {
|
|
611
406
|
try {
|
|
612
407
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
613
|
-
const ptr0 = passStringToWasm0(
|
|
408
|
+
const ptr0 = passStringToWasm0(subform_path, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
614
409
|
const len0 = WASM_VECTOR_LEN;
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
410
|
+
const ptr1 = passStringToWasm0(data, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
411
|
+
const len1 = WASM_VECTOR_LEN;
|
|
412
|
+
var ptr2 = isLikeNone(context) ? 0 : passStringToWasm0(context, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
413
|
+
var len2 = WASM_VECTOR_LEN;
|
|
414
|
+
var ptr3 = isLikeNone(paths) ? 0 : passArrayJsValueToWasm0(paths, wasm.__wbindgen_export);
|
|
415
|
+
var len3 = WASM_VECTOR_LEN;
|
|
416
|
+
wasm.jsonevalwasm_evaluateSubform(retptr, this.__wbg_ptr, ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3);
|
|
618
417
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
619
418
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
throw takeObject(r1);
|
|
419
|
+
if (r1) {
|
|
420
|
+
throw takeObject(r0);
|
|
623
421
|
}
|
|
624
|
-
return ValidationResult.__wrap(r0);
|
|
625
422
|
} finally {
|
|
626
423
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
627
424
|
}
|
|
628
425
|
}
|
|
629
426
|
/**
|
|
630
|
-
*
|
|
427
|
+
* Get the evaluated schema with optional layout resolution
|
|
631
428
|
*
|
|
632
|
-
* @param
|
|
633
|
-
* @
|
|
634
|
-
* @param
|
|
635
|
-
* @
|
|
636
|
-
* @param {string | null} [context]
|
|
637
|
-
* @param {string | null} [data]
|
|
638
|
-
* @returns {JSONEvalWasm}
|
|
429
|
+
* @param skipLayout - Whether to skip layout resolution
|
|
430
|
+
* @returns Evaluated schema as JSON string
|
|
431
|
+
* @param {boolean} skip_layout
|
|
432
|
+
* @returns {string}
|
|
639
433
|
*/
|
|
640
|
-
|
|
434
|
+
getEvaluatedSchema(skip_layout) {
|
|
435
|
+
let deferred1_0;
|
|
436
|
+
let deferred1_1;
|
|
641
437
|
try {
|
|
642
438
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
643
|
-
|
|
644
|
-
const len0 = WASM_VECTOR_LEN;
|
|
645
|
-
var ptr1 = isLikeNone(context) ? 0 : passStringToWasm0(context, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
646
|
-
var len1 = WASM_VECTOR_LEN;
|
|
647
|
-
var ptr2 = isLikeNone(data) ? 0 : passStringToWasm0(data, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
648
|
-
var len2 = WASM_VECTOR_LEN;
|
|
649
|
-
wasm.jsonevalwasm_newFromCache(retptr, ptr0, len0, ptr1, len1, ptr2, len2);
|
|
439
|
+
wasm.jsonevalwasm_getEvaluatedSchema(retptr, this.__wbg_ptr, skip_layout);
|
|
650
440
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
651
441
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
}
|
|
656
|
-
return JSONEvalWasm.__wrap(r0);
|
|
442
|
+
deferred1_0 = r0;
|
|
443
|
+
deferred1_1 = r1;
|
|
444
|
+
return getStringFromWasm0(r0, r1);
|
|
657
445
|
} finally {
|
|
658
446
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
447
|
+
wasm.__wbindgen_export3(deferred1_0, deferred1_1, 1);
|
|
659
448
|
}
|
|
660
449
|
}
|
|
661
450
|
/**
|
|
662
|
-
*
|
|
451
|
+
* Get a value from the evaluated schema using dotted path notation
|
|
663
452
|
*
|
|
664
|
-
* @param
|
|
665
|
-
* @param
|
|
666
|
-
* @
|
|
667
|
-
* @param {
|
|
668
|
-
* @param {
|
|
669
|
-
* @
|
|
670
|
-
* @returns {JSONEvalWasm}
|
|
453
|
+
* @param path - Dotted path to the value (e.g., "properties.field.value")
|
|
454
|
+
* @param skipLayout - Whether to skip layout resolution
|
|
455
|
+
* @returns Value as JSON string or null if not found
|
|
456
|
+
* @param {string} path
|
|
457
|
+
* @param {boolean} skip_layout
|
|
458
|
+
* @returns {string | undefined}
|
|
671
459
|
*/
|
|
672
|
-
|
|
460
|
+
getEvaluatedSchemaByPath(path, skip_layout) {
|
|
673
461
|
try {
|
|
674
462
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
675
|
-
const ptr0 =
|
|
463
|
+
const ptr0 = passStringToWasm0(path, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
676
464
|
const len0 = WASM_VECTOR_LEN;
|
|
677
|
-
|
|
678
|
-
var len1 = WASM_VECTOR_LEN;
|
|
679
|
-
var ptr2 = isLikeNone(data) ? 0 : passStringToWasm0(data, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
680
|
-
var len2 = WASM_VECTOR_LEN;
|
|
681
|
-
wasm.jsonevalwasm_newFromMsgpack(retptr, ptr0, len0, ptr1, len1, ptr2, len2);
|
|
465
|
+
wasm.jsonevalwasm_getEvaluatedSchemaByPath(retptr, this.__wbg_ptr, ptr0, len0, skip_layout);
|
|
682
466
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
683
467
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
684
|
-
|
|
685
|
-
if (
|
|
686
|
-
|
|
468
|
+
let v2;
|
|
469
|
+
if (r0 !== 0) {
|
|
470
|
+
v2 = getStringFromWasm0(r0, r1).slice();
|
|
471
|
+
wasm.__wbindgen_export3(r0, r1 * 1, 1);
|
|
687
472
|
}
|
|
688
|
-
return
|
|
473
|
+
return v2;
|
|
689
474
|
} finally {
|
|
690
475
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
691
476
|
}
|
|
692
477
|
}
|
|
693
478
|
/**
|
|
694
|
-
*
|
|
695
|
-
*
|
|
696
|
-
* @param offsetMinutes - Timezone offset in minutes from UTC (e.g., 420 for UTC+7, -300 for UTC-5)
|
|
697
|
-
* Pass null or undefined to reset to UTC
|
|
698
|
-
* @param {number | null} [offset_minutes]
|
|
699
|
-
*/
|
|
700
|
-
setTimezoneOffset(offset_minutes) {
|
|
701
|
-
wasm.jsonevalwasm_setTimezoneOffset(this.__wbg_ptr, isLikeNone(offset_minutes) ? 0x100000001 : (offset_minutes) >> 0);
|
|
702
|
-
}
|
|
703
|
-
/**
|
|
704
|
-
* Create a new JSONEval instance
|
|
479
|
+
* Get a value from the evaluated schema using dotted path notation as JavaScript object
|
|
705
480
|
*
|
|
706
|
-
* @param
|
|
707
|
-
* @param
|
|
708
|
-
* @
|
|
709
|
-
* @param {string}
|
|
710
|
-
* @param {
|
|
711
|
-
* @
|
|
481
|
+
* @param path - Dotted path to the value (e.g., "properties.field.value")
|
|
482
|
+
* @param skipLayout - Whether to skip layout resolution
|
|
483
|
+
* @returns Value as JavaScript object or null if not found
|
|
484
|
+
* @param {string} path
|
|
485
|
+
* @param {boolean} skip_layout
|
|
486
|
+
* @returns {any}
|
|
712
487
|
*/
|
|
713
|
-
|
|
488
|
+
getEvaluatedSchemaByPathJS(path, skip_layout) {
|
|
714
489
|
try {
|
|
715
490
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
716
|
-
const ptr0 = passStringToWasm0(
|
|
491
|
+
const ptr0 = passStringToWasm0(path, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
717
492
|
const len0 = WASM_VECTOR_LEN;
|
|
718
|
-
|
|
719
|
-
var len1 = WASM_VECTOR_LEN;
|
|
720
|
-
var ptr2 = isLikeNone(data) ? 0 : passStringToWasm0(data, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
721
|
-
var len2 = WASM_VECTOR_LEN;
|
|
722
|
-
wasm.jsonevalwasm_new(retptr, ptr0, len0, ptr1, len1, ptr2, len2);
|
|
493
|
+
wasm.jsonevalwasm_getEvaluatedSchemaByPathJS(retptr, this.__wbg_ptr, ptr0, len0, skip_layout);
|
|
723
494
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
724
495
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
725
496
|
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
726
497
|
if (r2) {
|
|
727
498
|
throw takeObject(r1);
|
|
728
499
|
}
|
|
729
|
-
|
|
730
|
-
JSONEvalWasmFinalization.register(this, this.__wbg_ptr, this);
|
|
731
|
-
return this;
|
|
500
|
+
return takeObject(r0);
|
|
732
501
|
} finally {
|
|
733
502
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
734
503
|
}
|
|
735
504
|
}
|
|
736
505
|
/**
|
|
737
|
-
*
|
|
506
|
+
* Get evaluated schema by specific path from subform
|
|
507
|
+
*
|
|
508
|
+
* @param subformPath - Path to the subform
|
|
509
|
+
* @param schemaPath - Dotted path to the value within the subform
|
|
510
|
+
* @param skipLayout - Whether to skip layout resolution
|
|
511
|
+
* @returns Value as JSON string or null if not found
|
|
512
|
+
* @param {string} subform_path
|
|
513
|
+
* @param {string} schema_path
|
|
514
|
+
* @param {boolean} skip_layout
|
|
515
|
+
* @returns {string | undefined}
|
|
738
516
|
*/
|
|
739
|
-
|
|
740
|
-
|
|
517
|
+
getEvaluatedSchemaByPathSubform(subform_path, schema_path, skip_layout) {
|
|
518
|
+
try {
|
|
519
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
520
|
+
const ptr0 = passStringToWasm0(subform_path, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
521
|
+
const len0 = WASM_VECTOR_LEN;
|
|
522
|
+
const ptr1 = passStringToWasm0(schema_path, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
523
|
+
const len1 = WASM_VECTOR_LEN;
|
|
524
|
+
wasm.jsonevalwasm_getEvaluatedSchemaByPathSubform(retptr, this.__wbg_ptr, ptr0, len0, ptr1, len1, skip_layout);
|
|
525
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
526
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
527
|
+
let v3;
|
|
528
|
+
if (r0 !== 0) {
|
|
529
|
+
v3 = getStringFromWasm0(r0, r1).slice();
|
|
530
|
+
wasm.__wbindgen_export3(r0, r1 * 1, 1);
|
|
531
|
+
}
|
|
532
|
+
return v3;
|
|
533
|
+
} finally {
|
|
534
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
535
|
+
}
|
|
741
536
|
}
|
|
742
537
|
/**
|
|
743
|
-
* Get
|
|
538
|
+
* Get evaluated schema by specific path from subform as JavaScript object
|
|
744
539
|
*
|
|
745
|
-
* @
|
|
540
|
+
* @param subformPath - Path to the subform
|
|
541
|
+
* @param schemaPath - Dotted path to the value within the subform
|
|
542
|
+
* @param skipLayout - Whether to skip layout resolution
|
|
543
|
+
* @returns Value as JavaScript object or null if not found
|
|
544
|
+
* @param {string} subform_path
|
|
545
|
+
* @param {string} schema_path
|
|
546
|
+
* @param {boolean} skip_layout
|
|
746
547
|
* @returns {any}
|
|
747
548
|
*/
|
|
748
|
-
|
|
549
|
+
getEvaluatedSchemaByPathSubformJS(subform_path, schema_path, skip_layout) {
|
|
749
550
|
try {
|
|
750
551
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
751
|
-
wasm.
|
|
552
|
+
const ptr0 = passStringToWasm0(subform_path, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
553
|
+
const len0 = WASM_VECTOR_LEN;
|
|
554
|
+
const ptr1 = passStringToWasm0(schema_path, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
555
|
+
const len1 = WASM_VECTOR_LEN;
|
|
556
|
+
wasm.jsonevalwasm_getEvaluatedSchemaByPathSubformJS(retptr, this.__wbg_ptr, ptr0, len0, ptr1, len1, skip_layout);
|
|
752
557
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
753
558
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
754
559
|
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
@@ -761,106 +566,132 @@ export class JSONEvalWasm {
|
|
|
761
566
|
}
|
|
762
567
|
}
|
|
763
568
|
/**
|
|
764
|
-
*
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
*
|
|
771
|
-
*
|
|
772
|
-
|
|
773
|
-
enableCache() {
|
|
774
|
-
wasm.jsonevalwasm_enableCache(this.__wbg_ptr);
|
|
775
|
-
}
|
|
776
|
-
/**
|
|
777
|
-
* Disable evaluation caching
|
|
778
|
-
* Useful for web API usage where each request creates a new JSONEval instance
|
|
779
|
-
* Improves performance by skipping cache operations that have no benefit for single-use instances
|
|
780
|
-
*/
|
|
781
|
-
disableCache() {
|
|
782
|
-
wasm.jsonevalwasm_disableCache(this.__wbg_ptr);
|
|
783
|
-
}
|
|
784
|
-
/**
|
|
785
|
-
* Check if evaluation caching is enabled
|
|
786
|
-
*
|
|
787
|
-
* @returns true if caching is enabled, false otherwise
|
|
788
|
-
* @returns {boolean}
|
|
789
|
-
*/
|
|
790
|
-
isCacheEnabled() {
|
|
791
|
-
const ret = wasm.jsonevalwasm_isCacheEnabled(this.__wbg_ptr);
|
|
792
|
-
return ret !== 0;
|
|
793
|
-
}
|
|
794
|
-
/**
|
|
795
|
-
* Get the number of cached entries
|
|
796
|
-
*
|
|
797
|
-
* @returns Number of cached entries
|
|
798
|
-
* @returns {number}
|
|
569
|
+
* Get values from evaluated schema using multiple dotted paths
|
|
570
|
+
* @param pathsJson - JSON array of dotted paths
|
|
571
|
+
* @param skipLayout - Whether to skip layout resolution
|
|
572
|
+
* @param format - Return format (0=Nested, 1=Flat, 2=Array)
|
|
573
|
+
* @returns Data in specified format as JSON string
|
|
574
|
+
* @param {string} paths_json
|
|
575
|
+
* @param {boolean} skip_layout
|
|
576
|
+
* @param {number} format
|
|
577
|
+
* @returns {string}
|
|
799
578
|
*/
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
579
|
+
getEvaluatedSchemaByPaths(paths_json, skip_layout, format) {
|
|
580
|
+
let deferred3_0;
|
|
581
|
+
let deferred3_1;
|
|
582
|
+
try {
|
|
583
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
584
|
+
const ptr0 = passStringToWasm0(paths_json, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
585
|
+
const len0 = WASM_VECTOR_LEN;
|
|
586
|
+
wasm.jsonevalwasm_getEvaluatedSchemaByPaths(retptr, this.__wbg_ptr, ptr0, len0, skip_layout, format);
|
|
587
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
588
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
589
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
590
|
+
var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
|
|
591
|
+
var ptr2 = r0;
|
|
592
|
+
var len2 = r1;
|
|
593
|
+
if (r3) {
|
|
594
|
+
ptr2 = 0; len2 = 0;
|
|
595
|
+
throw takeObject(r2);
|
|
596
|
+
}
|
|
597
|
+
deferred3_0 = ptr2;
|
|
598
|
+
deferred3_1 = len2;
|
|
599
|
+
return getStringFromWasm0(ptr2, len2);
|
|
600
|
+
} finally {
|
|
601
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
602
|
+
wasm.__wbindgen_export3(deferred3_0, deferred3_1, 1);
|
|
603
|
+
}
|
|
803
604
|
}
|
|
804
605
|
/**
|
|
805
|
-
*
|
|
806
|
-
*
|
|
807
|
-
* @param
|
|
808
|
-
* @
|
|
809
|
-
* @
|
|
606
|
+
* Get values from evaluated schema using multiple dotted paths (JS object)
|
|
607
|
+
* @param pathsJson - JSON array of dotted paths
|
|
608
|
+
* @param skipLayout - Whether to skip layout resolution
|
|
609
|
+
* @param format - Return format (0=Nested, 1=Flat, 2=Array)
|
|
610
|
+
* @returns Data in specified format as JavaScript object
|
|
611
|
+
* @param {string} paths_json
|
|
612
|
+
* @param {boolean} skip_layout
|
|
613
|
+
* @param {number} format
|
|
614
|
+
* @returns {any}
|
|
810
615
|
*/
|
|
811
|
-
|
|
616
|
+
getEvaluatedSchemaByPathsJS(paths_json, skip_layout, format) {
|
|
812
617
|
try {
|
|
813
618
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
814
|
-
|
|
619
|
+
const ptr0 = passStringToWasm0(paths_json, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
620
|
+
const len0 = WASM_VECTOR_LEN;
|
|
621
|
+
wasm.jsonevalwasm_getEvaluatedSchemaByPathsJS(retptr, this.__wbg_ptr, ptr0, len0, skip_layout, format);
|
|
815
622
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
816
623
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
817
|
-
|
|
818
|
-
|
|
624
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
625
|
+
if (r2) {
|
|
626
|
+
throw takeObject(r1);
|
|
819
627
|
}
|
|
628
|
+
return takeObject(r0);
|
|
820
629
|
} finally {
|
|
821
630
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
822
631
|
}
|
|
823
632
|
}
|
|
824
633
|
/**
|
|
825
|
-
*
|
|
826
|
-
*
|
|
827
|
-
* @param
|
|
828
|
-
* @param
|
|
829
|
-
* @param
|
|
830
|
-
* @
|
|
831
|
-
* @param {string
|
|
832
|
-
* @param {string
|
|
634
|
+
* Get values from the evaluated schema of a subform using multiple dotted path notations (returns JSON string)
|
|
635
|
+
* @param subformPath - Path to the subform
|
|
636
|
+
* @param pathsJson - JSON array of dotted paths
|
|
637
|
+
* @param skipLayout - Whether to skip layout resolution
|
|
638
|
+
* @param format - Return format (0=Nested, 1=Flat, 2=Array)
|
|
639
|
+
* @returns Data in specified format as JSON string
|
|
640
|
+
* @param {string} subform_path
|
|
641
|
+
* @param {string} paths_json
|
|
642
|
+
* @param {boolean} skip_layout
|
|
643
|
+
* @param {number} format
|
|
644
|
+
* @returns {string}
|
|
833
645
|
*/
|
|
834
|
-
|
|
646
|
+
getEvaluatedSchemaByPathsSubform(subform_path, paths_json, skip_layout, format) {
|
|
647
|
+
let deferred4_0;
|
|
648
|
+
let deferred4_1;
|
|
835
649
|
try {
|
|
836
650
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
837
|
-
const ptr0 = passStringToWasm0(
|
|
651
|
+
const ptr0 = passStringToWasm0(subform_path, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
838
652
|
const len0 = WASM_VECTOR_LEN;
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
var len2 = WASM_VECTOR_LEN;
|
|
843
|
-
wasm.jsonevalwasm_reloadSchema(retptr, this.__wbg_ptr, ptr0, len0, ptr1, len1, ptr2, len2);
|
|
653
|
+
const ptr1 = passStringToWasm0(paths_json, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
654
|
+
const len1 = WASM_VECTOR_LEN;
|
|
655
|
+
wasm.jsonevalwasm_getEvaluatedSchemaByPathsSubform(retptr, this.__wbg_ptr, ptr0, len0, ptr1, len1, skip_layout, format);
|
|
844
656
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
845
657
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
846
|
-
|
|
847
|
-
|
|
658
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
659
|
+
var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
|
|
660
|
+
var ptr3 = r0;
|
|
661
|
+
var len3 = r1;
|
|
662
|
+
if (r3) {
|
|
663
|
+
ptr3 = 0; len3 = 0;
|
|
664
|
+
throw takeObject(r2);
|
|
848
665
|
}
|
|
666
|
+
deferred4_0 = ptr3;
|
|
667
|
+
deferred4_1 = len3;
|
|
668
|
+
return getStringFromWasm0(ptr3, len3);
|
|
849
669
|
} finally {
|
|
850
670
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
671
|
+
wasm.__wbindgen_export3(deferred4_0, deferred4_1, 1);
|
|
851
672
|
}
|
|
852
673
|
}
|
|
853
674
|
/**
|
|
854
|
-
* Get
|
|
855
|
-
*
|
|
856
|
-
*
|
|
857
|
-
* @
|
|
675
|
+
* Get values from the evaluated schema of a subform using multiple dotted path notations (returns JS object)
|
|
676
|
+
* @param subformPath - Path to the subform
|
|
677
|
+
* @param paths - Array of dotted paths
|
|
678
|
+
* @param skipLayout - Whether to skip layout resolution
|
|
679
|
+
* @param format - Return format (0=Nested, 1=Flat, 2=Array)
|
|
680
|
+
* @returns Data in specified format as JavaScript object
|
|
681
|
+
* @param {string} subform_path
|
|
682
|
+
* @param {string} paths_json
|
|
683
|
+
* @param {boolean} skip_layout
|
|
684
|
+
* @param {number} format
|
|
858
685
|
* @returns {any}
|
|
859
686
|
*/
|
|
860
|
-
|
|
687
|
+
getEvaluatedSchemaByPathsSubformJS(subform_path, paths_json, skip_layout, format) {
|
|
861
688
|
try {
|
|
862
689
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
863
|
-
wasm.
|
|
690
|
+
const ptr0 = passStringToWasm0(subform_path, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
691
|
+
const len0 = WASM_VECTOR_LEN;
|
|
692
|
+
const ptr1 = passStringToWasm0(paths_json, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
693
|
+
const len1 = WASM_VECTOR_LEN;
|
|
694
|
+
wasm.jsonevalwasm_getEvaluatedSchemaByPathsSubformJS(retptr, this.__wbg_ptr, ptr0, len0, ptr1, len1, skip_layout, format);
|
|
864
695
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
865
696
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
866
697
|
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
@@ -873,104 +704,107 @@ export class JSONEvalWasm {
|
|
|
873
704
|
}
|
|
874
705
|
}
|
|
875
706
|
/**
|
|
876
|
-
* Get
|
|
707
|
+
* Get the evaluated schema as JavaScript object
|
|
877
708
|
*
|
|
878
|
-
* @param
|
|
879
|
-
* @returns
|
|
880
|
-
* @param {
|
|
881
|
-
* @returns {
|
|
709
|
+
* @param skipLayout - Whether to skip layout resolution
|
|
710
|
+
* @returns Evaluated schema as JavaScript object
|
|
711
|
+
* @param {boolean} skip_layout
|
|
712
|
+
* @returns {any}
|
|
882
713
|
*/
|
|
883
|
-
|
|
714
|
+
getEvaluatedSchemaJS(skip_layout) {
|
|
884
715
|
try {
|
|
885
716
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
886
|
-
|
|
887
|
-
const len0 = WASM_VECTOR_LEN;
|
|
888
|
-
wasm.jsonevalwasm_getSchemaByPath(retptr, this.__wbg_ptr, ptr0, len0);
|
|
717
|
+
wasm.jsonevalwasm_getEvaluatedSchemaJS(retptr, this.__wbg_ptr, skip_layout);
|
|
889
718
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
890
719
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
891
|
-
|
|
892
|
-
if (
|
|
893
|
-
|
|
894
|
-
wasm.__wbindgen_export_2(r0, r1 * 1, 1);
|
|
720
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
721
|
+
if (r2) {
|
|
722
|
+
throw takeObject(r1);
|
|
895
723
|
}
|
|
896
|
-
return
|
|
724
|
+
return takeObject(r0);
|
|
897
725
|
} finally {
|
|
898
726
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
899
727
|
}
|
|
900
728
|
}
|
|
901
729
|
/**
|
|
902
|
-
* Get
|
|
903
|
-
*
|
|
904
|
-
* @param
|
|
905
|
-
* @returns
|
|
906
|
-
*
|
|
907
|
-
*
|
|
908
|
-
*
|
|
730
|
+
* Get the evaluated schema in MessagePack format
|
|
731
|
+
*
|
|
732
|
+
* @param skipLayout - Whether to skip layout resolution
|
|
733
|
+
* @returns Evaluated schema as MessagePack bytes (Uint8Array)
|
|
734
|
+
*
|
|
735
|
+
* # Zero-Copy Optimization
|
|
736
|
+
*
|
|
737
|
+
* This method returns MessagePack binary data with minimal copying:
|
|
738
|
+
* 1. Serializes schema to Vec<u8> in Rust (unavoidable)
|
|
739
|
+
* 2. wasm-bindgen transfers Vec<u8> to JS as Uint8Array (optimized)
|
|
740
|
+
* 3. Result is a Uint8Array view (minimal overhead)
|
|
741
|
+
*
|
|
742
|
+
* MessagePack format is 20-50% smaller than JSON, ideal for web/WASM.
|
|
743
|
+
* @param {boolean} skip_layout
|
|
744
|
+
* @returns {Uint8Array}
|
|
909
745
|
*/
|
|
910
|
-
|
|
911
|
-
let deferred3_0;
|
|
912
|
-
let deferred3_1;
|
|
746
|
+
getEvaluatedSchemaMsgpack(skip_layout) {
|
|
913
747
|
try {
|
|
914
748
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
915
|
-
|
|
916
|
-
const len0 = WASM_VECTOR_LEN;
|
|
917
|
-
wasm.jsonevalwasm_getSchemaByPaths(retptr, this.__wbg_ptr, ptr0, len0, format);
|
|
749
|
+
wasm.jsonevalwasm_getEvaluatedSchemaMsgpack(retptr, this.__wbg_ptr, skip_layout);
|
|
918
750
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
919
751
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
920
752
|
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
921
753
|
var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
|
|
922
|
-
var ptr2 = r0;
|
|
923
|
-
var len2 = r1;
|
|
924
754
|
if (r3) {
|
|
925
|
-
ptr2 = 0; len2 = 0;
|
|
926
755
|
throw takeObject(r2);
|
|
927
756
|
}
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
return
|
|
757
|
+
var v1 = getArrayU8FromWasm0(r0, r1).slice();
|
|
758
|
+
wasm.__wbindgen_export3(r0, r1 * 1, 1);
|
|
759
|
+
return v1;
|
|
931
760
|
} finally {
|
|
932
761
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
933
|
-
wasm.__wbindgen_export_2(deferred3_0, deferred3_1, 1);
|
|
934
762
|
}
|
|
935
763
|
}
|
|
936
764
|
/**
|
|
937
|
-
* Get
|
|
765
|
+
* Get evaluated schema from subform
|
|
938
766
|
*
|
|
939
|
-
* @param
|
|
767
|
+
* @param subformPath - Path to the subform
|
|
768
|
+
* @param resolveLayout - Whether to resolve layout
|
|
940
769
|
* @returns Evaluated schema as JSON string
|
|
941
|
-
* @param {
|
|
770
|
+
* @param {string} subform_path
|
|
771
|
+
* @param {boolean} resolve_layout
|
|
942
772
|
* @returns {string}
|
|
943
773
|
*/
|
|
944
|
-
|
|
945
|
-
let
|
|
946
|
-
let
|
|
774
|
+
getEvaluatedSchemaSubform(subform_path, resolve_layout) {
|
|
775
|
+
let deferred2_0;
|
|
776
|
+
let deferred2_1;
|
|
947
777
|
try {
|
|
948
778
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
949
|
-
|
|
779
|
+
const ptr0 = passStringToWasm0(subform_path, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
780
|
+
const len0 = WASM_VECTOR_LEN;
|
|
781
|
+
wasm.jsonevalwasm_getEvaluatedSchemaSubform(retptr, this.__wbg_ptr, ptr0, len0, resolve_layout);
|
|
950
782
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
951
783
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
952
|
-
|
|
953
|
-
|
|
784
|
+
deferred2_0 = r0;
|
|
785
|
+
deferred2_1 = r1;
|
|
954
786
|
return getStringFromWasm0(r0, r1);
|
|
955
787
|
} finally {
|
|
956
788
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
957
|
-
wasm.
|
|
789
|
+
wasm.__wbindgen_export3(deferred2_0, deferred2_1, 1);
|
|
958
790
|
}
|
|
959
791
|
}
|
|
960
792
|
/**
|
|
961
|
-
* Get
|
|
793
|
+
* Get evaluated schema from subform as JavaScript object
|
|
962
794
|
*
|
|
963
|
-
* @param
|
|
964
|
-
* @
|
|
965
|
-
* @
|
|
795
|
+
* @param subformPath - Path to the subform
|
|
796
|
+
* @param resolveLayout - Whether to resolve layout
|
|
797
|
+
* @returns Evaluated schema as JavaScript object
|
|
798
|
+
* @param {string} subform_path
|
|
799
|
+
* @param {boolean} resolve_layout
|
|
966
800
|
* @returns {any}
|
|
967
801
|
*/
|
|
968
|
-
|
|
802
|
+
getEvaluatedSchemaSubformJS(subform_path, resolve_layout) {
|
|
969
803
|
try {
|
|
970
804
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
971
|
-
const ptr0 = passStringToWasm0(
|
|
805
|
+
const ptr0 = passStringToWasm0(subform_path, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
972
806
|
const len0 = WASM_VECTOR_LEN;
|
|
973
|
-
wasm.
|
|
807
|
+
wasm.jsonevalwasm_getEvaluatedSchemaSubformJS(retptr, this.__wbg_ptr, ptr0, len0, resolve_layout);
|
|
974
808
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
975
809
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
976
810
|
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
@@ -983,49 +817,41 @@ export class JSONEvalWasm {
|
|
|
983
817
|
}
|
|
984
818
|
}
|
|
985
819
|
/**
|
|
986
|
-
*
|
|
820
|
+
* Get the evaluated schema without $params field
|
|
987
821
|
*
|
|
988
|
-
* @param
|
|
989
|
-
* @
|
|
990
|
-
* @param
|
|
991
|
-
* @
|
|
992
|
-
* @param {string | null} [context]
|
|
993
|
-
* @param {string | null} [data]
|
|
822
|
+
* @param skipLayout - Whether to skip layout resolution
|
|
823
|
+
* @returns Evaluated schema as JSON string
|
|
824
|
+
* @param {boolean} skip_layout
|
|
825
|
+
* @returns {string}
|
|
994
826
|
*/
|
|
995
|
-
|
|
827
|
+
getEvaluatedSchemaWithoutParams(skip_layout) {
|
|
828
|
+
let deferred1_0;
|
|
829
|
+
let deferred1_1;
|
|
996
830
|
try {
|
|
997
831
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
998
|
-
|
|
999
|
-
const len0 = WASM_VECTOR_LEN;
|
|
1000
|
-
var ptr1 = isLikeNone(context) ? 0 : passStringToWasm0(context, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
1001
|
-
var len1 = WASM_VECTOR_LEN;
|
|
1002
|
-
var ptr2 = isLikeNone(data) ? 0 : passStringToWasm0(data, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
1003
|
-
var len2 = WASM_VECTOR_LEN;
|
|
1004
|
-
wasm.jsonevalwasm_reloadSchemaMsgpack(retptr, this.__wbg_ptr, ptr0, len0, ptr1, len1, ptr2, len2);
|
|
832
|
+
wasm.jsonevalwasm_getEvaluatedSchemaWithoutParams(retptr, this.__wbg_ptr, skip_layout);
|
|
1005
833
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
1006
834
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
|
|
835
|
+
deferred1_0 = r0;
|
|
836
|
+
deferred1_1 = r1;
|
|
837
|
+
return getStringFromWasm0(r0, r1);
|
|
1010
838
|
} finally {
|
|
1011
839
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
840
|
+
wasm.__wbindgen_export3(deferred1_0, deferred1_1, 1);
|
|
1012
841
|
}
|
|
1013
842
|
}
|
|
1014
843
|
/**
|
|
1015
|
-
* Get
|
|
1016
|
-
*
|
|
1017
|
-
* @param
|
|
1018
|
-
* @returns
|
|
1019
|
-
* @param {
|
|
1020
|
-
* @param {number} format
|
|
844
|
+
* Get the evaluated schema without $params as JavaScript object
|
|
845
|
+
*
|
|
846
|
+
* @param skipLayout - Whether to skip layout resolution
|
|
847
|
+
* @returns Evaluated schema as JavaScript object
|
|
848
|
+
* @param {boolean} skip_layout
|
|
1021
849
|
* @returns {any}
|
|
1022
850
|
*/
|
|
1023
|
-
|
|
851
|
+
getEvaluatedSchemaWithoutParamsJS(skip_layout) {
|
|
1024
852
|
try {
|
|
1025
853
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1026
|
-
|
|
1027
|
-
const len0 = WASM_VECTOR_LEN;
|
|
1028
|
-
wasm.jsonevalwasm_getSchemaByPathsJS(retptr, this.__wbg_ptr, ptr0, len0, format);
|
|
854
|
+
wasm.jsonevalwasm_getEvaluatedSchemaWithoutParamsJS(retptr, this.__wbg_ptr, skip_layout);
|
|
1029
855
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
1030
856
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
1031
857
|
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
@@ -1038,39 +864,49 @@ export class JSONEvalWasm {
|
|
|
1038
864
|
}
|
|
1039
865
|
}
|
|
1040
866
|
/**
|
|
1041
|
-
* Get
|
|
1042
|
-
* Returns [{path: "", value: ""}, ...]
|
|
867
|
+
* Get evaluated schema without $params from subform
|
|
1043
868
|
*
|
|
1044
|
-
* @
|
|
1045
|
-
* @
|
|
869
|
+
* @param subformPath - Path to the subform
|
|
870
|
+
* @param resolveLayout - Whether to resolve layout
|
|
871
|
+
* @returns Evaluated schema as JSON string
|
|
872
|
+
* @param {string} subform_path
|
|
873
|
+
* @param {boolean} resolve_layout
|
|
874
|
+
* @returns {string}
|
|
1046
875
|
*/
|
|
1047
|
-
|
|
876
|
+
getEvaluatedSchemaWithoutParamsSubform(subform_path, resolve_layout) {
|
|
877
|
+
let deferred2_0;
|
|
878
|
+
let deferred2_1;
|
|
1048
879
|
try {
|
|
1049
880
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1050
|
-
wasm.
|
|
881
|
+
const ptr0 = passStringToWasm0(subform_path, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
882
|
+
const len0 = WASM_VECTOR_LEN;
|
|
883
|
+
wasm.jsonevalwasm_getEvaluatedSchemaWithoutParamsSubform(retptr, this.__wbg_ptr, ptr0, len0, resolve_layout);
|
|
1051
884
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
1052
885
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
1053
|
-
|
|
1054
|
-
|
|
1055
|
-
|
|
1056
|
-
}
|
|
1057
|
-
return takeObject(r0);
|
|
886
|
+
deferred2_0 = r0;
|
|
887
|
+
deferred2_1 = r1;
|
|
888
|
+
return getStringFromWasm0(r0, r1);
|
|
1058
889
|
} finally {
|
|
1059
890
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
891
|
+
wasm.__wbindgen_export3(deferred2_0, deferred2_1, 1);
|
|
1060
892
|
}
|
|
1061
893
|
}
|
|
1062
894
|
/**
|
|
1063
|
-
* Get
|
|
895
|
+
* Get evaluated schema without $params from subform as JavaScript object
|
|
1064
896
|
*
|
|
1065
|
-
* @param
|
|
897
|
+
* @param subformPath - Path to the subform
|
|
898
|
+
* @param resolveLayout - Whether to resolve layout
|
|
1066
899
|
* @returns Evaluated schema as JavaScript object
|
|
1067
|
-
* @param {
|
|
900
|
+
* @param {string} subform_path
|
|
901
|
+
* @param {boolean} resolve_layout
|
|
1068
902
|
* @returns {any}
|
|
1069
903
|
*/
|
|
1070
|
-
|
|
904
|
+
getEvaluatedSchemaWithoutParamsSubformJS(subform_path, resolve_layout) {
|
|
1071
905
|
try {
|
|
1072
906
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1073
|
-
|
|
907
|
+
const ptr0 = passStringToWasm0(subform_path, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
908
|
+
const len0 = WASM_VECTOR_LEN;
|
|
909
|
+
wasm.jsonevalwasm_getEvaluatedSchemaWithoutParamsSubformJS(retptr, this.__wbg_ptr, ptr0, len0, resolve_layout);
|
|
1074
910
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
1075
911
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
1076
912
|
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
@@ -1083,138 +919,130 @@ export class JSONEvalWasm {
|
|
|
1083
919
|
}
|
|
1084
920
|
}
|
|
1085
921
|
/**
|
|
1086
|
-
* Get
|
|
1087
|
-
* Returns {path: value, ...}
|
|
922
|
+
* Get a value from the schema using dotted path notation
|
|
1088
923
|
*
|
|
1089
|
-
* @
|
|
1090
|
-
* @returns
|
|
924
|
+
* @param path - Dotted path to the value (e.g., "properties.field.value")
|
|
925
|
+
* @returns Value as JSON string or null if not found
|
|
926
|
+
* @param {string} path
|
|
927
|
+
* @returns {string | undefined}
|
|
1091
928
|
*/
|
|
1092
|
-
|
|
929
|
+
getSchemaByPath(path) {
|
|
1093
930
|
try {
|
|
1094
931
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1095
|
-
wasm.
|
|
932
|
+
const ptr0 = passStringToWasm0(path, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
933
|
+
const len0 = WASM_VECTOR_LEN;
|
|
934
|
+
wasm.jsonevalwasm_getSchemaByPath(retptr, this.__wbg_ptr, ptr0, len0);
|
|
1096
935
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
1097
936
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
1098
|
-
|
|
1099
|
-
if (
|
|
1100
|
-
|
|
937
|
+
let v2;
|
|
938
|
+
if (r0 !== 0) {
|
|
939
|
+
v2 = getStringFromWasm0(r0, r1).slice();
|
|
940
|
+
wasm.__wbindgen_export3(r0, r1 * 1, 1);
|
|
1101
941
|
}
|
|
1102
|
-
return
|
|
942
|
+
return v2;
|
|
1103
943
|
} finally {
|
|
1104
944
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
1105
945
|
}
|
|
1106
946
|
}
|
|
1107
947
|
/**
|
|
1108
|
-
*
|
|
948
|
+
* Get a value from the schema using dotted path notation as JavaScript object
|
|
1109
949
|
*
|
|
1110
|
-
* @param
|
|
1111
|
-
* @
|
|
1112
|
-
* @param
|
|
1113
|
-
* @
|
|
1114
|
-
* @param {string | null} [context]
|
|
1115
|
-
* @param {string | null} [data]
|
|
950
|
+
* @param path - Dotted path to the value (e.g., "properties.field.value")
|
|
951
|
+
* @returns Value as JavaScript object or null if not found
|
|
952
|
+
* @param {string} path
|
|
953
|
+
* @returns {any}
|
|
1116
954
|
*/
|
|
1117
|
-
|
|
955
|
+
getSchemaByPathJS(path) {
|
|
1118
956
|
try {
|
|
1119
957
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1120
|
-
const ptr0 = passStringToWasm0(
|
|
958
|
+
const ptr0 = passStringToWasm0(path, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
1121
959
|
const len0 = WASM_VECTOR_LEN;
|
|
1122
|
-
|
|
1123
|
-
var len1 = WASM_VECTOR_LEN;
|
|
1124
|
-
var ptr2 = isLikeNone(data) ? 0 : passStringToWasm0(data, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
1125
|
-
var len2 = WASM_VECTOR_LEN;
|
|
1126
|
-
wasm.jsonevalwasm_reloadSchemaFromCache(retptr, this.__wbg_ptr, ptr0, len0, ptr1, len1, ptr2, len2);
|
|
960
|
+
wasm.jsonevalwasm_getSchemaByPathJS(retptr, this.__wbg_ptr, ptr0, len0);
|
|
1127
961
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
1128
962
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
1129
|
-
|
|
1130
|
-
|
|
963
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
964
|
+
if (r2) {
|
|
965
|
+
throw takeObject(r1);
|
|
1131
966
|
}
|
|
967
|
+
return takeObject(r0);
|
|
1132
968
|
} finally {
|
|
1133
969
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
1134
970
|
}
|
|
1135
971
|
}
|
|
1136
972
|
/**
|
|
1137
|
-
* Get
|
|
1138
|
-
*
|
|
1139
|
-
* @param
|
|
1140
|
-
* @param skipLayout - Whether to skip layout resolution
|
|
973
|
+
* Get schema by specific path from subform (returns JSON string)
|
|
974
|
+
* @param subformPath - Path to the subform
|
|
975
|
+
* @param schemaPath - Path within the subform
|
|
1141
976
|
* @returns Value as JSON string or null if not found
|
|
1142
|
-
* @param {string}
|
|
1143
|
-
* @param {
|
|
977
|
+
* @param {string} subform_path
|
|
978
|
+
* @param {string} schema_path
|
|
1144
979
|
* @returns {string | undefined}
|
|
1145
980
|
*/
|
|
1146
|
-
|
|
981
|
+
getSchemaByPathSubform(subform_path, schema_path) {
|
|
1147
982
|
try {
|
|
1148
983
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1149
|
-
const ptr0 = passStringToWasm0(
|
|
984
|
+
const ptr0 = passStringToWasm0(subform_path, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
1150
985
|
const len0 = WASM_VECTOR_LEN;
|
|
1151
|
-
|
|
986
|
+
const ptr1 = passStringToWasm0(schema_path, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
987
|
+
const len1 = WASM_VECTOR_LEN;
|
|
988
|
+
wasm.jsonevalwasm_getSchemaByPathSubform(retptr, this.__wbg_ptr, ptr0, len0, ptr1, len1);
|
|
1152
989
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
1153
990
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
1154
|
-
let
|
|
991
|
+
let v3;
|
|
1155
992
|
if (r0 !== 0) {
|
|
1156
|
-
|
|
1157
|
-
wasm.
|
|
993
|
+
v3 = getStringFromWasm0(r0, r1).slice();
|
|
994
|
+
wasm.__wbindgen_export3(r0, r1 * 1, 1);
|
|
1158
995
|
}
|
|
1159
|
-
return
|
|
996
|
+
return v3;
|
|
1160
997
|
} finally {
|
|
1161
998
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
1162
999
|
}
|
|
1163
1000
|
}
|
|
1164
1001
|
/**
|
|
1165
|
-
* Get
|
|
1166
|
-
*
|
|
1167
|
-
* @param
|
|
1168
|
-
* @returns
|
|
1169
|
-
*
|
|
1170
|
-
*
|
|
1171
|
-
*
|
|
1172
|
-
* This method returns MessagePack binary data with minimal copying:
|
|
1173
|
-
* 1. Serializes schema to Vec<u8> in Rust (unavoidable)
|
|
1174
|
-
* 2. wasm-bindgen transfers Vec<u8> to JS as Uint8Array (optimized)
|
|
1175
|
-
* 3. Result is a Uint8Array view (minimal overhead)
|
|
1176
|
-
*
|
|
1177
|
-
* MessagePack format is 20-50% smaller than JSON, ideal for web/WASM.
|
|
1178
|
-
* @param {boolean} skip_layout
|
|
1179
|
-
* @returns {Uint8Array}
|
|
1002
|
+
* Get schema by specific path from subform (returns JS object)
|
|
1003
|
+
* @param subformPath - Path to the subform
|
|
1004
|
+
* @param schemaPath - Path within the subform
|
|
1005
|
+
* @returns Value as JavaScript object or null if not found
|
|
1006
|
+
* @param {string} subform_path
|
|
1007
|
+
* @param {string} schema_path
|
|
1008
|
+
* @returns {any}
|
|
1180
1009
|
*/
|
|
1181
|
-
|
|
1010
|
+
getSchemaByPathSubformJS(subform_path, schema_path) {
|
|
1182
1011
|
try {
|
|
1183
1012
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1184
|
-
|
|
1013
|
+
const ptr0 = passStringToWasm0(subform_path, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
1014
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1015
|
+
const ptr1 = passStringToWasm0(schema_path, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
1016
|
+
const len1 = WASM_VECTOR_LEN;
|
|
1017
|
+
wasm.jsonevalwasm_getSchemaByPathSubformJS(retptr, this.__wbg_ptr, ptr0, len0, ptr1, len1);
|
|
1185
1018
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
1186
1019
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
1187
1020
|
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
1188
|
-
|
|
1189
|
-
|
|
1190
|
-
throw takeObject(r2);
|
|
1021
|
+
if (r2) {
|
|
1022
|
+
throw takeObject(r1);
|
|
1191
1023
|
}
|
|
1192
|
-
|
|
1193
|
-
wasm.__wbindgen_export_2(r0, r1 * 1, 1);
|
|
1194
|
-
return v1;
|
|
1024
|
+
return takeObject(r0);
|
|
1195
1025
|
} finally {
|
|
1196
1026
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
1197
1027
|
}
|
|
1198
1028
|
}
|
|
1199
1029
|
/**
|
|
1200
|
-
* Get values from
|
|
1030
|
+
* Get values from schema using multiple dotted paths
|
|
1201
1031
|
* @param pathsJson - JSON array of dotted paths
|
|
1202
|
-
* @param skipLayout - Whether to skip layout resolution
|
|
1203
1032
|
* @param format - Return format (0=Nested, 1=Flat, 2=Array)
|
|
1204
1033
|
* @returns Data in specified format as JSON string
|
|
1205
1034
|
* @param {string} paths_json
|
|
1206
|
-
* @param {boolean} skip_layout
|
|
1207
1035
|
* @param {number} format
|
|
1208
1036
|
* @returns {string}
|
|
1209
1037
|
*/
|
|
1210
|
-
|
|
1038
|
+
getSchemaByPaths(paths_json, format) {
|
|
1211
1039
|
let deferred3_0;
|
|
1212
1040
|
let deferred3_1;
|
|
1213
1041
|
try {
|
|
1214
1042
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1215
|
-
const ptr0 = passStringToWasm0(paths_json, wasm.
|
|
1043
|
+
const ptr0 = passStringToWasm0(paths_json, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
1216
1044
|
const len0 = WASM_VECTOR_LEN;
|
|
1217
|
-
wasm.
|
|
1045
|
+
wasm.jsonevalwasm_getSchemaByPaths(retptr, this.__wbg_ptr, ptr0, len0, format);
|
|
1218
1046
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
1219
1047
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
1220
1048
|
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
@@ -1229,26 +1057,25 @@ export class JSONEvalWasm {
|
|
|
1229
1057
|
deferred3_1 = len2;
|
|
1230
1058
|
return getStringFromWasm0(ptr2, len2);
|
|
1231
1059
|
} finally {
|
|
1232
|
-
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
1233
|
-
wasm.
|
|
1234
|
-
}
|
|
1235
|
-
}
|
|
1236
|
-
/**
|
|
1237
|
-
* Get
|
|
1238
|
-
*
|
|
1239
|
-
* @param
|
|
1240
|
-
* @
|
|
1241
|
-
* @
|
|
1242
|
-
* @param {
|
|
1243
|
-
* @param {boolean} skip_layout
|
|
1060
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
1061
|
+
wasm.__wbindgen_export3(deferred3_0, deferred3_1, 1);
|
|
1062
|
+
}
|
|
1063
|
+
}
|
|
1064
|
+
/**
|
|
1065
|
+
* Get values from schema using multiple dotted paths (JS object)
|
|
1066
|
+
* @param pathsJson - JSON array of dotted paths
|
|
1067
|
+
* @param format - Return format (0=Nested, 1=Flat, 2=Array)
|
|
1068
|
+
* @returns Data in specified format as JavaScript object
|
|
1069
|
+
* @param {string} paths_json
|
|
1070
|
+
* @param {number} format
|
|
1244
1071
|
* @returns {any}
|
|
1245
1072
|
*/
|
|
1246
|
-
|
|
1073
|
+
getSchemaByPathsJS(paths_json, format) {
|
|
1247
1074
|
try {
|
|
1248
1075
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1249
|
-
const ptr0 = passStringToWasm0(
|
|
1076
|
+
const ptr0 = passStringToWasm0(paths_json, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
1250
1077
|
const len0 = WASM_VECTOR_LEN;
|
|
1251
|
-
wasm.
|
|
1078
|
+
wasm.jsonevalwasm_getSchemaByPathsJS(retptr, this.__wbg_ptr, ptr0, len0, format);
|
|
1252
1079
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
1253
1080
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
1254
1081
|
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
@@ -1261,69 +1088,85 @@ export class JSONEvalWasm {
|
|
|
1261
1088
|
}
|
|
1262
1089
|
}
|
|
1263
1090
|
/**
|
|
1264
|
-
* Get
|
|
1091
|
+
* Get schema by multiple paths from subform
|
|
1092
|
+
* @param subformPath - Path to the subform
|
|
1265
1093
|
* @param pathsJson - JSON array of dotted paths
|
|
1266
|
-
* @param skipLayout - Whether to skip layout resolution
|
|
1267
1094
|
* @param format - Return format (0=Nested, 1=Flat, 2=Array)
|
|
1268
|
-
* @returns Data in specified format as
|
|
1095
|
+
* @returns Data in specified format as JSON string
|
|
1096
|
+
* @param {string} subform_path
|
|
1269
1097
|
* @param {string} paths_json
|
|
1270
|
-
* @param {boolean} skip_layout
|
|
1271
1098
|
* @param {number} format
|
|
1272
|
-
* @returns {
|
|
1099
|
+
* @returns {string}
|
|
1273
1100
|
*/
|
|
1274
|
-
|
|
1101
|
+
getSchemaByPathsSubform(subform_path, paths_json, format) {
|
|
1102
|
+
let deferred4_0;
|
|
1103
|
+
let deferred4_1;
|
|
1275
1104
|
try {
|
|
1276
1105
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1277
|
-
const ptr0 = passStringToWasm0(
|
|
1106
|
+
const ptr0 = passStringToWasm0(subform_path, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
1278
1107
|
const len0 = WASM_VECTOR_LEN;
|
|
1279
|
-
|
|
1108
|
+
const ptr1 = passStringToWasm0(paths_json, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
1109
|
+
const len1 = WASM_VECTOR_LEN;
|
|
1110
|
+
wasm.jsonevalwasm_getSchemaByPathsSubform(retptr, this.__wbg_ptr, ptr0, len0, ptr1, len1, format);
|
|
1280
1111
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
1281
1112
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
1282
1113
|
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
1283
|
-
|
|
1284
|
-
|
|
1114
|
+
var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
|
|
1115
|
+
var ptr3 = r0;
|
|
1116
|
+
var len3 = r1;
|
|
1117
|
+
if (r3) {
|
|
1118
|
+
ptr3 = 0; len3 = 0;
|
|
1119
|
+
throw takeObject(r2);
|
|
1285
1120
|
}
|
|
1286
|
-
|
|
1121
|
+
deferred4_0 = ptr3;
|
|
1122
|
+
deferred4_1 = len3;
|
|
1123
|
+
return getStringFromWasm0(ptr3, len3);
|
|
1287
1124
|
} finally {
|
|
1288
1125
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
1126
|
+
wasm.__wbindgen_export3(deferred4_0, deferred4_1, 1);
|
|
1289
1127
|
}
|
|
1290
1128
|
}
|
|
1291
1129
|
/**
|
|
1292
|
-
* Get
|
|
1293
|
-
*
|
|
1294
|
-
* @param
|
|
1295
|
-
* @
|
|
1296
|
-
* @
|
|
1297
|
-
* @
|
|
1130
|
+
* Get schema by multiple paths from subform (JS object)
|
|
1131
|
+
* @param subformPath - Path to the subform
|
|
1132
|
+
* @param paths - Array of dotted paths
|
|
1133
|
+
* @param format - Return format (0=Nested, 1=Flat, 2=Array)
|
|
1134
|
+
* @returns Data in specified format as JavaScript object
|
|
1135
|
+
* @param {string} subform_path
|
|
1136
|
+
* @param {string} paths_json
|
|
1137
|
+
* @param {number} format
|
|
1138
|
+
* @returns {any}
|
|
1298
1139
|
*/
|
|
1299
|
-
|
|
1300
|
-
let deferred1_0;
|
|
1301
|
-
let deferred1_1;
|
|
1140
|
+
getSchemaByPathsSubformJS(subform_path, paths_json, format) {
|
|
1302
1141
|
try {
|
|
1303
1142
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1304
|
-
|
|
1143
|
+
const ptr0 = passStringToWasm0(subform_path, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
1144
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1145
|
+
const ptr1 = passStringToWasm0(paths_json, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
1146
|
+
const len1 = WASM_VECTOR_LEN;
|
|
1147
|
+
wasm.jsonevalwasm_getSchemaByPathsSubformJS(retptr, this.__wbg_ptr, ptr0, len0, ptr1, len1, format);
|
|
1305
1148
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
1306
1149
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
1307
|
-
|
|
1308
|
-
|
|
1309
|
-
|
|
1150
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
1151
|
+
if (r2) {
|
|
1152
|
+
throw takeObject(r1);
|
|
1153
|
+
}
|
|
1154
|
+
return takeObject(r0);
|
|
1310
1155
|
} finally {
|
|
1311
1156
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
1312
|
-
wasm.__wbindgen_export_2(deferred1_0, deferred1_1, 1);
|
|
1313
1157
|
}
|
|
1314
1158
|
}
|
|
1315
1159
|
/**
|
|
1316
|
-
* Get
|
|
1160
|
+
* Get all schema values (evaluations ending with .value)
|
|
1161
|
+
* Mutates internal data by overriding with values from value evaluations
|
|
1317
1162
|
*
|
|
1318
|
-
* @
|
|
1319
|
-
* @returns Evaluated schema as JavaScript object
|
|
1320
|
-
* @param {boolean} skip_layout
|
|
1163
|
+
* @returns Modified data as JavaScript object
|
|
1321
1164
|
* @returns {any}
|
|
1322
1165
|
*/
|
|
1323
|
-
|
|
1166
|
+
getSchemaValue() {
|
|
1324
1167
|
try {
|
|
1325
1168
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1326
|
-
wasm.
|
|
1169
|
+
wasm.jsonevalwasm_getSchemaValue(retptr, this.__wbg_ptr);
|
|
1327
1170
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
1328
1171
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
1329
1172
|
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
@@ -1336,125 +1179,97 @@ export class JSONEvalWasm {
|
|
|
1336
1179
|
}
|
|
1337
1180
|
}
|
|
1338
1181
|
/**
|
|
1339
|
-
*
|
|
1340
|
-
*
|
|
1341
|
-
* @param subformPath - Path to check
|
|
1342
|
-
* @returns True if subform exists, false otherwise
|
|
1343
|
-
* @param {string} subform_path
|
|
1344
|
-
* @returns {boolean}
|
|
1345
|
-
*/
|
|
1346
|
-
hasSubform(subform_path) {
|
|
1347
|
-
const ptr0 = passStringToWasm0(subform_path, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
1348
|
-
const len0 = WASM_VECTOR_LEN;
|
|
1349
|
-
const ret = wasm.jsonevalwasm_hasSubform(this.__wbg_ptr, ptr0, len0);
|
|
1350
|
-
return ret !== 0;
|
|
1351
|
-
}
|
|
1352
|
-
/**
|
|
1353
|
-
* Evaluate a subform with data
|
|
1182
|
+
* Get all schema values as array of path-value pairs
|
|
1183
|
+
* Returns [{path: "", value: ""}, ...]
|
|
1354
1184
|
*
|
|
1355
|
-
* @
|
|
1356
|
-
* @
|
|
1357
|
-
* @param context - Optional context data JSON string
|
|
1358
|
-
* @param paths - Optional array of paths to evaluate (JSON string array)
|
|
1359
|
-
* @throws Error if evaluation fails
|
|
1360
|
-
* @param {string} subform_path
|
|
1361
|
-
* @param {string} data
|
|
1362
|
-
* @param {string | null} [context]
|
|
1363
|
-
* @param {string[] | null} [paths]
|
|
1185
|
+
* @returns Array of {path, value} objects as JavaScript array
|
|
1186
|
+
* @returns {any}
|
|
1364
1187
|
*/
|
|
1365
|
-
|
|
1188
|
+
getSchemaValueArray() {
|
|
1366
1189
|
try {
|
|
1367
1190
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1368
|
-
|
|
1369
|
-
const len0 = WASM_VECTOR_LEN;
|
|
1370
|
-
const ptr1 = passStringToWasm0(data, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
1371
|
-
const len1 = WASM_VECTOR_LEN;
|
|
1372
|
-
var ptr2 = isLikeNone(context) ? 0 : passStringToWasm0(context, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
1373
|
-
var len2 = WASM_VECTOR_LEN;
|
|
1374
|
-
var ptr3 = isLikeNone(paths) ? 0 : passArrayJsValueToWasm0(paths, wasm.__wbindgen_export_0);
|
|
1375
|
-
var len3 = WASM_VECTOR_LEN;
|
|
1376
|
-
wasm.jsonevalwasm_evaluateSubform(retptr, this.__wbg_ptr, ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3);
|
|
1191
|
+
wasm.jsonevalwasm_getSchemaValueArray(retptr, this.__wbg_ptr);
|
|
1377
1192
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
1378
1193
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
1379
|
-
|
|
1380
|
-
|
|
1194
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
1195
|
+
if (r2) {
|
|
1196
|
+
throw takeObject(r1);
|
|
1381
1197
|
}
|
|
1198
|
+
return takeObject(r0);
|
|
1382
1199
|
} finally {
|
|
1383
1200
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
1384
1201
|
}
|
|
1385
1202
|
}
|
|
1386
1203
|
/**
|
|
1387
|
-
*
|
|
1204
|
+
* Get schema values from subform as a flat array of path-value pairs.
|
|
1205
|
+
* Returns an array like `[{path: "field.sub", value: 123}, ...]`.
|
|
1388
1206
|
*
|
|
1389
1207
|
* @param subformPath - Path to the subform
|
|
1390
|
-
* @
|
|
1391
|
-
* @param context - Optional context data JSON string
|
|
1392
|
-
* @returns ValidationResult
|
|
1208
|
+
* @returns Array of {path, value} objects
|
|
1393
1209
|
* @param {string} subform_path
|
|
1394
|
-
* @
|
|
1395
|
-
* @param {string | null} [context]
|
|
1396
|
-
* @returns {ValidationResult}
|
|
1210
|
+
* @returns {any}
|
|
1397
1211
|
*/
|
|
1398
|
-
|
|
1212
|
+
getSchemaValueArraySubform(subform_path) {
|
|
1399
1213
|
try {
|
|
1400
1214
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1401
|
-
const ptr0 = passStringToWasm0(subform_path, wasm.
|
|
1215
|
+
const ptr0 = passStringToWasm0(subform_path, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
1402
1216
|
const len0 = WASM_VECTOR_LEN;
|
|
1403
|
-
|
|
1404
|
-
const len1 = WASM_VECTOR_LEN;
|
|
1405
|
-
var ptr2 = isLikeNone(context) ? 0 : passStringToWasm0(context, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
1406
|
-
var len2 = WASM_VECTOR_LEN;
|
|
1407
|
-
wasm.jsonevalwasm_validateSubform(retptr, this.__wbg_ptr, ptr0, len0, ptr1, len1, ptr2, len2);
|
|
1217
|
+
wasm.jsonevalwasm_getSchemaValueArraySubform(retptr, this.__wbg_ptr, ptr0, len0);
|
|
1408
1218
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
1409
1219
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
1410
1220
|
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
1411
1221
|
if (r2) {
|
|
1412
1222
|
throw takeObject(r1);
|
|
1413
1223
|
}
|
|
1414
|
-
return
|
|
1224
|
+
return takeObject(r0);
|
|
1415
1225
|
} finally {
|
|
1416
1226
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
1417
1227
|
}
|
|
1418
1228
|
}
|
|
1419
1229
|
/**
|
|
1420
|
-
* Get
|
|
1230
|
+
* Get all schema values as object with dotted path keys
|
|
1231
|
+
* Returns {path: value, ...}
|
|
1421
1232
|
*
|
|
1422
|
-
* @returns
|
|
1423
|
-
* @returns {
|
|
1233
|
+
* @returns Flat object with dotted paths as keys
|
|
1234
|
+
* @returns {any}
|
|
1424
1235
|
*/
|
|
1425
|
-
|
|
1236
|
+
getSchemaValueObject() {
|
|
1426
1237
|
try {
|
|
1427
1238
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1428
|
-
wasm.
|
|
1239
|
+
wasm.jsonevalwasm_getSchemaValueObject(retptr, this.__wbg_ptr);
|
|
1429
1240
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
1430
1241
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
1431
|
-
var
|
|
1432
|
-
|
|
1433
|
-
|
|
1242
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
1243
|
+
if (r2) {
|
|
1244
|
+
throw takeObject(r1);
|
|
1245
|
+
}
|
|
1246
|
+
return takeObject(r0);
|
|
1434
1247
|
} finally {
|
|
1435
1248
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
1436
1249
|
}
|
|
1437
1250
|
}
|
|
1438
1251
|
/**
|
|
1439
|
-
*
|
|
1252
|
+
* Get schema values from subform as a flat object with dotted path keys.
|
|
1253
|
+
* Returns an object like `{"field.sub": 123, ...}`.
|
|
1440
1254
|
*
|
|
1441
1255
|
* @param subformPath - Path to the subform
|
|
1442
|
-
* @
|
|
1443
|
-
* @throws Error if resolve fails
|
|
1256
|
+
* @returns Flat object with dotted paths as keys
|
|
1444
1257
|
* @param {string} subform_path
|
|
1445
|
-
* @
|
|
1258
|
+
* @returns {any}
|
|
1446
1259
|
*/
|
|
1447
|
-
|
|
1260
|
+
getSchemaValueObjectSubform(subform_path) {
|
|
1448
1261
|
try {
|
|
1449
1262
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1450
|
-
const ptr0 = passStringToWasm0(subform_path, wasm.
|
|
1263
|
+
const ptr0 = passStringToWasm0(subform_path, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
1451
1264
|
const len0 = WASM_VECTOR_LEN;
|
|
1452
|
-
wasm.
|
|
1265
|
+
wasm.jsonevalwasm_getSchemaValueObjectSubform(retptr, this.__wbg_ptr, ptr0, len0);
|
|
1453
1266
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
1454
1267
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
1455
|
-
|
|
1456
|
-
|
|
1268
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
1269
|
+
if (r2) {
|
|
1270
|
+
throw takeObject(r1);
|
|
1457
1271
|
}
|
|
1272
|
+
return takeObject(r0);
|
|
1458
1273
|
} finally {
|
|
1459
1274
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
1460
1275
|
}
|
|
@@ -1471,7 +1286,7 @@ export class JSONEvalWasm {
|
|
|
1471
1286
|
getSchemaValueSubform(subform_path) {
|
|
1472
1287
|
try {
|
|
1473
1288
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1474
|
-
const ptr0 = passStringToWasm0(subform_path, wasm.
|
|
1289
|
+
const ptr0 = passStringToWasm0(subform_path, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
1475
1290
|
const len0 = WASM_VECTOR_LEN;
|
|
1476
1291
|
wasm.jsonevalwasm_getSchemaValueSubform(retptr, this.__wbg_ptr, ptr0, len0);
|
|
1477
1292
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
@@ -1486,416 +1301,363 @@ export class JSONEvalWasm {
|
|
|
1486
1301
|
}
|
|
1487
1302
|
}
|
|
1488
1303
|
/**
|
|
1489
|
-
* Get
|
|
1490
|
-
*
|
|
1491
|
-
* @
|
|
1492
|
-
* @returns
|
|
1493
|
-
* @param {string} subform_path
|
|
1494
|
-
* @param {string} schema_path
|
|
1495
|
-
* @returns {string | undefined}
|
|
1304
|
+
* Get list of available subform paths
|
|
1305
|
+
*
|
|
1306
|
+
* @returns Array of subform paths
|
|
1307
|
+
* @returns {string[]}
|
|
1496
1308
|
*/
|
|
1497
|
-
|
|
1309
|
+
getSubformPaths() {
|
|
1498
1310
|
try {
|
|
1499
1311
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1500
|
-
|
|
1501
|
-
const len0 = WASM_VECTOR_LEN;
|
|
1502
|
-
const ptr1 = passStringToWasm0(schema_path, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
1503
|
-
const len1 = WASM_VECTOR_LEN;
|
|
1504
|
-
wasm.jsonevalwasm_getSchemaByPathSubform(retptr, this.__wbg_ptr, ptr0, len0, ptr1, len1);
|
|
1312
|
+
wasm.jsonevalwasm_getSubformPaths(retptr, this.__wbg_ptr);
|
|
1505
1313
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
1506
1314
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
1507
|
-
|
|
1508
|
-
|
|
1509
|
-
|
|
1510
|
-
wasm.__wbindgen_export_2(r0, r1 * 1, 1);
|
|
1511
|
-
}
|
|
1512
|
-
return v3;
|
|
1315
|
+
var v1 = getArrayJsValueFromWasm0(r0, r1).slice();
|
|
1316
|
+
wasm.__wbindgen_export3(r0, r1 * 4, 4);
|
|
1317
|
+
return v1;
|
|
1513
1318
|
} finally {
|
|
1514
1319
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
1515
1320
|
}
|
|
1516
1321
|
}
|
|
1517
1322
|
/**
|
|
1518
|
-
*
|
|
1323
|
+
* Check if a subform exists at the given path
|
|
1519
1324
|
*
|
|
1520
|
-
* @param subformPath - Path to
|
|
1521
|
-
* @
|
|
1522
|
-
* @param data - Optional updated JSON data string
|
|
1523
|
-
* @param context - Optional context data JSON string
|
|
1524
|
-
* @returns Array of dependent change objects as JSON string
|
|
1325
|
+
* @param subformPath - Path to check
|
|
1326
|
+
* @returns True if subform exists, false otherwise
|
|
1525
1327
|
* @param {string} subform_path
|
|
1526
|
-
* @
|
|
1527
|
-
* @param {string | null | undefined} data
|
|
1528
|
-
* @param {string | null | undefined} context
|
|
1529
|
-
* @param {boolean} re_evaluate
|
|
1530
|
-
* @returns {string}
|
|
1328
|
+
* @returns {boolean}
|
|
1531
1329
|
*/
|
|
1532
|
-
|
|
1533
|
-
|
|
1534
|
-
|
|
1535
|
-
|
|
1536
|
-
|
|
1537
|
-
|
|
1538
|
-
|
|
1539
|
-
|
|
1540
|
-
|
|
1541
|
-
|
|
1542
|
-
|
|
1543
|
-
|
|
1544
|
-
|
|
1545
|
-
|
|
1546
|
-
|
|
1547
|
-
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
1548
|
-
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
1549
|
-
var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
|
|
1550
|
-
var ptr5 = r0;
|
|
1551
|
-
var len5 = r1;
|
|
1552
|
-
if (r3) {
|
|
1553
|
-
ptr5 = 0; len5 = 0;
|
|
1554
|
-
throw takeObject(r2);
|
|
1555
|
-
}
|
|
1556
|
-
deferred6_0 = ptr5;
|
|
1557
|
-
deferred6_1 = len5;
|
|
1558
|
-
return getStringFromWasm0(ptr5, len5);
|
|
1559
|
-
} finally {
|
|
1560
|
-
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
1561
|
-
wasm.__wbindgen_export_2(deferred6_0, deferred6_1, 1);
|
|
1562
|
-
}
|
|
1330
|
+
hasSubform(subform_path) {
|
|
1331
|
+
const ptr0 = passStringToWasm0(subform_path, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
1332
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1333
|
+
const ret = wasm.jsonevalwasm_hasSubform(this.__wbg_ptr, ptr0, len0);
|
|
1334
|
+
return ret !== 0;
|
|
1335
|
+
}
|
|
1336
|
+
/**
|
|
1337
|
+
* Check if evaluation caching is enabled
|
|
1338
|
+
*
|
|
1339
|
+
* @returns true if caching is enabled, false otherwise
|
|
1340
|
+
* @returns {boolean}
|
|
1341
|
+
*/
|
|
1342
|
+
isCacheEnabled() {
|
|
1343
|
+
const ret = wasm.jsonevalwasm_isCacheEnabled(this.__wbg_ptr);
|
|
1344
|
+
return ret !== 0;
|
|
1563
1345
|
}
|
|
1564
1346
|
/**
|
|
1565
|
-
*
|
|
1566
|
-
*
|
|
1567
|
-
* @param
|
|
1568
|
-
* @param
|
|
1569
|
-
* @
|
|
1570
|
-
* @param {string}
|
|
1571
|
-
* @param {string}
|
|
1572
|
-
* @param {
|
|
1573
|
-
* @returns {string}
|
|
1347
|
+
* Create a new JSONEval instance
|
|
1348
|
+
*
|
|
1349
|
+
* @param schema - JSON schema string
|
|
1350
|
+
* @param context - Optional context data JSON string
|
|
1351
|
+
* @param data - Optional initial data JSON string
|
|
1352
|
+
* @param {string} schema
|
|
1353
|
+
* @param {string | null} [context]
|
|
1354
|
+
* @param {string | null} [data]
|
|
1574
1355
|
*/
|
|
1575
|
-
|
|
1576
|
-
let deferred4_0;
|
|
1577
|
-
let deferred4_1;
|
|
1356
|
+
constructor(schema, context, data) {
|
|
1578
1357
|
try {
|
|
1579
1358
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1580
|
-
const ptr0 = passStringToWasm0(
|
|
1359
|
+
const ptr0 = passStringToWasm0(schema, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
1581
1360
|
const len0 = WASM_VECTOR_LEN;
|
|
1582
|
-
|
|
1583
|
-
|
|
1584
|
-
|
|
1361
|
+
var ptr1 = isLikeNone(context) ? 0 : passStringToWasm0(context, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
1362
|
+
var len1 = WASM_VECTOR_LEN;
|
|
1363
|
+
var ptr2 = isLikeNone(data) ? 0 : passStringToWasm0(data, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
1364
|
+
var len2 = WASM_VECTOR_LEN;
|
|
1365
|
+
wasm.jsonevalwasm_new(retptr, ptr0, len0, ptr1, len1, ptr2, len2);
|
|
1585
1366
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
1586
1367
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
1587
1368
|
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
1588
|
-
|
|
1589
|
-
|
|
1590
|
-
var len3 = r1;
|
|
1591
|
-
if (r3) {
|
|
1592
|
-
ptr3 = 0; len3 = 0;
|
|
1593
|
-
throw takeObject(r2);
|
|
1369
|
+
if (r2) {
|
|
1370
|
+
throw takeObject(r1);
|
|
1594
1371
|
}
|
|
1595
|
-
|
|
1596
|
-
|
|
1597
|
-
return
|
|
1372
|
+
this.__wbg_ptr = r0 >>> 0;
|
|
1373
|
+
JSONEvalWasmFinalization.register(this, this.__wbg_ptr, this);
|
|
1374
|
+
return this;
|
|
1598
1375
|
} finally {
|
|
1599
1376
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
1600
|
-
wasm.__wbindgen_export_2(deferred4_0, deferred4_1, 1);
|
|
1601
1377
|
}
|
|
1602
1378
|
}
|
|
1603
1379
|
/**
|
|
1604
|
-
*
|
|
1380
|
+
* Create a new JSONEval instance from a cached ParsedSchema
|
|
1605
1381
|
*
|
|
1606
|
-
* @param
|
|
1607
|
-
* @param
|
|
1608
|
-
* @
|
|
1609
|
-
* @param {string}
|
|
1610
|
-
* @param {
|
|
1611
|
-
* @
|
|
1382
|
+
* @param cacheKey - Cache key to lookup in the global ParsedSchemaCache
|
|
1383
|
+
* @param context - Optional context data JSON string
|
|
1384
|
+
* @param data - Optional initial data JSON string
|
|
1385
|
+
* @param {string} cache_key
|
|
1386
|
+
* @param {string | null} [context]
|
|
1387
|
+
* @param {string | null} [data]
|
|
1388
|
+
* @returns {JSONEvalWasm}
|
|
1612
1389
|
*/
|
|
1613
|
-
|
|
1614
|
-
let deferred2_0;
|
|
1615
|
-
let deferred2_1;
|
|
1390
|
+
static newFromCache(cache_key, context, data) {
|
|
1616
1391
|
try {
|
|
1617
1392
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1618
|
-
const ptr0 = passStringToWasm0(
|
|
1393
|
+
const ptr0 = passStringToWasm0(cache_key, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
1619
1394
|
const len0 = WASM_VECTOR_LEN;
|
|
1620
|
-
|
|
1395
|
+
var ptr1 = isLikeNone(context) ? 0 : passStringToWasm0(context, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
1396
|
+
var len1 = WASM_VECTOR_LEN;
|
|
1397
|
+
var ptr2 = isLikeNone(data) ? 0 : passStringToWasm0(data, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
1398
|
+
var len2 = WASM_VECTOR_LEN;
|
|
1399
|
+
wasm.jsonevalwasm_newFromCache(retptr, ptr0, len0, ptr1, len1, ptr2, len2);
|
|
1621
1400
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
1622
1401
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
1623
|
-
|
|
1624
|
-
|
|
1625
|
-
|
|
1402
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
1403
|
+
if (r2) {
|
|
1404
|
+
throw takeObject(r1);
|
|
1405
|
+
}
|
|
1406
|
+
return JSONEvalWasm.__wrap(r0);
|
|
1626
1407
|
} finally {
|
|
1627
1408
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
1628
|
-
wasm.__wbindgen_export_2(deferred2_0, deferred2_1, 1);
|
|
1629
1409
|
}
|
|
1630
1410
|
}
|
|
1631
1411
|
/**
|
|
1632
|
-
*
|
|
1633
|
-
*
|
|
1634
|
-
* @param
|
|
1635
|
-
* @
|
|
1636
|
-
* @param
|
|
1637
|
-
* @param {
|
|
1638
|
-
* @
|
|
1412
|
+
* Create a new JSONEval instance from MessagePack-encoded schema
|
|
1413
|
+
*
|
|
1414
|
+
* @param schemaMsgpack - MessagePack-encoded schema bytes (Uint8Array)
|
|
1415
|
+
* @param context - Optional context data JSON string
|
|
1416
|
+
* @param data - Optional initial data JSON string
|
|
1417
|
+
* @param {Uint8Array} schema_msgpack
|
|
1418
|
+
* @param {string | null} [context]
|
|
1419
|
+
* @param {string | null} [data]
|
|
1420
|
+
* @returns {JSONEvalWasm}
|
|
1639
1421
|
*/
|
|
1640
|
-
|
|
1422
|
+
static newFromMsgpack(schema_msgpack, context, data) {
|
|
1641
1423
|
try {
|
|
1642
1424
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1643
|
-
const ptr0 =
|
|
1425
|
+
const ptr0 = passArray8ToWasm0(schema_msgpack, wasm.__wbindgen_export);
|
|
1644
1426
|
const len0 = WASM_VECTOR_LEN;
|
|
1645
|
-
|
|
1646
|
-
|
|
1647
|
-
|
|
1427
|
+
var ptr1 = isLikeNone(context) ? 0 : passStringToWasm0(context, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
1428
|
+
var len1 = WASM_VECTOR_LEN;
|
|
1429
|
+
var ptr2 = isLikeNone(data) ? 0 : passStringToWasm0(data, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
1430
|
+
var len2 = WASM_VECTOR_LEN;
|
|
1431
|
+
wasm.jsonevalwasm_newFromMsgpack(retptr, ptr0, len0, ptr1, len1, ptr2, len2);
|
|
1648
1432
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
1649
1433
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
1650
1434
|
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
1651
1435
|
if (r2) {
|
|
1652
1436
|
throw takeObject(r1);
|
|
1653
1437
|
}
|
|
1654
|
-
return
|
|
1438
|
+
return JSONEvalWasm.__wrap(r0);
|
|
1655
1439
|
} finally {
|
|
1656
1440
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
1657
1441
|
}
|
|
1658
1442
|
}
|
|
1659
1443
|
/**
|
|
1660
|
-
*
|
|
1444
|
+
* Reload schema with new data
|
|
1661
1445
|
*
|
|
1662
|
-
* @param
|
|
1663
|
-
* @param changedPath - Path of the field that changed
|
|
1664
|
-
* @param data - Optional updated JSON data string
|
|
1446
|
+
* @param schema - New JSON schema string
|
|
1665
1447
|
* @param context - Optional context data JSON string
|
|
1666
|
-
* @
|
|
1667
|
-
* @param {string}
|
|
1668
|
-
* @param {string}
|
|
1669
|
-
* @param {string | null
|
|
1670
|
-
* @param {string | null | undefined} context
|
|
1671
|
-
* @param {boolean} re_evaluate
|
|
1672
|
-
* @returns {any}
|
|
1448
|
+
* @param data - Optional initial data JSON string
|
|
1449
|
+
* @param {string} schema
|
|
1450
|
+
* @param {string | null} [context]
|
|
1451
|
+
* @param {string | null} [data]
|
|
1673
1452
|
*/
|
|
1674
|
-
|
|
1453
|
+
reloadSchema(schema, context, data) {
|
|
1675
1454
|
try {
|
|
1676
1455
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1677
|
-
const ptr0 = passStringToWasm0(
|
|
1456
|
+
const ptr0 = passStringToWasm0(schema, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
1678
1457
|
const len0 = WASM_VECTOR_LEN;
|
|
1679
|
-
|
|
1680
|
-
|
|
1681
|
-
var ptr2 = isLikeNone(data) ? 0 : passStringToWasm0(data, wasm.
|
|
1458
|
+
var ptr1 = isLikeNone(context) ? 0 : passStringToWasm0(context, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
1459
|
+
var len1 = WASM_VECTOR_LEN;
|
|
1460
|
+
var ptr2 = isLikeNone(data) ? 0 : passStringToWasm0(data, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
1682
1461
|
var len2 = WASM_VECTOR_LEN;
|
|
1683
|
-
|
|
1684
|
-
var len3 = WASM_VECTOR_LEN;
|
|
1685
|
-
wasm.jsonevalwasm_evaluateDependentsSubformJS(retptr, this.__wbg_ptr, ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3, re_evaluate);
|
|
1462
|
+
wasm.jsonevalwasm_reloadSchema(retptr, this.__wbg_ptr, ptr0, len0, ptr1, len1, ptr2, len2);
|
|
1686
1463
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
1687
1464
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
1688
|
-
|
|
1689
|
-
|
|
1690
|
-
throw takeObject(r1);
|
|
1465
|
+
if (r1) {
|
|
1466
|
+
throw takeObject(r0);
|
|
1691
1467
|
}
|
|
1692
|
-
return takeObject(r0);
|
|
1693
1468
|
} finally {
|
|
1694
1469
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
1695
1470
|
}
|
|
1696
1471
|
}
|
|
1697
1472
|
/**
|
|
1698
|
-
*
|
|
1699
|
-
*
|
|
1700
|
-
* @param
|
|
1701
|
-
* @param
|
|
1702
|
-
* @
|
|
1703
|
-
* @param {string}
|
|
1704
|
-
* @param {string}
|
|
1705
|
-
* @param {
|
|
1706
|
-
* @returns {any}
|
|
1473
|
+
* Reload schema from ParsedSchemaCache using a cache key
|
|
1474
|
+
*
|
|
1475
|
+
* @param cacheKey - Cache key to lookup in the global ParsedSchemaCache
|
|
1476
|
+
* @param context - Optional context data JSON string
|
|
1477
|
+
* @param data - Optional initial data JSON string
|
|
1478
|
+
* @param {string} cache_key
|
|
1479
|
+
* @param {string | null} [context]
|
|
1480
|
+
* @param {string | null} [data]
|
|
1707
1481
|
*/
|
|
1708
|
-
|
|
1482
|
+
reloadSchemaFromCache(cache_key, context, data) {
|
|
1709
1483
|
try {
|
|
1710
1484
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1711
|
-
const ptr0 = passStringToWasm0(
|
|
1485
|
+
const ptr0 = passStringToWasm0(cache_key, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
1712
1486
|
const len0 = WASM_VECTOR_LEN;
|
|
1713
|
-
|
|
1714
|
-
|
|
1715
|
-
|
|
1487
|
+
var ptr1 = isLikeNone(context) ? 0 : passStringToWasm0(context, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
1488
|
+
var len1 = WASM_VECTOR_LEN;
|
|
1489
|
+
var ptr2 = isLikeNone(data) ? 0 : passStringToWasm0(data, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
1490
|
+
var len2 = WASM_VECTOR_LEN;
|
|
1491
|
+
wasm.jsonevalwasm_reloadSchemaFromCache(retptr, this.__wbg_ptr, ptr0, len0, ptr1, len1, ptr2, len2);
|
|
1716
1492
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
1717
1493
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
1718
|
-
|
|
1719
|
-
|
|
1720
|
-
throw takeObject(r1);
|
|
1494
|
+
if (r1) {
|
|
1495
|
+
throw takeObject(r0);
|
|
1721
1496
|
}
|
|
1722
|
-
return takeObject(r0);
|
|
1723
1497
|
} finally {
|
|
1724
1498
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
1725
1499
|
}
|
|
1726
1500
|
}
|
|
1727
1501
|
/**
|
|
1728
|
-
*
|
|
1729
|
-
* Returns an array like `[{path: "field.sub", value: 123}, ...]`.
|
|
1502
|
+
* Reload schema from MessagePack-encoded bytes
|
|
1730
1503
|
*
|
|
1731
|
-
* @param
|
|
1732
|
-
* @
|
|
1733
|
-
* @param
|
|
1734
|
-
* @
|
|
1504
|
+
* @param schemaMsgpack - MessagePack-encoded schema bytes (Uint8Array)
|
|
1505
|
+
* @param context - Optional context data JSON string
|
|
1506
|
+
* @param data - Optional initial data JSON string
|
|
1507
|
+
* @param {Uint8Array} schema_msgpack
|
|
1508
|
+
* @param {string | null} [context]
|
|
1509
|
+
* @param {string | null} [data]
|
|
1735
1510
|
*/
|
|
1736
|
-
|
|
1511
|
+
reloadSchemaMsgpack(schema_msgpack, context, data) {
|
|
1737
1512
|
try {
|
|
1738
1513
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1739
|
-
const ptr0 =
|
|
1514
|
+
const ptr0 = passArray8ToWasm0(schema_msgpack, wasm.__wbindgen_export);
|
|
1740
1515
|
const len0 = WASM_VECTOR_LEN;
|
|
1741
|
-
|
|
1516
|
+
var ptr1 = isLikeNone(context) ? 0 : passStringToWasm0(context, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
1517
|
+
var len1 = WASM_VECTOR_LEN;
|
|
1518
|
+
var ptr2 = isLikeNone(data) ? 0 : passStringToWasm0(data, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
1519
|
+
var len2 = WASM_VECTOR_LEN;
|
|
1520
|
+
wasm.jsonevalwasm_reloadSchemaMsgpack(retptr, this.__wbg_ptr, ptr0, len0, ptr1, len1, ptr2, len2);
|
|
1742
1521
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
1743
1522
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
1744
|
-
|
|
1745
|
-
|
|
1746
|
-
throw takeObject(r1);
|
|
1523
|
+
if (r1) {
|
|
1524
|
+
throw takeObject(r0);
|
|
1747
1525
|
}
|
|
1748
|
-
return takeObject(r0);
|
|
1749
1526
|
} finally {
|
|
1750
1527
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
1751
1528
|
}
|
|
1752
1529
|
}
|
|
1753
1530
|
/**
|
|
1754
|
-
*
|
|
1531
|
+
* Resolve layout with optional evaluation
|
|
1755
1532
|
*
|
|
1756
|
-
* @param
|
|
1757
|
-
* @
|
|
1758
|
-
* @
|
|
1759
|
-
* @param {string} subform_path
|
|
1760
|
-
* @param {boolean} resolve_layout
|
|
1761
|
-
* @returns {any}
|
|
1533
|
+
* @param evaluate - If true, runs evaluation before resolving layout
|
|
1534
|
+
* @throws Error if resolve fails
|
|
1535
|
+
* @param {boolean} evaluate
|
|
1762
1536
|
*/
|
|
1763
|
-
|
|
1537
|
+
resolveLayout(evaluate) {
|
|
1764
1538
|
try {
|
|
1765
1539
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1766
|
-
|
|
1767
|
-
const len0 = WASM_VECTOR_LEN;
|
|
1768
|
-
wasm.jsonevalwasm_getEvaluatedSchemaSubformJS(retptr, this.__wbg_ptr, ptr0, len0, resolve_layout);
|
|
1540
|
+
wasm.jsonevalwasm_resolveLayout(retptr, this.__wbg_ptr, evaluate);
|
|
1769
1541
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
1770
1542
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
1771
|
-
|
|
1772
|
-
|
|
1773
|
-
throw takeObject(r1);
|
|
1543
|
+
if (r1) {
|
|
1544
|
+
throw takeObject(r0);
|
|
1774
1545
|
}
|
|
1775
|
-
return takeObject(r0);
|
|
1776
1546
|
} finally {
|
|
1777
1547
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
1778
1548
|
}
|
|
1779
1549
|
}
|
|
1780
1550
|
/**
|
|
1781
|
-
*
|
|
1782
|
-
* Returns an object like `{"field.sub": 123, ...}`.
|
|
1551
|
+
* Resolve layout for subform
|
|
1783
1552
|
*
|
|
1784
1553
|
* @param subformPath - Path to the subform
|
|
1785
|
-
* @
|
|
1554
|
+
* @param evaluate - If true, runs evaluation before resolving layout
|
|
1555
|
+
* @throws Error if resolve fails
|
|
1786
1556
|
* @param {string} subform_path
|
|
1787
|
-
* @
|
|
1557
|
+
* @param {boolean} evaluate
|
|
1788
1558
|
*/
|
|
1789
|
-
|
|
1559
|
+
resolveLayoutSubform(subform_path, evaluate) {
|
|
1790
1560
|
try {
|
|
1791
1561
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1792
|
-
const ptr0 = passStringToWasm0(subform_path, wasm.
|
|
1562
|
+
const ptr0 = passStringToWasm0(subform_path, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
1793
1563
|
const len0 = WASM_VECTOR_LEN;
|
|
1794
|
-
wasm.
|
|
1564
|
+
wasm.jsonevalwasm_resolveLayoutSubform(retptr, this.__wbg_ptr, ptr0, len0, evaluate);
|
|
1795
1565
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
1796
1566
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
1797
|
-
|
|
1798
|
-
|
|
1799
|
-
throw takeObject(r1);
|
|
1567
|
+
if (r1) {
|
|
1568
|
+
throw takeObject(r0);
|
|
1800
1569
|
}
|
|
1801
|
-
return takeObject(r0);
|
|
1802
1570
|
} finally {
|
|
1803
1571
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
1804
1572
|
}
|
|
1805
1573
|
}
|
|
1806
1574
|
/**
|
|
1807
|
-
*
|
|
1808
|
-
*
|
|
1809
|
-
* @param
|
|
1810
|
-
* @param
|
|
1811
|
-
* @
|
|
1812
|
-
* @
|
|
1813
|
-
* @param {string}
|
|
1814
|
-
* @param {string}
|
|
1815
|
-
* @
|
|
1816
|
-
* @returns {string | undefined}
|
|
1575
|
+
* Run pre-compiled logic by ID
|
|
1576
|
+
* @param logic_id - Compiled logic ID from compileLogic
|
|
1577
|
+
* @param data - Optional JSON data string
|
|
1578
|
+
* @param context - Optional JSON context string
|
|
1579
|
+
* @returns Result as JavaScript object
|
|
1580
|
+
* @param {number} logic_id
|
|
1581
|
+
* @param {string | null} [data]
|
|
1582
|
+
* @param {string | null} [context]
|
|
1583
|
+
* @returns {any}
|
|
1817
1584
|
*/
|
|
1818
|
-
|
|
1585
|
+
runLogic(logic_id, data, context) {
|
|
1819
1586
|
try {
|
|
1820
1587
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1821
|
-
|
|
1822
|
-
|
|
1823
|
-
|
|
1824
|
-
|
|
1825
|
-
wasm.
|
|
1588
|
+
var ptr0 = isLikeNone(data) ? 0 : passStringToWasm0(data, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
1589
|
+
var len0 = WASM_VECTOR_LEN;
|
|
1590
|
+
var ptr1 = isLikeNone(context) ? 0 : passStringToWasm0(context, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
1591
|
+
var len1 = WASM_VECTOR_LEN;
|
|
1592
|
+
wasm.jsonevalwasm_runLogic(retptr, this.__wbg_ptr, logic_id, ptr0, len0, ptr1, len1);
|
|
1826
1593
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
1827
|
-
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
1828
|
-
|
|
1829
|
-
if (
|
|
1830
|
-
|
|
1831
|
-
wasm.__wbindgen_export_2(r0, r1 * 1, 1);
|
|
1594
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
1595
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
1596
|
+
if (r2) {
|
|
1597
|
+
throw takeObject(r1);
|
|
1832
1598
|
}
|
|
1833
|
-
return
|
|
1599
|
+
return takeObject(r0);
|
|
1834
1600
|
} finally {
|
|
1835
1601
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
1836
1602
|
}
|
|
1837
1603
|
}
|
|
1838
1604
|
/**
|
|
1839
|
-
*
|
|
1840
|
-
*
|
|
1841
|
-
* @param
|
|
1842
|
-
*
|
|
1843
|
-
* @param
|
|
1844
|
-
* @returns Data in specified format as JSON string
|
|
1845
|
-
* @param {string} subform_path
|
|
1846
|
-
* @param {string} paths_json
|
|
1847
|
-
* @param {boolean} skip_layout
|
|
1848
|
-
* @param {number} format
|
|
1849
|
-
* @returns {string}
|
|
1605
|
+
* Set timezone offset for datetime operations (TODAY, NOW)
|
|
1606
|
+
*
|
|
1607
|
+
* @param offsetMinutes - Timezone offset in minutes from UTC (e.g., 420 for UTC+7, -300 for UTC-5)
|
|
1608
|
+
* Pass null or undefined to reset to UTC
|
|
1609
|
+
* @param {number | null} [offset_minutes]
|
|
1850
1610
|
*/
|
|
1851
|
-
|
|
1852
|
-
|
|
1853
|
-
|
|
1611
|
+
setTimezoneOffset(offset_minutes) {
|
|
1612
|
+
wasm.jsonevalwasm_setTimezoneOffset(this.__wbg_ptr, isLikeNone(offset_minutes) ? 0x100000001 : (offset_minutes) >> 0);
|
|
1613
|
+
}
|
|
1614
|
+
/**
|
|
1615
|
+
* Validate data against schema rules
|
|
1616
|
+
*
|
|
1617
|
+
* @param data - JSON data string
|
|
1618
|
+
* @param context - Optional context data JSON string
|
|
1619
|
+
* @returns ValidationResult
|
|
1620
|
+
* @param {string} data
|
|
1621
|
+
* @param {string | null} [context]
|
|
1622
|
+
* @returns {ValidationResult}
|
|
1623
|
+
*/
|
|
1624
|
+
validate(data, context) {
|
|
1854
1625
|
try {
|
|
1855
1626
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1856
|
-
const ptr0 = passStringToWasm0(
|
|
1627
|
+
const ptr0 = passStringToWasm0(data, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
1857
1628
|
const len0 = WASM_VECTOR_LEN;
|
|
1858
|
-
|
|
1859
|
-
|
|
1860
|
-
wasm.
|
|
1629
|
+
var ptr1 = isLikeNone(context) ? 0 : passStringToWasm0(context, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
1630
|
+
var len1 = WASM_VECTOR_LEN;
|
|
1631
|
+
wasm.jsonevalwasm_validate(retptr, this.__wbg_ptr, ptr0, len0, ptr1, len1);
|
|
1861
1632
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
1862
1633
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
1863
1634
|
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
1864
|
-
|
|
1865
|
-
|
|
1866
|
-
var len3 = r1;
|
|
1867
|
-
if (r3) {
|
|
1868
|
-
ptr3 = 0; len3 = 0;
|
|
1869
|
-
throw takeObject(r2);
|
|
1635
|
+
if (r2) {
|
|
1636
|
+
throw takeObject(r1);
|
|
1870
1637
|
}
|
|
1871
|
-
|
|
1872
|
-
deferred4_1 = len3;
|
|
1873
|
-
return getStringFromWasm0(ptr3, len3);
|
|
1638
|
+
return ValidationResult.__wrap(r0);
|
|
1874
1639
|
} finally {
|
|
1875
1640
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
1876
|
-
wasm.__wbindgen_export_2(deferred4_0, deferred4_1, 1);
|
|
1877
1641
|
}
|
|
1878
1642
|
}
|
|
1879
1643
|
/**
|
|
1880
|
-
*
|
|
1644
|
+
* Validate data and return as plain JavaScript object (Worker-safe)
|
|
1881
1645
|
*
|
|
1882
|
-
* @param
|
|
1883
|
-
* @param
|
|
1884
|
-
* @
|
|
1885
|
-
* @
|
|
1886
|
-
* @param {string}
|
|
1887
|
-
* @param {string} schema_path
|
|
1888
|
-
* @param {boolean} skip_layout
|
|
1646
|
+
* @param data - JSON data string
|
|
1647
|
+
* @param context - Optional context data JSON string
|
|
1648
|
+
* @returns Plain JavaScript object with validation result
|
|
1649
|
+
* @param {string} data
|
|
1650
|
+
* @param {string | null} [context]
|
|
1889
1651
|
* @returns {any}
|
|
1890
1652
|
*/
|
|
1891
|
-
|
|
1653
|
+
validateJS(data, context) {
|
|
1892
1654
|
try {
|
|
1893
1655
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1894
|
-
const ptr0 = passStringToWasm0(
|
|
1656
|
+
const ptr0 = passStringToWasm0(data, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
1895
1657
|
const len0 = WASM_VECTOR_LEN;
|
|
1896
|
-
|
|
1897
|
-
|
|
1898
|
-
wasm.
|
|
1658
|
+
var ptr1 = isLikeNone(context) ? 0 : passStringToWasm0(context, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
1659
|
+
var len1 = WASM_VECTOR_LEN;
|
|
1660
|
+
wasm.jsonevalwasm_validateJS(retptr, this.__wbg_ptr, ptr0, len0, ptr1, len1);
|
|
1899
1661
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
1900
1662
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
1901
1663
|
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
@@ -1908,88 +1670,100 @@ export class JSONEvalWasm {
|
|
|
1908
1670
|
}
|
|
1909
1671
|
}
|
|
1910
1672
|
/**
|
|
1911
|
-
*
|
|
1912
|
-
*
|
|
1913
|
-
* @param
|
|
1914
|
-
* @param
|
|
1915
|
-
* @param
|
|
1916
|
-
* @returns
|
|
1917
|
-
* @param {string}
|
|
1918
|
-
* @param {string}
|
|
1919
|
-
* @param {
|
|
1920
|
-
* @
|
|
1921
|
-
* @returns {any}
|
|
1673
|
+
* Validate data against schema rules with optional path filtering
|
|
1674
|
+
*
|
|
1675
|
+
* @param data - JSON data string
|
|
1676
|
+
* @param context - Optional context data JSON string
|
|
1677
|
+
* @param paths - Optional array of paths to validate (null for all)
|
|
1678
|
+
* @returns ValidationResult
|
|
1679
|
+
* @param {string} data
|
|
1680
|
+
* @param {string | null} [context]
|
|
1681
|
+
* @param {string[] | null} [paths]
|
|
1682
|
+
* @returns {ValidationResult}
|
|
1922
1683
|
*/
|
|
1923
|
-
|
|
1684
|
+
validatePaths(data, context, paths) {
|
|
1924
1685
|
try {
|
|
1925
1686
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1926
|
-
const ptr0 = passStringToWasm0(
|
|
1687
|
+
const ptr0 = passStringToWasm0(data, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
1927
1688
|
const len0 = WASM_VECTOR_LEN;
|
|
1928
|
-
|
|
1929
|
-
|
|
1930
|
-
|
|
1689
|
+
var ptr1 = isLikeNone(context) ? 0 : passStringToWasm0(context, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
1690
|
+
var len1 = WASM_VECTOR_LEN;
|
|
1691
|
+
var ptr2 = isLikeNone(paths) ? 0 : passArrayJsValueToWasm0(paths, wasm.__wbindgen_export);
|
|
1692
|
+
var len2 = WASM_VECTOR_LEN;
|
|
1693
|
+
wasm.jsonevalwasm_validatePaths(retptr, this.__wbg_ptr, ptr0, len0, ptr1, len1, ptr2, len2);
|
|
1931
1694
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
1932
1695
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
1933
1696
|
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
1934
1697
|
if (r2) {
|
|
1935
1698
|
throw takeObject(r1);
|
|
1936
1699
|
}
|
|
1937
|
-
return
|
|
1700
|
+
return ValidationResult.__wrap(r0);
|
|
1938
1701
|
} finally {
|
|
1939
1702
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
1940
1703
|
}
|
|
1941
1704
|
}
|
|
1942
1705
|
/**
|
|
1943
|
-
*
|
|
1706
|
+
* Validate with path filtering and return as plain JavaScript object (Worker-safe)
|
|
1944
1707
|
*
|
|
1945
|
-
* @param
|
|
1946
|
-
* @param
|
|
1947
|
-
* @
|
|
1948
|
-
* @
|
|
1949
|
-
* @param {
|
|
1950
|
-
* @
|
|
1708
|
+
* @param data - JSON data string
|
|
1709
|
+
* @param context - Optional context data JSON string
|
|
1710
|
+
* @param paths - Optional array of paths to validate (null for all)
|
|
1711
|
+
* @returns Plain JavaScript object with validation result
|
|
1712
|
+
* @param {string} data
|
|
1713
|
+
* @param {string | null} [context]
|
|
1714
|
+
* @param {string[] | null} [paths]
|
|
1715
|
+
* @returns {any}
|
|
1951
1716
|
*/
|
|
1952
|
-
|
|
1953
|
-
let deferred2_0;
|
|
1954
|
-
let deferred2_1;
|
|
1717
|
+
validatePathsJS(data, context, paths) {
|
|
1955
1718
|
try {
|
|
1956
1719
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1957
|
-
const ptr0 = passStringToWasm0(
|
|
1720
|
+
const ptr0 = passStringToWasm0(data, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
1958
1721
|
const len0 = WASM_VECTOR_LEN;
|
|
1959
|
-
|
|
1722
|
+
var ptr1 = isLikeNone(context) ? 0 : passStringToWasm0(context, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
1723
|
+
var len1 = WASM_VECTOR_LEN;
|
|
1724
|
+
var ptr2 = isLikeNone(paths) ? 0 : passArrayJsValueToWasm0(paths, wasm.__wbindgen_export);
|
|
1725
|
+
var len2 = WASM_VECTOR_LEN;
|
|
1726
|
+
wasm.jsonevalwasm_validatePathsJS(retptr, this.__wbg_ptr, ptr0, len0, ptr1, len1, ptr2, len2);
|
|
1960
1727
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
1961
1728
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
1962
|
-
|
|
1963
|
-
|
|
1964
|
-
|
|
1729
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
1730
|
+
if (r2) {
|
|
1731
|
+
throw takeObject(r1);
|
|
1732
|
+
}
|
|
1733
|
+
return takeObject(r0);
|
|
1965
1734
|
} finally {
|
|
1966
1735
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
1967
|
-
wasm.__wbindgen_export_2(deferred2_0, deferred2_1, 1);
|
|
1968
1736
|
}
|
|
1969
1737
|
}
|
|
1970
1738
|
/**
|
|
1971
|
-
*
|
|
1739
|
+
* Validate subform data against its schema rules
|
|
1972
1740
|
*
|
|
1973
1741
|
* @param subformPath - Path to the subform
|
|
1974
|
-
* @param
|
|
1975
|
-
* @
|
|
1742
|
+
* @param data - JSON data string for the subform
|
|
1743
|
+
* @param context - Optional context data JSON string
|
|
1744
|
+
* @returns ValidationResult
|
|
1976
1745
|
* @param {string} subform_path
|
|
1977
|
-
* @param {
|
|
1978
|
-
* @
|
|
1746
|
+
* @param {string} data
|
|
1747
|
+
* @param {string | null} [context]
|
|
1748
|
+
* @returns {ValidationResult}
|
|
1979
1749
|
*/
|
|
1980
|
-
|
|
1750
|
+
validateSubform(subform_path, data, context) {
|
|
1981
1751
|
try {
|
|
1982
1752
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1983
|
-
const ptr0 = passStringToWasm0(subform_path, wasm.
|
|
1753
|
+
const ptr0 = passStringToWasm0(subform_path, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
1984
1754
|
const len0 = WASM_VECTOR_LEN;
|
|
1985
|
-
|
|
1755
|
+
const ptr1 = passStringToWasm0(data, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
1756
|
+
const len1 = WASM_VECTOR_LEN;
|
|
1757
|
+
var ptr2 = isLikeNone(context) ? 0 : passStringToWasm0(context, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
1758
|
+
var len2 = WASM_VECTOR_LEN;
|
|
1759
|
+
wasm.jsonevalwasm_validateSubform(retptr, this.__wbg_ptr, ptr0, len0, ptr1, len1, ptr2, len2);
|
|
1986
1760
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
1987
1761
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
1988
1762
|
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
1989
1763
|
if (r2) {
|
|
1990
1764
|
throw takeObject(r1);
|
|
1991
1765
|
}
|
|
1992
|
-
return
|
|
1766
|
+
return ValidationResult.__wrap(r0);
|
|
1993
1767
|
} finally {
|
|
1994
1768
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
1995
1769
|
}
|
|
@@ -1997,21 +1771,16 @@ export class JSONEvalWasm {
|
|
|
1997
1771
|
}
|
|
1998
1772
|
if (Symbol.dispose) JSONEvalWasm.prototype[Symbol.dispose] = JSONEvalWasm.prototype.free;
|
|
1999
1773
|
|
|
2000
|
-
const ValidationErrorFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
2001
|
-
? { register: () => {}, unregister: () => {} }
|
|
2002
|
-
: new FinalizationRegistry(ptr => wasm.__wbg_validationerror_free(ptr >>> 0, 1));
|
|
2003
1774
|
/**
|
|
2004
1775
|
* Validation error for JavaScript
|
|
2005
1776
|
*/
|
|
2006
1777
|
export class ValidationError {
|
|
2007
|
-
|
|
2008
1778
|
__destroy_into_raw() {
|
|
2009
1779
|
const ptr = this.__wbg_ptr;
|
|
2010
1780
|
this.__wbg_ptr = 0;
|
|
2011
1781
|
ValidationErrorFinalization.unregister(this);
|
|
2012
1782
|
return ptr;
|
|
2013
1783
|
}
|
|
2014
|
-
|
|
2015
1784
|
free() {
|
|
2016
1785
|
const ptr = this.__destroy_into_raw();
|
|
2017
1786
|
wasm.__wbg_validationerror_free(ptr, 0);
|
|
@@ -2019,57 +1788,57 @@ export class ValidationError {
|
|
|
2019
1788
|
/**
|
|
2020
1789
|
* @returns {string | undefined}
|
|
2021
1790
|
*/
|
|
2022
|
-
get
|
|
1791
|
+
get code() {
|
|
2023
1792
|
try {
|
|
2024
1793
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
2025
|
-
wasm.
|
|
1794
|
+
wasm.validationerror_code(retptr, this.__wbg_ptr);
|
|
2026
1795
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
2027
1796
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
2028
1797
|
let v1;
|
|
2029
1798
|
if (r0 !== 0) {
|
|
2030
1799
|
v1 = getStringFromWasm0(r0, r1).slice();
|
|
2031
|
-
wasm.
|
|
1800
|
+
wasm.__wbindgen_export3(r0, r1 * 1, 1);
|
|
2032
1801
|
}
|
|
2033
1802
|
return v1;
|
|
2034
1803
|
} finally {
|
|
2035
1804
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
2036
1805
|
}
|
|
2037
1806
|
}
|
|
1807
|
+
/**
|
|
1808
|
+
* @returns {any}
|
|
1809
|
+
*/
|
|
1810
|
+
get data() {
|
|
1811
|
+
const ret = wasm.validationerror_data(this.__wbg_ptr);
|
|
1812
|
+
return takeObject(ret);
|
|
1813
|
+
}
|
|
2038
1814
|
/**
|
|
2039
1815
|
* @returns {string | undefined}
|
|
2040
1816
|
*/
|
|
2041
|
-
get
|
|
1817
|
+
get field_value() {
|
|
2042
1818
|
try {
|
|
2043
1819
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
2044
|
-
wasm.
|
|
1820
|
+
wasm.validationerror_field_value(retptr, this.__wbg_ptr);
|
|
2045
1821
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
2046
1822
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
2047
1823
|
let v1;
|
|
2048
1824
|
if (r0 !== 0) {
|
|
2049
1825
|
v1 = getStringFromWasm0(r0, r1).slice();
|
|
2050
|
-
wasm.
|
|
1826
|
+
wasm.__wbindgen_export3(r0, r1 * 1, 1);
|
|
2051
1827
|
}
|
|
2052
1828
|
return v1;
|
|
2053
1829
|
} finally {
|
|
2054
1830
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
2055
1831
|
}
|
|
2056
1832
|
}
|
|
2057
|
-
/**
|
|
2058
|
-
* @returns {any}
|
|
2059
|
-
*/
|
|
2060
|
-
get data() {
|
|
2061
|
-
const ret = wasm.validationerror_data(this.__wbg_ptr);
|
|
2062
|
-
return takeObject(ret);
|
|
2063
|
-
}
|
|
2064
1833
|
/**
|
|
2065
1834
|
* @returns {string}
|
|
2066
1835
|
*/
|
|
2067
|
-
get
|
|
1836
|
+
get message() {
|
|
2068
1837
|
let deferred1_0;
|
|
2069
1838
|
let deferred1_1;
|
|
2070
1839
|
try {
|
|
2071
1840
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
2072
|
-
wasm.
|
|
1841
|
+
wasm.validationerror_message(retptr, this.__wbg_ptr);
|
|
2073
1842
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
2074
1843
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
2075
1844
|
deferred1_0 = r0;
|
|
@@ -2077,18 +1846,18 @@ export class ValidationError {
|
|
|
2077
1846
|
return getStringFromWasm0(r0, r1);
|
|
2078
1847
|
} finally {
|
|
2079
1848
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
2080
|
-
wasm.
|
|
1849
|
+
wasm.__wbindgen_export3(deferred1_0, deferred1_1, 1);
|
|
2081
1850
|
}
|
|
2082
1851
|
}
|
|
2083
1852
|
/**
|
|
2084
1853
|
* @returns {string}
|
|
2085
1854
|
*/
|
|
2086
|
-
get
|
|
1855
|
+
get path() {
|
|
2087
1856
|
let deferred1_0;
|
|
2088
1857
|
let deferred1_1;
|
|
2089
1858
|
try {
|
|
2090
1859
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
2091
|
-
wasm.
|
|
1860
|
+
wasm.validationerror_path(retptr, this.__wbg_ptr);
|
|
2092
1861
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
2093
1862
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
2094
1863
|
deferred1_0 = r0;
|
|
@@ -2096,7 +1865,7 @@ export class ValidationError {
|
|
|
2096
1865
|
return getStringFromWasm0(r0, r1);
|
|
2097
1866
|
} finally {
|
|
2098
1867
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
2099
|
-
wasm.
|
|
1868
|
+
wasm.__wbindgen_export3(deferred1_0, deferred1_1, 1);
|
|
2100
1869
|
}
|
|
2101
1870
|
}
|
|
2102
1871
|
/**
|
|
@@ -2111,7 +1880,7 @@ export class ValidationError {
|
|
|
2111
1880
|
let v1;
|
|
2112
1881
|
if (r0 !== 0) {
|
|
2113
1882
|
v1 = getStringFromWasm0(r0, r1).slice();
|
|
2114
|
-
wasm.
|
|
1883
|
+
wasm.__wbindgen_export3(r0, r1 * 1, 1);
|
|
2115
1884
|
}
|
|
2116
1885
|
return v1;
|
|
2117
1886
|
} finally {
|
|
@@ -2134,20 +1903,16 @@ export class ValidationError {
|
|
|
2134
1903
|
return getStringFromWasm0(r0, r1);
|
|
2135
1904
|
} finally {
|
|
2136
1905
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
2137
|
-
wasm.
|
|
1906
|
+
wasm.__wbindgen_export3(deferred1_0, deferred1_1, 1);
|
|
2138
1907
|
}
|
|
2139
1908
|
}
|
|
2140
1909
|
}
|
|
2141
1910
|
if (Symbol.dispose) ValidationError.prototype[Symbol.dispose] = ValidationError.prototype.free;
|
|
2142
1911
|
|
|
2143
|
-
const ValidationResultFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
2144
|
-
? { register: () => {}, unregister: () => {} }
|
|
2145
|
-
: new FinalizationRegistry(ptr => wasm.__wbg_validationresult_free(ptr >>> 0, 1));
|
|
2146
1912
|
/**
|
|
2147
1913
|
* Validation result for JavaScript
|
|
2148
1914
|
*/
|
|
2149
1915
|
export class ValidationResult {
|
|
2150
|
-
|
|
2151
1916
|
static __wrap(ptr) {
|
|
2152
1917
|
ptr = ptr >>> 0;
|
|
2153
1918
|
const obj = Object.create(ValidationResult.prototype);
|
|
@@ -2155,14 +1920,12 @@ export class ValidationResult {
|
|
|
2155
1920
|
ValidationResultFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
2156
1921
|
return obj;
|
|
2157
1922
|
}
|
|
2158
|
-
|
|
2159
1923
|
__destroy_into_raw() {
|
|
2160
1924
|
const ptr = this.__wbg_ptr;
|
|
2161
1925
|
this.__wbg_ptr = 0;
|
|
2162
1926
|
ValidationResultFinalization.unregister(this);
|
|
2163
1927
|
return ptr;
|
|
2164
1928
|
}
|
|
2165
|
-
|
|
2166
1929
|
free() {
|
|
2167
1930
|
const ptr = this.__destroy_into_raw();
|
|
2168
1931
|
wasm.__wbg_validationresult_free(ptr, 0);
|
|
@@ -2174,6 +1937,13 @@ export class ValidationResult {
|
|
|
2174
1937
|
const ret = wasm.validationresult_error(this.__wbg_ptr);
|
|
2175
1938
|
return takeObject(ret);
|
|
2176
1939
|
}
|
|
1940
|
+
/**
|
|
1941
|
+
* @returns {boolean}
|
|
1942
|
+
*/
|
|
1943
|
+
get has_error() {
|
|
1944
|
+
const ret = wasm.validationresult_has_error(this.__wbg_ptr);
|
|
1945
|
+
return ret !== 0;
|
|
1946
|
+
}
|
|
2177
1947
|
/**
|
|
2178
1948
|
* @returns {any}
|
|
2179
1949
|
*/
|
|
@@ -2192,30 +1962,84 @@ export class ValidationResult {
|
|
|
2192
1962
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
2193
1963
|
}
|
|
2194
1964
|
}
|
|
2195
|
-
|
|
2196
|
-
|
|
2197
|
-
|
|
2198
|
-
|
|
2199
|
-
|
|
2200
|
-
|
|
1965
|
+
}
|
|
1966
|
+
if (Symbol.dispose) ValidationResult.prototype[Symbol.dispose] = ValidationResult.prototype.free;
|
|
1967
|
+
|
|
1968
|
+
/**
|
|
1969
|
+
* Get the library version
|
|
1970
|
+
* @returns {string}
|
|
1971
|
+
*/
|
|
1972
|
+
export function getVersion() {
|
|
1973
|
+
let deferred1_0;
|
|
1974
|
+
let deferred1_1;
|
|
1975
|
+
try {
|
|
1976
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1977
|
+
wasm.getVersion(retptr);
|
|
1978
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
1979
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
1980
|
+
deferred1_0 = r0;
|
|
1981
|
+
deferred1_1 = r1;
|
|
1982
|
+
return getStringFromWasm0(r0, r1);
|
|
1983
|
+
} finally {
|
|
1984
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
1985
|
+
wasm.__wbindgen_export3(deferred1_0, deferred1_1, 1);
|
|
1986
|
+
}
|
|
1987
|
+
}
|
|
1988
|
+
|
|
1989
|
+
/**
|
|
1990
|
+
* Initialize the library (sets up panic hook)
|
|
1991
|
+
*/
|
|
1992
|
+
export function init() {
|
|
1993
|
+
wasm.init();
|
|
1994
|
+
}
|
|
1995
|
+
|
|
1996
|
+
/**
|
|
1997
|
+
* Get library version (alias)
|
|
1998
|
+
* @returns {string}
|
|
1999
|
+
*/
|
|
2000
|
+
export function version() {
|
|
2001
|
+
let deferred1_0;
|
|
2002
|
+
let deferred1_1;
|
|
2003
|
+
try {
|
|
2004
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
2005
|
+
wasm.version(retptr);
|
|
2006
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
2007
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
2008
|
+
deferred1_0 = r0;
|
|
2009
|
+
deferred1_1 = r1;
|
|
2010
|
+
return getStringFromWasm0(r0, r1);
|
|
2011
|
+
} finally {
|
|
2012
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
2013
|
+
wasm.__wbindgen_export3(deferred1_0, deferred1_1, 1);
|
|
2201
2014
|
}
|
|
2202
2015
|
}
|
|
2203
|
-
|
|
2204
|
-
|
|
2205
|
-
export function __wbg_Error_e17e777aac105295(arg0, arg1) {
|
|
2016
|
+
export function __wbg_Error_83742b46f01ce22d(arg0, arg1) {
|
|
2206
2017
|
const ret = Error(getStringFromWasm0(arg0, arg1));
|
|
2207
2018
|
return addHeapObject(ret);
|
|
2208
|
-
}
|
|
2209
|
-
|
|
2210
|
-
export function __wbg_String_8f0eb39a4a4c2f66(arg0, arg1) {
|
|
2019
|
+
}
|
|
2020
|
+
export function __wbg_String_8564e559799eccda(arg0, arg1) {
|
|
2211
2021
|
const ret = String(getObject(arg1));
|
|
2212
|
-
const ptr1 = passStringToWasm0(ret, wasm.
|
|
2022
|
+
const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
2213
2023
|
const len1 = WASM_VECTOR_LEN;
|
|
2214
2024
|
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
2215
2025
|
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
2216
|
-
}
|
|
2217
|
-
|
|
2218
|
-
|
|
2026
|
+
}
|
|
2027
|
+
export function __wbg___wbindgen_is_string_7ef6b97b02428fae(arg0) {
|
|
2028
|
+
const ret = typeof(getObject(arg0)) === 'string';
|
|
2029
|
+
return ret;
|
|
2030
|
+
}
|
|
2031
|
+
export function __wbg___wbindgen_string_get_395e606bd0ee4427(arg0, arg1) {
|
|
2032
|
+
const obj = getObject(arg1);
|
|
2033
|
+
const ret = typeof(obj) === 'string' ? obj : undefined;
|
|
2034
|
+
var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
2035
|
+
var len1 = WASM_VECTOR_LEN;
|
|
2036
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
2037
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
2038
|
+
}
|
|
2039
|
+
export function __wbg___wbindgen_throw_6ddd609b62940d55(arg0, arg1) {
|
|
2040
|
+
throw new Error(getStringFromWasm0(arg0, arg1));
|
|
2041
|
+
}
|
|
2042
|
+
export function __wbg_error_a6fa202b58aa1cd3(arg0, arg1) {
|
|
2219
2043
|
let deferred0_0;
|
|
2220
2044
|
let deferred0_1;
|
|
2221
2045
|
try {
|
|
@@ -2223,117 +2047,254 @@ export function __wbg_error_7534b8e9a36f1ab4(arg0, arg1) {
|
|
|
2223
2047
|
deferred0_1 = arg1;
|
|
2224
2048
|
console.error(getStringFromWasm0(arg0, arg1));
|
|
2225
2049
|
} finally {
|
|
2226
|
-
wasm.
|
|
2050
|
+
wasm.__wbindgen_export3(deferred0_0, deferred0_1, 1);
|
|
2227
2051
|
}
|
|
2228
|
-
}
|
|
2229
|
-
|
|
2230
|
-
export function __wbg_getRandomValues_1c61fac11405ffdc() { return handleError(function (arg0, arg1) {
|
|
2052
|
+
}
|
|
2053
|
+
export function __wbg_getRandomValues_3f44b700395062e5() { return handleError(function (arg0, arg1) {
|
|
2231
2054
|
globalThis.crypto.getRandomValues(getArrayU8FromWasm0(arg0, arg1));
|
|
2232
|
-
}, arguments) }
|
|
2233
|
-
|
|
2234
|
-
export function __wbg_getTime_6bb3f64e0f18f817(arg0) {
|
|
2055
|
+
}, arguments); }
|
|
2056
|
+
export function __wbg_getTime_1dad7b5386ddd2d9(arg0) {
|
|
2235
2057
|
const ret = getObject(arg0).getTime();
|
|
2236
2058
|
return ret;
|
|
2237
|
-
}
|
|
2238
|
-
|
|
2239
|
-
export function __wbg_log_2b562790053c5ff7(arg0, arg1) {
|
|
2059
|
+
}
|
|
2060
|
+
export function __wbg_log_c58dbef5c3f95283(arg0, arg1) {
|
|
2240
2061
|
console.log(getStringFromWasm0(arg0, arg1));
|
|
2241
|
-
}
|
|
2242
|
-
|
|
2243
|
-
export function __wbg_new0_b0a0a38c201e6df5() {
|
|
2062
|
+
}
|
|
2063
|
+
export function __wbg_new_0_1dcafdf5e786e876() {
|
|
2244
2064
|
const ret = new Date();
|
|
2245
2065
|
return addHeapObject(ret);
|
|
2246
|
-
}
|
|
2247
|
-
|
|
2248
|
-
|
|
2249
|
-
const ret = new Object();
|
|
2250
|
-
return addHeapObject(ret);
|
|
2251
|
-
};
|
|
2252
|
-
|
|
2253
|
-
export function __wbg_new_1f3a344cf3123716() {
|
|
2254
|
-
const ret = new Array();
|
|
2066
|
+
}
|
|
2067
|
+
export function __wbg_new_227d7c05414eb861() {
|
|
2068
|
+
const ret = new Error();
|
|
2255
2069
|
return addHeapObject(ret);
|
|
2256
|
-
}
|
|
2257
|
-
|
|
2258
|
-
export function __wbg_new_2ff1f68f3676ea53() {
|
|
2070
|
+
}
|
|
2071
|
+
export function __wbg_new_49d5571bd3f0c4d4() {
|
|
2259
2072
|
const ret = new Map();
|
|
2260
2073
|
return addHeapObject(ret);
|
|
2261
|
-
}
|
|
2262
|
-
|
|
2263
|
-
|
|
2264
|
-
const ret = new Error();
|
|
2074
|
+
}
|
|
2075
|
+
export function __wbg_new_a70fbab9066b301f() {
|
|
2076
|
+
const ret = new Array();
|
|
2265
2077
|
return addHeapObject(ret);
|
|
2266
|
-
}
|
|
2267
|
-
|
|
2268
|
-
|
|
2269
|
-
|
|
2270
|
-
}
|
|
2271
|
-
|
|
2272
|
-
export function __wbg_set_90f6c0f7bd8c0415(arg0, arg1, arg2) {
|
|
2078
|
+
}
|
|
2079
|
+
export function __wbg_new_ab79df5bd7c26067() {
|
|
2080
|
+
const ret = new Object();
|
|
2081
|
+
return addHeapObject(ret);
|
|
2082
|
+
}
|
|
2083
|
+
export function __wbg_set_282384002438957f(arg0, arg1, arg2) {
|
|
2273
2084
|
getObject(arg0)[arg1 >>> 0] = takeObject(arg2);
|
|
2274
|
-
}
|
|
2275
|
-
|
|
2276
|
-
|
|
2085
|
+
}
|
|
2086
|
+
export function __wbg_set_6be42768c690e380(arg0, arg1, arg2) {
|
|
2087
|
+
getObject(arg0)[takeObject(arg1)] = takeObject(arg2);
|
|
2088
|
+
}
|
|
2089
|
+
export function __wbg_set_bf7251625df30a02(arg0, arg1, arg2) {
|
|
2277
2090
|
const ret = getObject(arg0).set(getObject(arg1), getObject(arg2));
|
|
2278
2091
|
return addHeapObject(ret);
|
|
2279
|
-
}
|
|
2280
|
-
|
|
2281
|
-
export function __wbg_stack_0ed75d68575b0f3c(arg0, arg1) {
|
|
2092
|
+
}
|
|
2093
|
+
export function __wbg_stack_3b0d974bbf31e44f(arg0, arg1) {
|
|
2282
2094
|
const ret = getObject(arg1).stack;
|
|
2283
|
-
const ptr1 = passStringToWasm0(ret, wasm.
|
|
2095
|
+
const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
2284
2096
|
const len1 = WASM_VECTOR_LEN;
|
|
2285
2097
|
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
2286
2098
|
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
2287
|
-
}
|
|
2288
|
-
|
|
2289
|
-
|
|
2290
|
-
const ret =
|
|
2291
|
-
return ret;
|
|
2292
|
-
}
|
|
2293
|
-
|
|
2294
|
-
|
|
2295
|
-
const
|
|
2296
|
-
|
|
2297
|
-
|
|
2298
|
-
|
|
2299
|
-
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
2300
|
-
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
2301
|
-
};
|
|
2302
|
-
|
|
2303
|
-
export function __wbg_wbindgenthrow_451ec1a8469d7eb6(arg0, arg1) {
|
|
2304
|
-
throw new Error(getStringFromWasm0(arg0, arg1));
|
|
2305
|
-
};
|
|
2306
|
-
|
|
2307
|
-
export function __wbindgen_cast_2241b6af4c4b2941(arg0, arg1) {
|
|
2099
|
+
}
|
|
2100
|
+
export function __wbindgen_cast_0000000000000001(arg0) {
|
|
2101
|
+
// Cast intrinsic for `F64 -> Externref`.
|
|
2102
|
+
const ret = arg0;
|
|
2103
|
+
return addHeapObject(ret);
|
|
2104
|
+
}
|
|
2105
|
+
export function __wbindgen_cast_0000000000000002(arg0) {
|
|
2106
|
+
// Cast intrinsic for `I64 -> Externref`.
|
|
2107
|
+
const ret = arg0;
|
|
2108
|
+
return addHeapObject(ret);
|
|
2109
|
+
}
|
|
2110
|
+
export function __wbindgen_cast_0000000000000003(arg0, arg1) {
|
|
2308
2111
|
// Cast intrinsic for `Ref(String) -> Externref`.
|
|
2309
2112
|
const ret = getStringFromWasm0(arg0, arg1);
|
|
2310
2113
|
return addHeapObject(ret);
|
|
2311
|
-
}
|
|
2312
|
-
|
|
2313
|
-
export function __wbindgen_cast_4625c577ab2ec9ee(arg0) {
|
|
2114
|
+
}
|
|
2115
|
+
export function __wbindgen_cast_0000000000000004(arg0) {
|
|
2314
2116
|
// Cast intrinsic for `U64 -> Externref`.
|
|
2315
2117
|
const ret = BigInt.asUintN(64, arg0);
|
|
2316
2118
|
return addHeapObject(ret);
|
|
2317
|
-
}
|
|
2318
|
-
|
|
2319
|
-
export function __wbindgen_cast_9ae0607507abb057(arg0) {
|
|
2320
|
-
// Cast intrinsic for `I64 -> Externref`.
|
|
2321
|
-
const ret = arg0;
|
|
2322
|
-
return addHeapObject(ret);
|
|
2323
|
-
};
|
|
2324
|
-
|
|
2325
|
-
export function __wbindgen_cast_d6cd19b81560fd6e(arg0) {
|
|
2326
|
-
// Cast intrinsic for `F64 -> Externref`.
|
|
2327
|
-
const ret = arg0;
|
|
2328
|
-
return addHeapObject(ret);
|
|
2329
|
-
};
|
|
2330
|
-
|
|
2119
|
+
}
|
|
2331
2120
|
export function __wbindgen_object_clone_ref(arg0) {
|
|
2332
2121
|
const ret = getObject(arg0);
|
|
2333
2122
|
return addHeapObject(ret);
|
|
2334
|
-
}
|
|
2335
|
-
|
|
2123
|
+
}
|
|
2336
2124
|
export function __wbindgen_object_drop_ref(arg0) {
|
|
2337
2125
|
takeObject(arg0);
|
|
2338
|
-
}
|
|
2126
|
+
}
|
|
2127
|
+
const JSONEvalWasmFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
2128
|
+
? { register: () => {}, unregister: () => {} }
|
|
2129
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_jsonevalwasm_free(ptr >>> 0, 1));
|
|
2130
|
+
const ValidationErrorFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
2131
|
+
? { register: () => {}, unregister: () => {} }
|
|
2132
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_validationerror_free(ptr >>> 0, 1));
|
|
2133
|
+
const ValidationResultFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
2134
|
+
? { register: () => {}, unregister: () => {} }
|
|
2135
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_validationresult_free(ptr >>> 0, 1));
|
|
2136
|
+
|
|
2137
|
+
function addHeapObject(obj) {
|
|
2138
|
+
if (heap_next === heap.length) heap.push(heap.length + 1);
|
|
2139
|
+
const idx = heap_next;
|
|
2140
|
+
heap_next = heap[idx];
|
|
2141
|
+
|
|
2142
|
+
heap[idx] = obj;
|
|
2143
|
+
return idx;
|
|
2144
|
+
}
|
|
2145
|
+
|
|
2146
|
+
function dropObject(idx) {
|
|
2147
|
+
if (idx < 1028) return;
|
|
2148
|
+
heap[idx] = heap_next;
|
|
2149
|
+
heap_next = idx;
|
|
2150
|
+
}
|
|
2151
|
+
|
|
2152
|
+
function getArrayJsValueFromWasm0(ptr, len) {
|
|
2153
|
+
ptr = ptr >>> 0;
|
|
2154
|
+
const mem = getDataViewMemory0();
|
|
2155
|
+
const result = [];
|
|
2156
|
+
for (let i = ptr; i < ptr + 4 * len; i += 4) {
|
|
2157
|
+
result.push(takeObject(mem.getUint32(i, true)));
|
|
2158
|
+
}
|
|
2159
|
+
return result;
|
|
2160
|
+
}
|
|
2161
|
+
|
|
2162
|
+
function getArrayU8FromWasm0(ptr, len) {
|
|
2163
|
+
ptr = ptr >>> 0;
|
|
2164
|
+
return getUint8ArrayMemory0().subarray(ptr / 1, ptr / 1 + len);
|
|
2165
|
+
}
|
|
2166
|
+
|
|
2167
|
+
let cachedDataViewMemory0 = null;
|
|
2168
|
+
function getDataViewMemory0() {
|
|
2169
|
+
if (cachedDataViewMemory0 === null || cachedDataViewMemory0.buffer.detached === true || (cachedDataViewMemory0.buffer.detached === undefined && cachedDataViewMemory0.buffer !== wasm.memory.buffer)) {
|
|
2170
|
+
cachedDataViewMemory0 = new DataView(wasm.memory.buffer);
|
|
2171
|
+
}
|
|
2172
|
+
return cachedDataViewMemory0;
|
|
2173
|
+
}
|
|
2174
|
+
|
|
2175
|
+
function getStringFromWasm0(ptr, len) {
|
|
2176
|
+
ptr = ptr >>> 0;
|
|
2177
|
+
return decodeText(ptr, len);
|
|
2178
|
+
}
|
|
2179
|
+
|
|
2180
|
+
let cachedUint8ArrayMemory0 = null;
|
|
2181
|
+
function getUint8ArrayMemory0() {
|
|
2182
|
+
if (cachedUint8ArrayMemory0 === null || cachedUint8ArrayMemory0.byteLength === 0) {
|
|
2183
|
+
cachedUint8ArrayMemory0 = new Uint8Array(wasm.memory.buffer);
|
|
2184
|
+
}
|
|
2185
|
+
return cachedUint8ArrayMemory0;
|
|
2186
|
+
}
|
|
2187
|
+
|
|
2188
|
+
function getObject(idx) { return heap[idx]; }
|
|
2189
|
+
|
|
2190
|
+
function handleError(f, args) {
|
|
2191
|
+
try {
|
|
2192
|
+
return f.apply(this, args);
|
|
2193
|
+
} catch (e) {
|
|
2194
|
+
wasm.__wbindgen_export4(addHeapObject(e));
|
|
2195
|
+
}
|
|
2196
|
+
}
|
|
2197
|
+
|
|
2198
|
+
let heap = new Array(1024).fill(undefined);
|
|
2199
|
+
heap.push(undefined, null, true, false);
|
|
2200
|
+
|
|
2201
|
+
let heap_next = heap.length;
|
|
2202
|
+
|
|
2203
|
+
function isLikeNone(x) {
|
|
2204
|
+
return x === undefined || x === null;
|
|
2205
|
+
}
|
|
2206
|
+
|
|
2207
|
+
function passArray8ToWasm0(arg, malloc) {
|
|
2208
|
+
const ptr = malloc(arg.length * 1, 1) >>> 0;
|
|
2209
|
+
getUint8ArrayMemory0().set(arg, ptr / 1);
|
|
2210
|
+
WASM_VECTOR_LEN = arg.length;
|
|
2211
|
+
return ptr;
|
|
2212
|
+
}
|
|
2213
|
+
|
|
2214
|
+
function passArrayJsValueToWasm0(array, malloc) {
|
|
2215
|
+
const ptr = malloc(array.length * 4, 4) >>> 0;
|
|
2216
|
+
const mem = getDataViewMemory0();
|
|
2217
|
+
for (let i = 0; i < array.length; i++) {
|
|
2218
|
+
mem.setUint32(ptr + 4 * i, addHeapObject(array[i]), true);
|
|
2219
|
+
}
|
|
2220
|
+
WASM_VECTOR_LEN = array.length;
|
|
2221
|
+
return ptr;
|
|
2222
|
+
}
|
|
2223
|
+
|
|
2224
|
+
function passStringToWasm0(arg, malloc, realloc) {
|
|
2225
|
+
if (realloc === undefined) {
|
|
2226
|
+
const buf = cachedTextEncoder.encode(arg);
|
|
2227
|
+
const ptr = malloc(buf.length, 1) >>> 0;
|
|
2228
|
+
getUint8ArrayMemory0().subarray(ptr, ptr + buf.length).set(buf);
|
|
2229
|
+
WASM_VECTOR_LEN = buf.length;
|
|
2230
|
+
return ptr;
|
|
2231
|
+
}
|
|
2232
|
+
|
|
2233
|
+
let len = arg.length;
|
|
2234
|
+
let ptr = malloc(len, 1) >>> 0;
|
|
2339
2235
|
|
|
2236
|
+
const mem = getUint8ArrayMemory0();
|
|
2237
|
+
|
|
2238
|
+
let offset = 0;
|
|
2239
|
+
|
|
2240
|
+
for (; offset < len; offset++) {
|
|
2241
|
+
const code = arg.charCodeAt(offset);
|
|
2242
|
+
if (code > 0x7F) break;
|
|
2243
|
+
mem[ptr + offset] = code;
|
|
2244
|
+
}
|
|
2245
|
+
if (offset !== len) {
|
|
2246
|
+
if (offset !== 0) {
|
|
2247
|
+
arg = arg.slice(offset);
|
|
2248
|
+
}
|
|
2249
|
+
ptr = realloc(ptr, len, len = offset + arg.length * 3, 1) >>> 0;
|
|
2250
|
+
const view = getUint8ArrayMemory0().subarray(ptr + offset, ptr + len);
|
|
2251
|
+
const ret = cachedTextEncoder.encodeInto(arg, view);
|
|
2252
|
+
|
|
2253
|
+
offset += ret.written;
|
|
2254
|
+
ptr = realloc(ptr, len, offset, 1) >>> 0;
|
|
2255
|
+
}
|
|
2256
|
+
|
|
2257
|
+
WASM_VECTOR_LEN = offset;
|
|
2258
|
+
return ptr;
|
|
2259
|
+
}
|
|
2260
|
+
|
|
2261
|
+
function takeObject(idx) {
|
|
2262
|
+
const ret = getObject(idx);
|
|
2263
|
+
dropObject(idx);
|
|
2264
|
+
return ret;
|
|
2265
|
+
}
|
|
2266
|
+
|
|
2267
|
+
let cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
|
|
2268
|
+
cachedTextDecoder.decode();
|
|
2269
|
+
const MAX_SAFARI_DECODE_BYTES = 2146435072;
|
|
2270
|
+
let numBytesDecoded = 0;
|
|
2271
|
+
function decodeText(ptr, len) {
|
|
2272
|
+
numBytesDecoded += len;
|
|
2273
|
+
if (numBytesDecoded >= MAX_SAFARI_DECODE_BYTES) {
|
|
2274
|
+
cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
|
|
2275
|
+
cachedTextDecoder.decode();
|
|
2276
|
+
numBytesDecoded = len;
|
|
2277
|
+
}
|
|
2278
|
+
return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len));
|
|
2279
|
+
}
|
|
2280
|
+
|
|
2281
|
+
const cachedTextEncoder = new TextEncoder();
|
|
2282
|
+
|
|
2283
|
+
if (!('encodeInto' in cachedTextEncoder)) {
|
|
2284
|
+
cachedTextEncoder.encodeInto = function (arg, view) {
|
|
2285
|
+
const buf = cachedTextEncoder.encode(arg);
|
|
2286
|
+
view.set(buf);
|
|
2287
|
+
return {
|
|
2288
|
+
read: arg.length,
|
|
2289
|
+
written: buf.length
|
|
2290
|
+
};
|
|
2291
|
+
};
|
|
2292
|
+
}
|
|
2293
|
+
|
|
2294
|
+
let WASM_VECTOR_LEN = 0;
|
|
2295
|
+
|
|
2296
|
+
|
|
2297
|
+
let wasm;
|
|
2298
|
+
export function __wbg_set_wasm(val) {
|
|
2299
|
+
wasm = val;
|
|
2300
|
+
}
|