@objectstack/spec 0.1.1 → 0.2.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 (174) hide show
  1. package/README.md +73 -1
  2. package/dist/api/contract.zod.d.ts +1733 -0
  3. package/dist/api/contract.zod.d.ts.map +1 -0
  4. package/dist/api/contract.zod.js +138 -0
  5. package/dist/data/dataset.zod.d.ts +2 -2
  6. package/dist/data/field.zod.d.ts +1648 -10
  7. package/dist/data/field.zod.d.ts.map +1 -1
  8. package/dist/data/field.zod.js +149 -8
  9. package/dist/data/filter.zod.d.ts +295 -0
  10. package/dist/data/filter.zod.d.ts.map +1 -0
  11. package/dist/data/filter.zod.js +226 -0
  12. package/dist/data/mapping.zod.d.ts +215 -2
  13. package/dist/data/mapping.zod.d.ts.map +1 -1
  14. package/dist/data/object.zod.d.ts +505 -25
  15. package/dist/data/object.zod.d.ts.map +1 -1
  16. package/dist/data/object.zod.js +32 -5
  17. package/dist/data/query.zod.d.ts +349 -0
  18. package/dist/data/query.zod.d.ts.map +1 -1
  19. package/dist/data/query.zod.js +77 -1
  20. package/dist/data/trigger.zod.d.ts +354 -0
  21. package/dist/data/trigger.zod.d.ts.map +1 -0
  22. package/dist/data/trigger.zod.js +195 -0
  23. package/dist/data/validation.zod.d.ts +83 -43
  24. package/dist/data/validation.zod.d.ts.map +1 -1
  25. package/dist/data/validation.zod.js +51 -5
  26. package/dist/index.d.ts +10 -0
  27. package/dist/index.d.ts.map +1 -1
  28. package/dist/index.js +11 -0
  29. package/dist/system/api.zod.d.ts +130 -4
  30. package/dist/system/api.zod.d.ts.map +1 -1
  31. package/dist/system/api.zod.js +4 -1
  32. package/dist/system/auth.zod.d.ts +2287 -0
  33. package/dist/system/auth.zod.d.ts.map +1 -0
  34. package/dist/system/auth.zod.js +365 -0
  35. package/dist/system/datasource.zod.d.ts +193 -30
  36. package/dist/system/datasource.zod.d.ts.map +1 -1
  37. package/dist/system/datasource.zod.js +58 -11
  38. package/dist/system/discovery.zod.d.ts +174 -0
  39. package/dist/system/discovery.zod.d.ts.map +1 -0
  40. package/dist/system/discovery.zod.js +53 -0
  41. package/dist/system/driver.zod.d.ts +1631 -0
  42. package/dist/system/driver.zod.d.ts.map +1 -0
  43. package/dist/system/driver.zod.js +337 -0
  44. package/dist/system/license.zod.d.ts +2 -2
  45. package/dist/system/manifest.zod.d.ts +323 -52
  46. package/dist/system/manifest.zod.d.ts.map +1 -1
  47. package/dist/system/manifest.zod.js +91 -17
  48. package/dist/system/plugin.zod.d.ts +3516 -0
  49. package/dist/system/plugin.zod.d.ts.map +1 -0
  50. package/dist/system/plugin.zod.js +226 -0
  51. package/dist/system/policy.zod.d.ts +10 -10
  52. package/dist/system/territory.zod.d.ts +1 -1
  53. package/dist/system/webhook.zod.d.ts +3 -3
  54. package/dist/ui/action.zod.d.ts +19 -12
  55. package/dist/ui/action.zod.d.ts.map +1 -1
  56. package/dist/ui/action.zod.js +7 -1
  57. package/dist/ui/app.zod.d.ts +109 -3
  58. package/dist/ui/app.zod.d.ts.map +1 -1
  59. package/dist/ui/app.zod.js +13 -2
  60. package/dist/ui/dashboard.zod.d.ts +19 -13
  61. package/dist/ui/dashboard.zod.d.ts.map +1 -1
  62. package/dist/ui/dashboard.zod.js +10 -3
  63. package/dist/ui/page.zod.d.ts +6 -6
  64. package/dist/ui/report.zod.d.ts +13 -32
  65. package/dist/ui/report.zod.d.ts.map +1 -1
  66. package/dist/ui/report.zod.js +10 -9
  67. package/dist/ui/theme.zod.d.ts +1221 -0
  68. package/dist/ui/theme.zod.d.ts.map +1 -0
  69. package/dist/ui/theme.zod.js +202 -0
  70. package/dist/ui/widget.zod.d.ts +350 -0
  71. package/dist/ui/widget.zod.d.ts.map +1 -0
  72. package/dist/ui/widget.zod.js +66 -0
  73. package/json-schema/AccountLinkingConfig.json +27 -0
  74. package/json-schema/Action.json +8 -2
  75. package/json-schema/ActionParam.json +8 -2
  76. package/json-schema/Address.json +40 -0
  77. package/json-schema/AggregationFunction.json +19 -0
  78. package/json-schema/AggregationNode.json +42 -0
  79. package/json-schema/Animation.json +56 -0
  80. package/json-schema/ApiCapabilities.json +28 -0
  81. package/json-schema/ApiError.json +27 -0
  82. package/json-schema/ApiRoutes.json +41 -0
  83. package/json-schema/App.json +13 -2
  84. package/json-schema/AsyncValidation.json +70 -0
  85. package/json-schema/AuthConfig.json +606 -0
  86. package/json-schema/AuthPluginConfig.json +28 -0
  87. package/json-schema/AuthStrategy.json +17 -0
  88. package/json-schema/AuthenticationConfig.json +601 -0
  89. package/json-schema/AuthenticationProvider.json +617 -0
  90. package/json-schema/BaseResponse.json +63 -0
  91. package/json-schema/BorderRadius.json +44 -0
  92. package/json-schema/Breakpoints.json +36 -0
  93. package/json-schema/BulkRequest.json +29 -0
  94. package/json-schema/BulkResponse.json +108 -0
  95. package/json-schema/CSRFConfig.json +31 -0
  96. package/json-schema/ColorPalette.json +83 -0
  97. package/json-schema/ComparisonOperator.json +56 -0
  98. package/json-schema/ConditionalValidation.json +793 -0
  99. package/json-schema/CreateRequest.json +20 -0
  100. package/json-schema/CrossFieldValidation.json +56 -0
  101. package/json-schema/CustomValidator.json +57 -0
  102. package/json-schema/Dashboard.json +20 -0
  103. package/json-schema/DashboardWidget.json +20 -0
  104. package/json-schema/DatabaseAdapter.json +38 -0
  105. package/json-schema/Datasource.json +25 -23
  106. package/json-schema/DatasourceCapabilities.json +25 -5
  107. package/json-schema/DeleteResponse.json +68 -0
  108. package/json-schema/Discovery.json +114 -0
  109. package/json-schema/DriverCapabilities.json +69 -0
  110. package/json-schema/DriverDefinition.json +86 -0
  111. package/json-schema/DriverInterface.json +88 -0
  112. package/json-schema/DriverOptions.json +23 -0
  113. package/json-schema/DriverType.json +1 -18
  114. package/json-schema/EmailPasswordConfig.json +43 -0
  115. package/json-schema/EqualityOperator.json +14 -0
  116. package/json-schema/ExportRequest.json +786 -0
  117. package/json-schema/Field.json +75 -4
  118. package/json-schema/FieldOperators.json +108 -0
  119. package/json-schema/FieldType.json +8 -2
  120. package/json-schema/FieldWidgetProps.json +327 -0
  121. package/json-schema/FilterCondition.json +28 -0
  122. package/json-schema/I18nContext.json +12 -0
  123. package/json-schema/JoinNode.json +455 -0
  124. package/json-schema/JoinType.json +15 -0
  125. package/json-schema/ListRecordResponse.json +103 -0
  126. package/json-schema/LocationCoordinates.json +36 -0
  127. package/json-schema/Logger.json +25 -0
  128. package/json-schema/MagicLinkConfig.json +21 -0
  129. package/json-schema/Manifest.json +243 -18
  130. package/json-schema/Mapping.json +328 -0
  131. package/json-schema/ModificationResult.json +46 -0
  132. package/json-schema/NormalizedFilter.json +348 -0
  133. package/json-schema/OAuthProvider.json +66 -0
  134. package/json-schema/Object.json +103 -6
  135. package/json-schema/ObjectCapabilities.json +26 -0
  136. package/json-schema/ObjectQLClient.json +12 -0
  137. package/json-schema/PasskeyConfig.json +54 -0
  138. package/json-schema/Plugin.json +20 -0
  139. package/json-schema/PluginContext.json +91 -0
  140. package/json-schema/PluginLifecycle.json +11 -0
  141. package/json-schema/Query.json +328 -0
  142. package/json-schema/QueryFilter.json +34 -0
  143. package/json-schema/RangeOperator.json +41 -0
  144. package/json-schema/RateLimitConfig.json +36 -0
  145. package/json-schema/RecordData.json +11 -0
  146. package/json-schema/Report.json +20 -26
  147. package/json-schema/Router.json +12 -0
  148. package/json-schema/Scheduler.json +12 -0
  149. package/json-schema/ScopedStorage.json +12 -0
  150. package/json-schema/SessionConfig.json +56 -0
  151. package/json-schema/SetOperator.json +18 -0
  152. package/json-schema/Shadow.json +44 -0
  153. package/json-schema/SingleRecordResponse.json +69 -0
  154. package/json-schema/Spacing.json +64 -0
  155. package/json-schema/SpecialOperator.json +18 -0
  156. package/json-schema/StandardAuthProvider.json +622 -0
  157. package/json-schema/StringOperator.json +21 -0
  158. package/json-schema/SystemAPI.json +12 -0
  159. package/json-schema/Theme.json +543 -0
  160. package/json-schema/ThemeMode.json +14 -0
  161. package/json-schema/Trigger.json +73 -0
  162. package/json-schema/TriggerAction.json +14 -0
  163. package/json-schema/TriggerContext.json +61 -0
  164. package/json-schema/TriggerTiming.json +13 -0
  165. package/json-schema/TwoFactorConfig.json +40 -0
  166. package/json-schema/Typography.json +142 -0
  167. package/json-schema/UpdateRequest.json +20 -0
  168. package/json-schema/UserFieldMapping.json +47 -0
  169. package/json-schema/ValidationRule.json +583 -0
  170. package/json-schema/WindowFunction.json +24 -0
  171. package/json-schema/WindowFunctionNode.json +104 -0
  172. package/json-schema/WindowSpec.json +65 -0
  173. package/json-schema/ZIndex.json +44 -0
  174. package/package.json +8 -3
@@ -0,0 +1,793 @@
1
+ {
2
+ "$ref": "#/definitions/ConditionalValidation",
3
+ "definitions": {
4
+ "ConditionalValidation": {
5
+ "type": "object",
6
+ "properties": {
7
+ "name": {
8
+ "type": "string",
9
+ "pattern": "^[a-z_][a-z0-9_]*$",
10
+ "description": "Unique rule name"
11
+ },
12
+ "active": {
13
+ "type": "boolean",
14
+ "default": true
15
+ },
16
+ "severity": {
17
+ "type": "string",
18
+ "enum": [
19
+ "error",
20
+ "warning",
21
+ "info"
22
+ ],
23
+ "default": "error"
24
+ },
25
+ "message": {
26
+ "type": "string",
27
+ "description": "Error message to display"
28
+ },
29
+ "type": {
30
+ "type": "string",
31
+ "const": "conditional"
32
+ },
33
+ "when": {
34
+ "type": "string",
35
+ "description": "Condition formula (e.g. \"type = 'enterprise'\")"
36
+ },
37
+ "then": {
38
+ "anyOf": [
39
+ {
40
+ "type": "object",
41
+ "properties": {
42
+ "name": {
43
+ "type": "string",
44
+ "pattern": "^[a-z_][a-z0-9_]*$",
45
+ "description": "Unique rule name"
46
+ },
47
+ "active": {
48
+ "type": "boolean",
49
+ "default": true
50
+ },
51
+ "severity": {
52
+ "type": "string",
53
+ "enum": [
54
+ "error",
55
+ "warning",
56
+ "info"
57
+ ],
58
+ "default": "error"
59
+ },
60
+ "message": {
61
+ "type": "string",
62
+ "description": "Error message to display"
63
+ },
64
+ "type": {
65
+ "type": "string",
66
+ "const": "script"
67
+ },
68
+ "condition": {
69
+ "type": "string",
70
+ "description": "Formula expression. If TRUE, validation fails. (e.g. amount < 0)"
71
+ }
72
+ },
73
+ "required": [
74
+ "name",
75
+ "message",
76
+ "type",
77
+ "condition"
78
+ ],
79
+ "additionalProperties": false
80
+ },
81
+ {
82
+ "type": "object",
83
+ "properties": {
84
+ "name": {
85
+ "type": "string",
86
+ "pattern": "^[a-z_][a-z0-9_]*$",
87
+ "description": "Unique rule name"
88
+ },
89
+ "active": {
90
+ "type": "boolean",
91
+ "default": true
92
+ },
93
+ "severity": {
94
+ "type": "string",
95
+ "enum": [
96
+ "error",
97
+ "warning",
98
+ "info"
99
+ ],
100
+ "default": "error"
101
+ },
102
+ "message": {
103
+ "type": "string",
104
+ "description": "Error message to display"
105
+ },
106
+ "type": {
107
+ "type": "string",
108
+ "const": "unique"
109
+ },
110
+ "fields": {
111
+ "type": "array",
112
+ "items": {
113
+ "type": "string"
114
+ },
115
+ "description": "Fields that must be combined unique"
116
+ },
117
+ "scope": {
118
+ "type": "string",
119
+ "description": "Formula condition for scope (e.g. active = true)"
120
+ },
121
+ "caseSensitive": {
122
+ "type": "boolean",
123
+ "default": true
124
+ }
125
+ },
126
+ "required": [
127
+ "name",
128
+ "message",
129
+ "type",
130
+ "fields"
131
+ ],
132
+ "additionalProperties": false
133
+ },
134
+ {
135
+ "type": "object",
136
+ "properties": {
137
+ "name": {
138
+ "type": "string",
139
+ "pattern": "^[a-z_][a-z0-9_]*$",
140
+ "description": "Unique rule name"
141
+ },
142
+ "active": {
143
+ "type": "boolean",
144
+ "default": true
145
+ },
146
+ "severity": {
147
+ "type": "string",
148
+ "enum": [
149
+ "error",
150
+ "warning",
151
+ "info"
152
+ ],
153
+ "default": "error"
154
+ },
155
+ "message": {
156
+ "type": "string",
157
+ "description": "Error message to display"
158
+ },
159
+ "type": {
160
+ "type": "string",
161
+ "const": "state_machine"
162
+ },
163
+ "field": {
164
+ "type": "string",
165
+ "description": "State field (e.g. status)"
166
+ },
167
+ "transitions": {
168
+ "type": "object",
169
+ "additionalProperties": {
170
+ "type": "array",
171
+ "items": {
172
+ "type": "string"
173
+ }
174
+ },
175
+ "description": "Map of { OldState: [AllowedNewStates] }"
176
+ }
177
+ },
178
+ "required": [
179
+ "name",
180
+ "message",
181
+ "type",
182
+ "field",
183
+ "transitions"
184
+ ],
185
+ "additionalProperties": false
186
+ },
187
+ {
188
+ "type": "object",
189
+ "properties": {
190
+ "name": {
191
+ "type": "string",
192
+ "pattern": "^[a-z_][a-z0-9_]*$",
193
+ "description": "Unique rule name"
194
+ },
195
+ "active": {
196
+ "type": "boolean",
197
+ "default": true
198
+ },
199
+ "severity": {
200
+ "type": "string",
201
+ "enum": [
202
+ "error",
203
+ "warning",
204
+ "info"
205
+ ],
206
+ "default": "error"
207
+ },
208
+ "message": {
209
+ "type": "string",
210
+ "description": "Error message to display"
211
+ },
212
+ "type": {
213
+ "type": "string",
214
+ "const": "format"
215
+ },
216
+ "field": {
217
+ "type": "string"
218
+ },
219
+ "regex": {
220
+ "type": "string"
221
+ },
222
+ "format": {
223
+ "type": "string",
224
+ "enum": [
225
+ "email",
226
+ "url",
227
+ "phone",
228
+ "json"
229
+ ]
230
+ }
231
+ },
232
+ "required": [
233
+ "name",
234
+ "message",
235
+ "type",
236
+ "field"
237
+ ],
238
+ "additionalProperties": false
239
+ },
240
+ {
241
+ "type": "object",
242
+ "properties": {
243
+ "name": {
244
+ "type": "string",
245
+ "pattern": "^[a-z_][a-z0-9_]*$",
246
+ "description": "Unique rule name"
247
+ },
248
+ "active": {
249
+ "type": "boolean",
250
+ "default": true
251
+ },
252
+ "severity": {
253
+ "type": "string",
254
+ "enum": [
255
+ "error",
256
+ "warning",
257
+ "info"
258
+ ],
259
+ "default": "error"
260
+ },
261
+ "message": {
262
+ "type": "string",
263
+ "description": "Error message to display"
264
+ },
265
+ "type": {
266
+ "type": "string",
267
+ "const": "cross_field"
268
+ },
269
+ "condition": {
270
+ "type": "string",
271
+ "description": "Formula expression comparing fields (e.g. \"end_date > start_date\")"
272
+ },
273
+ "fields": {
274
+ "type": "array",
275
+ "items": {
276
+ "type": "string"
277
+ },
278
+ "description": "Fields involved in the validation"
279
+ }
280
+ },
281
+ "required": [
282
+ "name",
283
+ "message",
284
+ "type",
285
+ "condition",
286
+ "fields"
287
+ ],
288
+ "additionalProperties": false
289
+ },
290
+ {
291
+ "type": "object",
292
+ "properties": {
293
+ "name": {
294
+ "type": "string",
295
+ "pattern": "^[a-z_][a-z0-9_]*$",
296
+ "description": "Unique rule name"
297
+ },
298
+ "active": {
299
+ "type": "boolean",
300
+ "default": true
301
+ },
302
+ "severity": {
303
+ "type": "string",
304
+ "enum": [
305
+ "error",
306
+ "warning",
307
+ "info"
308
+ ],
309
+ "default": "error"
310
+ },
311
+ "message": {
312
+ "type": "string",
313
+ "description": "Error message to display"
314
+ },
315
+ "type": {
316
+ "type": "string",
317
+ "const": "async"
318
+ },
319
+ "field": {
320
+ "type": "string",
321
+ "description": "Field to validate"
322
+ },
323
+ "validatorUrl": {
324
+ "type": "string",
325
+ "description": "External API endpoint for validation"
326
+ },
327
+ "validatorFunction": {
328
+ "type": "string",
329
+ "description": "Reference to custom validator function"
330
+ },
331
+ "timeout": {
332
+ "type": "number",
333
+ "default": 5000,
334
+ "description": "Timeout in milliseconds"
335
+ },
336
+ "debounce": {
337
+ "type": "number",
338
+ "description": "Debounce delay in milliseconds"
339
+ },
340
+ "params": {
341
+ "type": "object",
342
+ "additionalProperties": {},
343
+ "description": "Additional parameters to pass to validator"
344
+ }
345
+ },
346
+ "required": [
347
+ "name",
348
+ "message",
349
+ "type",
350
+ "field"
351
+ ],
352
+ "additionalProperties": false
353
+ },
354
+ {
355
+ "type": "object",
356
+ "properties": {
357
+ "name": {
358
+ "type": "string",
359
+ "pattern": "^[a-z_][a-z0-9_]*$",
360
+ "description": "Unique rule name"
361
+ },
362
+ "active": {
363
+ "type": "boolean",
364
+ "default": true
365
+ },
366
+ "severity": {
367
+ "type": "string",
368
+ "enum": [
369
+ "error",
370
+ "warning",
371
+ "info"
372
+ ],
373
+ "default": "error"
374
+ },
375
+ "message": {
376
+ "type": "string",
377
+ "description": "Error message to display"
378
+ },
379
+ "type": {
380
+ "type": "string",
381
+ "const": "custom"
382
+ },
383
+ "field": {
384
+ "type": "string",
385
+ "description": "Field to validate (optional for record-level validation)"
386
+ },
387
+ "validatorFunction": {
388
+ "type": "string",
389
+ "description": "Function name or reference to custom validator"
390
+ },
391
+ "params": {
392
+ "type": "object",
393
+ "additionalProperties": {},
394
+ "description": "Additional parameters for the validator"
395
+ }
396
+ },
397
+ "required": [
398
+ "name",
399
+ "message",
400
+ "type",
401
+ "validatorFunction"
402
+ ],
403
+ "additionalProperties": false
404
+ },
405
+ {}
406
+ ],
407
+ "description": "Validation rule to apply when condition is true"
408
+ },
409
+ "otherwise": {
410
+ "anyOf": [
411
+ {
412
+ "type": "object",
413
+ "properties": {
414
+ "name": {
415
+ "type": "string",
416
+ "pattern": "^[a-z_][a-z0-9_]*$",
417
+ "description": "Unique rule name"
418
+ },
419
+ "active": {
420
+ "type": "boolean",
421
+ "default": true
422
+ },
423
+ "severity": {
424
+ "type": "string",
425
+ "enum": [
426
+ "error",
427
+ "warning",
428
+ "info"
429
+ ],
430
+ "default": "error"
431
+ },
432
+ "message": {
433
+ "type": "string",
434
+ "description": "Error message to display"
435
+ },
436
+ "type": {
437
+ "type": "string",
438
+ "const": "script"
439
+ },
440
+ "condition": {
441
+ "type": "string",
442
+ "description": "Formula expression. If TRUE, validation fails. (e.g. amount < 0)"
443
+ }
444
+ },
445
+ "required": [
446
+ "name",
447
+ "message",
448
+ "type",
449
+ "condition"
450
+ ],
451
+ "additionalProperties": false
452
+ },
453
+ {
454
+ "type": "object",
455
+ "properties": {
456
+ "name": {
457
+ "type": "string",
458
+ "pattern": "^[a-z_][a-z0-9_]*$",
459
+ "description": "Unique rule name"
460
+ },
461
+ "active": {
462
+ "type": "boolean",
463
+ "default": true
464
+ },
465
+ "severity": {
466
+ "type": "string",
467
+ "enum": [
468
+ "error",
469
+ "warning",
470
+ "info"
471
+ ],
472
+ "default": "error"
473
+ },
474
+ "message": {
475
+ "type": "string",
476
+ "description": "Error message to display"
477
+ },
478
+ "type": {
479
+ "type": "string",
480
+ "const": "unique"
481
+ },
482
+ "fields": {
483
+ "type": "array",
484
+ "items": {
485
+ "type": "string"
486
+ },
487
+ "description": "Fields that must be combined unique"
488
+ },
489
+ "scope": {
490
+ "type": "string",
491
+ "description": "Formula condition for scope (e.g. active = true)"
492
+ },
493
+ "caseSensitive": {
494
+ "type": "boolean",
495
+ "default": true
496
+ }
497
+ },
498
+ "required": [
499
+ "name",
500
+ "message",
501
+ "type",
502
+ "fields"
503
+ ],
504
+ "additionalProperties": false
505
+ },
506
+ {
507
+ "type": "object",
508
+ "properties": {
509
+ "name": {
510
+ "type": "string",
511
+ "pattern": "^[a-z_][a-z0-9_]*$",
512
+ "description": "Unique rule name"
513
+ },
514
+ "active": {
515
+ "type": "boolean",
516
+ "default": true
517
+ },
518
+ "severity": {
519
+ "type": "string",
520
+ "enum": [
521
+ "error",
522
+ "warning",
523
+ "info"
524
+ ],
525
+ "default": "error"
526
+ },
527
+ "message": {
528
+ "type": "string",
529
+ "description": "Error message to display"
530
+ },
531
+ "type": {
532
+ "type": "string",
533
+ "const": "state_machine"
534
+ },
535
+ "field": {
536
+ "type": "string",
537
+ "description": "State field (e.g. status)"
538
+ },
539
+ "transitions": {
540
+ "type": "object",
541
+ "additionalProperties": {
542
+ "type": "array",
543
+ "items": {
544
+ "type": "string"
545
+ }
546
+ },
547
+ "description": "Map of { OldState: [AllowedNewStates] }"
548
+ }
549
+ },
550
+ "required": [
551
+ "name",
552
+ "message",
553
+ "type",
554
+ "field",
555
+ "transitions"
556
+ ],
557
+ "additionalProperties": false
558
+ },
559
+ {
560
+ "type": "object",
561
+ "properties": {
562
+ "name": {
563
+ "type": "string",
564
+ "pattern": "^[a-z_][a-z0-9_]*$",
565
+ "description": "Unique rule name"
566
+ },
567
+ "active": {
568
+ "type": "boolean",
569
+ "default": true
570
+ },
571
+ "severity": {
572
+ "type": "string",
573
+ "enum": [
574
+ "error",
575
+ "warning",
576
+ "info"
577
+ ],
578
+ "default": "error"
579
+ },
580
+ "message": {
581
+ "type": "string",
582
+ "description": "Error message to display"
583
+ },
584
+ "type": {
585
+ "type": "string",
586
+ "const": "format"
587
+ },
588
+ "field": {
589
+ "type": "string"
590
+ },
591
+ "regex": {
592
+ "type": "string"
593
+ },
594
+ "format": {
595
+ "type": "string",
596
+ "enum": [
597
+ "email",
598
+ "url",
599
+ "phone",
600
+ "json"
601
+ ]
602
+ }
603
+ },
604
+ "required": [
605
+ "name",
606
+ "message",
607
+ "type",
608
+ "field"
609
+ ],
610
+ "additionalProperties": false
611
+ },
612
+ {
613
+ "type": "object",
614
+ "properties": {
615
+ "name": {
616
+ "type": "string",
617
+ "pattern": "^[a-z_][a-z0-9_]*$",
618
+ "description": "Unique rule name"
619
+ },
620
+ "active": {
621
+ "type": "boolean",
622
+ "default": true
623
+ },
624
+ "severity": {
625
+ "type": "string",
626
+ "enum": [
627
+ "error",
628
+ "warning",
629
+ "info"
630
+ ],
631
+ "default": "error"
632
+ },
633
+ "message": {
634
+ "type": "string",
635
+ "description": "Error message to display"
636
+ },
637
+ "type": {
638
+ "type": "string",
639
+ "const": "cross_field"
640
+ },
641
+ "condition": {
642
+ "type": "string",
643
+ "description": "Formula expression comparing fields (e.g. \"end_date > start_date\")"
644
+ },
645
+ "fields": {
646
+ "type": "array",
647
+ "items": {
648
+ "type": "string"
649
+ },
650
+ "description": "Fields involved in the validation"
651
+ }
652
+ },
653
+ "required": [
654
+ "name",
655
+ "message",
656
+ "type",
657
+ "condition",
658
+ "fields"
659
+ ],
660
+ "additionalProperties": false
661
+ },
662
+ {
663
+ "type": "object",
664
+ "properties": {
665
+ "name": {
666
+ "type": "string",
667
+ "pattern": "^[a-z_][a-z0-9_]*$",
668
+ "description": "Unique rule name"
669
+ },
670
+ "active": {
671
+ "type": "boolean",
672
+ "default": true
673
+ },
674
+ "severity": {
675
+ "type": "string",
676
+ "enum": [
677
+ "error",
678
+ "warning",
679
+ "info"
680
+ ],
681
+ "default": "error"
682
+ },
683
+ "message": {
684
+ "type": "string",
685
+ "description": "Error message to display"
686
+ },
687
+ "type": {
688
+ "type": "string",
689
+ "const": "async"
690
+ },
691
+ "field": {
692
+ "type": "string",
693
+ "description": "Field to validate"
694
+ },
695
+ "validatorUrl": {
696
+ "type": "string",
697
+ "description": "External API endpoint for validation"
698
+ },
699
+ "validatorFunction": {
700
+ "type": "string",
701
+ "description": "Reference to custom validator function"
702
+ },
703
+ "timeout": {
704
+ "type": "number",
705
+ "default": 5000,
706
+ "description": "Timeout in milliseconds"
707
+ },
708
+ "debounce": {
709
+ "type": "number",
710
+ "description": "Debounce delay in milliseconds"
711
+ },
712
+ "params": {
713
+ "type": "object",
714
+ "additionalProperties": {},
715
+ "description": "Additional parameters to pass to validator"
716
+ }
717
+ },
718
+ "required": [
719
+ "name",
720
+ "message",
721
+ "type",
722
+ "field"
723
+ ],
724
+ "additionalProperties": false
725
+ },
726
+ {
727
+ "type": "object",
728
+ "properties": {
729
+ "name": {
730
+ "type": "string",
731
+ "pattern": "^[a-z_][a-z0-9_]*$",
732
+ "description": "Unique rule name"
733
+ },
734
+ "active": {
735
+ "type": "boolean",
736
+ "default": true
737
+ },
738
+ "severity": {
739
+ "type": "string",
740
+ "enum": [
741
+ "error",
742
+ "warning",
743
+ "info"
744
+ ],
745
+ "default": "error"
746
+ },
747
+ "message": {
748
+ "type": "string",
749
+ "description": "Error message to display"
750
+ },
751
+ "type": {
752
+ "type": "string",
753
+ "const": "custom"
754
+ },
755
+ "field": {
756
+ "type": "string",
757
+ "description": "Field to validate (optional for record-level validation)"
758
+ },
759
+ "validatorFunction": {
760
+ "type": "string",
761
+ "description": "Function name or reference to custom validator"
762
+ },
763
+ "params": {
764
+ "type": "object",
765
+ "additionalProperties": {},
766
+ "description": "Additional parameters for the validator"
767
+ }
768
+ },
769
+ "required": [
770
+ "name",
771
+ "message",
772
+ "type",
773
+ "validatorFunction"
774
+ ],
775
+ "additionalProperties": false
776
+ },
777
+ {}
778
+ ],
779
+ "description": "Validation rule to apply when condition is false"
780
+ }
781
+ },
782
+ "required": [
783
+ "name",
784
+ "message",
785
+ "type",
786
+ "when",
787
+ "then"
788
+ ],
789
+ "additionalProperties": false
790
+ }
791
+ },
792
+ "$schema": "http://json-schema.org/draft-07/schema#"
793
+ }