@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,201 +0,0 @@
1
- /**
2
- * Field-level action trigger system types
3
- * @public
4
- */
5
-
6
- import type { HSTNode } from './hst'
7
-
8
- /**
9
- * Context provided to action functions when field changes occur
10
- * @public
11
- */
12
- export interface FieldChangeContext {
13
- /** The HST path that was changed */
14
- path: string
15
- /** The field name (last segment of path) */
16
- fieldname: string
17
- /** Value before the change */
18
- beforeValue: any
19
- /** Value after the change */
20
- afterValue: any
21
- /** The operation type */
22
- operation: 'set' | 'delete' | 'patch'
23
- /** The doctype of the record being changed */
24
- doctype: string
25
- /** The record ID if applicable */
26
- recordId?: string
27
- /** Timestamp of the change */
28
- timestamp: Date
29
- /** Reference to the HST store for state access (optional) */
30
- store?: HSTNode
31
- }
32
-
33
- /**
34
- * Context provided to XState transition action functions
35
- * Extends FieldChangeContext with FSM-specific data
36
- * @public
37
- */
38
- export interface TransitionChangeContext extends FieldChangeContext {
39
- /** The XState transition name that triggered this action */
40
- transition: string
41
- /** Current workflow state before transition */
42
- currentState?: string
43
- /** Target workflow state after transition */
44
- targetState?: string
45
- /** Additional FSM context data */
46
- fsmContext?: Record<string, any>
47
- }
48
-
49
- /**
50
- * Action function that can be triggered by field changes
51
- * @public
52
- */
53
- export type FieldActionFunction = (context: FieldChangeContext) => void | Promise<void>
54
-
55
- /**
56
- * Action function for XState transition triggers
57
- * Receives enhanced context with FSM state information
58
- * @public
59
- */
60
- export type TransitionActionFunction = (context: TransitionChangeContext) => void | Promise<void>
61
-
62
- /**
63
- * String reference to a globally registered action function or inline function
64
- * @public
65
- */
66
- export type FieldActionString = string
67
-
68
- /**
69
- * Supported action types for field triggers
70
- * @public
71
- */
72
- export type FieldAction = FieldActionFunction | FieldActionString
73
-
74
- /**
75
- * Supported action types for XState transitions
76
- * Can be either a transition-specific function or a string reference
77
- * @public
78
- */
79
- export type TransitionAction = TransitionActionFunction | FieldActionString
80
-
81
- /**
82
- * Configuration for a single field trigger
83
- * @public
84
- */
85
- export interface FieldTriggerConfig {
86
- /** Array of actions to execute when this field changes */
87
- actions: FieldAction[]
88
- /** Optional condition function to determine if actions should run */
89
- condition?: (context: FieldChangeContext) => boolean | Promise<boolean>
90
- /** Whether to run actions before or after the value is set (default: 'after') */
91
- timing?: 'before' | 'after'
92
- /** Whether to stop execution on first error (default: true) */
93
- stopOnError?: boolean
94
- /** Maximum execution time in milliseconds before timeout */
95
- timeout?: number
96
- /** Whether to enable automatic rollback for this field trigger (overrides global setting) */
97
- enableRollback?: boolean
98
- }
99
-
100
- /**
101
- * Map of field paths to trigger configurations
102
- * Supports wildcard patterns like 'emailAddress.*.is_primary'
103
- * @public
104
- */
105
- export type FieldTriggerMap = Record<string, FieldTriggerConfig | FieldAction[]>
106
-
107
- /**
108
- * Registry for storing global action functions
109
- * @public
110
- */
111
- export interface ActionRegistry {
112
- /** Register a global action function */
113
- register(name: string, fn: FieldActionFunction): void
114
- /** Get a registered action function */
115
- get(name: string): FieldActionFunction | undefined
116
- /** Check if an action is registered */
117
- has(name: string): boolean
118
- /** Unregister an action function */
119
- unregister(name: string): void
120
- /** Get all registered action names */
121
- list(): string[]
122
- }
123
-
124
- /**
125
- * Result of executing a field action
126
- * @public
127
- */
128
- export interface ActionExecutionResult {
129
- /** Whether the action executed successfully */
130
- success: boolean
131
- /** Error if execution failed */
132
- error?: Error
133
- /** Execution time in milliseconds */
134
- executionTime: number
135
- /** The action that was executed */
136
- action: FieldAction
137
- }
138
-
139
- /**
140
- * Result of executing an XState transition action
141
- * @public
142
- */
143
- export interface TransitionExecutionResult {
144
- /** Whether the action executed successfully */
145
- success: boolean
146
- /** Error if execution failed */
147
- error?: Error
148
- /** Execution time in milliseconds */
149
- executionTime: number
150
- /** The action that was executed */
151
- action: TransitionAction
152
- /** The transition name that was executed */
153
- transition: string
154
- }
155
-
156
- /**
157
- * Result of executing all actions for a field change
158
- * @public
159
- */
160
- export interface FieldTriggerExecutionResult {
161
- /** The path that triggered the actions */
162
- path: string
163
- /** Results for each action that was executed */
164
- actionResults: ActionExecutionResult[]
165
- /** Total execution time for all actions */
166
- totalExecutionTime: number
167
- /** Whether all actions succeeded */
168
- allSucceeded: boolean
169
- /** Whether execution was stopped due to an error */
170
- stoppedOnError: boolean
171
- /** Whether a rollback was performed */
172
- rolledBack: boolean
173
- /** The snapshot that was captured before execution */
174
- snapshot?: any
175
- }
176
-
177
- /**
178
- * Options for the field trigger system
179
- * @public
180
- */
181
- export interface FieldTriggerOptions {
182
- /** Default timeout for action execution in milliseconds */
183
- defaultTimeout?: number
184
- /** Whether to log trigger executions for debugging */
185
- debug?: boolean
186
- /** Custom error handler for action failures */
187
- errorHandler?: (error: Error, context: FieldChangeContext, action: FieldAction) => void
188
- /** Whether to enable automatic rollback on failure (default: true) */
189
- enableRollback?: boolean
190
- }
191
-
192
- /**
193
- * Pattern matching result for wildcard paths
194
- * @internal
195
- */
196
- export interface _PathMatchResult {
197
- /** Whether the path matches the pattern */
198
- matches: boolean
199
- /** Captured wildcard values */
200
- captures: Record<string, string>
201
- }
package/src/types/hst.ts DELETED
@@ -1,77 +0,0 @@
1
- /**
2
- * Core HST Interface - enhanced with tree navigation
3
- * Provides a hierarchical state tree interface for navigating and manipulating nested data structures.
4
- *
5
- * @public
6
- */
7
- export interface HSTNode {
8
- /**
9
- * Gets a value at the specified path
10
- * @param path - The dot-separated path to the value
11
- * @returns The value at the specified path
12
- */
13
- get(path: string): any
14
-
15
- /**
16
- * Sets a value at the specified path
17
- * @param path - The dot-separated path where to set the value
18
- * @param value - The value to set
19
- * @param source - Optional source of the operation (user, system, sync, undo, redo)
20
- */
21
- set(path: string, value: any, source?: 'user' | 'system' | 'sync' | 'undo' | 'redo'): void
22
-
23
- /**
24
- * Checks if a value exists at the specified path
25
- * @param path - The dot-separated path to check
26
- * @returns True if the path exists, false otherwise
27
- */
28
- has(path: string): boolean
29
-
30
- /**
31
- * Gets the ancestor node in the tree hierarchy (immediate predecessor)
32
- * @returns The ancestor HSTNode or null if this is the root
33
- */
34
- getAncestor(): HSTNode | null
35
-
36
- /**
37
- * Gets the root node of the tree
38
- * @returns The root HSTNode
39
- */
40
- getRoot(): HSTNode
41
-
42
- /**
43
- * Gets the full path from root to this node
44
- * @returns The dot-separated path string
45
- */
46
- getPath(): string
47
-
48
- /**
49
- * Gets the depth level of this node in the tree
50
- * @returns The depth as a number (0 for root)
51
- */
52
- getDepth(): number
53
-
54
- /**
55
- * Gets an array of path segments from root to this node
56
- * @returns Array of path segments representing breadcrumbs
57
- */
58
- getBreadcrumbs(): string[]
59
-
60
- /**
61
- * Gets a child node at the specified relative path
62
- * @param path - The relative path to the child node
63
- * @returns The child HSTNode
64
- */
65
- getNode(path: string): HSTNode
66
-
67
- /**
68
- * Trigger an XState transition with optional context data
69
- * @param transition - The transition name (should be uppercase per convention)
70
- * @param context - Optional additional FSM context data
71
- * @returns Promise resolving to the transition execution results
72
- */
73
- triggerTransition(
74
- transition: string,
75
- context?: { currentState?: string; targetState?: string; fsmContext?: Record<string, any> }
76
- ): Promise<any>
77
- }
@@ -1,11 +0,0 @@
1
- // Re-export all type files
2
- export * from './client-action'
3
- export * from './composable'
4
- export * from './doctype'
5
- export * from './field-triggers'
6
- export * from './hst'
7
- export * from './operation-log'
8
- export * from './plugin'
9
- export * from './registry'
10
- export * from './schema-validator'
11
- export * from './stonecrop'
@@ -1,202 +0,0 @@
1
- /**
2
- * Type of HST operation
3
- * @public
4
- */
5
- export type HSTOperationType = 'set' | 'delete' | 'batch' | 'transition' | 'action'
6
-
7
- /**
8
- * Operation source - where the change originated
9
- * @public
10
- */
11
- export type OperationSource = 'user' | 'system' | 'sync' | 'undo' | 'redo'
12
-
13
- /**
14
- * Complete metadata for an HST mutation
15
- * Enables time travel, synchronization, and audit trails
16
- * @public
17
- */
18
- export interface HSTOperation {
19
- /** Unique operation identifier */
20
- id: string
21
-
22
- /** Type of operation performed */
23
- type: HSTOperationType
24
-
25
- /** Full HST path affected (e.g., "task.123.title") */
26
- path: string
27
-
28
- /** Field name extracted from path */
29
- fieldname: string
30
-
31
- /** Value before the operation */
32
- beforeValue: any
33
-
34
- /** Value after the operation */
35
- afterValue: any
36
-
37
- /** Doctype this operation affects */
38
- doctype: string
39
-
40
- /** Record ID if applicable */
41
- recordId?: string
42
-
43
- /** Timestamp of the operation */
44
- timestamp: Date
45
-
46
- /** Source of the operation (defaults to 'user' if not specified) */
47
- source?: OperationSource
48
-
49
- /** Whether this operation can be undone */
50
- reversible: boolean
51
-
52
- /** Reason if operation is irreversible */
53
- irreversibleReason?: string
54
-
55
- /** XState transition name if triggered by FSM */
56
- transition?: string
57
-
58
- /** XState current state before transition */
59
- currentState?: string
60
-
61
- /** XState target state after transition */
62
- targetState?: string
63
-
64
- /** Action name if operation is an action execution (type: 'action') */
65
- actionName?: string
66
-
67
- /** Record IDs that the action was executed on */
68
- actionRecordIds?: string[]
69
-
70
- /** Result or status of the action execution */
71
- actionResult?: 'success' | 'failure' | 'pending'
72
-
73
- /** Error message if action execution failed */
74
- actionError?: string
75
-
76
- /** User or session identifier */
77
- userId?: string
78
-
79
- /** Additional metadata for custom use cases */
80
- metadata?: Record<string, any>
81
-
82
- /** Ancestor operation ID for batch operations */
83
- ancestorOperationId?: string
84
-
85
- /** Descendant operation IDs for batch operations */
86
- descendantOperationIds?: string[]
87
- }
88
-
89
- /**
90
- * Input type for adding operations
91
- * Excludes system-generated fields (id, timestamp)
92
- * @public
93
- */
94
- export type HSTOperationInput = Omit<HSTOperation, 'id' | 'timestamp' | 'source'> & {
95
- source?: OperationSource
96
- }
97
-
98
- /**
99
- * Batch operation wrapper
100
- * @public
101
- */
102
- export interface BatchOperation {
103
- /** Unique batch identifier */
104
- id: string
105
- /** Operations included in this batch */
106
- operations: HSTOperation[]
107
- /** When the batch was created */
108
- timestamp: Date
109
- /** Optional description of what this batch represents */
110
- description?: string
111
- /** Whether the entire batch can be undone */
112
- reversible: boolean
113
- }
114
-
115
- /**
116
- * Operation log configuration
117
- * @public
118
- */
119
- export interface OperationLogConfig {
120
- /** Maximum operations to store (default: 100) */
121
- maxOperations?: number
122
-
123
- /** Enable cross-tab synchronization (default: true) */
124
- enableCrossTabSync?: boolean
125
-
126
- /** Enable operation persistence to localStorage (default: false) */
127
- enablePersistence?: boolean
128
-
129
- /** Persistence key prefix */
130
- persistenceKeyPrefix?: string
131
-
132
- /** User identifier for multi-user scenarios */
133
- userId?: string
134
-
135
- /** Custom operation filter */
136
- operationFilter?: (operation: HSTOperation) => boolean
137
- }
138
-
139
- /**
140
- * Undo/Redo state
141
- * @public
142
- */
143
- export interface UndoRedoState {
144
- /** Can undo */
145
- canUndo: boolean
146
-
147
- /** Can redo */
148
- canRedo: boolean
149
-
150
- /** Number of operations available for undo */
151
- undoCount: number
152
-
153
- /** Number of operations available for redo */
154
- redoCount: number
155
-
156
- /** Current operation index */
157
- currentIndex: number
158
- }
159
-
160
- /**
161
- * Operation log snapshot for debugging
162
- * @public
163
- */
164
- export interface OperationLogSnapshot {
165
- /** All operations in the log */
166
- operations: HSTOperation[]
167
- /** Current operation index in the history */
168
- currentIndex: number
169
- /** Total number of operations */
170
- totalOperations: number
171
- /** Number of operations that can be undone */
172
- reversibleOperations: number
173
- /** Number of operations that cannot be undone */
174
- irreversibleOperations: number
175
- /** Timestamp of the oldest operation */
176
- oldestOperation?: Date
177
- /** Timestamp of the newest operation */
178
- newestOperation?: Date
179
- }
180
-
181
- /**
182
- * Cross-tab message types
183
- * @public
184
- */
185
- export type CrossTabMessageType = 'operation' | 'undo' | 'redo' | 'sync-request' | 'sync-response'
186
-
187
- /**
188
- * Cross-tab message payload
189
- * @public
190
- */
191
- export interface CrossTabMessage {
192
- /** Type of cross-tab message */
193
- type: CrossTabMessageType
194
- /** Single operation for operation/undo/redo messages */
195
- operation?: HSTOperation
196
- /** Multiple operations for sync messages */
197
- operations?: HSTOperation[]
198
- /** Identifier of the client/tab sending the message */
199
- clientId: string
200
- /** When the message was sent */
201
- timestamp: Date
202
- }
@@ -1,38 +0,0 @@
1
- import type { DataClient } from '@stonecrop/schema'
2
- import type { Component } from 'vue'
3
- import type { Router } from 'vue-router'
4
-
5
- import type Doctype from '../doctype'
6
- import type Registry from '../registry'
7
- import type { Stonecrop } from '../stonecrop'
8
- import type { RouteContext } from './registry'
9
-
10
- /**
11
- * Install options for Stonecrop Vue plugin
12
- * @public
13
- */
14
- export type InstallOptions = {
15
- router?: Router
16
- components?: Record<string, Component>
17
- getMeta?: (routeContext: RouteContext) => Doctype | Promise<Doctype>
18
- /**
19
- * Data client for fetching doctype metadata and records.
20
- * Use \@stonecrop/graphql-client's StonecropClient for GraphQL backends,
21
- * or implement DataClient for custom data sources.
22
- *
23
- * Can be set later via `useStonecropRegistry().setClient()` for deferred configuration.
24
- *
25
- * @example
26
- * ```ts
27
- * import { StonecropClient } from '@stonecrop/graphql-client'
28
- *
29
- * const client = new StonecropClient({ endpoint: '/graphql' })
30
- * app.use(StonecropPlugin, { client })
31
- * ```
32
- */
33
- client?: DataClient
34
- /** Automatically run initialization callback after app mounting (default: false) */
35
- autoInitializeRouter?: boolean
36
- /** Callback function called after plugin is ready and mounted */
37
- onRouterInitialized?: (registry: Registry, stonecrop: Stonecrop) => void | Promise<void>
38
- }
@@ -1,10 +0,0 @@
1
- /**
2
- * Route context passed to getMeta function
3
- * @public
4
- */
5
- export interface RouteContext {
6
- /** The full route path (e.g., "/todo/1" or "/todo") */
7
- path: string
8
- /** Path segments split by "/" (e.g., ["todo", "1"] or ["todo"]) */
9
- segments: string[]
10
- }
@@ -1,69 +0,0 @@
1
- import type Registry from '../registry'
2
-
3
- /**
4
- * Validation severity levels
5
- * @public
6
- */
7
- export enum ValidationSeverity {
8
- /** Blocking error that prevents save */
9
- ERROR = 'error',
10
- /** Advisory warning that allows save */
11
- WARNING = 'warning',
12
- /** Informational message */
13
- INFO = 'info',
14
- }
15
-
16
- /**
17
- * Validation issue
18
- * @public
19
- */
20
- export interface ValidationIssue {
21
- /** Severity level */
22
- severity: ValidationSeverity
23
- /** Validation rule that failed */
24
- rule: string
25
- /** Human-readable message */
26
- message: string
27
- /** Doctype name */
28
- doctype?: string
29
- /** Field name if applicable */
30
- fieldname?: string
31
- /** Additional context */
32
- context?: Record<string, unknown>
33
- }
34
-
35
- /**
36
- * Validation result
37
- * @public
38
- */
39
- export interface ValidationResult {
40
- /** Whether validation passed (no blocking errors) */
41
- valid: boolean
42
- /** List of validation issues */
43
- issues: ValidationIssue[]
44
- /** Count of errors */
45
- errorCount: number
46
- /** Count of warnings */
47
- warningCount: number
48
- /** Count of info messages */
49
- infoCount: number
50
- }
51
-
52
- /**
53
- * Schema validator options
54
- * @public
55
- */
56
- export interface ValidatorOptions {
57
- /** Registry instance for doctype lookups */
58
- registry?: Registry
59
- /** Whether to validate Link field targets */
60
- validateLinkTargets?: boolean
61
- /** Whether to validate links object (target resolution, backlink consistency, Link field correspondence) */
62
- validateLinks?: boolean
63
- /** Whether to validate workflow reachability */
64
- validateWorkflows?: boolean
65
- /** Whether to validate action registration */
66
- validateActions?: boolean
67
- /** Whether to validate required schema properties */
68
- validateRequiredProperties?: boolean
69
- }
@@ -1,33 +0,0 @@
1
- import type { DataClient } from '@stonecrop/schema'
2
-
3
- /**
4
- * Pagination metadata from the last {@link Stonecrop.getRecords} for a doctype.
5
- * Kept beside HST, not in it — see {@link Stonecrop.getPageInfo}.
6
- * @public
7
- */
8
- export interface PageInfo {
9
- /** Whether the backend holds further records beyond what has been fetched */
10
- hasMore: boolean
11
- /** Total matching the filters when the caller passed includeTotal */
12
- count?: number
13
- /** Offset of the last fetch */
14
- offset: number
15
- /** Number of rows in the last page (result.data.length) */
16
- limit: number
17
- }
18
-
19
- /**
20
- * Options for constructing a Stonecrop instance directly.
21
- * When using the Vue plugin, pass these via `InstallOptions` instead.
22
- * @public
23
- */
24
- export interface StonecropOptions {
25
- /**
26
- * Data client for fetching doctype metadata and records.
27
- * Use \@stonecrop/graphql-client's StonecropClient for GraphQL backends,
28
- * or implement DataClient for custom data sources.
29
- *
30
- * Can be set later via `setClient()` for deferred configuration.
31
- */
32
- client?: DataClient
33
- }