@intentius/chant-lexicon-grafana 0.99.0 → 0.101.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.
- package/README.md +12 -6
- package/dist/annotations.d.ts +61 -0
- package/dist/annotations.d.ts.map +1 -0
- package/dist/api/apply.d.ts +8 -4
- package/dist/api/apply.d.ts.map +1 -1
- package/dist/api/fake-grafana.d.ts +2 -0
- package/dist/api/fake-grafana.d.ts.map +1 -1
- package/dist/api/folders.d.ts +53 -17
- package/dist/api/folders.d.ts.map +1 -1
- package/dist/build.d.ts +26 -5
- package/dist/build.d.ts.map +1 -1
- package/dist/catalog.d.ts +1 -1
- package/dist/catalog.d.ts.map +1 -1
- package/dist/codegen/docs.d.ts.map +1 -1
- package/dist/codegen/generate.d.ts +7 -1
- package/dist/codegen/generate.d.ts.map +1 -1
- package/dist/composites/agent-dashboard.d.ts +80 -6
- package/dist/composites/agent-dashboard.d.ts.map +1 -1
- package/dist/composites/catalog.d.ts.map +1 -1
- package/dist/composites/index.d.ts +1 -1
- package/dist/composites/index.d.ts.map +1 -1
- package/dist/composites/shared.d.ts +4 -3
- package/dist/composites/shared.d.ts.map +1 -1
- package/dist/dashboard.d.ts +42 -14
- package/dist/dashboard.d.ts.map +1 -1
- package/dist/datasource-refs.d.ts +9 -5
- package/dist/datasource-refs.d.ts.map +1 -1
- package/dist/datasource-settings.d.ts +834 -0
- package/dist/datasource-settings.d.ts.map +1 -0
- package/dist/datasource.d.ts +53 -11
- package/dist/datasource.d.ts.map +1 -1
- package/dist/deep-observe-hooks.d.ts +1 -1
- package/dist/deep-observe-hooks.d.ts.map +1 -1
- package/dist/deep-observe.d.ts +9 -4
- package/dist/deep-observe.d.ts.map +1 -1
- package/dist/describe-resources.d.ts +1 -0
- package/dist/describe-resources.d.ts.map +1 -1
- package/dist/detect.d.ts +4 -2
- package/dist/detect.d.ts.map +1 -1
- package/dist/folder.d.ts +68 -0
- package/dist/folder.d.ts.map +1 -0
- package/dist/import/generator.d.ts.map +1 -1
- package/dist/import/mappings.d.ts +12 -6
- package/dist/import/mappings.d.ts.map +1 -1
- package/dist/import/model.d.ts +7 -0
- package/dist/import/model.d.ts.map +1 -1
- package/dist/import/normalize.d.ts.map +1 -1
- package/dist/import/parser.d.ts +16 -1
- package/dist/import/parser.d.ts.map +1 -1
- package/dist/import/testdata/fixtures.d.ts +6 -0
- package/dist/import/testdata/fixtures.d.ts.map +1 -1
- package/dist/import/v2.d.ts +4 -3
- package/dist/import/v2.d.ts.map +1 -1
- package/dist/index.d.ts +12 -10
- package/dist/index.d.ts.map +1 -1
- package/dist/init-templates.d.ts +27 -0
- package/dist/init-templates.d.ts.map +1 -0
- package/dist/integrity.json +11 -9
- package/dist/lint/audit-catalog.d.ts +1 -1
- package/dist/lint/audit-catalog.d.ts.map +1 -1
- package/dist/lint/post-synth/graf101.d.ts +1 -1
- package/dist/lint/post-synth/graf104.d.ts +2 -2
- package/dist/lint/post-synth/graf106.d.ts +2 -2
- package/dist/lint/post-synth/graf110.d.ts +8 -0
- package/dist/lint/post-synth/graf110.d.ts.map +1 -0
- package/dist/lint/post-synth/grafana-helpers.d.ts.map +1 -1
- package/dist/lint/post-synth/index.d.ts.map +1 -1
- package/dist/manifest.json +1 -1
- package/dist/meta.json +70 -0
- package/dist/okf/index.md +18 -3
- package/dist/okf/rules/GRAF101.md +2 -2
- package/dist/okf/rules/GRAF104.md +2 -2
- package/dist/okf/rules/GRAF106.md +2 -2
- package/dist/okf/rules/GRAF110.md +11 -0
- package/dist/okf/types/AdhocVariable.md +9 -0
- package/dist/okf/types/AzureMonitorQuery.md +9 -0
- package/dist/okf/types/BigQueryQuery.md +9 -0
- package/dist/okf/types/CloudMonitoringQuery.md +9 -0
- package/dist/okf/types/CloudWatchQuery.md +9 -0
- package/dist/okf/types/Dashboard.md +1 -1
- package/dist/okf/types/Datasource.md +1 -1
- package/dist/okf/types/DatasourceProvisioning.md +9 -0
- package/dist/okf/types/ElasticsearchQuery.md +9 -0
- package/dist/okf/types/ExternalDatasource.md +1 -1
- package/dist/okf/types/Folder.md +9 -0
- package/dist/okf/types/GroupByVariable.md +9 -0
- package/dist/okf/types/MSSQLQuery.md +9 -0
- package/dist/okf/types/MySQLQuery.md +9 -0
- package/dist/okf/types/PostgresQuery.md +9 -0
- package/dist/okf/types/PyroscopeQuery.md +9 -0
- package/dist/okf/types/SwitchVariable.md +9 -0
- package/dist/op/activities/grafana-apply.d.ts +11 -0
- package/dist/op/activities/grafana-apply.d.ts.map +1 -1
- package/dist/op/activities/index.d.ts +1 -1
- package/dist/op/activities/index.d.ts.map +1 -1
- package/dist/ownership.d.ts +11 -0
- package/dist/ownership.d.ts.map +1 -1
- package/dist/pin.d.ts +1 -1
- package/dist/pin.d.ts.map +1 -1
- package/dist/plugin.d.ts.map +1 -1
- package/dist/promql-check.d.ts.map +1 -1
- package/dist/query-models.d.ts +95 -0
- package/dist/query-models.d.ts.map +1 -0
- package/dist/query.d.ts +107 -10
- package/dist/query.d.ts.map +1 -1
- package/dist/rules/graf101.ts +2 -2
- package/dist/rules/graf104.ts +3 -3
- package/dist/rules/graf106.ts +3 -3
- package/dist/rules/graf110.ts +17 -0
- package/dist/rules/grafana-helpers.ts +13 -3
- package/dist/schema/azuremonitor.gen.d.ts +354 -0
- package/dist/schema/azuremonitor.gen.d.ts.map +1 -0
- package/dist/schema/bigquery.gen.d.ts +93 -0
- package/dist/schema/bigquery.gen.d.ts.map +1 -0
- package/dist/schema/cloudwatch.gen.d.ts +394 -0
- package/dist/schema/cloudwatch.gen.d.ts.map +1 -0
- package/dist/schema/elasticsearch.gen.d.ts +444 -0
- package/dist/schema/elasticsearch.gen.d.ts.map +1 -0
- package/dist/schema/googlecloudmonitoring.gen.d.ts +312 -0
- package/dist/schema/googlecloudmonitoring.gen.d.ts.map +1 -0
- package/dist/schema/grafanapyroscope.gen.d.ts +60 -0
- package/dist/schema/grafanapyroscope.gen.d.ts.map +1 -0
- package/dist/schema/index.d.ts +6 -0
- package/dist/schema/index.d.ts.map +1 -1
- package/dist/schema/table.gen.d.ts +13 -0
- package/dist/schema/table.gen.d.ts.map +1 -1
- package/dist/schema-validate.d.ts +9 -0
- package/dist/schema-validate.d.ts.map +1 -1
- package/dist/skill-defs.d.ts.map +1 -1
- package/dist/skills/chant-grafana-operations.md +108 -0
- package/dist/skills/chant-grafana.md +7 -5
- package/dist/spec/schemas.d.ts +9 -7
- package/dist/spec/schemas.d.ts.map +1 -1
- package/dist/spec/schemas.gen.d.ts +3 -0
- package/dist/spec/schemas.gen.d.ts.map +1 -0
- package/dist/validate-alerting.d.ts.map +1 -1
- package/dist/validate-output.d.ts +15 -2
- package/dist/validate-output.d.ts.map +1 -1
- package/dist/validate.d.ts.map +1 -1
- package/dist/validation.d.ts +14 -0
- package/dist/validation.d.ts.map +1 -0
- package/dist/variables.d.ts +102 -5
- package/dist/variables.d.ts.map +1 -1
- package/package.json +2 -2
- package/src/annotations.ts +84 -0
- package/src/api/apply.test.ts +19 -1
- package/src/api/apply.ts +18 -8
- package/src/api/fake-grafana.ts +6 -2
- package/src/api/folders.ts +106 -32
- package/src/build.test.ts +142 -6
- package/src/build.ts +126 -24
- package/src/catalog.ts +20 -2
- package/src/codegen/docs.ts +13 -6
- package/src/codegen/generate.ts +27 -1
- package/src/composites/__snapshots__/agent-dashboard.snapshot.test.ts.snap +1581 -0
- package/src/composites/agent-dashboard.snapshot.test.ts +47 -0
- package/src/composites/agent-dashboard.ts +316 -8
- package/src/composites/catalog.ts +13 -7
- package/src/composites/composites.test.ts +160 -2
- package/src/composites/index.ts +1 -1
- package/src/composites/queries.e2e.test.ts +128 -2
- package/src/composites/shared.ts +3 -2
- package/src/dashboard.ts +59 -14
- package/src/datasource-refs.ts +30 -6
- package/src/datasource-settings.test.ts +106 -0
- package/src/datasource-settings.ts +941 -0
- package/src/datasource.ts +71 -11
- package/src/deep-observe-hooks.ts +16 -1
- package/src/deep-observe.test.ts +47 -1
- package/src/deep-observe.ts +36 -13
- package/src/describe-resources.test.ts +16 -0
- package/src/describe-resources.ts +36 -1
- package/src/detect.ts +3 -3
- package/src/folder.ts +118 -0
- package/src/generated/lexicon-grafana.json +70 -0
- package/src/import/generated-types.e2e.test.ts +15 -3
- package/src/import/generator.ts +2 -1
- package/src/import/mappings.ts +98 -26
- package/src/import/model.ts +7 -0
- package/src/import/normalize.ts +32 -3
- package/src/import/parser.test.ts +97 -21
- package/src/import/parser.ts +169 -18
- package/src/import/roundtrip.test.ts +104 -9
- package/src/import/testdata/fixtures.ts +8 -0
- package/src/import/v2.ts +4 -3
- package/src/index.ts +123 -13
- package/src/init-templates.test.ts +74 -0
- package/src/init-templates.ts +349 -0
- package/src/lint/audit-catalog.ts +9 -1
- package/src/lint/post-synth/graf101.ts +2 -2
- package/src/lint/post-synth/graf104.ts +3 -3
- package/src/lint/post-synth/graf106.ts +3 -3
- package/src/lint/post-synth/graf110.ts +17 -0
- package/src/lint/post-synth/grafana-helpers.ts +13 -3
- package/src/lint/post-synth/index.ts +2 -0
- package/src/lint/post-synth/post-synth.test.ts +99 -2
- package/src/load-cost.test.ts +35 -0
- package/src/op/activities/grafana-apply.e2e.test.ts +14 -5
- package/src/op/activities/grafana-apply.test.ts +16 -2
- package/src/op/activities/grafana-apply.ts +29 -3
- package/src/op/activities/index.ts +1 -1
- package/src/ownership.ts +19 -0
- package/src/panels.test.ts +3 -1
- package/src/pin.ts +12 -0
- package/src/plugin.test.ts +9 -2
- package/src/plugin.ts +9 -0
- package/src/promql-check.ts +5 -1
- package/src/query-models.ts +94 -0
- package/src/query.test.ts +166 -0
- package/src/query.ts +177 -12
- package/src/schema/azuremonitor.gen.ts +381 -0
- package/src/schema/bigquery.gen.ts +110 -0
- package/src/schema/cloudwatch.gen.ts +423 -0
- package/src/schema/elasticsearch.gen.ts +508 -0
- package/src/schema/googlecloudmonitoring.gen.ts +330 -0
- package/src/schema/grafanapyroscope.gen.ts +66 -0
- package/src/schema/index.ts +6 -0
- package/src/schema/table.gen.ts +14 -0
- package/src/schema-validate.ts +58 -7
- package/src/skill-defs.ts +17 -0
- package/src/skills/chant-grafana-operations.md +108 -0
- package/src/skills/chant-grafana.md +7 -5
- package/src/spec/overlay/table.overlay.json +19 -0
- package/src/spec/schemas/azuremonitor.jsonschema.json +679 -0
- package/src/spec/schemas/bigquery.jsonschema.json +290 -0
- package/src/spec/schemas/cloudwatch.jsonschema.json +721 -0
- package/src/spec/schemas/elasticsearch.jsonschema.json +1695 -0
- package/src/spec/schemas/googlecloudmonitoring.jsonschema.json +488 -0
- package/src/spec/schemas/grafanapyroscope.jsonschema.json +93 -0
- package/src/spec/schemas.gen.ts +40 -0
- package/src/spec/schemas.ts +9 -7
- package/src/typecheck.test.ts +90 -0
- package/src/validate-alerting.ts +4 -2
- package/src/validate-output.ts +96 -4
- package/src/validate.ts +14 -0
- package/src/validation.ts +27 -0
- package/src/variables.ts +113 -6
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
*/
|
|
5
5
|
import type { DatasourceInput } from "../query.js";
|
|
6
6
|
import type { DashboardLinkInput } from "../dashboard.js";
|
|
7
|
+
import type { FolderEntity } from "../folder.js";
|
|
7
8
|
import type { ThresholdsConfig } from "../schema/dashboard.gen.js";
|
|
8
9
|
/** Dashboard settings every composite takes; each has a default derived from what it reads. */
|
|
9
10
|
export interface DashboardOptions {
|
|
@@ -14,8 +15,8 @@ export interface DashboardOptions {
|
|
|
14
15
|
uid?: string;
|
|
15
16
|
description?: string;
|
|
16
17
|
tags?: string[];
|
|
17
|
-
/** The Grafana folder to provision it into. */
|
|
18
|
-
folder?: string;
|
|
18
|
+
/** The Grafana folder to provision it into: a path, or a `Folder` to pin its uid. */
|
|
19
|
+
folder?: string | FolderEntity;
|
|
19
20
|
/** Initial time range. */
|
|
20
21
|
time?: {
|
|
21
22
|
from: string;
|
|
@@ -58,7 +59,7 @@ export declare function dashboardProps(o: DashboardOptions, defaults: {
|
|
|
58
59
|
tags: string[];
|
|
59
60
|
}): {
|
|
60
61
|
links?: DashboardLinkInput[] | undefined;
|
|
61
|
-
folder?: string | undefined;
|
|
62
|
+
folder?: string | FolderEntity | undefined;
|
|
62
63
|
graphTooltip: "sharedCrosshair";
|
|
63
64
|
refresh: string;
|
|
64
65
|
title: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"shared.d.ts","sourceRoot":"","sources":["../../src/composites/shared.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAChD,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AACvD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAEhE,+FAA+F;AAC/F,MAAM,WAAW,gBAAgB;IAC/B,yIAAyI;IACzI,UAAU,EAAE,eAAe,CAAC,YAAY,CAAC,CAAC;IAC1C,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,8EAA8E;IAC9E,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;IAChB
|
|
1
|
+
{"version":3,"file":"shared.d.ts","sourceRoot":"","sources":["../../src/composites/shared.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAChD,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AACvD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AAC9C,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAEhE,+FAA+F;AAC/F,MAAM,WAAW,gBAAgB;IAC/B,yIAAyI;IACzI,UAAU,EAAE,eAAe,CAAC,YAAY,CAAC,CAAC;IAC1C,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,8EAA8E;IAC9E,GAAG,CAAC,EAAE,MAAM,CAA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M,EAAE,MAAM,EAAE,GAAG,MAAM,CAElD;AAED,wEAAwE;AACxE,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,SAAS,GAAG,MAAM,CAE7D;AAED,0EAA0E;AAC1E,wBAAgB,UAAU,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,KAAK,CAAC,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,GAAG,gBAAgB,CAEzF;AAED,0FAA0F;AAC1F,wBAAgB,cAAc,CAAC,CAAC,EAAE,gBAAgB,EAAE,QAAQ,EAAE;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,GAAG,EAAE,MAAM,CAAC;IAAC,WAAW,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,EAAE,CAAA;CAAE;;;;;;;;;;cA9DhH,MAAM;YAAM,MAAM;;EA0ElC;AAED,uDAAuD;AACvD,wBAAgB,iBAAiB,CAAC,SAAS,EAAE,MAAM,EAAE,EAAE,EAAE,OAAO,GAAG,IAAI,CAMtE"}
|
package/dist/dashboard.d.ts
CHANGED
|
@@ -10,6 +10,8 @@ import type { Declarable } from "@intentius/chant/declarable";
|
|
|
10
10
|
import type { PanelEntity, RowEntity } from "./panels.js";
|
|
11
11
|
import type { VariableEntity } from "./variables.js";
|
|
12
12
|
import type { DashboardLink, TimePickerConfig } from "./schema/dashboard.gen.js";
|
|
13
|
+
import { type FolderEntity } from "./folder.js";
|
|
14
|
+
import type { AnnotationInput } from "./annotations.js";
|
|
13
15
|
/** A dashboard link: `title` and `type` required, the rest defaulted as Grafana's editor would. */
|
|
14
16
|
export type DashboardLinkInput = Partial<DashboardLink> & Pick<DashboardLink, "title" | "type">;
|
|
15
17
|
export interface DashboardProps {
|
|
@@ -51,20 +53,39 @@ export interface DashboardProps {
|
|
|
51
53
|
panels?: Array<PanelEntity<any, any> | RowEntity>;
|
|
52
54
|
links?: DashboardLinkInput[];
|
|
53
55
|
/**
|
|
54
|
-
*
|
|
55
|
-
*
|
|
56
|
-
*
|
|
57
|
-
*
|
|
58
|
-
* folder inside Platform; earlier versions use only the last level
|
|
59
|
-
* (GRAF109 warns). Leave it out for the General folder.
|
|
56
|
+
* Annotation queries: events drawn on the dashboard's time series panels
|
|
57
|
+
* (deploys, incidents), each from a datasource. Grafana adds its own
|
|
58
|
+
* "Annotations & Alerts" query to every dashboard that has none with
|
|
59
|
+
* `builtIn: 1`, so leave that one out unless you change it.
|
|
60
60
|
*/
|
|
61
|
-
|
|
61
|
+
annotations?: AnnotationInput[];
|
|
62
|
+
/**
|
|
63
|
+
* The Grafana folder: a path (`"Platform/Kubernetes"`) or a `Folder`,
|
|
64
|
+
* which pins the folder's uid. Written as a subdirectory of `dashboards/`,
|
|
65
|
+
* which the provider maps to folders (`foldersFromFilesStructure`); a path
|
|
66
|
+
* nests one directory in another, which Grafana 13.1 and later make a
|
|
67
|
+
* Kubernetes folder inside Platform, and earlier versions use only the
|
|
68
|
+
* last level (GRAF109 warns). The API applier creates each level with its
|
|
69
|
+
* uid. Leave it out for the General folder.
|
|
70
|
+
*/
|
|
71
|
+
folder?: string | FolderEntity;
|
|
62
72
|
}
|
|
73
|
+
/** A dashboard's props as the entity holds them: `folder` is always the path, and a `Folder` given for it is `folderEntity`. */
|
|
74
|
+
export type DashboardEntityProps = Omit<DashboardProps, "folder"> & {
|
|
75
|
+
folder?: string;
|
|
76
|
+
};
|
|
63
77
|
export interface DashboardEntity extends Declarable {
|
|
64
|
-
readonly props:
|
|
78
|
+
readonly props: DashboardEntityProps;
|
|
79
|
+
/** The `Folder` the dashboard was given, when it was given one rather than a path. */
|
|
80
|
+
readonly folderEntity?: FolderEntity;
|
|
65
81
|
}
|
|
66
82
|
export declare const DASHBOARD_TYPE = "Grafana::Dashboard";
|
|
67
|
-
/**
|
|
83
|
+
/**
|
|
84
|
+
* A Grafana dashboard. A `Folder` given as its `folder` is held as the
|
|
85
|
+
* folder's path, so everything that reads the dashboard's props (the build,
|
|
86
|
+
* the checks, observation's diff) sees one form; the `Folder` itself, for its
|
|
87
|
+
* uid, is `folderEntity`.
|
|
88
|
+
*/
|
|
68
89
|
export declare const Dashboard: new (props: DashboardProps) => DashboardEntity;
|
|
69
90
|
export declare function isDashboardEntity(value: unknown): value is DashboardEntity;
|
|
70
91
|
/** Where Grafana finds the dashboard files by default: mount `dashboards/` here. */
|
|
@@ -74,11 +95,14 @@ export interface DashboardProviderProps {
|
|
|
74
95
|
name: string;
|
|
75
96
|
orgId?: number;
|
|
76
97
|
/**
|
|
77
|
-
* Put every dashboard this provider loads in this folder
|
|
78
|
-
* `
|
|
79
|
-
*
|
|
98
|
+
* Put every dashboard this provider loads in this folder: a title, or a
|
|
99
|
+
* root-level `Folder`, whose title and uid are written as `folder` and
|
|
100
|
+
* `folderUid` (Grafana creates a provider's folder at the root, so a
|
|
101
|
+
* nested `Folder` is refused). Setting it (or `folderUid`) turns
|
|
102
|
+
* `foldersFromFilesStructure` off by default, so each dashboard's own
|
|
103
|
+
* `folder` is ignored (GRAF109 warns).
|
|
80
104
|
*/
|
|
81
|
-
folder?: string;
|
|
105
|
+
folder?: string | FolderEntity;
|
|
82
106
|
folderUid?: string;
|
|
83
107
|
/** Where the `dashboards/` output is mounted in the Grafana container. Defaults to `/var/lib/grafana/dashboards`. */
|
|
84
108
|
path?: string;
|
|
@@ -88,8 +112,12 @@ export interface DashboardProviderProps {
|
|
|
88
112
|
allowUiUpdates?: boolean;
|
|
89
113
|
updateIntervalSeconds?: number;
|
|
90
114
|
}
|
|
115
|
+
/** A provider's props as the entity holds them: a `Folder` given for `folder` is written out as `folder` and `folderUid`. */
|
|
116
|
+
export type DashboardProviderEntityProps = Omit<DashboardProviderProps, "folder"> & {
|
|
117
|
+
folder?: string;
|
|
118
|
+
};
|
|
91
119
|
export interface DashboardProviderEntity extends Declarable {
|
|
92
|
-
readonly props:
|
|
120
|
+
readonly props: DashboardProviderEntityProps;
|
|
93
121
|
}
|
|
94
122
|
export declare const DASHBOARD_PROVIDER_TYPE = "Grafana::DashboardProvider";
|
|
95
123
|
/** An entry in the dashboard provisioning file. Optional: a default one is written when none is declared. */
|
package/dist/dashboard.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dashboard.d.ts","sourceRoot":"","sources":["../src/dashboard.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAGH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,6BAA6B,CAAC;AAC9D,OAAO,KAAK,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AACvD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAClD,OAAO,KAAK,EAAE,aAAa,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;
|
|
1
|
+
{"version":3,"file":"dashboard.d.ts","sourceRoot":"","sources":["../src/dashboard.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAGH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,6BAA6B,CAAC;AAC9D,OAAO,KAAK,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AACvD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAClD,OAAO,KAAK,EAAE,aAAa,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAC9E,OAAO,EAAkB,KAAK,YAAY,EAAE,MAAM,UAAU,CAAC;AAC7D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAErD,mGAAmG;AACnG,MAAM,MAAM,kBAAkB,GAAG,OAAO,CAAC,aAAa,CAAC,GAAG,IAAI,CAAC,aAAa,EAAE,OAAO,GAAG,MAAM,CAAC,CAAC;AAEhG,MAAM,WAAW,cAAc;IAC7B,KAAK,EAAE,MAAM,CAAC;IACd;;;;OAIG;IACH,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,IAAI,CAAC,EAAE,MAAM,EAAE,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;AAInD;;;;;GAKG;AACH,eAAO,MAAM,SAAS,EAQN,KAAK,KAAK,EAAE,cAAc,KAAK,eAAe,CAAC;AAG/D,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,eAAe,CAO1E;AAED,oFAAoF;AACpF,eAAO,MAAM,uBAAuB,gCAAgC,CAAC;AAErE,MAAM,WAAW,sBAAsB;IACrC,sDAAsD;IACtD,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;;;;;;OAOG;IACH,MAAM,CAAC,EAAE,MAAM,GAAG,YAAY,CAAC;IAC/B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,qHAAqH;IACrH,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,+GAA+G;IAC/G,yBAAyB,CAAC,EAAE,OAAO,CAAC;IACpC,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,qBAAqB,CAAC,EAAE,MAAM,CAAC;CAChC;AAED,6HAA6H;AAC7H,MAAM,MAAM,4BAA4B,GAAG,IAAI,CAAC,sBAAsB,EAAE,QAAQ,CAAC,GAAG;IAAE,MAAM,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC;AAExG,MAAM,WAAW,uBAAwB,SAAQ,UAAU;IACzD,QAAQ,CAAC,KAAK,EAAE,4BAA4B,CAAC;CAC9C;AAED,eAAO,MAAM,uBAAuB,+BAA+B,CAAC;AAOpE,6GAA6G;AAC7G,eAAO,MAAM,iBAAiB,EAed,KAAK,KAAK,EAAE,sBAAsB,KAAK,uBAAuB,CAAC;AAG/E,wBAAgB,yBAAyB,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,uBAAuB,CAO1F"}
|
|
@@ -55,14 +55,15 @@ export type ResolvedDatasource = {
|
|
|
55
55
|
};
|
|
56
56
|
/** One place a dashboard names, or inherits, a datasource. */
|
|
57
57
|
export interface DatasourceUse {
|
|
58
|
-
/** A panel's own `datasource`, one of its queries (`targets`),
|
|
59
|
-
kind: "panel" | "query" | "variable";
|
|
58
|
+
/** A panel's own `datasource`, one of its queries (`targets`), a query, ad hoc or group by variable, or an annotation query. */
|
|
59
|
+
kind: "panel" | "query" | "variable" | "annotation";
|
|
60
60
|
/** A human description, e.g. `panel "Latency" (id 3) query B`. */
|
|
61
61
|
where: string;
|
|
62
62
|
panel?: Json;
|
|
63
63
|
target?: Json;
|
|
64
64
|
variable?: Json;
|
|
65
|
-
|
|
65
|
+
annotation?: Json;
|
|
66
|
+
/** The ref written on this panel, query, variable or annotation; unset when a query inherits its panel's. */
|
|
66
67
|
ref?: DatasourceRefJson;
|
|
67
68
|
/** Where the request goes: the query's own ref, else its panel's. */
|
|
68
69
|
resolved: ResolvedDatasource;
|
|
@@ -85,10 +86,13 @@ export declare function variableReferences(text: string): string[];
|
|
|
85
86
|
export declare function isPseudoRef(ref: DatasourceRefJson): boolean;
|
|
86
87
|
/** Where one reference leads, given the dashboard's datasource variables and the known datasources. */
|
|
87
88
|
export declare function resolveDatasourceRef(ref: DatasourceRefJson | undefined, dsVariables: ReadonlyMap<string, Json>, known: ReadonlyMap<string, KnownDatasource>): ResolvedDatasource;
|
|
89
|
+
/** A dashboard's `annotations.list`. */
|
|
90
|
+
export declare function annotationsOf(dashboard: Json): Json[];
|
|
88
91
|
/**
|
|
89
92
|
* Every place a dashboard names or inherits a datasource: each panel's own
|
|
90
|
-
* ref, each query (with its own ref, or its panel's when it has none),
|
|
91
|
-
*
|
|
93
|
+
* ref, each query (with its own ref, or its panel's when it has none), each
|
|
94
|
+
* query, ad hoc and group by variable, and each annotation query with a datasource. Rows are left
|
|
95
|
+
* out; their panels carry the ref.
|
|
92
96
|
*/
|
|
93
97
|
export declare function datasourceUses(dashboard: Json, known: ReadonlyMap<string, KnownDatasource>): DatasourceUse[];
|
|
94
98
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"datasource-refs.d.ts","sourceRoot":"","sources":["../src/datasource-refs.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,KAAK,EAAE,wBAAwB,EAAE,qBAAqB,EAAE,MAAM,SAAS,CAAC;AAG/E,KAAK,IAAI,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;AAEpC,yEAAyE;AACzE,MAAM,WAAW,iBAAiB;IAChC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,GAAG,CAAC,EAAE,MAAM,CAAC;CACd;AAED,oFAAoF;AACpF,MAAM,WAAW,eAAe;IAC9B,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,uEAAuE;IACvE,QAAQ,EAAE,OAAO,CAAC;CACnB;AAED;;;;;;;;GAQG;AACH,MAAM,MAAM,kBAAkB,GAC1B;IAAE,IAAI,EAAE,UAAU,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,UAAU,EAAE,eAAe,CAAA;CAAE,GAC/D;IAAE,IAAI,EAAE,UAAU,CAAC;IAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,OAAO,CAAA;CAAE,GACxE;IAAE,IAAI,EAAE,SAAS,CAAC;IAAC,IAAI,CAAC,EAAE,MAAM,CAAA;CAAE,GAClC;IAAE,IAAI,EAAE,YAAY,CAAC;IAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IAAC,GAAG,EAAE,MAAM,CAAA;CAAE,GAClD;IAAE,IAAI,EAAE,SAAS,CAAC;IAAC,IAAI,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC;AAEvC,8DAA8D;AAC9D,MAAM,WAAW,aAAa;IAC5B,
|
|
1
|
+
{"version":3,"file":"datasource-refs.d.ts","sourceRoot":"","sources":["../src/datasource-refs.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH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