@lightdash/common 0.2072.0 → 0.2073.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.
@@ -0,0 +1,349 @@
1
+ {
2
+ "$schema": "http://json-schema.org/draft-07/schema#",
3
+ "$id": "https://schemas.lightdash.com/lightdash/dashboard-as-code.json",
4
+ "title": "Lightdash Dashboard as Code",
5
+ "description": "Schema for defining Lightdash dashboards in YAML format for version control",
6
+ "type": "object",
7
+ "required": [
8
+ "name",
9
+ "slug",
10
+ "spaceSlug",
11
+ "version",
12
+ "tiles",
13
+ "filters",
14
+ "tabs"
15
+ ],
16
+ "properties": {
17
+ "version": {
18
+ "type": "number",
19
+ "description": "Schema version for this dashboard configuration",
20
+ "const": 1
21
+ },
22
+ "name": {
23
+ "type": "string",
24
+ "description": "Display name of the dashboard",
25
+ "minLength": 1
26
+ },
27
+ "description": {
28
+ "type": "string",
29
+ "description": "Optional description of what this dashboard displays"
30
+ },
31
+ "slug": {
32
+ "type": "string",
33
+ "description": "Unique identifier slug for this dashboard",
34
+ "pattern": "^[a-z0-9]+(?:-[a-z0-9]+)*$"
35
+ },
36
+ "spaceSlug": {
37
+ "type": "string",
38
+ "description": "Path to the space containing this dashboard (e.g., 'sales/reports' or 'marketing')"
39
+ },
40
+ "updatedAt": {
41
+ "type": "string",
42
+ "format": "date-time",
43
+ "description": "Timestamp when the dashboard was last updated (readonly)"
44
+ },
45
+ "downloadedAt": {
46
+ "type": "string",
47
+ "format": "date-time",
48
+ "description": "Timestamp when this dashboard was downloaded from Lightdash (readonly)"
49
+ },
50
+ "tiles": {
51
+ "type": "array",
52
+ "description": "Array of tiles (charts, markdown, loom videos) positioned on the dashboard",
53
+ "items": {
54
+ "type": "object",
55
+ "required": ["type", "x", "y", "h", "w"],
56
+ "properties": {
57
+ "uuid": {
58
+ "type": "string",
59
+ "description": "Optional UUID for the tile (generated if not provided)"
60
+ },
61
+ "tileSlug": {
62
+ "type": "string",
63
+ "description": "Optional slug identifier for the tile"
64
+ },
65
+ "type": {
66
+ "type": "string",
67
+ "description": "Type of dashboard tile",
68
+ "enum": ["saved_chart", "markdown", "loom"]
69
+ },
70
+ "x": {
71
+ "type": "number",
72
+ "description": "Horizontal position in grid units",
73
+ "minimum": 0
74
+ },
75
+ "y": {
76
+ "type": "number",
77
+ "description": "Vertical position in grid units",
78
+ "minimum": 0
79
+ },
80
+ "h": {
81
+ "type": "number",
82
+ "description": "Height in grid units",
83
+ "minimum": 1
84
+ },
85
+ "w": {
86
+ "type": "number",
87
+ "description": "Width in grid units",
88
+ "minimum": 1
89
+ },
90
+ "tabUuid": {
91
+ "type": ["string", "null"],
92
+ "description": "UUID of the tab this tile belongs to, or null for default tab"
93
+ },
94
+ "properties": {
95
+ "type": "object",
96
+ "description": "Tile-specific properties (varies by tile type)",
97
+ "oneOf": [
98
+ {
99
+ "description": "Properties for a saved chart tile",
100
+ "properties": {
101
+ "title": {
102
+ "type": "string",
103
+ "description": "Optional custom title override for the chart"
104
+ },
105
+ "hideTitle": {
106
+ "type": "boolean",
107
+ "description": "Whether to hide the chart title"
108
+ },
109
+ "chartSlug": {
110
+ "type": "string",
111
+ "description": "Slug of the chart to display"
112
+ },
113
+ "chartName": {
114
+ "type": "string",
115
+ "description": "Name of the chart"
116
+ }
117
+ },
118
+ "required": ["chartSlug"]
119
+ },
120
+ {
121
+ "description": "Properties for a markdown tile",
122
+ "properties": {
123
+ "title": {
124
+ "type": "string",
125
+ "description": "Title of the markdown tile"
126
+ },
127
+ "hideTitle": {
128
+ "type": "boolean",
129
+ "description": "Whether to hide the markdown tile title"
130
+ },
131
+ "content": {
132
+ "type": "string",
133
+ "description": "Markdown content to display"
134
+ }
135
+ },
136
+ "required": ["title", "content"]
137
+ },
138
+ {
139
+ "description": "Properties for a Loom video tile",
140
+ "properties": {
141
+ "title": {
142
+ "type": "string",
143
+ "description": "Title of the Loom tile"
144
+ },
145
+ "hideTitle": {
146
+ "type": "boolean",
147
+ "description": "Whether to hide the tile title"
148
+ },
149
+ "url": {
150
+ "type": "string",
151
+ "format": "uri",
152
+ "description": "URL of the Loom video"
153
+ }
154
+ },
155
+ "required": ["title", "url"]
156
+ }
157
+ ]
158
+ }
159
+ }
160
+ }
161
+ },
162
+ "tabs": {
163
+ "type": "array",
164
+ "description": "Dashboard tabs for organizing tiles into separate views",
165
+ "items": {
166
+ "type": "object",
167
+ "required": ["uuid", "name", "order"],
168
+ "properties": {
169
+ "uuid": {
170
+ "type": "string",
171
+ "description": "Unique identifier for the tab"
172
+ },
173
+ "name": {
174
+ "type": "string",
175
+ "description": "Display name of the tab",
176
+ "minLength": 1
177
+ },
178
+ "order": {
179
+ "type": "number",
180
+ "description": "Sort order of the tab (lower numbers appear first)",
181
+ "minimum": 0
182
+ }
183
+ }
184
+ }
185
+ },
186
+ "filters": {
187
+ "type": "object",
188
+ "description": "Dashboard-level filters that can be applied across all tiles",
189
+ "required": ["dimensions"],
190
+ "properties": {
191
+ "dimensions": {
192
+ "type": "array",
193
+ "description": "Dimension filters applied to the dashboard",
194
+ "items": {
195
+ "type": "object",
196
+ "required": ["operator", "target"],
197
+ "properties": {
198
+ "operator": {
199
+ "type": "string",
200
+ "description": "Filter operator determining how values are compared",
201
+ "enum": [
202
+ "isNull",
203
+ "notNull",
204
+ "equals",
205
+ "notEquals",
206
+ "startsWith",
207
+ "endsWith",
208
+ "include",
209
+ "doesNotInclude",
210
+ "lessThan",
211
+ "lessThanOrEqual",
212
+ "greaterThan",
213
+ "greaterThanOrEqual",
214
+ "inThePast",
215
+ "notInThePast",
216
+ "inTheNext",
217
+ "inTheCurrent",
218
+ "notInTheCurrent",
219
+ "inBetween",
220
+ "notInBetween"
221
+ ]
222
+ },
223
+ "values": {
224
+ "type": "array",
225
+ "description": "Values to filter by (varies by operator)",
226
+ "items": {}
227
+ },
228
+ "target": {
229
+ "type": "object",
230
+ "description": "Field to apply the filter to",
231
+ "required": ["fieldId", "tableName"],
232
+ "properties": {
233
+ "fieldId": {
234
+ "type": "string",
235
+ "description": "ID of the field to filter (e.g., 'orders_status')"
236
+ },
237
+ "fieldName": {
238
+ "type": "string",
239
+ "description": "Human-readable name of the field (e.g., 'status')"
240
+ },
241
+ "tableName": {
242
+ "type": "string",
243
+ "description": "Table containing the field (e.g., 'orders')"
244
+ },
245
+ "isSqlColumn": {
246
+ "type": "boolean",
247
+ "description": "Whether the fieldId refers to a SQL column name"
248
+ },
249
+ "fallbackType": {
250
+ "type": "string",
251
+ "description": "Fallback type when field is not available",
252
+ "enum": [
253
+ "string",
254
+ "number",
255
+ "boolean",
256
+ "date",
257
+ "timestamp"
258
+ ]
259
+ }
260
+ }
261
+ },
262
+ "settings": {
263
+ "type": "object",
264
+ "description": "Additional settings for date/time filters",
265
+ "properties": {
266
+ "unitOfTime": {
267
+ "type": "string",
268
+ "enum": [
269
+ "milliseconds",
270
+ "seconds",
271
+ "minutes",
272
+ "hours",
273
+ "days",
274
+ "weeks",
275
+ "months",
276
+ "quarters",
277
+ "years"
278
+ ]
279
+ },
280
+ "completed": {
281
+ "type": "boolean",
282
+ "description": "For date filters, whether to include completed periods"
283
+ }
284
+ }
285
+ },
286
+ "disabled": {
287
+ "type": "boolean",
288
+ "description": "Whether this filter is currently disabled"
289
+ },
290
+ "required": {
291
+ "type": "boolean",
292
+ "description": "Whether this filter must be set by users"
293
+ },
294
+ "tileTargets": {
295
+ "type": "object",
296
+ "description": "Per-tile filter configuration (tile UUID -> field mapping or false to disable)",
297
+ "additionalProperties": {
298
+ "oneOf": [
299
+ {
300
+ "type": "boolean",
301
+ "const": false
302
+ },
303
+ {
304
+ "type": "object",
305
+ "required": [
306
+ "fieldId",
307
+ "tableName"
308
+ ],
309
+ "properties": {
310
+ "fieldId": {
311
+ "type": "string"
312
+ },
313
+ "tableName": {
314
+ "type": "string"
315
+ }
316
+ }
317
+ }
318
+ ]
319
+ }
320
+ },
321
+ "label": {
322
+ "type": ["string", "null"],
323
+ "description": "Custom label for the filter"
324
+ },
325
+ "singleValue": {
326
+ "type": "boolean",
327
+ "description": "Whether the filter only accepts a single value"
328
+ }
329
+ }
330
+ }
331
+ },
332
+ "metrics": {
333
+ "type": "array",
334
+ "description": "Metric filters applied to the dashboard",
335
+ "items": {
336
+ "$ref": "#/properties/filters/properties/dimensions/items"
337
+ }
338
+ },
339
+ "tableCalculations": {
340
+ "type": "array",
341
+ "description": "Table calculation filters applied to the dashboard",
342
+ "items": {
343
+ "$ref": "#/properties/filters/properties/dimensions/items"
344
+ }
345
+ }
346
+ }
347
+ }
348
+ }
349
+ }