@perses-dev/plugin-system 0.55.0-beta.3 → 0.55.0-beta.7

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 (555) hide show
  1. package/dist/components/Annotations/AnnotationEditorForm/AnnotationEditorForm.d.ts +3 -3
  2. package/dist/components/Annotations/AnnotationEditorForm/AnnotationEditorForm.d.ts.map +1 -1
  3. package/dist/components/Annotations/AnnotationEditorForm/AnnotationEditorForm.js +11 -11
  4. package/dist/components/Annotations/AnnotationEditorForm/AnnotationEditorForm.js.map +1 -1
  5. package/dist/components/Annotations/AnnotationEditorForm/AnnotationPreview.d.ts +3 -3
  6. package/dist/components/Annotations/AnnotationEditorForm/AnnotationPreview.d.ts.map +1 -1
  7. package/dist/components/Annotations/AnnotationEditorForm/AnnotationPreview.js +6 -6
  8. package/dist/components/Annotations/AnnotationEditorForm/AnnotationPreview.js.map +1 -1
  9. package/dist/components/Annotations/AnnotationEditorForm/index.js +1 -1
  10. package/dist/components/Annotations/AnnotationEditorForm/index.js.map +1 -1
  11. package/dist/components/Annotations/index.js +2 -2
  12. package/dist/components/Annotations/index.js.map +1 -1
  13. package/dist/components/CalculationSelector/CalculationSelector.d.ts +2 -2
  14. package/dist/components/CalculationSelector/CalculationSelector.d.ts.map +1 -1
  15. package/dist/components/CalculationSelector/CalculationSelector.js +2 -2
  16. package/dist/components/CalculationSelector/CalculationSelector.js.map +1 -1
  17. package/dist/components/CalculationSelector/index.js +1 -1
  18. package/dist/components/CalculationSelector/index.js.map +1 -1
  19. package/dist/components/DatasourceEditorForm/DatasourceEditorForm.d.ts +2 -2
  20. package/dist/components/DatasourceEditorForm/DatasourceEditorForm.d.ts.map +1 -1
  21. package/dist/components/DatasourceEditorForm/DatasourceEditorForm.js +7 -7
  22. package/dist/components/DatasourceEditorForm/DatasourceEditorForm.js.map +1 -1
  23. package/dist/components/DatasourceEditorForm/index.js +1 -1
  24. package/dist/components/DatasourceEditorForm/index.js.map +1 -1
  25. package/dist/components/DatasourceSelect/DatasourceSelect.d.ts +4 -4
  26. package/dist/components/DatasourceSelect/DatasourceSelect.d.ts.map +1 -1
  27. package/dist/components/DatasourceSelect/DatasourceSelect.js +7 -7
  28. package/dist/components/DatasourceSelect/DatasourceSelect.js.map +1 -1
  29. package/dist/components/DatasourceSelect/index.js +1 -1
  30. package/dist/components/DatasourceSelect/index.js.map +1 -1
  31. package/dist/components/DatasourceTestConnectionButton/DatasourceTestConnectionButton.d.ts +2 -2
  32. package/dist/components/DatasourceTestConnectionButton/DatasourceTestConnectionButton.d.ts.map +1 -1
  33. package/dist/components/DatasourceTestConnectionButton/DatasourceTestConnectionButton.js +4 -4
  34. package/dist/components/DatasourceTestConnectionButton/DatasourceTestConnectionButton.js.map +1 -1
  35. package/dist/components/DatasourceTestConnectionButton/index.js +1 -1
  36. package/dist/components/DatasourceTestConnectionButton/index.js.map +1 -1
  37. package/dist/components/HTTPSettingsEditor/HTTPSettingsEditor.d.ts +2 -2
  38. package/dist/components/HTTPSettingsEditor/HTTPSettingsEditor.d.ts.map +1 -1
  39. package/dist/components/HTTPSettingsEditor/HTTPSettingsEditor.js +9 -9
  40. package/dist/components/HTTPSettingsEditor/HTTPSettingsEditor.js.map +1 -1
  41. package/dist/components/HTTPSettingsEditor/index.js +1 -1
  42. package/dist/components/HTTPSettingsEditor/index.js.map +1 -1
  43. package/dist/components/ItemSelectionActionsOptionsEditor/ItemSelectionActionsOptionsEditor.d.ts +1 -1
  44. package/dist/components/ItemSelectionActionsOptionsEditor/ItemSelectionActionsOptionsEditor.d.ts.map +1 -1
  45. package/dist/components/ItemSelectionActionsOptionsEditor/ItemSelectionActionsOptionsEditor.js +28 -28
  46. package/dist/components/ItemSelectionActionsOptionsEditor/ItemSelectionActionsOptionsEditor.js.map +1 -1
  47. package/dist/components/ItemSelectionActionsOptionsEditor/index.js +1 -1
  48. package/dist/components/ItemSelectionActionsOptionsEditor/index.js.map +1 -1
  49. package/dist/components/LayoutEditor/LayoutEditor.d.ts +4 -4
  50. package/dist/components/LayoutEditor/LayoutEditor.d.ts.map +1 -1
  51. package/dist/components/LayoutEditor/LayoutEditor.js +7 -7
  52. package/dist/components/LayoutEditor/LayoutEditor.js.map +1 -1
  53. package/dist/components/LayoutEditor/RepeatLayoutPreview.d.ts +1 -1
  54. package/dist/components/LayoutEditor/RepeatLayoutPreview.d.ts.map +1 -1
  55. package/dist/components/LayoutEditor/RepeatLayoutPreview.js +4 -4
  56. package/dist/components/LayoutEditor/RepeatLayoutPreview.js.map +1 -1
  57. package/dist/components/LayoutEditor/RepeatVariableEditor.d.ts +4 -4
  58. package/dist/components/LayoutEditor/RepeatVariableEditor.d.ts.map +1 -1
  59. package/dist/components/LayoutEditor/RepeatVariableEditor.js +3 -3
  60. package/dist/components/LayoutEditor/RepeatVariableEditor.js.map +1 -1
  61. package/dist/components/LayoutEditor/index.js +3 -3
  62. package/dist/components/LayoutEditor/index.js.map +1 -1
  63. package/dist/components/LegendOptionsEditor/LegendOptionsEditor.d.ts +2 -2
  64. package/dist/components/LegendOptionsEditor/LegendOptionsEditor.d.ts.map +1 -1
  65. package/dist/components/LegendOptionsEditor/LegendOptionsEditor.js +5 -5
  66. package/dist/components/LegendOptionsEditor/LegendOptionsEditor.js.map +1 -1
  67. package/dist/components/LegendOptionsEditor/index.js +1 -1
  68. package/dist/components/LegendOptionsEditor/index.js.map +1 -1
  69. package/dist/components/LinksEditor/LinksEditor.d.ts +3 -3
  70. package/dist/components/LinksEditor/LinksEditor.d.ts.map +1 -1
  71. package/dist/components/LinksEditor/LinksEditor.js +6 -6
  72. package/dist/components/LinksEditor/LinksEditor.js.map +1 -1
  73. package/dist/components/LinksEditor/index.js +1 -1
  74. package/dist/components/LinksEditor/index.js.map +1 -1
  75. package/dist/components/MetricLabelInput/MetricLabelInput.d.ts +1 -1
  76. package/dist/components/MetricLabelInput/MetricLabelInput.d.ts.map +1 -1
  77. package/dist/components/MetricLabelInput/MetricLabelInput.js +2 -2
  78. package/dist/components/MetricLabelInput/MetricLabelInput.js.map +1 -1
  79. package/dist/components/MetricLabelInput/index.js +1 -1
  80. package/dist/components/MetricLabelInput/index.js.map +1 -1
  81. package/dist/components/MultiQueryEditor/MultiQueryEditor.d.ts +3 -3
  82. package/dist/components/MultiQueryEditor/MultiQueryEditor.d.ts.map +1 -1
  83. package/dist/components/MultiQueryEditor/MultiQueryEditor.js +6 -6
  84. package/dist/components/MultiQueryEditor/MultiQueryEditor.js.map +1 -1
  85. package/dist/components/MultiQueryEditor/QueryEditorContainer.d.ts +3 -3
  86. package/dist/components/MultiQueryEditor/QueryEditorContainer.d.ts.map +1 -1
  87. package/dist/components/MultiQueryEditor/QueryEditorContainer.js +14 -14
  88. package/dist/components/MultiQueryEditor/QueryEditorContainer.js.map +1 -1
  89. package/dist/components/MultiQueryEditor/index.js +2 -2
  90. package/dist/components/MultiQueryEditor/index.js.map +1 -1
  91. package/dist/components/MultiQueryEditor/utils.d.ts +1 -1
  92. package/dist/components/MultiQueryEditor/utils.d.ts.map +1 -1
  93. package/dist/components/MultiQueryEditor/utils.js.map +1 -1
  94. package/dist/components/OptionsEditorRadios/OptionsEditorRadios.d.ts +1 -1
  95. package/dist/components/OptionsEditorRadios/OptionsEditorRadios.d.ts.map +1 -1
  96. package/dist/components/OptionsEditorRadios/OptionsEditorRadios.js +4 -4
  97. package/dist/components/OptionsEditorRadios/OptionsEditorRadios.js.map +1 -1
  98. package/dist/components/OptionsEditorRadios/index.js +1 -1
  99. package/dist/components/OptionsEditorRadios/index.js.map +1 -1
  100. package/dist/components/OptionsEditorTabPanel/OptionsEditorTabPanel.d.ts +1 -1
  101. package/dist/components/OptionsEditorTabPanel/OptionsEditorTabPanel.d.ts.map +1 -1
  102. package/dist/components/OptionsEditorTabPanel/OptionsEditorTabPanel.js +1 -1
  103. package/dist/components/OptionsEditorTabPanel/OptionsEditorTabPanel.js.map +1 -1
  104. package/dist/components/OptionsEditorTabPanel/index.js +1 -1
  105. package/dist/components/OptionsEditorTabPanel/index.js.map +1 -1
  106. package/dist/components/OptionsEditorTabs/OptionsEditorTabs.d.ts +1 -1
  107. package/dist/components/OptionsEditorTabs/OptionsEditorTabs.d.ts.map +1 -1
  108. package/dist/components/OptionsEditorTabs/OptionsEditorTabs.js +4 -4
  109. package/dist/components/OptionsEditorTabs/OptionsEditorTabs.js.map +1 -1
  110. package/dist/components/OptionsEditorTabs/index.js +1 -1
  111. package/dist/components/OptionsEditorTabs/index.js.map +1 -1
  112. package/dist/components/PanelSpecEditor/PanelAnnotationsEditor.d.ts +2 -2
  113. package/dist/components/PanelSpecEditor/PanelAnnotationsEditor.d.ts.map +1 -1
  114. package/dist/components/PanelSpecEditor/PanelAnnotationsEditor.js +9 -9
  115. package/dist/components/PanelSpecEditor/PanelAnnotationsEditor.js.map +1 -1
  116. package/dist/components/PanelSpecEditor/PanelSpecEditor.d.ts +5 -5
  117. package/dist/components/PanelSpecEditor/PanelSpecEditor.d.ts.map +1 -1
  118. package/dist/components/PanelSpecEditor/PanelSpecEditor.js +9 -9
  119. package/dist/components/PanelSpecEditor/PanelSpecEditor.js.map +1 -1
  120. package/dist/components/PanelSpecEditor/index.js +1 -1
  121. package/dist/components/PanelSpecEditor/index.js.map +1 -1
  122. package/dist/components/PluginEditor/PluginEditor.d.ts +2 -2
  123. package/dist/components/PluginEditor/PluginEditor.d.ts.map +1 -1
  124. package/dist/components/PluginEditor/PluginEditor.js +7 -7
  125. package/dist/components/PluginEditor/PluginEditor.js.map +1 -1
  126. package/dist/components/PluginEditor/index.js +2 -2
  127. package/dist/components/PluginEditor/index.js.map +1 -1
  128. package/dist/components/PluginEditor/plugin-editor-api.d.ts +3 -3
  129. package/dist/components/PluginEditor/plugin-editor-api.d.ts.map +1 -1
  130. package/dist/components/PluginEditor/plugin-editor-api.js +4 -4
  131. package/dist/components/PluginEditor/plugin-editor-api.js.map +1 -1
  132. package/dist/components/PluginKindSelect/PluginKindSelect.d.ts +3 -3
  133. package/dist/components/PluginKindSelect/PluginKindSelect.d.ts.map +1 -1
  134. package/dist/components/PluginKindSelect/PluginKindSelect.js +6 -6
  135. package/dist/components/PluginKindSelect/PluginKindSelect.js.map +1 -1
  136. package/dist/components/PluginKindSelect/index.js +1 -1
  137. package/dist/components/PluginKindSelect/index.js.map +1 -1
  138. package/dist/components/PluginRegistry/PluginRegistry.d.ts +2 -2
  139. package/dist/components/PluginRegistry/PluginRegistry.d.ts.map +1 -1
  140. package/dist/components/PluginRegistry/PluginRegistry.js +5 -5
  141. package/dist/components/PluginRegistry/PluginRegistry.js.map +1 -1
  142. package/dist/components/PluginRegistry/getPluginSearchHelper.d.ts +2 -2
  143. package/dist/components/PluginRegistry/getPluginSearchHelper.d.ts.map +1 -1
  144. package/dist/components/PluginRegistry/getPluginSearchHelper.js +2 -2
  145. package/dist/components/PluginRegistry/getPluginSearchHelper.js.map +1 -1
  146. package/dist/components/PluginRegistry/index.js +1 -1
  147. package/dist/components/PluginRegistry/index.js.map +1 -1
  148. package/dist/components/PluginRegistry/plugin-indexes.d.ts +2 -1
  149. package/dist/components/PluginRegistry/plugin-indexes.d.ts.map +1 -1
  150. package/dist/components/PluginRegistry/plugin-indexes.js +3 -3
  151. package/dist/components/PluginRegistry/plugin-indexes.js.map +1 -1
  152. package/dist/components/PluginSpecEditor/DatasourceSpecEditor.d.ts +3 -3
  153. package/dist/components/PluginSpecEditor/DatasourceSpecEditor.d.ts.map +1 -1
  154. package/dist/components/PluginSpecEditor/DatasourceSpecEditor.js +3 -3
  155. package/dist/components/PluginSpecEditor/DatasourceSpecEditor.js.map +1 -1
  156. package/dist/components/PluginSpecEditor/PluginSpecEditor.d.ts +4 -4
  157. package/dist/components/PluginSpecEditor/PluginSpecEditor.d.ts.map +1 -1
  158. package/dist/components/PluginSpecEditor/PluginSpecEditor.js +4 -4
  159. package/dist/components/PluginSpecEditor/PluginSpecEditor.js.map +1 -1
  160. package/dist/components/PluginSpecEditor/index.js +1 -1
  161. package/dist/components/PluginSpecEditor/index.js.map +1 -1
  162. package/dist/components/SelectionOptionsEditor/SelectionOptionsEditor.d.ts +1 -1
  163. package/dist/components/SelectionOptionsEditor/SelectionOptionsEditor.d.ts.map +1 -1
  164. package/dist/components/SelectionOptionsEditor/SelectionOptionsEditor.js +3 -3
  165. package/dist/components/SelectionOptionsEditor/SelectionOptionsEditor.js.map +1 -1
  166. package/dist/components/SelectionOptionsEditor/index.js +1 -1
  167. package/dist/components/SelectionOptionsEditor/index.js.map +1 -1
  168. package/dist/components/TimeRangeControls/TimeRangeControls.d.ts +4 -4
  169. package/dist/components/TimeRangeControls/TimeRangeControls.d.ts.map +1 -1
  170. package/dist/components/TimeRangeControls/TimeRangeControls.js +15 -51
  171. package/dist/components/TimeRangeControls/TimeRangeControls.js.map +1 -1
  172. package/dist/components/TimeRangeControls/index.js +1 -1
  173. package/dist/components/TimeRangeControls/index.js.map +1 -1
  174. package/dist/components/Variables/VariableEditorForm/VariableEditorForm.d.ts +3 -3
  175. package/dist/components/Variables/VariableEditorForm/VariableEditorForm.d.ts.map +1 -1
  176. package/dist/components/Variables/VariableEditorForm/VariableEditorForm.js +11 -11
  177. package/dist/components/Variables/VariableEditorForm/VariableEditorForm.js.map +1 -1
  178. package/dist/components/Variables/VariableEditorForm/VariablePreview.d.ts +2 -2
  179. package/dist/components/Variables/VariableEditorForm/VariablePreview.d.ts.map +1 -1
  180. package/dist/components/Variables/VariableEditorForm/VariablePreview.js +8 -7
  181. package/dist/components/Variables/VariableEditorForm/VariablePreview.js.map +1 -1
  182. package/dist/components/Variables/VariableEditorForm/index.js +3 -3
  183. package/dist/components/Variables/VariableEditorForm/index.js.map +1 -1
  184. package/dist/components/Variables/VariableEditorForm/variable-editor-form-model.d.ts +2 -2
  185. package/dist/components/Variables/VariableEditorForm/variable-editor-form-model.d.ts.map +1 -1
  186. package/dist/components/Variables/VariableEditorForm/variable-editor-form-model.js +6 -6
  187. package/dist/components/Variables/VariableEditorForm/variable-editor-form-model.js.map +1 -1
  188. package/dist/components/Variables/index.js +2 -2
  189. package/dist/components/Variables/index.js.map +1 -1
  190. package/dist/components/Variables/variable-model.d.ts +4 -4
  191. package/dist/components/Variables/variable-model.d.ts.map +1 -1
  192. package/dist/components/Variables/variable-model.js +3 -3
  193. package/dist/components/Variables/variable-model.js.map +1 -1
  194. package/dist/components/index.js +21 -21
  195. package/dist/components/index.js.map +1 -1
  196. package/dist/constants/index.js +2 -2
  197. package/dist/constants/index.js.map +1 -1
  198. package/dist/context/ValidationProvider.d.ts +5 -5
  199. package/dist/context/ValidationProvider.d.ts.map +1 -1
  200. package/dist/context/ValidationProvider.js +5 -5
  201. package/dist/context/ValidationProvider.js.map +1 -1
  202. package/dist/context/index.js +1 -1
  203. package/dist/context/index.js.map +1 -1
  204. package/dist/index.js +9 -9
  205. package/dist/index.js.map +1 -1
  206. package/dist/model/alerts-queries.d.ts +4 -4
  207. package/dist/model/alerts-queries.d.ts.map +1 -1
  208. package/dist/model/alerts-queries.js.map +1 -1
  209. package/dist/model/annotations.d.ts +3 -3
  210. package/dist/model/annotations.d.ts.map +1 -1
  211. package/dist/model/annotations.js.map +1 -1
  212. package/dist/model/calculations.d.ts +1 -1
  213. package/dist/model/calculations.d.ts.map +1 -1
  214. package/dist/model/calculations.js.map +1 -1
  215. package/dist/model/datasource.d.ts +2 -2
  216. package/dist/model/datasource.d.ts.map +1 -1
  217. package/dist/model/datasource.js.map +1 -1
  218. package/dist/model/explore.d.ts +2 -2
  219. package/dist/model/explore.d.ts.map +1 -1
  220. package/dist/model/explore.js.map +1 -1
  221. package/dist/model/index.js +17 -17
  222. package/dist/model/index.js.map +1 -1
  223. package/dist/model/json-queries.d.ts +3 -3
  224. package/dist/model/json-queries.d.ts.map +1 -1
  225. package/dist/model/json-queries.js.map +1 -1
  226. package/dist/model/legend.d.ts +2 -2
  227. package/dist/model/legend.d.ts.map +1 -1
  228. package/dist/model/legend.js +2 -2
  229. package/dist/model/legend.js.map +1 -1
  230. package/dist/model/log-queries.d.ts +3 -3
  231. package/dist/model/log-queries.d.ts.map +1 -1
  232. package/dist/model/log-queries.js.map +1 -1
  233. package/dist/model/panels.d.ts +4 -4
  234. package/dist/model/panels.d.ts.map +1 -1
  235. package/dist/model/panels.js.map +1 -1
  236. package/dist/model/plugin-base.d.ts +1 -1
  237. package/dist/model/plugin-base.d.ts.map +1 -1
  238. package/dist/model/plugin-base.js.map +1 -1
  239. package/dist/model/plugin-loading.d.ts +1 -1
  240. package/dist/model/plugin-loading.d.ts.map +1 -1
  241. package/dist/model/plugin-loading.js +1 -1
  242. package/dist/model/plugin-loading.js.map +1 -1
  243. package/dist/model/plugins.d.ts +14 -14
  244. package/dist/model/plugins.d.ts.map +1 -1
  245. package/dist/model/plugins.js.map +1 -1
  246. package/dist/model/profile-queries.d.ts +4 -4
  247. package/dist/model/profile-queries.d.ts.map +1 -1
  248. package/dist/model/profile-queries.js.map +1 -1
  249. package/dist/model/silences-queries.d.ts +4 -4
  250. package/dist/model/silences-queries.d.ts.map +1 -1
  251. package/dist/model/silences-queries.js.map +1 -1
  252. package/dist/model/time-series-queries.d.ts +4 -4
  253. package/dist/model/time-series-queries.d.ts.map +1 -1
  254. package/dist/model/time-series-queries.js.map +1 -1
  255. package/dist/model/trace-queries.d.ts +4 -4
  256. package/dist/model/trace-queries.d.ts.map +1 -1
  257. package/dist/model/trace-queries.js.map +1 -1
  258. package/dist/model/variables.d.ts +3 -3
  259. package/dist/model/variables.d.ts.map +1 -1
  260. package/dist/model/variables.js.map +1 -1
  261. package/dist/remote/PluginLoaderComponent.d.ts +1 -1
  262. package/dist/remote/PluginLoaderComponent.d.ts.map +1 -1
  263. package/dist/remote/PluginLoaderComponent.js +2 -2
  264. package/dist/remote/PluginLoaderComponent.js.map +1 -1
  265. package/dist/remote/PluginRuntime.d.ts +11 -2
  266. package/dist/remote/PluginRuntime.d.ts.map +1 -1
  267. package/dist/remote/PluginRuntime.js +65 -54
  268. package/dist/remote/PluginRuntime.js.map +1 -1
  269. package/dist/remote/index.d.ts +1 -0
  270. package/dist/remote/index.d.ts.map +1 -1
  271. package/dist/remote/index.js +3 -2
  272. package/dist/remote/index.js.map +1 -1
  273. package/dist/remote/remotePluginLoader.d.ts +2 -2
  274. package/dist/remote/remotePluginLoader.d.ts.map +1 -1
  275. package/dist/remote/remotePluginLoader.js +3 -3
  276. package/dist/remote/remotePluginLoader.js.map +1 -1
  277. package/dist/runtime/DataQueriesProvider/DataQueriesProvider.d.ts +3 -3
  278. package/dist/runtime/DataQueriesProvider/DataQueriesProvider.d.ts.map +1 -1
  279. package/dist/runtime/DataQueriesProvider/DataQueriesProvider.js +10 -10
  280. package/dist/runtime/DataQueriesProvider/DataQueriesProvider.js.map +1 -1
  281. package/dist/runtime/DataQueriesProvider/index.js +2 -2
  282. package/dist/runtime/DataQueriesProvider/index.js.map +1 -1
  283. package/dist/runtime/DataQueriesProvider/model.d.ts +3 -3
  284. package/dist/runtime/DataQueriesProvider/model.d.ts.map +1 -1
  285. package/dist/runtime/DataQueriesProvider/model.js.map +1 -1
  286. package/dist/runtime/RouterProvider.d.ts +2 -1
  287. package/dist/runtime/RouterProvider.d.ts.map +1 -1
  288. package/dist/runtime/RouterProvider.js +3 -3
  289. package/dist/runtime/RouterProvider.js.map +1 -1
  290. package/dist/runtime/TimeRangeProvider/TimeRangeProvider.d.ts +3 -2
  291. package/dist/runtime/TimeRangeProvider/TimeRangeProvider.d.ts.map +1 -1
  292. package/dist/runtime/TimeRangeProvider/TimeRangeProvider.js +6 -6
  293. package/dist/runtime/TimeRangeProvider/TimeRangeProvider.js.map +1 -1
  294. package/dist/runtime/TimeRangeProvider/TimeRangeProviders.d.ts +3 -2
  295. package/dist/runtime/TimeRangeProvider/TimeRangeProviders.d.ts.map +1 -1
  296. package/dist/runtime/TimeRangeProvider/TimeRangeProviders.js +4 -4
  297. package/dist/runtime/TimeRangeProvider/TimeRangeProviders.js.map +1 -1
  298. package/dist/runtime/TimeRangeProvider/TimeRangeSettingsProvider.d.ts +6 -2
  299. package/dist/runtime/TimeRangeProvider/TimeRangeSettingsProvider.d.ts.map +1 -1
  300. package/dist/runtime/TimeRangeProvider/TimeRangeSettingsProvider.js +52 -4
  301. package/dist/runtime/TimeRangeProvider/TimeRangeSettingsProvider.js.map +1 -1
  302. package/dist/runtime/TimeRangeProvider/index.js +4 -4
  303. package/dist/runtime/TimeRangeProvider/index.js.map +1 -1
  304. package/dist/runtime/TimeRangeProvider/query-params.d.ts +3 -3
  305. package/dist/runtime/TimeRangeProvider/query-params.d.ts.map +1 -1
  306. package/dist/runtime/TimeRangeProvider/query-params.js +4 -4
  307. package/dist/runtime/TimeRangeProvider/query-params.js.map +1 -1
  308. package/dist/runtime/TimeRangeProvider/refresh-interval.d.ts +1 -1
  309. package/dist/runtime/TimeRangeProvider/refresh-interval.d.ts.map +1 -1
  310. package/dist/runtime/TimeRangeProvider/refresh-interval.js +2 -2
  311. package/dist/runtime/TimeRangeProvider/refresh-interval.js.map +1 -1
  312. package/dist/runtime/UsageMetricsProvider.d.ts +3 -3
  313. package/dist/runtime/UsageMetricsProvider.d.ts.map +1 -1
  314. package/dist/runtime/UsageMetricsProvider.js +3 -3
  315. package/dist/runtime/UsageMetricsProvider.js.map +1 -1
  316. package/dist/runtime/alerts-queries.d.ts +2 -2
  317. package/dist/runtime/alerts-queries.d.ts.map +1 -1
  318. package/dist/runtime/alerts-queries.js +5 -5
  319. package/dist/runtime/alerts-queries.js.map +1 -1
  320. package/dist/runtime/annotations.d.ts +2 -2
  321. package/dist/runtime/annotations.d.ts.map +1 -1
  322. package/dist/runtime/annotations.js +6 -6
  323. package/dist/runtime/annotations.js.map +1 -1
  324. package/dist/runtime/builtin-variables.d.ts +2 -2
  325. package/dist/runtime/builtin-variables.d.ts.map +1 -1
  326. package/dist/runtime/builtin-variables.js +1 -1
  327. package/dist/runtime/builtin-variables.js.map +1 -1
  328. package/dist/runtime/datasources.d.ts +2 -2
  329. package/dist/runtime/datasources.d.ts.map +1 -1
  330. package/dist/runtime/datasources.js +2 -2
  331. package/dist/runtime/datasources.js.map +1 -1
  332. package/dist/runtime/index.js +16 -16
  333. package/dist/runtime/index.js.map +1 -1
  334. package/dist/runtime/item-actions.d.ts +3 -3
  335. package/dist/runtime/item-actions.d.ts.map +1 -1
  336. package/dist/runtime/item-actions.js +1 -1
  337. package/dist/runtime/item-actions.js.map +1 -1
  338. package/dist/runtime/json-queries.d.ts +2 -2
  339. package/dist/runtime/json-queries.d.ts.map +1 -1
  340. package/dist/runtime/json-queries.js +4 -4
  341. package/dist/runtime/json-queries.js.map +1 -1
  342. package/dist/runtime/log-queries.d.ts +3 -3
  343. package/dist/runtime/log-queries.d.ts.map +1 -1
  344. package/dist/runtime/log-queries.js +5 -5
  345. package/dist/runtime/log-queries.js.map +1 -1
  346. package/dist/runtime/plugin-registry.d.ts +3 -3
  347. package/dist/runtime/plugin-registry.d.ts.map +1 -1
  348. package/dist/runtime/plugin-registry.js +2 -2
  349. package/dist/runtime/plugin-registry.js.map +1 -1
  350. package/dist/runtime/profile-queries.d.ts +2 -2
  351. package/dist/runtime/profile-queries.d.ts.map +1 -1
  352. package/dist/runtime/profile-queries.js +4 -4
  353. package/dist/runtime/profile-queries.js.map +1 -1
  354. package/dist/runtime/silences-queries.d.ts +2 -2
  355. package/dist/runtime/silences-queries.d.ts.map +1 -1
  356. package/dist/runtime/silences-queries.js +5 -5
  357. package/dist/runtime/silences-queries.js.map +1 -1
  358. package/dist/runtime/time-series-queries.d.ts +3 -3
  359. package/dist/runtime/time-series-queries.d.ts.map +1 -1
  360. package/dist/runtime/time-series-queries.js +6 -6
  361. package/dist/runtime/time-series-queries.js.map +1 -1
  362. package/dist/runtime/trace-queries.d.ts +2 -2
  363. package/dist/runtime/trace-queries.d.ts.map +1 -1
  364. package/dist/runtime/trace-queries.js +6 -6
  365. package/dist/runtime/trace-queries.js.map +1 -1
  366. package/dist/runtime/utils.d.ts +1 -1
  367. package/dist/runtime/utils.d.ts.map +1 -1
  368. package/dist/runtime/utils.js.map +1 -1
  369. package/dist/runtime/variables.d.ts +1 -1
  370. package/dist/runtime/variables.d.ts.map +1 -1
  371. package/dist/runtime/variables.js +4 -4
  372. package/dist/runtime/variables.js.map +1 -1
  373. package/dist/schema/index.js +1 -1
  374. package/dist/schema/index.js.map +1 -1
  375. package/dist/schema/panel.d.ts +2 -2
  376. package/dist/schema/panel.d.ts.map +1 -1
  377. package/dist/schema/panel.js +2 -2
  378. package/dist/schema/panel.js.map +1 -1
  379. package/dist/test/index.js +2 -2
  380. package/dist/test/index.js.map +1 -1
  381. package/dist/test/mock-data.d.ts +1 -1
  382. package/dist/test/mock-data.d.ts.map +1 -1
  383. package/dist/test/mock-data.js.map +1 -1
  384. package/dist/test/render-hook.d.ts +2 -2
  385. package/dist/test/render-hook.d.ts.map +1 -1
  386. package/dist/test/render-hook.js +2 -2
  387. package/dist/test/render-hook.js.map +1 -1
  388. package/dist/test/render.d.ts +3 -3
  389. package/dist/test/render.d.ts.map +1 -1
  390. package/dist/test/render.js +3 -3
  391. package/dist/test/render.js.map +1 -1
  392. package/dist/test/setup-tests.js +1 -1
  393. package/dist/test/test-plugins/bert/index.d.ts +3 -3
  394. package/dist/test/test-plugins/bert/index.d.ts.map +1 -1
  395. package/dist/test/test-plugins/bert/index.js.map +1 -1
  396. package/dist/test/test-plugins/ernie/index.d.ts +1 -1
  397. package/dist/test/test-plugins/ernie/index.d.ts.map +1 -1
  398. package/dist/test/test-plugins/ernie/index.js.map +1 -1
  399. package/dist/test/test-plugins/index.d.ts +1 -1
  400. package/dist/test/test-plugins/index.d.ts.map +1 -1
  401. package/dist/test/test-plugins/index.js +5 -5
  402. package/dist/test/test-plugins/index.js.map +1 -1
  403. package/dist/test/utils.d.ts +2 -2
  404. package/dist/test/utils.d.ts.map +1 -1
  405. package/dist/test/utils.js +4 -4
  406. package/dist/test/utils.js.map +1 -1
  407. package/dist/test-utils/index.js +1 -1
  408. package/dist/test-utils/index.js.map +1 -1
  409. package/dist/test-utils/mock-plugin-registry.d.ts +2 -2
  410. package/dist/test-utils/mock-plugin-registry.d.ts.map +1 -1
  411. package/dist/test-utils/mock-plugin-registry.js +1 -1
  412. package/dist/test-utils/mock-plugin-registry.js.map +1 -1
  413. package/dist/utils/csv-export.js +1 -1
  414. package/dist/utils/csv-export.js.map +1 -1
  415. package/dist/utils/event.js +1 -1
  416. package/dist/utils/index.js +3 -3
  417. package/dist/utils/index.js.map +1 -1
  418. package/dist/utils/variables.js +1 -1
  419. package/package.json +9 -9
  420. package/dist/cjs/components/Annotations/AnnotationEditorForm/AnnotationEditorForm.js +0 -283
  421. package/dist/cjs/components/Annotations/AnnotationEditorForm/AnnotationPreview.js +0 -197
  422. package/dist/cjs/components/Annotations/AnnotationEditorForm/index.js +0 -30
  423. package/dist/cjs/components/Annotations/constants.js +0 -23
  424. package/dist/cjs/components/Annotations/index.js +0 -31
  425. package/dist/cjs/components/CalculationSelector/CalculationSelector.js +0 -49
  426. package/dist/cjs/components/CalculationSelector/index.js +0 -30
  427. package/dist/cjs/components/DatasourceEditorForm/DatasourceEditorForm.js +0 -271
  428. package/dist/cjs/components/DatasourceEditorForm/index.js +0 -30
  429. package/dist/cjs/components/DatasourceSelect/DatasourceSelect.js +0 -266
  430. package/dist/cjs/components/DatasourceSelect/index.js +0 -30
  431. package/dist/cjs/components/DatasourceTestConnectionButton/DatasourceTestConnectionButton.js +0 -53
  432. package/dist/cjs/components/DatasourceTestConnectionButton/index.js +0 -30
  433. package/dist/cjs/components/HTTPSettingsEditor/HTTPSettingsEditor.js +0 -593
  434. package/dist/cjs/components/HTTPSettingsEditor/index.js +0 -30
  435. package/dist/cjs/components/ItemSelectionActionsOptionsEditor/ItemSelectionActionsOptionsEditor.js +0 -1175
  436. package/dist/cjs/components/ItemSelectionActionsOptionsEditor/index.js +0 -30
  437. package/dist/cjs/components/LayoutEditor/LayoutEditor.js +0 -123
  438. package/dist/cjs/components/LayoutEditor/RepeatLayoutPreview.js +0 -105
  439. package/dist/cjs/components/LayoutEditor/RepeatVariableEditor.js +0 -176
  440. package/dist/cjs/components/LayoutEditor/index.js +0 -32
  441. package/dist/cjs/components/LegendOptionsEditor/LegendOptionsEditor.js +0 -211
  442. package/dist/cjs/components/LegendOptionsEditor/index.js +0 -30
  443. package/dist/cjs/components/LinksEditor/LinksEditor.js +0 -162
  444. package/dist/cjs/components/LinksEditor/index.js +0 -30
  445. package/dist/cjs/components/MetricLabelInput/MetricLabelInput.js +0 -41
  446. package/dist/cjs/components/MetricLabelInput/index.js +0 -30
  447. package/dist/cjs/components/MultiQueryEditor/MultiQueryEditor.js +0 -162
  448. package/dist/cjs/components/MultiQueryEditor/QueryEditorContainer.js +0 -250
  449. package/dist/cjs/components/MultiQueryEditor/index.js +0 -31
  450. package/dist/cjs/components/MultiQueryEditor/utils.js +0 -36
  451. package/dist/cjs/components/OptionsEditorRadios/OptionsEditorRadios.js +0 -69
  452. package/dist/cjs/components/OptionsEditorRadios/index.js +0 -30
  453. package/dist/cjs/components/OptionsEditorTabPanel/OptionsEditorTabPanel.js +0 -39
  454. package/dist/cjs/components/OptionsEditorTabPanel/index.js +0 -30
  455. package/dist/cjs/components/OptionsEditorTabs/OptionsEditorTabs.js +0 -61
  456. package/dist/cjs/components/OptionsEditorTabs/index.js +0 -30
  457. package/dist/cjs/components/PanelSpecEditor/PanelAnnotationsEditor.js +0 -246
  458. package/dist/cjs/components/PanelSpecEditor/PanelSpecEditor.js +0 -144
  459. package/dist/cjs/components/PanelSpecEditor/index.js +0 -30
  460. package/dist/cjs/components/PluginEditor/PluginEditor.js +0 -99
  461. package/dist/cjs/components/PluginEditor/index.js +0 -31
  462. package/dist/cjs/components/PluginEditor/plugin-editor-api.js +0 -136
  463. package/dist/cjs/components/PluginKindSelect/PluginKindSelect.js +0 -109
  464. package/dist/cjs/components/PluginKindSelect/index.js +0 -30
  465. package/dist/cjs/components/PluginRegistry/PluginRegistry.js +0 -86
  466. package/dist/cjs/components/PluginRegistry/getPluginSearchHelper.js +0 -92
  467. package/dist/cjs/components/PluginRegistry/index.js +0 -30
  468. package/dist/cjs/components/PluginRegistry/plugin-indexes.js +0 -88
  469. package/dist/cjs/components/PluginSpecEditor/DatasourceSpecEditor.js +0 -70
  470. package/dist/cjs/components/PluginSpecEditor/PluginSpecEditor.js +0 -69
  471. package/dist/cjs/components/PluginSpecEditor/index.js +0 -30
  472. package/dist/cjs/components/SelectionOptionsEditor/SelectionOptionsEditor.js +0 -43
  473. package/dist/cjs/components/SelectionOptionsEditor/index.js +0 -30
  474. package/dist/cjs/components/TimeRangeControls/TimeRangeControls.js +0 -235
  475. package/dist/cjs/components/TimeRangeControls/index.js +0 -30
  476. package/dist/cjs/components/Variables/VariableEditorForm/VariableEditorForm.js +0 -613
  477. package/dist/cjs/components/Variables/VariableEditorForm/VariablePreview.js +0 -193
  478. package/dist/cjs/components/Variables/VariableEditorForm/index.js +0 -32
  479. package/dist/cjs/components/Variables/VariableEditorForm/variable-editor-form-model.js +0 -143
  480. package/dist/cjs/components/Variables/index.js +0 -31
  481. package/dist/cjs/components/Variables/variable-model.js +0 -211
  482. package/dist/cjs/components/index.js +0 -50
  483. package/dist/cjs/constants/index.js +0 -31
  484. package/dist/cjs/constants/repeat.js +0 -32
  485. package/dist/cjs/constants/user-interface-text.js +0 -32
  486. package/dist/cjs/context/ValidationProvider.js +0 -77
  487. package/dist/cjs/context/index.js +0 -30
  488. package/dist/cjs/index.js +0 -38
  489. package/dist/cjs/model/alerts-queries.js +0 -16
  490. package/dist/cjs/model/annotations.js +0 -16
  491. package/dist/cjs/model/calculations.js +0 -178
  492. package/dist/cjs/model/datasource.js +0 -16
  493. package/dist/cjs/model/explore.js +0 -16
  494. package/dist/cjs/model/index.js +0 -46
  495. package/dist/cjs/model/json-queries.js +0 -16
  496. package/dist/cjs/model/legend.js +0 -111
  497. package/dist/cjs/model/log-queries.js +0 -16
  498. package/dist/cjs/model/log-volume-utils.js +0 -124
  499. package/dist/cjs/model/panels.js +0 -16
  500. package/dist/cjs/model/plugin-base.js +0 -16
  501. package/dist/cjs/model/plugin-loading.js +0 -56
  502. package/dist/cjs/model/plugins.js +0 -26
  503. package/dist/cjs/model/profile-queries.js +0 -16
  504. package/dist/cjs/model/silences-queries.js +0 -16
  505. package/dist/cjs/model/time-series-queries.js +0 -26
  506. package/dist/cjs/model/trace-queries.js +0 -16
  507. package/dist/cjs/model/variables.js +0 -16
  508. package/dist/cjs/remote/PersesPlugin.types.js +0 -16
  509. package/dist/cjs/remote/PluginLoaderComponent.js +0 -87
  510. package/dist/cjs/remote/PluginRuntime.js +0 -323
  511. package/dist/cjs/remote/index.js +0 -31
  512. package/dist/cjs/remote/remotePluginLoader.js +0 -101
  513. package/dist/cjs/runtime/DataQueriesProvider/DataQueriesProvider.js +0 -162
  514. package/dist/cjs/runtime/DataQueriesProvider/index.js +0 -31
  515. package/dist/cjs/runtime/DataQueriesProvider/model.js +0 -34
  516. package/dist/cjs/runtime/RouterProvider.js +0 -114
  517. package/dist/cjs/runtime/TimeRangeProvider/TimeRangeProvider.js +0 -215
  518. package/dist/cjs/runtime/TimeRangeProvider/TimeRangeProviders.js +0 -66
  519. package/dist/cjs/runtime/TimeRangeProvider/TimeRangeSettingsProvider.js +0 -126
  520. package/dist/cjs/runtime/TimeRangeProvider/index.js +0 -33
  521. package/dist/cjs/runtime/TimeRangeProvider/query-params.js +0 -250
  522. package/dist/cjs/runtime/TimeRangeProvider/refresh-interval.js +0 -30
  523. package/dist/cjs/runtime/UsageMetricsProvider.js +0 -102
  524. package/dist/cjs/runtime/alerts-queries.js +0 -101
  525. package/dist/cjs/runtime/annotations.js +0 -148
  526. package/dist/cjs/runtime/builtin-variables.js +0 -81
  527. package/dist/cjs/runtime/datasources.js +0 -80
  528. package/dist/cjs/runtime/index.js +0 -45
  529. package/dist/cjs/runtime/item-actions.js +0 -302
  530. package/dist/cjs/runtime/json-queries.js +0 -70
  531. package/dist/cjs/runtime/log-queries.js +0 -76
  532. package/dist/cjs/runtime/plugin-registry.js +0 -135
  533. package/dist/cjs/runtime/profile-queries.js +0 -73
  534. package/dist/cjs/runtime/silences-queries.js +0 -101
  535. package/dist/cjs/runtime/time-series-queries.js +0 -165
  536. package/dist/cjs/runtime/trace-queries.js +0 -106
  537. package/dist/cjs/runtime/utils.js +0 -39
  538. package/dist/cjs/runtime/variables.js +0 -160
  539. package/dist/cjs/schema/index.js +0 -30
  540. package/dist/cjs/schema/panel.js +0 -56
  541. package/dist/cjs/test/index.js +0 -31
  542. package/dist/cjs/test/mock-data.js +0 -366
  543. package/dist/cjs/test/render-hook.js +0 -31
  544. package/dist/cjs/test/render.js +0 -31
  545. package/dist/cjs/test/setup-tests.js +0 -26
  546. package/dist/cjs/test/test-plugins/bert/index.js +0 -99
  547. package/dist/cjs/test/test-plugins/ernie/index.js +0 -149
  548. package/dist/cjs/test/test-plugins/index.js +0 -81
  549. package/dist/cjs/test/utils.js +0 -58
  550. package/dist/cjs/test-utils/index.js +0 -30
  551. package/dist/cjs/test-utils/mock-plugin-registry.js +0 -81
  552. package/dist/cjs/utils/csv-export.js +0 -248
  553. package/dist/cjs/utils/event.js +0 -30
  554. package/dist/cjs/utils/index.js +0 -32
  555. package/dist/cjs/utils/variables.js +0 -44
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/model/calculations.ts"],"sourcesContent":["// Copyright 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\nimport { TimeSeriesValueTuple } from './time-series-queries';\n\nexport const DEFAULT_CALCULATION: CalculationType = 'last'; // aligned with cue\n\nexport const CalculationsMap = {\n first: first,\n last: last,\n 'first-number': firstNumber,\n 'last-number': lastNumber,\n mean: mean,\n sum: sum,\n min: min,\n max: max,\n};\n\nexport type CalculationType = keyof typeof CalculationsMap;\n\nexport type CalculationConfig = {\n label: string;\n description: string;\n};\n\nexport const CALCULATIONS_CONFIG: Readonly<Record<CalculationType, CalculationConfig>> = {\n first: {\n label: 'First',\n description: 'First value',\n },\n last: {\n label: 'Last',\n description: 'Last value',\n },\n 'first-number': {\n label: 'First *',\n description: 'First numeric value',\n },\n 'last-number': {\n label: 'Last *',\n description: 'Last numeric value',\n },\n mean: {\n label: 'Avg',\n description: 'Average value excluding nulls',\n },\n sum: {\n label: 'Sum',\n description: 'The sum of all values',\n },\n min: {\n label: 'Min',\n description: 'Minimum value',\n },\n max: {\n label: 'Max',\n description: 'Maximum value',\n },\n} as const;\n\ntype CalculationValue = number | null | undefined;\n\n/**\n * Calculate a multiple values for a set of time series data.\n *\n * @param values - Array of time series data.\n * @param includeCalculations - Array of calculations to include.\n */\nexport function getCalculations<IncludeCalcs extends CalculationType[]>(\n values: TimeSeriesValueTuple[],\n includeCalculations: IncludeCalcs,\n): Record<\n // This extract combined with the generics above keeps the key of the returned\n // record to *just* the specified calculations.\n Extract<CalculationType, IncludeCalcs[number]>,\n CalculationValue\n> {\n const calculations = includeCalculations.reduce(\n (initResult, calculation) => {\n initResult[calculation] = undefined;\n return initResult;\n },\n {} as Record<string, CalculationValue>,\n );\n\n // We save these values as separate values instead of directly setting them\n // in the calculations because they are needed by multiple calculations.\n let nonNullCount = 0;\n let sum = 0;\n\n // We use this large function capable of performing one or more calculations\n // in a single iteration of the data to minimize the performance impact of\n // generating multiple calculations for large timeseries values. This is\n // less optimized for certain single calculations when done in isolation (e.g.\n // `last`), but will be more performant in the more expensive cases where\n // multiple values are being used (e.g. table legend).\n values.forEach((tuple, i) => {\n const value = tuple[1];\n\n if (i === 0 && 'first' in calculations) {\n calculations.first = value;\n }\n if (i === values.length - 1 && 'last' in calculations) {\n calculations.last = value;\n }\n\n // Handling specific to non-null values.\n if (typeof value === 'number') {\n nonNullCount += 1;\n sum += value;\n\n if ('first-number' in calculations && calculations['first-number'] === undefined) {\n // Save the first number we see.\n calculations['first-number'] = value;\n }\n\n if ('last-number' in calculations) {\n // Keep setting the numbers we see, which will eventually be set to the\n // last number when finished iterating.\n calculations['last-number'] = value;\n }\n\n if ('min' in calculations) {\n if (typeof calculations.min !== 'number') {\n // Init the first time we see a number\n calculations.min = value;\n } else {\n // Use lowest value once initialized\n calculations.min = Math.min(calculations.min, value);\n }\n }\n\n if ('max' in calculations) {\n if (typeof calculations.max !== 'number') {\n // Init the first time we see a number\n calculations.max = value;\n } else {\n // Use highest value once initialized\n calculations.max = Math.max(calculations.max, value);\n }\n }\n }\n });\n\n // Set calculations that require iterating over all values.\n if (nonNullCount > 0 && 'sum' in calculations) {\n calculations.sum = sum;\n }\n\n if (nonNullCount > 0 && 'mean' in calculations) {\n calculations.mean = sum / nonNullCount;\n }\n\n return calculations;\n}\n\n/**\n * Calculate a single value for a set of time series data.\n *\n * Use `getCalculations` instead if you need multiple calculations.\n *\n * @param values - Array of time series data.\n * @param calculation - Name of the calculation to calculate.\n */\nexport function getCalculation(values: TimeSeriesValueTuple[], calculation: CalculationType): CalculationValue {\n return getCalculations(values, [calculation])[calculation];\n}\n\nfunction first(values: TimeSeriesValueTuple[]): CalculationValue {\n return getCalculation(values, 'first');\n}\n\nfunction last(values: TimeSeriesValueTuple[]): CalculationValue {\n return getCalculation(values, 'last');\n}\n\nfunction firstNumber(values: TimeSeriesValueTuple[]): CalculationValue {\n return getCalculation(values, 'first-number');\n}\n\nfunction lastNumber(values: TimeSeriesValueTuple[]): CalculationValue {\n return getCalculation(values, 'last-number');\n}\n\nfunction mean(values: TimeSeriesValueTuple[]): CalculationValue {\n return getCalculation(values, 'mean');\n}\n\nfunction sum(values: TimeSeriesValueTuple[]): CalculationValue {\n return getCalculation(values, 'sum');\n}\n\nfunction min(values: TimeSeriesValueTuple[]): CalculationValue {\n return getCalculation(values, 'min');\n}\n\nfunction max(values: TimeSeriesValueTuple[]): CalculationValue {\n return getCalculation(values, 'max');\n}\n"],"names":["DEFAULT_CALCULATION","CalculationsMap","first","last","firstNumber","lastNumber","mean","sum","min","max","CALCULATIONS_CONFIG","label","description","getCalculations","values","includeCalculations","calculations","reduce","initResult","calculation","undefined","nonNullCount","forEach","tuple","i","value","length","Math","getCalculation"],"mappings":"AAAA,+BAA+B;AAC/B,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAIjC,OAAO,MAAMA,sBAAuC,OAAO,CAAC,mBAAmB;AAE/E,OAAO,MAAMC,kBAAkB;IAC7BC,OAAOA;IACPC,MAAMA;IACN,gBAAgBC;IAChB,eAAeC;IACfC,MAAMA;IACNC,KAAKA;IACLC,KAAKA;IACLC,KAAKA;AACP,EAAE;AASF,OAAO,MAAMC,sBAA4E;IACvFR,OAAO;QACLS,OAAO;QACPC,aAAa;IACf;IACAT,MAAM;QACJQ,OAAO;QACPC,aAAa;IACf;IACA,gBAAgB;QACdD,OAAO;QACPC,aAAa;IACf;IACA,eAAe;QACbD,OAAO;QACPC,aAAa;IACf;IACAN,MAAM;QACJK,OAAO;QACPC,aAAa;IACf;IACAL,KAAK;QACHI,OAAO;QACPC,aAAa;IACf;IACAJ,KAAK;QACHG,OAAO;QACPC,aAAa;IACf;IACAH,KAAK;QACHE,OAAO;QACPC,aAAa;IACf;AACF,EAAW;AAIX;;;;;CAKC,GACD,OAAO,SAASC,gBACdC,MAA8B,EAC9BC,mBAAiC;IAOjC,MAAMC,eAAeD,oBAAoBE,MAAM,CAC7C,CAACC,YAAYC;QACXD,UAAU,CAACC,YAAY,GAAGC;QAC1B,OAAOF;IACT,GACA,CAAC;IAGH,2EAA2E;IAC3E,wEAAwE;IACxE,IAAIG,eAAe;IACnB,IAAId,MAAM;IAEV,4EAA4E;IAC5E,0EAA0E;IAC1E,wEAAwE;IACxE,8EAA8E;I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;;;;;CAOC,GACD,OAAO,SAASY,eAAed,MAA8B,EAAEK,WAA4B;IACzF,OAAON,gBAAgBC,QAAQ;QAACK;KAAY,CAAC,CAACA,YAAY;AAC5D;AAEA,SAASjB,MAAMY,MAA8B;IAC3C,OAAOc,eAAed,QAAQ;AAChC;AAEA,SAASX,KAAKW,MAA8B;IAC1C,OAAOc,eAAed,QAAQ;AAChC;AAEA,SAASV,YAAYU,MAA8B;IACjD,OAAOc,eAAed,QAAQ;AAChC;AAEA,SAAST,WAAWS,MAA8B;IAChD,OAAOc,eAAed,QAAQ;AAChC;AAEA,SAASR,KAAKQ,MAA8B;IAC1C,OAAOc,eAAed,QAAQ;AAChC;AAEA,SAASP,IAAIO,MAA8B;IACzC,OAAOc,eAAed,QAAQ;AAChC;AAEA,SAASN,IAAIM,MAA8B;IACzC,OAAOc,eAAed,QAAQ;AAChC;AAEA,SAASL,IAAIK,MAA8B;IACzC,OAAOc,eAAed,QAAQ;AAChC"}
1
+ {"version":3,"sources":["../../src/model/calculations.ts"],"sourcesContent":["// Copyright 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\nimport type { TimeSeriesValueTuple } from './time-series-queries';\n\nexport const DEFAULT_CALCULATION: CalculationType = 'last'; // aligned with cue\n\nexport const CalculationsMap = {\n first: first,\n last: last,\n 'first-number': firstNumber,\n 'last-number': lastNumber,\n mean: mean,\n sum: sum,\n min: min,\n max: max,\n};\n\nexport type CalculationType = keyof typeof CalculationsMap;\n\nexport type CalculationConfig = {\n label: string;\n description: string;\n};\n\nexport const CALCULATIONS_CONFIG: Readonly<Record<CalculationType, CalculationConfig>> = {\n first: {\n label: 'First',\n description: 'First value',\n },\n last: {\n label: 'Last',\n description: 'Last value',\n },\n 'first-number': {\n label: 'First *',\n description: 'First numeric value',\n },\n 'last-number': {\n label: 'Last *',\n description: 'Last numeric value',\n },\n mean: {\n label: 'Avg',\n description: 'Average value excluding nulls',\n },\n sum: {\n label: 'Sum',\n description: 'The sum of all values',\n },\n min: {\n label: 'Min',\n description: 'Minimum value',\n },\n max: {\n label: 'Max',\n description: 'Maximum value',\n },\n} as const;\n\ntype CalculationValue = number | null | undefined;\n\n/**\n * Calculate a multiple values for a set of time series data.\n *\n * @param values - Array of time series data.\n * @param includeCalculations - Array of calculations to include.\n */\nexport function getCalculations<IncludeCalcs extends CalculationType[]>(\n values: TimeSeriesValueTuple[],\n includeCalculations: IncludeCalcs,\n): Record<\n // This extract combined with the generics above keeps the key of the returned\n // record to *just* the specified calculations.\n Extract<CalculationType, IncludeCalcs[number]>,\n CalculationValue\n> {\n const calculations = includeCalculations.reduce(\n (initResult, calculation) => {\n initResult[calculation] = undefined;\n return initResult;\n },\n {} as Record<string, CalculationValue>,\n );\n\n // We save these values as separate values instead of directly setting them\n // in the calculations because they are needed by multiple calculations.\n let nonNullCount = 0;\n let sum = 0;\n\n // We use this large function capable of performing one or more calculations\n // in a single iteration of the data to minimize the performance impact of\n // generating multiple calculations for large timeseries values. This is\n // less optimized for certain single calculations when done in isolation (e.g.\n // `last`), but will be more performant in the more expensive cases where\n // multiple values are being used (e.g. table legend).\n values.forEach((tuple, i) => {\n const value = tuple[1];\n\n if (i === 0 && 'first' in calculations) {\n calculations.first = value;\n }\n if (i === values.length - 1 && 'last' in calculations) {\n calculations.last = value;\n }\n\n // Handling specific to non-null values.\n if (typeof value === 'number') {\n nonNullCount += 1;\n sum += value;\n\n if ('first-number' in calculations && calculations['first-number'] === undefined) {\n // Save the first number we see.\n calculations['first-number'] = value;\n }\n\n if ('last-number' in calculations) {\n // Keep setting the numbers we see, which will eventually be set to the\n // last number when finished iterating.\n calculations['last-number'] = value;\n }\n\n if ('min' in calculations) {\n if (typeof calculations.min !== 'number') {\n // Init the first time we see a number\n calculations.min = value;\n } else {\n // Use lowest value once initialized\n calculations.min = Math.min(calculations.min, value);\n }\n }\n\n if ('max' in calculations) {\n if (typeof calculations.max !== 'number') {\n // Init the first time we see a number\n calculations.max = value;\n } else {\n // Use highest value once initialized\n calculations.max = Math.max(calculations.max, value);\n }\n }\n }\n });\n\n // Set calculations that require iterating over all values.\n if (nonNullCount > 0 && 'sum' in calculations) {\n calculations.sum = sum;\n }\n\n if (nonNullCount > 0 && 'mean' in calculations) {\n calculations.mean = sum / nonNullCount;\n }\n\n return calculations;\n}\n\n/**\n * Calculate a single value for a set of time series data.\n *\n * Use `getCalculations` instead if you need multiple calculations.\n *\n * @param values - Array of time series data.\n * @param calculation - Name of the calculation to calculate.\n */\nexport function getCalculation(values: TimeSeriesValueTuple[], calculation: CalculationType): CalculationValue {\n return getCalculations(values, [calculation])[calculation];\n}\n\nfunction first(values: TimeSeriesValueTuple[]): CalculationValue {\n return getCalculation(values, 'first');\n}\n\nfunction last(values: TimeSeriesValueTuple[]): CalculationValue {\n return getCalculation(values, 'last');\n}\n\nfunction firstNumber(values: TimeSeriesValueTuple[]): CalculationValue {\n return getCalculation(values, 'first-number');\n}\n\nfunction lastNumber(values: TimeSeriesValueTuple[]): CalculationValue {\n return getCalculation(values, 'last-number');\n}\n\nfunction mean(values: TimeSeriesValueTuple[]): CalculationValue {\n return getCalculation(values, 'mean');\n}\n\nfunction sum(values: TimeSeriesValueTuple[]): CalculationValue {\n return getCalculation(values, 'sum');\n}\n\nfunction min(values: TimeSeriesValueTuple[]): CalculationValue {\n return getCalculation(values, 'min');\n}\n\nfunction max(values: TimeSeriesValueTuple[]): CalculationValue {\n return getCalculation(values, 'max');\n}\n"],"names":["DEFAULT_CALCULATION","CalculationsMap","first","last","firstNumber","lastNumber","mean","sum","min","max","CALCULATIONS_CONFIG","label","description","getCalculations","values","includeCalculations","calculations","reduce","initResult","calculation","undefined","nonNullCount","forEach","tuple","i","value","length","Math","getCalculation"],"mappings":"AAAA,+BAA+B;AAC/B,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAIjC,OAAO,MAAMA,sBAAuC,OAAO,CAAC,mBAAmB;AAE/E,OAAO,MAAMC,kBAAkB;IAC7BC,OAAOA;IACPC,MAAMA;IACN,gBAAgBC;IAChB,eAAeC;IACfC,MAAMA;IACNC,KAAKA;IACLC,KAAKA;IACLC,KAAKA;AACP,EAAE;AASF,OAAO,MAAMC,sBAA4E;IACvFR,OAAO;QACLS,OAAO;QACPC,aAAa;IACf;IACAT,MAAM;QACJQ,OAAO;QACPC,aAAa;IACf;IACA,gBAAgB;QACdD,OAAO;QACPC,aAAa;IACf;IACA,eAAe;QACbD,OAAO;QACPC,aAAa;IACf;IACAN,MAAM;QACJK,OAAO;QACPC,aAAa;IACf;IACAL,KAAK;QACHI,OAAO;QACPC,aAAa;IACf;IACAJ,KAAK;QACHG,OAAO;QACPC,aAAa;IACf;IACAH,KAAK;QACHE,OAAO;QACPC,aAAa;IACf;AACF,EAAW;AAIX;;;;;CAKC,GACD,OAAO,SAASC,gBACdC,MAA8B,EAC9BC,mBAAiC;IAOjC,MAAMC,eAAeD,oBAAoBE,MAAM,CAC7C,CAACC,YAAYC;QACXD,UAAU,CAACC,YAAY,GAAGC;QAC1B,OAAOF;IACT,GACA,CAAC;IAGH,2EAA2E;IAC3E,wEAAwE;IACxE,IAAIG,eAAe;IACnB,IAAId,MAAM;IAEV,4EAA4E;IAC5E,0EAA0E;IAC1E,wEAAwE;IACxE,8EAA8E;IAC9E,yEAAyE;IACzE,sDAAsD;IACtDO,OAAOQ,OAAO,CAAC,CAACC,OAAOC;QACrB,MAAMC,QAAQF,KAAK,CAAC,EAAE;QAEtB,IAAIC,MAAM,KA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ASjB,MAAMY,MAA8B;IAC3C,OAAOc,eAAed,QAAQ;AAChC;AAEA,SAASX,KAAKW,MAA8B;IAC1C,OAAOc,eAAed,QAAQ;AAChC;AAEA,SAASV,YAAYU,MAA8B;IACjD,OAAOc,eAAed,QAAQ;AAChC;AAEA,SAAST,WAAWS,MAA8B;IAChD,OAAOc,eAAed,QAAQ;AAChC;AAEA,SAASR,KAAKQ,MAA8B;IAC1C,OAAOc,eAAed,QAAQ;AAChC;AAEA,SAASP,IAAIO,MAA8B;IACzC,OAAOc,eAAed,QAAQ;AAChC;AAEA,SAASN,IAAIM,MAA8B;IACzC,OAAOc,eAAed,QAAQ;AAChC;AAEA,SAASL,IAAIK,MAA8B;IACzC,OAAOc,eAAed,QAAQ;AAChC"}
@@ -1,5 +1,5 @@
1
- import { BuiltinVariableDefinition, UnknownSpec } from '@perses-dev/spec';
2
- import { OptionsEditorProps, Plugin } from './plugin-base';
1
+ import type { BuiltinVariableDefinition, UnknownSpec } from '@perses-dev/spec';
2
+ import type { OptionsEditorProps, Plugin } from './plugin-base';
3
3
  /**
4
4
  * Plugin that defines options for an external system that Perses talks to for data.
5
5
  */
@@ -1 +1 @@
1
- {"version":3,"file":"datasource.d.ts","sourceRoot":"","sources":["../../src/model/datasource.ts"],"names":[],"mappings":"AAaA,OAAO,EAAE,yBAAyB,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAE1E,OAAO,EAAE,kBAAkB,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AAE3D;;GAEG;AACH,MAAM,WAAW,gBAAgB,CAC/B,IAAI,GAAG,WAAW,EAClB,MAAM,GAAG,OAAO,EAChB,sBAAsB,GAAG,qBAAqB,CAAC,IAAI,CAAC,CACpD,SAAQ,MAAM,CAAC,IAAI,EAAE,sBAAsB,CAAC;IAC5C,YAAY,EAAE,CAAC,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,uBAAuB,KAAK,MAAM,CAAC;IAEvE,6BAA6B,CAAC,EAAE,M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AED;;GAEG;AACH,MAAM,WAAW,qBAAqB,CAAC,IAAI,CAAE,SAAQ,kBAAkB,CAAC,IAAI,CAAC;IAC3E,cAAc,CAAC,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;CACtC"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/model/datasource.ts"],"sourcesContent":["// Copyright 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\nimport { BuiltinVariableDefinition, UnknownSpec } from '@perses-dev/spec';\n\nimport { OptionsEditorProps, Plugin } from './plugin-base';\n\n/**\n * Plugin that defines options for an external system that Perses talks to for data.\n */\nexport interface DatasourcePlugin<\n Spec = UnknownSpec,\n Client = unknown,\n OptionsEditorPropsType = DatasourceEditorProps<Spec>,\n> extends Plugin<Spec, OptionsEditorPropsType> {\n createClient: (spec: Spec, options: DatasourceClientOptions) => Client;\n // Provide builtin variable definitions available on the datasource. Optional\n getBuiltinVariableDefinitions?: () => BuiltinVariableDefinition[];\n healthCheckPath?: string;\n}\n\nexport interface DatasourceClientOptions {\n proxyUrl?: string;\n}\n\n/**\n * Common properties for all clients\n */\nexport interface DatasourceClient {\n // TODO: set kind and define healthCheck function\n kind?: string;\n healthCheck?: () => Promise<boolean>;\n}\n\n/**\n * Common props passed to datasource options editor components.\n */\nexport interface DatasourceEditorProps<Spec> extends OptionsEditorProps<Spec> {\n testConnection?: () => Promise<void>;\n}\n"],"names":[],"mappings":"AAAA,+BAA+B;AAC/B,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAiCjC;;CAEC,GACD,WAEC"}
1
+ {"version":3,"sources":["../../src/model/datasource.ts"],"sourcesContent":["// Copyright 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\nimport type { BuiltinVariableDefinition, UnknownSpec } from '@perses-dev/spec';\n\nimport type { OptionsEditorProps, Plugin } from './plugin-base';\n\n/**\n * Plugin that defines options for an external system that Perses talks to for data.\n */\nexport interface DatasourcePlugin<\n Spec = UnknownSpec,\n Client = unknown,\n OptionsEditorPropsType = DatasourceEditorProps<Spec>,\n> extends Plugin<Spec, OptionsEditorPropsType> {\n createClient: (spec: Spec, options: DatasourceClientOptions) => Client;\n // Provide builtin variable definitions available on the datasource. Optional\n getBuiltinVariableDefinitions?: () => BuiltinVariableDefinition[];\n healthCheckPath?: string;\n}\n\nexport interface DatasourceClientOptions {\n proxyUrl?: string;\n}\n\n/**\n * Common properties for all clients\n */\nexport interface DatasourceClient {\n // TODO: set kind and define healthCheck function\n kind?: string;\n healthCheck?: () => Promise<boolean>;\n}\n\n/**\n * Common props passed to datasource options editor components.\n */\nexport interface DatasourceEditorProps<Spec> extends OptionsEditorProps<Spec> {\n testConnection?: () => Promise<void>;\n}\n"],"names":[],"mappings":"AAAA,+BAA+B;AAC/B,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAiCjC;;CAEC,GACD,WAEC"}
@@ -1,5 +1,5 @@
1
- import { UnknownSpec } from '@perses-dev/spec';
2
- import { Plugin } from './plugin-base';
1
+ import type { UnknownSpec } from '@perses-dev/spec';
2
+ import type { Plugin } from './plugin-base';
3
3
  export interface ExploreComponentProps<Spec> {
4
4
  spec: Spec;
5
5
  }
@@ -1 +1 @@
1
- {"version":3,"file":"explore.d.ts","sourceRoot":"","sources":["../../src/model/explore.ts"],"names":[],"mappings":"AAaA,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAE/C,OAAO,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AAEvC,MAAM,WAAW,qBAAqB,CAAC,IAAI;IACzC,IAAI,EAAE,IAAI,CAAC;CACZ;AAED;;GAEG;AACH,MAAM,WAAW,aAAa,CAAC,IAAI,GAAG,WAAW,CAAE,SAAQ,MAAM,CAAC,IAAI,CAAC;IACrE,gBAAgB,EAAE,KAAK,CAAC,aAAa,CAAC,qBAAqB,CAAC,IAAI,CAAC,CAAC,CAAC;CACpE"}
1
+ {"version":3,"file":"explore.d.ts","sourceRoot":"","sources":["../../src/model/explore.ts"],"names":[],"mappings":"AAaA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAEpD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AAE5C,MAAM,WAAW,qBAAqB,CAAC,IAAI;IACzC,IAAI,EAAE,IAAI,CAAC;CACZ;AAED;;GAEG;AACH,MAAM,WAAW,aAAa,CAAC,IAAI,GAAG,WAAW,CAAE,SAAQ,MAAM,CAAC,IAAI,CAAC;IACrE,gBAAgB,EAAE,KAAK,CAAC,aAAa,CAAC,qBAAqB,CAAC,IAAI,CAAC,CAAC,CAAC;CACpE"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/model/explore.ts"],"sourcesContent":["// Copyright 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\nimport { UnknownSpec } from '@perses-dev/spec';\n\nimport { Plugin } from './plugin-base';\n\nexport interface ExploreComponentProps<Spec> {\n spec: Spec;\n}\n\n/**\n * Plugin that defines options for an external system that Perses talks to for data.\n */\nexport interface ExplorePlugin<Spec = UnknownSpec> extends Plugin<Spec> {\n ExploreComponent: React.ComponentType<ExploreComponentProps<Spec>>;\n}\n"],"names":[],"mappings":"AAAA,+BAA+B;AAC/B,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAUjC;;CAEC,GACD,WAEC"}
1
+ {"version":3,"sources":["../../src/model/explore.ts"],"sourcesContent":["// Copyright 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\nimport type { UnknownSpec } from '@perses-dev/spec';\n\nimport type { Plugin } from './plugin-base';\n\nexport interface ExploreComponentProps<Spec> {\n spec: Spec;\n}\n\n/**\n * Plugin that defines options for an external system that Perses talks to for data.\n */\nexport interface ExplorePlugin<Spec = UnknownSpec> extends Plugin<Spec> {\n ExploreComponent: React.ComponentType<ExploreComponentProps<Spec>>;\n}\n"],"names":[],"mappings":"AAAA,+BAA+B;AAC/B,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAUjC;;CAEC,GACD,WAEC"}
@@ -10,22 +10,22 @@
10
10
  // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11
11
  // See the License for the specific language governing permissions and
12
12
  // limitations under the License.
13
- export * from './annotations';
14
- export * from './datasource';
15
- export * from './json-queries';
16
- export * from './legend';
17
- export * from './log-queries';
18
- export * from './log-volume-utils';
19
- export * from './panels';
20
- export * from './plugins';
21
- export * from './plugin-base';
22
- export * from './plugin-loading';
23
- export * from './time-series-queries';
24
- export * from './trace-queries';
25
- export * from './profile-queries';
26
- export * from './variables';
27
- export * from './calculations';
28
- export * from './alerts-queries';
29
- export * from './silences-queries';
13
+ export * from "./annotations.js";
14
+ export * from "./datasource.js";
15
+ export * from "./json-queries.js";
16
+ export * from "./legend.js";
17
+ export * from "./log-queries.js";
18
+ export * from "./log-volume-utils.js";
19
+ export * from "./panels.js";
20
+ export * from "./plugins.js";
21
+ export * from "./plugin-base.js";
22
+ export * from "./plugin-loading.js";
23
+ export * from "./time-series-queries.js";
24
+ export * from "./trace-queries.js";
25
+ export * from "./profile-queries.js";
26
+ export * from "./variables.js";
27
+ export * from "./calculations.js";
28
+ export * from "./alerts-queries.js";
29
+ export * from "./silences-queries.js";
30
30
 
31
31
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/model/index.ts"],"sourcesContent":["// Copyright 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 './annotations';\nexport * from './datasource';\nexport * from './json-queries';\nexport * from './legend';\nexport * from './log-queries';\nexport * from './log-volume-utils';\nexport * from './panels';\nexport * from './plugins';\nexport * from './plugin-base';\nexport * from './plugin-loading';\nexport * from './time-series-queries';\nexport * from './trace-queries';\nexport * from './profile-queries';\nexport * from './variables';\nexport * from './calculations';\nexport * from './alerts-queries';\nexport * from './silences-queries';\n"],"names":[],"mappings":"AAAA,+BAA+B;AAC/B,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAEjC,cAAc,gBAAgB;AAC9B,cAAc,eAAe;AAC7B,cAAc,iBAAiB;AAC/B,cAAc,WAAW;AACzB,cAAc,gBAAgB;AAC9B,cAAc,qBAAqB;AACnC,cAAc,WAAW;AACzB,cAAc,YAAY;AAC1B,cAAc,gBAAgB;AAC9B,cAAc,mBAAmB;AACjC,cAAc,wBAAwB;AACtC,cAAc,kBAAkB;AAChC,cAAc,oBAAoB;AAClC,cAAc,cAAc;AAC5B,cAAc,iBAAiB;AAC/B,cAAc,mBAAmB;AACjC,cAAc,qBAAqB"}
1
+ {"version":3,"sources":["../../src/model/index.ts"],"sourcesContent":["// Copyright 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 './annotations';\nexport * from './datasource';\nexport * from './json-queries';\nexport * from './legend';\nexport * from './log-queries';\nexport * from './log-volume-utils';\nexport * from './panels';\nexport * from './plugins';\nexport * from './plugin-base';\nexport * from './plugin-loading';\nexport * from './time-series-queries';\nexport * from './trace-queries';\nexport * from './profile-queries';\nexport * from './variables';\nexport * from './calculations';\nexport * from './alerts-queries';\nexport * from './silences-queries';\n"],"names":[],"mappings":"AAAA,+BAA+B;AAC/B,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAEjC,cAAc,mBAAgB;AAC9B,cAAc,kBAAe;AAC7B,cAAc,oBAAiB;AAC/B,cAAc,cAAW;AACzB,cAAc,mBAAgB;AAC9B,cAAc,wBAAqB;AACnC,cAAc,cAAW;AACzB,cAAc,eAAY;AAC1B,cAAc,mBAAgB;AAC9B,cAAc,sBAAmB;AACjC,cAAc,2BAAwB;AACtC,cAAc,qBAAkB;AAChC,cAAc,uBAAoB;AAClC,cAAc,iBAAc;AAC5B,cAAc,oBAAiB;AAC/B,cAAc,sBAAmB;AACjC,cAAc,wBAAqB"}
@@ -1,6 +1,6 @@
1
- import { JsonData, UnknownSpec } from '@perses-dev/spec';
2
- import { DatasourceStore, VariableStateMap } from '../runtime';
3
- import { Plugin } from './plugin-base';
1
+ import type { JsonData, UnknownSpec } from '@perses-dev/spec';
2
+ import type { DatasourceStore, VariableStateMap } from '../runtime';
3
+ import type { Plugin } from './plugin-base';
4
4
  /**
5
5
  * An object containing all the dependencies of a JsonQuery.
6
6
  */
@@ -1 +1 @@
1
- {"version":3,"file":"json-queries.d.ts","sourceRoot":"","sources":["../../src/model/json-queries.ts"],"names":[],"mappings":"AAaA,OAAO,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAEzD,OAAO,EAAE,eAAe,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAC/D,OAAO,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AAEvC;;GAEG;AACH,KAAK,2BAA2B,GAAG;IACjC;;OAE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AC,EAAE,CAAC,IAAI,EAAE,IAAI,EAAE,GAAG,EAAE,gBAAgB,KAAK,2BAA2B,CAAC;CAChF"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/model/json-queries.ts"],"sourcesContent":["// Copyright 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\nimport { JsonData, UnknownSpec } from '@perses-dev/spec';\n\nimport { DatasourceStore, VariableStateMap } from '../runtime';\nimport { Plugin } from './plugin-base';\n\n/**\n * An object containing all the dependencies of a JsonQuery.\n */\ntype JsonQueryPluginDependencies = {\n /**\n * Returns a list of variables name this json query depends on.\n */\n variables?: string[];\n};\n\n/**\n * Context available to JsonQuery plugins at runtime.\n * Note: No absoluteTimeRange since a json query is not time-range dependent.\n */\nexport interface JsonQueryContext {\n variableState: VariableStateMap;\n datasourceStore: DatasourceStore;\n}\n\n/**\n * A plugin for running json queries, i.e. queries returning arbitrary JSON payloads.\n */\nexport interface JsonQueryPlugin<Spec = UnknownSpec> extends Plugin<Spec> {\n getJsonData: (spec: Spec, ctx: JsonQueryContext, abortSignal?: AbortSignal) => Promise<JsonData>;\n dependsOn?: (spec: Spec, ctx: JsonQueryContext) => JsonQueryPluginDependencies;\n}\n"],"names":[],"mappings":"AAAA,+BAA+B;AAC/B,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AA0BjC;;CAEC,GACD,WAGC"}
1
+ {"version":3,"sources":["../../src/model/json-queries.ts"],"sourcesContent":["// Copyright 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\nimport type { JsonData, UnknownSpec } from '@perses-dev/spec';\n\nimport type { DatasourceStore, VariableStateMap } from '../runtime';\nimport type { Plugin } from './plugin-base';\n\n/**\n * An object containing all the dependencies of a JsonQuery.\n */\ntype JsonQueryPluginDependencies = {\n /**\n * Returns a list of variables name this json query depends on.\n */\n variables?: string[];\n};\n\n/**\n * Context available to JsonQuery plugins at runtime.\n * Note: No absoluteTimeRange since a json query is not time-range dependent.\n */\nexport interface JsonQueryContext {\n variableState: VariableStateMap;\n datasourceStore: DatasourceStore;\n}\n\n/**\n * A plugin for running json queries, i.e. queries returning arbitrary JSON payloads.\n */\nexport interface JsonQueryPlugin<Spec = UnknownSpec> extends Plugin<Spec> {\n getJsonData: (spec: Spec, ctx: JsonQueryContext, abortSignal?: AbortSignal) => Promise<JsonData>;\n dependsOn?: (spec: Spec, ctx: JsonQueryContext) => JsonQueryPluginDependencies;\n}\n"],"names":[],"mappings":"AAAA,+BAA+B;AAC/B,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AA0BjC;;CAEC,GACD,WAGC"}
@@ -1,5 +1,5 @@
1
- import { LegendMode, LegendOptionsBase, LegendPositions, LegendSize } from '@perses-dev/components';
2
- import { CalculationType } from './calculations';
1
+ import type { LegendMode, LegendOptionsBase, LegendPositions, LegendSize } from '@perses-dev/components';
2
+ import type { CalculationType } from './calculations';
3
3
  export declare const legendValues: CalculationType[];
4
4
  export type LegendValue = (typeof legendValues)[number];
5
5
  export type ComparisonValues = 'abs' | 'relative';
@@ -1 +1 @@
1
- {"version":3,"file":"legend.d.ts","sourceRoot":"","sources":["../../src/model/legend.ts"],"names":[],"mappings":"AAaA,OAAO,EAIL,UAAU,EACV,iBAAiB,EACjB,eAAe,EACf,UAAU,EACX,MAAM,wBAAwB,CAAC;AAEhC,OAAO,EAAuB,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAUtE,eAAO,MAAM,YAAY,EAAE,eAAe,EASzC,CAAC;AACF,MAAM,MAAM,WAAW,GAAG,CAAC,OAAO,YAAY,CAAC,CAAC,MAAM,CAAC,CAAC;AAExD,MAAM,MAAM,gBAAgB,GAAG,KAAK,GAAG,UAAU,CAAC;AAElD,eAAO,MAAM,iBAAiB,EAAE,MAAM,CAAC,gBAAgB,EAAE,wBAAwB,CAGhF,CAAC;AAKF,MAAM,WAAW,iBAAkB,SAAQ,iBAAiB;IAC1D,MAAM,CAAC,EAAE,KAAK,CAAC,WAAW,GAAG,gBAAgB,CAAC,CAAC;CAChD;AAED,MAAM,MAAM,wBAAwB,GAAG;IACrC,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB,CAAC;AAEF,eAAO,MAAM,uBAAuB,EAAE,QAAQ,CAAC,MAAM,CAAC,eAAe,EAAE,wBAAwB,CAAC,CAG/F,CAAC;AAEF,eAAO,MAAM,kBAAkB,EAAE,QAAQ,CAAC,MAAM,CAAC,UAAU,EAAE,wBAAwB,CAAC,CAGrF,CAAC;AAEF,eAAO,MAAM,kBAAkB,EAAE,QAAQ,CAAC,MAAM,CAAC,UAAU,EAAE,wBAAwB,CAAC,CAGrF,CAAC;AAEF,eAAO,MAAM,mBAAmB,+HAO/B,CAAC;AAEF,wBAAgB,kBAAkB,CAAC,MAAM,CAAC,EAAE,iBAAiB,GAAG,OAAO,CAgBtE"}
1
+ {"version":3,"file":"legend.d.ts","sourceRoot":"","sources":["../../src/model/legend.ts"],"names":[],"mappings":"AAaA,OAAO,KAAK,EAAE,UAAU,EAAE,iBAAiB,EAAE,eAAe,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AAGzG,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAWtD,eAAO,MAAM,YAAY,EAAE,eAAe,EASzC,CAAC;AACF,MAAM,MAAM,WAAW,GAAG,CAAC,OAAO,YAAY,CAAC,CAAC,MAAM,CAAC,CAAC;AAExD,MAAM,MAAM,gBAAgB,GAAG,KAAK,GAAG,UAAU,CAAC;AAElD,eAAO,MAAM,iBAAiB,EAAE,MAAM,CAAC,gBAAgB,EAAE,wBAAwB,CAGhF,CAAC;AAKF,MAAM,WAAW,iBAAkB,SAAQ,iBAAiB;IAC1D,MAAM,CAAC,EAAE,KAAK,CAAC,WAAW,GAAG,gBAAgB,CAAC,CAAC;CAChD;AAED,MAAM,MAAM,wBAAwB,GAAG;IACrC,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB,CAAC;AAEF,eAAO,MAAM,uBAAuB,EAAE,QAAQ,CAAC,MAAM,CAAC,eAAe,EAAE,wBAAwB,CAAC,CAG/F,CAAC;AAEF,eAAO,MAAM,kBAAkB,EAAE,QAAQ,CAAC,MAAM,CAAC,UAAU,EAAE,wBAAwB,CAAC,CAGrF,CAAC;AAEF,eAAO,MAAM,kBAAkB,EAAE,QAAQ,CAAC,MAAM,CAAC,UAAU,EAAE,wBAAwB,CAAC,CAGrF,CAAC;AAEF,eAAO,MAAM,mBAAmB,+HAO/B,CAAC;AAEF,wBAAgB,kBAAkB,CAAC,MAAM,CAAC,EAAE,iBAAiB,GAAG,OAAO,CAgBtE"}
@@ -10,8 +10,8 @@
10
10
  // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11
11
  // See the License for the specific language governing permissions and
12
12
  // limitations under the License.
13
- import { isValidLegendMode, isValidLegendPosition, isValidLegendSize } from '@perses-dev/components';
14
- import { CALCULATIONS_CONFIG } from './calculations';
13
+ import { isValidLegendMode, isValidLegendPosition, isValidLegendSize } from "@perses-dev/components";
14
+ import { CALCULATIONS_CONFIG } from "./calculations.js";
15
15
  // This file contains legend-related model code specific to panel plugin specs.
16
16
  // See the `core` package for common/shared legend model code and the
17
17
  // `components` package for legend model code specific to the Legend component.
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/model/legend.ts"],"sourcesContent":["// Copyright 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\nimport {\n isValidLegendMode,\n isValidLegendPosition,\n isValidLegendSize,\n LegendMode,\n LegendOptionsBase,\n LegendPositions,\n LegendSize,\n} from '@perses-dev/components';\n\nimport { CALCULATIONS_CONFIG, CalculationType } from './calculations';\n\n// This file contains legend-related model code specific to panel plugin specs.\n// See the `core` package for common/shared legend model code and the\n// `components` package for legend model code specific to the Legend component.\n\n// Explicity listing the calculations we intend to use for legend values because\n// we want them ordered in a specific way, and it may be possible in the future\n// that we only use a subset of calculations for the legend because the calculations\n// are also used by other features.\nexport const legendValues: CalculationType[] = [\n 'mean',\n 'first',\n 'first-number',\n 'last',\n 'last-number',\n 'min',\n 'max',\n 'sum',\n];\nexport type LegendValue = (typeof legendValues)[number];\n\nexport type ComparisonValues = 'abs' | 'relative';\n\nexport const comparisonLegends: Record<ComparisonValues, LegendSingleSelectConfig> = {\n abs: { label: 'Absolute', description: 'Absolute value' },\n relative: { label: 'Relative', description: 'Relative value' },\n};\n\n// Note: explicitly defining different options for the legend spec and\n// legend component that extend from some common options, so we can allow the\n// component and the spec to diverge in some upcoming work.\nexport interface LegendSpecOptions extends LegendOptionsBase {\n values?: Array<LegendValue | ComparisonValues>;\n}\n\nexport type LegendSingleSelectConfig = {\n label: string;\n description?: string;\n};\n\nexport const LEGEND_POSITIONS_CONFIG: Readonly<Record<LegendPositions, LegendSingleSelectConfig>> = {\n bottom: { label: 'Bottom' },\n right: { label: 'Right' },\n};\n\nexport const LEGEND_MODE_CONFIG: Readonly<Record<LegendMode, LegendSingleSelectConfig>> = {\n list: { label: 'List' },\n table: { label: 'Table' },\n};\n\nexport const LEGEND_SIZE_CONFIG: Readonly<Record<LegendSize, LegendSingleSelectConfig>> = {\n small: { label: 'Small' },\n medium: { label: 'Medium' },\n};\n\nexport const LEGEND_VALUE_CONFIG = legendValues.reduce(\n (config, value) => {\n config[value] = CALCULATIONS_CONFIG[value];\n\n return config;\n },\n {} as Partial<Record<LegendValue, LegendSingleSelectConfig>>,\n);\n\nexport function validateLegendSpec(legend?: LegendOptionsBase): boolean {\n if (legend === undefined) {\n // undefined is valid since this is how legend is hidden by default\n return true;\n }\n if (!isValidLegendPosition(legend.position)) {\n return false;\n }\n if (legend.mode && !isValidLegendMode(legend.mode)) {\n return false;\n }\n if (legend.size && !isValidLegendSize(legend.size)) {\n return false;\n }\n\n return true;\n}\n"],"names":["isValidLegendMode","isValidLegendPosition","isValidLegendSize","CALCULATIONS_CONFIG","legendValues","comparisonLegends","abs","label","description","relative","LEGEND_POSITIONS_CONFIG","bottom","right","LEGEND_MODE_CONFIG","list","table","LEGEND_SIZE_CONFIG","small","medium","LEGEND_VALUE_CONFIG","reduce","config","value","validateLegendSpec","legend","undefined","position","mode","size"],"mappings":"AAAA,+BAA+B;AAC/B,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAEjC,SACEA,iBAAiB,EACjBC,qBAAqB,E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["../../src/model/legend.ts"],"sourcesContent":["// Copyright 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\nimport type { LegendMode, LegendOptionsBase, LegendPositions, LegendSize } from '@perses-dev/components';\nimport { isValidLegendMode, isValidLegendPosition, isValidLegendSize } from '@perses-dev/components';\n\nimport type { CalculationType } from './calculations';\nimport { CALCULATIONS_CONFIG } from './calculations';\n\n// This file contains legend-related model code specific to panel plugin specs.\n// See the `core` package for common/shared legend model code and the\n// `components` package for legend model code specific to the Legend component.\n\n// Explicity listing the calculations we intend to use for legend values because\n// we want them ordered in a specific way, and it may be possible in the future\n// that we only use a subset of calculations for the legend because the calculations\n// are also used by other features.\nexport const legendValues: CalculationType[] = [\n 'mean',\n 'first',\n 'first-number',\n 'last',\n 'last-number',\n 'min',\n 'max',\n 'sum',\n];\nexport type LegendValue = (typeof legendValues)[number];\n\nexport type ComparisonValues = 'abs' | 'relative';\n\nexport const comparisonLegends: Record<ComparisonValues, LegendSingleSelectConfig> = {\n abs: { label: 'Absolute', description: 'Absolute value' },\n relative: { label: 'Relative', description: 'Relative value' },\n};\n\n// Note: explicitly defining different options for the legend spec and\n// legend component that extend from some common options, so we can allow the\n// component and the spec to diverge in some upcoming work.\nexport interface LegendSpecOptions extends LegendOptionsBase {\n values?: Array<LegendValue | ComparisonValues>;\n}\n\nexport type LegendSingleSelectConfig = {\n label: string;\n description?: string;\n};\n\nexport const LEGEND_POSITIONS_CONFIG: Readonly<Record<LegendPositions, LegendSingleSelectConfig>> = {\n bottom: { label: 'Bottom' },\n right: { label: 'Right' },\n};\n\nexport const LEGEND_MODE_CONFIG: Readonly<Record<LegendMode, LegendSingleSelectConfig>> = {\n list: { label: 'List' },\n table: { label: 'Table' },\n};\n\nexport const LEGEND_SIZE_CONFIG: Readonly<Record<LegendSize, LegendSingleSelectConfig>> = {\n small: { label: 'Small' },\n medium: { label: 'Medium' },\n};\n\nexport const LEGEND_VALUE_CONFIG = legendValues.reduce(\n (config, value) => {\n config[value] = CALCULATIONS_CONFIG[value];\n\n return config;\n },\n {} as Partial<Record<LegendValue, LegendSingleSelectConfig>>,\n);\n\nexport function validateLegendSpec(legend?: LegendOptionsBase): boolean {\n if (legend === undefined) {\n // undefined is valid since this is how legend is hidden by default\n return true;\n }\n if (!isValidLegendPosition(legend.position)) {\n return false;\n }\n if (legend.mode && !isValidLegendMode(legend.mode)) {\n return false;\n }\n if (legend.size && !isValidLegendSize(legend.size)) {\n return false;\n }\n\n return true;\n}\n"],"names":["isValidLegendMode","isValidLegendPosition","isValidLegendSize","CALCULATIONS_CONFIG","legendValues","comparisonLegends","abs","label","description","relative","LEGEND_POSITIONS_CONFIG","bottom","right","LEGEND_MODE_CONFIG","list","table","LEGEND_SIZE_CONFIG","small","medium","LEGEND_VALUE_CONFIG","reduce","config","value","validateLegendSpec","legend","undefined","position","mode","size"],"mappings":"AAAA,+BAA+B;AAC/B,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAGjC,SAASA,iBAAiB,EAAEC,qBAAqB,EAAEC,iBAAiB,QAAQ,yBAAyB;AAGrG,SAASC,mBAAmB,QAAQ,oBAAiB;AAErD,+EAA+E;AAC/E,qEAAqE;AACrE,+EAA+E;AAE/E,gFAAgF;AAChF,+EAA+E;AAC/E,oFAAoF;AACpF,mCAAmC;AACnC,OAAO,MAAMC,eAAkC;IAC7C;IACA;IACA;IACA;IACA;IACA;IACA;IACA;CACD,CAAC;AAKF,OAAO,MAAMC,oBAAwE;IACnFC,KAAK;QAAEC,OAAO;QAAYC,aAAa;IAAiB;IACxDC,UAAU;QAAEF,OAAO;QAAYC,aAAa;IAAiB;AAC/D,EAAE;AAcF,OAAO,MAAME,0BAAuF;IAClGC,QAAQ;QAAEJ,OAAO;IAAS;IAC1BK,OAAO;QAAEL,OAAO;IAAQ;AAC1B,EAAE;AAEF,OAAO,MAAMM,qBAA6E;IACxFC,MAAM;QAAEP,OAAO;IAAO;IACtBQ,OAAO;QAAER,OAAO;IAAQ;AAC1B,EAAE;AAEF,OAAO,MAAMS,qBAA6E;IACxFC,OAAO;QAAEV,OAAO;IAAQ;IACxBW,QAAQ;QAAEX,OAAO;IAAS;AAC5B,EAAE;AAEF,OAAO,MAAMY,sBAAsBf,aAAagB,MAAM,CACpD,CAACC,QAAQC;IACPD,MAAM,CAACC,MAAM,GAAGnB,mBAAmB,CAACmB,MAAM;IAE1C,OAAOD;AACT,GACA,CAAC,GACD;AAEF,OAAO,SAASE,mBAAmBC,MAA0B;IAC3D,IAAIA,WAAWC,WAAW;QACxB,mEAAmE;QACnE,OAAO;IACT;IACA,IAAI,CAACxB,sBAAsBuB,OAAOE,QAAQ,GAAG;QAC3C,OAAO;IACT;IACA,IAAIF,OAAOG,IAAI,IAAI,CAAC3B,kBAAkBwB,OAAOG,IAAI,GAAG;QAClD,OAAO;IACT;IACA,IAAIH,OAAOI,IAAI,IAAI,CAAC1B,kBAAkBsB,OAAOI,IAAI,GAAG;QAClD,OAAO;IACT;IAEA,OAAO;AACT"}
@@ -1,6 +1,6 @@
1
- import { AbsoluteTimeRange, UnknownSpec, LogData, QueryDefinition } from '@perses-dev/spec';
2
- import { DatasourceStore, VariableStateMap } from '../runtime';
3
- import { Plugin } from './plugin-base';
1
+ import type { AbsoluteTimeRange, UnknownSpec, LogData, QueryDefinition } from '@perses-dev/spec';
2
+ import type { DatasourceStore, VariableStateMap } from '../runtime';
3
+ import type { Plugin } from './plugin-base';
4
4
  export interface LogQueryResult {
5
5
  logs: LogData;
6
6
  timeRange: AbsoluteTimeRange;
@@ -1 +1 @@
1
- {"version":3,"file":"log-queries.d.ts","sourceRoot":"","sources":["../../src/model/log-queries.ts"],"names":[],"mappings":"AAaA,OAAO,EAAE,iBAAiB,EAAE,WAAW,EAAE,OAAO,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAE5F,OAAO,EAAE,eAAe,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAC/D,OAAO,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AAEvC,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,OAAO,CAAC;IACd,SAAS,EAAE,iBAAiB,CAAC;IAC7B,QAAQ,CAAC,EAAE;QACT,mBAAmB,EAAE,MAAM,CAAC;KAC7B,CAAC;CACH;AAED,MAAM,WAAW,eAAe;IAC9B,SAAS,EAAE,iBAAiB,CAAC;IAC7B,aAAa,EAAE,gBAAgB,CAAC;IAChC,eAAe,EAAE,eAAe,CAAC;IACjC,UAAU,EAAE,MAAM,CAAC;CACpB;AAED,KAAK,0BAA0B,GAAG;IAChC,SAAS,CAAC,EAAE,MAAM,EAAE,CAAC;CACtB,CAAC;AAEF,MAAM,WAAW,cAAc,CAAC,IAAI,GAAG,WAAW,CAAE,SAAQ,MAAM,CAAC,IAAI,CAAC;IACtE,UAAU,EAAE,CAAC,IAAI,EAAE,IAAI,EAAE,GAAG,EAAE,eAAe,EAAE,WAAW,CAAC,EAAE,WAAW,KAAK,OAAO,CAAC,cAAc,CAAC,CAAC;IACrG,SAAS,CAAC,EAAE,CAAC,IAAI,EAAE,IAAI,EAAE,GAAG,EAAE,eAAe,KAAK,0BAA0B,CAAC;IAC7E,iBAAiB,CAAC,EAAE,CAAC,IAAI,EAAE,IAAI,EAAE,GAAG,EAAE,eAAe,KAAK,eAAe,GAAG,IAAI,CAAC;CAClF"}
1
+ {"version":3,"file":"log-queries.d.ts","sourceRoot":"","sources":["../../src/model/log-queries.ts"],"names":[],"mappings":"AAaA,OAAO,KAAK,EAAE,iBAAiB,EAAE,WAAW,EAAE,OAAO,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAEjG,OAAO,KAAK,EAAE,eAAe,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AACpE,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AAE5C,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,OAAO,CAAC;IACd,SAAS,EAAE,iBAAiB,CAAC;IAC7B,QAAQ,CAAC,EAAE;QACT,mBAAmB,EAAE,MAAM,CAAC;KAC7B,CAAC;CACH;AAED,MAAM,WAAW,eAAe;IAC9B,SAAS,EAAE,iBAAiB,CAAC;IAC7B,aAAa,EAAE,gBAAgB,CAAC;IAChC,eAAe,EAAE,eAAe,CAAC;IACjC,UAAU,EAAE,MAAM,CAAC;CACpB;AAED,KAAK,0BAA0B,GAAG;IAChC,SAAS,CAAC,EAAE,MAAM,EAAE,CAAC;CACtB,CAAC;AAEF,MAAM,WAAW,cAAc,CAAC,IAAI,GAAG,WAAW,CAAE,SAAQ,MAAM,CAAC,IAAI,CAAC;IACtE,UAAU,EAAE,CAAC,IAAI,EAAE,IAAI,EAAE,GAAG,EAAE,eAAe,EAAE,WAAW,CAAC,EAAE,WAAW,KAAK,OAAO,CAAC,cAAc,CAAC,CAAC;IACrG,SAAS,CAAC,EAAE,CAAC,IAAI,EAAE,IAAI,EAAE,GAAG,EAAE,eAAe,KAAK,0BAA0B,CAAC;IAC7E,iBAAiB,CAAC,EAAE,CAAC,IAAI,EAAE,IAAI,EAAE,GAAG,EAAE,eAAe,KAAK,eAAe,GAAG,IAAI,CAAC;CAClF"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/model/log-queries.ts"],"sourcesContent":["// Copyright 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\nimport { AbsoluteTimeRange, UnknownSpec, LogData, QueryDefinition } from '@perses-dev/spec';\n\nimport { DatasourceStore, VariableStateMap } from '../runtime';\nimport { Plugin } from './plugin-base';\n\nexport interface LogQueryResult {\n logs: LogData;\n timeRange: AbsoluteTimeRange;\n metadata?: {\n executedQueryString: string;\n };\n}\n\nexport interface LogQueryContext {\n timeRange: AbsoluteTimeRange;\n variableState: VariableStateMap;\n datasourceStore: DatasourceStore;\n refreshKey: string;\n}\n\ntype LogQueryPluginDependencies = {\n variables?: string[];\n};\n\nexport interface LogQueryPlugin<Spec = UnknownSpec> extends Plugin<Spec> {\n getLogData: (spec: Spec, ctx: LogQueryContext, abortSignal?: AbortSignal) => Promise<LogQueryResult>;\n dependsOn?: (spec: Spec, ctx: LogQueryContext) => LogQueryPluginDependencies;\n createVolumeQuery?: (spec: Spec, ctx: LogQueryContext) => QueryDefinition | null;\n}\n"],"names":[],"mappings":"AAAA,+BAA+B;AAC/B,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AA0BjC,WAIC"}
1
+ {"version":3,"sources":["../../src/model/log-queries.ts"],"sourcesContent":["// Copyright 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\nimport type { AbsoluteTimeRange, UnknownSpec, LogData, QueryDefinition } from '@perses-dev/spec';\n\nimport type { DatasourceStore, VariableStateMap } from '../runtime';\nimport type { Plugin } from './plugin-base';\n\nexport interface LogQueryResult {\n logs: LogData;\n timeRange: AbsoluteTimeRange;\n metadata?: {\n executedQueryString: string;\n };\n}\n\nexport interface LogQueryContext {\n timeRange: AbsoluteTimeRange;\n variableState: VariableStateMap;\n datasourceStore: DatasourceStore;\n refreshKey: string;\n}\n\ntype LogQueryPluginDependencies = {\n variables?: string[];\n};\n\nexport interface LogQueryPlugin<Spec = UnknownSpec> extends Plugin<Spec> {\n getLogData: (spec: Spec, ctx: LogQueryContext, abortSignal?: AbortSignal) => Promise<LogQueryResult>;\n dependsOn?: (spec: Spec, ctx: LogQueryContext) => LogQueryPluginDependencies;\n createVolumeQuery?: (spec: Spec, ctx: LogQueryContext) => QueryDefinition | null;\n}\n"],"names":[],"mappings":"AAAA,+BAA+B;AAC/B,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AA0BjC,WAIC"}
@@ -1,8 +1,8 @@
1
- import { PanelDefinition, QueryDataType, QueryDefinition, QueryPluginType, UnknownSpec } from '@perses-dev/spec';
1
+ import type { PanelDefinition, QueryDataType, QueryDefinition, QueryPluginType, UnknownSpec } from '@perses-dev/spec';
2
2
  import React from 'react';
3
- import { OptionsEditorTab } from '../components';
4
- import { QueryOptions } from '../runtime';
5
- import { OptionsEditorProps, Plugin } from './plugin-base';
3
+ import type { OptionsEditorTab } from '../components';
4
+ import type { QueryOptions } from '../runtime';
5
+ import type { OptionsEditorProps, Plugin } from './plugin-base';
6
6
  export type PanelOptionsEditorComponent<T> = Pick<OptionsEditorTab, 'label'> & {
7
7
  content: React.ComponentType<OptionsEditorProps<T>>;
8
8
  };
@@ -1 +1 @@
1
- {"version":3,"file":"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AC3C;AAED;;GAEG;AACH,MAAM,WAAW,UAAU,CAAC,IAAI,EAAE,mBAAmB,GAAG,aAAa;IACnE,IAAI,EAAE,IAAI,CAAC;IACX,iBAAiB,CAAC,EAAE;QAClB,KAAK,EAAE,MAAM,CAAC;QACd,MAAM,EAAE,MAAM,CAAC;KAChB,CAAC;IACF,UAAU,CAAC,EAAE,eAAe,CAAC;IAC7B,YAAY,EAAE,KAAK,CAAC,SAAS,CAAC,mBAAmB,CAAC,CAAC,CAAC;CACrD;AAED,MAAM,WAAW,SAAS,CAAC,mBAAmB,GAAG,aAAa;IAC5D,UAAU,EAAE,eAAe,CAAC;IAC5B,IAAI,EAAE,mBAAmB,CAAC;CAC3B;AAED,MAAM,MAAM,YAAY,GAAG,MAAM,CAAC;AAElC;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAChC,OAAO,EAAE,YAAY,CAAC;IACtB,eAAe,EAAE,eAAe,CAAC;IACjC,gBAAgB,CAAC,EAAE;QACjB,KAAK,EAAE,MAAM,CAAC;QACd,MAAM,EAAE,MAAM,CAAC;QACf,cAAc,CAAC,EAAE;YACf,KAAK,EAAE,MAAM,CAAC;YACd,MAAM,CAAC,EAAE,MAAM,CAAC;YAChB,SAAS,CAAC,EAAE,YAAY,GAAG,UAAU,CAAC;SACvC,CAAC;KACH,CAAC;CACH"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/model/panels.ts"],"sourcesContent":["// Copyright 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\nimport { PanelDefinition, QueryDataType, QueryDefinition, QueryPluginType, UnknownSpec } from '@perses-dev/spec';\nimport React from 'react';\n\nimport { OptionsEditorTab } from '../components';\nimport { QueryOptions } from '../runtime';\nimport { OptionsEditorProps, Plugin } from './plugin-base';\n\nexport type PanelOptionsEditorComponent<T> = Pick<OptionsEditorTab, 'label'> & {\n content: React.ComponentType<OptionsEditorProps<T>>;\n};\n\nexport type PanelAction<TPanelProps> = {\n component: React.ComponentType<TPanelProps>;\n location?: string; // 'header' or other available locations\n};\n\n/**\n * Plugin the provides custom visualizations inside a Panel.\n */\nexport interface PanelPlugin<Spec = UnknownSpec, TPanelProps = PanelProps<Spec>> extends Plugin<Spec> {\n PanelComponent: React.ComponentType<TPanelProps>;\n /**\n * React components for custom tabs\n */\n panelOptionsEditorComponents?: Array<PanelOptionsEditorComponent<Spec>>;\n /**\n * Show a custom React component when the query is loading.\n * Default: <LoadingOverlay />\n */\n LoadingComponent?: React.ComponentType<TPanelProps>;\n /**\n * List of query types supported by this panel.\n * @default [] (no query types supported) only relevant if hideQueryEditor is true\n */\n supportedQueryTypes?: QueryPluginType[];\n /**\n * Static options for the queries that will be executed.\n * Each {@link QueryPluginType} implementation can have its own options.\n * For example see {@link UseTimeSeriesQueryOptions} for time series queries.\n */\n queryOptions?: QueryOptions | ((spec: Spec) => QueryOptions);\n /**\n * If true, query editor will be hidden for panel plugin\n * @default false\n */\n hideQueryEditor?: boolean;\n /**\n * If true, the panel editor exposes a common \"Annotations\" tab so annotations can be configured\n * per panel. Only enable this for panel plugins whose PanelComponent actually renders annotations.\n * @default false\n */\n supportsAnnotations?: boolean;\n /**\n * List of panel actions that will be rendered in the panel header\n */\n actions?: Array<PanelAction<TPanelProps>>;\n}\n\n/**\n * The props provided by Perses to a panel plugin's PanelComponent.\n */\nexport interface PanelProps<Spec, SupportedQueryTypes = QueryDataType> {\n spec: Spec;\n contentDimensions?: {\n width: number;\n height: number;\n };\n definition?: PanelDefinition;\n queryResults: Array<PanelData<SupportedQueryTypes>>;\n}\n\nexport interface PanelData<SupportedQueryTypes = QueryDataType> {\n definition: QueryDefinition;\n data: SupportedQueryTypes;\n}\n\nexport type PanelGroupId = number;\n\n/**\n * Panel values that can be edited in the panel editor.\n */\nexport interface PanelEditorValues {\n groupId: PanelGroupId;\n panelDefinition: PanelDefinition;\n layoutDefinition?: {\n width: number;\n height: number;\n repeatVariable?: {\n value: string;\n maxPer?: number;\n alignment?: 'horizontal' | 'vertical';\n };\n };\n}\n"],"names":[],"mappings":"AAAA,+BAA+B;AAC/B,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAgFjC;;CAEC,GACD,WAYC"}
1
+ {"version":3,"sources":["../../src/model/panels.ts"],"sourcesContent":["// Copyright 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\nimport type { PanelDefinition, QueryDataType, QueryDefinition, QueryPluginType, UnknownSpec } from '@perses-dev/spec';\nimport React from 'react';\n\nimport type { OptionsEditorTab } from '../components';\nimport type { QueryOptions } from '../runtime';\nimport type { OptionsEditorProps, Plugin } from './plugin-base';\n\nexport type PanelOptionsEditorComponent<T> = Pick<OptionsEditorTab, 'label'> & {\n content: React.ComponentType<OptionsEditorProps<T>>;\n};\n\nexport type PanelAction<TPanelProps> = {\n component: React.ComponentType<TPanelProps>;\n location?: string; // 'header' or other available locations\n};\n\n/**\n * Plugin the provides custom visualizations inside a Panel.\n */\nexport interface PanelPlugin<Spec = UnknownSpec, TPanelProps = PanelProps<Spec>> extends Plugin<Spec> {\n PanelComponent: React.ComponentType<TPanelProps>;\n /**\n * React components for custom tabs\n */\n panelOptionsEditorComponents?: Array<PanelOptionsEditorComponent<Spec>>;\n /**\n * Show a custom React component when the query is loading.\n * Default: <LoadingOverlay />\n */\n LoadingComponent?: React.ComponentType<TPanelProps>;\n /**\n * List of query types supported by this panel.\n * @default [] (no query types supported) only relevant if hideQueryEditor is true\n */\n supportedQueryTypes?: QueryPluginType[];\n /**\n * Static options for the queries that will be executed.\n * Each {@link QueryPluginType} implementation can have its own options.\n * For example see {@link UseTimeSeriesQueryOptions} for time series queries.\n */\n queryOptions?: QueryOptions | ((spec: Spec) => QueryOptions);\n /**\n * If true, query editor will be hidden for panel plugin\n * @default false\n */\n hideQueryEditor?: boolean;\n /**\n * If true, the panel editor exposes a common \"Annotations\" tab so annotations can be configured\n * per panel. Only enable this for panel plugins whose PanelComponent actually renders annotations.\n * @default false\n */\n supportsAnnotations?: boolean;\n /**\n * List of panel actions that will be rendered in the panel header\n */\n actions?: Array<PanelAction<TPanelProps>>;\n}\n\n/**\n * The props provided by Perses to a panel plugin's PanelComponent.\n */\nexport interface PanelProps<Spec, SupportedQueryTypes = QueryDataType> {\n spec: Spec;\n contentDimensions?: {\n width: number;\n height: number;\n };\n definition?: PanelDefinition;\n queryResults: Array<PanelData<SupportedQueryTypes>>;\n}\n\nexport interface PanelData<SupportedQueryTypes = QueryDataType> {\n definition: QueryDefinition;\n data: SupportedQueryTypes;\n}\n\nexport type PanelGroupId = number;\n\n/**\n * Panel values that can be edited in the panel editor.\n */\nexport interface PanelEditorValues {\n groupId: PanelGroupId;\n panelDefinition: PanelDefinition;\n layoutDefinition?: {\n width: number;\n height: number;\n repeatVariable?: {\n value: string;\n maxPer?: number;\n alignment?: 'horizontal' | 'vertical';\n };\n };\n}\n"],"names":[],"mappings":"AAAA,+BAA+B;AAC/B,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAgFjC;;CAEC,GACD,WAYC"}
@@ -1,4 +1,4 @@
1
- import { QueryDefinition } from '@perses-dev/spec';
1
+ import type { QueryDefinition } from '@perses-dev/spec';
2
2
  import React from 'react';
3
3
  /**
4
4
  * Base type of all plugin implementations.
@@ -1 +1 @@
1
- {"version":3,"file":"plugin-base.d.ts","sourceRoot":"","sources":["../../src/model/plugin-base.ts"],"names":[],"mappings":"AAaA,OAAO,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AACnD,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B;;GAEG;AACH,MAAM,WAAW,MAAM,CAAC,IAAI,EAAE,sBAAsB,GAAG,kBAAkB,CAAC,IAAI,CAAC;IAC7E;;OAEG;IACH,sBAAsB,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC,sBAAsB,CAAC,CAAC;IAErE;;OAEG;IACH,oBAAoB,EAAE,MAAM,IAAI,CAAC;CAClC;AAED;;GAEG;AACH,MAAM,WAAW,kBAAkB,CAAC,IAAI;IAGtC,KAAK,EAAE,IAAI,CAAC;IACZ,QAAQ,EAAE,CAAC,IAAI,EAAE,IAAI,KAAK,IAAI,CAAC;IAC/B,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB;AAED;;GAEG;AACH,MAAM,WAAW,gBAAgB,CAAC,IAAI,CAAE,SAAQ,kBAAkB,CAAC,IAAI,CAAC;IACtE,OAAO,EAAE,eAAe,EAAE,CAAC;CAC5B"}
1
+ {"version":3,"file":"plugin-base.d.ts","sourceRoot":"","sources":["../../src/model/plugin-base.ts"],"names":[],"mappings":"AAaA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AACxD,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B;;GAEG;AACH,MAAM,WAAW,MAAM,CAAC,IAAI,EAAE,sBAAsB,GAAG,kBAAkB,CAAC,IAAI,CAAC;IAC7E;;OAEG;IACH,sBAAsB,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC,sBAAsB,CAAC,CAAC;IAErE;;OAEG;IACH,oBAAoB,EAAE,MAAM,IAAI,CAAC;CAClC;AAED;;GAEG;AACH,MAAM,WAAW,kBAAkB,CAAC,IAAI;IAGtC,KAAK,EAAE,IAAI,CAAC;IACZ,QAAQ,EAAE,CAAC,IAAI,EAAE,IAAI,KAAK,IAAI,CAAC;IAC/B,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB;AAED;;GAEG;AACH,MAAM,WAAW,gBAAgB,CAAC,IAAI,CAAE,SAAQ,kBAAkB,CAAC,IAAI,CAAC;IACtE,OAAO,EAAE,eAAe,EAAE,CAAC;CAC5B"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/model/plugin-base.ts"],"sourcesContent":["// Copyright 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\nimport { QueryDefinition } from '@perses-dev/spec';\nimport React from 'react';\n\n/**\n * Base type of all plugin implementations.\n */\nexport interface Plugin<Spec, OptionsEditorPropsType = OptionsEditorProps<Spec>> {\n /**\n * React component for editing the plugin's options in the UI.\n */\n OptionsEditorComponent?: React.ComponentType<OptionsEditorPropsType>;\n\n /**\n * Callback for creating the initial options for the plugin.\n */\n createInitialOptions: () => Spec;\n}\n\n/**\n * Common props passed to options editor components.\n */\nexport interface OptionsEditorProps<Spec> {\n // TODO: These are temporary and may not actually make sense, so replace\n // with whatever makes sense as visual editing evolves\n value: Spec;\n onChange: (next: Spec) => void;\n isReadonly?: boolean;\n}\n\n/**\n * Common props passed to query editor component\n */\nexport interface QueryEditorProps<Spec> extends OptionsEditorProps<Spec> {\n queries: QueryDefinition[];\n}\n"],"names":[],"mappings":"AAAA,+BAA+B;AAC/B,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AA+BjC;;CAEC,GACD,WAEC"}
1
+ {"version":3,"sources":["../../src/model/plugin-base.ts"],"sourcesContent":["// Copyright 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\nimport type { QueryDefinition } from '@perses-dev/spec';\nimport React from 'react';\n\n/**\n * Base type of all plugin implementations.\n */\nexport interface Plugin<Spec, OptionsEditorPropsType = OptionsEditorProps<Spec>> {\n /**\n * React component for editing the plugin's options in the UI.\n */\n OptionsEditorComponent?: React.ComponentType<OptionsEditorPropsType>;\n\n /**\n * Callback for creating the initial options for the plugin.\n */\n createInitialOptions: () => Spec;\n}\n\n/**\n * Common props passed to options editor components.\n */\nexport interface OptionsEditorProps<Spec> {\n // TODO: These are temporary and may not actually make sense, so replace\n // with whatever makes sense as visual editing evolves\n value: Spec;\n onChange: (next: Spec) => void;\n isReadonly?: boolean;\n}\n\n/**\n * Common props passed to query editor component\n */\nexport interface QueryEditorProps<Spec> extends OptionsEditorProps<Spec> {\n queries: QueryDefinition[];\n}\n"],"names":[],"mappings":"AAAA,+BAA+B;AAC/B,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AA+BjC;;CAEC,GACD,WAEC"}
@@ -1,4 +1,4 @@
1
- import { PluginModuleResource } from './plugins';
1
+ import type { PluginModuleResource } from './plugins';
2
2
  /**
3
3
  * A component capable of loading the resource/metadata for all available plugins, then loading individual plugins for
4
4
  * those resources on-demand.
@@ -1 +1 @@
1
- {"version":3,"file":"plugin-loading.d.ts","sourceRoot":"","sources":["../../src/model/plugin-loading.ts"],"names":[],"mappings":"AAaA,OAAO,EAAE,oBAAoB,EAA8B,MAAM,WAAW,CAAC;AAE7E;;;GAGG;AACH,MAAM,WAAW,YAAY;IAC3B,mBAAmB,EAAE,MAAM,OAAO,CAAC,oBAAoB,EAAE,CAAC,CAAC;IAC3D,kBAAkB,EAAE,CAAC,QAAQ,EAAE,oBAAoB,KAAK,OAAO,CAAC,OAAO,CAAC,CAAC;CAC1E;AAED;;GAEG;AACH,MAAM,WAAW,mBAAmB;IAClC,QAAQ,EAAE,oBAAoB,CAAC;IAC/B,YAAY,IAAI,OAAO,CAAC,OAAO,CAAC,CAAC;CAClC;AAED;;;GAGG;AACH,wBAAgB,yBAAyB,CAAC,OAAO,EAAE,mBAAmB,EAAE,GAAG,YAAY,CA8BtF"}
1
+ {"version":3,"file":"plugin-loading.d.ts","sourceRoot":"","sources":["../../src/model/plugin-loading.ts"],"names":[],"mappings":"AAaA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,WAAW,CAAC;AAGtD;;;GAGG;AACH,MAAM,WAAW,YAAY;IAC3B,mBAAmB,EAAE,MAAM,OAAO,CAAC,oBAAoB,EAAE,CAAC,CAAC;IAC3D,kBAAkB,EAAE,CAAC,QAAQ,EAAE,oBAAoB,KAAK,OAAO,CAAC,OAAO,CAAC,CAAC;CAC1E;AAED;;GAEG;AACH,MAAM,WAAW,mBAAmB;IAClC,QAAQ,EAAE,oBAAoB,CAAC;IAC/B,YAAY,IAAI,OAAO,CAAC,OAAO,CAAC,CAAC;CAClC;AAED;;;GAGG;AACH,wBAAgB,yBAAyB,CAAC,OAAO,EAAE,mBAAmB,EAAE,GAAG,YAAY,CA8BtF"}
@@ -10,7 +10,7 @@
10
10
  // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11
11
  // See the License for the specific language governing permissions and
12
12
  // limitations under the License.
13
- import { getPluginModuleCompoundKey } from './plugins';
13
+ import { getPluginModuleCompoundKey } from "./plugins.js";
14
14
  /**
15
15
  * A PluginLoader for the common pattern in Perses where we eagerly import a plugin's resource file, and then lazy load
16
16
  * the plugin itself via a dynamic `import()` statement.
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/model/plugin-loading.ts"],"sourcesContent":["// Copyright 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\nimport { PluginModuleResource, getPluginModuleCompoundKey } from './plugins';\n\n/**\n * A component capable of loading the resource/metadata for all available plugins, then loading individual plugins for\n * those resources on-demand.\n */\nexport interface PluginLoader {\n getInstalledPlugins: () => Promise<PluginModuleResource[]>;\n importPluginModule: (resource: PluginModuleResource) => Promise<unknown>;\n}\n\n/**\n * The dynamic import for a single plugin resource.\n */\nexport interface DynamicImportPlugin {\n resource: PluginModuleResource;\n importPlugin(): Promise<unknown>;\n}\n\n/**\n * A PluginLoader for the common pattern in Perses where we eagerly import a plugin's resource file, and then lazy load\n * the plugin itself via a dynamic `import()` statement.\n */\nexport function dynamicImportPluginLoader(plugins: DynamicImportPlugin[]): PluginLoader {\n const importMap: Map<string, { resource: PluginModuleResource; importPlugin: DynamicImportPlugin['importPlugin'] }> =\n new Map();\n for (const p of plugins) {\n const {\n resource,\n resource: {\n kind,\n metadata: { name, registry, version },\n },\n importPlugin,\n } = p;\n importMap.set(getPluginModuleCompoundKey({ kind, name, registry, version }), { resource, importPlugin });\n }\n return {\n async getInstalledPlugins(): Promise<PluginModuleResource[]> {\n return Promise.resolve(Array.from(importMap.values()).map((v) => v.resource));\n },\n importPluginModule(resource): Promise<unknown> {\n const {\n kind,\n metadata: { name, version, registry },\n } = resource;\n const { importPlugin } = importMap.get(getPluginModuleCompoundKey({ kind, name, registry, version })) || {};\n if (importPlugin === undefined) {\n throw new Error('Plugin not found');\n }\n return importPlugin();\n },\n };\n}\n"],"names":["getPluginModuleCompoundKey","dynamicImportPluginLoader","plugins","importMap","Map","p","resource","kind","metadata","name","registry","version","importPlugin","set","getInstalledPlugins","Promise","resolve","Array","from","values","map","v","importPluginModule","get","undefined","Error"],"mappings":"AAAA,+BAA+B;AAC/B,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAEjC,SAA+BA,0BAA0B,QAAQ,YAAY;AAmB7E;;;CAGC,GACD,OAAO,SAASC,0BAA0BC,OAA8B;IACtE,MAAMC,YACJ,IAAIC;IACN,KAAK,MAAMC,KAAKH,QAAS;QACvB,MAAM,EACJI,QAAQ,EACRA,UAAU,EACRC,IAAI,EACJC,UAAU,EAAEC,IAAI,EAAEC,QAAQ,EAAEC,OAAO,EAAE,EACtC,EACDC,YAAY,EACb,GAAGP;QACJF,UAAUU,GAAG,CAACb,2BAA2B;YAAEO;YAAME;YAAMC;YAAUC;QAAQ,IAAI;YAAEL;YAAUM;QAAa;IACxG;IACA,OAAO;QACL,MAAME;YACJ,OAAOC,QAAQC,OAAO,CAACC,MAAMC,IAAI,CAACf,UAAUgB,MAAM,IAAIC,GAAG,CAAC,CAACC,IAAMA,EAAEf,QAAQ;QAC7E;QACAgB,oBAAmBhB,QAAQ;YACzB,MAAM,EACJC,IAAI,EACJC,UAAU,EAAEC,IAAI,EAAEE,OAAO,EAAED,QAAQ,EAAE,EACtC,GAAGJ;YACJ,MAAM,EAAEM,YAAY,EAAE,GAAGT,UAAUoB,GAAG,CAACvB,2BAA2B;gBAAEO;gBAAME;gBAAMC;gBAAUC;YAAQ,OAAO,CAAC;YAC1G,IAAIC,iBAAiBY,WAAW;gBAC9B,MAAM,IAAIC,MAAM;YAClB;YACA,OAAOb;QACT;IACF;AACF"}
1
+ {"version":3,"sources":["../../src/model/plugin-loading.ts"],"sourcesContent":["// Copyright 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\nimport type { PluginModuleResource } from './plugins';\nimport { getPluginModuleCompoundKey } from './plugins';\n\n/**\n * A component capable of loading the resource/metadata for all available plugins, then loading individual plugins for\n * those resources on-demand.\n */\nexport interface PluginLoader {\n getInstalledPlugins: () => Promise<PluginModuleResource[]>;\n importPluginModule: (resource: PluginModuleResource) => Promise<unknown>;\n}\n\n/**\n * The dynamic import for a single plugin resource.\n */\nexport interface DynamicImportPlugin {\n resource: PluginModuleResource;\n importPlugin(): Promise<unknown>;\n}\n\n/**\n * A PluginLoader for the common pattern in Perses where we eagerly import a plugin's resource file, and then lazy load\n * the plugin itself via a dynamic `import()` statement.\n */\nexport function dynamicImportPluginLoader(plugins: DynamicImportPlugin[]): PluginLoader {\n const importMap: Map<string, { resource: PluginModuleResource; importPlugin: DynamicImportPlugin['importPlugin'] }> =\n new Map();\n for (const p of plugins) {\n const {\n resource,\n resource: {\n kind,\n metadata: { name, registry, version },\n },\n importPlugin,\n } = p;\n importMap.set(getPluginModuleCompoundKey({ kind, name, registry, version }), { resource, importPlugin });\n }\n return {\n async getInstalledPlugins(): Promise<PluginModuleResource[]> {\n return Promise.resolve(Array.from(importMap.values()).map((v) => v.resource));\n },\n importPluginModule(resource): Promise<unknown> {\n const {\n kind,\n metadata: { name, version, registry },\n } = resource;\n const { importPlugin } = importMap.get(getPluginModuleCompoundKey({ kind, name, registry, version })) || {};\n if (importPlugin === undefined) {\n throw new Error('Plugin not found');\n }\n return importPlugin();\n },\n };\n}\n"],"names":["getPluginModuleCompoundKey","dynamicImportPluginLoader","plugins","importMap","Map","p","resource","kind","metadata","name","registry","version","importPlugin","set","getInstalledPlugins","Promise","resolve","Array","from","values","map","v","importPluginModule","get","undefined","Error"],"mappings":"AAAA,+BAA+B;AAC/B,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAGjC,SAASA,0BAA0B,QAAQ,eAAY;AAmBvD;;;CAGC,GACD,OAAO,SAASC,0BAA0BC,OAA8B;IACtE,MAAMC,YACJ,IAAIC;IACN,KAAK,MAAMC,KAAKH,QAAS;QACvB,MAAM,EACJI,QAAQ,EACRA,UAAU,EACRC,IAAI,EACJC,UAAU,EAAEC,IAAI,EAAEC,QAAQ,EAAEC,OAAO,EAAE,EACtC,EACDC,YAAY,EACb,GAAGP;QACJF,UAAUU,GAAG,CAACb,2BAA2B;YAAEO;YAAME;YAAMC;YAAUC;QAAQ,IAAI;YAAEL;YAAUM;QAAa;IACxG;IACA,OAAO;QACL,MAAME;YACJ,OAAOC,QAAQC,OAAO,CAACC,MAAMC,IAAI,CAACf,UAAUgB,MAAM,IAAIC,GAAG,CAAC,CAACC,IAAMA,EAAEf,QAAQ;QAC7E;QACAgB,oBAAmBhB,QAAQ;YACzB,MAAM,EACJC,IAAI,EACJC,UAAU,EAAEC,IAAI,EAAEE,OAAO,EAAED,QAAQ,EAAE,EACtC,GAAGJ;YACJ,MAAM,EAAEM,YAAY,EAAE,GAAGT,UAAUoB,GAAG,CAACvB,2BAA2B;gBAAEO;gBAAME;gBAAMC;gBAAUC;YAAQ,OAAO,CAAC;YAC1G,IAAIC,iBAAiBY,WAAW;gBAC9B,MAAM,IAAIC,MAAM;YAClB;YACA,OAAOb;QACT;IACF;AACF"}
@@ -1,17 +1,17 @@
1
- import { UnknownSpec } from '@perses-dev/spec';
2
- import { AlertsQueryPlugin } from './alerts-queries';
3
- import { AnnotationPlugin } from './annotations';
4
- import { DatasourcePlugin } from './datasource';
5
- import { ExplorePlugin } from './explore';
6
- import { JsonQueryPlugin } from './json-queries';
7
- import { LogQueryPlugin } from './log-queries';
8
- import { PanelPlugin } from './panels';
9
- import { Plugin } from './plugin-base';
10
- import { ProfileQueryPlugin } from './profile-queries';
11
- import { SilencesQueryPlugin } from './silences-queries';
12
- import { TimeSeriesQueryPlugin } from './time-series-queries';
13
- import { TraceQueryPlugin } from './trace-queries';
14
- import { VariablePlugin } from './variables';
1
+ import type { UnknownSpec } from '@perses-dev/spec';
2
+ import type { AlertsQueryPlugin } from './alerts-queries';
3
+ import type { AnnotationPlugin } from './annotations';
4
+ import type { DatasourcePlugin } from './datasource';
5
+ import type { ExplorePlugin } from './explore';
6
+ import type { JsonQueryPlugin } from './json-queries';
7
+ import type { LogQueryPlugin } from './log-queries';
8
+ import type { PanelPlugin } from './panels';
9
+ import type { Plugin } from './plugin-base';
10
+ import type { ProfileQueryPlugin } from './profile-queries';
11
+ import type { SilencesQueryPlugin } from './silences-queries';
12
+ import type { TimeSeriesQueryPlugin } from './time-series-queries';
13
+ import type { TraceQueryPlugin } from './trace-queries';
14
+ import type { VariablePlugin } from './variables';
15
15
  export interface PluginModuleSpec {
16
16
  plugins: PluginMetadata[];
17
17
  }
@@ -1 +1 @@
1
- {"version":3,"file":"plugins.d.ts","sourceRoot":"","sources":["../../src/model/plugins.ts"],"names":[],"mappings":"AAaA,OAAO,EAAE,WAAW,EAAE,MA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AAW,EAAE,iBAAiB,CAAC;IAC/B,aAAa,EAAE,mBAAmB,CAAC;IACnC,SAAS,EAAE,eAAe,CAAC;IAC3B,UAAU,EAAE,gBAAgB,CAAC;IAC7B,OAAO,EAAE,aAAa,CAAC;CACxB;AAED;;GAEG;AACH,MAAM,MAAM,oBAAoB,CAAC,IAAI,SAAS,UAAU,IAAI,gBAAgB,CAAC,IAAI,CAAC,CAAC;AAEnF;;GAEG;AACH,KAAK,WAAW,GAAG,OAAO,CAAC,MAAM,CAAC,UAAU,EAAE,MAAM,CAAC,CAAC,CAAC;AACvD,MAAM,MAAM,kBAAkB,GAAG,QAAQ,CAAC,IAAI,CAAC,WAAW,EAAE,iBAAiB,CAAC,CAAC,GAAG,IAAI,CAAC,WAAW,EAAE,iBAAiB,CAAC,CAAC;AAEvH,MAAM,MAAM,iBAAiB,CAAC,CAAC,SAAS,UAAU,IAAI;IACpD,IAAI,EAAE,CAAC,CAAC;IACR,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB,CAAC;AAEF,wBAAgB,0BAA0B,CAAC,WAAW,EAAE;IACtD,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB,GAAG,MAAM,CAGT"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/model/plugins.ts"],"sourcesContent":["// Copyright 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\nimport { UnknownSpec } from '@perses-dev/spec';\n\nimport { AlertsQueryPlugin } from './alerts-queries';\nimport { AnnotationPlugin } from './annotations';\nimport { DatasourcePlugin } from './datasource';\nimport { ExplorePlugin } from './explore';\nimport { JsonQueryPlugin } from './json-queries';\nimport { LogQueryPlugin } from './log-queries';\nimport { PanelPlugin } from './panels';\nimport { Plugin } from './plugin-base';\nimport { ProfileQueryPlugin } from './profile-queries';\nimport { SilencesQueryPlugin } from './silences-queries';\nimport { TimeSeriesQueryPlugin } from './time-series-queries';\nimport { TraceQueryPlugin } from './trace-queries';\nimport { VariablePlugin } from './variables';\n\nexport interface PluginModuleSpec {\n plugins: PluginMetadata[];\n}\n\nexport interface PluginMetadataWithModule extends PluginMetadata {\n module: PluginModuleMetadata;\n}\n\n/**\n * Metadata about an individual plugin that's part of a PluginModule.\n */\nexport interface PluginMetadata {\n kind: PluginType;\n metadata?: {\n version?: string;\n registry?: string;\n };\n spec: {\n name: string;\n display: {\n name: string;\n description?: string;\n };\n };\n}\n\n/**\n * Metadata about a module/package that contains plugins.\n */\nexport interface PluginModuleMetadata {\n name: string;\n version: string;\n registry?: string;\n}\n\n/**\n * Information about a module/package that contains plugins.\n */\nexport interface PluginModuleResource {\n kind: 'PluginModule';\n metadata: PluginModuleMetadata;\n spec: PluginModuleSpec;\n}\n\n/**\n * All supported plugin types. A plugin's implementation must extend from `Plugin<UnknownSpec>` to be considered a valid\n * `PluginType`.\n */\nexport type PluginType = {\n // Filter out implementations on SupportedPlugins that don't extend `Plugin<UnknownSpec>`\n [K in keyof SupportedPlugins]: SupportedPlugins[K] extends Plugin<UnknownSpec> ? K : never;\n}[keyof SupportedPlugins];\n\n/**\n * Map of plugin type key/string -> implementation type. Use Typescript module augmentation to extend the plugin system\n * with new plugin types.\n */\nexport interface SupportedPlugins {\n Variable: VariablePlugin;\n Annotation: AnnotationPlugin;\n Panel: PanelPlugin;\n TimeSeriesQuery: TimeSeriesQueryPlugin;\n TraceQuery: TraceQueryPlugin;\n ProfileQuery: ProfileQueryPlugin;\n LogQuery: LogQueryPlugin;\n AlertsQuery: AlertsQueryPlugin;\n SilencesQuery: SilencesQueryPlugin;\n JsonQuery: JsonQueryPlugin;\n Datasource: DatasourcePlugin;\n Explore: ExplorePlugin;\n}\n\n/**\n * The implementation for a given plugin type.\n */\nexport type PluginImplementation<Type extends PluginType> = SupportedPlugins[Type];\n\n/**\n * Default plugin kinds by plugin type.\n */\ntype PluginKinds = Partial<Record<PluginType, string>>;\nexport type DefaultPluginKinds = Required<Pick<PluginKinds, 'TimeSeriesQuery'>> & Omit<PluginKinds, 'TimeSeriesQuery'>;\n\nexport type PluginCompoundKey<T extends PluginType> = {\n kind: T;\n name: string;\n registry?: string;\n version?: string;\n};\n\nexport function getPluginModuleCompoundKey(compoundKey: {\n kind: string;\n name: string;\n registry?: string;\n version?: string;\n}): string {\n const { kind, name, registry, version } = compoundKey;\n return `${kind}:${name}:${registry ?? ''}:${version ?? ''}`;\n}\n"],"names":["getPluginModuleCompoundKey","compoundKey","kind","name","registry","version"],"mappings":"AAAA,+BAA+B;AAC/B,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AA4GjC,OAAO,SAASA,2BAA2BC,WAK1C;IACC,MAAM,EAAEC,IAAI,EAAEC,IAAI,EAAEC,QAAQ,EAAEC,OAAO,EAAE,GAAGJ;IAC1C,OAAO,GAAGC,KAAK,CAAC,EAAEC,KAAK,CAAC,EAAEC,YAAY,GAAG,CAAC,EAAEC,WAAW,IAAI;AAC7D"}
1
+ {"version":3,"sources":["../../src/model/plugins.ts"],"sourcesContent":["// Copyright 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\nimport type { UnknownSpec } from '@perses-dev/spec';\n\nimport type { AlertsQueryPlugin } from './alerts-queries';\nimport type { AnnotationPlugin } from './annotations';\nimport type { DatasourcePlugin } from './datasource';\nimport type { ExplorePlugin } from './explore';\nimport type { JsonQueryPlugin } from './json-queries';\nimport type { LogQueryPlugin } from './log-queries';\nimport type { PanelPlugin } from './panels';\nimport type { Plugin } from './plugin-base';\nimport type { ProfileQueryPlugin } from './profile-queries';\nimport type { SilencesQueryPlugin } from './silences-queries';\nimport type { TimeSeriesQueryPlugin } from './time-series-queries';\nimport type { TraceQueryPlugin } from './trace-queries';\nimport type { VariablePlugin } from './variables';\n\nexport interface PluginModuleSpec {\n plugins: PluginMetadata[];\n}\n\nexport interface PluginMetadataWithModule extends PluginMetadata {\n module: PluginModuleMetadata;\n}\n\n/**\n * Metadata about an individual plugin that's part of a PluginModule.\n */\nexport interface PluginMetadata {\n kind: PluginType;\n metadata?: {\n version?: string;\n registry?: string;\n };\n spec: {\n name: string;\n display: {\n name: string;\n description?: string;\n };\n };\n}\n\n/**\n * Metadata about a module/package that contains plugins.\n */\nexport interface PluginModuleMetadata {\n name: string;\n version: string;\n registry?: string;\n}\n\n/**\n * Information about a module/package that contains plugins.\n */\nexport interface PluginModuleResource {\n kind: 'PluginModule';\n metadata: PluginModuleMetadata;\n spec: PluginModuleSpec;\n}\n\n/**\n * All supported plugin types. A plugin's implementation must extend from `Plugin<UnknownSpec>` to be considered a valid\n * `PluginType`.\n */\nexport type PluginType = {\n // Filter out implementations on SupportedPlugins that don't extend `Plugin<UnknownSpec>`\n [K in keyof SupportedPlugins]: SupportedPlugins[K] extends Plugin<UnknownSpec> ? K : never;\n}[keyof SupportedPlugins];\n\n/**\n * Map of plugin type key/string -> implementation type. Use Typescript module augmentation to extend the plugin system\n * with new plugin types.\n */\nexport interface SupportedPlugins {\n Variable: VariablePlugin;\n Annotation: AnnotationPlugin;\n Panel: PanelPlugin;\n TimeSeriesQuery: TimeSeriesQueryPlugin;\n TraceQuery: TraceQueryPlugin;\n ProfileQuery: ProfileQueryPlugin;\n LogQuery: LogQueryPlugin;\n AlertsQuery: AlertsQueryPlugin;\n SilencesQuery: SilencesQueryPlugin;\n JsonQuery: JsonQueryPlugin;\n Datasource: DatasourcePlugin;\n Explore: ExplorePlugin;\n}\n\n/**\n * The implementation for a given plugin type.\n */\nexport type PluginImplementation<Type extends PluginType> = SupportedPlugins[Type];\n\n/**\n * Default plugin kinds by plugin type.\n */\ntype PluginKinds = Partial<Record<PluginType, string>>;\nexport type DefaultPluginKinds = Required<Pick<PluginKinds, 'TimeSeriesQuery'>> & Omit<PluginKinds, 'TimeSeriesQuery'>;\n\nexport type PluginCompoundKey<T extends PluginType> = {\n kind: T;\n name: string;\n registry?: string;\n version?: string;\n};\n\nexport function getPluginModuleCompoundKey(compoundKey: {\n kind: string;\n name: string;\n registry?: string;\n version?: string;\n}): string {\n const { kind, name, registry, version } = compoundKey;\n return `${kind}:${name}:${registry ?? ''}:${version ?? ''}`;\n}\n"],"names":["getPluginModuleCompoundKey","compoundKey","kind","name","registry","version"],"mappings":"AAAA,+BAA+B;AAC/B,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AA4GjC,OAAO,SAASA,2BAA2BC,WAK1C;IACC,MAAM,EAAEC,IAAI,EAAEC,IAAI,EAAEC,QAAQ,EAAEC,OAAO,EAAE,GAAGJ;IAC1C,OAAO,GAAGC,KAAK,CAAC,EAAEC,KAAK,CAAC,EAAEC,YAAY,GAAG,CAAC,EAAEC,WAAW,IAAI;AAC7D"}
@@ -1,7 +1,7 @@
1
- import { UnknownSpec, ProfileData, AbsoluteTimeRange } from '@perses-dev/spec';
2
- import { Query, QueryKey } from '@tanstack/react-query';
3
- import { DatasourceStore } from '../runtime';
4
- import { Plugin } from './plugin-base';
1
+ import type { UnknownSpec, ProfileData, AbsoluteTimeRange } from '@perses-dev/spec';
2
+ import type { Query, QueryKey } from '@tanstack/react-query';
3
+ import type { DatasourceStore } from '../runtime';
4
+ import type { Plugin } from './plugin-base';
5
5
  /**
6
6
  * A plugin for running profile queries.
7
7
  */
@@ -1 +1 @@
1
- {"version":3,"file":"profile-queries.d.ts","sourceRoot":"","sources":["../../src/model/profile-queries.ts"],"names":[],"mappings":"AAaA,OAAO,EAAE,WAAW,EAAE,WAAW,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AAC/E,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAExD,OAAO,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAC7C,OAAO,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AAEvC;;GAEG;AACH,MAAM,WAAW,kBAAkB,CAAC,IAAI,GAAG,WAAW,CAAE,SAAQ,MAAM,CAAC,IAAI,CAAC;IAC1E,cAAc,EAAE,CAAC,IAAI,EAAE,IAAI,EAAE,GAAG,EAAE,mBAAmB,EAAE,WAAW,CAAC,EAAE,WAAW,KAAK,OAAO,CAAC,WAAW,CAAC,CAAC;CAC3G;AAED;;GAEG;AACH,MAAM,WAAW,mBAAmB;IAClC,eAAe,EAAE,eAAe,CAAC;IACjC,iBAAiB,CAAC,EAAE,iBAAiB,CAAC;CACvC;AAED,MAAM,MAAM,gBAAgB,GAAG,KAAK,CAAC,WAAW,EAAE,OAAO,EAAE,WAAW,EAAE,QAAQ,CAAC,CAAC"}
1
+ {"version":3,"file":"profile-queries.d.ts","sourceRoot":"","sources":["../../src/model/profile-queries.ts"],"names":[],"mappings":"AAaA,OAAO,KAAK,EAAE,WAAW,EAAE,WAAW,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AACpF,OAAO,KAAK,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAE7D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAClD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AAE5C;;GAEG;AACH,MAAM,WAAW,kBAAkB,CAAC,IAAI,GAAG,WAAW,CAAE,SAAQ,MAAM,CAAC,IAAI,CAAC;IAC1E,cAAc,EAAE,CAAC,IAAI,EAAE,IAAI,EAAE,GAAG,EAAE,mBAAmB,EAAE,WAAW,CAAC,EAAE,WAAW,KAAK,OAAO,CAAC,WAAW,CAAC,CAAC;CAC3G;AAED;;GAEG;AACH,MAAM,WAAW,mBAAmB;IAClC,eAAe,EAAE,eAAe,CAAC;IACjC,iBAAiB,CAAC,EAAE,iBAAiB,CAAC;CACvC;AAED,MAAM,MAAM,gBAAgB,GAAG,KAAK,CAAC,WAAW,EAAE,OAAO,EAAE,WAAW,EAAE,QAAQ,CAAC,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/model/profile-queries.ts"],"sourcesContent":["// Copyright 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\nimport { UnknownSpec, ProfileData, AbsoluteTimeRange } from '@perses-dev/spec';\nimport { Query, QueryKey } from '@tanstack/react-query';\n\nimport { DatasourceStore } from '../runtime';\nimport { Plugin } from './plugin-base';\n\n/**\n * A plugin for running profile queries.\n */\nexport interface ProfileQueryPlugin<Spec = UnknownSpec> extends Plugin<Spec> {\n getProfileData: (spec: Spec, ctx: ProfileQueryContext, abortSignal?: AbortSignal) => Promise<ProfileData>;\n}\n\n/**\n * Context available to ProfileQuery plugins at runtime.\n */\nexport interface ProfileQueryContext {\n datasourceStore: DatasourceStore;\n absoluteTimeRange?: AbsoluteTimeRange;\n}\n\nexport type ProfileDataQuery = Query<ProfileData, unknown, ProfileData, QueryKey>;\n"],"names":[],"mappings":"AAAA,+BAA+B;AAC/B,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAuBjC,WAAkF"}
1
+ {"version":3,"sources":["../../src/model/profile-queries.ts"],"sourcesContent":["// Copyright 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\nimport type { UnknownSpec, ProfileData, AbsoluteTimeRange } from '@perses-dev/spec';\nimport type { Query, QueryKey } from '@tanstack/react-query';\n\nimport type { DatasourceStore } from '../runtime';\nimport type { Plugin } from './plugin-base';\n\n/**\n * A plugin for running profile queries.\n */\nexport interface ProfileQueryPlugin<Spec = UnknownSpec> extends Plugin<Spec> {\n getProfileData: (spec: Spec, ctx: ProfileQueryContext, abortSignal?: AbortSignal) => Promise<ProfileData>;\n}\n\n/**\n * Context available to ProfileQuery plugins at runtime.\n */\nexport interface ProfileQueryContext {\n datasourceStore: DatasourceStore;\n absoluteTimeRange?: AbsoluteTimeRange;\n}\n\nexport type ProfileDataQuery = Query<ProfileData, unknown, ProfileData, QueryKey>;\n"],"names":[],"mappings":"AAAA,+BAA+B;AAC/B,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAuBjC,WAAkF"}
@@ -1,7 +1,7 @@
1
- import { SilencesData, UnknownSpec } from '@perses-dev/spec';
2
- import { Query, QueryKey } from '@tanstack/react-query';
3
- import { DatasourceStore, VariableStateMap } from '../runtime';
4
- import { Plugin } from './plugin-base';
1
+ import type { SilencesData, UnknownSpec } from '@perses-dev/spec';
2
+ import type { Query, QueryKey } from '@tanstack/react-query';
3
+ import type { DatasourceStore, VariableStateMap } from '../runtime';
4
+ import type { Plugin } from './plugin-base';
5
5
  /**
6
6
  * An object containing all the dependencies of a SilencesQuery.
7
7
  */
@@ -1 +1 @@
1
- {"version":3,"file":"silences-queries.d.ts","sourceRoot":"","sources":["../../src/model/silences-queries.ts"],"names":[],"mappings":"AAaA,OAAO,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAC7D,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAExD,OAAO,EAAE,eAAe,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAC/D,OAAO,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AAEvC;;GAEG;AACH,KAAK,+BAA+B,GAAG;IACrC;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,EAAE,CAAC;CACtB,CAAC;AAEF;;;;GAIG;AACH,MAAM,WAAW,mBAAmB,CAAC,IAAI,GAAG,WAAW,CAAE,SAAQ,MAAM,CAAC,IAAI,CAAC;IAC3E,eAAe,EAAE,CAAC,IAAI,EAAE,IAAI,EAAE,GAAG,EAAE,oBAAoB,EAAE,WAAW,CAAC,EAAE,WAAW,KAAK,OAAO,CAAC,YAAY,CAAC,CAAC;IAC7G,SAAS,CAAC,EAAE,CAAC,IAAI,EAAE,IAAI,EAAE,GAAG,EAAE,oBAAoB,KAA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 +1 @@
1
- {"version":3,"sources":["../../src/model/silences-queries.ts"],"sourcesContent":["// Copyright 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\nimport { SilencesData, UnknownSpec } from '@perses-dev/spec';\nimport { Query, QueryKey } from '@tanstack/react-query';\n\nimport { DatasourceStore, VariableStateMap } from '../runtime';\nimport { Plugin } from './plugin-base';\n\n/**\n * An object containing all the dependencies of a SilencesQuery.\n */\ntype SilencesQueryPluginDependencies = {\n /**\n * Returns a list of variables name this silences query depends on.\n */\n variables?: string[];\n};\n\n/**\n * A plugin for running silences queries.\n * Silences represent current state, not historical data, so the context\n * does NOT include absoluteTimeRange.\n */\nexport interface SilencesQueryPlugin<Spec = UnknownSpec> extends Plugin<Spec> {\n getSilencesData: (spec: Spec, ctx: SilencesQueryContext, abortSignal?: AbortSignal) => Promise<SilencesData>;\n dependsOn?: (spec: Spec, ctx: SilencesQueryContext) => SilencesQueryPluginDependencies;\n}\n\n/**\n * Context available to SilencesQuery plugins at runtime.\n * Note: No absoluteTimeRange since silences represent current state.\n */\nexport interface SilencesQueryContext {\n datasourceStore: DatasourceStore;\n variableState: VariableStateMap;\n}\n\nexport type SilencesDataQuery = Query<SilencesData, unknown, SilencesData, QueryKey>;\n"],"names":[],"mappings":"AAAA,+BAA+B;AAC/B,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAqCjC,WAAqF"}
1
+ {"version":3,"sources":["../../src/model/silences-queries.ts"],"sourcesContent":["// Copyright 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\nimport type { SilencesData, UnknownSpec } from '@perses-dev/spec';\nimport type { Query, QueryKey } from '@tanstack/react-query';\n\nimport type { DatasourceStore, VariableStateMap } from '../runtime';\nimport type { Plugin } from './plugin-base';\n\n/**\n * An object containing all the dependencies of a SilencesQuery.\n */\ntype SilencesQueryPluginDependencies = {\n /**\n * Returns a list of variables name this silences query depends on.\n */\n variables?: string[];\n};\n\n/**\n * A plugin for running silences queries.\n * Silences represent current state, not historical data, so the context\n * does NOT include absoluteTimeRange.\n */\nexport interface SilencesQueryPlugin<Spec = UnknownSpec> extends Plugin<Spec> {\n getSilencesData: (spec: Spec, ctx: SilencesQueryContext, abortSignal?: AbortSignal) => Promise<SilencesData>;\n dependsOn?: (spec: Spec, ctx: SilencesQueryContext) => SilencesQueryPluginDependencies;\n}\n\n/**\n * Context available to SilencesQuery plugins at runtime.\n * Note: No absoluteTimeRange since silences represent current state.\n */\nexport interface SilencesQueryContext {\n datasourceStore: DatasourceStore;\n variableState: VariableStateMap;\n}\n\nexport type SilencesDataQuery = Query<SilencesData, unknown, SilencesData, QueryKey>;\n"],"names":[],"mappings":"AAAA,+BAA+B;AAC/B,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAqCjC,WAAqF"}