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