@revisium/schema-toolkit 0.21.5 → 0.22.1

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.
@@ -1,142 +1,163 @@
1
1
  'use strict';
2
2
 
3
- var chunk7JWCZZPJ_cjs = require('../chunk-7JWCZZPJ.cjs');
3
+ var chunkPLT4CHNF_cjs = require('../chunk-PLT4CHNF.cjs');
4
4
  var chunkERW5XVED_cjs = require('../chunk-ERW5XVED.cjs');
5
5
  var chunkT3QQSHAC_cjs = require('../chunk-T3QQSHAC.cjs');
6
6
  require('../chunk-FL6PWPVJ.cjs');
7
7
  require('../chunk-ITYABUR5.cjs');
8
8
  require('../chunk-EVD5ZI55.cjs');
9
9
  var chunkONW2OVNQ_cjs = require('../chunk-ONW2OVNQ.cjs');
10
+ require('../chunk-C3HDJOTY.cjs');
10
11
 
11
12
 
12
13
 
14
+ Object.defineProperty(exports, "RevisiumValidator", {
15
+ enumerable: true,
16
+ get: function () { return chunkPLT4CHNF_cjs.RevisiumValidator; }
17
+ });
13
18
  Object.defineProperty(exports, "SchemaTable", {
14
19
  enumerable: true,
15
- get: function () { return chunk7JWCZZPJ_cjs.SchemaTable; }
20
+ get: function () { return chunkPLT4CHNF_cjs.SchemaTable; }
16
21
  });
17
22
  Object.defineProperty(exports, "VALIDATE_JSON_FIELD_NAME_ERROR_MESSAGE", {
18
23
  enumerable: true,
19
- get: function () { return chunk7JWCZZPJ_cjs.VALIDATE_JSON_FIELD_NAME_ERROR_MESSAGE; }
24
+ get: function () { return chunkPLT4CHNF_cjs.VALIDATE_JSON_FIELD_NAME_ERROR_MESSAGE; }
20
25
  });
21
26
  Object.defineProperty(exports, "applyAddPatch", {
22
27
  enumerable: true,
23
- get: function () { return chunk7JWCZZPJ_cjs.applyAddPatch; }
28
+ get: function () { return chunkPLT4CHNF_cjs.applyAddPatch; }
24
29
  });
25
30
  Object.defineProperty(exports, "applyMovePatch", {
26
31
  enumerable: true,
27
- get: function () { return chunk7JWCZZPJ_cjs.applyMovePatch; }
32
+ get: function () { return chunkPLT4CHNF_cjs.applyMovePatch; }
28
33
  });
29
34
  Object.defineProperty(exports, "applyRemovePatch", {
30
35
  enumerable: true,
31
- get: function () { return chunk7JWCZZPJ_cjs.applyRemovePatch; }
36
+ get: function () { return chunkPLT4CHNF_cjs.applyRemovePatch; }
32
37
  });
33
38
  Object.defineProperty(exports, "applyReplacePatch", {
34
39
  enumerable: true,
35
- get: function () { return chunk7JWCZZPJ_cjs.applyReplacePatch; }
40
+ get: function () { return chunkPLT4CHNF_cjs.applyReplacePatch; }
41
+ });
42
+ Object.defineProperty(exports, "calculateDataWeight", {
43
+ enumerable: true,
44
+ get: function () { return chunkPLT4CHNF_cjs.calculateDataWeight; }
45
+ });
46
+ Object.defineProperty(exports, "calculateDataWeightFromStore", {
47
+ enumerable: true,
48
+ get: function () { return chunkPLT4CHNF_cjs.calculateDataWeightFromStore; }
49
+ });
50
+ Object.defineProperty(exports, "calculateSchemaWeight", {
51
+ enumerable: true,
52
+ get: function () { return chunkPLT4CHNF_cjs.calculateSchemaWeight; }
36
53
  });
37
54
  Object.defineProperty(exports, "convertJsonPathToSchemaPath", {
38
55
  enumerable: true,
39
- get: function () { return chunk7JWCZZPJ_cjs.convertJsonPathToSchemaPath; }
56
+ get: function () { return chunkPLT4CHNF_cjs.convertJsonPathToSchemaPath; }
40
57
  });
41
58
  Object.defineProperty(exports, "convertSchemaPathToJsonPath", {
42
59
  enumerable: true,
43
- get: function () { return chunk7JWCZZPJ_cjs.convertSchemaPathToJsonPath; }
60
+ get: function () { return chunkPLT4CHNF_cjs.convertSchemaPathToJsonPath; }
44
61
  });
45
62
  Object.defineProperty(exports, "createJsonObjectSchemaStore", {
46
63
  enumerable: true,
47
- get: function () { return chunk7JWCZZPJ_cjs.createJsonObjectSchemaStore; }
64
+ get: function () { return chunkPLT4CHNF_cjs.createJsonObjectSchemaStore; }
48
65
  });
49
66
  Object.defineProperty(exports, "createJsonSchemaStore", {
50
67
  enumerable: true,
51
- get: function () { return chunk7JWCZZPJ_cjs.createJsonSchemaStore; }
68
+ get: function () { return chunkPLT4CHNF_cjs.createJsonSchemaStore; }
52
69
  });
53
70
  Object.defineProperty(exports, "createPrimitiveStoreBySchema", {
54
71
  enumerable: true,
55
- get: function () { return chunk7JWCZZPJ_cjs.createPrimitiveStoreBySchema; }
72
+ get: function () { return chunkPLT4CHNF_cjs.createPrimitiveStoreBySchema; }
56
73
  });
57
74
  Object.defineProperty(exports, "deepEqual", {
58
75
  enumerable: true,
59
- get: function () { return chunk7JWCZZPJ_cjs.deepEqual; }
76
+ get: function () { return chunkPLT4CHNF_cjs.deepEqual; }
60
77
  });
61
78
  Object.defineProperty(exports, "getDBJsonPathByJsonSchemaStore", {
62
79
  enumerable: true,
63
- get: function () { return chunk7JWCZZPJ_cjs.getDBJsonPathByJsonSchemaStore; }
80
+ get: function () { return chunkPLT4CHNF_cjs.getDBJsonPathByJsonSchemaStore; }
64
81
  });
65
82
  Object.defineProperty(exports, "getForeignKeyPatchesFromSchema", {
66
83
  enumerable: true,
67
- get: function () { return chunk7JWCZZPJ_cjs.getForeignKeyPatchesFromSchema; }
84
+ get: function () { return chunkPLT4CHNF_cjs.getForeignKeyPatchesFromSchema; }
68
85
  });
69
86
  Object.defineProperty(exports, "getForeignKeysFromSchema", {
70
87
  enumerable: true,
71
- get: function () { return chunk7JWCZZPJ_cjs.getForeignKeysFromSchema; }
88
+ get: function () { return chunkPLT4CHNF_cjs.getForeignKeysFromSchema; }
72
89
  });
73
90
  Object.defineProperty(exports, "getForeignKeysFromValue", {
74
91
  enumerable: true,
75
- get: function () { return chunk7JWCZZPJ_cjs.getForeignKeysFromValue; }
92
+ get: function () { return chunkPLT4CHNF_cjs.getForeignKeysFromValue; }
76
93
  });
77
94
  Object.defineProperty(exports, "getInvalidFieldNamesInSchema", {
78
95
  enumerable: true,
79
- get: function () { return chunk7JWCZZPJ_cjs.getInvalidFieldNamesInSchema; }
96
+ get: function () { return chunkPLT4CHNF_cjs.getInvalidFieldNamesInSchema; }
80
97
  });
81
98
  Object.defineProperty(exports, "getJsonSchemaStoreByPath", {
82
99
  enumerable: true,
83
- get: function () { return chunk7JWCZZPJ_cjs.getJsonSchemaStoreByPath; }
100
+ get: function () { return chunkPLT4CHNF_cjs.getJsonSchemaStoreByPath; }
84
101
  });
85
102
  Object.defineProperty(exports, "getJsonValueStoreByPath", {
86
103
  enumerable: true,
87
- get: function () { return chunk7JWCZZPJ_cjs.getJsonValueStoreByPath; }
104
+ get: function () { return chunkPLT4CHNF_cjs.getJsonValueStoreByPath; }
88
105
  });
89
106
  Object.defineProperty(exports, "getParentForPath", {
90
107
  enumerable: true,
91
- get: function () { return chunk7JWCZZPJ_cjs.getParentForPath; }
108
+ get: function () { return chunkPLT4CHNF_cjs.getParentForPath; }
92
109
  });
93
110
  Object.defineProperty(exports, "getPathByStore", {
94
111
  enumerable: true,
95
- get: function () { return chunk7JWCZZPJ_cjs.getPathByStore; }
112
+ get: function () { return chunkPLT4CHNF_cjs.getPathByStore; }
96
113
  });
97
114
  Object.defineProperty(exports, "getValueByPath", {
98
115
  enumerable: true,
99
- get: function () { return chunk7JWCZZPJ_cjs.getValueByPath; }
116
+ get: function () { return chunkPLT4CHNF_cjs.getValueByPath; }
100
117
  });
101
118
  Object.defineProperty(exports, "hasPath", {
102
119
  enumerable: true,
103
- get: function () { return chunk7JWCZZPJ_cjs.hasPath; }
120
+ get: function () { return chunkPLT4CHNF_cjs.hasPath; }
104
121
  });
105
122
  Object.defineProperty(exports, "parsePath", {
106
123
  enumerable: true,
107
- get: function () { return chunk7JWCZZPJ_cjs.parsePath; }
124
+ get: function () { return chunkPLT4CHNF_cjs.parsePath; }
108
125
  });
109
126
  Object.defineProperty(exports, "pluginRefs", {
110
127
  enumerable: true,
111
- get: function () { return chunk7JWCZZPJ_cjs.pluginRefs; }
128
+ get: function () { return chunkPLT4CHNF_cjs.pluginRefs; }
112
129
  });
113
130
  Object.defineProperty(exports, "replaceForeignKeyValue", {
114
131
  enumerable: true,
115
- get: function () { return chunk7JWCZZPJ_cjs.replaceForeignKeyValue; }
132
+ get: function () { return chunkPLT4CHNF_cjs.replaceForeignKeyValue; }
116
133
  });
117
134
  Object.defineProperty(exports, "resolveRefs", {
118
135
  enumerable: true,
119
- get: function () { return chunk7JWCZZPJ_cjs.resolveRefs; }
136
+ get: function () { return chunkPLT4CHNF_cjs.resolveRefs; }
120
137
  });
121
138
  Object.defineProperty(exports, "saveSharedFields", {
122
139
  enumerable: true,
123
- get: function () { return chunk7JWCZZPJ_cjs.saveSharedFields; }
140
+ get: function () { return chunkPLT4CHNF_cjs.saveSharedFields; }
124
141
  });
125
142
  Object.defineProperty(exports, "setValueByPath", {
126
143
  enumerable: true,
127
- get: function () { return chunk7JWCZZPJ_cjs.setValueByPath; }
144
+ get: function () { return chunkPLT4CHNF_cjs.setValueByPath; }
128
145
  });
129
146
  Object.defineProperty(exports, "traverseStore", {
130
147
  enumerable: true,
131
- get: function () { return chunk7JWCZZPJ_cjs.traverseStore; }
148
+ get: function () { return chunkPLT4CHNF_cjs.traverseStore; }
132
149
  });
133
150
  Object.defineProperty(exports, "traverseValue", {
134
151
  enumerable: true,
135
- get: function () { return chunk7JWCZZPJ_cjs.traverseValue; }
152
+ get: function () { return chunkPLT4CHNF_cjs.traverseValue; }
136
153
  });
137
154
  Object.defineProperty(exports, "validateJsonFieldName", {
138
155
  enumerable: true,
139
- get: function () { return chunk7JWCZZPJ_cjs.validateJsonFieldName; }
156
+ get: function () { return chunkPLT4CHNF_cjs.validateJsonFieldName; }
157
+ });
158
+ Object.defineProperty(exports, "validateRevisiumSchema", {
159
+ enumerable: true,
160
+ get: function () { return chunkPLT4CHNF_cjs.validateRevisiumSchema; }
140
161
  });
141
162
  Object.defineProperty(exports, "collectFormulaNodes", {
142
163
  enumerable: true,
@@ -100,4 +100,52 @@ declare const traverseValue: (store: JsonValueStore, callback: (node: JsonValueS
100
100
  declare const VALIDATE_JSON_FIELD_NAME_ERROR_MESSAGE = "It must contain between 1 and 64 characters, start with a letter or underscore (_), cannot start with two underscores (__), and can only include letters (a-z, A-Z), numbers (0-9), hyphens (-), and underscores (_).";
101
101
  declare const validateJsonFieldName: (id: string) => boolean;
102
102
 
103
- export { type GetForeignKeysFromValueType, type RefsType, type ReplaceForeignKeyValueOptions, SchemaTable, VALIDATE_JSON_FIELD_NAME_ERROR_MESSAGE, addSharedFieldsFromState, applyAddPatch, applyMovePatch, applyRemovePatch, applyReplacePatch, convertJsonPathToSchemaPath, convertSchemaPathToJsonPath, createJsonArrayValueStore, createJsonObjectSchemaStore, createJsonObjectValueStore, createJsonSchemaStore, createJsonValueStore, createPrimitiveStoreBySchema, createPrimitiveValueStore, deepEqual, getDBJsonPathByJsonSchemaStore, getForeignKeyPatchesFromSchema, getForeignKeysFromSchema, getForeignKeysFromValue, getInvalidFieldNamesInSchema, getJsonSchemaStoreByPath, getJsonValueStoreByPath, getParentForPath, getPathByStore, getValueByPath, hasPath, parsePath, pluginRefs, replaceForeignKeyValue, resolveRefs, saveSharedFields, setValueByPath, traverseStore, traverseValue, validateJsonFieldName };
103
+ interface MetaSchemaValidationResult {
104
+ valid: boolean;
105
+ errors?: string[];
106
+ }
107
+ declare const validateRevisiumSchema: (schema: JsonObjectSchema) => MetaSchemaValidationResult;
108
+
109
+ interface ValidationError {
110
+ instancePath: string;
111
+ message?: string;
112
+ keyword: string;
113
+ params: Record<string, unknown>;
114
+ }
115
+ interface ValidateFn {
116
+ (data: unknown): boolean;
117
+ errors: ValidationError[] | null;
118
+ }
119
+ declare class RevisiumValidator {
120
+ readonly validateMetaSchema: ValidateFn;
121
+ readonly validateJsonPatch: ValidateFn;
122
+ readonly validateMigrations: ValidateFn;
123
+ readonly validateHistoryPatches: ValidateFn;
124
+ readonly validateTableViews: ValidateFn;
125
+ private readonly ajv;
126
+ private readonly cache;
127
+ constructor();
128
+ compile(schema: unknown): ValidateFn;
129
+ }
130
+
131
+ interface SchemaWeight {
132
+ totalFields: number;
133
+ maxDepth: number;
134
+ fieldNames: number;
135
+ totalArrays: number;
136
+ maxArrayDepth: number;
137
+ }
138
+ declare const calculateSchemaWeight: (schema: JsonObjectSchema) => SchemaWeight;
139
+
140
+ interface DataWeight {
141
+ totalBytes: number;
142
+ totalNodes: number;
143
+ maxDepth: number;
144
+ maxArrayLength: number;
145
+ maxStringLength: number;
146
+ totalStringsLength: number;
147
+ }
148
+ declare const calculateDataWeight: (data: unknown) => DataWeight;
149
+ declare const calculateDataWeightFromStore: (store: JsonValueStore) => DataWeight;
150
+
151
+ export { type DataWeight, type GetForeignKeysFromValueType, type MetaSchemaValidationResult, type RefsType, type ReplaceForeignKeyValueOptions, RevisiumValidator, SchemaTable, type SchemaWeight, VALIDATE_JSON_FIELD_NAME_ERROR_MESSAGE, type ValidateFn, type ValidationError, addSharedFieldsFromState, applyAddPatch, applyMovePatch, applyRemovePatch, applyReplacePatch, calculateDataWeight, calculateDataWeightFromStore, calculateSchemaWeight, convertJsonPathToSchemaPath, convertSchemaPathToJsonPath, createJsonArrayValueStore, createJsonObjectSchemaStore, createJsonObjectValueStore, createJsonSchemaStore, createJsonValueStore, createPrimitiveStoreBySchema, createPrimitiveValueStore, deepEqual, getDBJsonPathByJsonSchemaStore, getForeignKeyPatchesFromSchema, getForeignKeysFromSchema, getForeignKeysFromValue, getInvalidFieldNamesInSchema, getJsonSchemaStoreByPath, getJsonValueStoreByPath, getParentForPath, getPathByStore, getValueByPath, hasPath, parsePath, pluginRefs, replaceForeignKeyValue, resolveRefs, saveSharedFields, setValueByPath, traverseStore, traverseValue, validateJsonFieldName, validateRevisiumSchema };
@@ -100,4 +100,52 @@ declare const traverseValue: (store: JsonValueStore, callback: (node: JsonValueS
100
100
  declare const VALIDATE_JSON_FIELD_NAME_ERROR_MESSAGE = "It must contain between 1 and 64 characters, start with a letter or underscore (_), cannot start with two underscores (__), and can only include letters (a-z, A-Z), numbers (0-9), hyphens (-), and underscores (_).";
101
101
  declare const validateJsonFieldName: (id: string) => boolean;
102
102
 
103
- export { type GetForeignKeysFromValueType, type RefsType, type ReplaceForeignKeyValueOptions, SchemaTable, VALIDATE_JSON_FIELD_NAME_ERROR_MESSAGE, addSharedFieldsFromState, applyAddPatch, applyMovePatch, applyRemovePatch, applyReplacePatch, convertJsonPathToSchemaPath, convertSchemaPathToJsonPath, createJsonArrayValueStore, createJsonObjectSchemaStore, createJsonObjectValueStore, createJsonSchemaStore, createJsonValueStore, createPrimitiveStoreBySchema, createPrimitiveValueStore, deepEqual, getDBJsonPathByJsonSchemaStore, getForeignKeyPatchesFromSchema, getForeignKeysFromSchema, getForeignKeysFromValue, getInvalidFieldNamesInSchema, getJsonSchemaStoreByPath, getJsonValueStoreByPath, getParentForPath, getPathByStore, getValueByPath, hasPath, parsePath, pluginRefs, replaceForeignKeyValue, resolveRefs, saveSharedFields, setValueByPath, traverseStore, traverseValue, validateJsonFieldName };
103
+ interface MetaSchemaValidationResult {
104
+ valid: boolean;
105
+ errors?: string[];
106
+ }
107
+ declare const validateRevisiumSchema: (schema: JsonObjectSchema) => MetaSchemaValidationResult;
108
+
109
+ interface ValidationError {
110
+ instancePath: string;
111
+ message?: string;
112
+ keyword: string;
113
+ params: Record<string, unknown>;
114
+ }
115
+ interface ValidateFn {
116
+ (data: unknown): boolean;
117
+ errors: ValidationError[] | null;
118
+ }
119
+ declare class RevisiumValidator {
120
+ readonly validateMetaSchema: ValidateFn;
121
+ readonly validateJsonPatch: ValidateFn;
122
+ readonly validateMigrations: ValidateFn;
123
+ readonly validateHistoryPatches: ValidateFn;
124
+ readonly validateTableViews: ValidateFn;
125
+ private readonly ajv;
126
+ private readonly cache;
127
+ constructor();
128
+ compile(schema: unknown): ValidateFn;
129
+ }
130
+
131
+ interface SchemaWeight {
132
+ totalFields: number;
133
+ maxDepth: number;
134
+ fieldNames: number;
135
+ totalArrays: number;
136
+ maxArrayDepth: number;
137
+ }
138
+ declare const calculateSchemaWeight: (schema: JsonObjectSchema) => SchemaWeight;
139
+
140
+ interface DataWeight {
141
+ totalBytes: number;
142
+ totalNodes: number;
143
+ maxDepth: number;
144
+ maxArrayLength: number;
145
+ maxStringLength: number;
146
+ totalStringsLength: number;
147
+ }
148
+ declare const calculateDataWeight: (data: unknown) => DataWeight;
149
+ declare const calculateDataWeightFromStore: (store: JsonValueStore) => DataWeight;
150
+
151
+ export { type DataWeight, type GetForeignKeysFromValueType, type MetaSchemaValidationResult, type RefsType, type ReplaceForeignKeyValueOptions, RevisiumValidator, SchemaTable, type SchemaWeight, VALIDATE_JSON_FIELD_NAME_ERROR_MESSAGE, type ValidateFn, type ValidationError, addSharedFieldsFromState, applyAddPatch, applyMovePatch, applyRemovePatch, applyReplacePatch, calculateDataWeight, calculateDataWeightFromStore, calculateSchemaWeight, convertJsonPathToSchemaPath, convertSchemaPathToJsonPath, createJsonArrayValueStore, createJsonObjectSchemaStore, createJsonObjectValueStore, createJsonSchemaStore, createJsonValueStore, createPrimitiveStoreBySchema, createPrimitiveValueStore, deepEqual, getDBJsonPathByJsonSchemaStore, getForeignKeyPatchesFromSchema, getForeignKeysFromSchema, getForeignKeysFromValue, getInvalidFieldNamesInSchema, getJsonSchemaStoreByPath, getJsonValueStoreByPath, getParentForPath, getPathByStore, getValueByPath, hasPath, parsePath, pluginRefs, replaceForeignKeyValue, resolveRefs, saveSharedFields, setValueByPath, traverseStore, traverseValue, validateJsonFieldName, validateRevisiumSchema };
package/dist/lib/index.js CHANGED
@@ -1,7 +1,8 @@
1
- export { SchemaTable, VALIDATE_JSON_FIELD_NAME_ERROR_MESSAGE, applyAddPatch, applyMovePatch, applyRemovePatch, applyReplacePatch, convertJsonPathToSchemaPath, convertSchemaPathToJsonPath, createJsonObjectSchemaStore, createJsonSchemaStore, createPrimitiveStoreBySchema, deepEqual, getDBJsonPathByJsonSchemaStore, getForeignKeyPatchesFromSchema, getForeignKeysFromSchema, getForeignKeysFromValue, getInvalidFieldNamesInSchema, getJsonSchemaStoreByPath, getJsonValueStoreByPath, getParentForPath, getPathByStore, getValueByPath, hasPath, parsePath, pluginRefs, replaceForeignKeyValue, resolveRefs, saveSharedFields, setValueByPath, traverseStore, traverseValue, validateJsonFieldName } from '../chunk-JLXX3SGF.js';
1
+ export { RevisiumValidator, SchemaTable, VALIDATE_JSON_FIELD_NAME_ERROR_MESSAGE, applyAddPatch, applyMovePatch, applyRemovePatch, applyReplacePatch, calculateDataWeight, calculateDataWeightFromStore, calculateSchemaWeight, convertJsonPathToSchemaPath, convertSchemaPathToJsonPath, createJsonObjectSchemaStore, createJsonSchemaStore, createPrimitiveStoreBySchema, deepEqual, getDBJsonPathByJsonSchemaStore, getForeignKeyPatchesFromSchema, getForeignKeysFromSchema, getForeignKeysFromValue, getInvalidFieldNamesInSchema, getJsonSchemaStoreByPath, getJsonValueStoreByPath, getParentForPath, getPathByStore, getValueByPath, hasPath, parsePath, pluginRefs, replaceForeignKeyValue, resolveRefs, saveSharedFields, setValueByPath, traverseStore, traverseValue, validateJsonFieldName, validateRevisiumSchema } from '../chunk-YHRQOWWO.js';
2
2
  export { collectFormulaNodes, evaluateFormulas, extractSchemaFormulas, formulaSpec, validateFormulaAgainstSchema, validateSchemaFormulas } from '../chunk-GJM63Q4K.js';
3
3
  export { computeValueDiff } from '../chunk-7PEC6ZYY.js';
4
4
  import '../chunk-ZPRBA4AQ.js';
5
5
  import '../chunk-4U2RZHMX.js';
6
6
  import '../chunk-5DUMJHCA.js';
7
7
  export { addSharedFieldsFromState, createJsonArrayValueStore, createJsonObjectValueStore, createJsonValueStore, createPrimitiveValueStore } from '../chunk-FTBRJODD.js';
8
+ import '../chunk-6IMYMTFF.js';
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- var chunkDN2C3T5D_cjs = require('../chunk-DN2C3T5D.cjs');
3
+ var chunkJHNATNUI_cjs = require('../chunk-JHNATNUI.cjs');
4
4
  var chunkPJ5OFCLO_cjs = require('../chunk-PJ5OFCLO.cjs');
5
5
  require('../chunk-2PIMJSWJ.cjs');
6
6
  var chunkONW2OVNQ_cjs = require('../chunk-ONW2OVNQ.cjs');
@@ -9,183 +9,183 @@ var chunkONW2OVNQ_cjs = require('../chunk-ONW2OVNQ.cjs');
9
9
 
10
10
  Object.defineProperty(exports, "ArrayToItemsTypeTransformer", {
11
11
  enumerable: true,
12
- get: function () { return chunkDN2C3T5D_cjs.ArrayToItemsTypeTransformer; }
12
+ get: function () { return chunkJHNATNUI_cjs.ArrayToItemsTypeTransformer; }
13
13
  });
14
14
  Object.defineProperty(exports, "ArrayValueNode", {
15
15
  enumerable: true,
16
- get: function () { return chunkDN2C3T5D_cjs.ArrayValueNode; }
16
+ get: function () { return chunkJHNATNUI_cjs.ArrayValueNode; }
17
17
  });
18
18
  Object.defineProperty(exports, "BasePrimitiveValueNode", {
19
19
  enumerable: true,
20
- get: function () { return chunkDN2C3T5D_cjs.BasePrimitiveValueNode; }
20
+ get: function () { return chunkJHNATNUI_cjs.BasePrimitiveValueNode; }
21
21
  });
22
22
  Object.defineProperty(exports, "BaseValueNode", {
23
23
  enumerable: true,
24
- get: function () { return chunkDN2C3T5D_cjs.BaseValueNode; }
24
+ get: function () { return chunkJHNATNUI_cjs.BaseValueNode; }
25
25
  });
26
26
  Object.defineProperty(exports, "BooleanValueNode", {
27
27
  enumerable: true,
28
- get: function () { return chunkDN2C3T5D_cjs.BooleanValueNode; }
28
+ get: function () { return chunkJHNATNUI_cjs.BooleanValueNode; }
29
29
  });
30
30
  Object.defineProperty(exports, "DataModelImpl", {
31
31
  enumerable: true,
32
- get: function () { return chunkDN2C3T5D_cjs.DataModelImpl; }
32
+ get: function () { return chunkJHNATNUI_cjs.DataModelImpl; }
33
33
  });
34
34
  Object.defineProperty(exports, "DefaultTransformer", {
35
35
  enumerable: true,
36
- get: function () { return chunkDN2C3T5D_cjs.DefaultTransformer; }
36
+ get: function () { return chunkJHNATNUI_cjs.DefaultTransformer; }
37
37
  });
38
38
  Object.defineProperty(exports, "ForeignKeyNotFoundError", {
39
39
  enumerable: true,
40
- get: function () { return chunkDN2C3T5D_cjs.ForeignKeyNotFoundError; }
40
+ get: function () { return chunkJHNATNUI_cjs.ForeignKeyNotFoundError; }
41
41
  });
42
42
  Object.defineProperty(exports, "ForeignKeyResolverImpl", {
43
43
  enumerable: true,
44
- get: function () { return chunkDN2C3T5D_cjs.ForeignKeyResolverImpl; }
44
+ get: function () { return chunkJHNATNUI_cjs.ForeignKeyResolverImpl; }
45
45
  });
46
46
  Object.defineProperty(exports, "ForeignKeyResolverNotConfiguredError", {
47
47
  enumerable: true,
48
- get: function () { return chunkDN2C3T5D_cjs.ForeignKeyResolverNotConfiguredError; }
48
+ get: function () { return chunkJHNATNUI_cjs.ForeignKeyResolverNotConfiguredError; }
49
49
  });
50
50
  Object.defineProperty(exports, "ForeignKeyValueNodeImpl", {
51
51
  enumerable: true,
52
- get: function () { return chunkDN2C3T5D_cjs.ForeignKeyValueNodeImpl; }
52
+ get: function () { return chunkJHNATNUI_cjs.ForeignKeyValueNodeImpl; }
53
53
  });
54
54
  Object.defineProperty(exports, "FormulaChangeDetector", {
55
55
  enumerable: true,
56
- get: function () { return chunkDN2C3T5D_cjs.FormulaChangeDetector; }
56
+ get: function () { return chunkJHNATNUI_cjs.FormulaChangeDetector; }
57
57
  });
58
58
  Object.defineProperty(exports, "FormulaDependencyIndex", {
59
59
  enumerable: true,
60
- get: function () { return chunkDN2C3T5D_cjs.FormulaDependencyIndex; }
60
+ get: function () { return chunkJHNATNUI_cjs.FormulaDependencyIndex; }
61
61
  });
62
62
  Object.defineProperty(exports, "FormulaPath", {
63
63
  enumerable: true,
64
- get: function () { return chunkDN2C3T5D_cjs.FormulaPath; }
64
+ get: function () { return chunkJHNATNUI_cjs.FormulaPath; }
65
65
  });
66
66
  Object.defineProperty(exports, "NodeFactory", {
67
67
  enumerable: true,
68
- get: function () { return chunkDN2C3T5D_cjs.NodeFactory; }
68
+ get: function () { return chunkJHNATNUI_cjs.NodeFactory; }
69
69
  });
70
70
  Object.defineProperty(exports, "NodeFactoryRegistry", {
71
71
  enumerable: true,
72
- get: function () { return chunkDN2C3T5D_cjs.NodeFactoryRegistry; }
72
+ get: function () { return chunkJHNATNUI_cjs.NodeFactoryRegistry; }
73
73
  });
74
74
  Object.defineProperty(exports, "NumberValueNode", {
75
75
  enumerable: true,
76
- get: function () { return chunkDN2C3T5D_cjs.NumberValueNode; }
76
+ get: function () { return chunkJHNATNUI_cjs.NumberValueNode; }
77
77
  });
78
78
  Object.defineProperty(exports, "ObjectToArrayTransformer", {
79
79
  enumerable: true,
80
- get: function () { return chunkDN2C3T5D_cjs.ObjectToArrayTransformer; }
80
+ get: function () { return chunkJHNATNUI_cjs.ObjectToArrayTransformer; }
81
81
  });
82
82
  Object.defineProperty(exports, "ObjectValueNode", {
83
83
  enumerable: true,
84
- get: function () { return chunkDN2C3T5D_cjs.ObjectValueNode; }
84
+ get: function () { return chunkJHNATNUI_cjs.ObjectValueNode; }
85
85
  });
86
86
  Object.defineProperty(exports, "ParsedFormula", {
87
87
  enumerable: true,
88
- get: function () { return chunkDN2C3T5D_cjs.ParsedFormula; }
88
+ get: function () { return chunkJHNATNUI_cjs.ParsedFormula; }
89
89
  });
90
90
  Object.defineProperty(exports, "PrimitiveToArrayTransformer", {
91
91
  enumerable: true,
92
- get: function () { return chunkDN2C3T5D_cjs.PrimitiveToArrayTransformer; }
92
+ get: function () { return chunkJHNATNUI_cjs.PrimitiveToArrayTransformer; }
93
93
  });
94
94
  Object.defineProperty(exports, "RefTransformer", {
95
95
  enumerable: true,
96
- get: function () { return chunkDN2C3T5D_cjs.RefTransformer; }
96
+ get: function () { return chunkJHNATNUI_cjs.RefTransformer; }
97
97
  });
98
98
  Object.defineProperty(exports, "RowModelImpl", {
99
99
  enumerable: true,
100
- get: function () { return chunkDN2C3T5D_cjs.RowModelImpl; }
100
+ get: function () { return chunkJHNATNUI_cjs.RowModelImpl; }
101
101
  });
102
102
  Object.defineProperty(exports, "SchemaParser", {
103
103
  enumerable: true,
104
- get: function () { return chunkDN2C3T5D_cjs.SchemaParser; }
104
+ get: function () { return chunkJHNATNUI_cjs.SchemaParser; }
105
105
  });
106
106
  Object.defineProperty(exports, "StringValueNode", {
107
107
  enumerable: true,
108
- get: function () { return chunkDN2C3T5D_cjs.StringValueNode; }
108
+ get: function () { return chunkJHNATNUI_cjs.StringValueNode; }
109
109
  });
110
110
  Object.defineProperty(exports, "TableModelImpl", {
111
111
  enumerable: true,
112
- get: function () { return chunkDN2C3T5D_cjs.TableModelImpl; }
112
+ get: function () { return chunkJHNATNUI_cjs.TableModelImpl; }
113
113
  });
114
114
  Object.defineProperty(exports, "TypeTransformChain", {
115
115
  enumerable: true,
116
- get: function () { return chunkDN2C3T5D_cjs.TypeTransformChain; }
116
+ get: function () { return chunkJHNATNUI_cjs.TypeTransformChain; }
117
117
  });
118
118
  Object.defineProperty(exports, "ValueNodeFactory", {
119
119
  enumerable: true,
120
- get: function () { return chunkDN2C3T5D_cjs.NodeFactory2; }
120
+ get: function () { return chunkJHNATNUI_cjs.NodeFactory2; }
121
121
  });
122
122
  Object.defineProperty(exports, "ValueTree", {
123
123
  enumerable: true,
124
- get: function () { return chunkDN2C3T5D_cjs.ValueTree; }
124
+ get: function () { return chunkJHNATNUI_cjs.ValueTree; }
125
125
  });
126
126
  Object.defineProperty(exports, "ValueType", {
127
127
  enumerable: true,
128
- get: function () { return chunkDN2C3T5D_cjs.ValueType; }
128
+ get: function () { return chunkJHNATNUI_cjs.ValueType; }
129
129
  });
130
130
  Object.defineProperty(exports, "createDataModel", {
131
131
  enumerable: true,
132
- get: function () { return chunkDN2C3T5D_cjs.createDataModel; }
132
+ get: function () { return chunkJHNATNUI_cjs.createDataModel; }
133
133
  });
134
134
  Object.defineProperty(exports, "createDefaultRegistry", {
135
135
  enumerable: true,
136
- get: function () { return chunkDN2C3T5D_cjs.createDefaultRegistry; }
136
+ get: function () { return chunkJHNATNUI_cjs.createDefaultRegistry; }
137
137
  });
138
138
  Object.defineProperty(exports, "createForeignKeyResolver", {
139
139
  enumerable: true,
140
- get: function () { return chunkDN2C3T5D_cjs.createForeignKeyResolver; }
140
+ get: function () { return chunkJHNATNUI_cjs.createForeignKeyResolver; }
141
141
  });
142
142
  Object.defineProperty(exports, "createNodeFactory", {
143
143
  enumerable: true,
144
- get: function () { return chunkDN2C3T5D_cjs.createNodeFactory; }
144
+ get: function () { return chunkJHNATNUI_cjs.createNodeFactory; }
145
145
  });
146
146
  Object.defineProperty(exports, "createRowModel", {
147
147
  enumerable: true,
148
- get: function () { return chunkDN2C3T5D_cjs.createRowModel; }
148
+ get: function () { return chunkJHNATNUI_cjs.createRowModel; }
149
149
  });
150
150
  Object.defineProperty(exports, "createSchemaModel", {
151
151
  enumerable: true,
152
- get: function () { return chunkDN2C3T5D_cjs.createSchemaModel; }
152
+ get: function () { return chunkJHNATNUI_cjs.createSchemaModel; }
153
153
  });
154
154
  Object.defineProperty(exports, "createTableModel", {
155
155
  enumerable: true,
156
- get: function () { return chunkDN2C3T5D_cjs.createTableModel; }
156
+ get: function () { return chunkJHNATNUI_cjs.createTableModel; }
157
157
  });
158
158
  Object.defineProperty(exports, "createTypeTransformChain", {
159
159
  enumerable: true,
160
- get: function () { return chunkDN2C3T5D_cjs.createTypeTransformChain; }
160
+ get: function () { return chunkJHNATNUI_cjs.createTypeTransformChain; }
161
161
  });
162
162
  Object.defineProperty(exports, "createTypedTree", {
163
163
  enumerable: true,
164
- get: function () { return chunkDN2C3T5D_cjs.createTypedTree; }
164
+ get: function () { return chunkJHNATNUI_cjs.createTypedTree; }
165
165
  });
166
166
  Object.defineProperty(exports, "extractFormulaDefinition", {
167
167
  enumerable: true,
168
- get: function () { return chunkDN2C3T5D_cjs.extractFormulaDefinition; }
168
+ get: function () { return chunkJHNATNUI_cjs.extractFormulaDefinition; }
169
169
  });
170
170
  Object.defineProperty(exports, "generateDefaultValue", {
171
171
  enumerable: true,
172
- get: function () { return chunkDN2C3T5D_cjs.generateDefaultValue; }
172
+ get: function () { return chunkJHNATNUI_cjs.generateDefaultValue; }
173
173
  });
174
174
  Object.defineProperty(exports, "generateNodeId", {
175
175
  enumerable: true,
176
- get: function () { return chunkDN2C3T5D_cjs.generateNodeId; }
176
+ get: function () { return chunkJHNATNUI_cjs.generateNodeId; }
177
177
  });
178
178
  Object.defineProperty(exports, "isForeignKeyValueNode", {
179
179
  enumerable: true,
180
- get: function () { return chunkDN2C3T5D_cjs.isForeignKeyValueNode; }
180
+ get: function () { return chunkJHNATNUI_cjs.isForeignKeyValueNode; }
181
181
  });
182
182
  Object.defineProperty(exports, "resetNodeIdCounter", {
183
183
  enumerable: true,
184
- get: function () { return chunkDN2C3T5D_cjs.resetNodeIdCounter; }
184
+ get: function () { return chunkJHNATNUI_cjs.resetNodeIdCounter; }
185
185
  });
186
186
  Object.defineProperty(exports, "typedNode", {
187
187
  enumerable: true,
188
- get: function () { return chunkDN2C3T5D_cjs.typedNode; }
188
+ get: function () { return chunkJHNATNUI_cjs.typedNode; }
189
189
  });
190
190
  Object.defineProperty(exports, "FormulaPathBuilder", {
191
191
  enumerable: true,
@@ -1,7 +1,7 @@
1
1
  import { h as JsonSchemaStore } from '../json-string.store-cAOADo23.cjs';
2
2
  export { A as AddedPropertyEvent, C as ChangeNameEvent, f as JsonArrayStore, m as JsonArrayValueStore, b as JsonBooleanStore, k as JsonBooleanValueStore, a as JsonNumberStore, j as JsonNumberValueStore, c as JsonObjectStore, l as JsonObjectValueStore, g as JsonSchemaStorePrimitives, J as JsonStringStore, i as JsonStringValueStore, p as JsonValueStore, o as JsonValueStoreParent, n as JsonValueStorePrimitives, d as MigrateItemsEvent, M as MigratePropertyEvent, R as RemovedPropertyEvent, e as ReplaceItemsEvent } from '../json-string.store-cAOADo23.cjs';
3
- import { a3 as RefSchemas, Y as TypeTransformer, E as FieldTypeSpec, _ as TransformResult, Z as TransformContext, M as RowData, H as SchemaModelOptions, B as SchemaModel, C as FieldType, Q as RowModel, S as SchemaPaths, N as NodeAtPath, V as ValueAtPath, I as InferValue, U as RowModelOptions, z as ValueTreeLike, W as TableModelLike, q as ValueNode, d as JsonValuePatch, L as TableModelOptions, K as TableModel, X as ForeignKeyResolver, R as RefSchemas$1, l as ValueType, a4 as NodeChangeListener, a5 as NodeChangeEvent, O as ObjectValueNode$1, A as ArrayValueNode$1, P as PrimitiveValueNode, r as FormulaWarning, F as FormulaDefinition, y as NodeFactory$1, a6 as ValuePath, a7 as Change, x as NodeFactoryOptions, g as InferNode } from '../typed-DjSH_5Vh.cjs';
4
- export { v as ArrayNodeOptions, a2 as CompositeTypeName, D as DirtyTrackable, $ as FieldSchemaSpec, w as NodeFactoryFn, n as NodeFactoryRegistry, u as ObjectNodeOptions, t as PrimitiveNodeOptions, a1 as PrimitiveTypeName, G as ReplaceResult, a0 as SimpleFieldType, s as ValueNodeOptions, p as createDefaultRegistry, o as createNodeFactory, m as extractFormulaDefinition } from '../typed-DjSH_5Vh.cjs';
3
+ import { a3 as RefSchemas, Y as TypeTransformer, E as FieldTypeSpec, _ as TransformResult, Z as TransformContext, M as RowData, H as SchemaModelOptions, B as SchemaModel, C as FieldType, Q as RowModel, g as InferNode, S as SchemaPaths, N as NodeAtPath, V as ValueAtPath, I as InferValue, U as RowModelOptions, z as ValueTreeLike, R as RefSchemas$1, W as TableModelLike, q as ValueNode, d as JsonValuePatch, L as TableModelOptions, K as TableModel, X as ForeignKeyResolver, l as ValueType, a4 as NodeChangeListener, a5 as NodeChangeEvent, O as ObjectValueNode$1, A as ArrayValueNode$1, P as PrimitiveValueNode, r as FormulaWarning, F as FormulaDefinition, y as NodeFactory$1, a6 as ValuePath, a7 as Change, x as NodeFactoryOptions } from '../typed-C0YM-ar9.cjs';
4
+ export { v as ArrayNodeOptions, a2 as CompositeTypeName, D as DirtyTrackable, $ as FieldSchemaSpec, w as NodeFactoryFn, n as NodeFactoryRegistry, u as ObjectNodeOptions, t as PrimitiveNodeOptions, a1 as PrimitiveTypeName, G as ReplaceResult, a0 as SimpleFieldType, s as ValueNodeOptions, p as createDefaultRegistry, o as createNodeFactory, m as extractFormulaDefinition } from '../typed-C0YM-ar9.cjs';
5
5
  import { g as JsonObjectSchema, j as JsonSchema } from '../schema.types-On_VGw2m.cjs';
6
6
  import { j as SchemaNode, T as TreeFormulaValidationError, D as Diagnostic, o as Formula, F as FormulaDependency, P as Path } from '../types-BIvIURgy.cjs';
7
7
  export { R as ResolvedDependency } from '../types-BIvIURgy.cjs';
@@ -112,10 +112,12 @@ declare class NodeFactory {
112
112
  }
113
113
 
114
114
  interface TypedRowModel<S> extends RowModel {
115
+ readonly root: InferNode<S>;
115
116
  get<P extends SchemaPaths<S>>(path: P): NodeAtPath<S, P>;
116
117
  getValue<P extends SchemaPaths<S>>(path: P): ValueAtPath<S, P>;
117
118
  setValue<P extends SchemaPaths<S>>(path: P, value: ValueAtPath<S, P>): void;
118
119
  getPlainValue(): InferValue<S>;
120
+ reset(data?: InferValue<S>): void;
119
121
  }
120
122
  interface TypedRowModelOptions<S extends JsonSchema> extends Omit<RowModelOptions, 'schema' | 'data'> {
121
123
  schema: S;
@@ -125,11 +127,14 @@ interface TypedRowModelOptions<S extends JsonSchema> extends Omit<RowModelOption
125
127
  declare class RowModelImpl implements RowModel {
126
128
  private readonly _rowId;
127
129
  private readonly _tree;
130
+ private readonly _schema;
131
+ private readonly _refSchemas?;
128
132
  private _tableModel;
129
- constructor(_rowId: string, _tree: ValueTreeLike);
133
+ constructor(_rowId: string, _tree: ValueTreeLike, _schema: JsonSchema, _refSchemas?: RefSchemas$1 | undefined);
130
134
  get rowId(): string;
131
135
  get tableModel(): TableModelLike | null;
132
136
  get tree(): ValueTreeLike;
137
+ get root(): ValueNode;
133
138
  get index(): number;
134
139
  get prev(): RowModel | null;
135
140
  get next(): RowModel | null;
@@ -144,6 +149,7 @@ declare class RowModelImpl implements RowModel {
144
149
  get patches(): readonly JsonValuePatch[];
145
150
  commit(): void;
146
151
  revert(): void;
152
+ reset(data?: unknown): void;
147
153
  dispose(): void;
148
154
  setTableModel(tableModel: TableModelLike | null): void;
149
155
  }
@@ -466,6 +472,8 @@ declare class ArrayValueNode extends BaseValueNode implements ArrayValueNode$1 {
466
472
  get length(): number;
467
473
  getPlainValue(): unknown[];
468
474
  at(index: number): ValueNode | undefined;
475
+ find(predicate: (node: ValueNode, index: number) => boolean): ValueNode | undefined;
476
+ findIndex(predicate: (node: ValueNode, index: number) => boolean): number;
469
477
  push(node: ValueNode): void;
470
478
  insertAt(index: number, node: ValueNode): void;
471
479
  removeAt(index: number): void;