@json-eval-rs/bundler 0.0.44 → 0.0.46

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.
@@ -0,0 +1,25 @@
1
+ /**
2
+ * @json-eval-rs/bundler
3
+ * JSON Eval RS for modern bundlers (Webpack, Vite, Rollup, Next.js, etc.)
4
+ */
5
+ import { JSONEvalCore, JSONEvalOptions } from '@json-eval-rs/webcore';
6
+ /**
7
+ * JSONEval class with bundler WASM pre-configured
8
+ */
9
+ export declare class JSONEval extends JSONEvalCore {
10
+ constructor(options: JSONEvalOptions);
11
+ /**
12
+ * Create a new JSONEval instance from a cached ParsedSchema
13
+ * @param cacheKey - Cache key to lookup in ParsedSchemaCache
14
+ * @param context - Optional context data
15
+ * @param data - Optional initial data
16
+ * @returns New instance
17
+ */
18
+ static fromCache(cacheKey: string, context?: any, data?: any): JSONEval;
19
+ }
20
+ /**
21
+ * Get library version
22
+ */
23
+ export declare function version(): string;
24
+ export * from '@json-eval-rs/webcore';
25
+ export default JSONEval;
package/dist/index.js ADDED
@@ -0,0 +1,39 @@
1
+ /**
2
+ * @json-eval-rs/bundler
3
+ * JSON Eval RS for modern bundlers (Webpack, Vite, Rollup, Next.js, etc.)
4
+ */
5
+ import { JSONEvalCore, getVersion } from '@json-eval-rs/webcore';
6
+ // @ts-ignore - implicitly loaded by bundler, file exists after build
7
+ import * as wasm from '../pkg/json_eval_rs.js';
8
+ /**
9
+ * JSONEval class with bundler WASM pre-configured
10
+ */
11
+ export class JSONEval extends JSONEvalCore {
12
+ constructor(options) {
13
+ super(wasm, options);
14
+ }
15
+ /**
16
+ * Create a new JSONEval instance from a cached ParsedSchema
17
+ * @param cacheKey - Cache key to lookup in ParsedSchemaCache
18
+ * @param context - Optional context data
19
+ * @param data - Optional initial data
20
+ * @returns New instance
21
+ */
22
+ static fromCache(cacheKey, context, data) {
23
+ return new JSONEval({
24
+ schema: cacheKey,
25
+ context,
26
+ data,
27
+ fromCache: true
28
+ });
29
+ }
30
+ }
31
+ /**
32
+ * Get library version
33
+ */
34
+ export function version() {
35
+ return getVersion(wasm);
36
+ }
37
+ // Re-export types for convenience
38
+ export * from '@json-eval-rs/webcore';
39
+ export default JSONEval;
package/package.json CHANGED
@@ -1,17 +1,20 @@
1
1
  {
2
2
  "name": "@json-eval-rs/bundler",
3
- "version": "0.0.44",
3
+ "version": "0.0.46",
4
4
  "description": "JSON Eval RS for bundlers (Webpack, Vite, Next.js, etc.) with ergonomic API",
5
- "main": "index.js",
6
- "types": "index.d.ts",
5
+ "main": "dist/index.js",
6
+ "types": "dist/index.d.ts",
7
7
  "type": "module",
8
8
  "files": [
9
- "index.js",
10
- "index.d.ts",
9
+ "dist",
11
10
  "pkg/*.js",
12
11
  "pkg/*.wasm",
13
12
  "pkg/*.d.ts"
14
13
  ],
14
+ "scripts": {
15
+ "build": "tsc",
16
+ "prepack": "npm run build"
17
+ },
15
18
  "keywords": [
16
19
  "json",
17
20
  "json-logic",
@@ -1,17 +1,17 @@
1
1
  /* tslint:disable */
2
2
  /* eslint-disable */
3
3
  /**
4
- * Get library version (alias)
4
+ * Get the library version
5
5
  */
6
- export function version(): string;
6
+ export function getVersion(): string;
7
7
  /**
8
8
  * Initialize the library (sets up panic hook)
9
9
  */
10
10
  export function init(): void;
11
11
  /**
12
- * Get the library version
12
+ * Get library version (alias)
13
13
  */
14
- export function getVersion(): string;
14
+ export function version(): string;
15
15
  /**
16
16
  * WebAssembly wrapper for JSONEval
17
17
  */
@@ -218,10 +218,10 @@ function passArrayJsValueToWasm0(array, malloc) {
218
218
  return ptr;
219
219
  }
220
220
  /**
221
- * Get library version (alias)
221
+ * Get the library version
222
222
  * @returns {string}
223
223
  */
224
- export function version() {
224
+ export function getVersion() {
225
225
  let deferred1_0;
226
226
  let deferred1_1;
227
227
  try {
@@ -246,10 +246,10 @@ export function init() {
246
246
  }
247
247
 
248
248
  /**
249
- * Get the library version
249
+ * Get library version (alias)
250
250
  * @returns {string}
251
251
  */
252
- export function getVersion() {
252
+ export function version() {
253
253
  let deferred1_0;
254
254
  let deferred1_1;
255
255
  try {
@@ -2180,7 +2180,7 @@ export function __wbg_getTime_6bb3f64e0f18f817(arg0) {
2180
2180
  return ret;
2181
2181
  };
2182
2182
 
2183
- export function __wbg_log_2c698220b4282966(arg0, arg1) {
2183
+ export function __wbg_log_416dbeafc33eeb04(arg0, arg1) {
2184
2184
  console.log(getStringFromWasm0(arg0, arg1));
2185
2185
  };
2186
2186
 
Binary file
package/index.d.ts DELETED
@@ -1,124 +0,0 @@
1
- /**
2
- * @json-eval-rs/bundler - TypeScript definitions
3
- */
4
-
5
- export interface ValidationError {
6
- path: string;
7
- rule_type: string;
8
- message: string;
9
- }
10
-
11
- export interface ValidationResult {
12
- has_error: boolean;
13
- errors: ValidationError[];
14
- }
15
-
16
- export interface JSONEvalOptions {
17
- schema: any;
18
- context?: any;
19
- data?: any;
20
- }
21
-
22
- export interface ValidateOptions {
23
- data: any;
24
- context?: any;
25
- }
26
-
27
- export interface EvaluateOptions {
28
- data: any;
29
- context?: any;
30
- }
31
-
32
- export interface EvaluateDependentsOptions {
33
- changedPaths: string[];
34
- data: any;
35
- context?: any;
36
- nested?: boolean;
37
- }
38
-
39
- export interface GetEvaluatedSchemaOptions {
40
- skipLayout?: boolean;
41
- }
42
-
43
- export interface ReloadSchemaOptions {
44
- schema: any;
45
- context?: any;
46
- data?: any;
47
- }
48
-
49
- export interface CacheStats {
50
- hits: number;
51
- misses: number;
52
- entries: number;
53
- }
54
-
55
- export interface EvaluateSubformOptions {
56
- subformPath: string;
57
- data: any;
58
- context?: any;
59
- }
60
-
61
- export interface ValidateSubformOptions {
62
- subformPath: string;
63
- data: any;
64
- context?: any;
65
- }
66
-
67
- export interface EvaluateDependentsSubformOptions {
68
- subformPath: string;
69
- changedPath: string;
70
- data?: any;
71
- context?: any;
72
- }
73
-
74
- export interface ResolveLayoutSubformOptions {
75
- subformPath: string;
76
- evaluate?: boolean;
77
- }
78
-
79
- export interface GetEvaluatedSchemaSubformOptions {
80
- subformPath: string;
81
- resolveLayout?: boolean;
82
- }
83
-
84
- export interface GetSchemaValueSubformOptions {
85
- subformPath: string;
86
- }
87
-
88
- export interface GetEvaluatedSchemaByPathSubformOptions {
89
- subformPath: string;
90
- schemaPath: string;
91
- skipLayout?: boolean;
92
- }
93
-
94
- export class JSONEval {
95
- constructor(options: JSONEvalOptions);
96
- init(): Promise<void>;
97
- validate(options: ValidateOptions): Promise<ValidationResult>;
98
- evaluate(options: EvaluateOptions): Promise<any>;
99
- evaluateDependents(options: EvaluateDependentsOptions): Promise<any>;
100
- getEvaluatedSchema(options?: GetEvaluatedSchemaOptions): Promise<any>;
101
- getSchemaValue(): Promise<any>;
102
- reloadSchema(options: ReloadSchemaOptions): Promise<void>;
103
- cacheStats(): Promise<CacheStats>;
104
- clearCache(): Promise<void>;
105
- cacheLen(): Promise<number>;
106
-
107
- // Subform methods
108
- evaluateSubform(options: EvaluateSubformOptions): Promise<void>;
109
- validateSubform(options: ValidateSubformOptions): Promise<ValidationResult>;
110
- evaluateDependentsSubform(options: EvaluateDependentsSubformOptions): Promise<any>;
111
- resolveLayoutSubform(options: ResolveLayoutSubformOptions): Promise<void>;
112
- getEvaluatedSchemaSubform(options: GetEvaluatedSchemaSubformOptions): Promise<any>;
113
- getSchemaValueSubform(options: GetSchemaValueSubformOptions): Promise<any>;
114
- getEvaluatedSchemaWithoutParamsSubform(options: GetEvaluatedSchemaSubformOptions): Promise<any>;
115
- getEvaluatedSchemaByPathSubform(options: GetEvaluatedSchemaByPathSubformOptions): Promise<any | null>;
116
- getSubformPaths(): Promise<string[]>;
117
- hasSubform(subformPath: string): Promise<boolean>;
118
-
119
- free(): void;
120
- }
121
-
122
- export function version(): string;
123
-
124
- export default JSONEval;
package/index.js DELETED
@@ -1,45 +0,0 @@
1
- /**
2
- * @json-eval-rs/bundler
3
- * JSON Eval RS for modern bundlers (Webpack, Vite, Rollup, Next.js, etc.)
4
- */
5
-
6
- import { JSONEvalCore, getVersion } from '@json-eval-rs/webcore';
7
- import * as wasm from './pkg/json_eval_rs.js';
8
-
9
- /**
10
- * JSONEval class with bundler WASM pre-configured
11
- */
12
- export class JSONEval extends JSONEvalCore {
13
- constructor(options) {
14
- super(wasm, options);
15
- }
16
-
17
- /**
18
- * Create a new JSONEval instance from a cached ParsedSchema
19
- * @param {string} cacheKey - Cache key to lookup in ParsedSchemaCache
20
- * @param {object} [context] - Optional context data
21
- * @param {object} [data] - Optional initial data
22
- * @returns {JSONEval} New instance
23
- */
24
- static fromCache(cacheKey, context, data) {
25
- return new JSONEval({
26
- schema: cacheKey,
27
- context,
28
- data,
29
- fromCache: true
30
- });
31
- }
32
- }
33
-
34
- /**
35
- * Get library version
36
- * @returns {string}
37
- */
38
- export function version() {
39
- return getVersion(wasm);
40
- }
41
-
42
- // Re-export types for convenience
43
- export * from '@json-eval-rs/webcore';
44
-
45
- export default JSONEval;