@principal-ai/principal-view-core 0.26.12 → 0.26.13

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,85 @@
1
+ /**
2
+ * Dashboard File Validator
3
+ *
4
+ * Validates dashboard definition files (.dashboard.json) that define metrics,
5
+ * layout, and data sources for observability dashboards.
6
+ */
7
+ import type { DashboardDefinition } from '../types/dashboard';
8
+ /**
9
+ * Validation error details
10
+ */
11
+ export interface DashboardValidationError {
12
+ path: string;
13
+ message: string;
14
+ severity: 'error' | 'warning';
15
+ suggestion?: string;
16
+ }
17
+ /**
18
+ * Validation result
19
+ */
20
+ export interface DashboardValidationResult {
21
+ valid: boolean;
22
+ errors: DashboardValidationError[];
23
+ warnings: DashboardValidationError[];
24
+ }
25
+ /**
26
+ * Context for cross-reference validation (optional)
27
+ */
28
+ export interface DashboardValidationContext {
29
+ /** Known storyboard names for source validation */
30
+ storyboards?: string[];
31
+ /** Known workflow names per storyboard */
32
+ workflows?: Record<string, string[]>;
33
+ /** Known event names */
34
+ events?: string[];
35
+ }
36
+ /**
37
+ * Validator for dashboard definition files
38
+ */
39
+ export declare class DashboardValidator {
40
+ /**
41
+ * Validate dashboard definition structure
42
+ */
43
+ validate(data: unknown, filePath?: string, context?: DashboardValidationContext): DashboardValidationResult;
44
+ /**
45
+ * Validate a single metric definition
46
+ */
47
+ private validateMetric;
48
+ /**
49
+ * Validate a metric source
50
+ */
51
+ private validateSource;
52
+ /**
53
+ * Validate a metric query
54
+ */
55
+ private validateQuery;
56
+ /**
57
+ * Validate metric display options
58
+ */
59
+ private validateDisplay;
60
+ /**
61
+ * Validate dashboard layout
62
+ */
63
+ private validateLayout;
64
+ /**
65
+ * Validate a layout row
66
+ */
67
+ private validateRow;
68
+ /**
69
+ * Validate a panel placement
70
+ */
71
+ private validatePanel;
72
+ /**
73
+ * Validate and throw if invalid
74
+ */
75
+ validateOrThrow(data: unknown, filePath?: string, context?: DashboardValidationContext): DashboardDefinition;
76
+ /**
77
+ * Format validation result as human-readable report
78
+ */
79
+ formatReport(result: DashboardValidationResult): string;
80
+ }
81
+ /**
82
+ * Create a new dashboard validator instance
83
+ */
84
+ export declare function createDashboardValidator(): DashboardValidator;
85
+ //# sourceMappingURL=DashboardValidator.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DashboardValidator.d.ts","sourceRoot":"","sources":["../../src/dashboard/DashboardValidator.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EACV,mBAAmB,EAYpB,MAAM,oBAAoB,CAAC;AAE5B;;GAEG;AACH,MAAM,WAAW,wBAAwB;IACvC,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,OAAO,GAAG,SAAS,CAAC;IAC9B,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED;;GAEG;AACH,MAAM,WAAW,yBAAyB;IACxC,KAAK,EAAE,OAAO,CAAC;IACf,MAAM,EAAE,wBAAwB,EAAE,CAAC;IACnC,QAAQ,EAAE,wBAAwB,EAAE,CAAC;CACtC;AAED;;GAEG;AACH,MAAM,WAAW,0BAA0B;IACzC,mDAAmD;IACnD,WAAW,CAAC,EAAE,MAAM,EAAE,CAAC;IACvB,0CAA0C;IAC1C,SAAS,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,CAAC;IACrC,wBAAwB;IACxB,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;CACnB;AAqCD;;GAEG;AACH,qBAAa,kBAAkB;IAC7B;;OAEG;IACH,QAAQ,CACN,IAAI,EAAE,OAAO,EACb,QAAQ,CAAC,EAAE,MAAM,EACjB,OAAO,CAAC,EAAE,0BAA0B,GACnC,yBAAyB;IAmJ5B;;OAEG;IACH,OAAO,CAAC,cAAc;IA+JtB;;OAEG;IACH,OAAO,CAAC,cAAc;IA0GtB;;OAEG;IACH,OAAO,CAAC,aAAa;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