@object-ui/core 0.3.1 → 2.0.0

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.
Files changed (118) hide show
  1. package/.turbo/turbo-build.log +4 -0
  2. package/CHANGELOG.md +11 -0
  3. package/dist/actions/ActionRunner.d.ts +228 -4
  4. package/dist/actions/ActionRunner.js +397 -45
  5. package/dist/actions/TransactionManager.d.ts +193 -0
  6. package/dist/actions/TransactionManager.js +410 -0
  7. package/dist/actions/index.d.ts +2 -1
  8. package/dist/actions/index.js +2 -1
  9. package/dist/adapters/ApiDataSource.d.ts +69 -0
  10. package/dist/adapters/ApiDataSource.js +293 -0
  11. package/dist/adapters/ValueDataSource.d.ts +55 -0
  12. package/dist/adapters/ValueDataSource.js +287 -0
  13. package/dist/adapters/index.d.ts +3 -0
  14. package/dist/adapters/index.js +5 -2
  15. package/dist/adapters/resolveDataSource.d.ts +40 -0
  16. package/dist/adapters/resolveDataSource.js +59 -0
  17. package/dist/data-scope/DataScopeManager.d.ts +127 -0
  18. package/dist/data-scope/DataScopeManager.js +229 -0
  19. package/dist/data-scope/index.d.ts +10 -0
  20. package/dist/data-scope/index.js +10 -0
  21. package/dist/evaluator/ExpressionCache.d.ts +101 -0
  22. package/dist/evaluator/ExpressionCache.js +135 -0
  23. package/dist/evaluator/ExpressionEvaluator.d.ts +30 -2
  24. package/dist/evaluator/ExpressionEvaluator.js +60 -16
  25. package/dist/evaluator/FormulaFunctions.d.ts +58 -0
  26. package/dist/evaluator/FormulaFunctions.js +350 -0
  27. package/dist/evaluator/index.d.ts +4 -2
  28. package/dist/evaluator/index.js +4 -2
  29. package/dist/index.d.ts +14 -7
  30. package/dist/index.js +13 -9
  31. package/dist/query/index.d.ts +6 -0
  32. package/dist/query/index.js +6 -0
  33. package/dist/query/query-ast.d.ts +32 -0
  34. package/dist/query/query-ast.js +268 -0
  35. package/dist/registry/PluginScopeImpl.d.ts +80 -0
  36. package/dist/registry/PluginScopeImpl.js +243 -0
  37. package/dist/registry/PluginSystem.d.ts +66 -0
  38. package/dist/registry/PluginSystem.js +142 -0
  39. package/dist/registry/Registry.d.ts +83 -4
  40. package/dist/registry/Registry.js +113 -7
  41. package/dist/registry/WidgetRegistry.d.ts +120 -0
  42. package/dist/registry/WidgetRegistry.js +275 -0
  43. package/dist/theme/ThemeEngine.d.ts +82 -0
  44. package/dist/theme/ThemeEngine.js +400 -0
  45. package/dist/theme/index.d.ts +8 -0
  46. package/dist/theme/index.js +8 -0
  47. package/dist/validation/index.d.ts +9 -0
  48. package/dist/validation/index.js +9 -0
  49. package/dist/validation/validation-engine.d.ts +88 -0
  50. package/dist/validation/validation-engine.js +428 -0
  51. package/dist/validation/validators/index.d.ts +16 -0
  52. package/dist/validation/validators/index.js +16 -0
  53. package/dist/validation/validators/object-validation-engine.d.ts +118 -0
  54. package/dist/validation/validators/object-validation-engine.js +538 -0
  55. package/package.json +14 -5
  56. package/src/actions/ActionRunner.ts +577 -55
  57. package/src/actions/TransactionManager.ts +521 -0
  58. package/src/actions/__tests__/ActionRunner.params.test.ts +134 -0
  59. package/src/actions/__tests__/ActionRunner.test.ts +711 -0
  60. package/src/actions/__tests__/TransactionManager.test.ts +447 -0
  61. package/src/actions/index.ts +2 -1
  62. package/src/adapters/ApiDataSource.ts +349 -0
  63. package/src/adapters/ValueDataSource.ts +332 -0
  64. package/src/adapters/__tests__/ApiDataSource.test.ts +418 -0
  65. package/src/adapters/__tests__/ValueDataSource.test.ts +325 -0
  66. package/src/adapters/__tests__/resolveDataSource.test.ts +144 -0
  67. package/src/adapters/index.ts +6 -1
  68. package/src/adapters/resolveDataSource.ts +79 -0
  69. package/src/builder/__tests__/schema-builder.test.ts +235 -0
  70. package/src/data-scope/DataScopeManager.ts +269 -0
  71. package/src/data-scope/__tests__/DataScopeManager.test.ts +211 -0
  72. package/src/data-scope/index.ts +16 -0
  73. package/src/evaluator/ExpressionCache.ts +192 -0
  74. package/src/evaluator/ExpressionEvaluator.ts +61 -16
  75. package/src/evaluator/FormulaFunctions.ts +398 -0
  76. package/src/evaluator/__tests__/ExpressionCache.test.ts +135 -0
  77. package/src/evaluator/__tests__/ExpressionContext.test.ts +110 -0
  78. package/src/evaluator/__tests__/FormulaFunctions.test.ts +447 -0
  79. package/src/evaluator/index.ts +4 -2
  80. package/src/index.ts +14 -10
  81. package/src/query/__tests__/query-ast.test.ts +211 -0
  82. package/src/query/__tests__/window-functions.test.ts +275 -0
  83. package/src/query/index.ts +7 -0
  84. package/src/query/query-ast.ts +341 -0
  85. package/src/registry/PluginScopeImpl.ts +259 -0
  86. package/src/registry/PluginSystem.ts +161 -0
  87. package/src/registry/Registry.ts +136 -8
  88. package/src/registry/WidgetRegistry.ts +316 -0
  89. package/src/registry/__tests__/PluginSystem.test.ts +226 -0
  90. package/src/registry/__tests__/Registry.test.ts +293 -0
  91. package/src/registry/__tests__/WidgetRegistry.test.ts +321 -0
  92. package/src/registry/__tests__/plugin-scope-integration.test.ts +283 -0
  93. package/src/theme/ThemeEngine.ts +452 -0
  94. package/src/theme/__tests__/ThemeEngine.test.ts +606 -0
  95. package/src/theme/index.ts +22 -0
  96. package/src/validation/__tests__/object-validation-engine.test.ts +567 -0
  97. package/src/validation/__tests__/schema-validator.test.ts +118 -0
  98. package/src/validation/__tests__/validation-engine.test.ts +102 -0
  99. package/src/validation/index.ts +10 -0
  100. package/src/validation/validation-engine.ts +520 -0
  101. package/src/validation/validators/index.ts +25 -0
  102. package/src/validation/validators/object-validation-engine.ts +722 -0
  103. package/tsconfig.tsbuildinfo +1 -1
  104. package/vitest.config.ts +2 -0
  105. package/src/adapters/index.d.ts +0 -8
  106. package/src/adapters/index.js +0 -10
  107. package/src/builder/schema-builder.d.ts +0 -294
  108. package/src/builder/schema-builder.js +0 -503
  109. package/src/index.d.ts +0 -13
  110. package/src/index.js +0 -16
  111. package/src/registry/Registry.d.ts +0 -56
  112. package/src/registry/Registry.js +0 -43
  113. package/src/types/index.d.ts +0 -19
  114. package/src/types/index.js +0 -8
  115. package/src/utils/filter-converter.d.ts +0 -57
  116. package/src/utils/filter-converter.js +0 -100
  117. package/src/validation/schema-validator.d.ts +0 -94
  118. package/src/validation/schema-validator.js +0 -278
@@ -0,0 +1,428 @@
1
+ /**
2
+ * ObjectUI
3
+ * Copyright (c) 2024-present ObjectStack Inc.
4
+ *
5
+ * This source code is licensed under the MIT license found in the
6
+ * LICENSE file in the root directory of this source tree.
7
+ */
8
+ /**
9
+ * Validation Engine - Executes validation rules
10
+ */
11
+ export class ValidationEngine {
12
+ constructor() {
13
+ Object.defineProperty(this, "customValidators", {
14
+ enumerable: true,
15
+ configurable: true,
16
+ writable: true,
17
+ value: new Map()
18
+ });
19
+ Object.defineProperty(this, "customAsyncValidators", {
20
+ enumerable: true,
21
+ configurable: true,
22
+ writable: true,
23
+ value: new Map()
24
+ });
25
+ }
26
+ /**
27
+ * Register a custom synchronous validator by name
28
+ */
29
+ registerValidator(name, fn) {
30
+ this.customValidators.set(name, fn);
31
+ }
32
+ /**
33
+ * Register a custom asynchronous validator by name
34
+ */
35
+ registerAsyncValidator(name, fn) {
36
+ this.customAsyncValidators.set(name, fn);
37
+ }
38
+ /**
39
+ * Check if a custom validator is registered
40
+ */
41
+ hasValidator(name) {
42
+ return this.customValidators.has(name) || this.customAsyncValidators.has(name);
43
+ }
44
+ /**
45
+ * Get all registered custom validator names
46
+ */
47
+ getValidatorNames() {
48
+ return [
49
+ ...Array.from(this.customValidators.keys()),
50
+ ...Array.from(this.customAsyncValidators.keys()),
51
+ ];
52
+ }
53
+ /**
54
+ * Validate a value against validation schema
55
+ */
56
+ async validate(value, schema, context) {
57
+ const errors = [];
58
+ const warnings = [];
59
+ for (const rule of schema.rules) {
60
+ const result = await this.validateRule(value, rule, context);
61
+ if (result) {
62
+ const error = {
63
+ field: schema.field || 'unknown',
64
+ message: result,
65
+ code: rule.type,
66
+ rule: rule.type,
67
+ severity: rule.severity || 'error',
68
+ };
69
+ if (rule.severity === 'warning' || rule.severity === 'info') {
70
+ warnings.push(error);
71
+ }
72
+ else {
73
+ errors.push(error);
74
+ }
75
+ }
76
+ }
77
+ return {
78
+ valid: errors.length === 0,
79
+ errors,
80
+ warnings,
81
+ };
82
+ }
83
+ /**
84
+ * Validate a single rule
85
+ */
86
+ async validateRule(value, rule, context) {
87
+ // Custom async validator (inline)
88
+ if (rule.async_validator) {
89
+ const result = await rule.async_validator(value, context);
90
+ if (result === false) {
91
+ return rule.message || 'Async validation failed';
92
+ }
93
+ if (typeof result === 'string') {
94
+ return result;
95
+ }
96
+ return null;
97
+ }
98
+ // Custom sync validator (inline)
99
+ if (rule.validator) {
100
+ const result = rule.validator(value, context);
101
+ if (result === false) {
102
+ return rule.message || 'Validation failed';
103
+ }
104
+ if (typeof result === 'string') {
105
+ return result;
106
+ }
107
+ return null;
108
+ }
109
+ // Registered custom async validator (by name)
110
+ const registeredAsync = this.customAsyncValidators.get(rule.type);
111
+ if (registeredAsync) {
112
+ const result = await registeredAsync(value, context);
113
+ if (result === false) {
114
+ return rule.message || 'Async validation failed';
115
+ }
116
+ if (typeof result === 'string') {
117
+ return result;
118
+ }
119
+ return null;
120
+ }
121
+ // Registered custom sync validator (by name)
122
+ const registeredSync = this.customValidators.get(rule.type);
123
+ if (registeredSync) {
124
+ const result = registeredSync(value, context);
125
+ if (result === false) {
126
+ return rule.message || 'Validation failed';
127
+ }
128
+ if (typeof result === 'string') {
129
+ return result;
130
+ }
131
+ return null;
132
+ }
133
+ // Built-in validators
134
+ return this.validateBuiltInRule(value, rule, context);
135
+ }
136
+ /**
137
+ * Validate built-in rules
138
+ */
139
+ async validateBuiltInRule(value, rule, context) {
140
+ const { type, params, message } = rule;
141
+ switch (type) {
142
+ case 'required':
143
+ if (value === null || value === undefined || value === '') {
144
+ return message || 'This field is required';
145
+ }
146
+ break;
147
+ case 'min_length':
148
+ if (typeof value === 'string' && value.length < params) {
149
+ return message || `Minimum length is ${params} characters`;
150
+ }
151
+ break;
152
+ case 'max_length':
153
+ if (typeof value === 'string' && value.length > params) {
154
+ return message || `Maximum length is ${params} characters`;
155
+ }
156
+ break;
157
+ case 'pattern':
158
+ if (typeof value === 'string') {
159
+ try {
160
+ const regex = typeof params === 'string' ? new RegExp(params) : params;
161
+ if (!regex.test(value)) {
162
+ return message || 'Invalid format';
163
+ }
164
+ }
165
+ catch (error) {
166
+ return message || 'Invalid pattern configuration';
167
+ }
168
+ }
169
+ break;
170
+ case 'email':
171
+ if (typeof value === 'string') {
172
+ const emailRegex = /^[^\s@]+@[^\s@]+\.[^\s@]+$/;
173
+ if (!emailRegex.test(value)) {
174
+ return message || 'Invalid email address';
175
+ }
176
+ }
177
+ break;
178
+ case 'url':
179
+ if (typeof value === 'string') {
180
+ try {
181
+ new URL(value);
182
+ }
183
+ catch {
184
+ return message || 'Invalid URL';
185
+ }
186
+ }
187
+ break;
188
+ case 'phone':
189
+ if (typeof value === 'string') {
190
+ const phoneRegex = /^[\d\s\-+()]+$/;
191
+ if (!phoneRegex.test(value)) {
192
+ return message || 'Invalid phone number';
193
+ }
194
+ }
195
+ break;
196
+ case 'min':
197
+ if (typeof value === 'number' && value < params) {
198
+ return message || `Minimum value is ${params}`;
199
+ }
200
+ break;
201
+ case 'max':
202
+ if (typeof value === 'number' && value > params) {
203
+ return message || `Maximum value is ${params}`;
204
+ }
205
+ break;
206
+ case 'integer':
207
+ if (typeof value === 'number' && !Number.isInteger(value)) {
208
+ return message || 'Value must be an integer';
209
+ }
210
+ break;
211
+ case 'positive':
212
+ if (typeof value === 'number' && value <= 0) {
213
+ return message || 'Value must be positive';
214
+ }
215
+ break;
216
+ case 'negative':
217
+ if (typeof value === 'number' && value >= 0) {
218
+ return message || 'Value must be negative';
219
+ }
220
+ break;
221
+ case 'date_min':
222
+ if (value instanceof Date || typeof value === 'string') {
223
+ const date = value instanceof Date ? value : new Date(value);
224
+ const minDate = params instanceof Date ? params : new Date(params);
225
+ if (date < minDate) {
226
+ return message || `Date must be after ${minDate.toLocaleDateString()}`;
227
+ }
228
+ }
229
+ break;
230
+ case 'date_max':
231
+ if (value instanceof Date || typeof value === 'string') {
232
+ const date = value instanceof Date ? value : new Date(value);
233
+ const maxDate = params instanceof Date ? params : new Date(params);
234
+ if (date > maxDate) {
235
+ return message || `Date must be before ${maxDate.toLocaleDateString()}`;
236
+ }
237
+ }
238
+ break;
239
+ case 'date_future':
240
+ if (value instanceof Date || typeof value === 'string') {
241
+ const date = value instanceof Date ? value : new Date(value);
242
+ if (date <= new Date()) {
243
+ return message || 'Date must be in the future';
244
+ }
245
+ }
246
+ break;
247
+ case 'date_past':
248
+ if (value instanceof Date || typeof value === 'string') {
249
+ const date = value instanceof Date ? value : new Date(value);
250
+ if (date >= new Date()) {
251
+ return message || 'Date must be in the past';
252
+ }
253
+ }
254
+ break;
255
+ case 'min_items':
256
+ if (Array.isArray(value) && value.length < params) {
257
+ return message || `Minimum ${params} items required`;
258
+ }
259
+ break;
260
+ case 'max_items':
261
+ if (Array.isArray(value) && value.length > params) {
262
+ return message || `Maximum ${params} items allowed`;
263
+ }
264
+ break;
265
+ case 'unique_items':
266
+ if (Array.isArray(value)) {
267
+ const unique = new Set(value);
268
+ if (unique.size !== value.length) {
269
+ return message || 'All items must be unique';
270
+ }
271
+ }
272
+ break;
273
+ case 'field_match':
274
+ if (context?.values && params) {
275
+ const otherValue = context.values[params];
276
+ if (value !== otherValue) {
277
+ return message || `Value must match ${params}`;
278
+ }
279
+ }
280
+ break;
281
+ case 'field_compare':
282
+ if (context?.values && params) {
283
+ const { field: otherField, operator } = params;
284
+ const otherValue = context.values[otherField];
285
+ switch (operator) {
286
+ case '>':
287
+ if (value <= otherValue) {
288
+ return message || `Value must be greater than ${otherField}`;
289
+ }
290
+ break;
291
+ case '<':
292
+ if (value >= otherValue) {
293
+ return message || `Value must be less than ${otherField}`;
294
+ }
295
+ break;
296
+ case '>=':
297
+ if (value < otherValue) {
298
+ return message || `Value must be greater than or equal to ${otherField}`;
299
+ }
300
+ break;
301
+ case '<=':
302
+ if (value > otherValue) {
303
+ return message || `Value must be less than or equal to ${otherField}`;
304
+ }
305
+ break;
306
+ }
307
+ }
308
+ break;
309
+ case 'conditional':
310
+ if (context?.values && params) {
311
+ const { condition, rules } = params;
312
+ if (!Array.isArray(rules) || rules.length === 0) {
313
+ break;
314
+ }
315
+ const conditionMet = this.evaluateCondition(condition, context.values);
316
+ if (conditionMet) {
317
+ for (const conditionalRule of rules) {
318
+ const result = await this.validateRule(value, conditionalRule, context);
319
+ if (result) {
320
+ return result;
321
+ }
322
+ }
323
+ }
324
+ }
325
+ break;
326
+ default:
327
+ // Unhandled validation rule type
328
+ console.warn(`Unsupported validation rule type: ${type}`);
329
+ return null;
330
+ }
331
+ return null;
332
+ }
333
+ /**
334
+ * Evaluate a condition
335
+ * Note: Conditions must be declarative objects, not functions, for security.
336
+ */
337
+ evaluateCondition(condition, values) {
338
+ if (typeof condition === 'function') {
339
+ console.warn('Function-based conditions are deprecated and will be removed. Use declarative conditions instead.');
340
+ return false; // Security: reject function-based conditions
341
+ }
342
+ if (typeof condition === 'object' && condition.field) {
343
+ const fieldValue = values[condition.field];
344
+ const { operator = '=', value } = condition;
345
+ switch (operator) {
346
+ case '=':
347
+ return fieldValue === value;
348
+ case '!=':
349
+ return fieldValue !== value;
350
+ case '>':
351
+ return fieldValue > value;
352
+ case '<':
353
+ return fieldValue < value;
354
+ case '>=':
355
+ return fieldValue >= value;
356
+ case '<=':
357
+ return fieldValue <= value;
358
+ case 'in':
359
+ return Array.isArray(value) && value.includes(fieldValue);
360
+ default:
361
+ return false;
362
+ }
363
+ }
364
+ return false;
365
+ }
366
+ /**
367
+ * Validate multiple fields
368
+ */
369
+ async validateFields(values, schemas) {
370
+ const results = {};
371
+ const context = {
372
+ values,
373
+ };
374
+ for (const [field, schema] of Object.entries(schemas)) {
375
+ const value = values[field];
376
+ const schemaWithField = {
377
+ ...schema,
378
+ field: schema.field ?? field,
379
+ };
380
+ results[field] = await this.validate(value, schemaWithField, context);
381
+ }
382
+ return results;
383
+ }
384
+ /**
385
+ * Check if all fields are valid
386
+ */
387
+ isValid(results) {
388
+ return Object.values(results).every(result => result.valid);
389
+ }
390
+ /**
391
+ * Get all errors from validation results
392
+ */
393
+ getAllErrors(results) {
394
+ const errors = [];
395
+ for (const result of Object.values(results)) {
396
+ errors.push(...result.errors);
397
+ }
398
+ return errors;
399
+ }
400
+ /**
401
+ * Get all warnings from validation results
402
+ */
403
+ getAllWarnings(results) {
404
+ const warnings = [];
405
+ for (const result of Object.values(results)) {
406
+ if (result.warnings) {
407
+ warnings.push(...result.warnings);
408
+ }
409
+ }
410
+ return warnings;
411
+ }
412
+ }
413
+ /**
414
+ * Default validation engine instance
415
+ */
416
+ export const defaultValidationEngine = new ValidationEngine();
417
+ /**
418
+ * Convenience function to validate a value
419
+ */
420
+ export async function validate(value, schema, context) {
421
+ return defaultValidationEngine.validate(value, schema, context);
422
+ }
423
+ /**
424
+ * Convenience function to validate multiple fields
425
+ */
426
+ export async function validateFields(values, schemas) {
427
+ return defaultValidationEngine.validateFields(values, schemas);
428
+ }
@@ -0,0 +1,16 @@
1
+ /**
2
+ * ObjectUI
3
+ * Copyright (c) 2024-present ObjectStack Inc.
4
+ *
5
+ * This source code is licensed under the MIT license found in the
6
+ * LICENSE file in the root directory of this source tree.
7
+ */
8
+ /**
9
+ * @object-ui/core - Validators
10
+ *
11
+ * ObjectStack Spec v2.0.1 compliant validators
12
+ *
13
+ * @module validators
14
+ * @packageDocumentation
15
+ */
16
+ export { ObjectValidationEngine, defaultObjectValidationEngine, validateRecord, type ObjectValidationContext, type ObjectValidationResult, type ValidationExpressionEvaluator, } from './object-validation-engine.js';
@@ -0,0 +1,16 @@
1
+ /**
2
+ * ObjectUI
3
+ * Copyright (c) 2024-present ObjectStack Inc.
4
+ *
5
+ * This source code is licensed under the MIT license found in the
6
+ * LICENSE file in the root directory of this source tree.
7
+ */
8
+ /**
9
+ * @object-ui/core - Validators
10
+ *
11
+ * ObjectStack Spec v2.0.1 compliant validators
12
+ *
13
+ * @module validators
14
+ * @packageDocumentation
15
+ */
16
+ export { ObjectValidationEngine, defaultObjectValidationEngine, validateRecord, } from './object-validation-engine.js';
@@ -0,0 +1,118 @@
1
+ /**
2
+ * ObjectUI
3
+ * Copyright (c) 2024-present ObjectStack Inc.
4
+ *
5
+ * This source code is licensed under the MIT license found in the
6
+ * LICENSE file in the root directory of this source tree.
7
+ */
8
+ /**
9
+ * @object-ui/core - Object-Level Validation Engine
10
+ *
11
+ * ObjectStack Spec v2.0.1 compliant validation engine for object-level validation rules.
12
+ * Supports all 9 validation types from the specification:
13
+ * - ScriptValidation
14
+ * - UniquenessValidation
15
+ * - StateMachineValidation
16
+ * - CrossFieldValidation
17
+ * - AsyncValidation
18
+ * - ConditionalValidation
19
+ * - FormatValidation
20
+ * - RangeValidation
21
+ *
22
+ * @module object-validation-engine
23
+ * @packageDocumentation
24
+ */
25
+ import type { ObjectValidationRule } from '@object-ui/types';
26
+ /**
27
+ * Validation context for object-level validations
28
+ */
29
+ export interface ObjectValidationContext {
30
+ /** Current record data */
31
+ record: Record<string, any>;
32
+ /** Previous record data (for updates) */
33
+ oldRecord?: Record<string, any>;
34
+ /** Current user */
35
+ user?: Record<string, any>;
36
+ /** Additional context data */
37
+ [key: string]: any;
38
+ }
39
+ /**
40
+ * Validation result
41
+ */
42
+ export interface ObjectValidationResult {
43
+ /** Whether validation passed */
44
+ valid: boolean;
45
+ /** Error message if validation failed */
46
+ message?: string;
47
+ /** Validation rule that failed */
48
+ rule?: string;
49
+ /** Severity */
50
+ severity?: 'error' | 'warning' | 'info';
51
+ }
52
+ /**
53
+ * Validation expression evaluator interface
54
+ */
55
+ export interface ValidationExpressionEvaluator {
56
+ evaluate(expression: string, context: Record<string, any>): any;
57
+ }
58
+ /**
59
+ * Object-Level Validation Engine
60
+ * Implements ObjectStack Spec v2.0.1 validation framework
61
+ */
62
+ export declare class ObjectValidationEngine {
63
+ private expressionEvaluator;
64
+ private uniquenessChecker?;
65
+ constructor(expressionEvaluator?: ValidationExpressionEvaluator, uniquenessChecker?: (fields: string[], values: Record<string, any>, scope?: string, context?: ObjectValidationContext) => Promise<boolean>);
66
+ /**
67
+ * Validate a record against a set of validation rules
68
+ */
69
+ validateRecord(rules: ObjectValidationRule[], context: ObjectValidationContext, event?: 'insert' | 'update' | 'delete'): Promise<ObjectValidationResult[]>;
70
+ /**
71
+ * Validate a single rule
72
+ */
73
+ private validateRule;
74
+ /**
75
+ * Validate script-based rule
76
+ */
77
+ private validateScript;
78
+ /**
79
+ * Validate uniqueness constraint
80
+ */
81
+ private validateUniqueness;
82
+ /**
83
+ * Validate state machine transitions
84
+ */
85
+ private validateStateMachine;
86
+ /**
87
+ * Validate cross-field constraints
88
+ */
89
+ private validateCrossField;
90
+ /**
91
+ * Validate async/remote validation
92
+ */
93
+ private validateAsync;
94
+ /**
95
+ * Validate conditional rules
96
+ */
97
+ private validateConditional;
98
+ /**
99
+ * Validate format/pattern
100
+ */
101
+ private validateFormat;
102
+ /**
103
+ * Validate range constraints
104
+ */
105
+ private validateRange;
106
+ /**
107
+ * Get predefined regex pattern
108
+ */
109
+ private getPredefinedPattern;
110
+ }
111
+ /**
112
+ * Default instance
113
+ */
114
+ export declare const defaultObjectValidationEngine: ObjectValidationEngine;
115
+ /**
116
+ * Convenience function to validate a record
117
+ */
118
+ export declare function validateRecord(rules: ObjectValidationRule[], context: ObjectValidationContext, event?: 'insert' | 'update' | 'delete'): Promise<ObjectValidationResult[]>;