@grafana/viz-contract 1.1.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 (173) hide show
  1. package/CHANGELOG.md +17 -0
  2. package/LICENSE +201 -0
  3. package/README.md +140 -0
  4. package/fixtures/epoch-range/args.json +14 -0
  5. package/fixtures/epoch-range/meta.json +4 -0
  6. package/fixtures/epoch-range/request.json +17 -0
  7. package/fixtures/epoch-range/response.json +114 -0
  8. package/fixtures/epoch-range/result.json +252 -0
  9. package/fixtures/epoch-range/spec.json +141 -0
  10. package/fixtures/epoch-range/state.json +4 -0
  11. package/fixtures/error-all-queries-failed/spec.json +45 -0
  12. package/fixtures/error-all-queries-failed/state.json +8 -0
  13. package/fixtures/error-invalid-spec/spec.json +25 -0
  14. package/fixtures/error-invalid-spec/state.json +8 -0
  15. package/fixtures/error-unsupported-panel-type/spec.json +1372 -0
  16. package/fixtures/error-unsupported-panel-type/state.json +8 -0
  17. package/fixtures/error-unsupported-spec-version/spec.json +1372 -0
  18. package/fixtures/error-unsupported-spec-version/state.json +8 -0
  19. package/fixtures/hostile-label/args.json +14 -0
  20. package/fixtures/hostile-label/meta.json +4 -0
  21. package/fixtures/hostile-label/request.json +17 -0
  22. package/fixtures/hostile-label/response.json +420 -0
  23. package/fixtures/hostile-label/result.json +558 -0
  24. package/fixtures/hostile-label/spec.json +447 -0
  25. package/fixtures/hostile-label/state.json +4 -0
  26. package/fixtures/no-data/args.json +14 -0
  27. package/fixtures/no-data/meta.json +4 -0
  28. package/fixtures/no-data/request.json +17 -0
  29. package/fixtures/no-data/response.json +40 -0
  30. package/fixtures/no-data/result.json +178 -0
  31. package/fixtures/no-data/spec.json +67 -0
  32. package/fixtures/no-data/state.json +4 -0
  33. package/fixtures/partial-error/args.json +20 -0
  34. package/fixtures/partial-error/meta.json +4 -0
  35. package/fixtures/partial-error/request.json +28 -0
  36. package/fixtures/partial-error/response.json +220 -0
  37. package/fixtures/partial-error/result.json +358 -0
  38. package/fixtures/partial-error/spec.json +253 -0
  39. package/fixtures/partial-error/state.json +9 -0
  40. package/fixtures/pick-annotations-only/args.json +10 -0
  41. package/fixtures/pick-annotations-only/meta.json +4 -0
  42. package/fixtures/pick-annotations-only/response.json +41 -0
  43. package/fixtures/pick-annotations-only/result.json +53 -0
  44. package/fixtures/pick-categories/args.json +10 -0
  45. package/fixtures/pick-categories/meta.json +4 -0
  46. package/fixtures/pick-categories/response.json +58 -0
  47. package/fixtures/pick-categories/result.json +116 -0
  48. package/fixtures/pick-empty-result/args.json +10 -0
  49. package/fixtures/pick-empty-result/meta.json +4 -0
  50. package/fixtures/pick-empty-result/response.json +11 -0
  51. package/fixtures/pick-empty-result/result.json +23 -0
  52. package/fixtures/pick-failed-query-with-frames/args.json +10 -0
  53. package/fixtures/pick-failed-query-with-frames/meta.json +4 -0
  54. package/fixtures/pick-failed-query-with-frames/response.json +43 -0
  55. package/fixtures/pick-failed-query-with-frames/result.json +131 -0
  56. package/fixtures/pick-few-parts/args.json +10 -0
  57. package/fixtures/pick-few-parts/meta.json +4 -0
  58. package/fixtures/pick-few-parts/response.json +40 -0
  59. package/fixtures/pick-few-parts/result.json +98 -0
  60. package/fixtures/pick-heatmap-cells/args.json +10 -0
  61. package/fixtures/pick-heatmap-cells/meta.json +4 -0
  62. package/fixtures/pick-heatmap-cells/response.json +55 -0
  63. package/fixtures/pick-heatmap-cells/result.json +143 -0
  64. package/fixtures/pick-log-lines/args.json +10 -0
  65. package/fixtures/pick-log-lines/meta.json +4 -0
  66. package/fixtures/pick-log-lines/response.json +49 -0
  67. package/fixtures/pick-log-lines/result.json +76 -0
  68. package/fixtures/pick-no-rows/args.json +10 -0
  69. package/fixtures/pick-no-rows/meta.json +4 -0
  70. package/fixtures/pick-no-rows/response.json +32 -0
  71. package/fixtures/pick-no-rows/result.json +120 -0
  72. package/fixtures/pick-node-graph/args.json +10 -0
  73. package/fixtures/pick-node-graph/meta.json +4 -0
  74. package/fixtures/pick-node-graph/response.json +77 -0
  75. package/fixtures/pick-node-graph/result.json +89 -0
  76. package/fixtures/pick-numeric-only/args.json +10 -0
  77. package/fixtures/pick-numeric-only/meta.json +4 -0
  78. package/fixtures/pick-numeric-only/response.json +40 -0
  79. package/fixtures/pick-numeric-only/result.json +89 -0
  80. package/fixtures/pick-single-stat/args.json +10 -0
  81. package/fixtures/pick-single-stat/meta.json +4 -0
  82. package/fixtures/pick-single-stat/response.json +29 -0
  83. package/fixtures/pick-single-stat/result.json +69 -0
  84. package/fixtures/pick-time-series-instant/args.json +10 -0
  85. package/fixtures/pick-time-series-instant/meta.json +4 -0
  86. package/fixtures/pick-time-series-instant/response.json +40 -0
  87. package/fixtures/pick-time-series-instant/result.json +128 -0
  88. package/fixtures/pick-time-series-long/args.json +10 -0
  89. package/fixtures/pick-time-series-long/meta.json +4 -0
  90. package/fixtures/pick-time-series-long/response.json +61 -0
  91. package/fixtures/pick-time-series-long/result.json +167 -0
  92. package/fixtures/pick-time-series-multi-frame/args.json +10 -0
  93. package/fixtures/pick-time-series-multi-frame/meta.json +4 -0
  94. package/fixtures/pick-time-series-multi-frame/response.json +74 -0
  95. package/fixtures/pick-time-series-multi-frame/result.json +162 -0
  96. package/fixtures/pick-time-series-null-time/args.json +10 -0
  97. package/fixtures/pick-time-series-null-time/meta.json +4 -0
  98. package/fixtures/pick-time-series-null-time/response.json +40 -0
  99. package/fixtures/pick-time-series-null-time/result.json +128 -0
  100. package/fixtures/pick-time-series-single/args.json +10 -0
  101. package/fixtures/pick-time-series-single/meta.json +4 -0
  102. package/fixtures/pick-time-series-single/response.json +40 -0
  103. package/fixtures/pick-time-series-single/result.json +128 -0
  104. package/fixtures/pick-time-series-wide/args.json +10 -0
  105. package/fixtures/pick-time-series-wide/meta.json +4 -0
  106. package/fixtures/pick-time-series-wide/response.json +61 -0
  107. package/fixtures/pick-time-series-wide/result.json +149 -0
  108. package/fixtures/prometheus-line/args.json +14 -0
  109. package/fixtures/prometheus-line/meta.json +4 -0
  110. package/fixtures/prometheus-line/request.json +17 -0
  111. package/fixtures/prometheus-line/response.json +1344 -0
  112. package/fixtures/prometheus-line/result.json +1483 -0
  113. package/fixtures/prometheus-line/spec.json +1372 -0
  114. package/fixtures/prometheus-line/state.json +4 -0
  115. package/fixtures/smoke-barchart/spec.json +64 -0
  116. package/fixtures/smoke-barchart/state.json +4 -0
  117. package/fixtures/smoke-boxplot/spec.json +96 -0
  118. package/fixtures/smoke-boxplot/state.json +4 -0
  119. package/fixtures/smoke-bubble/spec.json +229 -0
  120. package/fixtures/smoke-bubble/state.json +4 -0
  121. package/fixtures/smoke-candlestick/spec.json +97 -0
  122. package/fixtures/smoke-candlestick/state.json +4 -0
  123. package/fixtures/smoke-chord/spec.json +72 -0
  124. package/fixtures/smoke-chord/state.json +4 -0
  125. package/fixtures/smoke-funnel/spec.json +62 -0
  126. package/fixtures/smoke-funnel/state.json +4 -0
  127. package/fixtures/smoke-geomap/spec.json +76 -0
  128. package/fixtures/smoke-geomap/state.json +4 -0
  129. package/fixtures/smoke-heatmap/spec.json +103 -0
  130. package/fixtures/smoke-heatmap/state.json +4 -0
  131. package/fixtures/smoke-histogram/spec.json +63 -0
  132. package/fixtures/smoke-histogram/state.json +4 -0
  133. package/fixtures/smoke-nodeGraph/spec.json +101 -0
  134. package/fixtures/smoke-nodeGraph/state.json +4 -0
  135. package/fixtures/smoke-parallel/spec.json +78 -0
  136. package/fixtures/smoke-parallel/state.json +4 -0
  137. package/fixtures/smoke-piechart/spec.json +62 -0
  138. package/fixtures/smoke-piechart/state.json +4 -0
  139. package/fixtures/smoke-radar/spec.json +82 -0
  140. package/fixtures/smoke-radar/state.json +4 -0
  141. package/fixtures/smoke-sankey/spec.json +72 -0
  142. package/fixtures/smoke-sankey/state.json +4 -0
  143. package/fixtures/smoke-state-timeline/spec.json +64 -0
  144. package/fixtures/smoke-state-timeline/state.json +4 -0
  145. package/fixtures/smoke-status-history/spec.json +64 -0
  146. package/fixtures/smoke-status-history/state.json +4 -0
  147. package/fixtures/smoke-streamgraph/spec.json +229 -0
  148. package/fixtures/smoke-streamgraph/state.json +4 -0
  149. package/fixtures/smoke-sunburst/spec.json +72 -0
  150. package/fixtures/smoke-sunburst/state.json +4 -0
  151. package/fixtures/smoke-timeseries/spec.json +163 -0
  152. package/fixtures/smoke-timeseries/state.json +4 -0
  153. package/fixtures/smoke-treemap/spec.json +72 -0
  154. package/fixtures/smoke-treemap/state.json +4 -0
  155. package/fixtures/too-large/args.json +14 -0
  156. package/fixtures/too-large/meta.json +4 -0
  157. package/fixtures/type-mismatch/args.json +15 -0
  158. package/fixtures/type-mismatch/meta.json +4 -0
  159. package/fixtures/type-mismatch/request.json +17 -0
  160. package/fixtures/type-mismatch/response.json +1344 -0
  161. package/fixtures/type-mismatch/result.json +9 -0
  162. package/package.json +32 -0
  163. package/registry/chart-types.json +170 -0
  164. package/registry/constants.json +14 -0
  165. package/registry/notices.json +40 -0
  166. package/registry/panel-types.json +14 -0
  167. package/registry/pick.json +46 -0
  168. package/registry/states.json +85 -0
  169. package/renderer-api.d.ts +70 -0
  170. package/schemas/bundled/query-datasource-args.schema.json +86 -0
  171. package/schemas/bundled/registry.schema.json +375 -0
  172. package/schemas/bundled/tool-result.schema.json +245 -0
  173. package/schemas/bundled/viz-spec.schema.json +261 -0
@@ -0,0 +1,8 @@
1
+ {
2
+ "state": "error",
3
+ "error": {
4
+ "code": "unsupported-spec-version",
5
+ "message": "This viz spec version (99) is not supported. Supported versions: 1."
6
+ },
7
+ "notices": []
8
+ }
@@ -0,0 +1,14 @@
1
+ {
2
+ "datasourceUid": "lgtm-prometheus",
3
+ "queries": [
4
+ {
5
+ "refId": "A",
6
+ "expr": "sum by (handler) (rate(grafana_http_request_duration_seconds_count[5m]))",
7
+ "legendFormat": "{{handler}}",
8
+ "format": "time_series"
9
+ }
10
+ ],
11
+ "from": "now-24h",
12
+ "to": "now",
13
+ "unit": "reqps"
14
+ }
@@ -0,0 +1,4 @@
1
+ {
2
+ "now": 1790353477294,
3
+ "capturedAt": 1790353477806
4
+ }
@@ -0,0 +1,17 @@
1
+ {
2
+ "from": "now-24h",
3
+ "to": "now",
4
+ "queries": [
5
+ {
6
+ "refId": "A",
7
+ "expr": "sum by (handler) (rate(grafana_http_request_duration_seconds_count[5m]))",
8
+ "legendFormat": "{{handler}}",
9
+ "format": "time_series",
10
+ "datasource": {
11
+ "uid": "lgtm-prometheus"
12
+ },
13
+ "maxDataPoints": 1000,
14
+ "intervalMs": 86400
15
+ }
16
+ ]
17
+ }
@@ -0,0 +1,420 @@
1
+ {
2
+ "status": 200,
3
+ "body": {
4
+ "results": {
5
+ "A": {
6
+ "status": 200,
7
+ "frames": [
8
+ {
9
+ "schema": {
10
+ "refId": "A",
11
+ "meta": {
12
+ "type": "timeseries-multi",
13
+ "typeVersion": [
14
+ 0,
15
+ 1
16
+ ]
17
+ },
18
+ "fields": [
19
+ {
20
+ "name": "Time",
21
+ "type": "time",
22
+ "typeInfo": {
23
+ "frame": "time.Time"
24
+ }
25
+ },
26
+ {
27
+ "name": "Value",
28
+ "type": "number",
29
+ "typeInfo": {
30
+ "frame": "float64"
31
+ },
32
+ "labels": {
33
+ "handler": "<img src=x onerror=alert(1)>"
34
+ },
35
+ "config": {
36
+ "displayNameFromDS": "<img src=x onerror=alert(1)>"
37
+ }
38
+ }
39
+ ]
40
+ },
41
+ "data": {
42
+ "values": [
43
+ [
44
+ 1790351737294,
45
+ 1790351797294,
46
+ 1790351857294,
47
+ 1790351917294,
48
+ 1790351977294,
49
+ 1790352037294,
50
+ 1790352097294,
51
+ 1790352157294,
52
+ 1790352217294,
53
+ 1790352277294,
54
+ 1790352337294,
55
+ 1790352397294,
56
+ 1790352457294,
57
+ 1790352517294,
58
+ 1790352577294,
59
+ 1790352637294,
60
+ 1790352697294,
61
+ 1790352757294,
62
+ 1790352817294,
63
+ 1790352877294,
64
+ 1790352937294,
65
+ 1790352997294,
66
+ 1790353057294,
67
+ 1790353117294,
68
+ 1790353177294,
69
+ 1790353237294,
70
+ 1790353297294,
71
+ 1790353357294,
72
+ 1790353417294,
73
+ 1790353477294
74
+ ],
75
+ [
76
+ 10,
77
+ 10.65,
78
+ 11.24,
79
+ 11.68,
80
+ 11.94,
81
+ 11.99,
82
+ 11.82,
83
+ 11.45,
84
+ 10.91,
85
+ 10.28,
86
+ 9.62,
87
+ 9,
88
+ 8.49,
89
+ 8.14,
90
+ 8,
91
+ 8.08,
92
+ 8.37,
93
+ 8.84,
94
+ 9.44,
95
+ 10.1,
96
+ 10.75,
97
+ 11.31,
98
+ 11.73,
99
+ 11.97,
100
+ 11.98,
101
+ 11.77,
102
+ 11.38,
103
+ 10.82,
104
+ 10.18,
105
+ 9.52
106
+ ]
107
+ ]
108
+ }
109
+ },
110
+ {
111
+ "schema": {
112
+ "refId": "A",
113
+ "meta": {
114
+ "type": "timeseries-multi",
115
+ "typeVersion": [
116
+ 0,
117
+ 1
118
+ ]
119
+ },
120
+ "fields": [
121
+ {
122
+ "name": "Time",
123
+ "type": "time",
124
+ "typeInfo": {
125
+ "frame": "time.Time"
126
+ }
127
+ },
128
+ {
129
+ "name": "Value",
130
+ "type": "number",
131
+ "typeInfo": {
132
+ "frame": "float64"
133
+ },
134
+ "labels": {
135
+ "handler": "</script><script>alert(2)</script>"
136
+ },
137
+ "config": {
138
+ "displayNameFromDS": "</script><script>alert(2)</script>"
139
+ }
140
+ }
141
+ ]
142
+ },
143
+ "data": {
144
+ "values": [
145
+ [
146
+ 1790351737294,
147
+ 1790351797294,
148
+ 1790351857294,
149
+ 1790351917294,
150
+ 1790351977294,
151
+ 1790352037294,
152
+ 1790352097294,
153
+ 1790352157294,
154
+ 1790352217294,
155
+ 1790352277294,
156
+ 1790352337294,
157
+ 1790352397294,
158
+ 1790352457294,
159
+ 1790352517294,
160
+ 1790352577294,
161
+ 1790352637294,
162
+ 1790352697294,
163
+ 1790352757294,
164
+ 1790352817294,
165
+ 1790352877294,
166
+ 1790352937294,
167
+ 1790352997294,
168
+ 1790353057294,
169
+ 1790353117294,
170
+ 1790353177294,
171
+ 1790353237294,
172
+ 1790353297294,
173
+ 1790353357294,
174
+ 1790353417294,
175
+ 1790353477294
176
+ ],
177
+ [
178
+ 14.68,
179
+ 14.94,
180
+ 14.99,
181
+ 14.82,
182
+ 14.45,
183
+ 13.91,
184
+ 13.28,
185
+ 12.62,
186
+ 12,
187
+ 11.49,
188
+ 11.14,
189
+ 11,
190
+ 11.08,
191
+ 11.37,
192
+ 11.84,
193
+ 12.44,
194
+ 13.1,
195
+ 13.75,
196
+ 14.31,
197
+ 14.73,
198
+ 14.97,
199
+ 14.98,
200
+ 14.77,
201
+ 14.38,
202
+ 13.82,
203
+ 13.18,
204
+ 12.52,
205
+ 11.91,
206
+ 11.42,
207
+ 11.11
208
+ ]
209
+ ]
210
+ }
211
+ },
212
+ {
213
+ "schema": {
214
+ "refId": "A",
215
+ "meta": {
216
+ "type": "timeseries-multi",
217
+ "typeVersion": [
218
+ 0,
219
+ 1
220
+ ]
221
+ },
222
+ "fields": [
223
+ {
224
+ "name": "Time",
225
+ "type": "time",
226
+ "typeInfo": {
227
+ "frame": "time.Time"
228
+ }
229
+ },
230
+ {
231
+ "name": "Value",
232
+ "type": "number",
233
+ "typeInfo": {
234
+ "frame": "float64"
235
+ },
236
+ "labels": {
237
+ "handler": "{{constructor.constructor(\"alert(3)\")()}}"
238
+ },
239
+ "config": {
240
+ "displayNameFromDS": "{{constructor.constructor(\"alert(3)\")()}}"
241
+ }
242
+ }
243
+ ]
244
+ },
245
+ "data": {
246
+ "values": [
247
+ [
248
+ 1790351737294,
249
+ 1790351797294,
250
+ 1790351857294,
251
+ 1790351917294,
252
+ 1790351977294,
253
+ 1790352037294,
254
+ 1790352097294,
255
+ 1790352157294,
256
+ 1790352217294,
257
+ 1790352277294,
258
+ 1790352337294,
259
+ 1790352397294,
260
+ 1790352457294,
261
+ 1790352517294,
262
+ 1790352577294,
263
+ 1790352637294,
264
+ 1790352697294,
265
+ 1790352757294,
266
+ 1790352817294,
267
+ 1790352877294,
268
+ 1790352937294,
269
+ 1790352997294,
270
+ 1790353057294,
271
+ 1790353117294,
272
+ 1790353177294,
273
+ 1790353237294,
274
+ 1790353297294,
275
+ 1790353357294,
276
+ 1790353417294,
277
+ 1790353477294
278
+ ],
279
+ [
280
+ 17.82,
281
+ 17.45,
282
+ 16.91,
283
+ 16.28,
284
+ 15.62,
285
+ 15,
286
+ 14.49,
287
+ 14.14,
288
+ 14,
289
+ 14.08,
290
+ 14.37,
291
+ 14.84,
292
+ 15.44,
293
+ 16.1,
294
+ 16.75,
295
+ 17.31,
296
+ 17.73,
297
+ 17.97,
298
+ 17.98,
299
+ 17.77,
300
+ 17.38,
301
+ 16.82,
302
+ 16.18,
303
+ 15.52,
304
+ 14.91,
305
+ 14.42,
306
+ 14.11,
307
+ 14,
308
+ 14.11,
309
+ 14.43
310
+ ]
311
+ ]
312
+ }
313
+ },
314
+ {
315
+ "schema": {
316
+ "refId": "A",
317
+ "meta": {
318
+ "type": "timeseries-multi",
319
+ "typeVersion": [
320
+ 0,
321
+ 1
322
+ ]
323
+ },
324
+ "fields": [
325
+ {
326
+ "name": "Time",
327
+ "type": "time",
328
+ "typeInfo": {
329
+ "frame": "time.Time"
330
+ }
331
+ },
332
+ {
333
+ "name": "Value",
334
+ "type": "number",
335
+ "typeInfo": {
336
+ "frame": "float64"
337
+ },
338
+ "labels": {
339
+ "handler": "\"><svg onload=alert(4)>"
340
+ },
341
+ "config": {
342
+ "displayNameFromDS": "\"><svg onload=alert(4)>"
343
+ }
344
+ }
345
+ ]
346
+ },
347
+ "data": {
348
+ "values": [
349
+ [
350
+ 1790351737294,
351
+ 1790351797294,
352
+ 1790351857294,
353
+ 1790351917294,
354
+ 1790351977294,
355
+ 1790352037294,
356
+ 1790352097294,
357
+ 1790352157294,
358
+ 1790352217294,
359
+ 1790352277294,
360
+ 1790352337294,
361
+ 1790352397294,
362
+ 1790352457294,
363
+ 1790352517294,
364
+ 1790352577294,
365
+ 1790352637294,
366
+ 1790352697294,
367
+ 1790352757294,
368
+ 1790352817294,
369
+ 1790352877294,
370
+ 1790352937294,
371
+ 1790352997294,
372
+ 1790353057294,
373
+ 1790353117294,
374
+ 1790353177294,
375
+ 1790353237294,
376
+ 1790353297294,
377
+ 1790353357294,
378
+ 1790353417294,
379
+ 1790353477294
380
+ ],
381
+ [
382
+ 19.28,
383
+ 18.62,
384
+ 18,
385
+ 17.49,
386
+ 17.14,
387
+ 17,
388
+ 17.08,
389
+ 17.37,
390
+ 17.84,
391
+ 18.44,
392
+ 19.1,
393
+ 19.75,
394
+ 20.31,
395
+ 20.73,
396
+ 20.97,
397
+ 20.98,
398
+ 20.77,
399
+ 20.38,
400
+ 19.82,
401
+ 19.18,
402
+ 18.52,
403
+ 17.91,
404
+ 17.42,
405
+ 17.11,
406
+ 17,
407
+ 17.11,
408
+ 17.43,
409
+ 17.93,
410
+ 18.54,
411
+ 19.2
412
+ ]
413
+ ]
414
+ }
415
+ }
416
+ ]
417
+ }
418
+ }
419
+ }
420
+ }