Schema: Move known shared types into the common (#61875)

* Setup shared types

* Expand field types

* Fix array type

* Add QueryResultMeta

* Add QueryResultBase

* Add DataFrameJSON

* Add DataSourcePluginMeta

* Update QueryResultMetaStat

* Add plugin cue and veneers

* Rexport dupliate types to fix errors

* Fix export

* Update types

* Remove data frame/plugin types

* Cleanup types

* Remove redundant type

* Remove data frame related types
This commit is contained in:
Alex Khomenko
2023-01-24 18:45:28 +02:00
committed by GitHub
parent f85d072c17
commit 8e94eab9ff
5 changed files with 40 additions and 13 deletions

View File

@@ -38,7 +38,7 @@ export type PreferredVisualisationType = typeof preferredVisualizationTypes[numb
export interface QueryResultMeta { export interface QueryResultMeta {
type?: DataFrameType; type?: DataFrameType;
/** DatasSource Specific Values */ /** DataSource Specific Values */
custom?: Record<string, any>; custom?: Record<string, any>;
/** Stats */ /** Stats */

View File

@@ -8,6 +8,17 @@
// Run 'make gen-cue' from repository root to regenerate. // Run 'make gen-cue' from repository root to regenerate.
/**
* TODO docs
*/
export interface DataSourceJsonData {
alertmanagerUid?: string;
authType?: string;
defaultRegion?: string;
manageAlerts?: boolean;
profile?: string;
}
/** /**
* These are the common properties available to all queries in all datasources. * These are the common properties available to all queries in all datasources.
* Specific implementations will *extend* this interface, adding the required * Specific implementations will *extend* this interface, adding the required
@@ -524,6 +535,14 @@ export enum BarGaugeDisplayMode {
Lcd = 'lcd', Lcd = 'lcd',
} }
/**
* TODO docs
*/
export interface VizTooltipOptions {
mode: TooltipDisplayMode;
sort: SortOrder;
}
/** /**
* Internally, this is the "type" of cell that's being displayed * Internally, this is the "type" of cell that's being displayed
* in the table such as colored text, JSON, gauge, etc. * in the table such as colored text, JSON, gauge, etc.
@@ -648,13 +667,7 @@ export interface FrameGeometrySource {
wkt?: string; wkt?: string;
} }
/** export interface Labels {}
* TODO docs
*/
export interface VizTooltipOptions {
mode: TooltipDisplayMode;
sort: SortOrder;
}
/** /**
* Field options for each field within a table (e.g 10, "The String", 64.20, etc.) * Field options for each field within a table (e.g 10, "The String", 64.20, etc.)

View File

@@ -0,0 +1,10 @@
package common
// TODO docs
DataSourceJsonData: {
authType?: string
defaultRegion?: string
profile?: string
manageAlerts?: bool
alertmanagerUid?: string
} @cuetsy(kind="interface")

View File

@@ -245,4 +245,6 @@ VizTooltipOptions: {
sort: SortOrder sort: SortOrder
} @cuetsy(kind="interface") } @cuetsy(kind="interface")
Labels: {
[string]: string
} @cuetsy(kind="interface")

View File

@@ -2,7 +2,9 @@
"kinds": { "kinds": {
"alertgroupspanelcfg": { "alertgroupspanelcfg": {
"category": "composable", "category": "composable",
"codeowners": [], "codeowners": [
"grafana/alerting-squad-frontend"
],
"currentVersion": [ "currentVersion": [
0, 0,
0 0
@@ -10,10 +12,10 @@
"grafanaMaturityCount": 0, "grafanaMaturityCount": 0,
"lineageIsGroup": true, "lineageIsGroup": true,
"links": { "links": {
"docs": "https:/grafana.com/docs/grafana/next/developers/kinds/composable/alertgroupspanelcfg/schema-reference", "docs": "https://grafana.com/docs/grafana/next/developers/kinds/composable/alertgroupspanelcfg/schema-reference",
"go": "n/a", "go": "n/a",
"schema": "https:/github.com/grafana/grafana/tree/main/public/app/plugins/panel/alertGroups/panelcfg.cue", "schema": "https://github.com/grafana/grafana/tree/main/public/app/plugins/panel/alertGroups/panelcfg.cue",
"ts": "https:/github.com/grafana/grafana/tree/main/public/app/plugins/panel/alertGroups/panelcfg.gen.ts" "ts": "https://github.com/grafana/grafana/tree/main/public/app/plugins/panel/alertGroups/panelcfg.gen.ts"
}, },
"machineName": "alertgroupspanelcfg", "machineName": "alertgroupspanelcfg",
"maturity": "merged", "maturity": "merged",