@object-ui/core 0.3.0 → 0.5.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 (90) hide show
  1. package/.turbo/turbo-build.log +4 -0
  2. package/CHANGELOG.md +8 -0
  3. package/dist/actions/ActionRunner.d.ts +40 -0
  4. package/dist/actions/ActionRunner.js +160 -0
  5. package/dist/actions/index.d.ts +8 -0
  6. package/dist/actions/index.js +8 -0
  7. package/dist/adapters/index.d.ts +7 -0
  8. package/dist/adapters/index.js +10 -0
  9. package/dist/builder/schema-builder.d.ts +7 -0
  10. package/dist/builder/schema-builder.js +4 -6
  11. package/dist/evaluator/ExpressionCache.d.ts +101 -0
  12. package/dist/evaluator/ExpressionCache.js +135 -0
  13. package/dist/evaluator/ExpressionContext.d.ts +51 -0
  14. package/dist/evaluator/ExpressionContext.js +110 -0
  15. package/dist/evaluator/ExpressionEvaluator.d.ts +117 -0
  16. package/dist/evaluator/ExpressionEvaluator.js +220 -0
  17. package/dist/evaluator/index.d.ts +10 -0
  18. package/dist/evaluator/index.js +10 -0
  19. package/dist/index.d.ts +17 -4
  20. package/dist/index.js +16 -5
  21. package/dist/query/index.d.ts +6 -0
  22. package/dist/query/index.js +6 -0
  23. package/dist/query/query-ast.d.ts +32 -0
  24. package/dist/query/query-ast.js +268 -0
  25. package/dist/registry/PluginScopeImpl.d.ts +80 -0
  26. package/dist/registry/PluginScopeImpl.js +243 -0
  27. package/dist/registry/PluginSystem.d.ts +66 -0
  28. package/dist/registry/PluginSystem.js +142 -0
  29. package/dist/registry/Registry.d.ts +80 -4
  30. package/dist/registry/Registry.js +119 -7
  31. package/dist/types/index.d.ts +7 -0
  32. package/dist/types/index.js +7 -0
  33. package/dist/utils/filter-converter.d.ts +57 -0
  34. package/dist/utils/filter-converter.js +100 -0
  35. package/dist/validation/index.d.ts +9 -0
  36. package/dist/validation/index.js +9 -0
  37. package/dist/validation/schema-validator.d.ts +7 -0
  38. package/dist/validation/schema-validator.js +4 -6
  39. package/dist/validation/validation-engine.d.ts +70 -0
  40. package/dist/validation/validation-engine.js +363 -0
  41. package/dist/validation/validators/index.d.ts +16 -0
  42. package/dist/validation/validators/index.js +16 -0
  43. package/dist/validation/validators/object-validation-engine.d.ts +118 -0
  44. package/dist/validation/validators/object-validation-engine.js +538 -0
  45. package/package.json +26 -7
  46. package/src/actions/ActionRunner.ts +195 -0
  47. package/src/actions/index.ts +9 -0
  48. package/src/adapters/README.md +180 -0
  49. package/src/adapters/index.ts +10 -0
  50. package/src/builder/schema-builder.ts +8 -0
  51. package/src/evaluator/ExpressionCache.ts +192 -0
  52. package/src/evaluator/ExpressionContext.ts +118 -0
  53. package/src/evaluator/ExpressionEvaluator.ts +267 -0
  54. package/src/evaluator/__tests__/ExpressionCache.test.ts +135 -0
  55. package/src/evaluator/__tests__/ExpressionEvaluator.test.ts +101 -0
  56. package/src/evaluator/index.ts +11 -0
  57. package/src/index.test.ts +8 -0
  58. package/src/index.ts +18 -5
  59. package/src/query/__tests__/query-ast.test.ts +211 -0
  60. package/src/query/__tests__/window-functions.test.ts +275 -0
  61. package/src/query/index.ts +7 -0
  62. package/src/query/query-ast.ts +341 -0
  63. package/src/registry/PluginScopeImpl.ts +259 -0
  64. package/src/registry/PluginSystem.ts +161 -0
  65. package/src/registry/Registry.ts +133 -8
  66. package/src/registry/__tests__/PluginSystem.test.ts +226 -0
  67. package/src/registry/__tests__/Registry.test.ts +293 -0
  68. package/src/registry/__tests__/plugin-scope-integration.test.ts +283 -0
  69. package/src/types/index.ts +8 -0
  70. package/src/utils/__tests__/filter-converter.test.ts +118 -0
  71. package/src/utils/filter-converter.ts +133 -0
  72. package/src/validation/__tests__/object-validation-engine.test.ts +567 -0
  73. package/src/validation/__tests__/validation-engine.test.ts +102 -0
  74. package/src/validation/index.ts +10 -0
  75. package/src/validation/schema-validator.ts +8 -0
  76. package/src/validation/validation-engine.ts +461 -0
  77. package/src/validation/validators/index.ts +25 -0
  78. package/src/validation/validators/object-validation-engine.ts +722 -0
  79. package/tsconfig.tsbuildinfo +1 -1
  80. package/vitest.config.ts +2 -0
  81. package/src/builder/schema-builder.d.ts +0 -287
  82. package/src/builder/schema-builder.js +0 -505
  83. package/src/index.d.ts +0 -4
  84. package/src/index.js +0 -7
  85. package/src/registry/Registry.d.ts +0 -49
  86. package/src/registry/Registry.js +0 -36
  87. package/src/types/index.d.ts +0 -12
  88. package/src/types/index.js +0 -1
  89. package/src/validation/schema-validator.d.ts +0 -87
  90. package/src/validation/schema-validator.js +0 -280
@@ -0,0 +1,70 @@
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 - Validation Engine
10
+ *
11
+ * Phase 3.5: Complete validation engine implementation with support for:
12
+ * - Sync and async validation
13
+ * - Cross-field validation
14
+ * - Custom validation functions
15
+ * - Improved error messages
16
+ *
17
+ * @module validation-engine
18
+ * @packageDocumentation
19
+ */
20
+ import type { AdvancedValidationSchema, ValidationContext, AdvancedValidationResult, AdvancedValidationError } from '@object-ui/types';
21
+ /**
22
+ * Validation Engine - Executes validation rules
23
+ */
24
+ export declare class ValidationEngine {
25
+ /**
26
+ * Validate a value against validation schema
27
+ */
28
+ validate(value: any, schema: AdvancedValidationSchema, context?: ValidationContext): Promise<AdvancedValidationResult>;
29
+ /**
30
+ * Validate a single rule
31
+ */
32
+ private validateRule;
33
+ /**
34
+ * Validate built-in rules
35
+ */
36
+ private validateBuiltInRule;
37
+ /**
38
+ * Evaluate a condition
39
+ * Note: Conditions must be declarative objects, not functions, for security.
40
+ */
41
+ private evaluateCondition;
42
+ /**
43
+ * Validate multiple fields
44
+ */
45
+ validateFields(values: Record<string, any>, schemas: Record<string, AdvancedValidationSchema>): Promise<Record<string, AdvancedValidationResult>>;
46
+ /**
47
+ * Check if all fields are valid
48
+ */
49
+ isValid(results: Record<string, AdvancedValidationResult>): boolean;
50
+ /**
51
+ * Get all errors from validation results
52
+ */
53
+ getAllErrors(results: Record<string, AdvancedValidationResult>): AdvancedValidationError[];
54
+ /**
55
+ * Get all warnings from validation results
56
+ */
57
+ getAllWarnings(results: Record<string, AdvancedValidationResult>): AdvancedValidationError[];
58
+ }
59
+ /**
60
+ * Default validation engine instance
61
+ */
62
+ export declare const defaultValidationEngine: ValidationEngine;
63
+ /**
64
+ * Convenience function to validate a value
65
+ */
66
+ export declare function validate(value: any, schema: AdvancedValidationSchema, context?: ValidationContext): Promise<AdvancedValidationResult>;
67
+ /**
68
+ * Convenience function to validate multiple fields
69
+ */
70
+ export declare function validateFields(values: Record<string, any>, schemas: Record<string, AdvancedValidationSchema>): Promise<Record<string, AdvancedValidationResult>>;
@@ -0,0 +1,363 @@
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
+ /**
13
+ * Validate a value against validation schema
14
+ */
15
+ async validate(value, schema, context) {
16
+ const errors = [];
17
+ const warnings = [];
18
+ for (const rule of schema.rules) {
19
+ const result = await this.validateRule(value, rule, context);
20
+ if (result) {
21
+ const error = {
22
+ field: schema.field || 'unknown',
23
+ message: result,
24
+ code: rule.type,
25
+ rule: rule.type,
26
+ severity: rule.severity || 'error',
27
+ };
28
+ if (rule.severity === 'warning' || rule.severity === 'info') {
29
+ warnings.push(error);
30
+ }
31
+ else {
32
+ errors.push(error);
33
+ }
34
+ }
35
+ }
36
+ return {
37
+ valid: errors.length === 0,
38
+ errors,
39
+ warnings,
40
+ };
41
+ }
42
+ /**
43
+ * Validate a single rule
44
+ */
45
+ async validateRule(value, rule, context) {
46
+ // Custom async validator
47
+ if (rule.async_validator) {
48
+ const result = await rule.async_validator(value, context);
49
+ if (result === false) {
50
+ return rule.message || 'Async validation failed';
51
+ }
52
+ if (typeof result === 'string') {
53
+ return result;
54
+ }
55
+ return null;
56
+ }
57
+ // Custom sync validator
58
+ if (rule.validator) {
59
+ const result = rule.validator(value, context);
60
+ if (result === false) {
61
+ return rule.message || 'Validation failed';
62
+ }
63
+ if (typeof result === 'string') {
64
+ return result;
65
+ }
66
+ return null;
67
+ }
68
+ // Built-in validators
69
+ return this.validateBuiltInRule(value, rule, context);
70
+ }
71
+ /**
72
+ * Validate built-in rules
73
+ */
74
+ async validateBuiltInRule(value, rule, context) {
75
+ const { type, params, message } = rule;
76
+ switch (type) {
77
+ case 'required':
78
+ if (value === null || value === undefined || value === '') {
79
+ return message || 'This field is required';
80
+ }
81
+ break;
82
+ case 'min_length':
83
+ if (typeof value === 'string' && value.length < params) {
84
+ return message || `Minimum length is ${params} characters`;
85
+ }
86
+ break;
87
+ case 'max_length':
88
+ if (typeof value === 'string' && value.length > params) {
89
+ return message || `Maximum length is ${params} characters`;
90
+ }
91
+ break;
92
+ case 'pattern':
93
+ if (typeof value === 'string') {
94
+ try {
95
+ const regex = typeof params === 'string' ? new RegExp(params) : params;
96
+ if (!regex.test(value)) {
97
+ return message || 'Invalid format';
98
+ }
99
+ }
100
+ catch (error) {
101
+ return message || 'Invalid pattern configuration';
102
+ }
103
+ }
104
+ break;
105
+ case 'email':
106
+ if (typeof value === 'string') {
107
+ const emailRegex = /^[^\s@]+@[^\s@]+\.[^\s@]+$/;
108
+ if (!emailRegex.test(value)) {
109
+ return message || 'Invalid email address';
110
+ }
111
+ }
112
+ break;
113
+ case 'url':
114
+ if (typeof value === 'string') {
115
+ try {
116
+ new URL(value);
117
+ }
118
+ catch {
119
+ return message || 'Invalid URL';
120
+ }
121
+ }
122
+ break;
123
+ case 'phone':
124
+ if (typeof value === 'string') {
125
+ const phoneRegex = /^[\d\s\-+()]+$/;
126
+ if (!phoneRegex.test(value)) {
127
+ return message || 'Invalid phone number';
128
+ }
129
+ }
130
+ break;
131
+ case 'min':
132
+ if (typeof value === 'number' && value < params) {
133
+ return message || `Minimum value is ${params}`;
134
+ }
135
+ break;
136
+ case 'max':
137
+ if (typeof value === 'number' && value > params) {
138
+ return message || `Maximum value is ${params}`;
139
+ }
140
+ break;
141
+ case 'integer':
142
+ if (typeof value === 'number' && !Number.isInteger(value)) {
143
+ return message || 'Value must be an integer';
144
+ }
145
+ break;
146
+ case 'positive':
147
+ if (typeof value === 'number' && value <= 0) {
148
+ return message || 'Value must be positive';
149
+ }
150
+ break;
151
+ case 'negative':
152
+ if (typeof value === 'number' && value >= 0) {
153
+ return message || 'Value must be negative';
154
+ }
155
+ break;
156
+ case 'date_min':
157
+ if (value instanceof Date || typeof value === 'string') {
158
+ const date = value instanceof Date ? value : new Date(value);
159
+ const minDate = params instanceof Date ? params : new Date(params);
160
+ if (date < minDate) {
161
+ return message || `Date must be after ${minDate.toLocaleDateString()}`;
162
+ }
163
+ }
164
+ break;
165
+ case 'date_max':
166
+ if (value instanceof Date || typeof value === 'string') {
167
+ const date = value instanceof Date ? value : new Date(value);
168
+ const maxDate = params instanceof Date ? params : new Date(params);
169
+ if (date > maxDate) {
170
+ return message || `Date must be before ${maxDate.toLocaleDateString()}`;
171
+ }
172
+ }
173
+ break;
174
+ case 'date_future':
175
+ if (value instanceof Date || typeof value === 'string') {
176
+ const date = value instanceof Date ? value : new Date(value);
177
+ if (date <= new Date()) {
178
+ return message || 'Date must be in the future';
179
+ }
180
+ }
181
+ break;
182
+ case 'date_past':
183
+ if (value instanceof Date || typeof value === 'string') {
184
+ const date = value instanceof Date ? value : new Date(value);
185
+ if (date >= new Date()) {
186
+ return message || 'Date must be in the past';
187
+ }
188
+ }
189
+ break;
190
+ case 'min_items':
191
+ if (Array.isArray(value) && value.length < params) {
192
+ return message || `Minimum ${params} items required`;
193
+ }
194
+ break;
195
+ case 'max_items':
196
+ if (Array.isArray(value) && value.length > params) {
197
+ return message || `Maximum ${params} items allowed`;
198
+ }
199
+ break;
200
+ case 'unique_items':
201
+ if (Array.isArray(value)) {
202
+ const unique = new Set(value);
203
+ if (unique.size !== value.length) {
204
+ return message || 'All items must be unique';
205
+ }
206
+ }
207
+ break;
208
+ case 'field_match':
209
+ if (context?.values && params) {
210
+ const otherValue = context.values[params];
211
+ if (value !== otherValue) {
212
+ return message || `Value must match ${params}`;
213
+ }
214
+ }
215
+ break;
216
+ case 'field_compare':
217
+ if (context?.values && params) {
218
+ const { field: otherField, operator } = params;
219
+ const otherValue = context.values[otherField];
220
+ switch (operator) {
221
+ case '>':
222
+ if (value <= otherValue) {
223
+ return message || `Value must be greater than ${otherField}`;
224
+ }
225
+ break;
226
+ case '<':
227
+ if (value >= otherValue) {
228
+ return message || `Value must be less than ${otherField}`;
229
+ }
230
+ break;
231
+ case '>=':
232
+ if (value < otherValue) {
233
+ return message || `Value must be greater than or equal to ${otherField}`;
234
+ }
235
+ break;
236
+ case '<=':
237
+ if (value > otherValue) {
238
+ return message || `Value must be less than or equal to ${otherField}`;
239
+ }
240
+ break;
241
+ }
242
+ }
243
+ break;
244
+ case 'conditional':
245
+ if (context?.values && params) {
246
+ const { condition, rules } = params;
247
+ if (!Array.isArray(rules) || rules.length === 0) {
248
+ break;
249
+ }
250
+ const conditionMet = this.evaluateCondition(condition, context.values);
251
+ if (conditionMet) {
252
+ for (const conditionalRule of rules) {
253
+ const result = await this.validateRule(value, conditionalRule, context);
254
+ if (result) {
255
+ return result;
256
+ }
257
+ }
258
+ }
259
+ }
260
+ break;
261
+ default:
262
+ // Unhandled validation rule type
263
+ console.warn(`Unsupported validation rule type: ${type}`);
264
+ return null;
265
+ }
266
+ return null;
267
+ }
268
+ /**
269
+ * Evaluate a condition
270
+ * Note: Conditions must be declarative objects, not functions, for security.
271
+ */
272
+ evaluateCondition(condition, values) {
273
+ if (typeof condition === 'function') {
274
+ console.warn('Function-based conditions are deprecated and will be removed. Use declarative conditions instead.');
275
+ return false; // Security: reject function-based conditions
276
+ }
277
+ if (typeof condition === 'object' && condition.field) {
278
+ const fieldValue = values[condition.field];
279
+ const { operator = '=', value } = condition;
280
+ switch (operator) {
281
+ case '=':
282
+ return fieldValue === value;
283
+ case '!=':
284
+ return fieldValue !== value;
285
+ case '>':
286
+ return fieldValue > value;
287
+ case '<':
288
+ return fieldValue < value;
289
+ case '>=':
290
+ return fieldValue >= value;
291
+ case '<=':
292
+ return fieldValue <= value;
293
+ case 'in':
294
+ return Array.isArray(value) && value.includes(fieldValue);
295
+ default:
296
+ return false;
297
+ }
298
+ }
299
+ return false;
300
+ }
301
+ /**
302
+ * Validate multiple fields
303
+ */
304
+ async validateFields(values, schemas) {
305
+ const results = {};
306
+ const context = {
307
+ values,
308
+ };
309
+ for (const [field, schema] of Object.entries(schemas)) {
310
+ const value = values[field];
311
+ const schemaWithField = {
312
+ ...schema,
313
+ field: schema.field ?? field,
314
+ };
315
+ results[field] = await this.validate(value, schemaWithField, context);
316
+ }
317
+ return results;
318
+ }
319
+ /**
320
+ * Check if all fields are valid
321
+ */
322
+ isValid(results) {
323
+ return Object.values(results).every(result => result.valid);
324
+ }
325
+ /**
326
+ * Get all errors from validation results
327
+ */
328
+ getAllErrors(results) {
329
+ const errors = [];
330
+ for (const result of Object.values(results)) {
331
+ errors.push(...result.errors);
332
+ }
333
+ return errors;
334
+ }
335
+ /**
336
+ * Get all warnings from validation results
337
+ */
338
+ getAllWarnings(results) {
339
+ const warnings = [];
340
+ for (const result of Object.values(results)) {
341
+ if (result.warnings) {
342
+ warnings.push(...result.warnings);
343
+ }
344
+ }
345
+ return warnings;
346
+ }
347
+ }
348
+ /**
349
+ * Default validation engine instance
350
+ */
351
+ export const defaultValidationEngine = new ValidationEngine();
352
+ /**
353
+ * Convenience function to validate a value
354
+ */
355
+ export async function validate(value, schema, context) {
356
+ return defaultValidationEngine.validate(value, schema, context);
357
+ }
358
+ /**
359
+ * Convenience function to validate multiple fields
360
+ */
361
+ export async function validateFields(values, schemas) {
362
+ return defaultValidationEngine.validateFields(values, schemas);
363
+ }
@@ -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 v0.7.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 v0.7.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 v0.7.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 v0.7.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[]>;