@objectql/types 1.6.0 → 1.7.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.
- package/package.json +10 -3
- package/schemas/app.schema.json +50 -0
- package/schemas/menu.schema.json +129 -0
- package/schemas/object.schema.json +1384 -0
- package/schemas/page.schema.json +604 -0
- package/CHANGELOG.md +0 -60
- package/jest.config.js +0 -5
- package/src/action.ts +0 -96
- package/src/app.ts +0 -23
- package/src/application.ts +0 -46
- package/src/config.ts +0 -37
- package/src/context.ts +0 -45
- package/src/driver.ts +0 -27
- package/src/field.ts +0 -149
- package/src/hook.ts +0 -131
- package/src/index.ts +0 -18
- package/src/loader.ts +0 -17
- package/src/menu.ts +0 -102
- package/src/object.ts +0 -60
- package/src/page.ts +0 -332
- package/src/permission.ts +0 -477
- package/src/plugin.ts +0 -6
- package/src/query.ts +0 -23
- package/src/registry.ts +0 -61
- package/src/repository.ts +0 -17
- package/src/validation.ts +0 -390
- package/tsconfig.json +0 -9
- package/tsconfig.tsbuildinfo +0 -1
|
@@ -0,0 +1,1384 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$ref": "#/definitions/ObjectConfig",
|
|
3
|
+
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
4
|
+
"definitions": {
|
|
5
|
+
"ActionConfig": {
|
|
6
|
+
"additionalProperties": false,
|
|
7
|
+
"description": "The configuration of an Action visible to the Metadata engine (YAML/JSON side).",
|
|
8
|
+
"properties": {
|
|
9
|
+
"confirm_text": {
|
|
10
|
+
"description": "Message to show before executing. If present, UI should prompt confirmation.",
|
|
11
|
+
"type": "string"
|
|
12
|
+
},
|
|
13
|
+
"description": {
|
|
14
|
+
"type": "string"
|
|
15
|
+
},
|
|
16
|
+
"icon": {
|
|
17
|
+
"type": "string"
|
|
18
|
+
},
|
|
19
|
+
"internal": {
|
|
20
|
+
"description": "If true, this action is not exposed via API directly (server-internal).",
|
|
21
|
+
"type": "boolean"
|
|
22
|
+
},
|
|
23
|
+
"label": {
|
|
24
|
+
"type": "string"
|
|
25
|
+
},
|
|
26
|
+
"params": {
|
|
27
|
+
"$ref": "#/definitions/ActionInputDefinition",
|
|
28
|
+
"description": "Input parameter schema."
|
|
29
|
+
},
|
|
30
|
+
"return_type": {
|
|
31
|
+
"anyOf": [
|
|
32
|
+
{
|
|
33
|
+
"type": "string"
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
"$ref": "#/definitions/FieldConfig"
|
|
37
|
+
}
|
|
38
|
+
],
|
|
39
|
+
"description": "Output data shape description (optional, for content negotiation)."
|
|
40
|
+
},
|
|
41
|
+
"type": {
|
|
42
|
+
"$ref": "#/definitions/ActionType",
|
|
43
|
+
"description": "Default: 'global' if no fields defined, but usually specified explicitly."
|
|
44
|
+
}
|
|
45
|
+
},
|
|
46
|
+
"type": "object"
|
|
47
|
+
},
|
|
48
|
+
"ActionInputDefinition": {
|
|
49
|
+
"additionalProperties": {
|
|
50
|
+
"$ref": "#/definitions/FieldConfig"
|
|
51
|
+
},
|
|
52
|
+
"description": "Re-using FieldConfig allows us to describe input parameters using the same rich vocabulary as database fields (validation, UI hints, etc).",
|
|
53
|
+
"type": "object"
|
|
54
|
+
},
|
|
55
|
+
"ActionType": {
|
|
56
|
+
"description": "Defines the scope of the action.\n- `record`: Acts on a specific record instance (e.g. \"Approve Order\").\n- `global`: Acts on the collection or system (e.g. \"Import CSV\", \"Daily Report\").",
|
|
57
|
+
"enum": [
|
|
58
|
+
"record",
|
|
59
|
+
"global"
|
|
60
|
+
],
|
|
61
|
+
"type": "string"
|
|
62
|
+
},
|
|
63
|
+
"AiSearchConfig": {
|
|
64
|
+
"additionalProperties": false,
|
|
65
|
+
"properties": {
|
|
66
|
+
"enabled": {
|
|
67
|
+
"description": "Enable semantic search for this object",
|
|
68
|
+
"type": "boolean"
|
|
69
|
+
},
|
|
70
|
+
"fields": {
|
|
71
|
+
"description": "Fields to include in the embedding generation",
|
|
72
|
+
"items": {
|
|
73
|
+
"type": "string"
|
|
74
|
+
},
|
|
75
|
+
"type": "array"
|
|
76
|
+
},
|
|
77
|
+
"model": {
|
|
78
|
+
"description": "The AI model to use for embedding (e.g. 'openai/text-embedding-3-small')",
|
|
79
|
+
"type": "string"
|
|
80
|
+
},
|
|
81
|
+
"target_field": {
|
|
82
|
+
"description": "Optional: Target vector field name if manually defined",
|
|
83
|
+
"type": "string"
|
|
84
|
+
}
|
|
85
|
+
},
|
|
86
|
+
"required": [
|
|
87
|
+
"enabled",
|
|
88
|
+
"fields"
|
|
89
|
+
],
|
|
90
|
+
"type": "object"
|
|
91
|
+
},
|
|
92
|
+
"AnyValidationRule": {
|
|
93
|
+
"anyOf": [
|
|
94
|
+
{
|
|
95
|
+
"$ref": "#/definitions/ValidationRule"
|
|
96
|
+
},
|
|
97
|
+
{
|
|
98
|
+
"$ref": "#/definitions/CrossFieldValidationRule"
|
|
99
|
+
},
|
|
100
|
+
{
|
|
101
|
+
"$ref": "#/definitions/BusinessRuleValidationRule"
|
|
102
|
+
},
|
|
103
|
+
{
|
|
104
|
+
"$ref": "#/definitions/StateMachineValidationRule"
|
|
105
|
+
},
|
|
106
|
+
{
|
|
107
|
+
"$ref": "#/definitions/UniquenessValidationRule"
|
|
108
|
+
},
|
|
109
|
+
{
|
|
110
|
+
"$ref": "#/definitions/DependencyValidationRule"
|
|
111
|
+
},
|
|
112
|
+
{
|
|
113
|
+
"$ref": "#/definitions/CustomValidationRule"
|
|
114
|
+
}
|
|
115
|
+
],
|
|
116
|
+
"description": "Union type for all validation rules."
|
|
117
|
+
},
|
|
118
|
+
"BusinessRuleConstraint": {
|
|
119
|
+
"additionalProperties": false,
|
|
120
|
+
"description": "Business rule constraint definition.",
|
|
121
|
+
"properties": {
|
|
122
|
+
"all_of": {
|
|
123
|
+
"description": "Logical AND conditions",
|
|
124
|
+
"items": {
|
|
125
|
+
"$ref": "#/definitions/ValidationCondition"
|
|
126
|
+
},
|
|
127
|
+
"type": "array"
|
|
128
|
+
},
|
|
129
|
+
"any_of": {
|
|
130
|
+
"description": "Logical OR conditions",
|
|
131
|
+
"items": {
|
|
132
|
+
"$ref": "#/definitions/ValidationCondition"
|
|
133
|
+
},
|
|
134
|
+
"type": "array"
|
|
135
|
+
},
|
|
136
|
+
"expression": {
|
|
137
|
+
"description": "Expression to evaluate",
|
|
138
|
+
"type": "string"
|
|
139
|
+
},
|
|
140
|
+
"relationships": {
|
|
141
|
+
"additionalProperties": {
|
|
142
|
+
"$ref": "#/definitions/ValidationRelationship"
|
|
143
|
+
},
|
|
144
|
+
"description": "Relationships needed for the rule",
|
|
145
|
+
"type": "object"
|
|
146
|
+
},
|
|
147
|
+
"then_require": {
|
|
148
|
+
"description": "Required field condition",
|
|
149
|
+
"items": {
|
|
150
|
+
"$ref": "#/definitions/ValidationCondition"
|
|
151
|
+
},
|
|
152
|
+
"type": "array"
|
|
153
|
+
}
|
|
154
|
+
},
|
|
155
|
+
"type": "object"
|
|
156
|
+
},
|
|
157
|
+
"BusinessRuleValidationRule": {
|
|
158
|
+
"additionalProperties": false,
|
|
159
|
+
"description": "Business rule validation.",
|
|
160
|
+
"properties": {
|
|
161
|
+
"ai_context": {
|
|
162
|
+
"$ref": "#/definitions/ValidationAiContext",
|
|
163
|
+
"description": "AI context for understanding the rule"
|
|
164
|
+
},
|
|
165
|
+
"apply_when": {
|
|
166
|
+
"$ref": "#/definitions/ValidationCondition",
|
|
167
|
+
"description": "Condition for applying the rule"
|
|
168
|
+
},
|
|
169
|
+
"async": {
|
|
170
|
+
"description": "Whether this is an async validation",
|
|
171
|
+
"type": "boolean"
|
|
172
|
+
},
|
|
173
|
+
"constraint": {
|
|
174
|
+
"$ref": "#/definitions/BusinessRuleConstraint",
|
|
175
|
+
"description": "The business rule constraint"
|
|
176
|
+
},
|
|
177
|
+
"context": {
|
|
178
|
+
"description": "Contexts where this rule applies",
|
|
179
|
+
"items": {
|
|
180
|
+
"type": "string"
|
|
181
|
+
},
|
|
182
|
+
"type": "array"
|
|
183
|
+
},
|
|
184
|
+
"error_code": {
|
|
185
|
+
"description": "Error code for programmatic handling",
|
|
186
|
+
"type": "string"
|
|
187
|
+
},
|
|
188
|
+
"fields": {
|
|
189
|
+
"description": "Fields that trigger this rule when changed",
|
|
190
|
+
"items": {
|
|
191
|
+
"type": "string"
|
|
192
|
+
},
|
|
193
|
+
"type": "array"
|
|
194
|
+
},
|
|
195
|
+
"message": {
|
|
196
|
+
"anyOf": [
|
|
197
|
+
{
|
|
198
|
+
"type": "string"
|
|
199
|
+
},
|
|
200
|
+
{
|
|
201
|
+
"additionalProperties": {
|
|
202
|
+
"type": "string"
|
|
203
|
+
},
|
|
204
|
+
"type": "object"
|
|
205
|
+
}
|
|
206
|
+
],
|
|
207
|
+
"description": "Human-readable error message"
|
|
208
|
+
},
|
|
209
|
+
"name": {
|
|
210
|
+
"description": "Unique name of the rule",
|
|
211
|
+
"type": "string"
|
|
212
|
+
},
|
|
213
|
+
"severity": {
|
|
214
|
+
"$ref": "#/definitions/ValidationSeverity",
|
|
215
|
+
"description": "Severity level"
|
|
216
|
+
},
|
|
217
|
+
"skip_bulk": {
|
|
218
|
+
"description": "Skip in bulk operations",
|
|
219
|
+
"type": "boolean"
|
|
220
|
+
},
|
|
221
|
+
"timeout": {
|
|
222
|
+
"description": "Timeout for async validation (ms)",
|
|
223
|
+
"type": "number"
|
|
224
|
+
},
|
|
225
|
+
"trigger": {
|
|
226
|
+
"description": "Operations that trigger this rule",
|
|
227
|
+
"items": {
|
|
228
|
+
"$ref": "#/definitions/ValidationTrigger"
|
|
229
|
+
},
|
|
230
|
+
"type": "array"
|
|
231
|
+
},
|
|
232
|
+
"type": {
|
|
233
|
+
"const": "business_rule",
|
|
234
|
+
"description": "Type of validation rule",
|
|
235
|
+
"type": "string"
|
|
236
|
+
}
|
|
237
|
+
},
|
|
238
|
+
"required": [
|
|
239
|
+
"message",
|
|
240
|
+
"name",
|
|
241
|
+
"type"
|
|
242
|
+
],
|
|
243
|
+
"type": "object"
|
|
244
|
+
},
|
|
245
|
+
"CrossFieldValidationRule": {
|
|
246
|
+
"additionalProperties": false,
|
|
247
|
+
"description": "Cross-field validation rule.",
|
|
248
|
+
"properties": {
|
|
249
|
+
"ai_context": {
|
|
250
|
+
"$ref": "#/definitions/ValidationAiContext",
|
|
251
|
+
"description": "AI context for understanding the rule"
|
|
252
|
+
},
|
|
253
|
+
"apply_when": {
|
|
254
|
+
"$ref": "#/definitions/ValidationCondition",
|
|
255
|
+
"description": "Condition for applying the rule"
|
|
256
|
+
},
|
|
257
|
+
"async": {
|
|
258
|
+
"description": "Whether this is an async validation",
|
|
259
|
+
"type": "boolean"
|
|
260
|
+
},
|
|
261
|
+
"context": {
|
|
262
|
+
"description": "Contexts where this rule applies",
|
|
263
|
+
"items": {
|
|
264
|
+
"type": "string"
|
|
265
|
+
},
|
|
266
|
+
"type": "array"
|
|
267
|
+
},
|
|
268
|
+
"error_code": {
|
|
269
|
+
"description": "Error code for programmatic handling",
|
|
270
|
+
"type": "string"
|
|
271
|
+
},
|
|
272
|
+
"fields": {
|
|
273
|
+
"description": "Fields that trigger this rule when changed",
|
|
274
|
+
"items": {
|
|
275
|
+
"type": "string"
|
|
276
|
+
},
|
|
277
|
+
"type": "array"
|
|
278
|
+
},
|
|
279
|
+
"message": {
|
|
280
|
+
"anyOf": [
|
|
281
|
+
{
|
|
282
|
+
"type": "string"
|
|
283
|
+
},
|
|
284
|
+
{
|
|
285
|
+
"additionalProperties": {
|
|
286
|
+
"type": "string"
|
|
287
|
+
},
|
|
288
|
+
"type": "object"
|
|
289
|
+
}
|
|
290
|
+
],
|
|
291
|
+
"description": "Human-readable error message"
|
|
292
|
+
},
|
|
293
|
+
"name": {
|
|
294
|
+
"description": "Unique name of the rule",
|
|
295
|
+
"type": "string"
|
|
296
|
+
},
|
|
297
|
+
"rule": {
|
|
298
|
+
"$ref": "#/definitions/ValidationCondition",
|
|
299
|
+
"description": "The validation rule to apply"
|
|
300
|
+
},
|
|
301
|
+
"severity": {
|
|
302
|
+
"$ref": "#/definitions/ValidationSeverity",
|
|
303
|
+
"description": "Severity level"
|
|
304
|
+
},
|
|
305
|
+
"skip_bulk": {
|
|
306
|
+
"description": "Skip in bulk operations",
|
|
307
|
+
"type": "boolean"
|
|
308
|
+
},
|
|
309
|
+
"timeout": {
|
|
310
|
+
"description": "Timeout for async validation (ms)",
|
|
311
|
+
"type": "number"
|
|
312
|
+
},
|
|
313
|
+
"trigger": {
|
|
314
|
+
"description": "Operations that trigger this rule",
|
|
315
|
+
"items": {
|
|
316
|
+
"$ref": "#/definitions/ValidationTrigger"
|
|
317
|
+
},
|
|
318
|
+
"type": "array"
|
|
319
|
+
},
|
|
320
|
+
"type": {
|
|
321
|
+
"const": "cross_field",
|
|
322
|
+
"description": "Type of validation rule",
|
|
323
|
+
"type": "string"
|
|
324
|
+
}
|
|
325
|
+
},
|
|
326
|
+
"required": [
|
|
327
|
+
"message",
|
|
328
|
+
"name",
|
|
329
|
+
"type"
|
|
330
|
+
],
|
|
331
|
+
"type": "object"
|
|
332
|
+
},
|
|
333
|
+
"CustomValidationRule": {
|
|
334
|
+
"additionalProperties": false,
|
|
335
|
+
"description": "Custom validation rule with validator function.",
|
|
336
|
+
"properties": {
|
|
337
|
+
"ai_context": {
|
|
338
|
+
"$ref": "#/definitions/ValidationAiContext",
|
|
339
|
+
"description": "AI context for understanding the rule"
|
|
340
|
+
},
|
|
341
|
+
"apply_when": {
|
|
342
|
+
"$ref": "#/definitions/ValidationCondition",
|
|
343
|
+
"description": "Condition for applying the rule"
|
|
344
|
+
},
|
|
345
|
+
"async": {
|
|
346
|
+
"description": "Whether this is an async validation",
|
|
347
|
+
"type": "boolean"
|
|
348
|
+
},
|
|
349
|
+
"context": {
|
|
350
|
+
"description": "Contexts where this rule applies",
|
|
351
|
+
"items": {
|
|
352
|
+
"type": "string"
|
|
353
|
+
},
|
|
354
|
+
"type": "array"
|
|
355
|
+
},
|
|
356
|
+
"error_code": {
|
|
357
|
+
"description": "Error code for programmatic handling",
|
|
358
|
+
"type": "string"
|
|
359
|
+
},
|
|
360
|
+
"error_message_template": {
|
|
361
|
+
"description": "Error message template",
|
|
362
|
+
"type": "string"
|
|
363
|
+
},
|
|
364
|
+
"fields": {
|
|
365
|
+
"description": "Fields that trigger this rule when changed",
|
|
366
|
+
"items": {
|
|
367
|
+
"type": "string"
|
|
368
|
+
},
|
|
369
|
+
"type": "array"
|
|
370
|
+
},
|
|
371
|
+
"message": {
|
|
372
|
+
"anyOf": [
|
|
373
|
+
{
|
|
374
|
+
"type": "string"
|
|
375
|
+
},
|
|
376
|
+
{
|
|
377
|
+
"additionalProperties": {
|
|
378
|
+
"type": "string"
|
|
379
|
+
},
|
|
380
|
+
"type": "object"
|
|
381
|
+
}
|
|
382
|
+
],
|
|
383
|
+
"description": "Human-readable error message"
|
|
384
|
+
},
|
|
385
|
+
"message_params": {
|
|
386
|
+
"description": "Message parameters",
|
|
387
|
+
"type": "object"
|
|
388
|
+
},
|
|
389
|
+
"name": {
|
|
390
|
+
"description": "Unique name of the rule",
|
|
391
|
+
"type": "string"
|
|
392
|
+
},
|
|
393
|
+
"severity": {
|
|
394
|
+
"$ref": "#/definitions/ValidationSeverity",
|
|
395
|
+
"description": "Severity level"
|
|
396
|
+
},
|
|
397
|
+
"skip_bulk": {
|
|
398
|
+
"description": "Skip in bulk operations",
|
|
399
|
+
"type": "boolean"
|
|
400
|
+
},
|
|
401
|
+
"timeout": {
|
|
402
|
+
"description": "Timeout for async validation (ms)",
|
|
403
|
+
"type": "number"
|
|
404
|
+
},
|
|
405
|
+
"trigger": {
|
|
406
|
+
"description": "Operations that trigger this rule",
|
|
407
|
+
"items": {
|
|
408
|
+
"$ref": "#/definitions/ValidationTrigger"
|
|
409
|
+
},
|
|
410
|
+
"type": "array"
|
|
411
|
+
},
|
|
412
|
+
"type": {
|
|
413
|
+
"const": "custom",
|
|
414
|
+
"description": "Type of validation rule",
|
|
415
|
+
"type": "string"
|
|
416
|
+
},
|
|
417
|
+
"validator": {
|
|
418
|
+
"description": "Validator function as string",
|
|
419
|
+
"type": "string"
|
|
420
|
+
}
|
|
421
|
+
},
|
|
422
|
+
"required": [
|
|
423
|
+
"message",
|
|
424
|
+
"name",
|
|
425
|
+
"type"
|
|
426
|
+
],
|
|
427
|
+
"type": "object"
|
|
428
|
+
},
|
|
429
|
+
"DependencyValidationRule": {
|
|
430
|
+
"additionalProperties": false,
|
|
431
|
+
"description": "Dependency validation rule.",
|
|
432
|
+
"properties": {
|
|
433
|
+
"ai_context": {
|
|
434
|
+
"$ref": "#/definitions/ValidationAiContext",
|
|
435
|
+
"description": "AI context for understanding the rule"
|
|
436
|
+
},
|
|
437
|
+
"apply_when": {
|
|
438
|
+
"$ref": "#/definitions/ValidationCondition",
|
|
439
|
+
"description": "Condition for applying the rule"
|
|
440
|
+
},
|
|
441
|
+
"async": {
|
|
442
|
+
"description": "Whether this is an async validation",
|
|
443
|
+
"type": "boolean"
|
|
444
|
+
},
|
|
445
|
+
"condition": {
|
|
446
|
+
"additionalProperties": false,
|
|
447
|
+
"description": "Validation condition",
|
|
448
|
+
"properties": {
|
|
449
|
+
"has_related": {
|
|
450
|
+
"additionalProperties": false,
|
|
451
|
+
"description": "Related records check",
|
|
452
|
+
"properties": {
|
|
453
|
+
"filter": {
|
|
454
|
+
"items": {
|
|
455
|
+
"$ref": "#/definitions/ValidationCondition"
|
|
456
|
+
},
|
|
457
|
+
"type": "array"
|
|
458
|
+
},
|
|
459
|
+
"object": {
|
|
460
|
+
"type": "string"
|
|
461
|
+
},
|
|
462
|
+
"relation_field": {
|
|
463
|
+
"type": "string"
|
|
464
|
+
}
|
|
465
|
+
},
|
|
466
|
+
"required": [
|
|
467
|
+
"object",
|
|
468
|
+
"relation_field"
|
|
469
|
+
],
|
|
470
|
+
"type": "object"
|
|
471
|
+
},
|
|
472
|
+
"lookup": {
|
|
473
|
+
"$ref": "#/definitions/ValidationRelationship",
|
|
474
|
+
"description": "Lookup validation"
|
|
475
|
+
}
|
|
476
|
+
},
|
|
477
|
+
"type": "object"
|
|
478
|
+
},
|
|
479
|
+
"context": {
|
|
480
|
+
"description": "Contexts where this rule applies",
|
|
481
|
+
"items": {
|
|
482
|
+
"type": "string"
|
|
483
|
+
},
|
|
484
|
+
"type": "array"
|
|
485
|
+
},
|
|
486
|
+
"error_code": {
|
|
487
|
+
"description": "Error code for programmatic handling",
|
|
488
|
+
"type": "string"
|
|
489
|
+
},
|
|
490
|
+
"fields": {
|
|
491
|
+
"description": "Fields that trigger this rule when changed",
|
|
492
|
+
"items": {
|
|
493
|
+
"type": "string"
|
|
494
|
+
},
|
|
495
|
+
"type": "array"
|
|
496
|
+
},
|
|
497
|
+
"message": {
|
|
498
|
+
"anyOf": [
|
|
499
|
+
{
|
|
500
|
+
"type": "string"
|
|
501
|
+
},
|
|
502
|
+
{
|
|
503
|
+
"additionalProperties": {
|
|
504
|
+
"type": "string"
|
|
505
|
+
},
|
|
506
|
+
"type": "object"
|
|
507
|
+
}
|
|
508
|
+
],
|
|
509
|
+
"description": "Human-readable error message"
|
|
510
|
+
},
|
|
511
|
+
"name": {
|
|
512
|
+
"description": "Unique name of the rule",
|
|
513
|
+
"type": "string"
|
|
514
|
+
},
|
|
515
|
+
"severity": {
|
|
516
|
+
"$ref": "#/definitions/ValidationSeverity",
|
|
517
|
+
"description": "Severity level"
|
|
518
|
+
},
|
|
519
|
+
"skip_bulk": {
|
|
520
|
+
"description": "Skip in bulk operations",
|
|
521
|
+
"type": "boolean"
|
|
522
|
+
},
|
|
523
|
+
"timeout": {
|
|
524
|
+
"description": "Timeout for async validation (ms)",
|
|
525
|
+
"type": "number"
|
|
526
|
+
},
|
|
527
|
+
"trigger": {
|
|
528
|
+
"description": "Operations that trigger this rule",
|
|
529
|
+
"items": {
|
|
530
|
+
"$ref": "#/definitions/ValidationTrigger"
|
|
531
|
+
},
|
|
532
|
+
"type": "array"
|
|
533
|
+
},
|
|
534
|
+
"type": {
|
|
535
|
+
"const": "dependency",
|
|
536
|
+
"description": "Type of validation rule",
|
|
537
|
+
"type": "string"
|
|
538
|
+
}
|
|
539
|
+
},
|
|
540
|
+
"required": [
|
|
541
|
+
"message",
|
|
542
|
+
"name",
|
|
543
|
+
"type"
|
|
544
|
+
],
|
|
545
|
+
"type": "object"
|
|
546
|
+
},
|
|
547
|
+
"FieldConfig": {
|
|
548
|
+
"additionalProperties": false,
|
|
549
|
+
"description": "Configuration for a single field on an object. This defines the schema, validation rules, and UI hints for the attribute.",
|
|
550
|
+
"properties": {
|
|
551
|
+
"ai_context": {
|
|
552
|
+
"$ref": "#/definitions/ValidationAiContext",
|
|
553
|
+
"description": "AI context for the field. Provides semantic information for AI tools."
|
|
554
|
+
},
|
|
555
|
+
"defaultValue": {
|
|
556
|
+
"description": "The default value if not provided during creation."
|
|
557
|
+
},
|
|
558
|
+
"description": {
|
|
559
|
+
"description": "Description of the field for documentation or tooltip.",
|
|
560
|
+
"type": "string"
|
|
561
|
+
},
|
|
562
|
+
"dimension": {
|
|
563
|
+
"description": "Dimension of the vector for 'vector' type fields.",
|
|
564
|
+
"type": "number"
|
|
565
|
+
},
|
|
566
|
+
"filters": {
|
|
567
|
+
"items": {},
|
|
568
|
+
"type": "array"
|
|
569
|
+
},
|
|
570
|
+
"formula": {
|
|
571
|
+
"description": "Formula expression.",
|
|
572
|
+
"type": "string"
|
|
573
|
+
},
|
|
574
|
+
"help_text": {
|
|
575
|
+
"description": "Tooltip or help text for the user.",
|
|
576
|
+
"type": "string"
|
|
577
|
+
},
|
|
578
|
+
"hidden": {
|
|
579
|
+
"description": "Whether the field is hidden from default UI/API response.",
|
|
580
|
+
"type": "boolean"
|
|
581
|
+
},
|
|
582
|
+
"index": {
|
|
583
|
+
"description": "Whether to create a database index for this field.",
|
|
584
|
+
"type": "boolean"
|
|
585
|
+
},
|
|
586
|
+
"label": {
|
|
587
|
+
"description": "The human-readable label used in UIs.",
|
|
588
|
+
"type": "string"
|
|
589
|
+
},
|
|
590
|
+
"max": {
|
|
591
|
+
"description": "Maximum for number/currency/percent.",
|
|
592
|
+
"type": "number"
|
|
593
|
+
},
|
|
594
|
+
"max_length": {
|
|
595
|
+
"description": "Maximum length for text based fields.",
|
|
596
|
+
"type": "number"
|
|
597
|
+
},
|
|
598
|
+
"min": {
|
|
599
|
+
"description": "Minimum for number/currency/percent.",
|
|
600
|
+
"type": "number"
|
|
601
|
+
},
|
|
602
|
+
"min_length": {
|
|
603
|
+
"description": "Minimum length for text based fields.",
|
|
604
|
+
"type": "number"
|
|
605
|
+
},
|
|
606
|
+
"multiple": {
|
|
607
|
+
"description": "Whether the field allows multiple values. Supported by 'select', 'lookup', 'file', 'image'.",
|
|
608
|
+
"type": "boolean"
|
|
609
|
+
},
|
|
610
|
+
"name": {
|
|
611
|
+
"description": "The unique API name of the field. If defined within an object map, this is often automatically populated from the key.",
|
|
612
|
+
"type": "string"
|
|
613
|
+
},
|
|
614
|
+
"options": {
|
|
615
|
+
"description": "Options for select fields. List of available choices for select/multiselect fields.",
|
|
616
|
+
"items": {
|
|
617
|
+
"$ref": "#/definitions/FieldOption"
|
|
618
|
+
},
|
|
619
|
+
"type": "array"
|
|
620
|
+
},
|
|
621
|
+
"readonly": {
|
|
622
|
+
"description": "Whether the field is read-only in UI.",
|
|
623
|
+
"type": "boolean"
|
|
624
|
+
},
|
|
625
|
+
"reference_to": {
|
|
626
|
+
"description": "Reference to another object for lookup/master_detail fields. Specifies the target object name for relationship fields.",
|
|
627
|
+
"type": "string"
|
|
628
|
+
},
|
|
629
|
+
"regex": {
|
|
630
|
+
"description": "Regular expression pattern for validation.",
|
|
631
|
+
"type": "string"
|
|
632
|
+
},
|
|
633
|
+
"required": {
|
|
634
|
+
"description": "Whether the field is mandatory. Defaults to false.",
|
|
635
|
+
"type": "boolean"
|
|
636
|
+
},
|
|
637
|
+
"summary_field": {
|
|
638
|
+
"description": "Field on the summary object.",
|
|
639
|
+
"type": "string"
|
|
640
|
+
},
|
|
641
|
+
"summary_object": {
|
|
642
|
+
"description": "Object to summarize.",
|
|
643
|
+
"type": "string"
|
|
644
|
+
},
|
|
645
|
+
"summary_type": {
|
|
646
|
+
"description": "Type of summary (count, sum, min, max, avg).",
|
|
647
|
+
"type": "string"
|
|
648
|
+
},
|
|
649
|
+
"type": {
|
|
650
|
+
"$ref": "#/definitions/FieldType",
|
|
651
|
+
"description": "The data type of the field."
|
|
652
|
+
},
|
|
653
|
+
"unique": {
|
|
654
|
+
"description": "Whether the field is unique in the table.",
|
|
655
|
+
"type": "boolean"
|
|
656
|
+
},
|
|
657
|
+
"validation": {
|
|
658
|
+
"$ref": "#/definitions/FieldValidation",
|
|
659
|
+
"description": "Field validation configuration. Defines validation rules applied at the field level."
|
|
660
|
+
}
|
|
661
|
+
},
|
|
662
|
+
"required": [
|
|
663
|
+
"type"
|
|
664
|
+
],
|
|
665
|
+
"type": "object"
|
|
666
|
+
},
|
|
667
|
+
"FieldOption": {
|
|
668
|
+
"additionalProperties": false,
|
|
669
|
+
"description": "Defines a single option for select/multiselect fields.",
|
|
670
|
+
"properties": {
|
|
671
|
+
"label": {
|
|
672
|
+
"description": "The display label for the option.",
|
|
673
|
+
"type": "string"
|
|
674
|
+
},
|
|
675
|
+
"value": {
|
|
676
|
+
"description": "The actual value stored in the database.",
|
|
677
|
+
"type": [
|
|
678
|
+
"string",
|
|
679
|
+
"number"
|
|
680
|
+
]
|
|
681
|
+
}
|
|
682
|
+
},
|
|
683
|
+
"required": [
|
|
684
|
+
"label",
|
|
685
|
+
"value"
|
|
686
|
+
],
|
|
687
|
+
"type": "object"
|
|
688
|
+
},
|
|
689
|
+
"FieldType": {
|
|
690
|
+
"description": "Represents the supported field data types in the ObjectQL schema. These types determine how data is stored, validated, and rendered.\n\n- `text`: Simple string.\n- `textarea`: Long string.\n- `select`: Choice from a list.\n- `lookup`: Relationship to another object.",
|
|
691
|
+
"enum": [
|
|
692
|
+
"text",
|
|
693
|
+
"textarea",
|
|
694
|
+
"markdown",
|
|
695
|
+
"html",
|
|
696
|
+
"select",
|
|
697
|
+
"date",
|
|
698
|
+
"datetime",
|
|
699
|
+
"time",
|
|
700
|
+
"number",
|
|
701
|
+
"currency",
|
|
702
|
+
"percent",
|
|
703
|
+
"boolean",
|
|
704
|
+
"email",
|
|
705
|
+
"phone",
|
|
706
|
+
"url",
|
|
707
|
+
"image",
|
|
708
|
+
"file",
|
|
709
|
+
"avatar",
|
|
710
|
+
"location",
|
|
711
|
+
"lookup",
|
|
712
|
+
"master_detail",
|
|
713
|
+
"password",
|
|
714
|
+
"formula",
|
|
715
|
+
"summary",
|
|
716
|
+
"auto_number",
|
|
717
|
+
"object",
|
|
718
|
+
"vector",
|
|
719
|
+
"grid"
|
|
720
|
+
],
|
|
721
|
+
"type": "string"
|
|
722
|
+
},
|
|
723
|
+
"FieldValidation": {
|
|
724
|
+
"additionalProperties": false,
|
|
725
|
+
"description": "Field validation configuration (built into FieldConfig).",
|
|
726
|
+
"properties": {
|
|
727
|
+
"format": {
|
|
728
|
+
"description": "Format validation (email, url, etc.)",
|
|
729
|
+
"enum": [
|
|
730
|
+
"email",
|
|
731
|
+
"url",
|
|
732
|
+
"phone",
|
|
733
|
+
"date",
|
|
734
|
+
"datetime"
|
|
735
|
+
],
|
|
736
|
+
"type": "string"
|
|
737
|
+
},
|
|
738
|
+
"max": {
|
|
739
|
+
"description": "Maximum value for numbers",
|
|
740
|
+
"type": "number"
|
|
741
|
+
},
|
|
742
|
+
"max_length": {
|
|
743
|
+
"description": "Maximum length for strings",
|
|
744
|
+
"type": "number"
|
|
745
|
+
},
|
|
746
|
+
"message": {
|
|
747
|
+
"description": "Custom validation message",
|
|
748
|
+
"type": "string"
|
|
749
|
+
},
|
|
750
|
+
"min": {
|
|
751
|
+
"description": "Minimum value for numbers",
|
|
752
|
+
"type": "number"
|
|
753
|
+
},
|
|
754
|
+
"min_length": {
|
|
755
|
+
"description": "Minimum length for strings",
|
|
756
|
+
"type": "number"
|
|
757
|
+
},
|
|
758
|
+
"pattern": {
|
|
759
|
+
"description": "Regular expression pattern for validation",
|
|
760
|
+
"type": "string"
|
|
761
|
+
},
|
|
762
|
+
"protocols": {
|
|
763
|
+
"description": "Allowed protocols for URL validation",
|
|
764
|
+
"items": {
|
|
765
|
+
"type": "string"
|
|
766
|
+
},
|
|
767
|
+
"type": "array"
|
|
768
|
+
},
|
|
769
|
+
"regex": {
|
|
770
|
+
"deprecated": "Use pattern instead",
|
|
771
|
+
"type": "string"
|
|
772
|
+
}
|
|
773
|
+
},
|
|
774
|
+
"type": "object"
|
|
775
|
+
},
|
|
776
|
+
"IndexConfig": {
|
|
777
|
+
"additionalProperties": false,
|
|
778
|
+
"properties": {
|
|
779
|
+
"fields": {
|
|
780
|
+
"description": "List of fields involved in the index",
|
|
781
|
+
"items": {
|
|
782
|
+
"type": "string"
|
|
783
|
+
},
|
|
784
|
+
"type": "array"
|
|
785
|
+
},
|
|
786
|
+
"unique": {
|
|
787
|
+
"description": "Whether the index enforces uniqueness",
|
|
788
|
+
"type": "boolean"
|
|
789
|
+
}
|
|
790
|
+
},
|
|
791
|
+
"required": [
|
|
792
|
+
"fields"
|
|
793
|
+
],
|
|
794
|
+
"type": "object"
|
|
795
|
+
},
|
|
796
|
+
"ObjectAiConfig": {
|
|
797
|
+
"additionalProperties": false,
|
|
798
|
+
"properties": {
|
|
799
|
+
"search": {
|
|
800
|
+
"$ref": "#/definitions/AiSearchConfig",
|
|
801
|
+
"description": "Configuration for semantic search / RAG"
|
|
802
|
+
}
|
|
803
|
+
},
|
|
804
|
+
"type": "object"
|
|
805
|
+
},
|
|
806
|
+
"ObjectConfig": {
|
|
807
|
+
"additionalProperties": false,
|
|
808
|
+
"properties": {
|
|
809
|
+
"actions": {
|
|
810
|
+
"additionalProperties": {
|
|
811
|
+
"$ref": "#/definitions/ActionConfig"
|
|
812
|
+
},
|
|
813
|
+
"type": "object"
|
|
814
|
+
},
|
|
815
|
+
"ai": {
|
|
816
|
+
"$ref": "#/definitions/ObjectAiConfig",
|
|
817
|
+
"description": "AI capabilities configuration"
|
|
818
|
+
},
|
|
819
|
+
"datasource": {
|
|
820
|
+
"type": "string"
|
|
821
|
+
},
|
|
822
|
+
"description": {
|
|
823
|
+
"type": "string"
|
|
824
|
+
},
|
|
825
|
+
"fields": {
|
|
826
|
+
"additionalProperties": {
|
|
827
|
+
"$ref": "#/definitions/FieldConfig"
|
|
828
|
+
},
|
|
829
|
+
"type": "object"
|
|
830
|
+
},
|
|
831
|
+
"icon": {
|
|
832
|
+
"type": "string"
|
|
833
|
+
},
|
|
834
|
+
"indexes": {
|
|
835
|
+
"additionalProperties": {
|
|
836
|
+
"$ref": "#/definitions/IndexConfig"
|
|
837
|
+
},
|
|
838
|
+
"type": "object"
|
|
839
|
+
},
|
|
840
|
+
"label": {
|
|
841
|
+
"type": "string"
|
|
842
|
+
},
|
|
843
|
+
"name": {
|
|
844
|
+
"type": "string"
|
|
845
|
+
},
|
|
846
|
+
"validation": {
|
|
847
|
+
"additionalProperties": false,
|
|
848
|
+
"description": "Validation rules for this object",
|
|
849
|
+
"properties": {
|
|
850
|
+
"ai_context": {
|
|
851
|
+
"additionalProperties": false,
|
|
852
|
+
"description": "AI context for validation strategy",
|
|
853
|
+
"properties": {
|
|
854
|
+
"intent": {
|
|
855
|
+
"type": "string"
|
|
856
|
+
},
|
|
857
|
+
"validation_strategy": {
|
|
858
|
+
"type": "string"
|
|
859
|
+
}
|
|
860
|
+
},
|
|
861
|
+
"type": "object"
|
|
862
|
+
},
|
|
863
|
+
"rules": {
|
|
864
|
+
"description": "Validation rules",
|
|
865
|
+
"items": {
|
|
866
|
+
"$ref": "#/definitions/AnyValidationRule"
|
|
867
|
+
},
|
|
868
|
+
"type": "array"
|
|
869
|
+
}
|
|
870
|
+
},
|
|
871
|
+
"type": "object"
|
|
872
|
+
}
|
|
873
|
+
},
|
|
874
|
+
"required": [
|
|
875
|
+
"name",
|
|
876
|
+
"fields"
|
|
877
|
+
],
|
|
878
|
+
"type": "object"
|
|
879
|
+
},
|
|
880
|
+
"StateMachineValidationRule": {
|
|
881
|
+
"additionalProperties": false,
|
|
882
|
+
"description": "State machine validation rule.",
|
|
883
|
+
"properties": {
|
|
884
|
+
"ai_context": {
|
|
885
|
+
"$ref": "#/definitions/ValidationAiContext",
|
|
886
|
+
"description": "AI context for understanding the rule"
|
|
887
|
+
},
|
|
888
|
+
"apply_when": {
|
|
889
|
+
"$ref": "#/definitions/ValidationCondition",
|
|
890
|
+
"description": "Condition for applying the rule"
|
|
891
|
+
},
|
|
892
|
+
"async": {
|
|
893
|
+
"description": "Whether this is an async validation",
|
|
894
|
+
"type": "boolean"
|
|
895
|
+
},
|
|
896
|
+
"context": {
|
|
897
|
+
"description": "Contexts where this rule applies",
|
|
898
|
+
"items": {
|
|
899
|
+
"type": "string"
|
|
900
|
+
},
|
|
901
|
+
"type": "array"
|
|
902
|
+
},
|
|
903
|
+
"error_code": {
|
|
904
|
+
"description": "Error code for programmatic handling",
|
|
905
|
+
"type": "string"
|
|
906
|
+
},
|
|
907
|
+
"field": {
|
|
908
|
+
"description": "Field containing the state",
|
|
909
|
+
"type": "string"
|
|
910
|
+
},
|
|
911
|
+
"fields": {
|
|
912
|
+
"description": "Fields that trigger this rule when changed",
|
|
913
|
+
"items": {
|
|
914
|
+
"type": "string"
|
|
915
|
+
},
|
|
916
|
+
"type": "array"
|
|
917
|
+
},
|
|
918
|
+
"initial_states": {
|
|
919
|
+
"description": "Initial states",
|
|
920
|
+
"items": {
|
|
921
|
+
"type": "string"
|
|
922
|
+
},
|
|
923
|
+
"type": "array"
|
|
924
|
+
},
|
|
925
|
+
"message": {
|
|
926
|
+
"anyOf": [
|
|
927
|
+
{
|
|
928
|
+
"type": "string"
|
|
929
|
+
},
|
|
930
|
+
{
|
|
931
|
+
"additionalProperties": {
|
|
932
|
+
"type": "string"
|
|
933
|
+
},
|
|
934
|
+
"type": "object"
|
|
935
|
+
}
|
|
936
|
+
],
|
|
937
|
+
"description": "Human-readable error message"
|
|
938
|
+
},
|
|
939
|
+
"name": {
|
|
940
|
+
"description": "Unique name of the rule",
|
|
941
|
+
"type": "string"
|
|
942
|
+
},
|
|
943
|
+
"severity": {
|
|
944
|
+
"$ref": "#/definitions/ValidationSeverity",
|
|
945
|
+
"description": "Severity level"
|
|
946
|
+
},
|
|
947
|
+
"skip_bulk": {
|
|
948
|
+
"description": "Skip in bulk operations",
|
|
949
|
+
"type": "boolean"
|
|
950
|
+
},
|
|
951
|
+
"timeout": {
|
|
952
|
+
"description": "Timeout for async validation (ms)",
|
|
953
|
+
"type": "number"
|
|
954
|
+
},
|
|
955
|
+
"transition_conditions": {
|
|
956
|
+
"description": "Transition conditions",
|
|
957
|
+
"type": "object"
|
|
958
|
+
},
|
|
959
|
+
"transitions": {
|
|
960
|
+
"additionalProperties": {
|
|
961
|
+
"anyOf": [
|
|
962
|
+
{
|
|
963
|
+
"$ref": "#/definitions/StateTransition"
|
|
964
|
+
},
|
|
965
|
+
{
|
|
966
|
+
"items": {
|
|
967
|
+
"type": "string"
|
|
968
|
+
},
|
|
969
|
+
"type": "array"
|
|
970
|
+
}
|
|
971
|
+
]
|
|
972
|
+
},
|
|
973
|
+
"description": "Valid state transitions",
|
|
974
|
+
"type": "object"
|
|
975
|
+
},
|
|
976
|
+
"trigger": {
|
|
977
|
+
"description": "Operations that trigger this rule",
|
|
978
|
+
"items": {
|
|
979
|
+
"$ref": "#/definitions/ValidationTrigger"
|
|
980
|
+
},
|
|
981
|
+
"type": "array"
|
|
982
|
+
},
|
|
983
|
+
"type": {
|
|
984
|
+
"const": "state_machine",
|
|
985
|
+
"description": "Type of validation rule",
|
|
986
|
+
"type": "string"
|
|
987
|
+
}
|
|
988
|
+
},
|
|
989
|
+
"required": [
|
|
990
|
+
"field",
|
|
991
|
+
"message",
|
|
992
|
+
"name",
|
|
993
|
+
"type"
|
|
994
|
+
],
|
|
995
|
+
"type": "object"
|
|
996
|
+
},
|
|
997
|
+
"StateTransition": {
|
|
998
|
+
"additionalProperties": false,
|
|
999
|
+
"description": "State transition definition for state machine validation.",
|
|
1000
|
+
"properties": {
|
|
1001
|
+
"ai_context": {
|
|
1002
|
+
"$ref": "#/definitions/ValidationAiContext",
|
|
1003
|
+
"description": "AI context for the transition"
|
|
1004
|
+
},
|
|
1005
|
+
"allowed_next": {
|
|
1006
|
+
"description": "States that can transition to this state",
|
|
1007
|
+
"items": {
|
|
1008
|
+
"type": "string"
|
|
1009
|
+
},
|
|
1010
|
+
"type": "array"
|
|
1011
|
+
},
|
|
1012
|
+
"is_terminal": {
|
|
1013
|
+
"description": "Whether this is a terminal state",
|
|
1014
|
+
"type": "boolean"
|
|
1015
|
+
}
|
|
1016
|
+
},
|
|
1017
|
+
"type": "object"
|
|
1018
|
+
},
|
|
1019
|
+
"UniquenessValidationRule": {
|
|
1020
|
+
"additionalProperties": false,
|
|
1021
|
+
"description": "Uniqueness validation rule.",
|
|
1022
|
+
"properties": {
|
|
1023
|
+
"ai_context": {
|
|
1024
|
+
"$ref": "#/definitions/ValidationAiContext",
|
|
1025
|
+
"description": "AI context for understanding the rule"
|
|
1026
|
+
},
|
|
1027
|
+
"apply_when": {
|
|
1028
|
+
"$ref": "#/definitions/ValidationCondition",
|
|
1029
|
+
"description": "Condition for applying the rule"
|
|
1030
|
+
},
|
|
1031
|
+
"async": {
|
|
1032
|
+
"description": "Whether this is an async validation",
|
|
1033
|
+
"type": "boolean"
|
|
1034
|
+
},
|
|
1035
|
+
"case_sensitive": {
|
|
1036
|
+
"description": "Case sensitivity for string comparison",
|
|
1037
|
+
"type": "boolean"
|
|
1038
|
+
},
|
|
1039
|
+
"context": {
|
|
1040
|
+
"description": "Contexts where this rule applies",
|
|
1041
|
+
"items": {
|
|
1042
|
+
"type": "string"
|
|
1043
|
+
},
|
|
1044
|
+
"type": "array"
|
|
1045
|
+
},
|
|
1046
|
+
"error_code": {
|
|
1047
|
+
"description": "Error code for programmatic handling",
|
|
1048
|
+
"type": "string"
|
|
1049
|
+
},
|
|
1050
|
+
"field": {
|
|
1051
|
+
"description": "Field to check for uniqueness",
|
|
1052
|
+
"type": "string"
|
|
1053
|
+
},
|
|
1054
|
+
"fields": {
|
|
1055
|
+
"description": "Multiple fields for composite uniqueness",
|
|
1056
|
+
"items": {
|
|
1057
|
+
"type": "string"
|
|
1058
|
+
},
|
|
1059
|
+
"type": "array"
|
|
1060
|
+
},
|
|
1061
|
+
"message": {
|
|
1062
|
+
"anyOf": [
|
|
1063
|
+
{
|
|
1064
|
+
"type": "string"
|
|
1065
|
+
},
|
|
1066
|
+
{
|
|
1067
|
+
"additionalProperties": {
|
|
1068
|
+
"type": "string"
|
|
1069
|
+
},
|
|
1070
|
+
"type": "object"
|
|
1071
|
+
}
|
|
1072
|
+
],
|
|
1073
|
+
"description": "Human-readable error message"
|
|
1074
|
+
},
|
|
1075
|
+
"name": {
|
|
1076
|
+
"description": "Unique name of the rule",
|
|
1077
|
+
"type": "string"
|
|
1078
|
+
},
|
|
1079
|
+
"scope": {
|
|
1080
|
+
"$ref": "#/definitions/ValidationCondition",
|
|
1081
|
+
"description": "Scope constraint for conditional uniqueness"
|
|
1082
|
+
},
|
|
1083
|
+
"severity": {
|
|
1084
|
+
"$ref": "#/definitions/ValidationSeverity",
|
|
1085
|
+
"description": "Severity level"
|
|
1086
|
+
},
|
|
1087
|
+
"skip_bulk": {
|
|
1088
|
+
"description": "Skip in bulk operations",
|
|
1089
|
+
"type": "boolean"
|
|
1090
|
+
},
|
|
1091
|
+
"timeout": {
|
|
1092
|
+
"description": "Timeout for async validation (ms)",
|
|
1093
|
+
"type": "number"
|
|
1094
|
+
},
|
|
1095
|
+
"trigger": {
|
|
1096
|
+
"description": "Operations that trigger this rule",
|
|
1097
|
+
"items": {
|
|
1098
|
+
"$ref": "#/definitions/ValidationTrigger"
|
|
1099
|
+
},
|
|
1100
|
+
"type": "array"
|
|
1101
|
+
},
|
|
1102
|
+
"type": {
|
|
1103
|
+
"const": "unique",
|
|
1104
|
+
"description": "Type of validation rule",
|
|
1105
|
+
"type": "string"
|
|
1106
|
+
}
|
|
1107
|
+
},
|
|
1108
|
+
"required": [
|
|
1109
|
+
"message",
|
|
1110
|
+
"name",
|
|
1111
|
+
"type"
|
|
1112
|
+
],
|
|
1113
|
+
"type": "object"
|
|
1114
|
+
},
|
|
1115
|
+
"ValidationAiContext": {
|
|
1116
|
+
"additionalProperties": false,
|
|
1117
|
+
"description": "AI context for validation rules. Provides semantic information for AI tools to understand validation intent.",
|
|
1118
|
+
"properties": {
|
|
1119
|
+
"algorithm": {
|
|
1120
|
+
"description": "Algorithm description for complex validation",
|
|
1121
|
+
"type": "string"
|
|
1122
|
+
},
|
|
1123
|
+
"business_rule": {
|
|
1124
|
+
"description": "Business rule description in natural language",
|
|
1125
|
+
"type": "string"
|
|
1126
|
+
},
|
|
1127
|
+
"compliance": {
|
|
1128
|
+
"description": "Compliance requirements",
|
|
1129
|
+
"type": "string"
|
|
1130
|
+
},
|
|
1131
|
+
"data_dependency": {
|
|
1132
|
+
"description": "External dependencies required for validation",
|
|
1133
|
+
"type": "string"
|
|
1134
|
+
},
|
|
1135
|
+
"decision_logic": {
|
|
1136
|
+
"description": "Decision logic in natural language",
|
|
1137
|
+
"type": "string"
|
|
1138
|
+
},
|
|
1139
|
+
"error_impact": {
|
|
1140
|
+
"description": "Impact level if validation fails",
|
|
1141
|
+
"enum": [
|
|
1142
|
+
"high",
|
|
1143
|
+
"medium",
|
|
1144
|
+
"low"
|
|
1145
|
+
],
|
|
1146
|
+
"type": "string"
|
|
1147
|
+
},
|
|
1148
|
+
"examples": {
|
|
1149
|
+
"additionalProperties": false,
|
|
1150
|
+
"description": "Examples of valid/invalid data",
|
|
1151
|
+
"properties": {
|
|
1152
|
+
"invalid": {
|
|
1153
|
+
"items": {},
|
|
1154
|
+
"type": "array"
|
|
1155
|
+
},
|
|
1156
|
+
"valid": {
|
|
1157
|
+
"items": {},
|
|
1158
|
+
"type": "array"
|
|
1159
|
+
}
|
|
1160
|
+
},
|
|
1161
|
+
"type": "object"
|
|
1162
|
+
},
|
|
1163
|
+
"external_dependency": {
|
|
1164
|
+
"description": "External system dependencies",
|
|
1165
|
+
"type": "string"
|
|
1166
|
+
},
|
|
1167
|
+
"intent": {
|
|
1168
|
+
"description": "Business intent behind the validation rule",
|
|
1169
|
+
"type": "string"
|
|
1170
|
+
},
|
|
1171
|
+
"rationale": {
|
|
1172
|
+
"description": "Rationale for the rule",
|
|
1173
|
+
"type": "string"
|
|
1174
|
+
},
|
|
1175
|
+
"visualization": {
|
|
1176
|
+
"description": "Visualization of the validation logic",
|
|
1177
|
+
"type": "string"
|
|
1178
|
+
}
|
|
1179
|
+
},
|
|
1180
|
+
"type": "object"
|
|
1181
|
+
},
|
|
1182
|
+
"ValidationCondition": {
|
|
1183
|
+
"additionalProperties": false,
|
|
1184
|
+
"description": "Condition for applying validation rules.",
|
|
1185
|
+
"properties": {
|
|
1186
|
+
"all_of": {
|
|
1187
|
+
"description": "Logical AND conditions",
|
|
1188
|
+
"items": {
|
|
1189
|
+
"$ref": "#/definitions/ValidationCondition"
|
|
1190
|
+
},
|
|
1191
|
+
"type": "array"
|
|
1192
|
+
},
|
|
1193
|
+
"any_of": {
|
|
1194
|
+
"description": "Logical OR conditions",
|
|
1195
|
+
"items": {
|
|
1196
|
+
"$ref": "#/definitions/ValidationCondition"
|
|
1197
|
+
},
|
|
1198
|
+
"type": "array"
|
|
1199
|
+
},
|
|
1200
|
+
"compare_to": {
|
|
1201
|
+
"description": "Field name to compare against (for cross-field validation)",
|
|
1202
|
+
"type": "string"
|
|
1203
|
+
},
|
|
1204
|
+
"expression": {
|
|
1205
|
+
"description": "Expression to evaluate",
|
|
1206
|
+
"type": "string"
|
|
1207
|
+
},
|
|
1208
|
+
"field": {
|
|
1209
|
+
"description": "Field to check",
|
|
1210
|
+
"type": "string"
|
|
1211
|
+
},
|
|
1212
|
+
"operator": {
|
|
1213
|
+
"$ref": "#/definitions/ValidationOperator",
|
|
1214
|
+
"description": "Comparison operator"
|
|
1215
|
+
},
|
|
1216
|
+
"value": {
|
|
1217
|
+
"description": "Value to compare against"
|
|
1218
|
+
}
|
|
1219
|
+
},
|
|
1220
|
+
"type": "object"
|
|
1221
|
+
},
|
|
1222
|
+
"ValidationOperator": {
|
|
1223
|
+
"description": "Comparison operators for validation rules.",
|
|
1224
|
+
"enum": [
|
|
1225
|
+
"=",
|
|
1226
|
+
"!=",
|
|
1227
|
+
">",
|
|
1228
|
+
">=",
|
|
1229
|
+
"<",
|
|
1230
|
+
"<=",
|
|
1231
|
+
"in",
|
|
1232
|
+
"not_in",
|
|
1233
|
+
"contains",
|
|
1234
|
+
"not_contains",
|
|
1235
|
+
"starts_with",
|
|
1236
|
+
"ends_with"
|
|
1237
|
+
],
|
|
1238
|
+
"type": "string"
|
|
1239
|
+
},
|
|
1240
|
+
"ValidationRelationship": {
|
|
1241
|
+
"additionalProperties": false,
|
|
1242
|
+
"description": "Relationship lookup for business rule validation.",
|
|
1243
|
+
"properties": {
|
|
1244
|
+
"field": {
|
|
1245
|
+
"description": "Field(s) to fetch from related object",
|
|
1246
|
+
"type": "string"
|
|
1247
|
+
},
|
|
1248
|
+
"fields": {
|
|
1249
|
+
"items": {
|
|
1250
|
+
"type": "string"
|
|
1251
|
+
},
|
|
1252
|
+
"type": "array"
|
|
1253
|
+
},
|
|
1254
|
+
"object": {
|
|
1255
|
+
"description": "Related object name",
|
|
1256
|
+
"type": "string"
|
|
1257
|
+
},
|
|
1258
|
+
"validate": {
|
|
1259
|
+
"$ref": "#/definitions/ValidationCondition",
|
|
1260
|
+
"description": "Validation to apply on related record"
|
|
1261
|
+
},
|
|
1262
|
+
"via": {
|
|
1263
|
+
"description": "Field that links to the related object",
|
|
1264
|
+
"type": "string"
|
|
1265
|
+
}
|
|
1266
|
+
},
|
|
1267
|
+
"type": "object"
|
|
1268
|
+
},
|
|
1269
|
+
"ValidationRule": {
|
|
1270
|
+
"additionalProperties": false,
|
|
1271
|
+
"description": "Base validation rule definition.",
|
|
1272
|
+
"properties": {
|
|
1273
|
+
"ai_context": {
|
|
1274
|
+
"$ref": "#/definitions/ValidationAiContext",
|
|
1275
|
+
"description": "AI context for understanding the rule"
|
|
1276
|
+
},
|
|
1277
|
+
"apply_when": {
|
|
1278
|
+
"$ref": "#/definitions/ValidationCondition",
|
|
1279
|
+
"description": "Condition for applying the rule"
|
|
1280
|
+
},
|
|
1281
|
+
"async": {
|
|
1282
|
+
"description": "Whether this is an async validation",
|
|
1283
|
+
"type": "boolean"
|
|
1284
|
+
},
|
|
1285
|
+
"context": {
|
|
1286
|
+
"description": "Contexts where this rule applies",
|
|
1287
|
+
"items": {
|
|
1288
|
+
"type": "string"
|
|
1289
|
+
},
|
|
1290
|
+
"type": "array"
|
|
1291
|
+
},
|
|
1292
|
+
"error_code": {
|
|
1293
|
+
"description": "Error code for programmatic handling",
|
|
1294
|
+
"type": "string"
|
|
1295
|
+
},
|
|
1296
|
+
"fields": {
|
|
1297
|
+
"description": "Fields that trigger this rule when changed",
|
|
1298
|
+
"items": {
|
|
1299
|
+
"type": "string"
|
|
1300
|
+
},
|
|
1301
|
+
"type": "array"
|
|
1302
|
+
},
|
|
1303
|
+
"message": {
|
|
1304
|
+
"anyOf": [
|
|
1305
|
+
{
|
|
1306
|
+
"type": "string"
|
|
1307
|
+
},
|
|
1308
|
+
{
|
|
1309
|
+
"additionalProperties": {
|
|
1310
|
+
"type": "string"
|
|
1311
|
+
},
|
|
1312
|
+
"type": "object"
|
|
1313
|
+
}
|
|
1314
|
+
],
|
|
1315
|
+
"description": "Human-readable error message"
|
|
1316
|
+
},
|
|
1317
|
+
"name": {
|
|
1318
|
+
"description": "Unique name of the rule",
|
|
1319
|
+
"type": "string"
|
|
1320
|
+
},
|
|
1321
|
+
"severity": {
|
|
1322
|
+
"$ref": "#/definitions/ValidationSeverity",
|
|
1323
|
+
"description": "Severity level"
|
|
1324
|
+
},
|
|
1325
|
+
"skip_bulk": {
|
|
1326
|
+
"description": "Skip in bulk operations",
|
|
1327
|
+
"type": "boolean"
|
|
1328
|
+
},
|
|
1329
|
+
"timeout": {
|
|
1330
|
+
"description": "Timeout for async validation (ms)",
|
|
1331
|
+
"type": "number"
|
|
1332
|
+
},
|
|
1333
|
+
"trigger": {
|
|
1334
|
+
"description": "Operations that trigger this rule",
|
|
1335
|
+
"items": {
|
|
1336
|
+
"$ref": "#/definitions/ValidationTrigger"
|
|
1337
|
+
},
|
|
1338
|
+
"type": "array"
|
|
1339
|
+
},
|
|
1340
|
+
"type": {
|
|
1341
|
+
"$ref": "#/definitions/ValidationRuleType",
|
|
1342
|
+
"description": "Type of validation rule"
|
|
1343
|
+
}
|
|
1344
|
+
},
|
|
1345
|
+
"required": [
|
|
1346
|
+
"name",
|
|
1347
|
+
"type",
|
|
1348
|
+
"message"
|
|
1349
|
+
],
|
|
1350
|
+
"type": "object"
|
|
1351
|
+
},
|
|
1352
|
+
"ValidationRuleType": {
|
|
1353
|
+
"description": "Types of validation rules supported by ObjectQL.",
|
|
1354
|
+
"enum": [
|
|
1355
|
+
"field",
|
|
1356
|
+
"cross_field",
|
|
1357
|
+
"business_rule",
|
|
1358
|
+
"state_machine",
|
|
1359
|
+
"unique",
|
|
1360
|
+
"dependency",
|
|
1361
|
+
"custom"
|
|
1362
|
+
],
|
|
1363
|
+
"type": "string"
|
|
1364
|
+
},
|
|
1365
|
+
"ValidationSeverity": {
|
|
1366
|
+
"description": "Severity levels for validation errors.",
|
|
1367
|
+
"enum": [
|
|
1368
|
+
"error",
|
|
1369
|
+
"warning",
|
|
1370
|
+
"info"
|
|
1371
|
+
],
|
|
1372
|
+
"type": "string"
|
|
1373
|
+
},
|
|
1374
|
+
"ValidationTrigger": {
|
|
1375
|
+
"description": "Operations that can trigger validation.",
|
|
1376
|
+
"enum": [
|
|
1377
|
+
"create",
|
|
1378
|
+
"update",
|
|
1379
|
+
"delete"
|
|
1380
|
+
],
|
|
1381
|
+
"type": "string"
|
|
1382
|
+
}
|
|
1383
|
+
}
|
|
1384
|
+
}
|