@dforge-core/dforge-mcp 0.1.0-rc.1

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.
@@ -0,0 +1,299 @@
1
+ {
2
+ "$schema": "http://json-schema.org/draft-07/schema#",
3
+ "$id": "https://dforge.dev/schemas/data_views.schema.json",
4
+ "title": "dForge Data Views",
5
+ "description": "Data view definitions for a dForge module",
6
+ "type": "object",
7
+ "additionalProperties": {
8
+ "$ref": "#/$defs/dataView"
9
+ },
10
+ "$defs": {
11
+ "dataView": {
12
+ "type": "object",
13
+ "required": ["viewType", "dataSources"],
14
+ "properties": {
15
+ "viewType": {
16
+ "type": "string",
17
+ "enum": ["grid", "list", "kanban", "calendar", "gallery", "tree-grid", "diagram", "master-detail", "library"],
18
+ "description": "View display type"
19
+ },
20
+ "label": {
21
+ "type": "string",
22
+ "description": "Human-readable view name"
23
+ },
24
+ "icon": {
25
+ "type": "string",
26
+ "description": "Bootstrap icon class (e.g. 'bi-bounding-box')"
27
+ },
28
+ "description": {
29
+ "type": "string",
30
+ "description": "Optional description text shown on view cards"
31
+ },
32
+ "dataSources": {
33
+ "type": "array",
34
+ "items": {
35
+ "$ref": "#/$defs/dataSource"
36
+ },
37
+ "minItems": 1,
38
+ "description": "Data sources providing data for this view"
39
+ },
40
+ "filter": {
41
+ "description": "Default filter criteria"
42
+ },
43
+ "order": {
44
+ "description": "Default sort order"
45
+ },
46
+ "viewConfig": {
47
+ "type": "object",
48
+ "description": "View-type-specific configuration"
49
+ }
50
+ },
51
+ "additionalProperties": false,
52
+ "allOf": [
53
+ { "$ref": "#/$defs/rules/kanban" },
54
+ { "$ref": "#/$defs/rules/calendar" },
55
+ { "$ref": "#/$defs/rules/tree-grid" },
56
+ { "$ref": "#/$defs/rules/list" },
57
+ { "$ref": "#/$defs/rules/diagram" },
58
+ { "$ref": "#/$defs/rules/master-detail" }
59
+ ]
60
+ },
61
+
62
+ "rules": {
63
+ "kanban": {
64
+ "if": {
65
+ "properties": { "viewType": { "const": "kanban" } },
66
+ "required": ["viewType"]
67
+ },
68
+ "then": {
69
+ "properties": {
70
+ "viewConfig": { "$ref": "#/$defs/kanbanViewConfig" }
71
+ }
72
+ }
73
+ },
74
+ "calendar": {
75
+ "if": {
76
+ "properties": { "viewType": { "const": "calendar" } },
77
+ "required": ["viewType"]
78
+ },
79
+ "then": {
80
+ "properties": {
81
+ "viewConfig": { "$ref": "#/$defs/calendarViewConfig" }
82
+ }
83
+ }
84
+ },
85
+ "tree-grid": {
86
+ "if": {
87
+ "properties": { "viewType": { "const": "tree-grid" } },
88
+ "required": ["viewType"]
89
+ },
90
+ "then": {
91
+ "properties": {
92
+ "viewConfig": { "$ref": "#/$defs/treeGridViewConfig" }
93
+ }
94
+ }
95
+ },
96
+ "list": {
97
+ "if": {
98
+ "properties": { "viewType": { "const": "list" } },
99
+ "required": ["viewType"]
100
+ },
101
+ "then": {
102
+ "properties": {
103
+ "viewConfig": { "$ref": "#/$defs/listViewConfig" }
104
+ }
105
+ }
106
+ },
107
+ "diagram": {
108
+ "if": {
109
+ "properties": { "viewType": { "const": "diagram" } },
110
+ "required": ["viewType"]
111
+ },
112
+ "then": {
113
+ "properties": {
114
+ "viewConfig": { "$ref": "#/$defs/diagramViewConfig" }
115
+ }
116
+ }
117
+ },
118
+ "master-detail": {
119
+ "if": {
120
+ "properties": { "viewType": { "const": "master-detail" } },
121
+ "required": ["viewType"]
122
+ },
123
+ "then": {
124
+ "properties": {
125
+ "dataSources": { "minItems": 2 }
126
+ }
127
+ }
128
+ }
129
+ },
130
+
131
+ "kanbanViewConfig": {
132
+ "type": "object",
133
+ "required": ["groupByField"],
134
+ "properties": {
135
+ "groupByField": {
136
+ "type": "string",
137
+ "description": "Column code of a dropdown/flags/reference field to group cards by"
138
+ }
139
+ },
140
+ "additionalProperties": false
141
+ },
142
+ "calendarViewConfig": {
143
+ "type": "object",
144
+ "required": ["dateField"],
145
+ "properties": {
146
+ "dateField": {
147
+ "type": "string",
148
+ "description": "Column code of the date/timestamp field used to place events on the calendar"
149
+ },
150
+ "titleField": {
151
+ "type": "string",
152
+ "description": "Column code of the field displayed as event title. Defaults to the entity's toString template."
153
+ },
154
+ "colorField": {
155
+ "type": "string",
156
+ "description": "Optional column whose value drives the event pill color. For dropdown/flags columns, colors come from params.options rich form; otherwise a deterministic hash is used."
157
+ }
158
+ },
159
+ "additionalProperties": false
160
+ },
161
+ "treeGridViewConfig": {
162
+ "type": "object",
163
+ "required": ["parentField"],
164
+ "properties": {
165
+ "parentField": {
166
+ "type": "string",
167
+ "description": "Column code of the self-referencing FK (parent record)"
168
+ },
169
+ "labelField": {
170
+ "type": "string",
171
+ "description": "Field to display as node label (defaults to entity toString)"
172
+ },
173
+ "iconField": {
174
+ "type": "string",
175
+ "description": "Field containing a Bootstrap icon class per node"
176
+ }
177
+ },
178
+ "additionalProperties": false
179
+ },
180
+ "listViewConfig": {
181
+ "type": "object",
182
+ "properties": {
183
+ "titleField": {
184
+ "type": "string",
185
+ "description": "Column code of the primary display field"
186
+ },
187
+ "subtitleField": {
188
+ "type": "string",
189
+ "description": "Column code of the secondary display field"
190
+ },
191
+ "levels": {
192
+ "type": "array",
193
+ "items": { "$ref": "#/$defs/listLevelConfig" },
194
+ "description": "Hierarchical child levels for expandable list rows"
195
+ }
196
+ },
197
+ "additionalProperties": false
198
+ },
199
+ "listLevelConfig": {
200
+ "type": "object",
201
+ "required": ["entityCode", "foreignKey"],
202
+ "properties": {
203
+ "entityCode": {
204
+ "type": "string",
205
+ "description": "Entity code for this child level"
206
+ },
207
+ "foreignKey": {
208
+ "type": "string",
209
+ "description": "FK column in the child entity linking back to the parent"
210
+ },
211
+ "columns": {
212
+ "type": "array",
213
+ "items": { "type": "string" },
214
+ "description": "Columns to display inline for each child row"
215
+ }
216
+ },
217
+ "additionalProperties": false
218
+ },
219
+ "diagramViewConfig": {
220
+ "type": "object",
221
+ "properties": {
222
+ "groupByField": {
223
+ "type": "string",
224
+ "description": "Column code to group diagram nodes by (e.g. 'module', 'project')"
225
+ },
226
+ "defaultHiddenGroups": {
227
+ "type": "array",
228
+ "items": { "type": "string" },
229
+ "description": "Group values to hide by default in the diagram"
230
+ }
231
+ },
232
+ "additionalProperties": false
233
+ },
234
+
235
+ "viewColumn": {
236
+ "oneOf": [
237
+ {
238
+ "type": "string",
239
+ "description": "Column code (shorthand)"
240
+ },
241
+ {
242
+ "type": "object",
243
+ "required": ["column_cd"],
244
+ "properties": {
245
+ "column_cd": {
246
+ "type": "string",
247
+ "description": "Column code"
248
+ },
249
+ "width": {
250
+ "type": "integer",
251
+ "minimum": 1,
252
+ "description": "Column width in pixels"
253
+ },
254
+ "visible": {
255
+ "type": "boolean",
256
+ "default": true,
257
+ "description": "Whether the column is visible"
258
+ },
259
+ "pinned": {
260
+ "type": "string",
261
+ "enum": ["left", "right"],
262
+ "description": "Pin column to left or right edge"
263
+ }
264
+ },
265
+ "additionalProperties": false
266
+ }
267
+ ]
268
+ },
269
+ "dataSource": {
270
+ "type": "object",
271
+ "required": ["entityCode"],
272
+ "properties": {
273
+ "entityCode": {
274
+ "type": "string",
275
+ "description": "Entity code to query"
276
+ },
277
+ "level": {
278
+ "type": "integer",
279
+ "minimum": 0,
280
+ "description": "Nesting level (0 = root, 1+ = detail). Defaults to 0"
281
+ },
282
+ "label": {
283
+ "type": "string",
284
+ "description": "Human-readable label for this data source (used in master-detail tabs)"
285
+ },
286
+ "columns": {
287
+ "type": "array",
288
+ "items": { "$ref": "#/$defs/viewColumn" },
289
+ "description": "Column configuration — strings or objects with width/visibility"
290
+ },
291
+ "parentSetField": {
292
+ "type": "string",
293
+ "description": "Set field name on parent entity linking to this detail level"
294
+ }
295
+ },
296
+ "additionalProperties": false
297
+ }
298
+ }
299
+ }