@intentius/chant-lexicon-grafana 0.99.0 → 0.100.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 (224) hide show
  1. package/README.md +12 -6
  2. package/dist/annotations.d.ts +61 -0
  3. package/dist/annotations.d.ts.map +1 -0
  4. package/dist/api/apply.d.ts +8 -4
  5. package/dist/api/apply.d.ts.map +1 -1
  6. package/dist/api/fake-grafana.d.ts +2 -0
  7. package/dist/api/fake-grafana.d.ts.map +1 -1
  8. package/dist/api/folders.d.ts +53 -17
  9. package/dist/api/folders.d.ts.map +1 -1
  10. package/dist/build.d.ts +26 -5
  11. package/dist/build.d.ts.map +1 -1
  12. package/dist/catalog.d.ts +1 -1
  13. package/dist/catalog.d.ts.map +1 -1
  14. package/dist/codegen/docs.d.ts.map +1 -1
  15. package/dist/codegen/generate.d.ts +7 -1
  16. package/dist/codegen/generate.d.ts.map +1 -1
  17. package/dist/composites/shared.d.ts +4 -3
  18. package/dist/composites/shared.d.ts.map +1 -1
  19. package/dist/dashboard.d.ts +42 -14
  20. package/dist/dashboard.d.ts.map +1 -1
  21. package/dist/datasource-refs.d.ts +9 -5
  22. package/dist/datasource-refs.d.ts.map +1 -1
  23. package/dist/datasource-settings.d.ts +834 -0
  24. package/dist/datasource-settings.d.ts.map +1 -0
  25. package/dist/datasource.d.ts +53 -11
  26. package/dist/datasource.d.ts.map +1 -1
  27. package/dist/deep-observe-hooks.d.ts +1 -1
  28. package/dist/deep-observe-hooks.d.ts.map +1 -1
  29. package/dist/deep-observe.d.ts +9 -4
  30. package/dist/deep-observe.d.ts.map +1 -1
  31. package/dist/describe-resources.d.ts +1 -0
  32. package/dist/describe-resources.d.ts.map +1 -1
  33. package/dist/detect.d.ts +4 -2
  34. package/dist/detect.d.ts.map +1 -1
  35. package/dist/folder.d.ts +68 -0
  36. package/dist/folder.d.ts.map +1 -0
  37. package/dist/import/generator.d.ts.map +1 -1
  38. package/dist/import/mappings.d.ts +12 -6
  39. package/dist/import/mappings.d.ts.map +1 -1
  40. package/dist/import/model.d.ts +7 -0
  41. package/dist/import/model.d.ts.map +1 -1
  42. package/dist/import/normalize.d.ts.map +1 -1
  43. package/dist/import/parser.d.ts +16 -1
  44. package/dist/import/parser.d.ts.map +1 -1
  45. package/dist/import/testdata/fixtures.d.ts +6 -0
  46. package/dist/import/testdata/fixtures.d.ts.map +1 -1
  47. package/dist/import/v2.d.ts +4 -3
  48. package/dist/import/v2.d.ts.map +1 -1
  49. package/dist/index.d.ts +11 -9
  50. package/dist/index.d.ts.map +1 -1
  51. package/dist/init-templates.d.ts +27 -0
  52. package/dist/init-templates.d.ts.map +1 -0
  53. package/dist/integrity.json +11 -9
  54. package/dist/lint/audit-catalog.d.ts +1 -1
  55. package/dist/lint/audit-catalog.d.ts.map +1 -1
  56. package/dist/lint/post-synth/graf101.d.ts +1 -1
  57. package/dist/lint/post-synth/graf104.d.ts +2 -2
  58. package/dist/lint/post-synth/graf106.d.ts +2 -2
  59. package/dist/lint/post-synth/graf110.d.ts +8 -0
  60. package/dist/lint/post-synth/graf110.d.ts.map +1 -0
  61. package/dist/lint/post-synth/grafana-helpers.d.ts.map +1 -1
  62. package/dist/lint/post-synth/index.d.ts.map +1 -1
  63. package/dist/manifest.json +1 -1
  64. package/dist/meta.json +70 -0
  65. package/dist/okf/index.md +18 -3
  66. package/dist/okf/rules/GRAF101.md +2 -2
  67. package/dist/okf/rules/GRAF104.md +2 -2
  68. package/dist/okf/rules/GRAF106.md +2 -2
  69. package/dist/okf/rules/GRAF110.md +11 -0
  70. package/dist/okf/types/AdhocVariable.md +9 -0
  71. package/dist/okf/types/AzureMonitorQuery.md +9 -0
  72. package/dist/okf/types/BigQueryQuery.md +9 -0
  73. package/dist/okf/types/CloudMonitoringQuery.md +9 -0
  74. package/dist/okf/types/CloudWatchQuery.md +9 -0
  75. package/dist/okf/types/Dashboard.md +1 -1
  76. package/dist/okf/types/Datasource.md +1 -1
  77. package/dist/okf/types/DatasourceProvisioning.md +9 -0
  78. package/dist/okf/types/ElasticsearchQuery.md +9 -0
  79. package/dist/okf/types/ExternalDatasource.md +1 -1
  80. package/dist/okf/types/Folder.md +9 -0
  81. package/dist/okf/types/GroupByVariable.md +9 -0
  82. package/dist/okf/types/MSSQLQuery.md +9 -0
  83. package/dist/okf/types/MySQLQuery.md +9 -0
  84. package/dist/okf/types/PostgresQuery.md +9 -0
  85. package/dist/okf/types/PyroscopeQuery.md +9 -0
  86. package/dist/okf/types/SwitchVariable.md +9 -0
  87. package/dist/op/activities/grafana-apply.d.ts +11 -0
  88. package/dist/op/activities/grafana-apply.d.ts.map +1 -1
  89. package/dist/op/activities/index.d.ts +1 -1
  90. package/dist/op/activities/index.d.ts.map +1 -1
  91. package/dist/ownership.d.ts +11 -0
  92. package/dist/ownership.d.ts.map +1 -1
  93. package/dist/pin.d.ts +1 -1
  94. package/dist/pin.d.ts.map +1 -1
  95. package/dist/plugin.d.ts.map +1 -1
  96. package/dist/promql-check.d.ts.map +1 -1
  97. package/dist/query-models.d.ts +95 -0
  98. package/dist/query-models.d.ts.map +1 -0
  99. package/dist/query.d.ts +107 -10
  100. package/dist/query.d.ts.map +1 -1
  101. package/dist/rules/graf101.ts +2 -2
  102. package/dist/rules/graf104.ts +3 -3
  103. package/dist/rules/graf106.ts +3 -3
  104. package/dist/rules/graf110.ts +17 -0
  105. package/dist/rules/grafana-helpers.ts +13 -3
  106. package/dist/schema/azuremonitor.gen.d.ts +354 -0
  107. package/dist/schema/azuremonitor.gen.d.ts.map +1 -0
  108. package/dist/schema/bigquery.gen.d.ts +93 -0
  109. package/dist/schema/bigquery.gen.d.ts.map +1 -0
  110. package/dist/schema/cloudwatch.gen.d.ts +394 -0
  111. package/dist/schema/cloudwatch.gen.d.ts.map +1 -0
  112. package/dist/schema/elasticsearch.gen.d.ts +444 -0
  113. package/dist/schema/elasticsearch.gen.d.ts.map +1 -0
  114. package/dist/schema/googlecloudmonitoring.gen.d.ts +312 -0
  115. package/dist/schema/googlecloudmonitoring.gen.d.ts.map +1 -0
  116. package/dist/schema/grafanapyroscope.gen.d.ts +60 -0
  117. package/dist/schema/grafanapyroscope.gen.d.ts.map +1 -0
  118. package/dist/schema/index.d.ts +6 -0
  119. package/dist/schema/index.d.ts.map +1 -1
  120. package/dist/schema/table.gen.d.ts +13 -0
  121. package/dist/schema/table.gen.d.ts.map +1 -1
  122. package/dist/schema-validate.d.ts +9 -0
  123. package/dist/schema-validate.d.ts.map +1 -1
  124. package/dist/skill-defs.d.ts.map +1 -1
  125. package/dist/skills/chant-grafana-operations.md +108 -0
  126. package/dist/skills/chant-grafana.md +5 -4
  127. package/dist/spec/schemas.d.ts +9 -7
  128. package/dist/spec/schemas.d.ts.map +1 -1
  129. package/dist/spec/schemas.gen.d.ts +3 -0
  130. package/dist/spec/schemas.gen.d.ts.map +1 -0
  131. package/dist/validate-alerting.d.ts.map +1 -1
  132. package/dist/validate-output.d.ts +15 -2
  133. package/dist/validate-output.d.ts.map +1 -1
  134. package/dist/validate.d.ts.map +1 -1
  135. package/dist/validation.d.ts +14 -0
  136. package/dist/validation.d.ts.map +1 -0
  137. package/dist/variables.d.ts +102 -5
  138. package/dist/variables.d.ts.map +1 -1
  139. package/package.json +2 -2
  140. package/src/annotations.ts +84 -0
  141. package/src/api/apply.test.ts +19 -1
  142. package/src/api/apply.ts +18 -8
  143. package/src/api/fake-grafana.ts +6 -2
  144. package/src/api/folders.ts +106 -32
  145. package/src/build.test.ts +142 -6
  146. package/src/build.ts +126 -24
  147. package/src/catalog.ts +20 -2
  148. package/src/codegen/docs.ts +13 -6
  149. package/src/codegen/generate.ts +27 -1
  150. package/src/composites/shared.ts +3 -2
  151. package/src/dashboard.ts +59 -14
  152. package/src/datasource-refs.ts +30 -6
  153. package/src/datasource-settings.test.ts +106 -0
  154. package/src/datasource-settings.ts +941 -0
  155. package/src/datasource.ts +71 -11
  156. package/src/deep-observe-hooks.ts +16 -1
  157. package/src/deep-observe.test.ts +47 -1
  158. package/src/deep-observe.ts +36 -13
  159. package/src/describe-resources.test.ts +16 -0
  160. package/src/describe-resources.ts +36 -1
  161. package/src/detect.ts +3 -3
  162. package/src/folder.ts +118 -0
  163. package/src/generated/lexicon-grafana.json +70 -0
  164. package/src/import/generated-types.e2e.test.ts +15 -3
  165. package/src/import/generator.ts +2 -1
  166. package/src/import/mappings.ts +98 -26
  167. package/src/import/model.ts +7 -0
  168. package/src/import/normalize.ts +32 -3
  169. package/src/import/parser.test.ts +97 -21
  170. package/src/import/parser.ts +169 -18
  171. package/src/import/roundtrip.test.ts +104 -9
  172. package/src/import/testdata/fixtures.ts +8 -0
  173. package/src/import/v2.ts +4 -3
  174. package/src/index.ts +122 -13
  175. package/src/init-templates.test.ts +74 -0
  176. package/src/init-templates.ts +349 -0
  177. package/src/lint/audit-catalog.ts +9 -1
  178. package/src/lint/post-synth/graf101.ts +2 -2
  179. package/src/lint/post-synth/graf104.ts +3 -3
  180. package/src/lint/post-synth/graf106.ts +3 -3
  181. package/src/lint/post-synth/graf110.ts +17 -0
  182. package/src/lint/post-synth/grafana-helpers.ts +13 -3
  183. package/src/lint/post-synth/index.ts +2 -0
  184. package/src/lint/post-synth/post-synth.test.ts +99 -2
  185. package/src/load-cost.test.ts +35 -0
  186. package/src/op/activities/grafana-apply.e2e.test.ts +14 -5
  187. package/src/op/activities/grafana-apply.test.ts +16 -2
  188. package/src/op/activities/grafana-apply.ts +29 -3
  189. package/src/op/activities/index.ts +1 -1
  190. package/src/ownership.ts +19 -0
  191. package/src/panels.test.ts +3 -1
  192. package/src/pin.ts +12 -0
  193. package/src/plugin.test.ts +9 -2
  194. package/src/plugin.ts +9 -0
  195. package/src/promql-check.ts +5 -1
  196. package/src/query-models.ts +94 -0
  197. package/src/query.test.ts +166 -0
  198. package/src/query.ts +177 -12
  199. package/src/schema/azuremonitor.gen.ts +381 -0
  200. package/src/schema/bigquery.gen.ts +110 -0
  201. package/src/schema/cloudwatch.gen.ts +423 -0
  202. package/src/schema/elasticsearch.gen.ts +508 -0
  203. package/src/schema/googlecloudmonitoring.gen.ts +330 -0
  204. package/src/schema/grafanapyroscope.gen.ts +66 -0
  205. package/src/schema/index.ts +6 -0
  206. package/src/schema/table.gen.ts +14 -0
  207. package/src/schema-validate.ts +58 -7
  208. package/src/skill-defs.ts +17 -0
  209. package/src/skills/chant-grafana-operations.md +108 -0
  210. package/src/skills/chant-grafana.md +5 -4
  211. package/src/spec/overlay/table.overlay.json +19 -0
  212. package/src/spec/schemas/azuremonitor.jsonschema.json +679 -0
  213. package/src/spec/schemas/bigquery.jsonschema.json +290 -0
  214. package/src/spec/schemas/cloudwatch.jsonschema.json +721 -0
  215. package/src/spec/schemas/elasticsearch.jsonschema.json +1695 -0
  216. package/src/spec/schemas/googlecloudmonitoring.jsonschema.json +488 -0
  217. package/src/spec/schemas/grafanapyroscope.jsonschema.json +93 -0
  218. package/src/spec/schemas.gen.ts +40 -0
  219. package/src/spec/schemas.ts +9 -7
  220. package/src/validate-alerting.ts +4 -2
  221. package/src/validate-output.ts +96 -4
  222. package/src/validate.ts +14 -0
  223. package/src/validation.ts +27 -0
  224. package/src/variables.ts +113 -6
@@ -0,0 +1,508 @@
1
+ // Code generated by chant generate from the vendored Grafana schema
2
+ // src/spec/schemas/elasticsearch.jsonschema.json (see src/pin.ts) and its correction
3
+ // overlay in src/spec/overlay/ (see src/spec/overlay.ts). DO NOT EDIT.
4
+ /* eslint-disable */
5
+
6
+ export type BucketAggregation = DateHistogram | Histogram | Terms | Filters | GeoHashGrid | Nested;
7
+
8
+ export interface DateHistogram {
9
+ field?: string;
10
+ id: string;
11
+ type: BucketAggregationType;
12
+ settings?: {
13
+ interval?: string;
14
+ min_doc_count?: string;
15
+ trimEdges?: string;
16
+ offset?: string;
17
+ timeZone?: string;
18
+ };
19
+ }
20
+
21
+ export type BucketAggregationType = "terms" | "filters" | "geohash_grid" | "date_histogram" | "histogram" | "nested";
22
+
23
+ export interface Histogram {
24
+ field?: string;
25
+ id: string;
26
+ type: BucketAggregationType;
27
+ settings?: {
28
+ interval?: string;
29
+ min_doc_count?: string;
30
+ };
31
+ }
32
+
33
+ export interface Terms {
34
+ field?: string;
35
+ id: string;
36
+ type: BucketAggregationType;
37
+ settings?: {
38
+ order?: TermsOrder;
39
+ size?: string;
40
+ min_doc_count?: string;
41
+ orderBy?: string;
42
+ missing?: string;
43
+ };
44
+ }
45
+
46
+ export type TermsOrder = "desc" | "asc";
47
+
48
+ export interface Filters {
49
+ id: string;
50
+ type: BucketAggregationType;
51
+ settings?: {
52
+ filters?: Filter[];
53
+ };
54
+ }
55
+
56
+ export interface Filter {
57
+ query: string;
58
+ label: string;
59
+ }
60
+
61
+ export interface GeoHashGrid {
62
+ field?: string;
63
+ id: string;
64
+ type: BucketAggregationType;
65
+ settings?: {
66
+ precision?: string;
67
+ };
68
+ }
69
+
70
+ export interface Nested {
71
+ field?: string;
72
+ id: string;
73
+ type: BucketAggregationType;
74
+ settings?: Record<string, unknown>;
75
+ }
76
+
77
+ export type MetricAggregation = Count | PipelineMetricAggregation | MetricAggregationWithSettings;
78
+
79
+ export interface Count {
80
+ type: MetricAggregationType;
81
+ id: string;
82
+ hide?: boolean;
83
+ }
84
+
85
+ export type MetricAggregationType = "count" | "avg" | "sum" | "min" | "max" | "extended_stats" | "percentiles" | "cardinality" | "raw_document" | "raw_data" | "logs" | "rate" | "top_metrics" | PipelineMetricAggregationType;
86
+
87
+ export type PipelineMetricAggregationType = "moving_avg" | "moving_fn" | "derivative" | "serial_diff" | "cumulative_sum" | "bucket_script";
88
+
89
+ export type PipelineMetricAggregation = MovingAverage | Derivative | CumulativeSum | BucketScript;
90
+
91
+ /**
92
+ * #MovingAverage's settings are overridden in types.ts
93
+ */
94
+ export interface MovingAverage {
95
+ pipelineAgg?: string;
96
+ field?: string;
97
+ type: MetricAggregationType;
98
+ id: string;
99
+ settings?: Record<string, Record<string, unknown>>;
100
+ hide?: boolean;
101
+ }
102
+
103
+ export interface Derivative {
104
+ pipelineAgg?: string;
105
+ field?: string;
106
+ type: MetricAggregationType;
107
+ id: string;
108
+ settings?: {
109
+ unit?: string;
110
+ };
111
+ hide?: boolean;
112
+ }
113
+
114
+ export interface CumulativeSum {
115
+ pipelineAgg?: string;
116
+ field?: string;
117
+ type: MetricAggregationType;
118
+ id: string;
119
+ settings?: {
120
+ format?: string;
121
+ };
122
+ hide?: boolean;
123
+ }
124
+
125
+ export interface BucketScript {
126
+ type: MetricAggregationType;
127
+ pipelineVariables?: PipelineVariable[];
128
+ id: string;
129
+ settings?: {
130
+ script?: InlineScript;
131
+ };
132
+ hide?: boolean;
133
+ }
134
+
135
+ export interface PipelineVariable {
136
+ name: string;
137
+ pipelineAgg: string;
138
+ }
139
+
140
+ export type InlineScript = string | {
141
+ inline?: string;
142
+ };
143
+
144
+ export type MetricAggregationWithSettings = BucketScript | CumulativeSum | Derivative | SerialDiff | RawData | RawDocument | UniqueCount | Percentiles | ExtendedStats | Min | Max | Sum | Average | MovingAverage | MovingFunction | Logs | Rate | TopMetrics;
145
+
146
+ export interface SerialDiff {
147
+ pipelineAgg?: string;
148
+ field?: string;
149
+ type: MetricAggregationType;
150
+ id: string;
151
+ settings?: {
152
+ lag?: string;
153
+ };
154
+ hide?: boolean;
155
+ }
156
+
157
+ export interface RawData {
158
+ type: MetricAggregationType;
159
+ id: string;
160
+ settings?: {
161
+ size?: string;
162
+ };
163
+ hide?: boolean;
164
+ }
165
+
166
+ export interface RawDocument {
167
+ type: MetricAggregationType;
168
+ id: string;
169
+ settings?: {
170
+ size?: string;
171
+ };
172
+ hide?: boolean;
173
+ }
174
+
175
+ export interface UniqueCount {
176
+ type: MetricAggregationType;
177
+ field?: string;
178
+ id: string;
179
+ settings?: {
180
+ precision_threshold?: string;
181
+ missing?: string;
182
+ };
183
+ hide?: boolean;
184
+ }
185
+
186
+ export interface Percentiles {
187
+ type: MetricAggregationType;
188
+ field?: string;
189
+ id: string;
190
+ settings?: {
191
+ script?: InlineScript;
192
+ missing?: string;
193
+ percents?: string[];
194
+ };
195
+ hide?: boolean;
196
+ }
197
+
198
+ export interface ExtendedStats {
199
+ type: MetricAggregationType;
200
+ settings?: {
201
+ script?: InlineScript;
202
+ missing?: string;
203
+ sigma?: string;
204
+ };
205
+ field?: string;
206
+ id: string;
207
+ meta?: Record<string, unknown>;
208
+ hide?: boolean;
209
+ }
210
+
211
+ export interface Min {
212
+ type: MetricAggregationType;
213
+ field?: string;
214
+ id: string;
215
+ settings?: {
216
+ script?: InlineScript;
217
+ missing?: string;
218
+ };
219
+ hide?: boolean;
220
+ }
221
+
222
+ export interface Max {
223
+ type: MetricAggregationType;
224
+ field?: string;
225
+ id: string;
226
+ settings?: {
227
+ script?: InlineScript;
228
+ missing?: string;
229
+ };
230
+ hide?: boolean;
231
+ }
232
+
233
+ export interface Sum {
234
+ type: MetricAggregationType;
235
+ field?: string;
236
+ id: string;
237
+ settings?: {
238
+ script?: InlineScript;
239
+ missing?: string;
240
+ };
241
+ hide?: boolean;
242
+ }
243
+
244
+ export interface Average {
245
+ type: MetricAggregationType;
246
+ field?: string;
247
+ id: string;
248
+ settings?: {
249
+ script?: InlineScript;
250
+ missing?: string;
251
+ };
252
+ hide?: boolean;
253
+ }
254
+
255
+ export interface MovingFunction {
256
+ pipelineAgg?: string;
257
+ field?: string;
258
+ type: MetricAggregationType;
259
+ id: string;
260
+ settings?: {
261
+ window?: string;
262
+ script?: InlineScript;
263
+ shift?: string;
264
+ };
265
+ hide?: boolean;
266
+ }
267
+
268
+ export interface Logs {
269
+ type: MetricAggregationType;
270
+ id: string;
271
+ settings?: {
272
+ limit?: string;
273
+ };
274
+ hide?: boolean;
275
+ }
276
+
277
+ export interface Rate {
278
+ type: MetricAggregationType;
279
+ field?: string;
280
+ id: string;
281
+ settings?: {
282
+ unit?: string;
283
+ mode?: string;
284
+ };
285
+ hide?: boolean;
286
+ }
287
+
288
+ export interface TopMetrics {
289
+ type: MetricAggregationType;
290
+ id: string;
291
+ settings?: {
292
+ order?: string;
293
+ orderBy?: string;
294
+ metrics?: string[];
295
+ };
296
+ hide?: boolean;
297
+ }
298
+
299
+ export interface BaseBucketAggregation {
300
+ id: string;
301
+ type: BucketAggregationType;
302
+ settings?: Record<string, unknown>;
303
+ }
304
+
305
+ export interface BucketAggregationWithField {
306
+ field?: string;
307
+ id: string;
308
+ type: BucketAggregationType;
309
+ settings?: Record<string, unknown>;
310
+ }
311
+
312
+ export interface DateHistogramSettings {
313
+ interval?: string;
314
+ min_doc_count?: string;
315
+ trimEdges?: string;
316
+ offset?: string;
317
+ timeZone?: string;
318
+ }
319
+
320
+ export interface HistogramSettings {
321
+ interval?: string;
322
+ min_doc_count?: string;
323
+ }
324
+
325
+ export interface TermsSettings {
326
+ order?: TermsOrder;
327
+ size?: string;
328
+ min_doc_count?: string;
329
+ orderBy?: string;
330
+ missing?: string;
331
+ }
332
+
333
+ export interface FiltersSettings {
334
+ filters?: Filter[];
335
+ }
336
+
337
+ export interface GeoHashGridSettings {
338
+ precision?: string;
339
+ }
340
+
341
+ export interface BaseMetricAggregation {
342
+ type: MetricAggregationType;
343
+ id: string;
344
+ hide?: boolean;
345
+ }
346
+
347
+ export interface MetricAggregationWithField {
348
+ field?: string;
349
+ type: MetricAggregationType;
350
+ id: string;
351
+ hide?: boolean;
352
+ }
353
+
354
+ export interface MetricAggregationWithMissingSupport {
355
+ settings?: {
356
+ missing?: string;
357
+ };
358
+ type: MetricAggregationType;
359
+ id: string;
360
+ hide?: boolean;
361
+ }
362
+
363
+ export interface MetricAggregationWithInlineScript {
364
+ settings?: {
365
+ script?: InlineScript;
366
+ };
367
+ type: MetricAggregationType;
368
+ id: string;
369
+ hide?: boolean;
370
+ }
371
+
372
+ export type ExtendedStatMetaType = "avg" | "min" | "max" | "sum" | "count" | "std_deviation" | "std_deviation_bounds_upper" | "std_deviation_bounds_lower";
373
+
374
+ export interface ExtendedStat {
375
+ label: string;
376
+ value: ExtendedStatMetaType;
377
+ }
378
+
379
+ export interface BasePipelineMetricAggregation {
380
+ pipelineAgg?: string;
381
+ field?: string;
382
+ type: string;
383
+ id: string;
384
+ hide?: boolean;
385
+ }
386
+
387
+ export interface PipelineMetricAggregationWithMultipleBucketPaths {
388
+ pipelineVariables?: PipelineVariable[];
389
+ type: MetricAggregationType;
390
+ id: string;
391
+ hide?: boolean;
392
+ }
393
+
394
+ export type MovingAverageModel = "simple" | "linear" | "ewma" | "holt" | "holt_winters";
395
+
396
+ export interface MovingAverageModelOption {
397
+ label: string;
398
+ value: MovingAverageModel;
399
+ }
400
+
401
+ export interface BaseMovingAverageModelSettings {
402
+ model: MovingAverageModel;
403
+ window: string;
404
+ predict: string;
405
+ }
406
+
407
+ export interface MovingAverageSimpleModelSettings {
408
+ model: MovingAverageModel;
409
+ window: string;
410
+ predict: string;
411
+ }
412
+
413
+ export interface MovingAverageLinearModelSettings {
414
+ model: MovingAverageModel;
415
+ window: string;
416
+ predict: string;
417
+ }
418
+
419
+ export interface MovingAverageEWMAModelSettings {
420
+ model: MovingAverageModel;
421
+ settings?: {
422
+ alpha?: string;
423
+ };
424
+ window: string;
425
+ minimize: boolean;
426
+ predict: string;
427
+ }
428
+
429
+ export interface MovingAverageHoltModelSettings {
430
+ model: MovingAverageModel;
431
+ settings: {
432
+ alpha?: string;
433
+ beta?: string;
434
+ };
435
+ window: string;
436
+ minimize: boolean;
437
+ predict: string;
438
+ }
439
+
440
+ export interface MovingAverageHoltWintersModelSettings {
441
+ model: MovingAverageModel;
442
+ settings: {
443
+ alpha?: string;
444
+ beta?: string;
445
+ gamma?: string;
446
+ period?: string;
447
+ pad?: boolean;
448
+ };
449
+ window: string;
450
+ minimize: boolean;
451
+ predict: string;
452
+ }
453
+
454
+ export interface Dataquery {
455
+ /**
456
+ * Alias pattern
457
+ */
458
+ alias?: string;
459
+ /**
460
+ * Lucene query
461
+ */
462
+ query?: string;
463
+ /**
464
+ * Name of time field
465
+ */
466
+ timeField?: string;
467
+ /**
468
+ * List of bucket aggregations
469
+ */
470
+ bucketAggs?: BucketAggregation[];
471
+ /**
472
+ * List of metric aggregations
473
+ */
474
+ metrics?: MetricAggregation[];
475
+ /**
476
+ * A unique identifier for the query within the list of targets.
477
+ * In server side expressions, the refId is used as a variable name to identify results.
478
+ * By default, the UI will assign A->Z; however setting meaningful names may be useful.
479
+ */
480
+ refId?: string | null;
481
+ /**
482
+ * If hide is set to true, Grafana will filter out the response(s) associated with this query before returning it to the panel.
483
+ */
484
+ hide?: boolean;
485
+ /**
486
+ * Specify the query flavor
487
+ * TODO make this required and give it a default
488
+ */
489
+ queryType?: string;
490
+ /**
491
+ * For mixed data sources the selected datasource is on the query level.
492
+ * For non mixed scenarios this is undefined.
493
+ * TODO find a better way to do this ^ that's friendly to schema
494
+ * TODO this shouldn't be unknown but DataSourceRef | null
495
+ */
496
+ datasource?: DataSourceRef;
497
+ }
498
+
499
+ export interface DataSourceRef {
500
+ /**
501
+ * The plugin type-id
502
+ */
503
+ type?: string;
504
+ /**
505
+ * Specific datasource instance
506
+ */
507
+ uid?: string;
508
+ }