@json-eval-rs/node 0.0.55 → 0.0.56

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@json-eval-rs/node",
3
- "version": "0.0.55",
3
+ "version": "0.0.56",
4
4
  "description": "JSON Eval RS for Node.js and Server-Side Rendering with ergonomic API",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -1,13 +1,13 @@
1
1
  /* tslint:disable */
2
2
  /* eslint-disable */
3
- /**
4
- * Get library version (alias)
5
- */
6
- export function version(): string;
7
3
  /**
8
4
  * Get the library version
9
5
  */
10
6
  export function getVersion(): string;
7
+ /**
8
+ * Get library version (alias)
9
+ */
10
+ export function version(): string;
11
11
  /**
12
12
  * Initialize the library (sets up panic hook)
13
13
  */
@@ -250,6 +250,13 @@ export class JSONEvalWasm {
250
250
  * @returns Data in specified format as JavaScript object
251
251
  */
252
252
  getSchemaByPathsJS(paths_json: string, format: number): any;
253
+ /**
254
+ * Get all schema values as array of path-value pairs
255
+ * Returns [{path: "", value: ""}, ...]
256
+ *
257
+ * @returns Array of {path, value} objects as JavaScript array
258
+ */
259
+ getSchemaValueArray(): any;
253
260
  /**
254
261
  * Get the evaluated schema as JavaScript object
255
262
  *
@@ -257,6 +264,13 @@ export class JSONEvalWasm {
257
264
  * @returns Evaluated schema as JavaScript object
258
265
  */
259
266
  getEvaluatedSchemaJS(skip_layout: boolean): any;
267
+ /**
268
+ * Get all schema values as object with dotted path keys
269
+ * Returns {path: value, ...}
270
+ *
271
+ * @returns Flat object with dotted paths as keys
272
+ */
273
+ getSchemaValueObject(): any;
260
274
  /**
261
275
  * Reload schema from ParsedSchemaCache using a cache key
262
276
  *
@@ -368,10 +382,11 @@ export class JSONEvalWasm {
368
382
  */
369
383
  resolveLayoutSubform(subform_path: string, evaluate: boolean): void;
370
384
  /**
371
- * Get schema value from subform (all .value fields)
385
+ * Get schema value from subform in nested object format (all .value fields).
386
+ * Returns a hierarchical object structure mimicking the schema.
372
387
  *
373
388
  * @param subformPath - Path to the subform
374
- * @returns Modified data as JavaScript object
389
+ * @returns Modified data as JavaScript object (Nested)
375
390
  */
376
391
  getSchemaValueSubform(subform_path: string): any;
377
392
  /**
@@ -432,6 +447,14 @@ export class JSONEvalWasm {
432
447
  * @returns Data in specified format as JavaScript object
433
448
  */
434
449
  getSchemaByPathsSubformJS(subform_path: string, paths_json: string, format: number): any;
450
+ /**
451
+ * Get schema values from subform as a flat array of path-value pairs.
452
+ * Returns an array like `[{path: "field.sub", value: 123}, ...]`.
453
+ *
454
+ * @param subformPath - Path to the subform
455
+ * @returns Array of {path, value} objects
456
+ */
457
+ getSchemaValueArraySubform(subform_path: string): any;
435
458
  /**
436
459
  * Get evaluated schema from subform as JavaScript object
437
460
  *
@@ -440,6 +463,14 @@ export class JSONEvalWasm {
440
463
  * @returns Evaluated schema as JavaScript object
441
464
  */
442
465
  getEvaluatedSchemaSubformJS(subform_path: string, resolve_layout: boolean): any;
466
+ /**
467
+ * Get schema values from subform as a flat object with dotted path keys.
468
+ * Returns an object like `{"field.sub": 123, ...}`.
469
+ *
470
+ * @param subformPath - Path to the subform
471
+ * @returns Flat object with dotted paths as keys
472
+ */
473
+ getSchemaValueObjectSubform(subform_path: string): any;
443
474
  /**
444
475
  * Get evaluated schema by specific path from subform
445
476
  *
@@ -143,10 +143,10 @@ function passArrayJsValueToWasm0(array, malloc) {
143
143
  return ptr;
144
144
  }
145
145
  /**
146
- * Get library version (alias)
146
+ * Get the library version
147
147
  * @returns {string}
148
148
  */
149
- exports.version = function() {
149
+ exports.getVersion = function() {
150
150
  let deferred1_0;
151
151
  let deferred1_1;
152
152
  try {
@@ -164,10 +164,10 @@ exports.version = function() {
164
164
  };
165
165
 
166
166
  /**
167
- * Get the library version
167
+ * Get library version (alias)
168
168
  * @returns {string}
169
169
  */
170
- exports.getVersion = function() {
170
+ exports.version = function() {
171
171
  let deferred1_0;
172
172
  let deferred1_1;
173
173
  try {
@@ -1027,6 +1027,28 @@ class JSONEvalWasm {
1027
1027
  wasm.__wbindgen_add_to_stack_pointer(16);
1028
1028
  }
1029
1029
  }
1030
+ /**
1031
+ * Get all schema values as array of path-value pairs
1032
+ * Returns [{path: "", value: ""}, ...]
1033
+ *
1034
+ * @returns Array of {path, value} objects as JavaScript array
1035
+ * @returns {any}
1036
+ */
1037
+ getSchemaValueArray() {
1038
+ try {
1039
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1040
+ wasm.jsonevalwasm_getSchemaValueArray(retptr, this.__wbg_ptr);
1041
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
1042
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1043
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
1044
+ if (r2) {
1045
+ throw takeObject(r1);
1046
+ }
1047
+ return takeObject(r0);
1048
+ } finally {
1049
+ wasm.__wbindgen_add_to_stack_pointer(16);
1050
+ }
1051
+ }
1030
1052
  /**
1031
1053
  * Get the evaluated schema as JavaScript object
1032
1054
  *
@@ -1050,6 +1072,28 @@ class JSONEvalWasm {
1050
1072
  wasm.__wbindgen_add_to_stack_pointer(16);
1051
1073
  }
1052
1074
  }
1075
+ /**
1076
+ * Get all schema values as object with dotted path keys
1077
+ * Returns {path: value, ...}
1078
+ *
1079
+ * @returns Flat object with dotted paths as keys
1080
+ * @returns {any}
1081
+ */
1082
+ getSchemaValueObject() {
1083
+ try {
1084
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1085
+ wasm.jsonevalwasm_getSchemaValueObject(retptr, this.__wbg_ptr);
1086
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
1087
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1088
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
1089
+ if (r2) {
1090
+ throw takeObject(r1);
1091
+ }
1092
+ return takeObject(r0);
1093
+ } finally {
1094
+ wasm.__wbindgen_add_to_stack_pointer(16);
1095
+ }
1096
+ }
1053
1097
  /**
1054
1098
  * Reload schema from ParsedSchemaCache using a cache key
1055
1099
  *
@@ -1406,10 +1450,11 @@ class JSONEvalWasm {
1406
1450
  }
1407
1451
  }
1408
1452
  /**
1409
- * Get schema value from subform (all .value fields)
1453
+ * Get schema value from subform in nested object format (all .value fields).
1454
+ * Returns a hierarchical object structure mimicking the schema.
1410
1455
  *
1411
1456
  * @param subformPath - Path to the subform
1412
- * @returns Modified data as JavaScript object
1457
+ * @returns Modified data as JavaScript object (Nested)
1413
1458
  * @param {string} subform_path
1414
1459
  * @returns {any}
1415
1460
  */
@@ -1669,6 +1714,32 @@ class JSONEvalWasm {
1669
1714
  wasm.__wbindgen_add_to_stack_pointer(16);
1670
1715
  }
1671
1716
  }
1717
+ /**
1718
+ * Get schema values from subform as a flat array of path-value pairs.
1719
+ * Returns an array like `[{path: "field.sub", value: 123}, ...]`.
1720
+ *
1721
+ * @param subformPath - Path to the subform
1722
+ * @returns Array of {path, value} objects
1723
+ * @param {string} subform_path
1724
+ * @returns {any}
1725
+ */
1726
+ getSchemaValueArraySubform(subform_path) {
1727
+ try {
1728
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1729
+ const ptr0 = passStringToWasm0(subform_path, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
1730
+ const len0 = WASM_VECTOR_LEN;
1731
+ wasm.jsonevalwasm_getSchemaValueArraySubform(retptr, this.__wbg_ptr, ptr0, len0);
1732
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
1733
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1734
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
1735
+ if (r2) {
1736
+ throw takeObject(r1);
1737
+ }
1738
+ return takeObject(r0);
1739
+ } finally {
1740
+ wasm.__wbindgen_add_to_stack_pointer(16);
1741
+ }
1742
+ }
1672
1743
  /**
1673
1744
  * Get evaluated schema from subform as JavaScript object
1674
1745
  *
@@ -1696,6 +1767,32 @@ class JSONEvalWasm {
1696
1767
  wasm.__wbindgen_add_to_stack_pointer(16);
1697
1768
  }
1698
1769
  }
1770
+ /**
1771
+ * Get schema values from subform as a flat object with dotted path keys.
1772
+ * Returns an object like `{"field.sub": 123, ...}`.
1773
+ *
1774
+ * @param subformPath - Path to the subform
1775
+ * @returns Flat object with dotted paths as keys
1776
+ * @param {string} subform_path
1777
+ * @returns {any}
1778
+ */
1779
+ getSchemaValueObjectSubform(subform_path) {
1780
+ try {
1781
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1782
+ const ptr0 = passStringToWasm0(subform_path, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
1783
+ const len0 = WASM_VECTOR_LEN;
1784
+ wasm.jsonevalwasm_getSchemaValueObjectSubform(retptr, this.__wbg_ptr, ptr0, len0);
1785
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
1786
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1787
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
1788
+ if (r2) {
1789
+ throw takeObject(r1);
1790
+ }
1791
+ return takeObject(r0);
1792
+ } finally {
1793
+ wasm.__wbindgen_add_to_stack_pointer(16);
1794
+ }
1795
+ }
1699
1796
  /**
1700
1797
  * Get evaluated schema by specific path from subform
1701
1798
  *
@@ -2152,7 +2249,7 @@ exports.__wbg_getTime_6bb3f64e0f18f817 = function(arg0) {
2152
2249
  return ret;
2153
2250
  };
2154
2251
 
2155
- exports.__wbg_log_81520727e210fff2 = function(arg0, arg1) {
2252
+ exports.__wbg_log_2f61091b102ce39d = function(arg0, arg1) {
2156
2253
  console.log(getStringFromWasm0(arg0, arg1));
2157
2254
  };
2158
2255
 
Binary file
@@ -47,6 +47,10 @@ export const jsonevalwasm_getSchemaByPathsJS: (a: number, b: number, c: number,
47
47
  export const jsonevalwasm_getSchemaByPathsSubform: (a: number, b: number, c: number, d: number, e: number, f: number, g: number) => void;
48
48
  export const jsonevalwasm_getSchemaByPathsSubformJS: (a: number, b: number, c: number, d: number, e: number, f: number, g: number) => void;
49
49
  export const jsonevalwasm_getSchemaValue: (a: number, b: number) => void;
50
+ export const jsonevalwasm_getSchemaValueArray: (a: number, b: number) => void;
51
+ export const jsonevalwasm_getSchemaValueArraySubform: (a: number, b: number, c: number, d: number) => void;
52
+ export const jsonevalwasm_getSchemaValueObject: (a: number, b: number) => void;
53
+ export const jsonevalwasm_getSchemaValueObjectSubform: (a: number, b: number, c: number, d: number) => void;
50
54
  export const jsonevalwasm_getSchemaValueSubform: (a: number, b: number, c: number, d: number) => void;
51
55
  export const jsonevalwasm_getSubformPaths: (a: number, b: number) => void;
52
56
  export const jsonevalwasm_hasSubform: (a: number, b: number, c: number) => number;