@intentius/chant-lexicon-grafana 0.96.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.
Files changed (259) hide show
  1. package/README.md +50 -0
  2. package/dist/build.d.ts +116 -0
  3. package/dist/build.d.ts.map +1 -0
  4. package/dist/catalog.d.ts +26 -0
  5. package/dist/catalog.d.ts.map +1 -0
  6. package/dist/codegen/docs-cli.d.ts +3 -0
  7. package/dist/codegen/docs-cli.d.ts.map +1 -0
  8. package/dist/codegen/docs.d.ts +8 -0
  9. package/dist/codegen/docs.d.ts.map +1 -0
  10. package/dist/codegen/generate-cli.d.ts +3 -0
  11. package/dist/codegen/generate-cli.d.ts.map +1 -0
  12. package/dist/codegen/generate.d.ts +21 -0
  13. package/dist/codegen/generate.d.ts.map +1 -0
  14. package/dist/codegen/package.d.ts +7 -0
  15. package/dist/codegen/package.d.ts.map +1 -0
  16. package/dist/codegen/schema-types.d.ts +41 -0
  17. package/dist/codegen/schema-types.d.ts.map +1 -0
  18. package/dist/composites/agent-dashboard.d.ts +70 -0
  19. package/dist/composites/agent-dashboard.d.ts.map +1 -0
  20. package/dist/composites/catalog.d.ts +3 -0
  21. package/dist/composites/catalog.d.ts.map +1 -0
  22. package/dist/composites/index.d.ts +12 -0
  23. package/dist/composites/index.d.ts.map +1 -0
  24. package/dist/composites/red-dashboard.d.ts +58 -0
  25. package/dist/composites/red-dashboard.d.ts.map +1 -0
  26. package/dist/composites/shared.d.ts +68 -0
  27. package/dist/composites/shared.d.ts.map +1 -0
  28. package/dist/composites/slo-dashboard.d.ts +62 -0
  29. package/dist/composites/slo-dashboard.d.ts.map +1 -0
  30. package/dist/dashboard.d.ts +84 -0
  31. package/dist/dashboard.d.ts.map +1 -0
  32. package/dist/datasource.d.ts +67 -0
  33. package/dist/datasource.d.ts.map +1 -0
  34. package/dist/detect.d.ts +20 -0
  35. package/dist/detect.d.ts.map +1 -0
  36. package/dist/index.d.ts +17 -0
  37. package/dist/index.d.ts.map +1 -0
  38. package/dist/integrity.json +22 -0
  39. package/dist/lint/audit-catalog.d.ts +13 -0
  40. package/dist/lint/audit-catalog.d.ts.map +1 -0
  41. package/dist/lint/post-synth/graf101.d.ts +8 -0
  42. package/dist/lint/post-synth/graf101.d.ts.map +1 -0
  43. package/dist/lint/post-synth/graf102.d.ts +8 -0
  44. package/dist/lint/post-synth/graf102.d.ts.map +1 -0
  45. package/dist/lint/post-synth/graf103.d.ts +8 -0
  46. package/dist/lint/post-synth/graf103.d.ts.map +1 -0
  47. package/dist/lint/post-synth/graf104.d.ts +8 -0
  48. package/dist/lint/post-synth/graf104.d.ts.map +1 -0
  49. package/dist/lint/post-synth/graf105.d.ts +8 -0
  50. package/dist/lint/post-synth/graf105.d.ts.map +1 -0
  51. package/dist/lint/post-synth/graf106.d.ts +8 -0
  52. package/dist/lint/post-synth/graf106.d.ts.map +1 -0
  53. package/dist/lint/post-synth/graf107.d.ts +8 -0
  54. package/dist/lint/post-synth/graf107.d.ts.map +1 -0
  55. package/dist/lint/post-synth/grafana-helpers.d.ts +16 -0
  56. package/dist/lint/post-synth/grafana-helpers.d.ts.map +1 -0
  57. package/dist/lint/post-synth/index.d.ts +3 -0
  58. package/dist/lint/post-synth/index.d.ts.map +1 -0
  59. package/dist/lint/rules/grafana-ast.d.ts +21 -0
  60. package/dist/lint/rules/grafana-ast.d.ts.map +1 -0
  61. package/dist/lint/rules/index.d.ts +6 -0
  62. package/dist/lint/rules/index.d.ts.map +1 -0
  63. package/dist/lint/rules/literal-secret.d.ts +12 -0
  64. package/dist/lint/rules/literal-secret.d.ts.map +1 -0
  65. package/dist/lint/rules/uid-syntax.d.ts +12 -0
  66. package/dist/lint/rules/uid-syntax.d.ts.map +1 -0
  67. package/dist/lsp/completions.d.ts +4 -0
  68. package/dist/lsp/completions.d.ts.map +1 -0
  69. package/dist/lsp/hover.d.ts +4 -0
  70. package/dist/lsp/hover.d.ts.map +1 -0
  71. package/dist/manifest.json +8 -0
  72. package/dist/meta.json +107 -0
  73. package/dist/okf/index.md +39 -0
  74. package/dist/okf/rules/GRAF001.md +16 -0
  75. package/dist/okf/rules/GRAF002.md +15 -0
  76. package/dist/okf/rules/GRAF101.md +15 -0
  77. package/dist/okf/rules/GRAF102.md +15 -0
  78. package/dist/okf/rules/GRAF103.md +11 -0
  79. package/dist/okf/rules/GRAF104.md +15 -0
  80. package/dist/okf/rules/GRAF105.md +11 -0
  81. package/dist/okf/rules/GRAF106.md +11 -0
  82. package/dist/okf/rules/GRAF107.md +11 -0
  83. package/dist/okf/types/ConstantVariable.md +9 -0
  84. package/dist/okf/types/CustomVariable.md +9 -0
  85. package/dist/okf/types/Dashboard.md +14 -0
  86. package/dist/okf/types/DashboardProvider.md +9 -0
  87. package/dist/okf/types/Datasource.md +16 -0
  88. package/dist/okf/types/DatasourceVariable.md +9 -0
  89. package/dist/okf/types/GaugePanel.md +9 -0
  90. package/dist/okf/types/HeatmapPanel.md +9 -0
  91. package/dist/okf/types/IntervalVariable.md +9 -0
  92. package/dist/okf/types/LogsPanel.md +9 -0
  93. package/dist/okf/types/LokiQuery.md +9 -0
  94. package/dist/okf/types/PromQuery.md +9 -0
  95. package/dist/okf/types/QueryVariable.md +9 -0
  96. package/dist/okf/types/Row.md +9 -0
  97. package/dist/okf/types/StatPanel.md +9 -0
  98. package/dist/okf/types/TablePanel.md +9 -0
  99. package/dist/okf/types/TempoQuery.md +9 -0
  100. package/dist/okf/types/TextPanel.md +9 -0
  101. package/dist/okf/types/TextboxVariable.md +9 -0
  102. package/dist/okf/types/TimeSeriesPanel.md +9 -0
  103. package/dist/okf/types/TracesPanel.md +9 -0
  104. package/dist/package-cli.d.ts +3 -0
  105. package/dist/package-cli.d.ts.map +1 -0
  106. package/dist/panels.d.ts +138 -0
  107. package/dist/panels.d.ts.map +1 -0
  108. package/dist/pin.d.ts +32 -0
  109. package/dist/pin.d.ts.map +1 -0
  110. package/dist/plugin.d.ts +12 -0
  111. package/dist/plugin.d.ts.map +1 -0
  112. package/dist/query.d.ts +81 -0
  113. package/dist/query.d.ts.map +1 -0
  114. package/dist/rules/graf101.ts +17 -0
  115. package/dist/rules/graf102.ts +17 -0
  116. package/dist/rules/graf103.ts +17 -0
  117. package/dist/rules/graf104.ts +17 -0
  118. package/dist/rules/graf105.ts +17 -0
  119. package/dist/rules/graf106.ts +17 -0
  120. package/dist/rules/graf107.ts +17 -0
  121. package/dist/rules/grafana-ast.ts +70 -0
  122. package/dist/rules/grafana-helpers.ts +68 -0
  123. package/dist/rules/literal-secret.ts +48 -0
  124. package/dist/rules/uid-syntax.ts +56 -0
  125. package/dist/schema/dashboard.gen.d.ts +1231 -0
  126. package/dist/schema/dashboard.gen.d.ts.map +1 -0
  127. package/dist/schema/gauge.gen.d.ts +57 -0
  128. package/dist/schema/gauge.gen.d.ts.map +1 -0
  129. package/dist/schema/heatmap.gen.d.ts +295 -0
  130. package/dist/schema/heatmap.gen.d.ts.map +1 -0
  131. package/dist/schema/index.d.ts +18 -0
  132. package/dist/schema/index.d.ts.map +1 -0
  133. package/dist/schema/logs.gen.d.ts +29 -0
  134. package/dist/schema/logs.gen.d.ts.map +1 -0
  135. package/dist/schema/loki.gen.d.ts +69 -0
  136. package/dist/schema/loki.gen.d.ts.map +1 -0
  137. package/dist/schema/prometheus.gen.d.ts +169 -0
  138. package/dist/schema/prometheus.gen.d.ts.map +1 -0
  139. package/dist/schema/stat.gen.d.ts +75 -0
  140. package/dist/schema/stat.gen.d.ts.map +1 -0
  141. package/dist/schema/table.gen.d.ts +295 -0
  142. package/dist/schema/table.gen.d.ts.map +1 -0
  143. package/dist/schema/tempo.gen.d.ts +136 -0
  144. package/dist/schema/tempo.gen.d.ts.map +1 -0
  145. package/dist/schema/text.gen.d.ts +16 -0
  146. package/dist/schema/text.gen.d.ts.map +1 -0
  147. package/dist/schema/timeseries.gen.d.ts +179 -0
  148. package/dist/schema/timeseries.gen.d.ts.map +1 -0
  149. package/dist/schema-validate.d.ts +20 -0
  150. package/dist/schema-validate.d.ts.map +1 -0
  151. package/dist/serializer.d.ts +22 -0
  152. package/dist/serializer.d.ts.map +1 -0
  153. package/dist/skill-defs.d.ts +3 -0
  154. package/dist/skill-defs.d.ts.map +1 -0
  155. package/dist/skills/chant-grafana-provisioning.md +42 -0
  156. package/dist/skills/chant-grafana.md +93 -0
  157. package/dist/spec/fetch-cli.d.ts +3 -0
  158. package/dist/spec/fetch-cli.d.ts.map +1 -0
  159. package/dist/spec/schemas.d.ts +25 -0
  160. package/dist/spec/schemas.d.ts.map +1 -0
  161. package/dist/types/index.d.ts +3 -0
  162. package/dist/util.d.ts +17 -0
  163. package/dist/util.d.ts.map +1 -0
  164. package/dist/validate-cli.d.ts +3 -0
  165. package/dist/validate-cli.d.ts.map +1 -0
  166. package/dist/validate-output.d.ts +42 -0
  167. package/dist/validate-output.d.ts.map +1 -0
  168. package/dist/validate.d.ts +12 -0
  169. package/dist/validate.d.ts.map +1 -0
  170. package/dist/variables.d.ts +100 -0
  171. package/dist/variables.d.ts.map +1 -0
  172. package/package.json +79 -0
  173. package/src/build.test.ts +210 -0
  174. package/src/build.ts +573 -0
  175. package/src/catalog.ts +116 -0
  176. package/src/codegen/docs-cli.ts +4 -0
  177. package/src/codegen/docs.ts +97 -0
  178. package/src/codegen/generate-cli.ts +8 -0
  179. package/src/codegen/generate.ts +83 -0
  180. package/src/codegen/package.ts +41 -0
  181. package/src/codegen/schema-types.ts +173 -0
  182. package/src/composites/agent-dashboard.ts +235 -0
  183. package/src/composites/catalog.test.ts +37 -0
  184. package/src/composites/catalog.ts +223 -0
  185. package/src/composites/composites.test.ts +314 -0
  186. package/src/composites/index.ts +12 -0
  187. package/src/composites/red-dashboard.ts +159 -0
  188. package/src/composites/shared.ts +94 -0
  189. package/src/composites/slo-dashboard.ts +177 -0
  190. package/src/dashboard.ts +123 -0
  191. package/src/datasource.ts +93 -0
  192. package/src/detect.ts +30 -0
  193. package/src/generated/lexicon-grafana.json +107 -0
  194. package/src/import.e2e.test.ts +147 -0
  195. package/src/import.test.ts +45 -0
  196. package/src/index.ts +178 -0
  197. package/src/lint/audit-catalog.ts +87 -0
  198. package/src/lint/post-synth/graf101.ts +17 -0
  199. package/src/lint/post-synth/graf102.ts +17 -0
  200. package/src/lint/post-synth/graf103.ts +17 -0
  201. package/src/lint/post-synth/graf104.ts +17 -0
  202. package/src/lint/post-synth/graf105.ts +17 -0
  203. package/src/lint/post-synth/graf106.ts +17 -0
  204. package/src/lint/post-synth/graf107.ts +17 -0
  205. package/src/lint/post-synth/grafana-helpers.ts +68 -0
  206. package/src/lint/post-synth/index.ts +19 -0
  207. package/src/lint/post-synth/post-synth.test.ts +231 -0
  208. package/src/lint/rules/grafana-ast.ts +70 -0
  209. package/src/lint/rules/index.ts +9 -0
  210. package/src/lint/rules/literal-secret.ts +48 -0
  211. package/src/lint/rules/rules.test.ts +70 -0
  212. package/src/lint/rules/uid-syntax.ts +56 -0
  213. package/src/lsp/completions.test.ts +31 -0
  214. package/src/lsp/completions.ts +15 -0
  215. package/src/lsp/hover.test.ts +25 -0
  216. package/src/lsp/hover.ts +28 -0
  217. package/src/package-cli.ts +17 -0
  218. package/src/panels.ts +275 -0
  219. package/src/pin.ts +68 -0
  220. package/src/plugin.test.ts +50 -0
  221. package/src/plugin.ts +116 -0
  222. package/src/query.ts +160 -0
  223. package/src/schema/dashboard.gen.ts +1289 -0
  224. package/src/schema/gauge.gen.ts +64 -0
  225. package/src/schema/heatmap.gen.ts +321 -0
  226. package/src/schema/index.ts +17 -0
  227. package/src/schema/logs.gen.ts +34 -0
  228. package/src/schema/loki.gen.ts +77 -0
  229. package/src/schema/prometheus.gen.ts +181 -0
  230. package/src/schema/stat.gen.ts +86 -0
  231. package/src/schema/table.gen.ts +334 -0
  232. package/src/schema/tempo.gen.ts +146 -0
  233. package/src/schema/text.gen.ts +22 -0
  234. package/src/schema/timeseries.gen.ts +208 -0
  235. package/src/schema-validate.ts +143 -0
  236. package/src/schema.test.ts +76 -0
  237. package/src/serializer.test.ts +170 -0
  238. package/src/serializer.ts +37 -0
  239. package/src/skill-defs.ts +31 -0
  240. package/src/skills/chant-grafana-provisioning.md +42 -0
  241. package/src/skills/chant-grafana.md +93 -0
  242. package/src/spec/fetch-cli.ts +27 -0
  243. package/src/spec/schemas/dashboard.jsonschema.json +1901 -0
  244. package/src/spec/schemas/gauge.jsonschema.json +114 -0
  245. package/src/spec/schemas/heatmap.jsonschema.json +480 -0
  246. package/src/spec/schemas/logs.jsonschema.json +94 -0
  247. package/src/spec/schemas/loki.jsonschema.json +118 -0
  248. package/src/spec/schemas/prometheus.jsonschema.json +276 -0
  249. package/src/spec/schemas/stat.jsonschema.json +163 -0
  250. package/src/spec/schemas/table.jsonschema.json +751 -0
  251. package/src/spec/schemas/tempo.jsonschema.json +225 -0
  252. package/src/spec/schemas/text.jsonschema.json +72 -0
  253. package/src/spec/schemas/timeseries.jsonschema.json +471 -0
  254. package/src/spec/schemas.ts +56 -0
  255. package/src/util.ts +43 -0
  256. package/src/validate-cli.ts +7 -0
  257. package/src/validate-output.ts +380 -0
  258. package/src/validate.ts +108 -0
  259. package/src/variables.ts +161 -0
@@ -0,0 +1,39 @@
1
+ ---
2
+ okf_version: '0.2'
3
+ ---
4
+
5
+ # Resource types
6
+
7
+ * [ConstantVariable](/types/ConstantVariable.md) - Grafana::Variable::constant
8
+ * [CustomVariable](/types/CustomVariable.md) - Grafana::Variable::custom
9
+ * [Dashboard](/types/Dashboard.md) - Grafana::Dashboard
10
+ * [DashboardProvider](/types/DashboardProvider.md) - Grafana::DashboardProvider
11
+ * [Datasource](/types/Datasource.md) - Grafana::Datasource
12
+ * [DatasourceVariable](/types/DatasourceVariable.md) - Grafana::Variable::datasource
13
+ * [GaugePanel](/types/GaugePanel.md) - Grafana::Panel::gauge
14
+ * [HeatmapPanel](/types/HeatmapPanel.md) - Grafana::Panel::heatmap
15
+ * [IntervalVariable](/types/IntervalVariable.md) - Grafana::Variable::interval
16
+ * [LogsPanel](/types/LogsPanel.md) - Grafana::Panel::logs
17
+ * [LokiQuery](/types/LokiQuery.md) - Grafana::Query::loki
18
+ * [PromQuery](/types/PromQuery.md) - Grafana::Query::prometheus
19
+ * [QueryVariable](/types/QueryVariable.md) - Grafana::Variable::query
20
+ * [Row](/types/Row.md) - Grafana::Row
21
+ * [StatPanel](/types/StatPanel.md) - Grafana::Panel::stat
22
+ * [TablePanel](/types/TablePanel.md) - Grafana::Panel::table
23
+ * [TempoQuery](/types/TempoQuery.md) - Grafana::Query::tempo
24
+ * [TextboxVariable](/types/TextboxVariable.md) - Grafana::Variable::textbox
25
+ * [TextPanel](/types/TextPanel.md) - Grafana::Panel::text
26
+ * [TimeSeriesPanel](/types/TimeSeriesPanel.md) - Grafana::Panel::timeseries
27
+ * [TracesPanel](/types/TracesPanel.md) - Grafana::Panel::traces
28
+
29
+ # Rules
30
+
31
+ * [GRAF001](/rules/GRAF001.md) - a uid Grafana rejects, or a variable name queries cannot reference.
32
+ * [GRAF002](/rules/GRAF002.md) - a datasource secret written as a literal.
33
+ * [GRAF101](/rules/GRAF101.md) - A panel, query or variable uses a datasource no Datasource in the build declares
34
+ * [GRAF102](/rules/GRAF102.md) - A query is sent to a datasource of another plugin type
35
+ * [GRAF103](/rules/GRAF103.md) - A query, title, datasource or repeat uses a variable the dashboard does not declare
36
+ * [GRAF104](/rules/GRAF104.md) - Two dashboards, datasources, panels, variables or queries share an id
37
+ * [GRAF105](/rules/GRAF105.md) - A panel does not fit the 24-column grid, or overlaps another panel
38
+ * [GRAF106](/rules/GRAF106.md) - A dashboard or datasource uid Grafana rejects, or a dashboard with no title
39
+ * [GRAF107](/rules/GRAF107.md) - A dashboard does not match the pinned Grafana schema
@@ -0,0 +1,16 @@
1
+ ---
2
+ type: lint-rule
3
+ title: GRAF001
4
+ description: a uid Grafana rejects, or a variable name queries cannot reference.
5
+ id: GRAF001
6
+ severity: error
7
+ category: correctness
8
+ lexicon: grafana
9
+ docs: https://intentius.io/chant/lexicons/grafana/rules/
10
+ ---
11
+ a uid Grafana rejects, or a variable name queries cannot reference.
12
+
13
+ ## Applies to
14
+
15
+ - [Dashboard](/types/Dashboard.md)
16
+ - [Datasource](/types/Datasource.md)
@@ -0,0 +1,15 @@
1
+ ---
2
+ type: lint-rule
3
+ title: GRAF002
4
+ description: a datasource secret written as a literal.
5
+ id: GRAF002
6
+ severity: error
7
+ category: security
8
+ lexicon: grafana
9
+ docs: https://intentius.io/chant/lexicons/grafana/rules/
10
+ ---
11
+ a datasource secret written as a literal.
12
+
13
+ ## Applies to
14
+
15
+ - [Datasource](/types/Datasource.md)
@@ -0,0 +1,15 @@
1
+ ---
2
+ type: post-synth-check
3
+ title: GRAF101
4
+ description: A panel, query or variable uses a datasource no Datasource in the build declares
5
+ id: GRAF101
6
+ severity: error
7
+ category: post-synth
8
+ lexicon: grafana
9
+ docs: https://intentius.io/chant/lexicons/grafana/rules/
10
+ ---
11
+ A panel, query or variable uses a datasource no Datasource in the build declares
12
+
13
+ ## Applies to
14
+
15
+ - [Datasource](/types/Datasource.md)
@@ -0,0 +1,15 @@
1
+ ---
2
+ type: post-synth-check
3
+ title: GRAF102
4
+ description: A query is sent to a datasource of another plugin type
5
+ id: GRAF102
6
+ severity: error
7
+ category: post-synth
8
+ lexicon: grafana
9
+ docs: https://intentius.io/chant/lexicons/grafana/rules/
10
+ ---
11
+ A query is sent to a datasource of another plugin type
12
+
13
+ ## Applies to
14
+
15
+ - [Datasource](/types/Datasource.md)
@@ -0,0 +1,11 @@
1
+ ---
2
+ type: post-synth-check
3
+ title: GRAF103
4
+ description: A query, title, datasource or repeat uses a variable the dashboard does not declare
5
+ id: GRAF103
6
+ severity: error
7
+ category: post-synth
8
+ lexicon: grafana
9
+ docs: https://intentius.io/chant/lexicons/grafana/rules/
10
+ ---
11
+ A query, title, datasource or repeat uses a variable the dashboard does not declare
@@ -0,0 +1,15 @@
1
+ ---
2
+ type: post-synth-check
3
+ title: GRAF104
4
+ description: Two dashboards, datasources, panels, variables or queries share an id
5
+ id: GRAF104
6
+ severity: error
7
+ category: post-synth
8
+ lexicon: grafana
9
+ docs: https://intentius.io/chant/lexicons/grafana/rules/
10
+ ---
11
+ Two dashboards, datasources, panels, variables or queries share an id
12
+
13
+ ## Applies to
14
+
15
+ - [Dashboard](/types/Dashboard.md)
@@ -0,0 +1,11 @@
1
+ ---
2
+ type: post-synth-check
3
+ title: GRAF105
4
+ description: A panel does not fit the 24-column grid, or overlaps another panel
5
+ id: GRAF105
6
+ severity: error
7
+ category: post-synth
8
+ lexicon: grafana
9
+ docs: https://intentius.io/chant/lexicons/grafana/rules/
10
+ ---
11
+ A panel does not fit the 24-column grid, or overlaps another panel
@@ -0,0 +1,11 @@
1
+ ---
2
+ type: post-synth-check
3
+ title: GRAF106
4
+ description: A dashboard or datasource uid Grafana rejects, or a dashboard with no title
5
+ id: GRAF106
6
+ severity: error
7
+ category: post-synth
8
+ lexicon: grafana
9
+ docs: https://intentius.io/chant/lexicons/grafana/rules/
10
+ ---
11
+ A dashboard or datasource uid Grafana rejects, or a dashboard with no title
@@ -0,0 +1,11 @@
1
+ ---
2
+ type: post-synth-check
3
+ title: GRAF107
4
+ description: A dashboard does not match the pinned Grafana schema
5
+ id: GRAF107
6
+ severity: error
7
+ category: post-synth
8
+ lexicon: grafana
9
+ docs: https://intentius.io/chant/lexicons/grafana/rules/
10
+ ---
11
+ A dashboard does not match the pinned Grafana schema
@@ -0,0 +1,9 @@
1
+ ---
2
+ type: resource-type
3
+ title: ConstantVariable
4
+ description: grafana resource type Grafana::Variable::constant
5
+ name: ConstantVariable
6
+ lexicon: grafana
7
+ resource_type: Grafana::Variable::constant
8
+ ---
9
+ `Grafana::Variable::constant`, a resource type of the grafana lexicon.
@@ -0,0 +1,9 @@
1
+ ---
2
+ type: resource-type
3
+ title: CustomVariable
4
+ description: grafana resource type Grafana::Variable::custom
5
+ name: CustomVariable
6
+ lexicon: grafana
7
+ resource_type: Grafana::Variable::custom
8
+ ---
9
+ `Grafana::Variable::custom`, a resource type of the grafana lexicon.
@@ -0,0 +1,14 @@
1
+ ---
2
+ type: resource-type
3
+ title: Dashboard
4
+ description: grafana resource type Grafana::Dashboard
5
+ name: Dashboard
6
+ lexicon: grafana
7
+ resource_type: Grafana::Dashboard
8
+ ---
9
+ `Grafana::Dashboard`, a resource type of the grafana lexicon.
10
+
11
+ ## Governed by
12
+
13
+ - [GRAF001](/rules/GRAF001.md): a uid Grafana rejects, or a variable name queries cannot reference.
14
+ - [GRAF104](/rules/GRAF104.md): Two dashboards, datasources, panels, variables or queries share an id
@@ -0,0 +1,9 @@
1
+ ---
2
+ type: resource-type
3
+ title: DashboardProvider
4
+ description: grafana resource type Grafana::DashboardProvider
5
+ name: DashboardProvider
6
+ lexicon: grafana
7
+ resource_type: Grafana::DashboardProvider
8
+ ---
9
+ `Grafana::DashboardProvider`, a resource type of the grafana lexicon.
@@ -0,0 +1,16 @@
1
+ ---
2
+ type: resource-type
3
+ title: Datasource
4
+ description: grafana resource type Grafana::Datasource
5
+ name: Datasource
6
+ lexicon: grafana
7
+ resource_type: Grafana::Datasource
8
+ ---
9
+ `Grafana::Datasource`, a resource type of the grafana lexicon.
10
+
11
+ ## Governed by
12
+
13
+ - [GRAF001](/rules/GRAF001.md): a uid Grafana rejects, or a variable name queries cannot reference.
14
+ - [GRAF002](/rules/GRAF002.md): a datasource secret written as a literal.
15
+ - [GRAF101](/rules/GRAF101.md): A panel, query or variable uses a datasource no Datasource in the build declares
16
+ - [GRAF102](/rules/GRAF102.md): A query is sent to a datasource of another plugin type
@@ -0,0 +1,9 @@
1
+ ---
2
+ type: resource-type
3
+ title: DatasourceVariable
4
+ description: grafana resource type Grafana::Variable::datasource
5
+ name: DatasourceVariable
6
+ lexicon: grafana
7
+ resource_type: Grafana::Variable::datasource
8
+ ---
9
+ `Grafana::Variable::datasource`, a resource type of the grafana lexicon.
@@ -0,0 +1,9 @@
1
+ ---
2
+ type: resource-type
3
+ title: GaugePanel
4
+ description: grafana resource type Grafana::Panel::gauge
5
+ name: GaugePanel
6
+ lexicon: grafana
7
+ resource_type: Grafana::Panel::gauge
8
+ ---
9
+ `Grafana::Panel::gauge`, a resource type of the grafana lexicon.
@@ -0,0 +1,9 @@
1
+ ---
2
+ type: resource-type
3
+ title: HeatmapPanel
4
+ description: grafana resource type Grafana::Panel::heatmap
5
+ name: HeatmapPanel
6
+ lexicon: grafana
7
+ resource_type: Grafana::Panel::heatmap
8
+ ---
9
+ `Grafana::Panel::heatmap`, a resource type of the grafana lexicon.
@@ -0,0 +1,9 @@
1
+ ---
2
+ type: resource-type
3
+ title: IntervalVariable
4
+ description: grafana resource type Grafana::Variable::interval
5
+ name: IntervalVariable
6
+ lexicon: grafana
7
+ resource_type: Grafana::Variable::interval
8
+ ---
9
+ `Grafana::Variable::interval`, a resource type of the grafana lexicon.
@@ -0,0 +1,9 @@
1
+ ---
2
+ type: resource-type
3
+ title: LogsPanel
4
+ description: grafana resource type Grafana::Panel::logs
5
+ name: LogsPanel
6
+ lexicon: grafana
7
+ resource_type: Grafana::Panel::logs
8
+ ---
9
+ `Grafana::Panel::logs`, a resource type of the grafana lexicon.
@@ -0,0 +1,9 @@
1
+ ---
2
+ type: resource-type
3
+ title: LokiQuery
4
+ description: grafana resource type Grafana::Query::loki
5
+ name: LokiQuery
6
+ lexicon: grafana
7
+ resource_type: Grafana::Query::loki
8
+ ---
9
+ `Grafana::Query::loki`, a resource type of the grafana lexicon.
@@ -0,0 +1,9 @@
1
+ ---
2
+ type: resource-type
3
+ title: PromQuery
4
+ description: grafana resource type Grafana::Query::prometheus
5
+ name: PromQuery
6
+ lexicon: grafana
7
+ resource_type: Grafana::Query::prometheus
8
+ ---
9
+ `Grafana::Query::prometheus`, a resource type of the grafana lexicon.
@@ -0,0 +1,9 @@
1
+ ---
2
+ type: resource-type
3
+ title: QueryVariable
4
+ description: grafana resource type Grafana::Variable::query
5
+ name: QueryVariable
6
+ lexicon: grafana
7
+ resource_type: Grafana::Variable::query
8
+ ---
9
+ `Grafana::Variable::query`, a resource type of the grafana lexicon.
@@ -0,0 +1,9 @@
1
+ ---
2
+ type: resource-type
3
+ title: Row
4
+ description: grafana resource type Grafana::Row
5
+ name: Row
6
+ lexicon: grafana
7
+ resource_type: Grafana::Row
8
+ ---
9
+ `Grafana::Row`, a resource type of the grafana lexicon.
@@ -0,0 +1,9 @@
1
+ ---
2
+ type: resource-type
3
+ title: StatPanel
4
+ description: grafana resource type Grafana::Panel::stat
5
+ name: StatPanel
6
+ lexicon: grafana
7
+ resource_type: Grafana::Panel::stat
8
+ ---
9
+ `Grafana::Panel::stat`, a resource type of the grafana lexicon.
@@ -0,0 +1,9 @@
1
+ ---
2
+ type: resource-type
3
+ title: TablePanel
4
+ description: grafana resource type Grafana::Panel::table
5
+ name: TablePanel
6
+ lexicon: grafana
7
+ resource_type: Grafana::Panel::table
8
+ ---
9
+ `Grafana::Panel::table`, a resource type of the grafana lexicon.
@@ -0,0 +1,9 @@
1
+ ---
2
+ type: resource-type
3
+ title: TempoQuery
4
+ description: grafana resource type Grafana::Query::tempo
5
+ name: TempoQuery
6
+ lexicon: grafana
7
+ resource_type: Grafana::Query::tempo
8
+ ---
9
+ `Grafana::Query::tempo`, a resource type of the grafana lexicon.
@@ -0,0 +1,9 @@
1
+ ---
2
+ type: resource-type
3
+ title: TextPanel
4
+ description: grafana resource type Grafana::Panel::text
5
+ name: TextPanel
6
+ lexicon: grafana
7
+ resource_type: Grafana::Panel::text
8
+ ---
9
+ `Grafana::Panel::text`, a resource type of the grafana lexicon.
@@ -0,0 +1,9 @@
1
+ ---
2
+ type: resource-type
3
+ title: TextboxVariable
4
+ description: grafana resource type Grafana::Variable::textbox
5
+ name: TextboxVariable
6
+ lexicon: grafana
7
+ resource_type: Grafana::Variable::textbox
8
+ ---
9
+ `Grafana::Variable::textbox`, a resource type of the grafana lexicon.
@@ -0,0 +1,9 @@
1
+ ---
2
+ type: resource-type
3
+ title: TimeSeriesPanel
4
+ description: grafana resource type Grafana::Panel::timeseries
5
+ name: TimeSeriesPanel
6
+ lexicon: grafana
7
+ resource_type: Grafana::Panel::timeseries
8
+ ---
9
+ `Grafana::Panel::timeseries`, a resource type of the grafana lexicon.
@@ -0,0 +1,9 @@
1
+ ---
2
+ type: resource-type
3
+ title: TracesPanel
4
+ description: grafana resource type Grafana::Panel::traces
5
+ name: TracesPanel
6
+ lexicon: grafana
7
+ resource_type: Grafana::Panel::traces
8
+ ---
9
+ `Grafana::Panel::traces`, a resource type of the grafana lexicon.
@@ -0,0 +1,3 @@
1
+ #!/usr/bin/env tsx
2
+ export {};
3
+ //# sourceMappingURL=package-cli.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"package-cli.d.ts","sourceRoot":"","sources":["../src/package-cli.ts"],"names":[],"mappings":""}
@@ -0,0 +1,138 @@
1
+ /**
2
+ * Panels and rows.
3
+ *
4
+ * Each built-in panel class is defined through `definePanel`, with its
5
+ * `options` and `fieldConfig.defaults.custom` typed from that panel's
6
+ * schema at `GRAFANA_SCHEMA_PIN`. Every option is optional: Grafana fills
7
+ * in what a panel leaves out when it loads the dashboard. A panel plugin
8
+ * chant doesn't ship (a community visualization, an in-house plugin) comes
9
+ * in through `definePanel` too and is laid out, serialized and checked the
10
+ * same way.
11
+ *
12
+ * `gridPos` is optional. A panel without `x` and `y` is placed by the
13
+ * dashboard: left to right in declaration order, wrapping at Grafana's
14
+ * 24-column width, below the previous row of panels. A panel with both is
15
+ * placed exactly there, and GRAF105 reports overlaps.
16
+ */
17
+ import type { Declarable } from "@intentius/chant/declarable";
18
+ import type { DeepPartial } from "./util.js";
19
+ import type { DatasourceInput, QueryEntity } from "./query.js";
20
+ import type { VariableEntity } from "./variables.js";
21
+ import type { SchemaName } from "./pin.js";
22
+ import type { DashboardLink, DataTransformerConfig, FieldConfig, FieldConfigSource, GridPos } from "./schema/dashboard.gen.js";
23
+ import type * as timeseries from "./schema/timeseries.gen.js";
24
+ import type * as stat from "./schema/stat.gen.js";
25
+ import type * as gauge from "./schema/gauge.gen.js";
26
+ import type * as table from "./schema/table.gen.js";
27
+ import type * as logs from "./schema/logs.gen.js";
28
+ import type * as heatmap from "./schema/heatmap.gen.js";
29
+ import type * as text from "./schema/text.gen.js";
30
+ /** `fieldConfig` with `defaults.custom` typed for the panel. */
31
+ export interface PanelFieldConfig<C> {
32
+ defaults?: DeepPartial<Omit<FieldConfig, "custom">> & {
33
+ custom?: DeepPartial<C>;
34
+ };
35
+ overrides?: FieldConfigSource["overrides"];
36
+ }
37
+ /** A panel link: Grafana's `DashboardLink` fields, all but `title` optional. */
38
+ export type PanelLink = Partial<DashboardLink> & {
39
+ title: string;
40
+ url?: string;
41
+ };
42
+ export interface PanelProps<O = Record<string, unknown>, C = Record<string, unknown>> {
43
+ title?: string;
44
+ description?: string;
45
+ /** Position and size in the 24-column grid. Leave out `x`/`y` to let the dashboard place it. */
46
+ gridPos?: Partial<GridPos>;
47
+ /** The datasource for every query that doesn't name its own. */
48
+ datasource?: DatasourceInput<any>;
49
+ /** The panel's queries. `refId`s default to A, B, C… in order. */
50
+ targets?: QueryEntity<any, any>[];
51
+ /** The panel plugin's own options, typed from its schema. */
52
+ options?: DeepPartial<O>;
53
+ fieldConfig?: PanelFieldConfig<C>;
54
+ transformations?: DataTransformerConfig[];
55
+ links?: PanelLink[];
56
+ /** Repeat the panel once per value of this variable. */
57
+ repeat?: VariableEntity | string;
58
+ repeatDirection?: "h" | "v";
59
+ maxPerRow?: number;
60
+ maxDataPoints?: number;
61
+ interval?: string;
62
+ timeFrom?: string;
63
+ timeShift?: string;
64
+ hideTimeOverride?: boolean;
65
+ transparent?: boolean;
66
+ pluginVersion?: string;
67
+ /** Panel id within the dashboard. Defaults to position order, 1, 2, 3… */
68
+ id?: number;
69
+ }
70
+ export interface PanelDefinition<T extends string = string> {
71
+ /** The panel plugin id Grafana stores in `type`. */
72
+ type: T;
73
+ className: string;
74
+ description?: string;
75
+ /** Size used when `gridPos` leaves `w` or `h` out. */
76
+ defaultSize: {
77
+ w: number;
78
+ h: number;
79
+ };
80
+ /** The vendored schema its options follow, when there is one (GRAF107 validates against it). */
81
+ schema?: SchemaName;
82
+ /** True only for the panels this package ships. */
83
+ builtin: boolean;
84
+ }
85
+ export interface PanelEntity<O = Record<string, unknown>, C = Record<string, unknown>> extends Declarable {
86
+ readonly props: PanelProps<O, C>;
87
+ readonly panelDefinition: PanelDefinition;
88
+ }
89
+ export interface PanelClass<T extends string = string, O = Record<string, unknown>, C = Record<string, unknown>> {
90
+ new (props?: PanelProps<O, C>): PanelEntity<O, C>;
91
+ readonly definition: PanelDefinition<T>;
92
+ }
93
+ export declare const PANEL_TYPE_PREFIX = "Grafana::Panel::";
94
+ export declare const ROW_TYPE = "Grafana::Row";
95
+ /** Every registered panel definition, built-ins first. */
96
+ export declare function registeredPanels(): PanelDefinition[];
97
+ export declare function panelDefinitionFor(type: string): PanelDefinition | undefined;
98
+ /**
99
+ * Define a panel class for a panel plugin chant doesn't ship.
100
+ *
101
+ * @example
102
+ * ```ts
103
+ * interface PieOptions { pieType?: "pie" | "donut"; legend?: { showLegend?: boolean } }
104
+ *
105
+ * export const PieChartPanel = definePanel<PieOptions>()({
106
+ * type: "piechart",
107
+ * className: "PieChartPanel",
108
+ * defaultSize: { w: 8, h: 8 },
109
+ * });
110
+ * ```
111
+ */
112
+ export declare function definePanel<O = Record<string, unknown>, C = Record<string, unknown>>(): <T extends string>(def: Omit<PanelDefinition<T>, "builtin">) => PanelClass<T, O, C>;
113
+ export declare function isPanelEntity(value: unknown): value is PanelEntity;
114
+ export declare const TimeSeriesPanel: PanelClass<"timeseries", timeseries.Options, timeseries.GraphFieldConfig>;
115
+ export declare const StatPanel: PanelClass<"stat", stat.Options, Record<string, unknown>>;
116
+ export declare const GaugePanel: PanelClass<"gauge", gauge.Options, Record<string, unknown>>;
117
+ export declare const TablePanel: PanelClass<"table", table.Options, table.TableFieldOptions>;
118
+ export declare const LogsPanel: PanelClass<"logs", logs.Options, Record<string, unknown>>;
119
+ export declare const TracesPanel: PanelClass<"traces", Record<string, unknown>, Record<string, unknown>>;
120
+ export declare const HeatmapPanel: PanelClass<"heatmap", heatmap.Options, heatmap.FieldConfig>;
121
+ export declare const TextPanel: PanelClass<"text", text.Options, Record<string, unknown>>;
122
+ export interface RowProps {
123
+ title: string;
124
+ /** Collapsed rows keep their panels inside the row until opened. */
125
+ collapsed?: boolean;
126
+ panels?: PanelEntity<any, any>[];
127
+ /** Repeat the row once per value of this variable. */
128
+ repeat?: VariableEntity | string;
129
+ datasource?: DatasourceInput<any>;
130
+ id?: number;
131
+ }
132
+ export interface RowEntity extends Declarable {
133
+ readonly props: RowProps;
134
+ }
135
+ /** A full-width row header; the panels listed in it are placed below it. */
136
+ export declare const Row: new (props: RowProps) => RowEntity;
137
+ export declare function isRowEntity(value: unknown): value is RowEntity;
138
+ //# sourceMappingURL=panels.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"panels.d.ts","sourceRoot":"","sources":["../src/panels.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAGH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,6BAA6B,CAAC;AAC9D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,QAAQ,CAAC;AAC1C,OAAO,KAAK,EAAE,eAAe,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAC5D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAClD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AACxC,OAAO,KAAK,EACV,aAAa,EACb,qBAAqB,EACrB,WAAW,EACX,iBAAiB,EACjB,OAAO,EACR,MAAM,wBAAwB,CAAC;AAChC,OAAO,KAAK,KAAK,UAAU,MAAM,yBAAyB,CAAC;AAC3D,OAAO,KAAK,KAAK,IAAI,MAAM,mBAAmB,CAAC;AAC/C,OAAO,KAAK,KAAK,KAAK,MAAM,oBAAoB,CAAC;AACjD,OAAO,KAAK,KAAK,KAAK,MAAM,oBAAoB,CAAC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;IAEpB,MAAM,CAAC,EAAE,WAAW,CAAC,GAAG,EAAE,GAAG,CAAC,EAAE,CAAC;IACjC,sDAAsD;IACtD,MAAM,CAAC,EAAE,cAAc,GAAG,MAAM,CAAC;IAEjC,UAAU,CAAC,EAAE,eAAe,CAAC,GAAG,CAAC,CAAC;IAClC,EAAE,CAAC,EAAE,MAAM,CAAC;CACb;AAED,MAAM,WAAW,SAAU,SAAQ,UAAU;IAC3C,QAAQ,CAAC,KAAK,EAAE,QAAQ,CAAC;CAC1B;AAID,4EAA4E;AAC5E,eAAO,MAAM,GAAG,EAEA,KAAK,KAAK,EAAE,QAAQ,KAAK,SAAS,CAAC;AAGnD,wBAAgB,WAAW,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,SAAS,CAE9D"}
package/dist/pin.d.ts ADDED
@@ -0,0 +1,32 @@
1
+ /**
2
+ * The Grafana schemas this lexicon's types are generated from.
3
+ *
4
+ * Grafana defines dashboards, panel options and datasource queries as CUE
5
+ * kinds. `grafana/grafana-foundation-sdk` runs them through cog and
6
+ * publishes, beside its builder libraries, one JSON Schema per kind under
7
+ * `jsonschema/`. This lexicon vendors the files it uses into `src/spec/schemas/`
8
+ * (exact bytes, at the commit below) and generates `src/schema/*.gen.ts`
9
+ * from them. Nothing is fetched at build or test time.
10
+ *
11
+ * Bumping the pin: change `ref` and `commit`, run `just fetch-schemas`
12
+ * (downloads and prints the new digests), paste the digests here, run
13
+ * `npm run generate`, and review the diff of `src/schema/`.
14
+ */
15
+ export interface GrafanaSchemaPin {
16
+ /** Where the schema files come from. */
17
+ source: string;
18
+ /** The tag the commit is published under. */
19
+ ref: string;
20
+ /** The exact commit the vendored files were taken from. */
21
+ commit: string;
22
+ /** The Grafana kind registry version cog generated the schemas from. */
23
+ kindRegistry: string;
24
+ /** sha256 of each vendored file, keyed by schema name (`src/spec/schemas/<name>.jsonschema.json`). */
25
+ files: Readonly<Record<SchemaName, string>>;
26
+ }
27
+ export declare const SCHEMA_NAMES: readonly ["dashboard", "timeseries", "stat", "gauge", "table", "logs", "heatmap", "text", "prometheus", "tempo", "loki"];
28
+ export type SchemaName = (typeof SCHEMA_NAMES)[number];
29
+ export declare const GRAFANA_SCHEMA_PIN: GrafanaSchemaPin;
30
+ /** The raw URL of one schema file at the pinned commit. */
31
+ export declare function schemaUrl(name: SchemaName, pin?: GrafanaSchemaPin): string;
32
+ //# sourceMappingURL=pin.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pin.d.ts","sourceRoot":"","sources":["../src/pin.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,MAAM,WAAW,gBAAgB;IAC/B,wCAAwC;IACxC,MAAM,EAAE,MAAM,CAAC;IACf,6CAA6C;IAC7C,GAAG,EAAE,MAAM,CAAC;IACZ,2DAA2D;IAC3D,MAAM,EAAE,MAAM,CAAC;IACf,wEAAwE;IACxE,YAAY,EAAE,MAAM,CAAC;IACrB,sGAAsG;IACtG,KAAK,EAAE,QAAQ,CAAC,MAAM,CAAC,UAAU,EAAE,MAAM,CAAC,CAAC,CAAC;CAC7C;AAED,eAAO,MAAM,YAAY,0HAYf,CAAC;AAEX,MAAM,MAAM,UAAU,GAAG,CAAC,OAAO,YAAY,CAAC,CAAC,MAAM,CAAC,CAAC;AAEvD,eAAO,MAAM,kBAAkB,EAAE,gBAkB/B,CAAC;AAEH,2DAA2D;AAC3D,wBAAgB,SAAS,CAAC,IAAI,EAAE,UAAU,EAAE,GAAG,GAAE,gBAAqC,GAAG,MAAM,CAE9F"}
@@ -0,0 +1,12 @@
1
+ import type { LexiconPlugin } from "@intentius/chant/lexicon";
2
+ /**
3
+ * Grafana lexicon plugin.
4
+ *
5
+ * Dashboards, panels, typed Prometheus, Tempo and Loki queries, variables
6
+ * and datasources, serialized to dashboard JSON and Grafana's provisioning
7
+ * files. Panel options and query models are generated from Grafana's own
8
+ * schemas at `GRAFANA_SCHEMA_PIN`; `definePanel` and `defineQuery` add
9
+ * plugins chant doesn't ship.
10
+ */
11
+ export declare const grafanaPlugin: LexiconPlugin;
12
+ //# sourceMappingURL=plugin.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../src/plugin.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AA0B9D;;;;;;;;GAQG;AACH,eAAO,MAAM,aAAa,EAAE,aAgF3B,CAAC"}