@json-eval-rs/bundler 0.0.55 → 0.0.57

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/bundler",
3
- "version": "0.0.55",
3
+ "version": "0.0.57",
4
4
  "description": "JSON Eval RS for bundlers (Webpack, Vite, Next.js, etc.) with ergonomic API",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -1,17 +1,17 @@
1
1
  /* tslint:disable */
2
2
  /* eslint-disable */
3
3
  /**
4
- * Get library version (alias)
4
+ * Initialize the library (sets up panic hook)
5
5
  */
6
- export function version(): string;
6
+ export function init(): void;
7
7
  /**
8
8
  * Get the library version
9
9
  */
10
10
  export function getVersion(): string;
11
11
  /**
12
- * Initialize the library (sets up panic hook)
12
+ * Get library version (alias)
13
13
  */
14
- export function init(): void;
14
+ export function version(): string;
15
15
  /**
16
16
  * WebAssembly wrapper for JSONEval
17
17
  */
@@ -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
  *
@@ -516,6 +547,6 @@ export class ValidationResult {
516
547
  free(): void;
517
548
  [Symbol.dispose](): void;
518
549
  toJSON(): any;
519
- readonly errors: ValidationError[];
550
+ readonly error: any;
520
551
  readonly has_error: boolean;
521
552
  }
@@ -153,10 +153,17 @@ function passArrayJsValueToWasm0(array, malloc) {
153
153
  return ptr;
154
154
  }
155
155
  /**
156
- * Get library version (alias)
156
+ * Initialize the library (sets up panic hook)
157
+ */
158
+ export function init() {
159
+ wasm.init();
160
+ }
161
+
162
+ /**
163
+ * Get the library version
157
164
  * @returns {string}
158
165
  */
159
- export function version() {
166
+ export function getVersion() {
160
167
  let deferred1_0;
161
168
  let deferred1_1;
162
169
  try {
@@ -174,10 +181,10 @@ export function version() {
174
181
  }
175
182
 
176
183
  /**
177
- * Get the library version
184
+ * Get library version (alias)
178
185
  * @returns {string}
179
186
  */
180
- export function getVersion() {
187
+ export function version() {
181
188
  let deferred1_0;
182
189
  let deferred1_1;
183
190
  try {
@@ -194,13 +201,6 @@ export function getVersion() {
194
201
  }
195
202
  }
196
203
 
197
- /**
198
- * Initialize the library (sets up panic hook)
199
- */
200
- export function init() {
201
- wasm.init();
202
- }
203
-
204
204
  function passArray8ToWasm0(arg, malloc) {
205
205
  const ptr = malloc(arg.length * 1, 1) >>> 0;
206
206
  getUint8ArrayMemory0().set(arg, ptr / 1);
@@ -1037,6 +1037,28 @@ export class JSONEvalWasm {
1037
1037
  wasm.__wbindgen_add_to_stack_pointer(16);
1038
1038
  }
1039
1039
  }
1040
+ /**
1041
+ * Get all schema values as array of path-value pairs
1042
+ * Returns [{path: "", value: ""}, ...]
1043
+ *
1044
+ * @returns Array of {path, value} objects as JavaScript array
1045
+ * @returns {any}
1046
+ */
1047
+ getSchemaValueArray() {
1048
+ try {
1049
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1050
+ wasm.jsonevalwasm_getSchemaValueArray(retptr, this.__wbg_ptr);
1051
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
1052
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1053
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
1054
+ if (r2) {
1055
+ throw takeObject(r1);
1056
+ }
1057
+ return takeObject(r0);
1058
+ } finally {
1059
+ wasm.__wbindgen_add_to_stack_pointer(16);
1060
+ }
1061
+ }
1040
1062
  /**
1041
1063
  * Get the evaluated schema as JavaScript object
1042
1064
  *
@@ -1060,6 +1082,28 @@ export class JSONEvalWasm {
1060
1082
  wasm.__wbindgen_add_to_stack_pointer(16);
1061
1083
  }
1062
1084
  }
1085
+ /**
1086
+ * Get all schema values as object with dotted path keys
1087
+ * Returns {path: value, ...}
1088
+ *
1089
+ * @returns Flat object with dotted paths as keys
1090
+ * @returns {any}
1091
+ */
1092
+ getSchemaValueObject() {
1093
+ try {
1094
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1095
+ wasm.jsonevalwasm_getSchemaValueObject(retptr, this.__wbg_ptr);
1096
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
1097
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1098
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
1099
+ if (r2) {
1100
+ throw takeObject(r1);
1101
+ }
1102
+ return takeObject(r0);
1103
+ } finally {
1104
+ wasm.__wbindgen_add_to_stack_pointer(16);
1105
+ }
1106
+ }
1063
1107
  /**
1064
1108
  * Reload schema from ParsedSchemaCache using a cache key
1065
1109
  *
@@ -1416,10 +1460,11 @@ export class JSONEvalWasm {
1416
1460
  }
1417
1461
  }
1418
1462
  /**
1419
- * Get schema value from subform (all .value fields)
1463
+ * Get schema value from subform in nested object format (all .value fields).
1464
+ * Returns a hierarchical object structure mimicking the schema.
1420
1465
  *
1421
1466
  * @param subformPath - Path to the subform
1422
- * @returns Modified data as JavaScript object
1467
+ * @returns Modified data as JavaScript object (Nested)
1423
1468
  * @param {string} subform_path
1424
1469
  * @returns {any}
1425
1470
  */
@@ -1679,6 +1724,32 @@ export class JSONEvalWasm {
1679
1724
  wasm.__wbindgen_add_to_stack_pointer(16);
1680
1725
  }
1681
1726
  }
1727
+ /**
1728
+ * Get schema values from subform as a flat array of path-value pairs.
1729
+ * Returns an array like `[{path: "field.sub", value: 123}, ...]`.
1730
+ *
1731
+ * @param subformPath - Path to the subform
1732
+ * @returns Array of {path, value} objects
1733
+ * @param {string} subform_path
1734
+ * @returns {any}
1735
+ */
1736
+ getSchemaValueArraySubform(subform_path) {
1737
+ try {
1738
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1739
+ const ptr0 = passStringToWasm0(subform_path, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
1740
+ const len0 = WASM_VECTOR_LEN;
1741
+ wasm.jsonevalwasm_getSchemaValueArraySubform(retptr, this.__wbg_ptr, ptr0, len0);
1742
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
1743
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1744
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
1745
+ if (r2) {
1746
+ throw takeObject(r1);
1747
+ }
1748
+ return takeObject(r0);
1749
+ } finally {
1750
+ wasm.__wbindgen_add_to_stack_pointer(16);
1751
+ }
1752
+ }
1682
1753
  /**
1683
1754
  * Get evaluated schema from subform as JavaScript object
1684
1755
  *
@@ -1706,6 +1777,32 @@ export class JSONEvalWasm {
1706
1777
  wasm.__wbindgen_add_to_stack_pointer(16);
1707
1778
  }
1708
1779
  }
1780
+ /**
1781
+ * Get schema values from subform as a flat object with dotted path keys.
1782
+ * Returns an object like `{"field.sub": 123, ...}`.
1783
+ *
1784
+ * @param subformPath - Path to the subform
1785
+ * @returns Flat object with dotted paths as keys
1786
+ * @param {string} subform_path
1787
+ * @returns {any}
1788
+ */
1789
+ getSchemaValueObjectSubform(subform_path) {
1790
+ try {
1791
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1792
+ const ptr0 = passStringToWasm0(subform_path, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
1793
+ const len0 = WASM_VECTOR_LEN;
1794
+ wasm.jsonevalwasm_getSchemaValueObjectSubform(retptr, this.__wbg_ptr, ptr0, len0);
1795
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
1796
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1797
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
1798
+ if (r2) {
1799
+ throw takeObject(r1);
1800
+ }
1801
+ return takeObject(r0);
1802
+ } finally {
1803
+ wasm.__wbindgen_add_to_stack_pointer(16);
1804
+ }
1805
+ }
1709
1806
  /**
1710
1807
  * Get evaluated schema by specific path from subform
1711
1808
  *
@@ -1908,14 +2005,6 @@ const ValidationErrorFinalization = (typeof FinalizationRegistry === 'undefined'
1908
2005
  */
1909
2006
  export class ValidationError {
1910
2007
 
1911
- static __wrap(ptr) {
1912
- ptr = ptr >>> 0;
1913
- const obj = Object.create(ValidationError.prototype);
1914
- obj.__wbg_ptr = ptr;
1915
- ValidationErrorFinalization.register(obj, obj.__wbg_ptr, obj);
1916
- return obj;
1917
- }
1918
-
1919
2008
  __destroy_into_raw() {
1920
2009
  const ptr = this.__wbg_ptr;
1921
2010
  this.__wbg_ptr = 0;
@@ -2079,20 +2168,11 @@ export class ValidationResult {
2079
2168
  wasm.__wbg_validationresult_free(ptr, 0);
2080
2169
  }
2081
2170
  /**
2082
- * @returns {ValidationError[]}
2171
+ * @returns {any}
2083
2172
  */
2084
- get errors() {
2085
- try {
2086
- const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
2087
- wasm.validationresult_errors(retptr, this.__wbg_ptr);
2088
- var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
2089
- var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
2090
- var v1 = getArrayJsValueFromWasm0(r0, r1).slice();
2091
- wasm.__wbindgen_export_2(r0, r1 * 4, 4);
2092
- return v1;
2093
- } finally {
2094
- wasm.__wbindgen_add_to_stack_pointer(16);
2095
- }
2173
+ get error() {
2174
+ const ret = wasm.validationresult_error(this.__wbg_ptr);
2175
+ return takeObject(ret);
2096
2176
  }
2097
2177
  /**
2098
2178
  * @returns {any}
@@ -2156,7 +2236,7 @@ export function __wbg_getTime_6bb3f64e0f18f817(arg0) {
2156
2236
  return ret;
2157
2237
  };
2158
2238
 
2159
- export function __wbg_log_81520727e210fff2(arg0, arg1) {
2239
+ export function __wbg_log_c5bf37a3dcf4677e(arg0, arg1) {
2160
2240
  console.log(getStringFromWasm0(arg0, arg1));
2161
2241
  };
2162
2242
 
@@ -2206,11 +2286,6 @@ export function __wbg_stack_0ed75d68575b0f3c(arg0, arg1) {
2206
2286
  getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
2207
2287
  };
2208
2288
 
2209
- export function __wbg_validationerror_new(arg0) {
2210
- const ret = ValidationError.__wrap(arg0);
2211
- return addHeapObject(ret);
2212
- };
2213
-
2214
2289
  export function __wbg_wbindgenisstring_d4fa939789f003b0(arg0) {
2215
2290
  const ret = typeof(getObject(arg0)) === 'string';
2216
2291
  return ret;
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;
@@ -73,7 +77,7 @@ export const validationerror_message: (a: number, b: number) => void;
73
77
  export const validationerror_path: (a: number, b: number) => void;
74
78
  export const validationerror_pattern: (a: number, b: number) => void;
75
79
  export const validationerror_rule_type: (a: number, b: number) => void;
76
- export const validationresult_errors: (a: number, b: number) => void;
80
+ export const validationresult_error: (a: number) => number;
77
81
  export const validationresult_has_error: (a: number) => number;
78
82
  export const validationresult_toJSON: (a: number, b: number) => void;
79
83
  export const init: () => void;