@json-eval-rs/bundler 0.0.29 → 0.0.32
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 +1 -1
- package/pkg/json_eval_rs.d.ts +228 -228
- package/pkg/json_eval_rs_bg.js +747 -747
- package/pkg/json_eval_rs_bg.wasm +0 -0
- package/pkg/json_eval_rs_bg.wasm.d.ts +51 -51
package/pkg/json_eval_rs_bg.js
CHANGED
|
@@ -208,15 +208,22 @@ function isLikeNone(x) {
|
|
|
208
208
|
return x === undefined || x === null;
|
|
209
209
|
}
|
|
210
210
|
|
|
211
|
-
function
|
|
212
|
-
ptr =
|
|
211
|
+
function passArrayJsValueToWasm0(array, malloc) {
|
|
212
|
+
const ptr = malloc(array.length * 4, 4) >>> 0;
|
|
213
213
|
const mem = getDataViewMemory0();
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
result.push(takeObject(mem.getUint32(i, true)));
|
|
214
|
+
for (let i = 0; i < array.length; i++) {
|
|
215
|
+
mem.setUint32(ptr + 4 * i, addHeapObject(array[i]), true);
|
|
217
216
|
}
|
|
218
|
-
|
|
217
|
+
WASM_VECTOR_LEN = array.length;
|
|
218
|
+
return ptr;
|
|
219
|
+
}
|
|
220
|
+
/**
|
|
221
|
+
* Initialize the library (sets up panic hook)
|
|
222
|
+
*/
|
|
223
|
+
export function init() {
|
|
224
|
+
wasm.init();
|
|
219
225
|
}
|
|
226
|
+
|
|
220
227
|
/**
|
|
221
228
|
* Get the library version
|
|
222
229
|
* @returns {string}
|
|
@@ -259,13 +266,6 @@ export function version() {
|
|
|
259
266
|
}
|
|
260
267
|
}
|
|
261
268
|
|
|
262
|
-
/**
|
|
263
|
-
* Initialize the library (sets up panic hook)
|
|
264
|
-
*/
|
|
265
|
-
export function init() {
|
|
266
|
-
wasm.init();
|
|
267
|
-
}
|
|
268
|
-
|
|
269
269
|
function passArray8ToWasm0(arg, malloc) {
|
|
270
270
|
const ptr = malloc(arg.length * 1, 1) >>> 0;
|
|
271
271
|
getUint8ArrayMemory0().set(arg, ptr / 1);
|
|
@@ -273,14 +273,14 @@ function passArray8ToWasm0(arg, malloc) {
|
|
|
273
273
|
return ptr;
|
|
274
274
|
}
|
|
275
275
|
|
|
276
|
-
function
|
|
277
|
-
|
|
276
|
+
function getArrayJsValueFromWasm0(ptr, len) {
|
|
277
|
+
ptr = ptr >>> 0;
|
|
278
278
|
const mem = getDataViewMemory0();
|
|
279
|
-
|
|
280
|
-
|
|
279
|
+
const result = [];
|
|
280
|
+
for (let i = ptr; i < ptr + 4 * len; i += 4) {
|
|
281
|
+
result.push(takeObject(mem.getUint32(i, true)));
|
|
281
282
|
}
|
|
282
|
-
|
|
283
|
-
return ptr;
|
|
283
|
+
return result;
|
|
284
284
|
}
|
|
285
285
|
|
|
286
286
|
const JSONEvalWasmFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
@@ -311,98 +311,163 @@ export class JSONEvalWasm {
|
|
|
311
311
|
wasm.__wbg_jsonevalwasm_free(ptr, 0);
|
|
312
312
|
}
|
|
313
313
|
/**
|
|
314
|
-
*
|
|
314
|
+
* Evaluate and return as JsValue for direct JavaScript object access
|
|
315
315
|
*
|
|
316
|
-
* @param
|
|
316
|
+
* @param data - JSON data string
|
|
317
317
|
* @param context - Optional context data JSON string
|
|
318
|
-
* @
|
|
319
|
-
* @param {string}
|
|
318
|
+
* @returns Evaluated schema as JavaScript object
|
|
319
|
+
* @param {string} data
|
|
320
320
|
* @param {string | null} [context]
|
|
321
|
-
* @
|
|
321
|
+
* @returns {any}
|
|
322
322
|
*/
|
|
323
|
-
|
|
323
|
+
evaluateJS(data, context) {
|
|
324
324
|
try {
|
|
325
325
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
326
|
-
const ptr0 = passStringToWasm0(
|
|
326
|
+
const ptr0 = passStringToWasm0(data, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
327
327
|
const len0 = WASM_VECTOR_LEN;
|
|
328
328
|
var ptr1 = isLikeNone(context) ? 0 : passStringToWasm0(context, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
329
329
|
var len1 = WASM_VECTOR_LEN;
|
|
330
|
-
|
|
331
|
-
var len2 = WASM_VECTOR_LEN;
|
|
332
|
-
wasm.jsonevalwasm_new(retptr, ptr0, len0, ptr1, len1, ptr2, len2);
|
|
330
|
+
wasm.jsonevalwasm_evaluateJS(retptr, this.__wbg_ptr, ptr0, len0, ptr1, len1);
|
|
333
331
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
334
332
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
335
333
|
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
336
334
|
if (r2) {
|
|
337
335
|
throw takeObject(r1);
|
|
338
336
|
}
|
|
339
|
-
|
|
340
|
-
JSONEvalWasmFinalization.register(this, this.__wbg_ptr, this);
|
|
341
|
-
return this;
|
|
337
|
+
return takeObject(r0);
|
|
342
338
|
} finally {
|
|
343
339
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
344
340
|
}
|
|
345
341
|
}
|
|
346
342
|
/**
|
|
347
|
-
*
|
|
343
|
+
* Compile JSON logic and return a global ID
|
|
344
|
+
* @param logic_str - JSON logic expression as a string
|
|
345
|
+
* @returns Compiled logic ID as number (u64)
|
|
346
|
+
* @param {string} logic_str
|
|
347
|
+
* @returns {number}
|
|
348
|
+
*/
|
|
349
|
+
compileLogic(logic_str) {
|
|
350
|
+
try {
|
|
351
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
352
|
+
const ptr0 = passStringToWasm0(logic_str, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
353
|
+
const len0 = WASM_VECTOR_LEN;
|
|
354
|
+
wasm.jsonevalwasm_compileLogic(retptr, this.__wbg_ptr, ptr0, len0);
|
|
355
|
+
var r0 = getDataViewMemory0().getFloat64(retptr + 8 * 0, true);
|
|
356
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
357
|
+
var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
|
|
358
|
+
if (r3) {
|
|
359
|
+
throw takeObject(r2);
|
|
360
|
+
}
|
|
361
|
+
return r0;
|
|
362
|
+
} finally {
|
|
363
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
364
|
+
}
|
|
365
|
+
}
|
|
366
|
+
/**
|
|
367
|
+
* Evaluate dependents when a field changes (returns array of changes as JSON string)
|
|
348
368
|
*
|
|
349
|
-
* @param
|
|
369
|
+
* @param changedPath - Path of the field that changed
|
|
370
|
+
* @param data - Optional updated JSON data string
|
|
350
371
|
* @param context - Optional context data JSON string
|
|
351
|
-
* @
|
|
352
|
-
* @param {
|
|
372
|
+
* @returns Array of dependent change objects as JSON string
|
|
373
|
+
* @param {string} changed_path
|
|
374
|
+
* @param {string | null} [data]
|
|
353
375
|
* @param {string | null} [context]
|
|
376
|
+
* @returns {string}
|
|
377
|
+
*/
|
|
378
|
+
evaluateDependents(changed_path, data, context) {
|
|
379
|
+
let deferred5_0;
|
|
380
|
+
let deferred5_1;
|
|
381
|
+
try {
|
|
382
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
383
|
+
const ptr0 = passStringToWasm0(changed_path, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
384
|
+
const len0 = WASM_VECTOR_LEN;
|
|
385
|
+
var ptr1 = isLikeNone(data) ? 0 : passStringToWasm0(data, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
386
|
+
var len1 = WASM_VECTOR_LEN;
|
|
387
|
+
var ptr2 = isLikeNone(context) ? 0 : passStringToWasm0(context, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
388
|
+
var len2 = WASM_VECTOR_LEN;
|
|
389
|
+
wasm.jsonevalwasm_evaluateDependents(retptr, this.__wbg_ptr, ptr0, len0, ptr1, len1, ptr2, len2);
|
|
390
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
391
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
392
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
393
|
+
var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
|
|
394
|
+
var ptr4 = r0;
|
|
395
|
+
var len4 = r1;
|
|
396
|
+
if (r3) {
|
|
397
|
+
ptr4 = 0; len4 = 0;
|
|
398
|
+
throw takeObject(r2);
|
|
399
|
+
}
|
|
400
|
+
deferred5_0 = ptr4;
|
|
401
|
+
deferred5_1 = len4;
|
|
402
|
+
return getStringFromWasm0(ptr4, len4);
|
|
403
|
+
} finally {
|
|
404
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
405
|
+
wasm.__wbindgen_export_2(deferred5_0, deferred5_1, 1);
|
|
406
|
+
}
|
|
407
|
+
}
|
|
408
|
+
/**
|
|
409
|
+
* Compile and run JSON logic from a JSON logic string
|
|
410
|
+
* @param logic_str - JSON logic expression as a string
|
|
411
|
+
* @param data - Optional JSON data string
|
|
412
|
+
* @param context - Optional JSON context string
|
|
413
|
+
* @returns Result as JavaScript object
|
|
414
|
+
* @param {string} logic_str
|
|
354
415
|
* @param {string | null} [data]
|
|
355
|
-
* @
|
|
416
|
+
* @param {string | null} [context]
|
|
417
|
+
* @returns {any}
|
|
356
418
|
*/
|
|
357
|
-
|
|
419
|
+
compileAndRunLogic(logic_str, data, context) {
|
|
358
420
|
try {
|
|
359
421
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
360
|
-
const ptr0 =
|
|
422
|
+
const ptr0 = passStringToWasm0(logic_str, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
361
423
|
const len0 = WASM_VECTOR_LEN;
|
|
362
|
-
var ptr1 = isLikeNone(
|
|
424
|
+
var ptr1 = isLikeNone(data) ? 0 : passStringToWasm0(data, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
363
425
|
var len1 = WASM_VECTOR_LEN;
|
|
364
|
-
var ptr2 = isLikeNone(
|
|
426
|
+
var ptr2 = isLikeNone(context) ? 0 : passStringToWasm0(context, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
365
427
|
var len2 = WASM_VECTOR_LEN;
|
|
366
|
-
wasm.
|
|
428
|
+
wasm.jsonevalwasm_compileAndRunLogic(retptr, this.__wbg_ptr, ptr0, len0, ptr1, len1, ptr2, len2);
|
|
367
429
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
368
430
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
369
431
|
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
370
432
|
if (r2) {
|
|
371
433
|
throw takeObject(r1);
|
|
372
434
|
}
|
|
373
|
-
return
|
|
435
|
+
return takeObject(r0);
|
|
374
436
|
} finally {
|
|
375
437
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
376
438
|
}
|
|
377
439
|
}
|
|
378
440
|
/**
|
|
379
|
-
*
|
|
441
|
+
* Evaluate dependents and return as JavaScript object
|
|
380
442
|
*
|
|
381
|
-
* @param
|
|
443
|
+
* @param changedPathsJson - JSON array of field paths that changed
|
|
444
|
+
* @param data - Optional updated JSON data string
|
|
382
445
|
* @param context - Optional context data JSON string
|
|
383
|
-
* @param
|
|
384
|
-
* @
|
|
385
|
-
* @param {string
|
|
386
|
-
* @param {string | null}
|
|
387
|
-
* @
|
|
446
|
+
* @param reEvaluate - If true, performs full evaluation after processing dependents
|
|
447
|
+
* @returns Array of dependent change objects as JavaScript object
|
|
448
|
+
* @param {string} changed_paths_json
|
|
449
|
+
* @param {string | null | undefined} data
|
|
450
|
+
* @param {string | null | undefined} context
|
|
451
|
+
* @param {boolean} re_evaluate
|
|
452
|
+
* @returns {any}
|
|
388
453
|
*/
|
|
389
|
-
|
|
454
|
+
evaluateDependentsJS(changed_paths_json, data, context, re_evaluate) {
|
|
390
455
|
try {
|
|
391
456
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
392
|
-
const ptr0 = passStringToWasm0(
|
|
457
|
+
const ptr0 = passStringToWasm0(changed_paths_json, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
393
458
|
const len0 = WASM_VECTOR_LEN;
|
|
394
|
-
var ptr1 = isLikeNone(
|
|
459
|
+
var ptr1 = isLikeNone(data) ? 0 : passStringToWasm0(data, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
395
460
|
var len1 = WASM_VECTOR_LEN;
|
|
396
|
-
var ptr2 = isLikeNone(
|
|
461
|
+
var ptr2 = isLikeNone(context) ? 0 : passStringToWasm0(context, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
397
462
|
var len2 = WASM_VECTOR_LEN;
|
|
398
|
-
wasm.
|
|
463
|
+
wasm.jsonevalwasm_evaluateDependentsJS(retptr, this.__wbg_ptr, ptr0, len0, ptr1, len1, ptr2, len2, re_evaluate);
|
|
399
464
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
400
465
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
401
466
|
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
402
467
|
if (r2) {
|
|
403
468
|
throw takeObject(r1);
|
|
404
469
|
}
|
|
405
|
-
return
|
|
470
|
+
return takeObject(r0);
|
|
406
471
|
} finally {
|
|
407
472
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
408
473
|
}
|
|
@@ -434,23 +499,53 @@ export class JSONEvalWasm {
|
|
|
434
499
|
}
|
|
435
500
|
}
|
|
436
501
|
/**
|
|
437
|
-
*
|
|
502
|
+
* Run pre-compiled logic by ID
|
|
503
|
+
* @param logic_id - Compiled logic ID from compileLogic
|
|
504
|
+
* @param data - Optional JSON data string
|
|
505
|
+
* @param context - Optional JSON context string
|
|
506
|
+
* @returns Result as JavaScript object
|
|
507
|
+
* @param {number} logic_id
|
|
508
|
+
* @param {string | null} [data]
|
|
509
|
+
* @param {string | null} [context]
|
|
510
|
+
* @returns {any}
|
|
511
|
+
*/
|
|
512
|
+
runLogic(logic_id, data, context) {
|
|
513
|
+
try {
|
|
514
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
515
|
+
var ptr0 = isLikeNone(data) ? 0 : passStringToWasm0(data, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
516
|
+
var len0 = WASM_VECTOR_LEN;
|
|
517
|
+
var ptr1 = isLikeNone(context) ? 0 : passStringToWasm0(context, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
518
|
+
var len1 = WASM_VECTOR_LEN;
|
|
519
|
+
wasm.jsonevalwasm_runLogic(retptr, this.__wbg_ptr, logic_id, ptr0, len0, ptr1, len1);
|
|
520
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
521
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
522
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
523
|
+
if (r2) {
|
|
524
|
+
throw takeObject(r1);
|
|
525
|
+
}
|
|
526
|
+
return takeObject(r0);
|
|
527
|
+
} finally {
|
|
528
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
529
|
+
}
|
|
530
|
+
}
|
|
531
|
+
/**
|
|
532
|
+
* Validate data and return as plain JavaScript object (Worker-safe)
|
|
438
533
|
*
|
|
439
534
|
* @param data - JSON data string
|
|
440
535
|
* @param context - Optional context data JSON string
|
|
441
|
-
* @returns
|
|
536
|
+
* @returns Plain JavaScript object with validation result
|
|
442
537
|
* @param {string} data
|
|
443
538
|
* @param {string | null} [context]
|
|
444
539
|
* @returns {any}
|
|
445
540
|
*/
|
|
446
|
-
|
|
541
|
+
validateJS(data, context) {
|
|
447
542
|
try {
|
|
448
543
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
449
544
|
const ptr0 = passStringToWasm0(data, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
450
545
|
const len0 = WASM_VECTOR_LEN;
|
|
451
546
|
var ptr1 = isLikeNone(context) ? 0 : passStringToWasm0(context, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
452
547
|
var len1 = WASM_VECTOR_LEN;
|
|
453
|
-
wasm.
|
|
548
|
+
wasm.jsonevalwasm_validateJS(retptr, this.__wbg_ptr, ptr0, len0, ptr1, len1);
|
|
454
549
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
455
550
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
456
551
|
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
@@ -463,71 +558,60 @@ export class JSONEvalWasm {
|
|
|
463
558
|
}
|
|
464
559
|
}
|
|
465
560
|
/**
|
|
466
|
-
*
|
|
561
|
+
* Validate data against schema rules with optional path filtering
|
|
467
562
|
*
|
|
468
|
-
* @param
|
|
469
|
-
* @param data - Optional updated JSON data string
|
|
563
|
+
* @param data - JSON data string
|
|
470
564
|
* @param context - Optional context data JSON string
|
|
471
|
-
* @
|
|
472
|
-
* @
|
|
473
|
-
* @param {string
|
|
565
|
+
* @param paths - Optional array of paths to validate (null for all)
|
|
566
|
+
* @returns ValidationResult
|
|
567
|
+
* @param {string} data
|
|
474
568
|
* @param {string | null} [context]
|
|
475
|
-
* @
|
|
569
|
+
* @param {string[] | null} [paths]
|
|
570
|
+
* @returns {ValidationResult}
|
|
476
571
|
*/
|
|
477
|
-
|
|
478
|
-
let deferred5_0;
|
|
479
|
-
let deferred5_1;
|
|
572
|
+
validatePaths(data, context, paths) {
|
|
480
573
|
try {
|
|
481
574
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
482
|
-
const ptr0 = passStringToWasm0(
|
|
575
|
+
const ptr0 = passStringToWasm0(data, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
483
576
|
const len0 = WASM_VECTOR_LEN;
|
|
484
|
-
var ptr1 = isLikeNone(
|
|
577
|
+
var ptr1 = isLikeNone(context) ? 0 : passStringToWasm0(context, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
485
578
|
var len1 = WASM_VECTOR_LEN;
|
|
486
|
-
var ptr2 = isLikeNone(
|
|
579
|
+
var ptr2 = isLikeNone(paths) ? 0 : passArrayJsValueToWasm0(paths, wasm.__wbindgen_export_0);
|
|
487
580
|
var len2 = WASM_VECTOR_LEN;
|
|
488
|
-
wasm.
|
|
581
|
+
wasm.jsonevalwasm_validatePaths(retptr, this.__wbg_ptr, ptr0, len0, ptr1, len1, ptr2, len2);
|
|
489
582
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
490
583
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
491
584
|
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
var len4 = r1;
|
|
495
|
-
if (r3) {
|
|
496
|
-
ptr4 = 0; len4 = 0;
|
|
497
|
-
throw takeObject(r2);
|
|
585
|
+
if (r2) {
|
|
586
|
+
throw takeObject(r1);
|
|
498
587
|
}
|
|
499
|
-
|
|
500
|
-
deferred5_1 = len4;
|
|
501
|
-
return getStringFromWasm0(ptr4, len4);
|
|
588
|
+
return ValidationResult.__wrap(r0);
|
|
502
589
|
} finally {
|
|
503
590
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
504
|
-
wasm.__wbindgen_export_2(deferred5_0, deferred5_1, 1);
|
|
505
591
|
}
|
|
506
592
|
}
|
|
507
593
|
/**
|
|
508
|
-
*
|
|
594
|
+
* Validate with path filtering and return as plain JavaScript object (Worker-safe)
|
|
509
595
|
*
|
|
510
|
-
* @param
|
|
511
|
-
* @param data - Optional updated JSON data string
|
|
596
|
+
* @param data - JSON data string
|
|
512
597
|
* @param context - Optional context data JSON string
|
|
513
|
-
* @param
|
|
514
|
-
* @returns
|
|
515
|
-
* @param {string}
|
|
516
|
-
* @param {string | null
|
|
517
|
-
* @param {string | null
|
|
518
|
-
* @param {boolean} re_evaluate
|
|
598
|
+
* @param paths - Optional array of paths to validate (null for all)
|
|
599
|
+
* @returns Plain JavaScript object with validation result
|
|
600
|
+
* @param {string} data
|
|
601
|
+
* @param {string | null} [context]
|
|
602
|
+
* @param {string[] | null} [paths]
|
|
519
603
|
* @returns {any}
|
|
520
604
|
*/
|
|
521
|
-
|
|
605
|
+
validatePathsJS(data, context, paths) {
|
|
522
606
|
try {
|
|
523
607
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
524
|
-
const ptr0 = passStringToWasm0(
|
|
608
|
+
const ptr0 = passStringToWasm0(data, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
525
609
|
const len0 = WASM_VECTOR_LEN;
|
|
526
|
-
var ptr1 = isLikeNone(
|
|
610
|
+
var ptr1 = isLikeNone(context) ? 0 : passStringToWasm0(context, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
527
611
|
var len1 = WASM_VECTOR_LEN;
|
|
528
|
-
var ptr2 = isLikeNone(
|
|
612
|
+
var ptr2 = isLikeNone(paths) ? 0 : passArrayJsValueToWasm0(paths, wasm.__wbindgen_export_0);
|
|
529
613
|
var len2 = WASM_VECTOR_LEN;
|
|
530
|
-
wasm.
|
|
614
|
+
wasm.jsonevalwasm_validatePathsJS(retptr, this.__wbg_ptr, ptr0, len0, ptr1, len1, ptr2, len2);
|
|
531
615
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
532
616
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
533
617
|
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
@@ -540,251 +624,253 @@ export class JSONEvalWasm {
|
|
|
540
624
|
}
|
|
541
625
|
}
|
|
542
626
|
/**
|
|
543
|
-
*
|
|
544
|
-
*
|
|
545
|
-
* @param data -
|
|
546
|
-
* @param context - Optional JSON
|
|
547
|
-
* @returns
|
|
548
|
-
* @param {string}
|
|
549
|
-
* @param {string | null} [data]
|
|
627
|
+
* Validate data against schema rules
|
|
628
|
+
*
|
|
629
|
+
* @param data - JSON data string
|
|
630
|
+
* @param context - Optional context data JSON string
|
|
631
|
+
* @returns ValidationResult
|
|
632
|
+
* @param {string} data
|
|
550
633
|
* @param {string | null} [context]
|
|
551
|
-
* @returns {
|
|
634
|
+
* @returns {ValidationResult}
|
|
552
635
|
*/
|
|
553
|
-
|
|
636
|
+
validate(data, context) {
|
|
554
637
|
try {
|
|
555
638
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
556
|
-
const ptr0 = passStringToWasm0(
|
|
639
|
+
const ptr0 = passStringToWasm0(data, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
557
640
|
const len0 = WASM_VECTOR_LEN;
|
|
558
|
-
var ptr1 = isLikeNone(
|
|
641
|
+
var ptr1 = isLikeNone(context) ? 0 : passStringToWasm0(context, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
559
642
|
var len1 = WASM_VECTOR_LEN;
|
|
560
|
-
|
|
561
|
-
var len2 = WASM_VECTOR_LEN;
|
|
562
|
-
wasm.jsonevalwasm_compileAndRunLogic(retptr, this.__wbg_ptr, ptr0, len0, ptr1, len1, ptr2, len2);
|
|
643
|
+
wasm.jsonevalwasm_validate(retptr, this.__wbg_ptr, ptr0, len0, ptr1, len1);
|
|
563
644
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
564
645
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
565
646
|
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
566
647
|
if (r2) {
|
|
567
648
|
throw takeObject(r1);
|
|
568
649
|
}
|
|
569
|
-
return
|
|
570
|
-
} finally {
|
|
571
|
-
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
572
|
-
}
|
|
573
|
-
}
|
|
574
|
-
/**
|
|
575
|
-
* Compile JSON logic and return a global ID
|
|
576
|
-
* @param logic_str - JSON logic expression as a string
|
|
577
|
-
* @returns Compiled logic ID as number (u64)
|
|
578
|
-
* @param {string} logic_str
|
|
579
|
-
* @returns {number}
|
|
580
|
-
*/
|
|
581
|
-
compileLogic(logic_str) {
|
|
582
|
-
try {
|
|
583
|
-
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
584
|
-
const ptr0 = passStringToWasm0(logic_str, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
585
|
-
const len0 = WASM_VECTOR_LEN;
|
|
586
|
-
wasm.jsonevalwasm_compileLogic(retptr, this.__wbg_ptr, ptr0, len0);
|
|
587
|
-
var r0 = getDataViewMemory0().getFloat64(retptr + 8 * 0, true);
|
|
588
|
-
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
589
|
-
var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
|
|
590
|
-
if (r3) {
|
|
591
|
-
throw takeObject(r2);
|
|
592
|
-
}
|
|
593
|
-
return r0;
|
|
650
|
+
return ValidationResult.__wrap(r0);
|
|
594
651
|
} finally {
|
|
595
652
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
596
653
|
}
|
|
597
654
|
}
|
|
598
655
|
/**
|
|
599
|
-
*
|
|
600
|
-
*
|
|
601
|
-
* @param
|
|
602
|
-
* @param context - Optional JSON
|
|
603
|
-
* @
|
|
604
|
-
* @param {
|
|
605
|
-
* @param {string | null} [data]
|
|
656
|
+
* Create a new JSONEval instance from a cached ParsedSchema
|
|
657
|
+
*
|
|
658
|
+
* @param cacheKey - Cache key to lookup in the global ParsedSchemaCache
|
|
659
|
+
* @param context - Optional context data JSON string
|
|
660
|
+
* @param data - Optional initial data JSON string
|
|
661
|
+
* @param {string} cache_key
|
|
606
662
|
* @param {string | null} [context]
|
|
607
|
-
* @
|
|
663
|
+
* @param {string | null} [data]
|
|
664
|
+
* @returns {JSONEvalWasm}
|
|
608
665
|
*/
|
|
609
|
-
|
|
666
|
+
static newFromCache(cache_key, context, data) {
|
|
610
667
|
try {
|
|
611
668
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
612
|
-
|
|
613
|
-
|
|
669
|
+
const ptr0 = passStringToWasm0(cache_key, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
670
|
+
const len0 = WASM_VECTOR_LEN;
|
|
614
671
|
var ptr1 = isLikeNone(context) ? 0 : passStringToWasm0(context, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
615
672
|
var len1 = WASM_VECTOR_LEN;
|
|
616
|
-
|
|
673
|
+
var ptr2 = isLikeNone(data) ? 0 : passStringToWasm0(data, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
674
|
+
var len2 = WASM_VECTOR_LEN;
|
|
675
|
+
wasm.jsonevalwasm_newFromCache(retptr, ptr0, len0, ptr1, len1, ptr2, len2);
|
|
617
676
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
618
677
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
619
678
|
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
620
679
|
if (r2) {
|
|
621
680
|
throw takeObject(r1);
|
|
622
681
|
}
|
|
623
|
-
return
|
|
682
|
+
return JSONEvalWasm.__wrap(r0);
|
|
624
683
|
} finally {
|
|
625
684
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
626
685
|
}
|
|
627
686
|
}
|
|
628
687
|
/**
|
|
629
|
-
*
|
|
688
|
+
* Create a new JSONEval instance from MessagePack-encoded schema
|
|
630
689
|
*
|
|
631
|
-
* @param
|
|
690
|
+
* @param schemaMsgpack - MessagePack-encoded schema bytes (Uint8Array)
|
|
632
691
|
* @param context - Optional context data JSON string
|
|
633
|
-
* @
|
|
634
|
-
* @param {
|
|
692
|
+
* @param data - Optional initial data JSON string
|
|
693
|
+
* @param {Uint8Array} schema_msgpack
|
|
635
694
|
* @param {string | null} [context]
|
|
636
|
-
* @
|
|
695
|
+
* @param {string | null} [data]
|
|
696
|
+
* @returns {JSONEvalWasm}
|
|
637
697
|
*/
|
|
638
|
-
|
|
698
|
+
static newFromMsgpack(schema_msgpack, context, data) {
|
|
639
699
|
try {
|
|
640
700
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
641
|
-
const ptr0 =
|
|
701
|
+
const ptr0 = passArray8ToWasm0(schema_msgpack, wasm.__wbindgen_export_0);
|
|
642
702
|
const len0 = WASM_VECTOR_LEN;
|
|
643
703
|
var ptr1 = isLikeNone(context) ? 0 : passStringToWasm0(context, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
644
704
|
var len1 = WASM_VECTOR_LEN;
|
|
645
|
-
|
|
705
|
+
var ptr2 = isLikeNone(data) ? 0 : passStringToWasm0(data, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
706
|
+
var len2 = WASM_VECTOR_LEN;
|
|
707
|
+
wasm.jsonevalwasm_newFromMsgpack(retptr, ptr0, len0, ptr1, len1, ptr2, len2);
|
|
646
708
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
647
709
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
648
710
|
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
649
711
|
if (r2) {
|
|
650
712
|
throw takeObject(r1);
|
|
651
713
|
}
|
|
652
|
-
return
|
|
714
|
+
return JSONEvalWasm.__wrap(r0);
|
|
653
715
|
} finally {
|
|
654
716
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
655
717
|
}
|
|
656
718
|
}
|
|
657
719
|
/**
|
|
658
|
-
*
|
|
720
|
+
* Create a new JSONEval instance
|
|
659
721
|
*
|
|
660
|
-
* @param
|
|
722
|
+
* @param schema - JSON schema string
|
|
661
723
|
* @param context - Optional context data JSON string
|
|
662
|
-
* @
|
|
663
|
-
* @param {string}
|
|
724
|
+
* @param data - Optional initial data JSON string
|
|
725
|
+
* @param {string} schema
|
|
664
726
|
* @param {string | null} [context]
|
|
665
|
-
* @
|
|
727
|
+
* @param {string | null} [data]
|
|
666
728
|
*/
|
|
667
|
-
|
|
729
|
+
constructor(schema, context, data) {
|
|
668
730
|
try {
|
|
669
731
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
670
|
-
const ptr0 = passStringToWasm0(
|
|
732
|
+
const ptr0 = passStringToWasm0(schema, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
671
733
|
const len0 = WASM_VECTOR_LEN;
|
|
672
734
|
var ptr1 = isLikeNone(context) ? 0 : passStringToWasm0(context, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
673
735
|
var len1 = WASM_VECTOR_LEN;
|
|
674
|
-
|
|
736
|
+
var ptr2 = isLikeNone(data) ? 0 : passStringToWasm0(data, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
737
|
+
var len2 = WASM_VECTOR_LEN;
|
|
738
|
+
wasm.jsonevalwasm_new(retptr, ptr0, len0, ptr1, len1, ptr2, len2);
|
|
675
739
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
676
740
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
677
741
|
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
678
742
|
if (r2) {
|
|
679
743
|
throw takeObject(r1);
|
|
680
744
|
}
|
|
681
|
-
|
|
745
|
+
this.__wbg_ptr = r0 >>> 0;
|
|
746
|
+
JSONEvalWasmFinalization.register(this, this.__wbg_ptr, this);
|
|
747
|
+
return this;
|
|
682
748
|
} finally {
|
|
683
749
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
684
750
|
}
|
|
685
751
|
}
|
|
686
752
|
/**
|
|
687
|
-
*
|
|
753
|
+
* Get cache statistics
|
|
688
754
|
*
|
|
689
|
-
* @
|
|
690
|
-
* @
|
|
691
|
-
* @param paths - Optional array of paths to validate (null for all)
|
|
692
|
-
* @returns ValidationResult
|
|
693
|
-
* @param {string} data
|
|
694
|
-
* @param {string | null} [context]
|
|
695
|
-
* @param {string[] | null} [paths]
|
|
696
|
-
* @returns {ValidationResult}
|
|
755
|
+
* @returns Cache statistics as JavaScript object with hits, misses, and entries
|
|
756
|
+
* @returns {any}
|
|
697
757
|
*/
|
|
698
|
-
|
|
758
|
+
cacheStats() {
|
|
699
759
|
try {
|
|
700
760
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
701
|
-
|
|
702
|
-
const len0 = WASM_VECTOR_LEN;
|
|
703
|
-
var ptr1 = isLikeNone(context) ? 0 : passStringToWasm0(context, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
704
|
-
var len1 = WASM_VECTOR_LEN;
|
|
705
|
-
var ptr2 = isLikeNone(paths) ? 0 : passArrayJsValueToWasm0(paths, wasm.__wbindgen_export_0);
|
|
706
|
-
var len2 = WASM_VECTOR_LEN;
|
|
707
|
-
wasm.jsonevalwasm_validatePaths(retptr, this.__wbg_ptr, ptr0, len0, ptr1, len1, ptr2, len2);
|
|
761
|
+
wasm.jsonevalwasm_cacheStats(retptr, this.__wbg_ptr);
|
|
708
762
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
709
763
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
710
764
|
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
711
765
|
if (r2) {
|
|
712
766
|
throw takeObject(r1);
|
|
713
767
|
}
|
|
714
|
-
return
|
|
768
|
+
return takeObject(r0);
|
|
715
769
|
} finally {
|
|
716
770
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
717
771
|
}
|
|
718
772
|
}
|
|
719
773
|
/**
|
|
720
|
-
*
|
|
774
|
+
* Clear the evaluation cache
|
|
775
|
+
*/
|
|
776
|
+
clearCache() {
|
|
777
|
+
wasm.jsonevalwasm_clearCache(this.__wbg_ptr);
|
|
778
|
+
}
|
|
779
|
+
/**
|
|
780
|
+
* Enable evaluation caching
|
|
781
|
+
* Useful for reusing JSONEval instances with different data
|
|
782
|
+
*/
|
|
783
|
+
enableCache() {
|
|
784
|
+
wasm.jsonevalwasm_enableCache(this.__wbg_ptr);
|
|
785
|
+
}
|
|
786
|
+
/**
|
|
787
|
+
* Disable evaluation caching
|
|
788
|
+
* Useful for web API usage where each request creates a new JSONEval instance
|
|
789
|
+
* Improves performance by skipping cache operations that have no benefit for single-use instances
|
|
790
|
+
*/
|
|
791
|
+
disableCache() {
|
|
792
|
+
wasm.jsonevalwasm_disableCache(this.__wbg_ptr);
|
|
793
|
+
}
|
|
794
|
+
/**
|
|
795
|
+
* Check if evaluation caching is enabled
|
|
721
796
|
*
|
|
722
|
-
* @
|
|
723
|
-
* @
|
|
724
|
-
* @param paths - Optional array of paths to validate (null for all)
|
|
725
|
-
* @returns Plain JavaScript object with validation result
|
|
726
|
-
* @param {string} data
|
|
727
|
-
* @param {string | null} [context]
|
|
728
|
-
* @param {string[] | null} [paths]
|
|
729
|
-
* @returns {any}
|
|
797
|
+
* @returns true if caching is enabled, false otherwise
|
|
798
|
+
* @returns {boolean}
|
|
730
799
|
*/
|
|
731
|
-
|
|
800
|
+
isCacheEnabled() {
|
|
801
|
+
const ret = wasm.jsonevalwasm_isCacheEnabled(this.__wbg_ptr);
|
|
802
|
+
return ret !== 0;
|
|
803
|
+
}
|
|
804
|
+
/**
|
|
805
|
+
* Get the number of cached entries
|
|
806
|
+
*
|
|
807
|
+
* @returns Number of cached entries
|
|
808
|
+
* @returns {number}
|
|
809
|
+
*/
|
|
810
|
+
cacheLen() {
|
|
811
|
+
const ret = wasm.jsonevalwasm_cacheLen(this.__wbg_ptr);
|
|
812
|
+
return ret >>> 0;
|
|
813
|
+
}
|
|
814
|
+
/**
|
|
815
|
+
* Resolve layout with optional evaluation
|
|
816
|
+
*
|
|
817
|
+
* @param evaluate - If true, runs evaluation before resolving layout
|
|
818
|
+
* @throws Error if resolve fails
|
|
819
|
+
* @param {boolean} evaluate
|
|
820
|
+
*/
|
|
821
|
+
resolveLayout(evaluate) {
|
|
732
822
|
try {
|
|
733
823
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
734
|
-
|
|
735
|
-
const len0 = WASM_VECTOR_LEN;
|
|
736
|
-
var ptr1 = isLikeNone(context) ? 0 : passStringToWasm0(context, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
737
|
-
var len1 = WASM_VECTOR_LEN;
|
|
738
|
-
var ptr2 = isLikeNone(paths) ? 0 : passArrayJsValueToWasm0(paths, wasm.__wbindgen_export_0);
|
|
739
|
-
var len2 = WASM_VECTOR_LEN;
|
|
740
|
-
wasm.jsonevalwasm_validatePathsJS(retptr, this.__wbg_ptr, ptr0, len0, ptr1, len1, ptr2, len2);
|
|
824
|
+
wasm.jsonevalwasm_resolveLayout(retptr, this.__wbg_ptr, evaluate);
|
|
741
825
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
742
826
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
throw takeObject(r1);
|
|
827
|
+
if (r1) {
|
|
828
|
+
throw takeObject(r0);
|
|
746
829
|
}
|
|
747
|
-
return takeObject(r0);
|
|
748
830
|
} finally {
|
|
749
831
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
750
832
|
}
|
|
751
833
|
}
|
|
752
834
|
/**
|
|
753
|
-
*
|
|
835
|
+
* Reload schema with new data
|
|
754
836
|
*
|
|
755
|
-
* @param
|
|
756
|
-
* @
|
|
757
|
-
* @param
|
|
758
|
-
* @
|
|
837
|
+
* @param schema - New JSON schema string
|
|
838
|
+
* @param context - Optional context data JSON string
|
|
839
|
+
* @param data - Optional initial data JSON string
|
|
840
|
+
* @param {string} schema
|
|
841
|
+
* @param {string | null} [context]
|
|
842
|
+
* @param {string | null} [data]
|
|
759
843
|
*/
|
|
760
|
-
|
|
761
|
-
let deferred1_0;
|
|
762
|
-
let deferred1_1;
|
|
844
|
+
reloadSchema(schema, context, data) {
|
|
763
845
|
try {
|
|
764
846
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
765
|
-
|
|
847
|
+
const ptr0 = passStringToWasm0(schema, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
848
|
+
const len0 = WASM_VECTOR_LEN;
|
|
849
|
+
var ptr1 = isLikeNone(context) ? 0 : passStringToWasm0(context, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
850
|
+
var len1 = WASM_VECTOR_LEN;
|
|
851
|
+
var ptr2 = isLikeNone(data) ? 0 : passStringToWasm0(data, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
852
|
+
var len2 = WASM_VECTOR_LEN;
|
|
853
|
+
wasm.jsonevalwasm_reloadSchema(retptr, this.__wbg_ptr, ptr0, len0, ptr1, len1, ptr2, len2);
|
|
766
854
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
767
855
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
856
|
+
if (r1) {
|
|
857
|
+
throw takeObject(r0);
|
|
858
|
+
}
|
|
771
859
|
} finally {
|
|
772
860
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
773
|
-
wasm.__wbindgen_export_2(deferred1_0, deferred1_1, 1);
|
|
774
861
|
}
|
|
775
862
|
}
|
|
776
863
|
/**
|
|
777
|
-
* Get
|
|
864
|
+
* Get all schema values (evaluations ending with .value)
|
|
865
|
+
* Mutates internal data by overriding with values from value evaluations
|
|
778
866
|
*
|
|
779
|
-
* @
|
|
780
|
-
* @returns Evaluated schema as JavaScript object
|
|
781
|
-
* @param {boolean} skip_layout
|
|
867
|
+
* @returns Modified data as JavaScript object
|
|
782
868
|
* @returns {any}
|
|
783
869
|
*/
|
|
784
|
-
|
|
870
|
+
getSchemaValue() {
|
|
785
871
|
try {
|
|
786
872
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
787
|
-
wasm.
|
|
873
|
+
wasm.jsonevalwasm_getSchemaValue(retptr, this.__wbg_ptr);
|
|
788
874
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
789
875
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
790
876
|
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
@@ -797,76 +883,80 @@ export class JSONEvalWasm {
|
|
|
797
883
|
}
|
|
798
884
|
}
|
|
799
885
|
/**
|
|
800
|
-
* Get the
|
|
801
|
-
*
|
|
802
|
-
* @param skipLayout - Whether to skip layout resolution
|
|
803
|
-
* @returns Evaluated schema as MessagePack bytes (Uint8Array)
|
|
804
|
-
*
|
|
805
|
-
* # Zero-Copy Optimization
|
|
806
|
-
*
|
|
807
|
-
* This method returns MessagePack binary data with minimal copying:
|
|
808
|
-
* 1. Serializes schema to Vec<u8> in Rust (unavoidable)
|
|
809
|
-
* 2. wasm-bindgen transfers Vec<u8> to JS as Uint8Array (optimized)
|
|
810
|
-
* 3. Result is a Uint8Array view (minimal overhead)
|
|
886
|
+
* Get a value from the schema using dotted path notation
|
|
811
887
|
*
|
|
812
|
-
*
|
|
813
|
-
* @
|
|
814
|
-
* @
|
|
888
|
+
* @param path - Dotted path to the value (e.g., "properties.field.value")
|
|
889
|
+
* @returns Value as JSON string or null if not found
|
|
890
|
+
* @param {string} path
|
|
891
|
+
* @returns {string | undefined}
|
|
815
892
|
*/
|
|
816
|
-
|
|
893
|
+
getSchemaByPath(path) {
|
|
817
894
|
try {
|
|
818
895
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
819
|
-
|
|
896
|
+
const ptr0 = passStringToWasm0(path, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
897
|
+
const len0 = WASM_VECTOR_LEN;
|
|
898
|
+
wasm.jsonevalwasm_getSchemaByPath(retptr, this.__wbg_ptr, ptr0, len0);
|
|
820
899
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
821
900
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
901
|
+
let v2;
|
|
902
|
+
if (r0 !== 0) {
|
|
903
|
+
v2 = getStringFromWasm0(r0, r1).slice();
|
|
904
|
+
wasm.__wbindgen_export_2(r0, r1 * 1, 1);
|
|
826
905
|
}
|
|
827
|
-
|
|
828
|
-
wasm.__wbindgen_export_2(r0, r1 * 1, 1);
|
|
829
|
-
return v1;
|
|
906
|
+
return v2;
|
|
830
907
|
} finally {
|
|
831
908
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
832
909
|
}
|
|
833
910
|
}
|
|
834
911
|
/**
|
|
835
|
-
* Get
|
|
836
|
-
*
|
|
837
|
-
*
|
|
838
|
-
* @returns
|
|
839
|
-
* @
|
|
912
|
+
* Get values from schema using multiple dotted paths
|
|
913
|
+
* @param pathsJson - JSON array of dotted paths
|
|
914
|
+
* @param format - Return format (0=Nested, 1=Flat, 2=Array)
|
|
915
|
+
* @returns Data in specified format as JSON string
|
|
916
|
+
* @param {string} paths_json
|
|
917
|
+
* @param {number} format
|
|
918
|
+
* @returns {string}
|
|
840
919
|
*/
|
|
841
|
-
|
|
920
|
+
getSchemaByPaths(paths_json, format) {
|
|
921
|
+
let deferred3_0;
|
|
922
|
+
let deferred3_1;
|
|
842
923
|
try {
|
|
843
924
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
844
|
-
wasm.
|
|
925
|
+
const ptr0 = passStringToWasm0(paths_json, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
926
|
+
const len0 = WASM_VECTOR_LEN;
|
|
927
|
+
wasm.jsonevalwasm_getSchemaByPaths(retptr, this.__wbg_ptr, ptr0, len0, format);
|
|
845
928
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
846
929
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
847
930
|
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
848
|
-
|
|
849
|
-
|
|
931
|
+
var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
|
|
932
|
+
var ptr2 = r0;
|
|
933
|
+
var len2 = r1;
|
|
934
|
+
if (r3) {
|
|
935
|
+
ptr2 = 0; len2 = 0;
|
|
936
|
+
throw takeObject(r2);
|
|
850
937
|
}
|
|
851
|
-
|
|
938
|
+
deferred3_0 = ptr2;
|
|
939
|
+
deferred3_1 = len2;
|
|
940
|
+
return getStringFromWasm0(ptr2, len2);
|
|
852
941
|
} finally {
|
|
853
942
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
943
|
+
wasm.__wbindgen_export_2(deferred3_0, deferred3_1, 1);
|
|
854
944
|
}
|
|
855
945
|
}
|
|
856
946
|
/**
|
|
857
|
-
* Get the evaluated schema
|
|
947
|
+
* Get the evaluated schema with optional layout resolution
|
|
858
948
|
*
|
|
859
949
|
* @param skipLayout - Whether to skip layout resolution
|
|
860
950
|
* @returns Evaluated schema as JSON string
|
|
861
951
|
* @param {boolean} skip_layout
|
|
862
952
|
* @returns {string}
|
|
863
953
|
*/
|
|
864
|
-
|
|
954
|
+
getEvaluatedSchema(skip_layout) {
|
|
865
955
|
let deferred1_0;
|
|
866
956
|
let deferred1_1;
|
|
867
957
|
try {
|
|
868
958
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
869
|
-
wasm.
|
|
959
|
+
wasm.jsonevalwasm_getEvaluatedSchema(retptr, this.__wbg_ptr, skip_layout);
|
|
870
960
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
871
961
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
872
962
|
deferred1_0 = r0;
|
|
@@ -878,17 +968,19 @@ export class JSONEvalWasm {
|
|
|
878
968
|
}
|
|
879
969
|
}
|
|
880
970
|
/**
|
|
881
|
-
* Get the
|
|
971
|
+
* Get a value from the schema using dotted path notation as JavaScript object
|
|
882
972
|
*
|
|
883
|
-
* @param
|
|
884
|
-
* @returns
|
|
885
|
-
* @param {
|
|
973
|
+
* @param path - Dotted path to the value (e.g., "properties.field.value")
|
|
974
|
+
* @returns Value as JavaScript object or null if not found
|
|
975
|
+
* @param {string} path
|
|
886
976
|
* @returns {any}
|
|
887
977
|
*/
|
|
888
|
-
|
|
978
|
+
getSchemaByPathJS(path) {
|
|
889
979
|
try {
|
|
890
980
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
891
|
-
|
|
981
|
+
const ptr0 = passStringToWasm0(path, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
982
|
+
const len0 = WASM_VECTOR_LEN;
|
|
983
|
+
wasm.jsonevalwasm_getSchemaByPathJS(retptr, this.__wbg_ptr, ptr0, len0);
|
|
892
984
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
893
985
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
894
986
|
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
@@ -901,49 +993,49 @@ export class JSONEvalWasm {
|
|
|
901
993
|
}
|
|
902
994
|
}
|
|
903
995
|
/**
|
|
904
|
-
*
|
|
996
|
+
* Reload schema from MessagePack-encoded bytes
|
|
905
997
|
*
|
|
906
|
-
* @param
|
|
907
|
-
* @param
|
|
908
|
-
* @
|
|
909
|
-
* @param {
|
|
910
|
-
* @param {
|
|
911
|
-
* @
|
|
998
|
+
* @param schemaMsgpack - MessagePack-encoded schema bytes (Uint8Array)
|
|
999
|
+
* @param context - Optional context data JSON string
|
|
1000
|
+
* @param data - Optional initial data JSON string
|
|
1001
|
+
* @param {Uint8Array} schema_msgpack
|
|
1002
|
+
* @param {string | null} [context]
|
|
1003
|
+
* @param {string | null} [data]
|
|
912
1004
|
*/
|
|
913
|
-
|
|
1005
|
+
reloadSchemaMsgpack(schema_msgpack, context, data) {
|
|
914
1006
|
try {
|
|
915
1007
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
916
|
-
const ptr0 =
|
|
1008
|
+
const ptr0 = passArray8ToWasm0(schema_msgpack, wasm.__wbindgen_export_0);
|
|
917
1009
|
const len0 = WASM_VECTOR_LEN;
|
|
918
|
-
|
|
1010
|
+
var ptr1 = isLikeNone(context) ? 0 : passStringToWasm0(context, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
1011
|
+
var len1 = WASM_VECTOR_LEN;
|
|
1012
|
+
var ptr2 = isLikeNone(data) ? 0 : passStringToWasm0(data, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
1013
|
+
var len2 = WASM_VECTOR_LEN;
|
|
1014
|
+
wasm.jsonevalwasm_reloadSchemaMsgpack(retptr, this.__wbg_ptr, ptr0, len0, ptr1, len1, ptr2, len2);
|
|
919
1015
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
920
1016
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
v2 = getStringFromWasm0(r0, r1).slice();
|
|
924
|
-
wasm.__wbindgen_export_2(r0, r1 * 1, 1);
|
|
1017
|
+
if (r1) {
|
|
1018
|
+
throw takeObject(r0);
|
|
925
1019
|
}
|
|
926
|
-
return v2;
|
|
927
1020
|
} finally {
|
|
928
1021
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
929
1022
|
}
|
|
930
1023
|
}
|
|
931
1024
|
/**
|
|
932
|
-
* Get
|
|
933
|
-
*
|
|
934
|
-
* @param
|
|
935
|
-
* @
|
|
936
|
-
* @
|
|
937
|
-
* @param {
|
|
938
|
-
* @param {boolean} skip_layout
|
|
1025
|
+
* Get values from schema using multiple dotted paths (JS object)
|
|
1026
|
+
* @param pathsJson - JSON array of dotted paths
|
|
1027
|
+
* @param format - Return format (0=Nested, 1=Flat, 2=Array)
|
|
1028
|
+
* @returns Data in specified format as JavaScript object
|
|
1029
|
+
* @param {string} paths_json
|
|
1030
|
+
* @param {number} format
|
|
939
1031
|
* @returns {any}
|
|
940
1032
|
*/
|
|
941
|
-
|
|
1033
|
+
getSchemaByPathsJS(paths_json, format) {
|
|
942
1034
|
try {
|
|
943
1035
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
944
|
-
const ptr0 = passStringToWasm0(
|
|
1036
|
+
const ptr0 = passStringToWasm0(paths_json, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
945
1037
|
const len0 = WASM_VECTOR_LEN;
|
|
946
|
-
wasm.
|
|
1038
|
+
wasm.jsonevalwasm_getSchemaByPathsJS(retptr, this.__wbg_ptr, ptr0, len0, format);
|
|
947
1039
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
948
1040
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
949
1041
|
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
@@ -956,84 +1048,73 @@ export class JSONEvalWasm {
|
|
|
956
1048
|
}
|
|
957
1049
|
}
|
|
958
1050
|
/**
|
|
959
|
-
* Get
|
|
960
|
-
*
|
|
1051
|
+
* Get the evaluated schema as JavaScript object
|
|
1052
|
+
*
|
|
961
1053
|
* @param skipLayout - Whether to skip layout resolution
|
|
962
|
-
* @
|
|
963
|
-
* @returns Data in specified format as JSON string
|
|
964
|
-
* @param {string} paths_json
|
|
1054
|
+
* @returns Evaluated schema as JavaScript object
|
|
965
1055
|
* @param {boolean} skip_layout
|
|
966
|
-
* @
|
|
967
|
-
* @returns {string}
|
|
1056
|
+
* @returns {any}
|
|
968
1057
|
*/
|
|
969
|
-
|
|
970
|
-
let deferred3_0;
|
|
971
|
-
let deferred3_1;
|
|
1058
|
+
getEvaluatedSchemaJS(skip_layout) {
|
|
972
1059
|
try {
|
|
973
1060
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
974
|
-
|
|
975
|
-
const len0 = WASM_VECTOR_LEN;
|
|
976
|
-
wasm.jsonevalwasm_getEvaluatedSchemaByPaths(retptr, this.__wbg_ptr, ptr0, len0, skip_layout, format);
|
|
1061
|
+
wasm.jsonevalwasm_getEvaluatedSchemaJS(retptr, this.__wbg_ptr, skip_layout);
|
|
977
1062
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
978
1063
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
979
1064
|
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
980
|
-
|
|
981
|
-
|
|
982
|
-
var len2 = r1;
|
|
983
|
-
if (r3) {
|
|
984
|
-
ptr2 = 0; len2 = 0;
|
|
985
|
-
throw takeObject(r2);
|
|
1065
|
+
if (r2) {
|
|
1066
|
+
throw takeObject(r1);
|
|
986
1067
|
}
|
|
987
|
-
|
|
988
|
-
deferred3_1 = len2;
|
|
989
|
-
return getStringFromWasm0(ptr2, len2);
|
|
1068
|
+
return takeObject(r0);
|
|
990
1069
|
} finally {
|
|
991
1070
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
992
|
-
wasm.__wbindgen_export_2(deferred3_0, deferred3_1, 1);
|
|
993
1071
|
}
|
|
994
1072
|
}
|
|
995
1073
|
/**
|
|
996
|
-
*
|
|
997
|
-
*
|
|
998
|
-
* @param
|
|
999
|
-
* @param
|
|
1000
|
-
* @
|
|
1001
|
-
* @param {string}
|
|
1002
|
-
* @param {
|
|
1003
|
-
* @param {
|
|
1004
|
-
* @returns {any}
|
|
1074
|
+
* Reload schema from ParsedSchemaCache using a cache key
|
|
1075
|
+
*
|
|
1076
|
+
* @param cacheKey - Cache key to lookup in the global ParsedSchemaCache
|
|
1077
|
+
* @param context - Optional context data JSON string
|
|
1078
|
+
* @param data - Optional initial data JSON string
|
|
1079
|
+
* @param {string} cache_key
|
|
1080
|
+
* @param {string | null} [context]
|
|
1081
|
+
* @param {string | null} [data]
|
|
1005
1082
|
*/
|
|
1006
|
-
|
|
1083
|
+
reloadSchemaFromCache(cache_key, context, data) {
|
|
1007
1084
|
try {
|
|
1008
1085
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1009
|
-
const ptr0 = passStringToWasm0(
|
|
1086
|
+
const ptr0 = passStringToWasm0(cache_key, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
1010
1087
|
const len0 = WASM_VECTOR_LEN;
|
|
1011
|
-
|
|
1088
|
+
var ptr1 = isLikeNone(context) ? 0 : passStringToWasm0(context, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
1089
|
+
var len1 = WASM_VECTOR_LEN;
|
|
1090
|
+
var ptr2 = isLikeNone(data) ? 0 : passStringToWasm0(data, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
1091
|
+
var len2 = WASM_VECTOR_LEN;
|
|
1092
|
+
wasm.jsonevalwasm_reloadSchemaFromCache(retptr, this.__wbg_ptr, ptr0, len0, ptr1, len1, ptr2, len2);
|
|
1012
1093
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
1013
1094
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
throw takeObject(r1);
|
|
1095
|
+
if (r1) {
|
|
1096
|
+
throw takeObject(r0);
|
|
1017
1097
|
}
|
|
1018
|
-
return takeObject(r0);
|
|
1019
1098
|
} finally {
|
|
1020
1099
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
1021
1100
|
}
|
|
1022
1101
|
}
|
|
1023
1102
|
/**
|
|
1024
|
-
* Get a value from the schema using dotted path notation
|
|
1103
|
+
* Get a value from the evaluated schema using dotted path notation
|
|
1025
1104
|
*
|
|
1026
1105
|
* @param path - Dotted path to the value (e.g., "properties.field.value")
|
|
1106
|
+
* @param skipLayout - Whether to skip layout resolution
|
|
1027
1107
|
* @returns Value as JSON string or null if not found
|
|
1028
1108
|
* @param {string} path
|
|
1109
|
+
* @param {boolean} skip_layout
|
|
1029
1110
|
* @returns {string | undefined}
|
|
1030
1111
|
*/
|
|
1031
|
-
|
|
1112
|
+
getEvaluatedSchemaByPath(path, skip_layout) {
|
|
1032
1113
|
try {
|
|
1033
1114
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1034
1115
|
const ptr0 = passStringToWasm0(path, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
1035
1116
|
const len0 = WASM_VECTOR_LEN;
|
|
1036
|
-
wasm.
|
|
1117
|
+
wasm.jsonevalwasm_getEvaluatedSchemaByPath(retptr, this.__wbg_ptr, ptr0, len0, skip_layout);
|
|
1037
1118
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
1038
1119
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
1039
1120
|
let v2;
|
|
@@ -1047,47 +1128,59 @@ export class JSONEvalWasm {
|
|
|
1047
1128
|
}
|
|
1048
1129
|
}
|
|
1049
1130
|
/**
|
|
1050
|
-
* Get
|
|
1131
|
+
* Get the evaluated schema in MessagePack format
|
|
1051
1132
|
*
|
|
1052
|
-
* @param
|
|
1053
|
-
* @returns
|
|
1054
|
-
*
|
|
1055
|
-
*
|
|
1133
|
+
* @param skipLayout - Whether to skip layout resolution
|
|
1134
|
+
* @returns Evaluated schema as MessagePack bytes (Uint8Array)
|
|
1135
|
+
*
|
|
1136
|
+
* # Zero-Copy Optimization
|
|
1137
|
+
*
|
|
1138
|
+
* This method returns MessagePack binary data with minimal copying:
|
|
1139
|
+
* 1. Serializes schema to Vec<u8> in Rust (unavoidable)
|
|
1140
|
+
* 2. wasm-bindgen transfers Vec<u8> to JS as Uint8Array (optimized)
|
|
1141
|
+
* 3. Result is a Uint8Array view (minimal overhead)
|
|
1142
|
+
*
|
|
1143
|
+
* MessagePack format is 20-50% smaller than JSON, ideal for web/WASM.
|
|
1144
|
+
* @param {boolean} skip_layout
|
|
1145
|
+
* @returns {Uint8Array}
|
|
1056
1146
|
*/
|
|
1057
|
-
|
|
1147
|
+
getEvaluatedSchemaMsgpack(skip_layout) {
|
|
1058
1148
|
try {
|
|
1059
1149
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1060
|
-
|
|
1061
|
-
const len0 = WASM_VECTOR_LEN;
|
|
1062
|
-
wasm.jsonevalwasm_getSchemaByPathJS(retptr, this.__wbg_ptr, ptr0, len0);
|
|
1150
|
+
wasm.jsonevalwasm_getEvaluatedSchemaMsgpack(retptr, this.__wbg_ptr, skip_layout);
|
|
1063
1151
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
1064
1152
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
1065
1153
|
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
1066
|
-
|
|
1067
|
-
|
|
1154
|
+
var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
|
|
1155
|
+
if (r3) {
|
|
1156
|
+
throw takeObject(r2);
|
|
1068
1157
|
}
|
|
1069
|
-
|
|
1158
|
+
var v1 = getArrayU8FromWasm0(r0, r1).slice();
|
|
1159
|
+
wasm.__wbindgen_export_2(r0, r1 * 1, 1);
|
|
1160
|
+
return v1;
|
|
1070
1161
|
} finally {
|
|
1071
1162
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
1072
1163
|
}
|
|
1073
1164
|
}
|
|
1074
1165
|
/**
|
|
1075
|
-
* Get values from schema using multiple dotted paths
|
|
1166
|
+
* Get values from evaluated schema using multiple dotted paths
|
|
1076
1167
|
* @param pathsJson - JSON array of dotted paths
|
|
1168
|
+
* @param skipLayout - Whether to skip layout resolution
|
|
1077
1169
|
* @param format - Return format (0=Nested, 1=Flat, 2=Array)
|
|
1078
1170
|
* @returns Data in specified format as JSON string
|
|
1079
1171
|
* @param {string} paths_json
|
|
1172
|
+
* @param {boolean} skip_layout
|
|
1080
1173
|
* @param {number} format
|
|
1081
1174
|
* @returns {string}
|
|
1082
1175
|
*/
|
|
1083
|
-
|
|
1176
|
+
getEvaluatedSchemaByPaths(paths_json, skip_layout, format) {
|
|
1084
1177
|
let deferred3_0;
|
|
1085
1178
|
let deferred3_1;
|
|
1086
1179
|
try {
|
|
1087
1180
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1088
1181
|
const ptr0 = passStringToWasm0(paths_json, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
1089
1182
|
const len0 = WASM_VECTOR_LEN;
|
|
1090
|
-
wasm.
|
|
1183
|
+
wasm.jsonevalwasm_getEvaluatedSchemaByPaths(retptr, this.__wbg_ptr, ptr0, len0, skip_layout, format);
|
|
1091
1184
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
1092
1185
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
1093
1186
|
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
@@ -1107,20 +1200,49 @@ export class JSONEvalWasm {
|
|
|
1107
1200
|
}
|
|
1108
1201
|
}
|
|
1109
1202
|
/**
|
|
1110
|
-
* Get
|
|
1203
|
+
* Get a value from the evaluated schema using dotted path notation as JavaScript object
|
|
1204
|
+
*
|
|
1205
|
+
* @param path - Dotted path to the value (e.g., "properties.field.value")
|
|
1206
|
+
* @param skipLayout - Whether to skip layout resolution
|
|
1207
|
+
* @returns Value as JavaScript object or null if not found
|
|
1208
|
+
* @param {string} path
|
|
1209
|
+
* @param {boolean} skip_layout
|
|
1210
|
+
* @returns {any}
|
|
1211
|
+
*/
|
|
1212
|
+
getEvaluatedSchemaByPathJS(path, skip_layout) {
|
|
1213
|
+
try {
|
|
1214
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1215
|
+
const ptr0 = passStringToWasm0(path, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
1216
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1217
|
+
wasm.jsonevalwasm_getEvaluatedSchemaByPathJS(retptr, this.__wbg_ptr, ptr0, len0, skip_layout);
|
|
1218
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
1219
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
1220
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
1221
|
+
if (r2) {
|
|
1222
|
+
throw takeObject(r1);
|
|
1223
|
+
}
|
|
1224
|
+
return takeObject(r0);
|
|
1225
|
+
} finally {
|
|
1226
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
1227
|
+
}
|
|
1228
|
+
}
|
|
1229
|
+
/**
|
|
1230
|
+
* Get values from evaluated schema using multiple dotted paths (JS object)
|
|
1111
1231
|
* @param pathsJson - JSON array of dotted paths
|
|
1232
|
+
* @param skipLayout - Whether to skip layout resolution
|
|
1112
1233
|
* @param format - Return format (0=Nested, 1=Flat, 2=Array)
|
|
1113
1234
|
* @returns Data in specified format as JavaScript object
|
|
1114
1235
|
* @param {string} paths_json
|
|
1236
|
+
* @param {boolean} skip_layout
|
|
1115
1237
|
* @param {number} format
|
|
1116
1238
|
* @returns {any}
|
|
1117
1239
|
*/
|
|
1118
|
-
|
|
1240
|
+
getEvaluatedSchemaByPathsJS(paths_json, skip_layout, format) {
|
|
1119
1241
|
try {
|
|
1120
1242
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1121
1243
|
const ptr0 = passStringToWasm0(paths_json, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
1122
1244
|
const len0 = WASM_VECTOR_LEN;
|
|
1123
|
-
wasm.
|
|
1245
|
+
wasm.jsonevalwasm_getEvaluatedSchemaByPathsJS(retptr, this.__wbg_ptr, ptr0, len0, skip_layout, format);
|
|
1124
1246
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
1125
1247
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
1126
1248
|
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
@@ -1133,83 +1255,87 @@ export class JSONEvalWasm {
|
|
|
1133
1255
|
}
|
|
1134
1256
|
}
|
|
1135
1257
|
/**
|
|
1136
|
-
*
|
|
1258
|
+
* Get the evaluated schema without $params field
|
|
1137
1259
|
*
|
|
1138
|
-
* @param
|
|
1139
|
-
* @
|
|
1140
|
-
* @param
|
|
1141
|
-
* @
|
|
1142
|
-
* @param {string | null} [context]
|
|
1143
|
-
* @param {string | null} [data]
|
|
1260
|
+
* @param skipLayout - Whether to skip layout resolution
|
|
1261
|
+
* @returns Evaluated schema as JSON string
|
|
1262
|
+
* @param {boolean} skip_layout
|
|
1263
|
+
* @returns {string}
|
|
1144
1264
|
*/
|
|
1145
|
-
|
|
1265
|
+
getEvaluatedSchemaWithoutParams(skip_layout) {
|
|
1266
|
+
let deferred1_0;
|
|
1267
|
+
let deferred1_1;
|
|
1146
1268
|
try {
|
|
1147
1269
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1148
|
-
|
|
1149
|
-
const len0 = WASM_VECTOR_LEN;
|
|
1150
|
-
var ptr1 = isLikeNone(context) ? 0 : passStringToWasm0(context, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
1151
|
-
var len1 = WASM_VECTOR_LEN;
|
|
1152
|
-
var ptr2 = isLikeNone(data) ? 0 : passStringToWasm0(data, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
1153
|
-
var len2 = WASM_VECTOR_LEN;
|
|
1154
|
-
wasm.jsonevalwasm_reloadSchema(retptr, this.__wbg_ptr, ptr0, len0, ptr1, len1, ptr2, len2);
|
|
1270
|
+
wasm.jsonevalwasm_getEvaluatedSchemaWithoutParams(retptr, this.__wbg_ptr, skip_layout);
|
|
1155
1271
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
1156
1272
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
1157
|
-
|
|
1158
|
-
|
|
1159
|
-
|
|
1273
|
+
deferred1_0 = r0;
|
|
1274
|
+
deferred1_1 = r1;
|
|
1275
|
+
return getStringFromWasm0(r0, r1);
|
|
1160
1276
|
} finally {
|
|
1161
1277
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
1278
|
+
wasm.__wbindgen_export_2(deferred1_0, deferred1_1, 1);
|
|
1162
1279
|
}
|
|
1163
1280
|
}
|
|
1164
1281
|
/**
|
|
1165
|
-
*
|
|
1282
|
+
* Get the evaluated schema without $params as JavaScript object
|
|
1166
1283
|
*
|
|
1167
|
-
* @param
|
|
1168
|
-
* @
|
|
1169
|
-
* @param
|
|
1170
|
-
* @
|
|
1171
|
-
* @param {string | null} [context]
|
|
1172
|
-
* @param {string | null} [data]
|
|
1284
|
+
* @param skipLayout - Whether to skip layout resolution
|
|
1285
|
+
* @returns Evaluated schema as JavaScript object
|
|
1286
|
+
* @param {boolean} skip_layout
|
|
1287
|
+
* @returns {any}
|
|
1173
1288
|
*/
|
|
1174
|
-
|
|
1289
|
+
getEvaluatedSchemaWithoutParamsJS(skip_layout) {
|
|
1175
1290
|
try {
|
|
1176
1291
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1177
|
-
|
|
1178
|
-
const len0 = WASM_VECTOR_LEN;
|
|
1179
|
-
var ptr1 = isLikeNone(context) ? 0 : passStringToWasm0(context, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
1180
|
-
var len1 = WASM_VECTOR_LEN;
|
|
1181
|
-
var ptr2 = isLikeNone(data) ? 0 : passStringToWasm0(data, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
1182
|
-
var len2 = WASM_VECTOR_LEN;
|
|
1183
|
-
wasm.jsonevalwasm_reloadSchemaMsgpack(retptr, this.__wbg_ptr, ptr0, len0, ptr1, len1, ptr2, len2);
|
|
1292
|
+
wasm.jsonevalwasm_getEvaluatedSchemaWithoutParamsJS(retptr, this.__wbg_ptr, skip_layout);
|
|
1184
1293
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
1185
1294
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
1186
|
-
|
|
1187
|
-
|
|
1295
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
1296
|
+
if (r2) {
|
|
1297
|
+
throw takeObject(r1);
|
|
1188
1298
|
}
|
|
1299
|
+
return takeObject(r0);
|
|
1189
1300
|
} finally {
|
|
1190
1301
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
1191
1302
|
}
|
|
1192
1303
|
}
|
|
1193
1304
|
/**
|
|
1194
|
-
*
|
|
1305
|
+
* Check if a subform exists at the given path
|
|
1195
1306
|
*
|
|
1196
|
-
* @param
|
|
1307
|
+
* @param subformPath - Path to check
|
|
1308
|
+
* @returns True if subform exists, false otherwise
|
|
1309
|
+
* @param {string} subform_path
|
|
1310
|
+
* @returns {boolean}
|
|
1311
|
+
*/
|
|
1312
|
+
hasSubform(subform_path) {
|
|
1313
|
+
const ptr0 = passStringToWasm0(subform_path, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
1314
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1315
|
+
const ret = wasm.jsonevalwasm_hasSubform(this.__wbg_ptr, ptr0, len0);
|
|
1316
|
+
return ret !== 0;
|
|
1317
|
+
}
|
|
1318
|
+
/**
|
|
1319
|
+
* Evaluate a subform with data
|
|
1320
|
+
*
|
|
1321
|
+
* @param subformPath - Path to the subform (e.g., "#/riders")
|
|
1322
|
+
* @param data - JSON data string for the subform
|
|
1197
1323
|
* @param context - Optional context data JSON string
|
|
1198
|
-
* @
|
|
1199
|
-
* @param {string}
|
|
1324
|
+
* @throws Error if evaluation fails
|
|
1325
|
+
* @param {string} subform_path
|
|
1326
|
+
* @param {string} data
|
|
1200
1327
|
* @param {string | null} [context]
|
|
1201
|
-
* @param {string | null} [data]
|
|
1202
1328
|
*/
|
|
1203
|
-
|
|
1329
|
+
evaluateSubform(subform_path, data, context) {
|
|
1204
1330
|
try {
|
|
1205
1331
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1206
|
-
const ptr0 = passStringToWasm0(
|
|
1332
|
+
const ptr0 = passStringToWasm0(subform_path, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
1207
1333
|
const len0 = WASM_VECTOR_LEN;
|
|
1208
|
-
|
|
1209
|
-
|
|
1210
|
-
var ptr2 = isLikeNone(
|
|
1334
|
+
const ptr1 = passStringToWasm0(data, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
1335
|
+
const len1 = WASM_VECTOR_LEN;
|
|
1336
|
+
var ptr2 = isLikeNone(context) ? 0 : passStringToWasm0(context, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
1211
1337
|
var len2 = WASM_VECTOR_LEN;
|
|
1212
|
-
wasm.
|
|
1338
|
+
wasm.jsonevalwasm_evaluateSubform(retptr, this.__wbg_ptr, ptr0, len0, ptr1, len1, ptr2, len2);
|
|
1213
1339
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
1214
1340
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
1215
1341
|
if (r1) {
|
|
@@ -1220,78 +1346,72 @@ export class JSONEvalWasm {
|
|
|
1220
1346
|
}
|
|
1221
1347
|
}
|
|
1222
1348
|
/**
|
|
1223
|
-
*
|
|
1349
|
+
* Validate subform data against its schema rules
|
|
1224
1350
|
*
|
|
1225
|
-
* @
|
|
1226
|
-
* @
|
|
1351
|
+
* @param subformPath - Path to the subform
|
|
1352
|
+
* @param data - JSON data string for the subform
|
|
1353
|
+
* @param context - Optional context data JSON string
|
|
1354
|
+
* @returns ValidationResult
|
|
1355
|
+
* @param {string} subform_path
|
|
1356
|
+
* @param {string} data
|
|
1357
|
+
* @param {string | null} [context]
|
|
1358
|
+
* @returns {ValidationResult}
|
|
1227
1359
|
*/
|
|
1228
|
-
|
|
1360
|
+
validateSubform(subform_path, data, context) {
|
|
1229
1361
|
try {
|
|
1230
1362
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1231
|
-
wasm.
|
|
1363
|
+
const ptr0 = passStringToWasm0(subform_path, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
1364
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1365
|
+
const ptr1 = passStringToWasm0(data, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
1366
|
+
const len1 = WASM_VECTOR_LEN;
|
|
1367
|
+
var ptr2 = isLikeNone(context) ? 0 : passStringToWasm0(context, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
1368
|
+
var len2 = WASM_VECTOR_LEN;
|
|
1369
|
+
wasm.jsonevalwasm_validateSubform(retptr, this.__wbg_ptr, ptr0, len0, ptr1, len1, ptr2, len2);
|
|
1232
1370
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
1233
1371
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
1234
1372
|
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
1235
1373
|
if (r2) {
|
|
1236
1374
|
throw takeObject(r1);
|
|
1237
1375
|
}
|
|
1238
|
-
return
|
|
1376
|
+
return ValidationResult.__wrap(r0);
|
|
1239
1377
|
} finally {
|
|
1240
1378
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
1241
|
-
}
|
|
1242
|
-
}
|
|
1243
|
-
/**
|
|
1244
|
-
* Clear the evaluation cache
|
|
1245
|
-
*/
|
|
1246
|
-
clearCache() {
|
|
1247
|
-
wasm.jsonevalwasm_clearCache(this.__wbg_ptr);
|
|
1248
|
-
}
|
|
1249
|
-
/**
|
|
1250
|
-
* Get the number of cached entries
|
|
1251
|
-
*
|
|
1252
|
-
* @returns Number of cached entries
|
|
1253
|
-
* @returns {number}
|
|
1254
|
-
*/
|
|
1255
|
-
cacheLen() {
|
|
1256
|
-
const ret = wasm.jsonevalwasm_cacheLen(this.__wbg_ptr);
|
|
1257
|
-
return ret >>> 0;
|
|
1258
|
-
}
|
|
1259
|
-
/**
|
|
1260
|
-
* Enable evaluation caching
|
|
1261
|
-
* Useful for reusing JSONEval instances with different data
|
|
1262
|
-
*/
|
|
1263
|
-
enableCache() {
|
|
1264
|
-
wasm.jsonevalwasm_enableCache(this.__wbg_ptr);
|
|
1265
|
-
}
|
|
1266
|
-
/**
|
|
1267
|
-
* Disable evaluation caching
|
|
1268
|
-
* Useful for web API usage where each request creates a new JSONEval instance
|
|
1269
|
-
* Improves performance by skipping cache operations that have no benefit for single-use instances
|
|
1270
|
-
*/
|
|
1271
|
-
disableCache() {
|
|
1272
|
-
wasm.jsonevalwasm_disableCache(this.__wbg_ptr);
|
|
1379
|
+
}
|
|
1273
1380
|
}
|
|
1274
1381
|
/**
|
|
1275
|
-
*
|
|
1382
|
+
* Get list of available subform paths
|
|
1276
1383
|
*
|
|
1277
|
-
* @returns
|
|
1278
|
-
* @returns {
|
|
1384
|
+
* @returns Array of subform paths
|
|
1385
|
+
* @returns {string[]}
|
|
1279
1386
|
*/
|
|
1280
|
-
|
|
1281
|
-
|
|
1282
|
-
|
|
1387
|
+
getSubformPaths() {
|
|
1388
|
+
try {
|
|
1389
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1390
|
+
wasm.jsonevalwasm_getSubformPaths(retptr, this.__wbg_ptr);
|
|
1391
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
1392
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
1393
|
+
var v1 = getArrayJsValueFromWasm0(r0, r1).slice();
|
|
1394
|
+
wasm.__wbindgen_export_2(r0, r1 * 4, 4);
|
|
1395
|
+
return v1;
|
|
1396
|
+
} finally {
|
|
1397
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
1398
|
+
}
|
|
1283
1399
|
}
|
|
1284
1400
|
/**
|
|
1285
|
-
* Resolve layout
|
|
1401
|
+
* Resolve layout for subform
|
|
1286
1402
|
*
|
|
1403
|
+
* @param subformPath - Path to the subform
|
|
1287
1404
|
* @param evaluate - If true, runs evaluation before resolving layout
|
|
1288
1405
|
* @throws Error if resolve fails
|
|
1406
|
+
* @param {string} subform_path
|
|
1289
1407
|
* @param {boolean} evaluate
|
|
1290
1408
|
*/
|
|
1291
|
-
|
|
1409
|
+
resolveLayoutSubform(subform_path, evaluate) {
|
|
1292
1410
|
try {
|
|
1293
1411
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1294
|
-
|
|
1412
|
+
const ptr0 = passStringToWasm0(subform_path, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
1413
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1414
|
+
wasm.jsonevalwasm_resolveLayoutSubform(retptr, this.__wbg_ptr, ptr0, len0, evaluate);
|
|
1295
1415
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
1296
1416
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
1297
1417
|
if (r1) {
|
|
@@ -1302,64 +1422,55 @@ export class JSONEvalWasm {
|
|
|
1302
1422
|
}
|
|
1303
1423
|
}
|
|
1304
1424
|
/**
|
|
1305
|
-
*
|
|
1425
|
+
* Get schema value from subform (all .value fields)
|
|
1306
1426
|
*
|
|
1307
|
-
* @param subformPath - Path to the subform
|
|
1308
|
-
* @
|
|
1309
|
-
* @param context - Optional context data JSON string
|
|
1310
|
-
* @throws Error if evaluation fails
|
|
1427
|
+
* @param subformPath - Path to the subform
|
|
1428
|
+
* @returns Modified data as JavaScript object
|
|
1311
1429
|
* @param {string} subform_path
|
|
1312
|
-
* @
|
|
1313
|
-
* @param {string | null} [context]
|
|
1430
|
+
* @returns {any}
|
|
1314
1431
|
*/
|
|
1315
|
-
|
|
1432
|
+
getSchemaValueSubform(subform_path) {
|
|
1316
1433
|
try {
|
|
1317
1434
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1318
1435
|
const ptr0 = passStringToWasm0(subform_path, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
1319
1436
|
const len0 = WASM_VECTOR_LEN;
|
|
1320
|
-
|
|
1321
|
-
const len1 = WASM_VECTOR_LEN;
|
|
1322
|
-
var ptr2 = isLikeNone(context) ? 0 : passStringToWasm0(context, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
1323
|
-
var len2 = WASM_VECTOR_LEN;
|
|
1324
|
-
wasm.jsonevalwasm_evaluateSubform(retptr, this.__wbg_ptr, ptr0, len0, ptr1, len1, ptr2, len2);
|
|
1437
|
+
wasm.jsonevalwasm_getSchemaValueSubform(retptr, this.__wbg_ptr, ptr0, len0);
|
|
1325
1438
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
1326
1439
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
1327
|
-
|
|
1328
|
-
|
|
1440
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
1441
|
+
if (r2) {
|
|
1442
|
+
throw takeObject(r1);
|
|
1329
1443
|
}
|
|
1444
|
+
return takeObject(r0);
|
|
1330
1445
|
} finally {
|
|
1331
1446
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
1332
1447
|
}
|
|
1333
1448
|
}
|
|
1334
1449
|
/**
|
|
1335
|
-
*
|
|
1336
|
-
*
|
|
1450
|
+
* Get schema by specific path from subform (returns JSON string)
|
|
1337
1451
|
* @param subformPath - Path to the subform
|
|
1338
|
-
* @param
|
|
1339
|
-
* @
|
|
1340
|
-
* @returns ValidationResult
|
|
1452
|
+
* @param schemaPath - Path within the subform
|
|
1453
|
+
* @returns Value as JSON string or null if not found
|
|
1341
1454
|
* @param {string} subform_path
|
|
1342
|
-
* @param {string}
|
|
1343
|
-
* @
|
|
1344
|
-
* @returns {ValidationResult}
|
|
1455
|
+
* @param {string} schema_path
|
|
1456
|
+
* @returns {string | undefined}
|
|
1345
1457
|
*/
|
|
1346
|
-
|
|
1458
|
+
getSchemaByPathSubform(subform_path, schema_path) {
|
|
1347
1459
|
try {
|
|
1348
1460
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1349
1461
|
const ptr0 = passStringToWasm0(subform_path, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
1350
1462
|
const len0 = WASM_VECTOR_LEN;
|
|
1351
|
-
const ptr1 = passStringToWasm0(
|
|
1463
|
+
const ptr1 = passStringToWasm0(schema_path, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
1352
1464
|
const len1 = WASM_VECTOR_LEN;
|
|
1353
|
-
|
|
1354
|
-
var len2 = WASM_VECTOR_LEN;
|
|
1355
|
-
wasm.jsonevalwasm_validateSubform(retptr, this.__wbg_ptr, ptr0, len0, ptr1, len1, ptr2, len2);
|
|
1465
|
+
wasm.jsonevalwasm_getSchemaByPathSubform(retptr, this.__wbg_ptr, ptr0, len0, ptr1, len1);
|
|
1356
1466
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
1357
1467
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
1358
|
-
|
|
1359
|
-
if (
|
|
1360
|
-
|
|
1468
|
+
let v3;
|
|
1469
|
+
if (r0 !== 0) {
|
|
1470
|
+
v3 = getStringFromWasm0(r0, r1).slice();
|
|
1471
|
+
wasm.__wbindgen_export_2(r0, r1 * 1, 1);
|
|
1361
1472
|
}
|
|
1362
|
-
return
|
|
1473
|
+
return v3;
|
|
1363
1474
|
} finally {
|
|
1364
1475
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
1365
1476
|
}
|
|
@@ -1411,64 +1522,42 @@ export class JSONEvalWasm {
|
|
|
1411
1522
|
}
|
|
1412
1523
|
}
|
|
1413
1524
|
/**
|
|
1414
|
-
*
|
|
1415
|
-
*
|
|
1525
|
+
* Get schema by multiple paths from subform
|
|
1416
1526
|
* @param subformPath - Path to the subform
|
|
1417
|
-
* @param
|
|
1418
|
-
* @param
|
|
1419
|
-
* @
|
|
1420
|
-
* @returns Array of dependent change objects as JavaScript object
|
|
1527
|
+
* @param pathsJson - JSON array of dotted paths
|
|
1528
|
+
* @param format - Return format (0=Nested, 1=Flat, 2=Array)
|
|
1529
|
+
* @returns Data in specified format as JSON string
|
|
1421
1530
|
* @param {string} subform_path
|
|
1422
|
-
* @param {string}
|
|
1423
|
-
* @param {
|
|
1424
|
-
* @
|
|
1425
|
-
* @returns {any}
|
|
1531
|
+
* @param {string} paths_json
|
|
1532
|
+
* @param {number} format
|
|
1533
|
+
* @returns {string}
|
|
1426
1534
|
*/
|
|
1427
|
-
|
|
1535
|
+
getSchemaByPathsSubform(subform_path, paths_json, format) {
|
|
1536
|
+
let deferred4_0;
|
|
1537
|
+
let deferred4_1;
|
|
1428
1538
|
try {
|
|
1429
1539
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1430
1540
|
const ptr0 = passStringToWasm0(subform_path, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
1431
1541
|
const len0 = WASM_VECTOR_LEN;
|
|
1432
|
-
const ptr1 = passStringToWasm0(
|
|
1542
|
+
const ptr1 = passStringToWasm0(paths_json, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
1433
1543
|
const len1 = WASM_VECTOR_LEN;
|
|
1434
|
-
|
|
1435
|
-
var len2 = WASM_VECTOR_LEN;
|
|
1436
|
-
var ptr3 = isLikeNone(context) ? 0 : passStringToWasm0(context, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
1437
|
-
var len3 = WASM_VECTOR_LEN;
|
|
1438
|
-
wasm.jsonevalwasm_evaluateDependentsSubformJS(retptr, this.__wbg_ptr, ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3);
|
|
1544
|
+
wasm.jsonevalwasm_getSchemaByPathsSubform(retptr, this.__wbg_ptr, ptr0, len0, ptr1, len1, format);
|
|
1439
1545
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
1440
1546
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
1441
1547
|
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
1442
|
-
|
|
1443
|
-
|
|
1444
|
-
|
|
1445
|
-
|
|
1446
|
-
|
|
1447
|
-
|
|
1448
|
-
}
|
|
1449
|
-
}
|
|
1450
|
-
/**
|
|
1451
|
-
* Resolve layout for subform
|
|
1452
|
-
*
|
|
1453
|
-
* @param subformPath - Path to the subform
|
|
1454
|
-
* @param evaluate - If true, runs evaluation before resolving layout
|
|
1455
|
-
* @throws Error if resolve fails
|
|
1456
|
-
* @param {string} subform_path
|
|
1457
|
-
* @param {boolean} evaluate
|
|
1458
|
-
*/
|
|
1459
|
-
resolveLayoutSubform(subform_path, evaluate) {
|
|
1460
|
-
try {
|
|
1461
|
-
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1462
|
-
const ptr0 = passStringToWasm0(subform_path, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
1463
|
-
const len0 = WASM_VECTOR_LEN;
|
|
1464
|
-
wasm.jsonevalwasm_resolveLayoutSubform(retptr, this.__wbg_ptr, ptr0, len0, evaluate);
|
|
1465
|
-
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
1466
|
-
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
1467
|
-
if (r1) {
|
|
1468
|
-
throw takeObject(r0);
|
|
1548
|
+
var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
|
|
1549
|
+
var ptr3 = r0;
|
|
1550
|
+
var len3 = r1;
|
|
1551
|
+
if (r3) {
|
|
1552
|
+
ptr3 = 0; len3 = 0;
|
|
1553
|
+
throw takeObject(r2);
|
|
1469
1554
|
}
|
|
1555
|
+
deferred4_0 = ptr3;
|
|
1556
|
+
deferred4_1 = len3;
|
|
1557
|
+
return getStringFromWasm0(ptr3, len3);
|
|
1470
1558
|
} finally {
|
|
1471
1559
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
1560
|
+
wasm.__wbindgen_export_2(deferred4_0, deferred4_1, 1);
|
|
1472
1561
|
}
|
|
1473
1562
|
}
|
|
1474
1563
|
/**
|
|
@@ -1500,21 +1589,22 @@ export class JSONEvalWasm {
|
|
|
1500
1589
|
}
|
|
1501
1590
|
}
|
|
1502
1591
|
/**
|
|
1503
|
-
* Get
|
|
1504
|
-
*
|
|
1592
|
+
* Get schema by specific path from subform (returns JS object)
|
|
1505
1593
|
* @param subformPath - Path to the subform
|
|
1506
|
-
* @param
|
|
1507
|
-
* @returns
|
|
1594
|
+
* @param schemaPath - Path within the subform
|
|
1595
|
+
* @returns Value as JavaScript object or null if not found
|
|
1508
1596
|
* @param {string} subform_path
|
|
1509
|
-
* @param {
|
|
1597
|
+
* @param {string} schema_path
|
|
1510
1598
|
* @returns {any}
|
|
1511
1599
|
*/
|
|
1512
|
-
|
|
1600
|
+
getSchemaByPathSubformJS(subform_path, schema_path) {
|
|
1513
1601
|
try {
|
|
1514
1602
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1515
1603
|
const ptr0 = passStringToWasm0(subform_path, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
1516
1604
|
const len0 = WASM_VECTOR_LEN;
|
|
1517
|
-
|
|
1605
|
+
const ptr1 = passStringToWasm0(schema_path, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
1606
|
+
const len1 = WASM_VECTOR_LEN;
|
|
1607
|
+
wasm.jsonevalwasm_getSchemaByPathSubformJS(retptr, this.__wbg_ptr, ptr0, len0, ptr1, len1);
|
|
1518
1608
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
1519
1609
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
1520
1610
|
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
@@ -1527,19 +1617,31 @@ export class JSONEvalWasm {
|
|
|
1527
1617
|
}
|
|
1528
1618
|
}
|
|
1529
1619
|
/**
|
|
1530
|
-
*
|
|
1620
|
+
* Evaluate dependents in subform and return as JavaScript object
|
|
1531
1621
|
*
|
|
1532
1622
|
* @param subformPath - Path to the subform
|
|
1533
|
-
* @
|
|
1623
|
+
* @param changedPath - Path of the field that changed
|
|
1624
|
+
* @param data - Optional updated JSON data string
|
|
1625
|
+
* @param context - Optional context data JSON string
|
|
1626
|
+
* @returns Array of dependent change objects as JavaScript object
|
|
1534
1627
|
* @param {string} subform_path
|
|
1628
|
+
* @param {string} changed_path
|
|
1629
|
+
* @param {string | null} [data]
|
|
1630
|
+
* @param {string | null} [context]
|
|
1535
1631
|
* @returns {any}
|
|
1536
1632
|
*/
|
|
1537
|
-
|
|
1633
|
+
evaluateDependentsSubformJS(subform_path, changed_path, data, context) {
|
|
1538
1634
|
try {
|
|
1539
1635
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1540
1636
|
const ptr0 = passStringToWasm0(subform_path, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
1541
1637
|
const len0 = WASM_VECTOR_LEN;
|
|
1542
|
-
|
|
1638
|
+
const ptr1 = passStringToWasm0(changed_path, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
1639
|
+
const len1 = WASM_VECTOR_LEN;
|
|
1640
|
+
var ptr2 = isLikeNone(data) ? 0 : passStringToWasm0(data, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
1641
|
+
var len2 = WASM_VECTOR_LEN;
|
|
1642
|
+
var ptr3 = isLikeNone(context) ? 0 : passStringToWasm0(context, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
1643
|
+
var len3 = WASM_VECTOR_LEN;
|
|
1644
|
+
wasm.jsonevalwasm_evaluateDependentsSubformJS(retptr, this.__wbg_ptr, ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3);
|
|
1543
1645
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
1544
1646
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
1545
1647
|
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
@@ -1552,35 +1654,37 @@ export class JSONEvalWasm {
|
|
|
1552
1654
|
}
|
|
1553
1655
|
}
|
|
1554
1656
|
/**
|
|
1555
|
-
* Get
|
|
1556
|
-
*
|
|
1657
|
+
* Get schema by multiple paths from subform (JS object)
|
|
1557
1658
|
* @param subformPath - Path to the subform
|
|
1558
|
-
* @param
|
|
1559
|
-
* @
|
|
1659
|
+
* @param pathsJson - JSON array of dotted paths
|
|
1660
|
+
* @param format - Return format (0=Nested, 1=Flat, 2=Array)
|
|
1661
|
+
* @returns Data in specified format as JavaScript object
|
|
1560
1662
|
* @param {string} subform_path
|
|
1561
|
-
* @param {
|
|
1562
|
-
* @
|
|
1663
|
+
* @param {string} paths_json
|
|
1664
|
+
* @param {number} format
|
|
1665
|
+
* @returns {any}
|
|
1563
1666
|
*/
|
|
1564
|
-
|
|
1565
|
-
let deferred2_0;
|
|
1566
|
-
let deferred2_1;
|
|
1667
|
+
getSchemaByPathsSubformJS(subform_path, paths_json, format) {
|
|
1567
1668
|
try {
|
|
1568
1669
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1569
1670
|
const ptr0 = passStringToWasm0(subform_path, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
1570
1671
|
const len0 = WASM_VECTOR_LEN;
|
|
1571
|
-
|
|
1672
|
+
const ptr1 = passStringToWasm0(paths_json, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
1673
|
+
const len1 = WASM_VECTOR_LEN;
|
|
1674
|
+
wasm.jsonevalwasm_getSchemaByPathsSubformJS(retptr, this.__wbg_ptr, ptr0, len0, ptr1, len1, format);
|
|
1572
1675
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
1573
1676
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
1574
|
-
|
|
1575
|
-
|
|
1576
|
-
|
|
1677
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
1678
|
+
if (r2) {
|
|
1679
|
+
throw takeObject(r1);
|
|
1680
|
+
}
|
|
1681
|
+
return takeObject(r0);
|
|
1577
1682
|
} finally {
|
|
1578
1683
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
1579
|
-
wasm.__wbindgen_export_2(deferred2_0, deferred2_1, 1);
|
|
1580
1684
|
}
|
|
1581
1685
|
}
|
|
1582
1686
|
/**
|
|
1583
|
-
* Get evaluated schema
|
|
1687
|
+
* Get evaluated schema from subform as JavaScript object
|
|
1584
1688
|
*
|
|
1585
1689
|
* @param subformPath - Path to the subform
|
|
1586
1690
|
* @param resolveLayout - Whether to resolve layout
|
|
@@ -1589,12 +1693,12 @@ export class JSONEvalWasm {
|
|
|
1589
1693
|
* @param {boolean} resolve_layout
|
|
1590
1694
|
* @returns {any}
|
|
1591
1695
|
*/
|
|
1592
|
-
|
|
1696
|
+
getEvaluatedSchemaSubformJS(subform_path, resolve_layout) {
|
|
1593
1697
|
try {
|
|
1594
1698
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1595
1699
|
const ptr0 = passStringToWasm0(subform_path, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
1596
1700
|
const len0 = WASM_VECTOR_LEN;
|
|
1597
|
-
wasm.
|
|
1701
|
+
wasm.jsonevalwasm_getEvaluatedSchemaSubformJS(retptr, this.__wbg_ptr, ptr0, len0, resolve_layout);
|
|
1598
1702
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
1599
1703
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
1600
1704
|
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
@@ -1633,38 +1737,7 @@ export class JSONEvalWasm {
|
|
|
1633
1737
|
v3 = getStringFromWasm0(r0, r1).slice();
|
|
1634
1738
|
wasm.__wbindgen_export_2(r0, r1 * 1, 1);
|
|
1635
1739
|
}
|
|
1636
|
-
return v3;
|
|
1637
|
-
} finally {
|
|
1638
|
-
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
1639
|
-
}
|
|
1640
|
-
}
|
|
1641
|
-
/**
|
|
1642
|
-
* Get evaluated schema by specific path from subform as JavaScript object
|
|
1643
|
-
*
|
|
1644
|
-
* @param subformPath - Path to the subform
|
|
1645
|
-
* @param schemaPath - Dotted path to the value within the subform
|
|
1646
|
-
* @param skipLayout - Whether to skip layout resolution
|
|
1647
|
-
* @returns Value as JavaScript object or null if not found
|
|
1648
|
-
* @param {string} subform_path
|
|
1649
|
-
* @param {string} schema_path
|
|
1650
|
-
* @param {boolean} skip_layout
|
|
1651
|
-
* @returns {any}
|
|
1652
|
-
*/
|
|
1653
|
-
getEvaluatedSchemaByPathSubformJS(subform_path, schema_path, skip_layout) {
|
|
1654
|
-
try {
|
|
1655
|
-
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1656
|
-
const ptr0 = passStringToWasm0(subform_path, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
1657
|
-
const len0 = WASM_VECTOR_LEN;
|
|
1658
|
-
const ptr1 = passStringToWasm0(schema_path, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
1659
|
-
const len1 = WASM_VECTOR_LEN;
|
|
1660
|
-
wasm.jsonevalwasm_getEvaluatedSchemaByPathSubformJS(retptr, this.__wbg_ptr, ptr0, len0, ptr1, len1, skip_layout);
|
|
1661
|
-
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
1662
|
-
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
1663
|
-
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
1664
|
-
if (r2) {
|
|
1665
|
-
throw takeObject(r1);
|
|
1666
|
-
}
|
|
1667
|
-
return takeObject(r0);
|
|
1740
|
+
return v3;
|
|
1668
1741
|
} finally {
|
|
1669
1742
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
1670
1743
|
}
|
|
@@ -1711,26 +1784,25 @@ export class JSONEvalWasm {
|
|
|
1711
1784
|
}
|
|
1712
1785
|
}
|
|
1713
1786
|
/**
|
|
1714
|
-
* Get
|
|
1787
|
+
* Get evaluated schema by specific path from subform as JavaScript object
|
|
1788
|
+
*
|
|
1715
1789
|
* @param subformPath - Path to the subform
|
|
1716
|
-
* @param
|
|
1790
|
+
* @param schemaPath - Dotted path to the value within the subform
|
|
1717
1791
|
* @param skipLayout - Whether to skip layout resolution
|
|
1718
|
-
* @
|
|
1719
|
-
* @returns Data in specified format as JavaScript object
|
|
1792
|
+
* @returns Value as JavaScript object or null if not found
|
|
1720
1793
|
* @param {string} subform_path
|
|
1721
|
-
* @param {string}
|
|
1794
|
+
* @param {string} schema_path
|
|
1722
1795
|
* @param {boolean} skip_layout
|
|
1723
|
-
* @param {number} format
|
|
1724
1796
|
* @returns {any}
|
|
1725
1797
|
*/
|
|
1726
|
-
|
|
1798
|
+
getEvaluatedSchemaByPathSubformJS(subform_path, schema_path, skip_layout) {
|
|
1727
1799
|
try {
|
|
1728
1800
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1729
1801
|
const ptr0 = passStringToWasm0(subform_path, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
1730
1802
|
const len0 = WASM_VECTOR_LEN;
|
|
1731
|
-
const ptr1 = passStringToWasm0(
|
|
1803
|
+
const ptr1 = passStringToWasm0(schema_path, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
1732
1804
|
const len1 = WASM_VECTOR_LEN;
|
|
1733
|
-
wasm.
|
|
1805
|
+
wasm.jsonevalwasm_getEvaluatedSchemaByPathSubformJS(retptr, this.__wbg_ptr, ptr0, len0, ptr1, len1, skip_layout);
|
|
1734
1806
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
1735
1807
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
1736
1808
|
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
@@ -1743,51 +1815,26 @@ export class JSONEvalWasm {
|
|
|
1743
1815
|
}
|
|
1744
1816
|
}
|
|
1745
1817
|
/**
|
|
1746
|
-
* Get schema
|
|
1747
|
-
* @param subformPath - Path to the subform
|
|
1748
|
-
* @param schemaPath - Path within the subform
|
|
1749
|
-
* @returns Value as JSON string or null if not found
|
|
1750
|
-
* @param {string} subform_path
|
|
1751
|
-
* @param {string} schema_path
|
|
1752
|
-
* @returns {string | undefined}
|
|
1753
|
-
*/
|
|
1754
|
-
getSchemaByPathSubform(subform_path, schema_path) {
|
|
1755
|
-
try {
|
|
1756
|
-
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1757
|
-
const ptr0 = passStringToWasm0(subform_path, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
1758
|
-
const len0 = WASM_VECTOR_LEN;
|
|
1759
|
-
const ptr1 = passStringToWasm0(schema_path, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
1760
|
-
const len1 = WASM_VECTOR_LEN;
|
|
1761
|
-
wasm.jsonevalwasm_getSchemaByPathSubform(retptr, this.__wbg_ptr, ptr0, len0, ptr1, len1);
|
|
1762
|
-
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
1763
|
-
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
1764
|
-
let v3;
|
|
1765
|
-
if (r0 !== 0) {
|
|
1766
|
-
v3 = getStringFromWasm0(r0, r1).slice();
|
|
1767
|
-
wasm.__wbindgen_export_2(r0, r1 * 1, 1);
|
|
1768
|
-
}
|
|
1769
|
-
return v3;
|
|
1770
|
-
} finally {
|
|
1771
|
-
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
1772
|
-
}
|
|
1773
|
-
}
|
|
1774
|
-
/**
|
|
1775
|
-
* Get schema by specific path from subform (returns JS object)
|
|
1818
|
+
* Get values from the evaluated schema of a subform using multiple dotted path notations (returns JS object)
|
|
1776
1819
|
* @param subformPath - Path to the subform
|
|
1777
|
-
* @param
|
|
1778
|
-
* @
|
|
1820
|
+
* @param pathsJson - JSON array of dotted paths
|
|
1821
|
+
* @param skipLayout - Whether to skip layout resolution
|
|
1822
|
+
* @param format - Return format (0=Nested, 1=Flat, 2=Array)
|
|
1823
|
+
* @returns Data in specified format as JavaScript object
|
|
1779
1824
|
* @param {string} subform_path
|
|
1780
|
-
* @param {string}
|
|
1825
|
+
* @param {string} paths_json
|
|
1826
|
+
* @param {boolean} skip_layout
|
|
1827
|
+
* @param {number} format
|
|
1781
1828
|
* @returns {any}
|
|
1782
1829
|
*/
|
|
1783
|
-
|
|
1830
|
+
getEvaluatedSchemaByPathsSubformJS(subform_path, paths_json, skip_layout, format) {
|
|
1784
1831
|
try {
|
|
1785
1832
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1786
1833
|
const ptr0 = passStringToWasm0(subform_path, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
1787
1834
|
const len0 = WASM_VECTOR_LEN;
|
|
1788
|
-
const ptr1 = passStringToWasm0(
|
|
1835
|
+
const ptr1 = passStringToWasm0(paths_json, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
1789
1836
|
const len1 = WASM_VECTOR_LEN;
|
|
1790
|
-
wasm.
|
|
1837
|
+
wasm.jsonevalwasm_getEvaluatedSchemaByPathsSubformJS(retptr, this.__wbg_ptr, ptr0, len0, ptr1, len1, skip_layout, format);
|
|
1791
1838
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
1792
1839
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
1793
1840
|
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
@@ -1800,63 +1847,49 @@ export class JSONEvalWasm {
|
|
|
1800
1847
|
}
|
|
1801
1848
|
}
|
|
1802
1849
|
/**
|
|
1803
|
-
* Get schema
|
|
1850
|
+
* Get evaluated schema without $params from subform
|
|
1851
|
+
*
|
|
1804
1852
|
* @param subformPath - Path to the subform
|
|
1805
|
-
* @param
|
|
1806
|
-
* @
|
|
1807
|
-
* @returns Data in specified format as JSON string
|
|
1853
|
+
* @param resolveLayout - Whether to resolve layout
|
|
1854
|
+
* @returns Evaluated schema as JSON string
|
|
1808
1855
|
* @param {string} subform_path
|
|
1809
|
-
* @param {
|
|
1810
|
-
* @param {number} format
|
|
1856
|
+
* @param {boolean} resolve_layout
|
|
1811
1857
|
* @returns {string}
|
|
1812
1858
|
*/
|
|
1813
|
-
|
|
1814
|
-
let
|
|
1815
|
-
let
|
|
1859
|
+
getEvaluatedSchemaWithoutParamsSubform(subform_path, resolve_layout) {
|
|
1860
|
+
let deferred2_0;
|
|
1861
|
+
let deferred2_1;
|
|
1816
1862
|
try {
|
|
1817
1863
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1818
1864
|
const ptr0 = passStringToWasm0(subform_path, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
1819
1865
|
const len0 = WASM_VECTOR_LEN;
|
|
1820
|
-
|
|
1821
|
-
const len1 = WASM_VECTOR_LEN;
|
|
1822
|
-
wasm.jsonevalwasm_getSchemaByPathsSubform(retptr, this.__wbg_ptr, ptr0, len0, ptr1, len1, format);
|
|
1866
|
+
wasm.jsonevalwasm_getEvaluatedSchemaWithoutParamsSubform(retptr, this.__wbg_ptr, ptr0, len0, resolve_layout);
|
|
1823
1867
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
1824
1868
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
1825
|
-
|
|
1826
|
-
|
|
1827
|
-
|
|
1828
|
-
var len3 = r1;
|
|
1829
|
-
if (r3) {
|
|
1830
|
-
ptr3 = 0; len3 = 0;
|
|
1831
|
-
throw takeObject(r2);
|
|
1832
|
-
}
|
|
1833
|
-
deferred4_0 = ptr3;
|
|
1834
|
-
deferred4_1 = len3;
|
|
1835
|
-
return getStringFromWasm0(ptr3, len3);
|
|
1869
|
+
deferred2_0 = r0;
|
|
1870
|
+
deferred2_1 = r1;
|
|
1871
|
+
return getStringFromWasm0(r0, r1);
|
|
1836
1872
|
} finally {
|
|
1837
1873
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
1838
|
-
wasm.__wbindgen_export_2(
|
|
1874
|
+
wasm.__wbindgen_export_2(deferred2_0, deferred2_1, 1);
|
|
1839
1875
|
}
|
|
1840
1876
|
}
|
|
1841
1877
|
/**
|
|
1842
|
-
* Get schema
|
|
1878
|
+
* Get evaluated schema without $params from subform as JavaScript object
|
|
1879
|
+
*
|
|
1843
1880
|
* @param subformPath - Path to the subform
|
|
1844
|
-
* @param
|
|
1845
|
-
* @
|
|
1846
|
-
* @returns Data in specified format as JavaScript object
|
|
1881
|
+
* @param resolveLayout - Whether to resolve layout
|
|
1882
|
+
* @returns Evaluated schema as JavaScript object
|
|
1847
1883
|
* @param {string} subform_path
|
|
1848
|
-
* @param {
|
|
1849
|
-
* @param {number} format
|
|
1884
|
+
* @param {boolean} resolve_layout
|
|
1850
1885
|
* @returns {any}
|
|
1851
1886
|
*/
|
|
1852
|
-
|
|
1887
|
+
getEvaluatedSchemaWithoutParamsSubformJS(subform_path, resolve_layout) {
|
|
1853
1888
|
try {
|
|
1854
1889
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1855
1890
|
const ptr0 = passStringToWasm0(subform_path, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
1856
1891
|
const len0 = WASM_VECTOR_LEN;
|
|
1857
|
-
|
|
1858
|
-
const len1 = WASM_VECTOR_LEN;
|
|
1859
|
-
wasm.jsonevalwasm_getSchemaByPathsSubformJS(retptr, this.__wbg_ptr, ptr0, len0, ptr1, len1, format);
|
|
1892
|
+
wasm.jsonevalwasm_getEvaluatedSchemaWithoutParamsSubformJS(retptr, this.__wbg_ptr, ptr0, len0, resolve_layout);
|
|
1860
1893
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
1861
1894
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
1862
1895
|
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
@@ -1868,39 +1901,6 @@ export class JSONEvalWasm {
|
|
|
1868
1901
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
1869
1902
|
}
|
|
1870
1903
|
}
|
|
1871
|
-
/**
|
|
1872
|
-
* Get list of available subform paths
|
|
1873
|
-
*
|
|
1874
|
-
* @returns Array of subform paths
|
|
1875
|
-
* @returns {string[]}
|
|
1876
|
-
*/
|
|
1877
|
-
getSubformPaths() {
|
|
1878
|
-
try {
|
|
1879
|
-
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1880
|
-
wasm.jsonevalwasm_getSubformPaths(retptr, this.__wbg_ptr);
|
|
1881
|
-
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
1882
|
-
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
1883
|
-
var v1 = getArrayJsValueFromWasm0(r0, r1).slice();
|
|
1884
|
-
wasm.__wbindgen_export_2(r0, r1 * 4, 4);
|
|
1885
|
-
return v1;
|
|
1886
|
-
} finally {
|
|
1887
|
-
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
1888
|
-
}
|
|
1889
|
-
}
|
|
1890
|
-
/**
|
|
1891
|
-
* Check if a subform exists at the given path
|
|
1892
|
-
*
|
|
1893
|
-
* @param subformPath - Path to check
|
|
1894
|
-
* @returns True if subform exists, false otherwise
|
|
1895
|
-
* @param {string} subform_path
|
|
1896
|
-
* @returns {boolean}
|
|
1897
|
-
*/
|
|
1898
|
-
hasSubform(subform_path) {
|
|
1899
|
-
const ptr0 = passStringToWasm0(subform_path, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
1900
|
-
const len0 = WASM_VECTOR_LEN;
|
|
1901
|
-
const ret = wasm.jsonevalwasm_hasSubform(this.__wbg_ptr, ptr0, len0);
|
|
1902
|
-
return ret !== 0;
|
|
1903
|
-
}
|
|
1904
1904
|
}
|
|
1905
1905
|
if (Symbol.dispose) JSONEvalWasm.prototype[Symbol.dispose] = JSONEvalWasm.prototype.free;
|
|
1906
1906
|
|
|
@@ -1932,52 +1932,59 @@ export class ValidationError {
|
|
|
1932
1932
|
wasm.__wbg_validationerror_free(ptr, 0);
|
|
1933
1933
|
}
|
|
1934
1934
|
/**
|
|
1935
|
-
* @returns {string}
|
|
1935
|
+
* @returns {string | undefined}
|
|
1936
1936
|
*/
|
|
1937
|
-
get
|
|
1938
|
-
let deferred1_0;
|
|
1939
|
-
let deferred1_1;
|
|
1937
|
+
get field_value() {
|
|
1940
1938
|
try {
|
|
1941
1939
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1942
|
-
wasm.
|
|
1940
|
+
wasm.validationerror_field_value(retptr, this.__wbg_ptr);
|
|
1943
1941
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
1944
1942
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
1945
|
-
|
|
1946
|
-
|
|
1947
|
-
|
|
1943
|
+
let v1;
|
|
1944
|
+
if (r0 !== 0) {
|
|
1945
|
+
v1 = getStringFromWasm0(r0, r1).slice();
|
|
1946
|
+
wasm.__wbindgen_export_2(r0, r1 * 1, 1);
|
|
1947
|
+
}
|
|
1948
|
+
return v1;
|
|
1948
1949
|
} finally {
|
|
1949
1950
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
1950
|
-
wasm.__wbindgen_export_2(deferred1_0, deferred1_1, 1);
|
|
1951
1951
|
}
|
|
1952
1952
|
}
|
|
1953
1953
|
/**
|
|
1954
|
-
* @returns {string}
|
|
1954
|
+
* @returns {string | undefined}
|
|
1955
1955
|
*/
|
|
1956
|
-
get
|
|
1957
|
-
let deferred1_0;
|
|
1958
|
-
let deferred1_1;
|
|
1956
|
+
get code() {
|
|
1959
1957
|
try {
|
|
1960
1958
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1961
|
-
wasm.
|
|
1959
|
+
wasm.validationerror_code(retptr, this.__wbg_ptr);
|
|
1962
1960
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
1963
1961
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
1964
|
-
|
|
1965
|
-
|
|
1966
|
-
|
|
1962
|
+
let v1;
|
|
1963
|
+
if (r0 !== 0) {
|
|
1964
|
+
v1 = getStringFromWasm0(r0, r1).slice();
|
|
1965
|
+
wasm.__wbindgen_export_2(r0, r1 * 1, 1);
|
|
1966
|
+
}
|
|
1967
|
+
return v1;
|
|
1967
1968
|
} finally {
|
|
1968
1969
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
1969
|
-
wasm.__wbindgen_export_2(deferred1_0, deferred1_1, 1);
|
|
1970
1970
|
}
|
|
1971
1971
|
}
|
|
1972
|
+
/**
|
|
1973
|
+
* @returns {any}
|
|
1974
|
+
*/
|
|
1975
|
+
get data() {
|
|
1976
|
+
const ret = wasm.validationerror_data(this.__wbg_ptr);
|
|
1977
|
+
return takeObject(ret);
|
|
1978
|
+
}
|
|
1972
1979
|
/**
|
|
1973
1980
|
* @returns {string}
|
|
1974
1981
|
*/
|
|
1975
|
-
get
|
|
1982
|
+
get path() {
|
|
1976
1983
|
let deferred1_0;
|
|
1977
1984
|
let deferred1_1;
|
|
1978
1985
|
try {
|
|
1979
1986
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1980
|
-
wasm.
|
|
1987
|
+
wasm.validationerror_path(retptr, this.__wbg_ptr);
|
|
1981
1988
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
1982
1989
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
1983
1990
|
deferred1_0 = r0;
|
|
@@ -1989,22 +1996,22 @@ export class ValidationError {
|
|
|
1989
1996
|
}
|
|
1990
1997
|
}
|
|
1991
1998
|
/**
|
|
1992
|
-
* @returns {string
|
|
1999
|
+
* @returns {string}
|
|
1993
2000
|
*/
|
|
1994
|
-
get
|
|
2001
|
+
get message() {
|
|
2002
|
+
let deferred1_0;
|
|
2003
|
+
let deferred1_1;
|
|
1995
2004
|
try {
|
|
1996
2005
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1997
|
-
wasm.
|
|
2006
|
+
wasm.validationerror_message(retptr, this.__wbg_ptr);
|
|
1998
2007
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
1999
2008
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
2000
|
-
|
|
2001
|
-
|
|
2002
|
-
|
|
2003
|
-
wasm.__wbindgen_export_2(r0, r1 * 1, 1);
|
|
2004
|
-
}
|
|
2005
|
-
return v1;
|
|
2009
|
+
deferred1_0 = r0;
|
|
2010
|
+
deferred1_1 = r1;
|
|
2011
|
+
return getStringFromWasm0(r0, r1);
|
|
2006
2012
|
} finally {
|
|
2007
2013
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
2014
|
+
wasm.__wbindgen_export_2(deferred1_0, deferred1_1, 1);
|
|
2008
2015
|
}
|
|
2009
2016
|
}
|
|
2010
2017
|
/**
|
|
@@ -2027,31 +2034,24 @@ export class ValidationError {
|
|
|
2027
2034
|
}
|
|
2028
2035
|
}
|
|
2029
2036
|
/**
|
|
2030
|
-
* @returns {string
|
|
2037
|
+
* @returns {string}
|
|
2031
2038
|
*/
|
|
2032
|
-
get
|
|
2039
|
+
get rule_type() {
|
|
2040
|
+
let deferred1_0;
|
|
2041
|
+
let deferred1_1;
|
|
2033
2042
|
try {
|
|
2034
2043
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
2035
|
-
wasm.
|
|
2044
|
+
wasm.validationerror_rule_type(retptr, this.__wbg_ptr);
|
|
2036
2045
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
2037
2046
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
2038
|
-
|
|
2039
|
-
|
|
2040
|
-
|
|
2041
|
-
wasm.__wbindgen_export_2(r0, r1 * 1, 1);
|
|
2042
|
-
}
|
|
2043
|
-
return v1;
|
|
2047
|
+
deferred1_0 = r0;
|
|
2048
|
+
deferred1_1 = r1;
|
|
2049
|
+
return getStringFromWasm0(r0, r1);
|
|
2044
2050
|
} finally {
|
|
2045
2051
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
2052
|
+
wasm.__wbindgen_export_2(deferred1_0, deferred1_1, 1);
|
|
2046
2053
|
}
|
|
2047
2054
|
}
|
|
2048
|
-
/**
|
|
2049
|
-
* @returns {any}
|
|
2050
|
-
*/
|
|
2051
|
-
get data() {
|
|
2052
|
-
const ret = wasm.validationerror_data(this.__wbg_ptr);
|
|
2053
|
-
return takeObject(ret);
|
|
2054
|
-
}
|
|
2055
2055
|
}
|
|
2056
2056
|
if (Symbol.dispose) ValidationError.prototype[Symbol.dispose] = ValidationError.prototype.free;
|
|
2057
2057
|
|
|
@@ -2082,13 +2082,6 @@ export class ValidationResult {
|
|
|
2082
2082
|
const ptr = this.__destroy_into_raw();
|
|
2083
2083
|
wasm.__wbg_validationresult_free(ptr, 0);
|
|
2084
2084
|
}
|
|
2085
|
-
/**
|
|
2086
|
-
* @returns {boolean}
|
|
2087
|
-
*/
|
|
2088
|
-
get has_error() {
|
|
2089
|
-
const ret = wasm.validationresult_has_error(this.__wbg_ptr);
|
|
2090
|
-
return ret !== 0;
|
|
2091
|
-
}
|
|
2092
2085
|
/**
|
|
2093
2086
|
* @returns {ValidationError[]}
|
|
2094
2087
|
*/
|
|
@@ -2123,6 +2116,13 @@ export class ValidationResult {
|
|
|
2123
2116
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
2124
2117
|
}
|
|
2125
2118
|
}
|
|
2119
|
+
/**
|
|
2120
|
+
* @returns {boolean}
|
|
2121
|
+
*/
|
|
2122
|
+
get has_error() {
|
|
2123
|
+
const ret = wasm.validationresult_has_error(this.__wbg_ptr);
|
|
2124
|
+
return ret !== 0;
|
|
2125
|
+
}
|
|
2126
2126
|
}
|
|
2127
2127
|
if (Symbol.dispose) ValidationResult.prototype[Symbol.dispose] = ValidationResult.prototype.free;
|
|
2128
2128
|
|
|
@@ -2160,7 +2160,7 @@ export function __wbg_getTime_6bb3f64e0f18f817(arg0) {
|
|
|
2160
2160
|
return ret;
|
|
2161
2161
|
};
|
|
2162
2162
|
|
|
2163
|
-
export function
|
|
2163
|
+
export function __wbg_log_ec39d4fa397181b8(arg0, arg1) {
|
|
2164
2164
|
console.log(getStringFromWasm0(arg0, arg1));
|
|
2165
2165
|
};
|
|
2166
2166
|
|