@perses-dev/prometheus-plugin 0.50.3 → 0.51.0-beta.2

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 (434) hide show
  1. package/LICENSE +183 -183
  2. package/README.md +41 -0
  3. package/__mf/css/async/2341.dacad691.css +1 -0
  4. package/__mf/css/async/5263.dacad691.css +1 -0
  5. package/__mf/css/async/6759.dacad691.css +1 -0
  6. package/__mf/font/lato-all-300-normal.322bdf14.woff +0 -0
  7. package/__mf/font/lato-all-400-normal.63513b00.woff +0 -0
  8. package/__mf/font/lato-all-700-normal.bb27db94.woff +0 -0
  9. package/__mf/font/lato-all-900-normal.a27049a3.woff +0 -0
  10. package/__mf/font/lato-latin-300-normal.c5195215.woff2 +0 -0
  11. package/__mf/font/lato-latin-400-normal.b7ffde23.woff2 +0 -0
  12. package/__mf/font/lato-latin-700-normal.d5eb20bc.woff2 +0 -0
  13. package/__mf/font/lato-latin-900-normal.d884a71c.woff2 +0 -0
  14. package/__mf/font/lato-latin-ext-300-normal.abcc64a9.woff2 +0 -0
  15. package/__mf/font/lato-latin-ext-400-normal.6ebed106.woff2 +0 -0
  16. package/__mf/font/lato-latin-ext-700-normal.8697d1d5.woff2 +0 -0
  17. package/__mf/font/lato-latin-ext-900-normal.20a2b415.woff2 +0 -0
  18. package/__mf/js/622.f7592106.js +5 -0
  19. package/__mf/js/Prometheus.328aad7c.js +5 -0
  20. package/__mf/js/async/1465.3b5e12d5.js +1 -0
  21. package/__mf/js/async/1495.6c8b8071.js +1 -0
  22. package/__mf/js/async/1620.6376bd14.js +2 -0
  23. package/__mf/js/async/1620.6376bd14.js.LICENSE.txt +9 -0
  24. package/__mf/js/async/1864.df7c4beb.js +1 -0
  25. package/__mf/js/async/1950.704c331e.js +1 -0
  26. package/__mf/js/async/1964.95da06f6.js +2 -0
  27. package/__mf/js/async/1964.95da06f6.js.LICENSE.txt +9 -0
  28. package/__mf/js/async/1996.01084c88.js +2 -0
  29. package/__mf/js/async/1996.01084c88.js.LICENSE.txt +24 -0
  30. package/__mf/js/async/212.bd5d617a.js +1 -0
  31. package/__mf/js/async/2316.fec4907a.js +1 -0
  32. package/__mf/js/async/232.f3523a60.js +1 -0
  33. package/__mf/js/async/2569.daf868a6.js +10 -0
  34. package/__mf/js/async/2569.daf868a6.js.LICENSE.txt +27 -0
  35. package/__mf/js/async/2675.c3b73822.js +1 -0
  36. package/__mf/js/async/3224.23f0dccf.js +1 -0
  37. package/__mf/js/async/3355.a4dbcdb0.js +1 -0
  38. package/__mf/js/async/3436.97c926a4.js +1 -0
  39. package/__mf/js/async/3818.dde21d04.js +1 -0
  40. package/__mf/js/async/3871.6915e369.js +1 -0
  41. package/__mf/js/async/3960.129d5ef5.js +2 -0
  42. package/__mf/js/async/3960.129d5ef5.js.LICENSE.txt +8 -0
  43. package/__mf/js/async/4075.b77ca1c7.js +1 -0
  44. package/__mf/js/async/4238.8e4d29d5.js +1 -0
  45. package/__mf/js/async/4323.4266fd6a.js +1 -0
  46. package/__mf/js/async/4421.1bcc1637.js +1 -0
  47. package/__mf/js/async/4489.3361e7bc.js +29 -0
  48. package/__mf/js/async/4489.3361e7bc.js.LICENSE.txt +59 -0
  49. package/__mf/js/async/5214.027c4332.js +1 -0
  50. package/__mf/js/async/5345.8c2e4b4a.js +1 -0
  51. package/__mf/js/async/537.6911ea2e.js +1 -0
  52. package/__mf/js/async/5387.fd6e16d6.js +1 -0
  53. package/__mf/js/async/5654.ecb41aea.js +38 -0
  54. package/__mf/js/async/5724.6ee6ec51.js +1 -0
  55. package/__mf/js/async/5774.9b0b6be1.js +1 -0
  56. package/__mf/js/async/5790.2273e061.js +1 -0
  57. package/__mf/js/async/5913.9d30fd07.js +73 -0
  58. package/__mf/js/async/5913.9d30fd07.js.LICENSE.txt +19 -0
  59. package/__mf/js/async/5914.bd342d22.js +74 -0
  60. package/__mf/js/async/5981.40bed0d0.js +2 -0
  61. package/__mf/js/async/5981.40bed0d0.js.LICENSE.txt +8 -0
  62. package/__mf/js/async/6292.7b8efa78.js +1 -0
  63. package/__mf/js/async/6333.865a46e0.js +2 -0
  64. package/__mf/js/async/6333.865a46e0.js.LICENSE.txt +9 -0
  65. package/__mf/js/async/6377.ca974d89.js +2 -0
  66. package/__mf/js/async/6377.ca974d89.js.LICENSE.txt +32 -0
  67. package/__mf/js/async/6770.adb1c939.js +1 -0
  68. package/__mf/js/async/684.ca510333.js +1 -0
  69. package/__mf/js/async/694.f861d67c.js +1 -0
  70. package/__mf/js/async/7272.a763aa92.js +1 -0
  71. package/__mf/js/async/738.aca54e25.js +1 -0
  72. package/__mf/js/async/7740.0c5363fd.js +1 -0
  73. package/__mf/js/async/8265.b9e2c31e.js +1 -0
  74. package/__mf/js/async/8488.5237550f.js +1 -0
  75. package/__mf/js/async/8587.4891ea90.js +1 -0
  76. package/__mf/js/async/8610.8300df79.js +1 -0
  77. package/__mf/js/async/87.fdc843ac.js +1 -0
  78. package/__mf/js/async/8930.9fbbc975.js +1 -0
  79. package/__mf/js/async/8997.18901f45.js +28 -0
  80. package/__mf/js/async/9173.e8fbead5.js +2 -0
  81. package/__mf/js/async/9173.e8fbead5.js.LICENSE.txt +19 -0
  82. package/__mf/js/async/__federation_expose_PrometheusDatasource.f6f57299.js +1 -0
  83. package/__mf/js/async/__federation_expose_PrometheusExplorer.5fcf955a.js +1 -0
  84. package/__mf/js/async/__federation_expose_PrometheusLabelNamesVariable.86d0ad5a.js +1 -0
  85. package/__mf/js/async/__federation_expose_PrometheusLabelValuesVariable.b2893484.js +1 -0
  86. package/__mf/js/async/__federation_expose_PrometheusPromQLVariable.cd16f6e8.js +1 -0
  87. package/__mf/js/async/__federation_expose_PrometheusTimeSeriesQuery.eb9eefa6.js +1 -0
  88. package/__mf/js/main.154a5b65.js +1 -0
  89. package/lib/bootstrap.d.ts +2 -0
  90. package/lib/bootstrap.d.ts.map +1 -0
  91. package/lib/bootstrap.js +19 -0
  92. package/lib/bootstrap.js.map +1 -0
  93. package/lib/cjs/bootstrap.js +26 -0
  94. package/{dist → lib}/cjs/components/PromQLEditor.js +9 -7
  95. package/lib/cjs/components/TreeNode.js +492 -0
  96. package/{dist → lib}/cjs/components/promql/ast.js +21 -21
  97. package/lib/cjs/components/promql/functionSignatures.js +651 -0
  98. package/lib/cjs/components/promql/serialize.js +88 -0
  99. package/{dist → lib}/cjs/components/promql/utils.js +12 -1
  100. package/{dist/cjs/components/parse.js → lib/cjs/components/query.js} +37 -4
  101. package/lib/cjs/env.d.js +14 -0
  102. package/lib/cjs/explore/PrometheusExplorer.js +203 -0
  103. package/lib/cjs/explore/PrometheusMetricsFinder/PrometheusMetricsFinder.js +268 -0
  104. package/lib/cjs/explore/PrometheusMetricsFinder/display/MetricChip.js +61 -0
  105. package/lib/cjs/explore/PrometheusMetricsFinder/display/list/MetricList.js +179 -0
  106. package/lib/cjs/explore/PrometheusMetricsFinder/filter/FilterInputs.js +231 -0
  107. package/lib/cjs/explore/PrometheusMetricsFinder/filter/FinderFilters.js +97 -0
  108. package/{dist/cjs/plugins/prometheus-time-series-query → lib/cjs/explore/PrometheusMetricsFinder}/index.js +1 -1
  109. package/lib/cjs/explore/PrometheusMetricsFinder/overview/MetricOverview.js +235 -0
  110. package/lib/cjs/explore/PrometheusMetricsFinder/overview/tabs/JobTab.js +144 -0
  111. package/lib/cjs/explore/PrometheusMetricsFinder/overview/tabs/OverviewTab.js +423 -0
  112. package/lib/cjs/explore/PrometheusMetricsFinder/overview/tabs/SimilarTab.js +53 -0
  113. package/lib/cjs/explore/PrometheusMetricsFinder/types.js +25 -0
  114. package/lib/cjs/explore/PrometheusMetricsFinder/utils.js +203 -0
  115. package/lib/cjs/explore/index.js +19 -0
  116. package/lib/cjs/getPluginModule.js +27 -0
  117. package/lib/cjs/index-federation.js +55 -0
  118. package/lib/cjs/index.js +28 -0
  119. package/{dist → lib}/cjs/model/api-types.js +1 -1
  120. package/{dist → lib}/cjs/model/prometheus-client.js +1 -1
  121. package/lib/cjs/plugins/PrometheusDatasourceEditor.js +109 -0
  122. package/lib/cjs/plugins/PrometheusLabelNamesVariable.js +34 -0
  123. package/lib/cjs/plugins/PrometheusLabelValuesVariable.js +38 -0
  124. package/lib/cjs/plugins/PrometheusPromQLVariable.js +42 -0
  125. package/lib/cjs/plugins/index.js +26 -0
  126. package/{dist → lib}/cjs/plugins/prometheus-datasource.js +9 -9
  127. package/{dist → lib}/cjs/plugins/prometheus-time-series-query/PrometheusTimeSeriesQueryEditor.js +11 -9
  128. package/{dist → lib}/cjs/plugins/prometheus-time-series-query/get-time-series-data.js +51 -29
  129. package/lib/cjs/plugins/prometheus-time-series-query/index.js +35 -0
  130. package/{dist → lib}/cjs/plugins/prometheus-variables.js +25 -101
  131. package/{dist → lib}/cjs/plugins/variable.js +1 -2
  132. package/lib/cjs/setup-tests.js +19 -0
  133. package/{dist → lib}/cjs/utils/utils.js +1 -2
  134. package/lib/components/PromQLEditor.d.ts.map +1 -0
  135. package/{dist → lib}/components/PromQLEditor.js +9 -7
  136. package/lib/components/PromQLEditor.js.map +1 -0
  137. package/lib/components/TreeNode.d.ts +15 -0
  138. package/lib/components/TreeNode.d.ts.map +1 -0
  139. package/lib/components/TreeNode.js +479 -0
  140. package/lib/components/TreeNode.js.map +1 -0
  141. package/lib/components/index.d.ts.map +1 -0
  142. package/lib/components/index.js.map +1 -0
  143. package/lib/components/promql/ast.d.ts.map +1 -0
  144. package/{dist → lib}/components/promql/ast.js +21 -21
  145. package/lib/components/promql/ast.js.map +1 -0
  146. package/{dist → lib}/components/promql/format.d.ts +1 -1
  147. package/lib/components/promql/format.d.ts.map +1 -0
  148. package/lib/components/promql/format.js.map +1 -0
  149. package/lib/components/promql/functionSignatures.d.ts +3 -0
  150. package/lib/components/promql/functionSignatures.d.ts.map +1 -0
  151. package/lib/components/promql/functionSignatures.js +643 -0
  152. package/lib/components/promql/functionSignatures.js.map +1 -0
  153. package/lib/components/promql/serialize.d.ts +4 -0
  154. package/lib/components/promql/serialize.d.ts.map +1 -0
  155. package/lib/components/promql/serialize.js +80 -0
  156. package/lib/components/promql/serialize.js.map +1 -0
  157. package/{dist → lib}/components/promql/utils.d.ts +1 -0
  158. package/lib/components/promql/utils.d.ts.map +1 -0
  159. package/{dist → lib}/components/promql/utils.js +9 -1
  160. package/lib/components/promql/utils.js.map +1 -0
  161. package/lib/components/query.d.ts +6 -0
  162. package/lib/components/query.d.ts.map +1 -0
  163. package/{dist/components/parse.js → lib/components/query.js} +27 -2
  164. package/lib/components/query.js.map +1 -0
  165. package/lib/env.d.js +15 -0
  166. package/lib/env.d.js.map +1 -0
  167. package/lib/explore/PrometheusExplorer.d.ts +3 -0
  168. package/lib/explore/PrometheusExplorer.d.ts.map +1 -0
  169. package/lib/explore/PrometheusExplorer.js +190 -0
  170. package/lib/explore/PrometheusExplorer.js.map +1 -0
  171. package/lib/explore/PrometheusMetricsFinder/PrometheusMetricsFinder.d.ts +31 -0
  172. package/lib/explore/PrometheusMetricsFinder/PrometheusMetricsFinder.d.ts.map +1 -0
  173. package/lib/explore/PrometheusMetricsFinder/PrometheusMetricsFinder.js +244 -0
  174. package/lib/explore/PrometheusMetricsFinder/PrometheusMetricsFinder.js.map +1 -0
  175. package/lib/explore/PrometheusMetricsFinder/display/MetricChip.d.ts +4 -0
  176. package/lib/explore/PrometheusMetricsFinder/display/MetricChip.d.ts.map +1 -0
  177. package/lib/explore/PrometheusMetricsFinder/display/MetricChip.js +53 -0
  178. package/lib/explore/PrometheusMetricsFinder/display/MetricChip.js.map +1 -0
  179. package/lib/explore/PrometheusMetricsFinder/display/list/MetricList.d.ts +27 -0
  180. package/lib/explore/PrometheusMetricsFinder/display/list/MetricList.d.ts.map +1 -0
  181. package/lib/explore/PrometheusMetricsFinder/display/list/MetricList.js +158 -0
  182. package/lib/explore/PrometheusMetricsFinder/display/list/MetricList.js.map +1 -0
  183. package/lib/explore/PrometheusMetricsFinder/filter/FilterInputs.d.ts +23 -0
  184. package/lib/explore/PrometheusMetricsFinder/filter/FilterInputs.d.ts.map +1 -0
  185. package/lib/explore/PrometheusMetricsFinder/filter/FilterInputs.js +209 -0
  186. package/lib/explore/PrometheusMetricsFinder/filter/FilterInputs.js.map +1 -0
  187. package/lib/explore/PrometheusMetricsFinder/filter/FinderFilters.d.ts +13 -0
  188. package/lib/explore/PrometheusMetricsFinder/filter/FinderFilters.d.ts.map +1 -0
  189. package/lib/explore/PrometheusMetricsFinder/filter/FinderFilters.js +84 -0
  190. package/lib/explore/PrometheusMetricsFinder/filter/FinderFilters.js.map +1 -0
  191. package/lib/explore/PrometheusMetricsFinder/index.d.ts +2 -0
  192. package/lib/explore/PrometheusMetricsFinder/index.d.ts.map +1 -0
  193. package/{dist/model/api-types.js → lib/explore/PrometheusMetricsFinder/index.js} +2 -2
  194. package/lib/explore/PrometheusMetricsFinder/index.js.map +1 -0
  195. package/lib/explore/PrometheusMetricsFinder/overview/MetricOverview.d.ts +23 -0
  196. package/lib/explore/PrometheusMetricsFinder/overview/MetricOverview.d.ts.map +1 -0
  197. package/lib/explore/PrometheusMetricsFinder/overview/MetricOverview.js +214 -0
  198. package/lib/explore/PrometheusMetricsFinder/overview/MetricOverview.js.map +1 -0
  199. package/lib/explore/PrometheusMetricsFinder/overview/tabs/JobTab.d.ts +28 -0
  200. package/lib/explore/PrometheusMetricsFinder/overview/tabs/JobTab.d.ts.map +1 -0
  201. package/lib/explore/PrometheusMetricsFinder/overview/tabs/JobTab.js +125 -0
  202. package/lib/explore/PrometheusMetricsFinder/overview/tabs/JobTab.js.map +1 -0
  203. package/lib/explore/PrometheusMetricsFinder/overview/tabs/OverviewTab.d.ts +25 -0
  204. package/lib/explore/PrometheusMetricsFinder/overview/tabs/OverviewTab.d.ts.map +1 -0
  205. package/lib/explore/PrometheusMetricsFinder/overview/tabs/OverviewTab.js +399 -0
  206. package/lib/explore/PrometheusMetricsFinder/overview/tabs/OverviewTab.js.map +1 -0
  207. package/lib/explore/PrometheusMetricsFinder/overview/tabs/SimilarTab.d.ts +12 -0
  208. package/lib/explore/PrometheusMetricsFinder/overview/tabs/SimilarTab.d.ts.map +1 -0
  209. package/lib/explore/PrometheusMetricsFinder/overview/tabs/SimilarTab.js +45 -0
  210. package/lib/explore/PrometheusMetricsFinder/overview/tabs/SimilarTab.js.map +1 -0
  211. package/lib/explore/PrometheusMetricsFinder/types.d.ts +22 -0
  212. package/lib/explore/PrometheusMetricsFinder/types.d.ts.map +1 -0
  213. package/lib/explore/PrometheusMetricsFinder/types.js +17 -0
  214. package/lib/explore/PrometheusMetricsFinder/types.js.map +1 -0
  215. package/lib/explore/PrometheusMetricsFinder/utils.d.ts +22 -0
  216. package/lib/explore/PrometheusMetricsFinder/utils.d.ts.map +1 -0
  217. package/lib/explore/PrometheusMetricsFinder/utils.js +185 -0
  218. package/lib/explore/PrometheusMetricsFinder/utils.js.map +1 -0
  219. package/lib/explore/index.d.ts +3 -0
  220. package/lib/explore/index.d.ts.map +1 -0
  221. package/lib/explore/index.js +4 -0
  222. package/lib/explore/index.js.map +1 -0
  223. package/lib/getPluginModule.d.ts +6 -0
  224. package/lib/getPluginModule.d.ts.map +1 -0
  225. package/lib/getPluginModule.js +16 -0
  226. package/lib/getPluginModule.js.map +1 -0
  227. package/lib/index-federation.d.ts +1 -0
  228. package/lib/index-federation.d.ts.map +1 -0
  229. package/lib/index-federation.js +15 -0
  230. package/{dist/components/index.js.map → lib/index-federation.js.map} +1 -1
  231. package/lib/index.d.ts +6 -0
  232. package/lib/index.d.ts.map +1 -0
  233. package/lib/index.js +7 -0
  234. package/lib/index.js.map +1 -0
  235. package/{dist → lib}/model/api-types.d.ts +18 -1
  236. package/lib/model/api-types.d.ts.map +1 -0
  237. package/{dist/plugins/prometheus-time-series-query/index.js → lib/model/api-types.js} +3 -3
  238. package/lib/model/api-types.js.map +1 -0
  239. package/lib/model/index.d.ts.map +1 -0
  240. package/lib/model/index.js.map +1 -0
  241. package/lib/model/parse-sample-values.d.ts.map +1 -0
  242. package/lib/model/parse-sample-values.js.map +1 -0
  243. package/lib/model/prometheus-client.d.ts.map +1 -0
  244. package/{dist → lib}/model/prometheus-client.js +1 -1
  245. package/lib/model/prometheus-client.js.map +1 -0
  246. package/lib/model/prometheus-selectors.d.ts.map +1 -0
  247. package/lib/model/prometheus-selectors.js.map +1 -0
  248. package/lib/model/time.d.ts.map +1 -0
  249. package/lib/model/time.js.map +1 -0
  250. package/lib/plugins/MatcherEditor.d.ts.map +1 -0
  251. package/lib/plugins/MatcherEditor.js.map +1 -0
  252. package/lib/plugins/PrometheusDatasourceEditor.d.ts.map +1 -0
  253. package/lib/plugins/PrometheusDatasourceEditor.js +96 -0
  254. package/lib/plugins/PrometheusDatasourceEditor.js.map +1 -0
  255. package/lib/plugins/PrometheusLabelNamesVariable.d.ts +4 -0
  256. package/lib/plugins/PrometheusLabelNamesVariable.d.ts.map +1 -0
  257. package/lib/plugins/PrometheusLabelNamesVariable.js +26 -0
  258. package/lib/plugins/PrometheusLabelNamesVariable.js.map +1 -0
  259. package/lib/plugins/PrometheusLabelValuesVariable.d.ts +4 -0
  260. package/lib/plugins/PrometheusLabelValuesVariable.d.ts.map +1 -0
  261. package/lib/plugins/PrometheusLabelValuesVariable.js +30 -0
  262. package/lib/plugins/PrometheusLabelValuesVariable.js.map +1 -0
  263. package/lib/plugins/PrometheusPromQLVariable.d.ts +4 -0
  264. package/lib/plugins/PrometheusPromQLVariable.d.ts.map +1 -0
  265. package/lib/plugins/PrometheusPromQLVariable.js +34 -0
  266. package/lib/plugins/PrometheusPromQLVariable.js.map +1 -0
  267. package/lib/plugins/index.d.ts +10 -0
  268. package/lib/plugins/index.d.ts.map +1 -0
  269. package/lib/plugins/index.js +11 -0
  270. package/lib/plugins/index.js.map +1 -0
  271. package/lib/plugins/prometheus-datasource.d.ts.map +1 -0
  272. package/{dist → lib}/plugins/prometheus-datasource.js +9 -9
  273. package/lib/plugins/prometheus-datasource.js.map +1 -0
  274. package/lib/plugins/prometheus-time-series-query/PrometheusTimeSeriesQuery.d.ts.map +1 -0
  275. package/lib/plugins/prometheus-time-series-query/PrometheusTimeSeriesQuery.js.map +1 -0
  276. package/lib/plugins/prometheus-time-series-query/PrometheusTimeSeriesQueryEditor.d.ts.map +1 -0
  277. package/{dist → lib}/plugins/prometheus-time-series-query/PrometheusTimeSeriesQueryEditor.js +9 -7
  278. package/lib/plugins/prometheus-time-series-query/PrometheusTimeSeriesQueryEditor.js.map +1 -0
  279. package/lib/plugins/prometheus-time-series-query/get-time-series-data.d.ts.map +1 -0
  280. package/{dist → lib}/plugins/prometheus-time-series-query/get-time-series-data.js +51 -29
  281. package/lib/plugins/prometheus-time-series-query/get-time-series-data.js.map +1 -0
  282. package/lib/plugins/prometheus-time-series-query/index.d.ts +7 -0
  283. package/lib/plugins/prometheus-time-series-query/index.d.ts.map +1 -0
  284. package/lib/plugins/prometheus-time-series-query/index.js +20 -0
  285. package/lib/plugins/prometheus-time-series-query/index.js.map +1 -0
  286. package/lib/plugins/prometheus-time-series-query/query-editor-model.d.ts.map +1 -0
  287. package/lib/plugins/prometheus-time-series-query/query-editor-model.js.map +1 -0
  288. package/lib/plugins/prometheus-time-series-query/replace-prom-builtin-variables.d.ts.map +1 -0
  289. package/lib/plugins/prometheus-time-series-query/replace-prom-builtin-variables.js.map +1 -0
  290. package/lib/plugins/prometheus-time-series-query/time-series-query-model.d.ts.map +1 -0
  291. package/lib/plugins/prometheus-time-series-query/time-series-query-model.js.map +1 -0
  292. package/lib/plugins/prometheus-variables.d.ts +14 -0
  293. package/lib/plugins/prometheus-variables.d.ts.map +1 -0
  294. package/{dist → lib}/plugins/prometheus-variables.js +15 -98
  295. package/lib/plugins/prometheus-variables.js.map +1 -0
  296. package/lib/plugins/types.d.ts.map +1 -0
  297. package/lib/plugins/types.js.map +1 -0
  298. package/lib/plugins/variable.d.ts.map +1 -0
  299. package/{dist → lib}/plugins/variable.js +1 -2
  300. package/lib/plugins/variable.js.map +1 -0
  301. package/lib/setup-tests.d.ts +2 -0
  302. package/lib/setup-tests.d.ts.map +1 -0
  303. package/lib/setup-tests.js +17 -0
  304. package/{dist/utils/index.js.map → lib/setup-tests.js.map} +1 -1
  305. package/lib/test/setup-tests.d.ts.map +1 -0
  306. package/lib/test/setup-tests.js.map +1 -0
  307. package/lib/utils/index.d.ts.map +1 -0
  308. package/lib/utils/index.js.map +1 -0
  309. package/lib/utils/utils.d.ts.map +1 -0
  310. package/{dist → lib}/utils/utils.js +1 -2
  311. package/lib/utils/utils.js.map +1 -0
  312. package/mf-manifest.json +898 -0
  313. package/mf-stats.json +1004 -0
  314. package/package.json +99 -38
  315. package/dist/cjs/components/TreeNode.js +0 -147
  316. package/dist/cjs/index.js +0 -61
  317. package/dist/cjs/plugins/PrometheusDatasourceEditor.js +0 -626
  318. package/dist/components/PromQLEditor.d.ts.map +0 -1
  319. package/dist/components/PromQLEditor.js.map +0 -1
  320. package/dist/components/TreeNode.d.ts +0 -10
  321. package/dist/components/TreeNode.d.ts.map +0 -1
  322. package/dist/components/TreeNode.js +0 -139
  323. package/dist/components/TreeNode.js.map +0 -1
  324. package/dist/components/index.d.ts.map +0 -1
  325. package/dist/components/parse.d.ts +0 -5
  326. package/dist/components/parse.d.ts.map +0 -1
  327. package/dist/components/parse.js.map +0 -1
  328. package/dist/components/promql/ast.d.ts.map +0 -1
  329. package/dist/components/promql/ast.js.map +0 -1
  330. package/dist/components/promql/format.d.ts.map +0 -1
  331. package/dist/components/promql/format.js.map +0 -1
  332. package/dist/components/promql/utils.d.ts.map +0 -1
  333. package/dist/components/promql/utils.js.map +0 -1
  334. package/dist/index.d.ts +0 -8
  335. package/dist/index.d.ts.map +0 -1
  336. package/dist/index.js +0 -24
  337. package/dist/index.js.map +0 -1
  338. package/dist/model/api-types.d.ts.map +0 -1
  339. package/dist/model/api-types.js.map +0 -1
  340. package/dist/model/index.d.ts.map +0 -1
  341. package/dist/model/index.js.map +0 -1
  342. package/dist/model/parse-sample-values.d.ts.map +0 -1
  343. package/dist/model/parse-sample-values.js.map +0 -1
  344. package/dist/model/prometheus-client.d.ts.map +0 -1
  345. package/dist/model/prometheus-client.js.map +0 -1
  346. package/dist/model/prometheus-selectors.d.ts.map +0 -1
  347. package/dist/model/prometheus-selectors.js.map +0 -1
  348. package/dist/model/time.d.ts.map +0 -1
  349. package/dist/model/time.js.map +0 -1
  350. package/dist/plugins/MatcherEditor.d.ts.map +0 -1
  351. package/dist/plugins/MatcherEditor.js.map +0 -1
  352. package/dist/plugins/PrometheusDatasourceEditor.d.ts.map +0 -1
  353. package/dist/plugins/PrometheusDatasourceEditor.js +0 -572
  354. package/dist/plugins/PrometheusDatasourceEditor.js.map +0 -1
  355. package/dist/plugins/prometheus-datasource.d.ts.map +0 -1
  356. package/dist/plugins/prometheus-datasource.js.map +0 -1
  357. package/dist/plugins/prometheus-time-series-query/PrometheusTimeSeriesQuery.d.ts.map +0 -1
  358. package/dist/plugins/prometheus-time-series-query/PrometheusTimeSeriesQuery.js.map +0 -1
  359. package/dist/plugins/prometheus-time-series-query/PrometheusTimeSeriesQueryEditor.d.ts.map +0 -1
  360. package/dist/plugins/prometheus-time-series-query/PrometheusTimeSeriesQueryEditor.js.map +0 -1
  361. package/dist/plugins/prometheus-time-series-query/get-time-series-data.d.ts.map +0 -1
  362. package/dist/plugins/prometheus-time-series-query/get-time-series-data.js.map +0 -1
  363. package/dist/plugins/prometheus-time-series-query/index.d.ts +0 -2
  364. package/dist/plugins/prometheus-time-series-query/index.d.ts.map +0 -1
  365. package/dist/plugins/prometheus-time-series-query/index.js.map +0 -1
  366. package/dist/plugins/prometheus-time-series-query/query-editor-model.d.ts.map +0 -1
  367. package/dist/plugins/prometheus-time-series-query/query-editor-model.js.map +0 -1
  368. package/dist/plugins/prometheus-time-series-query/replace-prom-builtin-variables.d.ts.map +0 -1
  369. package/dist/plugins/prometheus-time-series-query/replace-prom-builtin-variables.js.map +0 -1
  370. package/dist/plugins/prometheus-time-series-query/time-series-query-model.d.ts.map +0 -1
  371. package/dist/plugins/prometheus-time-series-query/time-series-query-model.js.map +0 -1
  372. package/dist/plugins/prometheus-variables.d.ts +0 -6
  373. package/dist/plugins/prometheus-variables.d.ts.map +0 -1
  374. package/dist/plugins/prometheus-variables.js.map +0 -1
  375. package/dist/plugins/types.d.ts.map +0 -1
  376. package/dist/plugins/types.js.map +0 -1
  377. package/dist/plugins/variable.d.ts.map +0 -1
  378. package/dist/plugins/variable.js.map +0 -1
  379. package/dist/test/setup-tests.d.ts.map +0 -1
  380. package/dist/test/setup-tests.js.map +0 -1
  381. package/dist/utils/index.d.ts.map +0 -1
  382. package/dist/utils/utils.d.ts.map +0 -1
  383. package/dist/utils/utils.js.map +0 -1
  384. package/plugin.json +0 -58
  385. /package/{dist → lib}/cjs/components/index.js +0 -0
  386. /package/{dist → lib}/cjs/components/promql/format.js +0 -0
  387. /package/{dist → lib}/cjs/model/index.js +0 -0
  388. /package/{dist → lib}/cjs/model/parse-sample-values.js +0 -0
  389. /package/{dist → lib}/cjs/model/prometheus-selectors.js +0 -0
  390. /package/{dist → lib}/cjs/model/time.js +0 -0
  391. /package/{dist → lib}/cjs/plugins/MatcherEditor.js +0 -0
  392. /package/{dist → lib}/cjs/plugins/prometheus-time-series-query/PrometheusTimeSeriesQuery.js +0 -0
  393. /package/{dist → lib}/cjs/plugins/prometheus-time-series-query/query-editor-model.js +0 -0
  394. /package/{dist → lib}/cjs/plugins/prometheus-time-series-query/replace-prom-builtin-variables.js +0 -0
  395. /package/{dist → lib}/cjs/plugins/prometheus-time-series-query/time-series-query-model.js +0 -0
  396. /package/{dist → lib}/cjs/plugins/types.js +0 -0
  397. /package/{dist → lib}/cjs/test/setup-tests.js +0 -0
  398. /package/{dist → lib}/cjs/utils/index.js +0 -0
  399. /package/{dist → lib}/components/PromQLEditor.d.ts +0 -0
  400. /package/{dist → lib}/components/index.d.ts +0 -0
  401. /package/{dist → lib}/components/index.js +0 -0
  402. /package/{dist → lib}/components/promql/ast.d.ts +0 -0
  403. /package/{dist → lib}/components/promql/format.js +0 -0
  404. /package/{dist → lib}/model/index.d.ts +0 -0
  405. /package/{dist → lib}/model/index.js +0 -0
  406. /package/{dist → lib}/model/parse-sample-values.d.ts +0 -0
  407. /package/{dist → lib}/model/parse-sample-values.js +0 -0
  408. /package/{dist → lib}/model/prometheus-client.d.ts +0 -0
  409. /package/{dist → lib}/model/prometheus-selectors.d.ts +0 -0
  410. /package/{dist → lib}/model/prometheus-selectors.js +0 -0
  411. /package/{dist → lib}/model/time.d.ts +0 -0
  412. /package/{dist → lib}/model/time.js +0 -0
  413. /package/{dist → lib}/plugins/MatcherEditor.d.ts +0 -0
  414. /package/{dist → lib}/plugins/MatcherEditor.js +0 -0
  415. /package/{dist → lib}/plugins/PrometheusDatasourceEditor.d.ts +0 -0
  416. /package/{dist → lib}/plugins/prometheus-datasource.d.ts +0 -0
  417. /package/{dist → lib}/plugins/prometheus-time-series-query/PrometheusTimeSeriesQuery.d.ts +0 -0
  418. /package/{dist → lib}/plugins/prometheus-time-series-query/PrometheusTimeSeriesQuery.js +0 -0
  419. /package/{dist → lib}/plugins/prometheus-time-series-query/PrometheusTimeSeriesQueryEditor.d.ts +0 -0
  420. /package/{dist → lib}/plugins/prometheus-time-series-query/get-time-series-data.d.ts +0 -0
  421. /package/{dist → lib}/plugins/prometheus-time-series-query/query-editor-model.d.ts +0 -0
  422. /package/{dist → lib}/plugins/prometheus-time-series-query/query-editor-model.js +0 -0
  423. /package/{dist → lib}/plugins/prometheus-time-series-query/replace-prom-builtin-variables.d.ts +0 -0
  424. /package/{dist → lib}/plugins/prometheus-time-series-query/replace-prom-builtin-variables.js +0 -0
  425. /package/{dist → lib}/plugins/prometheus-time-series-query/time-series-query-model.d.ts +0 -0
  426. /package/{dist → lib}/plugins/prometheus-time-series-query/time-series-query-model.js +0 -0
  427. /package/{dist → lib}/plugins/types.d.ts +0 -0
  428. /package/{dist → lib}/plugins/types.js +0 -0
  429. /package/{dist → lib}/plugins/variable.d.ts +0 -0
  430. /package/{dist → lib}/test/setup-tests.d.ts +0 -0
  431. /package/{dist → lib}/test/setup-tests.js +0 -0
  432. /package/{dist → lib}/utils/index.d.ts +0 -0
  433. /package/{dist → lib}/utils/index.js +0 -0
  434. /package/{dist → lib}/utils/utils.d.ts +0 -0
@@ -0,0 +1,479 @@
1
+ // Copyright 2025 The Perses Authors
2
+ // Licensed under the Apache License, Version 2.0 (the "License");
3
+ // you may not use this file except in compliance with the License.
4
+ // You may obtain a copy of the License at
5
+ //
6
+ // http://www.apache.org/licenses/LICENSE-2.0
7
+ //
8
+ // Unless required by applicable law or agreed to in writing, software
9
+ // distributed under the License is distributed on an "AS IS" BASIS,
10
+ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11
+ // See the License for the specific language governing permissions and
12
+ // limitations under the License.
13
+ // Forked from https://github.com/prometheus/prometheus/blob/65f610353919b1c7b42d3776c3a95b68046a6bba/web/ui/mantine-ui/src/pages/query/TreeNode.tsx
14
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
15
+ import { Box, CircularProgress, List, ListItem, Stack, Tooltip, Typography, useTheme } from '@mui/material';
16
+ import CircleIcon from 'mdi-material-ui/Circle';
17
+ import { useCallback, useEffect, useLayoutEffect, useMemo, useState } from 'react';
18
+ import AlertCircle from 'mdi-material-ui/AlertCircle';
19
+ import { nodeType } from './promql/ast';
20
+ import { escapeString, getNodeChildren } from './promql/utils';
21
+ import { formatNode } from './promql/format';
22
+ import serializeNode from './promql/serialize';
23
+ import { functionSignatures } from './promql/functionSignatures';
24
+ import { useInstantQuery } from './query';
25
+ // The indentation factor for each level of the tree.
26
+ const nodeIndent = 5;
27
+ const connectorWidth = nodeIndent * 5;
28
+ // max number of label names and values to show in the individual query status
29
+ const maxLabelNames = 10;
30
+ const maxLabelValues = 10;
31
+ // mergeChildStates basically returns the "worst" state found among the children.
32
+ const mergeChildStates = (states)=>{
33
+ if (states.includes('error')) {
34
+ return 'error';
35
+ }
36
+ if (states.includes('waiting')) {
37
+ return 'waiting';
38
+ }
39
+ if (states.includes('running')) {
40
+ return 'running';
41
+ }
42
+ return 'success';
43
+ };
44
+ export default function TreeNode({ node, parentEl, reverse, datasource, childIdx, reportNodeState }) {
45
+ const theme = useTheme();
46
+ const children = getNodeChildren(node);
47
+ // A normal ref won't work properly here because the ref's `current` property
48
+ // going from `null` to defined won't trigger a re-render of the child
49
+ // component, since it's not a React state update. So we manually have to
50
+ // create a state update using a callback ref. See also
51
+ // https://tkdodo.eu/blog/avoiding-use-effect-with-callback-refs
52
+ const [nodeEl, setNodeEl] = useState(null);
53
+ const nodeRef = useCallback((node)=>setNodeEl(node), []);
54
+ const [resultStats, setResultStats] = useState({
55
+ numSeries: 0,
56
+ labelExamples: {},
57
+ sortedLabelCards: []
58
+ });
59
+ const [connectorStyle, setConnectorStyle] = useState({
60
+ borderColor: theme.palette.grey['500'],
61
+ borderLeftStyle: 'solid',
62
+ borderLeftWidth: 2,
63
+ width: connectorWidth,
64
+ left: -connectorWidth
65
+ });
66
+ const [childStates, setChildStates] = useState(children.map(()=>'waiting'));
67
+ const mergedChildState = useMemo(()=>mergeChildStates(childStates), [
68
+ childStates
69
+ ]);
70
+ // Optimize range vector selector fetches to give us the info we're looking for
71
+ // more cheaply. E.g. 'foo[7w]' can be expensive to fully fetch, but wrapping it
72
+ // in 'last_over_time(foo[7w])' is cheaper and also gives us all the info we
73
+ // need (number of series and labels).
74
+ let queryNode = node;
75
+ if (queryNode.type === nodeType.matrixSelector) {
76
+ queryNode = {
77
+ type: nodeType.call,
78
+ func: functionSignatures.last_over_time,
79
+ args: [
80
+ node
81
+ ]
82
+ };
83
+ }
84
+ // Individual query for the current node
85
+ const { data: instantQueryResponse, isFetching, error } = useInstantQuery(serializeNode(queryNode) ?? '', datasource, mergedChildState === 'success');
86
+ // report the node state to the parent
87
+ useEffect(()=>{
88
+ if (reportNodeState) {
89
+ if (mergedChildState === 'error' || error) {
90
+ reportNodeState(childIdx, 'error');
91
+ } else if (isFetching) {
92
+ reportNodeState(childIdx, 'running');
93
+ }
94
+ }
95
+ }, [
96
+ mergedChildState,
97
+ error,
98
+ isFetching,
99
+ reportNodeState,
100
+ childIdx
101
+ ]);
102
+ // This function is passed down to the child nodes so they can report their state.
103
+ const childReportNodeState = useCallback((childIdx, state)=>{
104
+ setChildStates((prev)=>{
105
+ const newStates = [
106
+ ...prev
107
+ ];
108
+ newStates[childIdx] = state;
109
+ return newStates;
110
+ });
111
+ }, [
112
+ setChildStates
113
+ ]);
114
+ // Update the size and position of tree connector lines based on the node's and its parent's position.
115
+ useLayoutEffect(()=>{
116
+ if (parentEl === undefined) {
117
+ // We're the root node.
118
+ return;
119
+ }
120
+ if (parentEl === null || nodeEl === null) {
121
+ // Either of the two connected nodes hasn't been rendered yet.
122
+ return;
123
+ }
124
+ const parentRect = parentEl.getBoundingClientRect();
125
+ const nodeRect = nodeEl.getBoundingClientRect();
126
+ if (reverse) {
127
+ setConnectorStyle((prevStyle)=>({
128
+ ...prevStyle,
129
+ top: 'calc(50% - 1px)',
130
+ bottom: nodeRect.bottom - parentRect.top,
131
+ borderTopLeftRadius: 10,
132
+ borderTopStyle: 'solid',
133
+ borderBottomLeftRadius: undefined
134
+ }));
135
+ } else {
136
+ setConnectorStyle((prevStyle)=>({
137
+ ...prevStyle,
138
+ top: parentRect.bottom - nodeRect.top,
139
+ bottom: 'calc(50% - 1px)',
140
+ borderBottomLeftRadius: 10,
141
+ borderBottomStyle: 'solid',
142
+ borderTopLeftRadius: undefined
143
+ }));
144
+ }
145
+ }, [
146
+ parentEl,
147
+ nodeEl,
148
+ reverse,
149
+ nodeRef,
150
+ setConnectorStyle
151
+ ]);
152
+ // Update the node info state based on the query result.
153
+ useEffect(()=>{
154
+ if (instantQueryResponse?.status !== 'success') {
155
+ return;
156
+ }
157
+ if (reportNodeState) {
158
+ reportNodeState(childIdx, 'success');
159
+ }
160
+ let resultSeries = 0;
161
+ // labelValuesByName records the number of times each label value appears for each label name.
162
+ const labelValuesByName = {};
163
+ const { resultType, result } = instantQueryResponse.data;
164
+ if (resultType === 'scalar' || resultType === 'string') {
165
+ resultSeries = 1;
166
+ } else if (result && result.length > 0) {
167
+ resultSeries = result.length;
168
+ result.forEach((s)=>{
169
+ Object.entries(s.metric).forEach(([ln, lv])=>{
170
+ // TODO: If we ever want to include __name__ here again, we cannot use the
171
+ // last_over_time(foo[7d]) optimization since that removes the metric name.
172
+ if (ln !== '__name__') {
173
+ labelValuesByName[ln] = labelValuesByName[ln] ?? {};
174
+ labelValuesByName[ln][lv] = (labelValuesByName[ln][lv] ?? 0) + 1;
175
+ }
176
+ });
177
+ });
178
+ }
179
+ // labelCardinalities records the number of unique label values for each label name.
180
+ const labelCardinalities = {};
181
+ // labelExamples records the most common label values for each label name.
182
+ const labelExamples = {};
183
+ Object.entries(labelValuesByName).forEach(([ln, lvs])=>{
184
+ labelCardinalities[ln] = Object.keys(lvs).length;
185
+ // Sort label values by their number of occurrences within this label name.
186
+ labelExamples[ln] = Object.entries(lvs).sort(([, aCnt], [, bCnt])=>bCnt - aCnt).slice(0, maxLabelValues).map(([lv, cnt])=>({
187
+ value: lv,
188
+ count: cnt
189
+ }));
190
+ });
191
+ setResultStats({
192
+ numSeries: resultSeries,
193
+ sortedLabelCards: Object.entries(labelCardinalities).sort((a, b)=>b[1] - a[1]),
194
+ labelExamples
195
+ });
196
+ }, [
197
+ instantQueryResponse,
198
+ reportNodeState,
199
+ childIdx
200
+ ]);
201
+ const innerNode = /*#__PURE__*/ _jsxs(Stack, {
202
+ direction: "row",
203
+ gap: 2,
204
+ children: [
205
+ /*#__PURE__*/ _jsxs(Box, {
206
+ ref: nodeRef,
207
+ sx: {
208
+ position: 'relative',
209
+ display: 'inline-block',
210
+ padding: 1,
211
+ marginBottom: 1.5,
212
+ borderRadius: 2,
213
+ backgroundColor: theme.palette.background.code
214
+ },
215
+ children: [
216
+ parentEl !== undefined && // Connector line between this node and its parent.
217
+ /*#__PURE__*/ _jsx(Box, {
218
+ sx: {
219
+ position: 'absolute',
220
+ display: 'inline-block',
221
+ ...connectorStyle
222
+ }
223
+ }),
224
+ formatNode(node, false, 1)
225
+ ]
226
+ }),
227
+ /*#__PURE__*/ _jsx(QueryStatus, {
228
+ mergedChildState: mergedChildState,
229
+ isFetching: isFetching,
230
+ error: error,
231
+ resultStats: resultStats,
232
+ responseTime: instantQueryResponse?.responseTime
233
+ })
234
+ ]
235
+ });
236
+ if (node.type === nodeType.binaryExpr) {
237
+ return /*#__PURE__*/ _jsxs("div", {
238
+ children: [
239
+ /*#__PURE__*/ _jsx(Box, {
240
+ ml: nodeIndent,
241
+ children: /*#__PURE__*/ _jsx(TreeNode, {
242
+ node: children[0],
243
+ parentEl: nodeEl,
244
+ reverse: true,
245
+ datasource: datasource,
246
+ childIdx: 0,
247
+ reportNodeState: childReportNodeState
248
+ })
249
+ }),
250
+ innerNode,
251
+ /*#__PURE__*/ _jsx(Box, {
252
+ ml: nodeIndent,
253
+ children: /*#__PURE__*/ _jsx(TreeNode, {
254
+ node: children[1],
255
+ parentEl: nodeEl,
256
+ reverse: false,
257
+ datasource: datasource,
258
+ childIdx: 1,
259
+ reportNodeState: childReportNodeState
260
+ })
261
+ })
262
+ ]
263
+ });
264
+ }
265
+ return /*#__PURE__*/ _jsxs("div", {
266
+ children: [
267
+ innerNode,
268
+ children.map((child, idx)=>/*#__PURE__*/ _jsx(Box, {
269
+ ml: nodeIndent,
270
+ children: /*#__PURE__*/ _jsx(TreeNode, {
271
+ node: child,
272
+ parentEl: nodeEl,
273
+ reverse: false,
274
+ datasource: datasource,
275
+ childIdx: idx,
276
+ reportNodeState: childReportNodeState
277
+ })
278
+ }, idx))
279
+ ]
280
+ });
281
+ }
282
+ function QueryStatus({ mergedChildState, isFetching, error, resultStats, responseTime }) {
283
+ if (mergedChildState === 'waiting') {
284
+ return /*#__PURE__*/ _jsx(ProgressState, {
285
+ text: "Waiting for child query"
286
+ });
287
+ }
288
+ if (mergedChildState === 'running') {
289
+ return /*#__PURE__*/ _jsx(ProgressState, {
290
+ text: "Running"
291
+ });
292
+ }
293
+ if (mergedChildState === 'error') {
294
+ return /*#__PURE__*/ _jsxs(Stack, {
295
+ children: [
296
+ /*#__PURE__*/ _jsx(AlertCircle, {}),
297
+ "Blocked on child query error"
298
+ ]
299
+ });
300
+ }
301
+ if (isFetching) {
302
+ return /*#__PURE__*/ _jsx(ProgressState, {
303
+ text: "Loading"
304
+ });
305
+ }
306
+ if (error) {
307
+ return /*#__PURE__*/ _jsxs(Box, {
308
+ display: "flex",
309
+ alignItems: "center",
310
+ gap: 1,
311
+ sx: {
312
+ color: (theme)=>theme.palette.error.main
313
+ },
314
+ marginBottom: 1.5,
315
+ children: [
316
+ /*#__PURE__*/ _jsx(AlertCircle, {}),
317
+ /*#__PURE__*/ _jsxs(Typography, {
318
+ variant: "body2",
319
+ children: [
320
+ /*#__PURE__*/ _jsx("strong", {
321
+ children: "Error executing query:"
322
+ }),
323
+ " ",
324
+ error.message
325
+ ]
326
+ })
327
+ ]
328
+ });
329
+ }
330
+ return /*#__PURE__*/ _jsxs(Stack, {
331
+ direction: "row",
332
+ gap: 1,
333
+ alignItems: "center",
334
+ marginBottom: 1.5,
335
+ children: [
336
+ /*#__PURE__*/ _jsxs(Typography, {
337
+ variant: "body2",
338
+ component: "span",
339
+ sx: {
340
+ color: (theme)=>theme.palette.grey[500]
341
+ },
342
+ children: [
343
+ resultStats.numSeries,
344
+ " result",
345
+ resultStats.numSeries !== 1 && 's',
346
+ "  –  ",
347
+ responseTime,
348
+ "ms",
349
+ resultStats.sortedLabelCards.length > 0 && /*#__PURE__*/ _jsx(_Fragment, {
350
+ children: "  –"
351
+ })
352
+ ]
353
+ }),
354
+ resultStats.sortedLabelCards.slice(0, maxLabelNames).map(([ln, cnt])=>/*#__PURE__*/ _jsx(Tooltip, {
355
+ title: /*#__PURE__*/ _jsx(Box, {
356
+ children: /*#__PURE__*/ _jsxs(List, {
357
+ dense: true,
358
+ children: [
359
+ resultStats.labelExamples[ln]?.map(({ value, count })=>/*#__PURE__*/ _jsxs(ListItem, {
360
+ sx: {
361
+ display: 'flex',
362
+ gap: 1,
363
+ py: 0,
364
+ px: 0.5
365
+ },
366
+ children: [
367
+ /*#__PURE__*/ _jsx(CircleIcon, {
368
+ sx: {
369
+ fontSize: 8
370
+ }
371
+ }),
372
+ /*#__PURE__*/ _jsx(Typography, {
373
+ variant: "body2",
374
+ component: "span",
375
+ sx: {
376
+ color: (theme)=>theme.palette.mode === 'dark' // TODO we shouldnt have to do that I guess..
377
+ ? theme.palette.warning.dark : theme.palette.warning.main,
378
+ fontFamily: 'monospace'
379
+ },
380
+ children: escapeString(value)
381
+ }),
382
+ /*#__PURE__*/ _jsxs(Typography, {
383
+ variant: "body2",
384
+ component: "span",
385
+ children: [
386
+ "(",
387
+ count,
388
+ "x)"
389
+ ]
390
+ })
391
+ ]
392
+ }, value)),
393
+ cnt > maxLabelValues && /*#__PURE__*/ _jsxs(ListItem, {
394
+ sx: {
395
+ display: 'flex',
396
+ gap: 1,
397
+ py: 0,
398
+ px: 0.5
399
+ },
400
+ children: [
401
+ /*#__PURE__*/ _jsx(CircleIcon, {
402
+ sx: {
403
+ fontSize: 8
404
+ }
405
+ }),
406
+ /*#__PURE__*/ _jsx(Typography, {
407
+ variant: "body2",
408
+ children: ". . ."
409
+ })
410
+ ]
411
+ })
412
+ ]
413
+ })
414
+ }),
415
+ arrow: true,
416
+ children: /*#__PURE__*/ _jsxs("span", {
417
+ style: {
418
+ cursor: 'pointer',
419
+ whiteSpace: 'nowrap'
420
+ },
421
+ children: [
422
+ /*#__PURE__*/ _jsx(Typography, {
423
+ variant: "body2",
424
+ component: "span",
425
+ sx: {
426
+ fontFamily: 'monospace',
427
+ color: (theme)=>theme.palette.success.main
428
+ },
429
+ children: ln
430
+ }),
431
+ /*#__PURE__*/ _jsxs(Typography, {
432
+ variant: "body2",
433
+ component: "span",
434
+ sx: {
435
+ color: (theme)=>theme.palette.grey[500]
436
+ },
437
+ children: [
438
+ ": ",
439
+ cnt
440
+ ]
441
+ })
442
+ ]
443
+ })
444
+ }, ln)),
445
+ resultStats.sortedLabelCards.length > maxLabelNames ? /*#__PURE__*/ _jsxs(Typography, {
446
+ variant: "body2",
447
+ children: [
448
+ "...",
449
+ resultStats.sortedLabelCards.length - maxLabelNames,
450
+ " more..."
451
+ ]
452
+ }) : null
453
+ ]
454
+ });
455
+ }
456
+ function ProgressState({ text }) {
457
+ return /*#__PURE__*/ _jsxs(Box, {
458
+ display: "flex",
459
+ alignItems: "center",
460
+ gap: 1,
461
+ marginBottom: 1.5,
462
+ children: [
463
+ /*#__PURE__*/ _jsx(CircularProgress, {
464
+ size: 16,
465
+ color: "secondary"
466
+ }),
467
+ /*#__PURE__*/ _jsxs(Typography, {
468
+ variant: "body2",
469
+ color: "text.secondary",
470
+ children: [
471
+ text,
472
+ "..."
473
+ ]
474
+ })
475
+ ]
476
+ });
477
+ }
478
+
479
+ //# sourceMappingURL=TreeNode.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/components/TreeNode.tsx"],"sourcesContent":["// Copyright 2025 The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\n// Forked from https://github.com/prometheus/prometheus/blob/65f610353919b1c7b42d3776c3a95b68046a6bba/web/ui/mantine-ui/src/pages/query/TreeNode.tsx\n\nimport { Box, CircularProgress, List, ListItem, Stack, Tooltip, Typography, useTheme } from '@mui/material';\nimport CircleIcon from 'mdi-material-ui/Circle';\nimport { ReactElement, useCallback, useEffect, useLayoutEffect, useMemo, useState } from 'react';\nimport AlertCircle from 'mdi-material-ui/AlertCircle';\nimport { StatusError } from '@perses-dev/core';\nimport { PrometheusDatasourceSelector } from '../model';\nimport ASTNode, { nodeType } from './promql/ast';\nimport { escapeString, getNodeChildren } from './promql/utils';\nimport { formatNode } from './promql/format';\nimport serializeNode from './promql/serialize';\nimport { functionSignatures } from './promql/functionSignatures';\nimport { useInstantQuery } from './query';\n\n// The indentation factor for each level of the tree.\nconst nodeIndent = 5;\nconst connectorWidth = nodeIndent * 5;\n\n// max number of label names and values to show in the individual query status\nconst maxLabelNames = 10;\nconst maxLabelValues = 10;\n\ntype NodeState = 'waiting' | 'running' | 'error' | 'success';\n\n// mergeChildStates basically returns the \"worst\" state found among the children.\nconst mergeChildStates = (states: NodeState[]): NodeState => {\n if (states.includes('error')) {\n return 'error';\n }\n if (states.includes('waiting')) {\n return 'waiting';\n }\n if (states.includes('running')) {\n return 'running';\n }\n\n return 'success';\n};\n\ninterface TreeNodeProps {\n // The AST node to render.\n node: ASTNode;\n // The parent element of this node.\n parentEl?: HTMLDivElement | null;\n // Used to compute the position of the connector line between this node and its parent.\n reverse: boolean;\n // Datasource used for the node's individual query.\n datasource: PrometheusDatasourceSelector;\n // The index of this node in its parent's children.\n // Used to render the node's individual query.\n childIdx: number;\n // Function to report the node state to the parent.\n // Used to render the node's individual query.\n reportNodeState?: (childIdx: number, state: NodeState) => void;\n}\n\nexport default function TreeNode({\n node,\n parentEl,\n reverse,\n datasource,\n childIdx,\n reportNodeState,\n}: TreeNodeProps): ReactElement {\n const theme = useTheme();\n const children = getNodeChildren(node);\n\n // A normal ref won't work properly here because the ref's `current` property\n // going from `null` to defined won't trigger a re-render of the child\n // component, since it's not a React state update. So we manually have to\n // create a state update using a callback ref. See also\n // https://tkdodo.eu/blog/avoiding-use-effect-with-callback-refs\n const [nodeEl, setNodeEl] = useState<HTMLDivElement | null>(null);\n const nodeRef = useCallback((node: HTMLDivElement) => setNodeEl(node), []);\n\n const [resultStats, setResultStats] = useState<{\n numSeries: number;\n labelExamples: Record<string, Array<{ value: string; count: number }>>;\n sortedLabelCards: Array<[string, number]>;\n }>({\n numSeries: 0,\n labelExamples: {},\n sortedLabelCards: [],\n });\n\n const [connectorStyle, setConnectorStyle] = useState({\n borderColor: theme.palette.grey['500'],\n borderLeftStyle: 'solid',\n borderLeftWidth: 2,\n width: connectorWidth,\n left: -connectorWidth,\n });\n\n const [childStates, setChildStates] = useState<NodeState[]>(children.map(() => 'waiting'));\n const mergedChildState = useMemo(() => mergeChildStates(childStates), [childStates]);\n\n // Optimize range vector selector fetches to give us the info we're looking for\n // more cheaply. E.g. 'foo[7w]' can be expensive to fully fetch, but wrapping it\n // in 'last_over_time(foo[7w])' is cheaper and also gives us all the info we\n // need (number of series and labels).\n let queryNode = node;\n if (queryNode.type === nodeType.matrixSelector) {\n queryNode = {\n type: nodeType.call,\n func: functionSignatures.last_over_time!,\n args: [node],\n };\n }\n\n // Individual query for the current node\n const {\n data: instantQueryResponse,\n isFetching,\n error,\n } = useInstantQuery(serializeNode(queryNode) ?? '', datasource, mergedChildState === 'success');\n\n // report the node state to the parent\n useEffect(() => {\n if (reportNodeState) {\n if (mergedChildState === 'error' || error) {\n reportNodeState(childIdx, 'error');\n } else if (isFetching) {\n reportNodeState(childIdx, 'running');\n }\n }\n }, [mergedChildState, error, isFetching, reportNodeState, childIdx]);\n\n // This function is passed down to the child nodes so they can report their state.\n const childReportNodeState = useCallback(\n (childIdx: number, state: NodeState) => {\n setChildStates((prev) => {\n const newStates = [...prev];\n newStates[childIdx] = state;\n return newStates;\n });\n },\n [setChildStates]\n );\n\n // Update the size and position of tree connector lines based on the node's and its parent's position.\n useLayoutEffect(() => {\n if (parentEl === undefined) {\n // We're the root node.\n return;\n }\n\n if (parentEl === null || nodeEl === null) {\n // Either of the two connected nodes hasn't been rendered yet.\n return;\n }\n\n const parentRect = parentEl.getBoundingClientRect();\n const nodeRect = nodeEl.getBoundingClientRect();\n if (reverse) {\n setConnectorStyle((prevStyle) => ({\n ...prevStyle,\n top: 'calc(50% - 1px)',\n bottom: nodeRect.bottom - parentRect.top,\n borderTopLeftRadius: 10,\n borderTopStyle: 'solid',\n borderBottomLeftRadius: undefined,\n }));\n } else {\n setConnectorStyle((prevStyle) => ({\n ...prevStyle,\n top: parentRect.bottom - nodeRect.top,\n bottom: 'calc(50% - 1px)',\n borderBottomLeftRadius: 10,\n borderBottomStyle: 'solid',\n borderTopLeftRadius: undefined,\n }));\n }\n }, [parentEl, nodeEl, reverse, nodeRef, setConnectorStyle]);\n\n // Update the node info state based on the query result.\n useEffect(() => {\n if (instantQueryResponse?.status !== 'success') {\n return;\n }\n\n if (reportNodeState) {\n reportNodeState(childIdx, 'success');\n }\n\n let resultSeries = 0;\n // labelValuesByName records the number of times each label value appears for each label name.\n const labelValuesByName: Record<string, Record<string, number>> = {};\n const { resultType, result } = instantQueryResponse.data;\n\n if (resultType === 'scalar' || resultType === 'string') {\n resultSeries = 1;\n } else if (result && result.length > 0) {\n resultSeries = result.length;\n result.forEach((s) => {\n Object.entries(s.metric).forEach(([ln, lv]) => {\n // TODO: If we ever want to include __name__ here again, we cannot use the\n // last_over_time(foo[7d]) optimization since that removes the metric name.\n if (ln !== '__name__') {\n labelValuesByName[ln] = labelValuesByName[ln] ?? {};\n labelValuesByName[ln]![lv] = (labelValuesByName[ln]![lv] ?? 0) + 1;\n }\n });\n });\n }\n\n // labelCardinalities records the number of unique label values for each label name.\n const labelCardinalities: Record<string, number> = {};\n // labelExamples records the most common label values for each label name.\n const labelExamples: Record<string, Array<{ value: string; count: number }>> = {};\n Object.entries(labelValuesByName).forEach(([ln, lvs]) => {\n labelCardinalities[ln] = Object.keys(lvs).length;\n // Sort label values by their number of occurrences within this label name.\n labelExamples[ln] = Object.entries(lvs)\n .sort(([, aCnt], [, bCnt]) => bCnt - aCnt)\n .slice(0, maxLabelValues)\n .map(([lv, cnt]) => ({ value: lv, count: cnt }));\n });\n\n setResultStats({\n numSeries: resultSeries,\n sortedLabelCards: Object.entries(labelCardinalities).sort((a, b) => b[1] - a[1]),\n labelExamples,\n });\n }, [instantQueryResponse, reportNodeState, childIdx]);\n\n const innerNode = (\n <Stack direction=\"row\" gap={2}>\n <Box\n ref={nodeRef}\n sx={{\n position: 'relative',\n display: 'inline-block',\n padding: 1,\n marginBottom: 1.5,\n borderRadius: 2,\n backgroundColor: theme.palette.background.code,\n }}\n >\n {parentEl !== undefined && (\n // Connector line between this node and its parent.\n <Box\n sx={{\n position: 'absolute',\n display: 'inline-block',\n ...connectorStyle,\n }}\n />\n )}\n {/* The node (visible box) itself. */}\n {formatNode(node, false, 1)}\n </Box>\n {/* The node's individual query: */}\n <QueryStatus\n mergedChildState={mergedChildState}\n isFetching={isFetching}\n error={error}\n resultStats={resultStats}\n responseTime={instantQueryResponse?.responseTime}\n />\n </Stack>\n );\n\n if (node.type === nodeType.binaryExpr) {\n return (\n <div>\n <Box ml={nodeIndent}>\n <TreeNode\n node={children[0]!}\n parentEl={nodeEl}\n reverse={true}\n datasource={datasource}\n childIdx={0}\n reportNodeState={childReportNodeState}\n />\n </Box>\n {innerNode}\n <Box ml={nodeIndent}>\n <TreeNode\n node={children[1]!}\n parentEl={nodeEl}\n reverse={false}\n datasource={datasource}\n childIdx={1}\n reportNodeState={childReportNodeState}\n />\n </Box>\n </div>\n );\n }\n\n return (\n <div>\n {innerNode}\n {children.map((child, idx) => (\n <Box ml={nodeIndent} key={idx}>\n <TreeNode\n node={child}\n parentEl={nodeEl}\n reverse={false}\n datasource={datasource}\n childIdx={idx}\n reportNodeState={childReportNodeState}\n />\n </Box>\n ))}\n </div>\n );\n}\n\ninterface QueryStatusProps {\n mergedChildState: NodeState;\n isFetching: boolean;\n error: StatusError | null;\n resultStats: {\n numSeries: number;\n labelExamples: Record<string, Array<{ value: string; count: number }>>;\n sortedLabelCards: Array<[string, number]>;\n };\n responseTime?: number;\n}\n\nfunction QueryStatus({\n mergedChildState,\n isFetching,\n error,\n resultStats,\n responseTime,\n}: QueryStatusProps): ReactElement {\n if (mergedChildState === 'waiting') {\n return <ProgressState text=\"Waiting for child query\" />;\n }\n\n if (mergedChildState === 'running') {\n return <ProgressState text=\"Running\" />;\n }\n\n if (mergedChildState === 'error') {\n return (\n <Stack>\n <AlertCircle />\n Blocked on child query error\n </Stack>\n );\n }\n\n if (isFetching) {\n return <ProgressState text=\"Loading\" />;\n }\n\n if (error) {\n return (\n <Box\n display=\"flex\"\n alignItems=\"center\"\n gap={1}\n sx={{ color: (theme) => theme.palette.error.main }}\n marginBottom={1.5}\n >\n <AlertCircle />\n <Typography variant=\"body2\">\n <strong>Error executing query:</strong> {error.message}\n </Typography>\n </Box>\n );\n }\n\n return (\n <Stack direction=\"row\" gap={1} alignItems=\"center\" marginBottom={1.5}>\n <Typography variant=\"body2\" component=\"span\" sx={{ color: (theme) => theme.palette.grey[500] }}>\n {resultStats.numSeries} result{resultStats.numSeries !== 1 && 's'}\n &nbsp;&nbsp;–&nbsp;&nbsp;\n {responseTime}ms\n {resultStats.sortedLabelCards.length > 0 && <>&nbsp;&nbsp;–</>}\n </Typography>\n {resultStats.sortedLabelCards.slice(0, maxLabelNames).map(([ln, cnt]) => (\n <Tooltip\n key={ln}\n title={\n <Box>\n <List dense>\n {resultStats.labelExamples[ln]?.map(({ value, count }) => (\n <ListItem\n key={value}\n sx={{\n display: 'flex',\n gap: 1,\n py: 0,\n px: 0.5,\n }}\n >\n <CircleIcon sx={{ fontSize: 8 }} />\n <Typography\n variant=\"body2\"\n component=\"span\"\n sx={{\n color: (theme) =>\n theme.palette.mode === 'dark' // TODO we shouldnt have to do that I guess..\n ? theme.palette.warning.dark\n : theme.palette.warning.main,\n fontFamily: 'monospace',\n }}\n >\n {escapeString(value)}\n </Typography>\n <Typography variant=\"body2\" component=\"span\">\n ({count}x)\n </Typography>\n </ListItem>\n ))}\n {cnt > maxLabelValues && (\n <ListItem\n sx={{\n display: 'flex',\n gap: 1,\n py: 0,\n px: 0.5,\n }}\n >\n <CircleIcon sx={{ fontSize: 8 }} />\n <Typography variant=\"body2\">. . .</Typography>\n </ListItem>\n )}\n </List>\n </Box>\n }\n arrow\n >\n <span style={{ cursor: 'pointer', whiteSpace: 'nowrap' }}>\n <Typography\n variant=\"body2\"\n component=\"span\"\n sx={{ fontFamily: 'monospace', color: (theme) => theme.palette.success.main }}\n >\n {ln}\n </Typography>\n <Typography variant=\"body2\" component=\"span\" sx={{ color: (theme) => theme.palette.grey[500] }}>\n : {cnt}\n </Typography>\n </span>\n </Tooltip>\n ))}\n {resultStats.sortedLabelCards.length > maxLabelNames ? (\n <Typography variant=\"body2\">...{resultStats.sortedLabelCards.length - maxLabelNames} more...</Typography>\n ) : null}\n </Stack>\n );\n}\n\nfunction ProgressState({ text }: { text: string }): ReactElement {\n return (\n <Box display=\"flex\" alignItems=\"center\" gap={1} marginBottom={1.5}>\n <CircularProgress size={16} color=\"secondary\" />\n <Typography variant=\"body2\" color=\"text.secondary\">\n {text}...\n </Typography>\n </Box>\n );\n}\n"],"names":["Box","CircularProgress","List","ListItem","Stack","Tooltip","Typography","useTheme","CircleIcon","useCallback","useEffect","useLayoutEffect","useMemo","useState","AlertCircle","nodeType","escapeString","getNodeChildren","formatNode","serializeNode","functionSignatures","useInstantQuery","nodeIndent","connectorWidth","maxLabelNames","maxLabelValues","mergeChildStates","states","includes","TreeNode","node","parentEl","reverse","datasource","childIdx","reportNodeState","theme","children","nodeEl","setNodeEl","nodeRef","resultStats","setResultStats","numSeries","labelExamples","sortedLabelCards","connectorStyle","setConnectorStyle","borderColor","palette","grey","borderLeftStyle","borderLeftWidth","width","left","childStates","setChildStates","map","mergedChildState","queryNode","type","matrixSelector","call","func","last_over_time","args","data","instantQueryResponse","isFetching","error","childReportNodeState","state","prev","newStates","undefined","parentRect","getBoundingClientRect","nodeRect","prevStyle","top","bottom","borderTopLeftRadius","borderTopStyle","borderBottomLeftRadius","borderBottomStyle","status","resultSeries","labelValuesByName","resultType","result","length","forEach","s","Object","entries","metric","ln","lv","labelCardinalities","lvs","keys","sort","aCnt","bCnt","slice","cnt","value","count","a","b","innerNode","direction","gap","ref","sx","position","display","padding","marginBottom","borderRadius","backgroundColor","background","code","QueryStatus","responseTime","binaryExpr","div","ml","child","idx","ProgressState","text","alignItems","color","main","variant","strong","message","component","title","dense","py","px","fontSize","mode","warning","dark","fontFamily","arrow","span","style","cursor","whiteSpace","success","size"],"mappings":"AAAA,oCAAoC;AACpC,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAEjC,oJAAoJ;;AAEpJ,SAASA,GAAG,EAAEC,gBAAgB,EAAEC,IAAI,EAAEC,QAAQ,EAAEC,KAAK,EAAEC,OAAO,EAAEC,UAAU,EAAEC,QAAQ,QAAQ,gBAAgB;AAC5G,OAAOC,gBAAgB,yBAAyB;AAChD,SAAuBC,WAAW,EAAEC,SAAS,EAAEC,eAAe,EAAEC,OAAO,EAAEC,QAAQ,QAAQ,QAAQ;AACjG,OAAOC,iBAAiB,8BAA8B;AAGtD,SAAkBC,QAAQ,QAAQ,eAAe;AACjD,SAASC,YAAY,EAAEC,eAAe,QAAQ,iBAAiB;AAC/D,SAASC,UAAU,QAAQ,kBAAkB;AAC7C,OAAOC,mBAAmB,qBAAqB;AAC/C,SAASC,kBAAkB,QAAQ,8BAA8B;AACjE,SAASC,eAAe,QAAQ,UAAU;AAE1C,qDAAqD;AACrD,MAAMC,aAAa;AACnB,MAAMC,iBAAiBD,aAAa;AAEpC,8EAA8E;AAC9E,MAAME,gBAAgB;AACtB,MAAMC,iBAAiB;AAIvB,iFAAiF;AACjF,MAAMC,mBAAmB,CAACC;IACxB,IAAIA,OAAOC,QAAQ,CAAC,UAAU;QAC5B,OAAO;IACT;IACA,IAAID,OAAOC,QAAQ,CAAC,YAAY;QAC9B,OAAO;IACT;IACA,IAAID,OAAOC,QAAQ,CAAC,YAAY;QAC9B,OAAO;IACT;IAEA,OAAO;AACT;AAmBA,eAAe,SAASC,SAAS,EAC/BC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BAAWiI,SAAQ;;oBAAQ;oBAAI9F,YAAYI,gBAAgB,CAAC6C,MAAM,GAAGlE;oBAAc;;iBAClF;;;AAGV;AAEA,SAAS0G,cAAc,EAAEC,IAAI,EAAoB;IAC/C,qBACE,MAACnI;QAAIoH,SAAQ;QAAOgB,YAAW;QAASpB,KAAK;QAAGM,cAAc;;0BAC5D,KAACrH;gBAAiByJ,MAAM;gBAAIrB,OAAM;;0BAClC,MAAC/H;gBAAWiI,SAAQ;gBAAQF,OAAM;;oBAC/BF;oBAAK;;;;;AAId"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/index.ts"],"names":[],"mappings":"AAaA,cAAc,gBAAgB,CAAC"}
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/components/index.ts"],"sourcesContent":["// Copyright 2023 The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nexport * from './PromQLEditor';\n"],"names":[],"mappings":"AAAA,oCAAoC;AACpC,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAEjC,cAAc,iBAAiB"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ast.d.ts","sourceRoot":"","sources":["../../../../src/components/promql/ast.ts"],"names":[],"mappings":"AAeA,oBAAY,QAAQ;IAClB,WAAW,gBAAgB;IAC3B,UAAU,eAAe;IACzB,IAAI,SAAS;IACb,cAAc,mBAAmB;IACjC,QAAQ,aAAa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IAAI,GACJ,cAAc,GACd,QAAQ,GACR,aAAa,GACb,SAAS,GACT,aAAa,GACb,SAAS,GACT,cAAc,GACd,WAAW,CAAC;AAEhB,eAAe,OAAO,CAAC"}
@@ -11,8 +11,7 @@
11
11
  // See the License for the specific language governing permissions and
12
12
  // limitations under the License.
13
13
  // Forked from https://github.com/prometheus/prometheus/blob/65f610353919b1c7b42d3776c3a95b68046a6bba/web/ui/mantine-ui/src/promql/ast.ts
14
- export var nodeType;
15
- (function(nodeType) {
14
+ export var nodeType = /*#__PURE__*/ function(nodeType) {
16
15
  nodeType["aggregation"] = "aggregation";
17
16
  nodeType["binaryExpr"] = "binaryExpr";
18
17
  nodeType["call"] = "call";
@@ -24,9 +23,9 @@ export var nodeType;
24
23
  nodeType["unaryExpr"] = "unaryExpr";
25
24
  nodeType["vectorSelector"] = "vectorSelector";
26
25
  nodeType["placeholder"] = "placeholder";
27
- })(nodeType || (nodeType = {}));
28
- export var aggregationType;
29
- (function(aggregationType) {
26
+ return nodeType;
27
+ }({});
28
+ export var aggregationType = /*#__PURE__*/ function(aggregationType) {
30
29
  aggregationType["sum"] = "sum";
31
30
  aggregationType["min"] = "min";
32
31
  aggregationType["max"] = "max";
@@ -41,9 +40,9 @@ export var aggregationType;
41
40
  aggregationType["quantile"] = "quantile";
42
41
  aggregationType["limitK"] = "limitk";
43
42
  aggregationType["limitRatio"] = "limit_ratio";
44
- })(aggregationType || (aggregationType = {}));
45
- export var binaryOperatorType;
46
- (function(binaryOperatorType) {
43
+ return aggregationType;
44
+ }({});
45
+ export var binaryOperatorType = /*#__PURE__*/ function(binaryOperatorType) {
47
46
  binaryOperatorType["add"] = "+";
48
47
  binaryOperatorType["sub"] = "-";
49
48
  binaryOperatorType["mul"] = "*";
@@ -60,7 +59,8 @@ export var binaryOperatorType;
60
59
  binaryOperatorType["or"] = "or";
61
60
  binaryOperatorType["unless"] = "unless";
62
61
  binaryOperatorType["atan2"] = "atan2";
63
- })(binaryOperatorType || (binaryOperatorType = {}));
62
+ return binaryOperatorType;
63
+ }({});
64
64
  export const compOperatorTypes = [
65
65
  "==",
66
66
  "!=",
@@ -74,33 +74,33 @@ export const setOperatorTypes = [
74
74
  "or",
75
75
  "unless"
76
76
  ];
77
- export var unaryOperatorType;
78
- (function(unaryOperatorType) {
77
+ export var unaryOperatorType = /*#__PURE__*/ function(unaryOperatorType) {
79
78
  unaryOperatorType["plus"] = "+";
80
79
  unaryOperatorType["minus"] = "-";
81
- })(unaryOperatorType || (unaryOperatorType = {}));
82
- export var vectorMatchCardinality;
83
- (function(vectorMatchCardinality) {
80
+ return unaryOperatorType;
81
+ }({});
82
+ export var vectorMatchCardinality = /*#__PURE__*/ function(vectorMatchCardinality) {
84
83
  vectorMatchCardinality["oneToOne"] = "one-to-one";
85
84
  vectorMatchCardinality["manyToOne"] = "many-to-one";
86
85
  vectorMatchCardinality["oneToMany"] = "one-to-many";
87
86
  vectorMatchCardinality["manyToMany"] = "many-to-many";
88
- })(vectorMatchCardinality || (vectorMatchCardinality = {}));
89
- export var valueType;
90
- (function(valueType) {
87
+ return vectorMatchCardinality;
88
+ }({});
89
+ export var valueType = /*#__PURE__*/ function(valueType) {
91
90
  // TODO: 'none' should never make it out of Prometheus. Do we need this here?
92
91
  valueType["none"] = "none";
93
92
  valueType["vector"] = "vector";
94
93
  valueType["scalar"] = "scalar";
95
94
  valueType["matrix"] = "matrix";
96
95
  valueType["string"] = "string";
97
- })(valueType || (valueType = {}));
98
- export var matchType;
99
- (function(matchType) {
96
+ return valueType;
97
+ }({});
98
+ export var matchType = /*#__PURE__*/ function(matchType) {
100
99
  matchType["equal"] = "=";
101
100
  matchType["notEqual"] = "!=";
102
101
  matchType["matchRegexp"] = "=~";
103
102
  matchType["matchNotRegexp"] = "!~";
104
- })(matchType || (matchType = {}));
103
+ return matchType;
104
+ }({});
105
105
 
106
106
  //# sourceMappingURL=ast.js.map