@stonecrop/stonecrop 0.30.0 → 0.32.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 (121) hide show
  1. package/dist/stonecrop.js +3548 -2740
  2. package/dist/stonecrop.js.map +1 -1
  3. package/dist/tsdoc-metadata.json +1 -1
  4. package/package.json +33 -27
  5. package/dist/src/client-action.d.ts +0 -31
  6. package/dist/src/client-action.d.ts.map +0 -1
  7. package/dist/src/client-action.js +0 -169
  8. package/dist/src/client-handler.d.ts +0 -43
  9. package/dist/src/client-handler.d.ts.map +0 -1
  10. package/dist/src/client-handler.js +0 -42
  11. package/dist/src/composables/lazy-link.d.ts +0 -25
  12. package/dist/src/composables/lazy-link.d.ts.map +0 -1
  13. package/dist/src/composables/lazy-link.js +0 -124
  14. package/dist/src/composables/operation-log.d.ts +0 -136
  15. package/dist/src/composables/operation-log.d.ts.map +0 -1
  16. package/dist/src/composables/operation-log.js +0 -224
  17. package/dist/src/composables/stonecrop.d.ts +0 -37
  18. package/dist/src/composables/stonecrop.d.ts.map +0 -1
  19. package/dist/src/composables/stonecrop.js +0 -433
  20. package/dist/src/doctype.d.ts +0 -243
  21. package/dist/src/doctype.d.ts.map +0 -1
  22. package/dist/src/doctype.js +0 -325
  23. package/dist/src/draft.d.ts +0 -35
  24. package/dist/src/draft.d.ts.map +0 -1
  25. package/dist/src/draft.js +0 -36
  26. package/dist/src/exceptions.d.ts +0 -14
  27. package/dist/src/exceptions.d.ts.map +0 -1
  28. package/dist/src/exceptions.js +0 -16
  29. package/dist/src/field-triggers.d.ts +0 -184
  30. package/dist/src/field-triggers.d.ts.map +0 -1
  31. package/dist/src/field-triggers.js +0 -577
  32. package/dist/src/index.d.ts +0 -25
  33. package/dist/src/index.d.ts.map +0 -1
  34. package/dist/src/index.js +0 -39
  35. package/dist/src/plugins/index.d.ts +0 -35
  36. package/dist/src/plugins/index.d.ts.map +0 -1
  37. package/dist/src/plugins/index.js +0 -98
  38. package/dist/src/registry.d.ts +0 -161
  39. package/dist/src/registry.d.ts.map +0 -1
  40. package/dist/src/registry.js +0 -384
  41. package/dist/src/schema-validator.d.ts +0 -78
  42. package/dist/src/schema-validator.d.ts.map +0 -1
  43. package/dist/src/schema-validator.js +0 -398
  44. package/dist/src/stonecrop.d.ts +0 -539
  45. package/dist/src/stonecrop.d.ts.map +0 -1
  46. package/dist/src/stonecrop.js +0 -610
  47. package/dist/src/stores/hst.d.ts +0 -92
  48. package/dist/src/stores/hst.d.ts.map +0 -1
  49. package/dist/src/stores/hst.js +0 -487
  50. package/dist/src/stores/index.d.ts +0 -9
  51. package/dist/src/stores/index.d.ts.map +0 -1
  52. package/dist/src/stores/index.js +0 -13
  53. package/dist/src/stores/operation-log.d.ts +0 -262
  54. package/dist/src/stores/operation-log.d.ts.map +0 -1
  55. package/dist/src/stores/operation-log.js +0 -571
  56. package/dist/src/stores/validation.d.ts +0 -83
  57. package/dist/src/stores/validation.d.ts.map +0 -1
  58. package/dist/src/stores/validation.js +0 -104
  59. package/dist/src/types/client-action.d.ts +0 -121
  60. package/dist/src/types/client-action.d.ts.map +0 -1
  61. package/dist/src/types/client-action.js +0 -0
  62. package/dist/src/types/composable.d.ts +0 -268
  63. package/dist/src/types/composable.d.ts.map +0 -1
  64. package/dist/src/types/composable.js +0 -0
  65. package/dist/src/types/doctype.d.ts +0 -34
  66. package/dist/src/types/doctype.d.ts.map +0 -1
  67. package/dist/src/types/doctype.js +0 -0
  68. package/dist/src/types/field-triggers.d.ts +0 -186
  69. package/dist/src/types/field-triggers.d.ts.map +0 -1
  70. package/dist/src/types/field-triggers.js +0 -4
  71. package/dist/src/types/hst.d.ts +0 -70
  72. package/dist/src/types/hst.d.ts.map +0 -1
  73. package/dist/src/types/hst.js +0 -0
  74. package/dist/src/types/index.d.ts +0 -11
  75. package/dist/src/types/index.d.ts.map +0 -1
  76. package/dist/src/types/index.js +0 -11
  77. package/dist/src/types/operation-log.d.ts +0 -163
  78. package/dist/src/types/operation-log.d.ts.map +0 -1
  79. package/dist/src/types/operation-log.js +0 -0
  80. package/dist/src/types/plugin.d.ts +0 -37
  81. package/dist/src/types/plugin.d.ts.map +0 -1
  82. package/dist/src/types/plugin.js +0 -0
  83. package/dist/src/types/registry.d.ts +0 -11
  84. package/dist/src/types/registry.d.ts.map +0 -1
  85. package/dist/src/types/registry.js +0 -0
  86. package/dist/src/types/schema-validator.d.ts +0 -66
  87. package/dist/src/types/schema-validator.d.ts.map +0 -1
  88. package/dist/src/types/schema-validator.js +0 -13
  89. package/dist/src/types/stonecrop.d.ts +0 -32
  90. package/dist/src/types/stonecrop.d.ts.map +0 -1
  91. package/dist/src/types/stonecrop.js +0 -0
  92. package/dist/stonecrop.tsbuildinfo +0 -1
  93. package/src/client-action.ts +0 -207
  94. package/src/client-handler.ts +0 -55
  95. package/src/composables/lazy-link.ts +0 -145
  96. package/src/composables/operation-log.ts +0 -257
  97. package/src/composables/stonecrop.ts +0 -556
  98. package/src/doctype.ts +0 -360
  99. package/src/draft.ts +0 -38
  100. package/src/exceptions.ts +0 -16
  101. package/src/field-triggers.ts +0 -686
  102. package/src/index.ts +0 -81
  103. package/src/plugins/index.ts +0 -113
  104. package/src/registry.ts +0 -433
  105. package/src/schema-validator.ts +0 -476
  106. package/src/stonecrop.ts +0 -721
  107. package/src/stores/hst.ts +0 -626
  108. package/src/stores/index.ts +0 -21
  109. package/src/stores/operation-log.ts +0 -675
  110. package/src/stores/validation.ts +0 -138
  111. package/src/types/client-action.ts +0 -121
  112. package/src/types/composable.ts +0 -288
  113. package/src/types/doctype.ts +0 -35
  114. package/src/types/field-triggers.ts +0 -201
  115. package/src/types/hst.ts +0 -77
  116. package/src/types/index.ts +0 -11
  117. package/src/types/operation-log.ts +0 -202
  118. package/src/types/plugin.ts +0 -38
  119. package/src/types/registry.ts +0 -10
  120. package/src/types/schema-validator.ts +0 -69
  121. package/src/types/stonecrop.ts +0 -33
@@ -1,476 +0,0 @@
1
- /**
2
- * Schema Validation Utilities
3
- * Validates Stonecrop schemas for integrity and consistency
4
- * @packageDocumentation
5
- */
6
-
7
- import type { DoctypeField } from '@stonecrop/schema'
8
- import type { LinkDeclaration } from '@stonecrop/schema'
9
- import { componentLinkExpansion } from '@stonecrop/schema'
10
- import type { List, Map as ImmutableMap } from 'immutable'
11
- import type { AnyStateNodeConfig } from 'xstate'
12
-
13
- import { getGlobalTriggerEngine } from './field-triggers'
14
- import type Registry from './registry'
15
- import { ValidationSeverity } from './types/schema-validator'
16
- import type { ValidationIssue, ValidationResult, ValidatorOptions } from './types/schema-validator'
17
-
18
- /**
19
- * Schema validator class
20
- * @public
21
- */
22
- export class SchemaValidator {
23
- private options: Required<ValidatorOptions>
24
-
25
- /**
26
- * Creates a new SchemaValidator instance
27
- * @param options - Validator configuration options
28
- */
29
- constructor(options: ValidatorOptions = {}) {
30
- this.options = {
31
- registry: options.registry || null!,
32
- validateLinkTargets: options.validateLinkTargets ?? true,
33
- validateLinks: options.validateLinks ?? true,
34
- validateActions: options.validateActions ?? true,
35
- validateWorkflows: options.validateWorkflows ?? true,
36
- validateRequiredProperties: options.validateRequiredProperties ?? true,
37
- }
38
- }
39
-
40
- /**
41
- * Validates a complete doctype schema
42
- * @param doctype - Doctype name
43
- * @param schema - Schema fields (List or Array)
44
- * @param workflow - Optional workflow configuration
45
- * @param actions - Optional actions map
46
- * @param links - Optional links object
47
- * @returns Validation result
48
- */
49
- validate(
50
- doctype: string,
51
- schema: List<DoctypeField> | DoctypeField[] | undefined,
52
- workflow?: AnyStateNodeConfig,
53
- actions?: ImmutableMap<string, string[]> | Map<string, string[]>,
54
- links?: Record<string, LinkDeclaration>
55
- ): ValidationResult {
56
- const issues: ValidationIssue[] = []
57
-
58
- // Convert schema to array for easier iteration
59
- const schemaArray = schema ? (Array.isArray(schema) ? schema : schema.toArray()) : []
60
-
61
- // Validate required properties
62
- if (this.options.validateRequiredProperties) {
63
- issues.push(...this.validateRequiredProperties(doctype, schemaArray, links))
64
- }
65
-
66
- // Validate Link field targets
67
- if (this.options.validateLinkTargets && this.options.registry) {
68
- issues.push(...this.validateLinkFields(doctype, schemaArray, this.options.registry))
69
- }
70
-
71
- // Validate links object
72
- if (this.options.validateLinks && this.options.registry && links) {
73
- issues.push(...this.validateLinkDeclarations(doctype, links, schemaArray, this.options.registry))
74
- }
75
-
76
- // Validate workflow configuration
77
- if (this.options.validateWorkflows && workflow) {
78
- issues.push(...this.validateWorkflow(doctype, workflow))
79
- }
80
-
81
- // Validate action registration
82
- if (this.options.validateActions && actions) {
83
- const actionsMap = actions instanceof Map ? actions : actions.toObject()
84
- // oxlint-disable-next-line typescript/no-unsafe-type-assertion -- toObject() returns plain object; runtime-safe cast for Map<string, string[]>
85
- issues.push(...this.validateActionRegistration(doctype, actionsMap as Record<string, string[]>))
86
- }
87
-
88
- // Calculate counts
89
- const errorCount = issues.filter(i => i.severity === ValidationSeverity.ERROR).length
90
- const warningCount = issues.filter(i => i.severity === ValidationSeverity.WARNING).length
91
- const infoCount = issues.filter(i => i.severity === ValidationSeverity.INFO).length
92
-
93
- return {
94
- valid: errorCount === 0,
95
- issues,
96
- errorCount,
97
- warningCount,
98
- infoCount,
99
- }
100
- }
101
-
102
- /**
103
- * Validates that required schema properties are present
104
- * @internal
105
- */
106
- private validateRequiredProperties(
107
- doctype: string,
108
- schema: DoctypeField[],
109
- links?: Record<string, LinkDeclaration>
110
- ): ValidationIssue[] {
111
- const issues: ValidationIssue[] = []
112
-
113
- for (const field of schema) {
114
- // Check for fieldname
115
- if (!field.fieldname) {
116
- issues.push({
117
- severity: ValidationSeverity.ERROR,
118
- rule: 'required-fieldname',
119
- message: 'Field is missing required property: fieldname',
120
- doctype,
121
- context: { field },
122
- })
123
- continue
124
- }
125
-
126
- // A value field renders through its component and has no other rendering axis;
127
- // fieldset/table have their own structural requirements.
128
- if (field.kind === 'field' && !field.component) {
129
- issues.push({
130
- severity: ValidationSeverity.ERROR,
131
- rule: 'required-component',
132
- message: `Field "${field.fieldname}" must have a component property`,
133
- doctype,
134
- fieldname: field.fieldname,
135
- })
136
- }
137
-
138
- // A link component with nothing to point at renders an empty picker, which looks exactly
139
- // like a record that has no value — so this fails silently at runtime rather than loudly.
140
- // Link-ness comes from `doctype` or a `links` declaration, so this is a field that named
141
- // a link component and gave it neither.
142
- if (
143
- field.kind === 'field' &&
144
- componentLinkExpansion(field.component) &&
145
- !field.doctype &&
146
- !links?.[field.fieldname]
147
- ) {
148
- issues.push({
149
- severity: ValidationSeverity.ERROR,
150
- rule: 'link-component-without-doctype',
151
- message:
152
- `Field "${field.fieldname}" renders with "${field.component}", which is a link component, ` +
153
- `but has no \`doctype\` to name its target`,
154
- doctype,
155
- fieldname: field.fieldname,
156
- })
157
- }
158
-
159
- // Validate nested schemas recursively (fieldset only; table columns are ColumnSchema not DoctypeField)
160
- if (field.kind === 'fieldset') {
161
- issues.push(...this.validateRequiredProperties(doctype, field.schema, links))
162
- }
163
- }
164
-
165
- return issues
166
- }
167
-
168
- /**
169
- * Validates Link field targets exist in registry
170
- * @internal
171
- */
172
- private validateLinkFields(doctype: string, schema: DoctypeField[], registry: Registry): ValidationIssue[] {
173
- const issues: ValidationIssue[] = []
174
-
175
- for (const field of schema) {
176
- // `doctype` is both the link marker and its target, and the schema types it as a
177
- // non-empty string — so there is no "missing target" or "malformed target" state left
178
- // to check here. The rules that did (`link-missing-options`, `link-invalid-options`)
179
- // were removed with the `options`-as-link-target convention; the case they actually
180
- // guarded — a link component with no target — is now `link-component-without-doctype`,
181
- // which fires in validateRequiredProperties whether or not a registry is configured.
182
- if (field.kind === 'field' && field.doctype) {
183
- const targetDoctype = field.doctype
184
- const targetMeta = registry.registry[targetDoctype] || registry.registry[targetDoctype.toLowerCase()]
185
-
186
- if (!targetMeta) {
187
- issues.push({
188
- severity: ValidationSeverity.ERROR,
189
- rule: 'link-invalid-target',
190
- message: `Link field "${field.fieldname}" references non-existent doctype: "${targetDoctype}"`,
191
- doctype,
192
- fieldname: field.fieldname,
193
- context: { targetDoctype },
194
- })
195
- }
196
- }
197
-
198
- // Recursively check nested fieldset schemas
199
- if (field.kind === 'fieldset') {
200
- issues.push(...this.validateLinkFields(doctype, field.schema, registry))
201
- }
202
- }
203
-
204
- return issues
205
- }
206
-
207
- /**
208
- * Validates link declarations: target resolution, backlink consistency, Link field correspondence
209
- * @internal
210
- */
211
- private validateLinkDeclarations(
212
- doctype: string,
213
- links: Record<string, LinkDeclaration>,
214
- schema: DoctypeField[],
215
- registry: Registry
216
- ): ValidationIssue[] {
217
- const issues: ValidationIssue[] = []
218
-
219
- // Build a map of link fields by fieldname for quick lookup
220
- const linkFieldsByFieldname = new Map<string, DoctypeField>()
221
- for (const field of schema) {
222
- if (field.kind === 'field' && field.doctype) {
223
- linkFieldsByFieldname.set(field.fieldname, field)
224
- }
225
- }
226
-
227
- for (const [fieldname, link] of Object.entries(links)) {
228
- // Check target resolves in registry
229
- const targetDoctype = registry.registry[link.target]
230
- if (!targetDoctype) {
231
- issues.push({
232
- severity: ValidationSeverity.ERROR,
233
- rule: 'link-invalid-target',
234
- message: `Link "${fieldname}" references non-existent doctype: "${link.target}"`,
235
- doctype,
236
- fieldname,
237
- context: { target: link.target },
238
- })
239
- continue
240
- }
241
-
242
- // Warn on self-referential target
243
- if (link.target === doctype) {
244
- issues.push({
245
- severity: ValidationSeverity.WARNING,
246
- rule: 'link-self-referential',
247
- message: `Link "${fieldname}" is self-referential (target: "${link.target}")`,
248
- doctype,
249
- fieldname,
250
- context: { target: link.target },
251
- })
252
- }
253
-
254
- // Check backlink consistency
255
- if (link.backlink && targetDoctype.links) {
256
- const reciprocalLink = targetDoctype.links[link.backlink]
257
- if (!reciprocalLink) {
258
- issues.push({
259
- severity: ValidationSeverity.ERROR,
260
- rule: 'link-backlink-missing',
261
- message: `Backlink "${link.backlink}" not found on target doctype "${link.target}"`,
262
- doctype,
263
- fieldname,
264
- context: { backlink: link.backlink, target: link.target },
265
- })
266
- } else if (reciprocalLink.target !== doctype) {
267
- issues.push({
268
- severity: ValidationSeverity.WARNING,
269
- rule: 'link-backlink-mismatch',
270
- message: `Backlink "${link.backlink}" on "${link.target}" points to "${reciprocalLink.target}" instead of "${doctype}"`,
271
- doctype,
272
- fieldname,
273
- context: { backlink: link.backlink, target: link.target, actualTarget: reciprocalLink.target },
274
- })
275
- }
276
- }
277
-
278
- // If Link field exists with same fieldname, verify it has matching target
279
- // Only check if link has fieldname set (otherwise it's a standalone link without a field)
280
- if (link.fieldname) {
281
- const linkField = linkFieldsByFieldname.get(link.fieldname)
282
- if (linkField && linkField.kind === 'field') {
283
- // Map membership implies `doctype` is set — that is the map's build condition.
284
- const linkFieldTarget = linkField.doctype
285
- if (linkFieldTarget && linkFieldTarget !== link.target) {
286
- issues.push({
287
- severity: ValidationSeverity.ERROR,
288
- rule: 'link-field-target-mismatch',
289
- message: `Link field "${link.fieldname}" targets "${linkFieldTarget}" but link declaration targets "${link.target}"`,
290
- doctype,
291
- fieldname: link.fieldname,
292
- context: { linkFieldTarget, linkTarget: link.target },
293
- })
294
- }
295
- }
296
- }
297
- }
298
-
299
- // NOTE: there is deliberately no "every link field needs a declaration" rule. A plain foreign
300
- // key is a link with no `links` entry — the map is additive, carrying expansion metadata
301
- // (backlink/fetch/cardinality), and is not required. Such a rule would contradict
302
- // `Registry.resolveFields`, which resolves undeclared links to inline pickers, and would flag
303
- // every doctype that mixes an expanded relation with a plain FK (e.g. `country`: a `links`
304
- // map for states/languages/subdivisions plus a plain `continent` picker).
305
-
306
- return issues
307
- }
308
-
309
- /**
310
- * Validates workflow state machine configuration
311
- * @internal
312
- */
313
- private validateWorkflow(doctype: string, workflow: AnyStateNodeConfig): ValidationIssue[] {
314
- const issues: ValidationIssue[] = []
315
-
316
- // Check for initial state
317
- if (!workflow.initial && !workflow.type) {
318
- issues.push({
319
- severity: ValidationSeverity.WARNING,
320
- rule: 'workflow-missing-initial',
321
- message: 'Workflow is missing initial state property',
322
- doctype,
323
- })
324
- }
325
-
326
- // Check for states
327
- if (!workflow.states || Object.keys(workflow.states).length === 0) {
328
- issues.push({
329
- severity: ValidationSeverity.WARNING,
330
- rule: 'workflow-no-states',
331
- message: 'Workflow has no states defined',
332
- doctype,
333
- })
334
- return issues
335
- }
336
-
337
- // Validate initial state exists
338
- if (workflow.initial && typeof workflow.initial === 'string' && !workflow.states[workflow.initial]) {
339
- issues.push({
340
- severity: ValidationSeverity.ERROR,
341
- rule: 'workflow-invalid-initial',
342
- message: `Workflow initial state "${workflow.initial}" does not exist in states`,
343
- doctype,
344
- context: { initialState: workflow.initial },
345
- })
346
- }
347
-
348
- // Check state reachability (simple check - all states should have at least one incoming transition or be initial)
349
- const stateNames = Object.keys(workflow.states)
350
- const reachableStates = new Set<string>()
351
-
352
- // Initial state is always reachable
353
- if (workflow.initial && typeof workflow.initial === 'string') {
354
- reachableStates.add(workflow.initial)
355
- }
356
-
357
- // Find all target states from transitions
358
- for (const [_stateName, stateConfig] of Object.entries(workflow.states)) {
359
- const state = stateConfig as AnyStateNodeConfig
360
- if (state.on) {
361
- for (const [_event, transition] of Object.entries(state.on)) {
362
- if (typeof transition === 'string') {
363
- reachableStates.add(transition)
364
- } else if (transition && typeof transition === 'object') {
365
- // oxlint-disable-next-line typescript/no-unsafe-type-assertion -- 'target' in transition guard confirms property; accessing unknown-typed target safely
366
- const target = 'target' in transition ? (transition as { target: unknown }).target : undefined
367
- if (typeof target === 'string') {
368
- reachableStates.add(target)
369
- } else if (Array.isArray(target)) {
370
- target.forEach((t: unknown) => {
371
- if (typeof t === 'string') {
372
- reachableStates.add(t)
373
- }
374
- })
375
- }
376
- }
377
- }
378
- }
379
- }
380
-
381
- // Check for unreachable states
382
- for (const stateName of stateNames) {
383
- if (!reachableStates.has(stateName)) {
384
- issues.push({
385
- severity: ValidationSeverity.WARNING,
386
- rule: 'workflow-unreachable-state',
387
- message: `Workflow state "${stateName}" may not be reachable`,
388
- doctype,
389
- context: { stateName },
390
- })
391
- }
392
- }
393
-
394
- return issues
395
- }
396
-
397
- /**
398
- * Validates that actions are registered in the FieldTriggerEngine
399
- * @internal
400
- */
401
- private validateActionRegistration(doctype: string, actions: Record<string, string[]>): ValidationIssue[] {
402
- const issues: ValidationIssue[] = []
403
- const triggerEngine = getGlobalTriggerEngine()
404
-
405
- for (const [triggerName, actionNames] of Object.entries(actions)) {
406
- if (!Array.isArray(actionNames)) {
407
- issues.push({
408
- severity: ValidationSeverity.ERROR,
409
- rule: 'action-invalid-format',
410
- message: `Action configuration for "${triggerName}" must be an array`,
411
- doctype,
412
- context: { triggerName, actionNames },
413
- })
414
- continue
415
- }
416
-
417
- // Check each action name
418
- for (const actionName of actionNames) {
419
- // Check if action is registered globally
420
- // oxlint-disable-next-line typescript/no-unsafe-type-assertion -- introspecting FieldTriggerEngine private fields for validation; no public API for this check
421
- const engine = triggerEngine as unknown as {
422
- globalActions?: Map<string, unknown>
423
- globalTransitionActions?: Map<string, unknown>
424
- }
425
- const isRegistered = engine.globalActions?.has(actionName) || engine.globalTransitionActions?.has(actionName)
426
-
427
- if (!isRegistered) {
428
- issues.push({
429
- severity: ValidationSeverity.WARNING,
430
- rule: 'action-not-registered',
431
- message: `Action "${actionName}" referenced in "${triggerName}" is not registered in FieldTriggerEngine`,
432
- doctype,
433
- context: { triggerName, actionName },
434
- })
435
- }
436
- }
437
- }
438
-
439
- return issues
440
- }
441
- }
442
-
443
- /**
444
- * Creates a validator with the given registry
445
- * @param registry - Registry instance
446
- * @param options - Additional validator options
447
- * @returns SchemaValidator instance
448
- * @public
449
- */
450
- export function createValidator(registry: Registry, options?: Partial<ValidatorOptions>): SchemaValidator {
451
- return new SchemaValidator({
452
- registry,
453
- ...options,
454
- })
455
- }
456
-
457
- /**
458
- * Quick validation helper
459
- * @param doctype - Doctype name
460
- * @param schema - Schema fields
461
- * @param registry - Registry instance
462
- * @param workflow - Optional workflow configuration
463
- * @param actions - Optional actions map
464
- * @returns Validation result
465
- * @public
466
- */
467
- export function validateSchema(
468
- doctype: string,
469
- schema: List<DoctypeField> | DoctypeField[] | undefined,
470
- registry: Registry,
471
- workflow?: AnyStateNodeConfig,
472
- actions?: ImmutableMap<string, string[]> | Map<string, string[]>
473
- ): ValidationResult {
474
- const validator = createValidator(registry)
475
- return validator.validate(doctype, schema, workflow, actions)
476
- }