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

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 (331) hide show
  1. package/dist/cjs/components/Annotations/AnnotationEditorForm/AnnotationEditorForm.js +4 -4
  2. package/dist/cjs/components/Annotations/AnnotationEditorForm/AnnotationPreview.js +1 -1
  3. package/dist/cjs/components/DatasourceEditorForm/DatasourceEditorForm.js +3 -2
  4. package/dist/cjs/components/DatasourceSelect/DatasourceSelect.js +1 -1
  5. package/dist/cjs/components/DatasourceTestConnectionButton/DatasourceTestConnectionButton.js +53 -0
  6. package/dist/cjs/components/DatasourceTestConnectionButton/index.js +30 -0
  7. package/dist/cjs/components/HTTPSettingsEditor/HTTPSettingsEditor.js +49 -24
  8. package/dist/cjs/components/LayoutEditor/LayoutEditor.js +123 -0
  9. package/dist/cjs/components/LayoutEditor/RepeatLayoutPreview.js +105 -0
  10. package/dist/cjs/components/LayoutEditor/RepeatVariableEditor.js +176 -0
  11. package/dist/cjs/components/LayoutEditor/index.js +32 -0
  12. package/dist/cjs/components/LinksEditor/LinksEditor.js +4 -4
  13. package/dist/cjs/components/MultiQueryEditor/MultiQueryEditor.js +8 -5
  14. package/dist/cjs/components/MultiQueryEditor/QueryEditorContainer.js +7 -7
  15. package/dist/cjs/components/PanelSpecEditor/PanelAnnotationsEditor.js +4 -4
  16. package/dist/cjs/components/PanelSpecEditor/PanelSpecEditor.js +18 -6
  17. package/dist/cjs/components/PluginEditor/PluginEditor.js +4 -3
  18. package/dist/cjs/components/PluginEditor/plugin-editor-api.js +1 -1
  19. package/dist/cjs/components/PluginRegistry/PluginRegistry.js +1 -1
  20. package/dist/cjs/components/PluginSpecEditor/DatasourceSpecEditor.js +70 -0
  21. package/dist/cjs/components/PluginSpecEditor/PluginSpecEditor.js +17 -3
  22. package/dist/cjs/components/TimeRangeControls/TimeRangeControls.js +6 -7
  23. package/dist/cjs/components/Variables/VariableEditorForm/VariableEditorForm.js +5 -5
  24. package/dist/cjs/components/Variables/VariableEditorForm/VariablePreview.js +1 -1
  25. package/dist/cjs/components/index.js +2 -0
  26. package/dist/cjs/constants/index.js +1 -0
  27. package/dist/cjs/constants/repeat.js +32 -0
  28. package/dist/cjs/context/ValidationProvider.js +2 -2
  29. package/dist/cjs/model/index.js +1 -0
  30. package/dist/cjs/model/json-queries.js +16 -0
  31. package/dist/cjs/remote/PluginRuntime.js +12 -20
  32. package/dist/cjs/remote/remotePluginLoader.js +1 -1
  33. package/dist/cjs/runtime/DataQueriesProvider/DataQueriesProvider.js +14 -6
  34. package/dist/cjs/runtime/TimeRangeProvider/TimeRangeProvider.js +18 -4
  35. package/dist/cjs/runtime/TimeRangeProvider/TimeRangeProviders.js +2 -2
  36. package/dist/cjs/runtime/TimeRangeProvider/TimeRangeSettingsProvider.js +14 -1
  37. package/dist/cjs/runtime/TimeRangeProvider/query-params.js +2 -2
  38. package/dist/cjs/runtime/alerts-queries.js +1 -1
  39. package/dist/cjs/runtime/annotations.js +2 -2
  40. package/dist/cjs/runtime/index.js +1 -0
  41. package/dist/cjs/runtime/item-actions.js +1 -1
  42. package/dist/cjs/runtime/json-queries.js +70 -0
  43. package/dist/cjs/runtime/silences-queries.js +1 -1
  44. package/dist/cjs/runtime/time-series-queries.js +1 -1
  45. package/dist/cjs/runtime/trace-queries.js +1 -1
  46. package/dist/cjs/schema/panel.js +17 -3
  47. package/dist/cjs/test/mock-data.js +9 -0
  48. package/dist/cjs/test/setup-tests.js +9 -3
  49. package/dist/cjs/test/test-plugins/ernie/index.js +58 -1
  50. package/dist/cjs/utils/csv-export.js +1 -1
  51. package/dist/components/Annotations/AnnotationEditorForm/AnnotationEditorForm.d.ts +2 -2
  52. package/dist/components/Annotations/AnnotationEditorForm/AnnotationEditorForm.d.ts.map +1 -1
  53. package/dist/components/Annotations/AnnotationEditorForm/AnnotationEditorForm.js +4 -4
  54. package/dist/components/Annotations/AnnotationEditorForm/AnnotationEditorForm.js.map +1 -1
  55. package/dist/components/Annotations/AnnotationEditorForm/AnnotationPreview.d.ts +2 -2
  56. package/dist/components/Annotations/AnnotationEditorForm/AnnotationPreview.d.ts.map +1 -1
  57. package/dist/components/Annotations/AnnotationEditorForm/AnnotationPreview.js +1 -1
  58. package/dist/components/Annotations/AnnotationEditorForm/AnnotationPreview.js.map +1 -1
  59. package/dist/components/CalculationSelector/CalculationSelector.d.ts.map +1 -1
  60. package/dist/components/CalculationSelector/CalculationSelector.js.map +1 -1
  61. package/dist/components/DatasourceEditorForm/DatasourceEditorForm.d.ts +2 -1
  62. package/dist/components/DatasourceEditorForm/DatasourceEditorForm.d.ts.map +1 -1
  63. package/dist/components/DatasourceEditorForm/DatasourceEditorForm.js +3 -2
  64. package/dist/components/DatasourceEditorForm/DatasourceEditorForm.js.map +1 -1
  65. package/dist/components/DatasourceSelect/DatasourceSelect.d.ts.map +1 -1
  66. package/dist/components/DatasourceSelect/DatasourceSelect.js +1 -1
  67. package/dist/components/DatasourceSelect/DatasourceSelect.js.map +1 -1
  68. package/dist/components/DatasourceTestConnectionButton/DatasourceTestConnectionButton.d.ts +8 -0
  69. package/dist/components/DatasourceTestConnectionButton/DatasourceTestConnectionButton.d.ts.map +1 -0
  70. package/dist/components/DatasourceTestConnectionButton/DatasourceTestConnectionButton.js +45 -0
  71. package/dist/components/DatasourceTestConnectionButton/DatasourceTestConnectionButton.js.map +1 -0
  72. package/dist/components/DatasourceTestConnectionButton/index.d.ts +2 -0
  73. package/dist/components/DatasourceTestConnectionButton/index.d.ts.map +1 -0
  74. package/dist/components/DatasourceTestConnectionButton/index.js +15 -0
  75. package/dist/components/DatasourceTestConnectionButton/index.js.map +1 -0
  76. package/dist/components/HTTPSettingsEditor/HTTPSettingsEditor.d.ts +2 -1
  77. package/dist/components/HTTPSettingsEditor/HTTPSettingsEditor.d.ts.map +1 -1
  78. package/dist/components/HTTPSettingsEditor/HTTPSettingsEditor.js +50 -25
  79. package/dist/components/HTTPSettingsEditor/HTTPSettingsEditor.js.map +1 -1
  80. package/dist/components/ItemSelectionActionsOptionsEditor/ItemSelectionActionsOptionsEditor.js.map +1 -1
  81. package/dist/components/LayoutEditor/LayoutEditor.d.ts +16 -0
  82. package/dist/components/LayoutEditor/LayoutEditor.d.ts.map +1 -0
  83. package/dist/components/LayoutEditor/LayoutEditor.js +115 -0
  84. package/dist/components/LayoutEditor/LayoutEditor.js.map +1 -0
  85. package/dist/components/LayoutEditor/RepeatLayoutPreview.d.ts +7 -0
  86. package/dist/components/LayoutEditor/RepeatLayoutPreview.d.ts.map +1 -0
  87. package/dist/components/LayoutEditor/RepeatLayoutPreview.js +92 -0
  88. package/dist/components/LayoutEditor/RepeatLayoutPreview.js.map +1 -0
  89. package/dist/components/LayoutEditor/RepeatVariableEditor.d.ts +18 -0
  90. package/dist/components/LayoutEditor/RepeatVariableEditor.d.ts.map +1 -0
  91. package/dist/components/LayoutEditor/RepeatVariableEditor.js +168 -0
  92. package/dist/components/LayoutEditor/RepeatVariableEditor.js.map +1 -0
  93. package/dist/components/LayoutEditor/index.d.ts +4 -0
  94. package/dist/components/LayoutEditor/index.d.ts.map +1 -0
  95. package/dist/components/LayoutEditor/index.js +17 -0
  96. package/dist/components/LayoutEditor/index.js.map +1 -0
  97. package/dist/components/LegendOptionsEditor/LegendOptionsEditor.d.ts.map +1 -1
  98. package/dist/components/LegendOptionsEditor/LegendOptionsEditor.js.map +1 -1
  99. package/dist/components/LinksEditor/LinksEditor.d.ts.map +1 -1
  100. package/dist/components/LinksEditor/LinksEditor.js +4 -4
  101. package/dist/components/LinksEditor/LinksEditor.js.map +1 -1
  102. package/dist/components/MultiQueryEditor/MultiQueryEditor.d.ts +0 -1
  103. package/dist/components/MultiQueryEditor/MultiQueryEditor.d.ts.map +1 -1
  104. package/dist/components/MultiQueryEditor/MultiQueryEditor.js +8 -5
  105. package/dist/components/MultiQueryEditor/MultiQueryEditor.js.map +1 -1
  106. package/dist/components/MultiQueryEditor/QueryEditorContainer.d.ts +0 -1
  107. package/dist/components/MultiQueryEditor/QueryEditorContainer.d.ts.map +1 -1
  108. package/dist/components/MultiQueryEditor/QueryEditorContainer.js +7 -7
  109. package/dist/components/MultiQueryEditor/QueryEditorContainer.js.map +1 -1
  110. package/dist/components/OptionsEditorRadios/OptionsEditorRadios.d.ts.map +1 -1
  111. package/dist/components/OptionsEditorRadios/OptionsEditorRadios.js.map +1 -1
  112. package/dist/components/OptionsEditorTabs/OptionsEditorTabs.d.ts.map +1 -1
  113. package/dist/components/OptionsEditorTabs/OptionsEditorTabs.js.map +1 -1
  114. package/dist/components/PanelSpecEditor/PanelAnnotationsEditor.d.ts +1 -1
  115. package/dist/components/PanelSpecEditor/PanelAnnotationsEditor.d.ts.map +1 -1
  116. package/dist/components/PanelSpecEditor/PanelAnnotationsEditor.js +4 -4
  117. package/dist/components/PanelSpecEditor/PanelAnnotationsEditor.js.map +1 -1
  118. package/dist/components/PanelSpecEditor/PanelSpecEditor.d.ts +5 -2
  119. package/dist/components/PanelSpecEditor/PanelSpecEditor.d.ts.map +1 -1
  120. package/dist/components/PanelSpecEditor/PanelSpecEditor.js +18 -6
  121. package/dist/components/PanelSpecEditor/PanelSpecEditor.js.map +1 -1
  122. package/dist/components/PluginEditor/PluginEditor.d.ts.map +1 -1
  123. package/dist/components/PluginEditor/PluginEditor.js +4 -3
  124. package/dist/components/PluginEditor/PluginEditor.js.map +1 -1
  125. package/dist/components/PluginEditor/plugin-editor-api.d.ts +2 -1
  126. package/dist/components/PluginEditor/plugin-editor-api.d.ts.map +1 -1
  127. package/dist/components/PluginEditor/plugin-editor-api.js +1 -1
  128. package/dist/components/PluginEditor/plugin-editor-api.js.map +1 -1
  129. package/dist/components/PluginKindSelect/PluginKindSelect.d.ts +0 -1
  130. package/dist/components/PluginKindSelect/PluginKindSelect.d.ts.map +1 -1
  131. package/dist/components/PluginKindSelect/PluginKindSelect.js.map +1 -1
  132. package/dist/components/PluginRegistry/PluginRegistry.d.ts.map +1 -1
  133. package/dist/components/PluginRegistry/PluginRegistry.js +1 -1
  134. package/dist/components/PluginRegistry/PluginRegistry.js.map +1 -1
  135. package/dist/components/PluginRegistry/getPluginSearchHelper.d.ts.map +1 -1
  136. package/dist/components/PluginRegistry/getPluginSearchHelper.js.map +1 -1
  137. package/dist/components/PluginRegistry/plugin-indexes.d.ts.map +1 -1
  138. package/dist/components/PluginRegistry/plugin-indexes.js.map +1 -1
  139. package/dist/components/PluginSpecEditor/DatasourceSpecEditor.d.ts +10 -0
  140. package/dist/components/PluginSpecEditor/DatasourceSpecEditor.d.ts.map +1 -0
  141. package/dist/components/PluginSpecEditor/DatasourceSpecEditor.js +62 -0
  142. package/dist/components/PluginSpecEditor/DatasourceSpecEditor.js.map +1 -0
  143. package/dist/components/PluginSpecEditor/PluginSpecEditor.d.ts +2 -1
  144. package/dist/components/PluginSpecEditor/PluginSpecEditor.d.ts.map +1 -1
  145. package/dist/components/PluginSpecEditor/PluginSpecEditor.js +17 -3
  146. package/dist/components/PluginSpecEditor/PluginSpecEditor.js.map +1 -1
  147. package/dist/components/TimeRangeControls/TimeRangeControls.d.ts.map +1 -1
  148. package/dist/components/TimeRangeControls/TimeRangeControls.js +9 -10
  149. package/dist/components/TimeRangeControls/TimeRangeControls.js.map +1 -1
  150. package/dist/components/Variables/VariableEditorForm/VariableEditorForm.d.ts +2 -2
  151. package/dist/components/Variables/VariableEditorForm/VariableEditorForm.d.ts.map +1 -1
  152. package/dist/components/Variables/VariableEditorForm/VariableEditorForm.js +5 -5
  153. package/dist/components/Variables/VariableEditorForm/VariableEditorForm.js.map +1 -1
  154. package/dist/components/Variables/VariableEditorForm/VariablePreview.d.ts +1 -1
  155. package/dist/components/Variables/VariableEditorForm/VariablePreview.d.ts.map +1 -1
  156. package/dist/components/Variables/VariableEditorForm/VariablePreview.js +1 -1
  157. package/dist/components/Variables/VariableEditorForm/VariablePreview.js.map +1 -1
  158. package/dist/components/Variables/VariableEditorForm/variable-editor-form-model.d.ts.map +1 -1
  159. package/dist/components/Variables/VariableEditorForm/variable-editor-form-model.js.map +1 -1
  160. package/dist/components/Variables/variable-model.d.ts.map +1 -1
  161. package/dist/components/Variables/variable-model.js.map +1 -1
  162. package/dist/components/index.d.ts +2 -0
  163. package/dist/components/index.d.ts.map +1 -1
  164. package/dist/components/index.js +2 -0
  165. package/dist/components/index.js.map +1 -1
  166. package/dist/constants/index.d.ts +1 -0
  167. package/dist/constants/index.d.ts.map +1 -1
  168. package/dist/constants/index.js +1 -0
  169. package/dist/constants/index.js.map +1 -1
  170. package/dist/constants/repeat.d.ts +3 -0
  171. package/dist/constants/repeat.d.ts.map +1 -0
  172. package/dist/constants/repeat.js +16 -0
  173. package/dist/constants/repeat.js.map +1 -0
  174. package/dist/context/ValidationProvider.d.ts +2 -2
  175. package/dist/context/ValidationProvider.d.ts.map +1 -1
  176. package/dist/context/ValidationProvider.js +2 -2
  177. package/dist/context/ValidationProvider.js.map +1 -1
  178. package/dist/model/alerts-queries.d.ts +1 -1
  179. package/dist/model/alerts-queries.d.ts.map +1 -1
  180. package/dist/model/alerts-queries.js.map +1 -1
  181. package/dist/model/annotations.d.ts.map +1 -1
  182. package/dist/model/annotations.js.map +1 -1
  183. package/dist/model/calculations.js.map +1 -1
  184. package/dist/model/datasource.d.ts +9 -2
  185. package/dist/model/datasource.d.ts.map +1 -1
  186. package/dist/model/datasource.js +1 -1
  187. package/dist/model/datasource.js.map +1 -1
  188. package/dist/model/explore.d.ts +0 -1
  189. package/dist/model/explore.d.ts.map +1 -1
  190. package/dist/model/explore.js.map +1 -1
  191. package/dist/model/index.d.ts +1 -0
  192. package/dist/model/index.d.ts.map +1 -1
  193. package/dist/model/index.js +1 -0
  194. package/dist/model/index.js.map +1 -1
  195. package/dist/model/json-queries.d.ts +29 -0
  196. package/dist/model/json-queries.d.ts.map +1 -0
  197. package/dist/model/json-queries.js +17 -0
  198. package/dist/model/json-queries.js.map +1 -0
  199. package/dist/model/legend.d.ts.map +1 -1
  200. package/dist/model/legend.js.map +1 -1
  201. package/dist/model/log-queries.d.ts.map +1 -1
  202. package/dist/model/log-queries.js.map +1 -1
  203. package/dist/model/panels.d.ts +10 -1
  204. package/dist/model/panels.d.ts.map +1 -1
  205. package/dist/model/panels.js.map +1 -1
  206. package/dist/model/plugin-base.d.ts +2 -2
  207. package/dist/model/plugin-base.d.ts.map +1 -1
  208. package/dist/model/plugin-base.js.map +1 -1
  209. package/dist/model/plugins.d.ts +8 -6
  210. package/dist/model/plugins.d.ts.map +1 -1
  211. package/dist/model/plugins.js.map +1 -1
  212. package/dist/model/profile-queries.d.ts +1 -1
  213. package/dist/model/profile-queries.d.ts.map +1 -1
  214. package/dist/model/profile-queries.js.map +1 -1
  215. package/dist/model/silences-queries.d.ts +1 -1
  216. package/dist/model/silences-queries.d.ts.map +1 -1
  217. package/dist/model/silences-queries.js.map +1 -1
  218. package/dist/model/time-series-queries.d.ts +1 -1
  219. package/dist/model/time-series-queries.d.ts.map +1 -1
  220. package/dist/model/time-series-queries.js.map +1 -1
  221. package/dist/model/trace-queries.d.ts +1 -1
  222. package/dist/model/trace-queries.d.ts.map +1 -1
  223. package/dist/model/trace-queries.js.map +1 -1
  224. package/dist/model/variables.d.ts +5 -1
  225. package/dist/model/variables.d.ts.map +1 -1
  226. package/dist/model/variables.js +1 -3
  227. package/dist/model/variables.js.map +1 -1
  228. package/dist/remote/PluginLoaderComponent.d.ts +0 -1
  229. package/dist/remote/PluginLoaderComponent.d.ts.map +1 -1
  230. package/dist/remote/PluginLoaderComponent.js.map +1 -1
  231. package/dist/remote/PluginRuntime.d.ts.map +1 -1
  232. package/dist/remote/PluginRuntime.js +12 -20
  233. package/dist/remote/PluginRuntime.js.map +1 -1
  234. package/dist/remote/remotePluginLoader.d.ts +1 -1
  235. package/dist/remote/remotePluginLoader.d.ts.map +1 -1
  236. package/dist/remote/remotePluginLoader.js +1 -1
  237. package/dist/remote/remotePluginLoader.js.map +1 -1
  238. package/dist/runtime/DataQueriesProvider/DataQueriesProvider.d.ts +2 -2
  239. package/dist/runtime/DataQueriesProvider/DataQueriesProvider.d.ts.map +1 -1
  240. package/dist/runtime/DataQueriesProvider/DataQueriesProvider.js +15 -7
  241. package/dist/runtime/DataQueriesProvider/DataQueriesProvider.js.map +1 -1
  242. package/dist/runtime/TimeRangeProvider/TimeRangeProvider.d.ts +1 -1
  243. package/dist/runtime/TimeRangeProvider/TimeRangeProvider.d.ts.map +1 -1
  244. package/dist/runtime/TimeRangeProvider/TimeRangeProvider.js +18 -4
  245. package/dist/runtime/TimeRangeProvider/TimeRangeProvider.js.map +1 -1
  246. package/dist/runtime/TimeRangeProvider/TimeRangeProviders.d.ts.map +1 -1
  247. package/dist/runtime/TimeRangeProvider/TimeRangeProviders.js +3 -3
  248. package/dist/runtime/TimeRangeProvider/TimeRangeProviders.js.map +1 -1
  249. package/dist/runtime/TimeRangeProvider/TimeRangeSettingsProvider.d.ts +8 -1
  250. package/dist/runtime/TimeRangeProvider/TimeRangeSettingsProvider.d.ts.map +1 -1
  251. package/dist/runtime/TimeRangeProvider/TimeRangeSettingsProvider.js +14 -1
  252. package/dist/runtime/TimeRangeProvider/TimeRangeSettingsProvider.js.map +1 -1
  253. package/dist/runtime/TimeRangeProvider/query-params.d.ts +1 -1
  254. package/dist/runtime/TimeRangeProvider/query-params.d.ts.map +1 -1
  255. package/dist/runtime/TimeRangeProvider/query-params.js +2 -2
  256. package/dist/runtime/TimeRangeProvider/query-params.js.map +1 -1
  257. package/dist/runtime/UsageMetricsProvider.d.ts.map +1 -1
  258. package/dist/runtime/alerts-queries.d.ts.map +1 -1
  259. package/dist/runtime/alerts-queries.js +1 -1
  260. package/dist/runtime/alerts-queries.js.map +1 -1
  261. package/dist/runtime/annotations.d.ts.map +1 -1
  262. package/dist/runtime/annotations.js +2 -2
  263. package/dist/runtime/annotations.js.map +1 -1
  264. package/dist/runtime/builtin-variables.d.ts +0 -1
  265. package/dist/runtime/builtin-variables.d.ts.map +1 -1
  266. package/dist/runtime/builtin-variables.js.map +1 -1
  267. package/dist/runtime/datasources.d.ts +0 -1
  268. package/dist/runtime/datasources.d.ts.map +1 -1
  269. package/dist/runtime/datasources.js.map +1 -1
  270. package/dist/runtime/index.d.ts +1 -0
  271. package/dist/runtime/index.d.ts.map +1 -1
  272. package/dist/runtime/index.js +1 -0
  273. package/dist/runtime/index.js.map +1 -1
  274. package/dist/runtime/item-actions.d.ts +1 -1
  275. package/dist/runtime/item-actions.d.ts.map +1 -1
  276. package/dist/runtime/item-actions.js +1 -1
  277. package/dist/runtime/item-actions.js.map +1 -1
  278. package/dist/runtime/json-queries.d.ts +11 -0
  279. package/dist/runtime/json-queries.d.ts.map +1 -0
  280. package/dist/runtime/json-queries.js +58 -0
  281. package/dist/runtime/json-queries.js.map +1 -0
  282. package/dist/runtime/log-queries.d.ts.map +1 -1
  283. package/dist/runtime/log-queries.js.map +1 -1
  284. package/dist/runtime/plugin-registry.d.ts +0 -1
  285. package/dist/runtime/plugin-registry.d.ts.map +1 -1
  286. package/dist/runtime/plugin-registry.js.map +1 -1
  287. package/dist/runtime/profile-queries.d.ts.map +1 -1
  288. package/dist/runtime/profile-queries.js.map +1 -1
  289. package/dist/runtime/silences-queries.d.ts.map +1 -1
  290. package/dist/runtime/silences-queries.js +1 -1
  291. package/dist/runtime/silences-queries.js.map +1 -1
  292. package/dist/runtime/time-series-queries.d.ts.map +1 -1
  293. package/dist/runtime/time-series-queries.js +1 -1
  294. package/dist/runtime/time-series-queries.js.map +1 -1
  295. package/dist/runtime/trace-queries.d.ts.map +1 -1
  296. package/dist/runtime/trace-queries.js +1 -1
  297. package/dist/runtime/trace-queries.js.map +1 -1
  298. package/dist/runtime/variables.d.ts +0 -1
  299. package/dist/runtime/variables.d.ts.map +1 -1
  300. package/dist/runtime/variables.js.map +1 -1
  301. package/dist/schema/panel.d.ts +1 -1
  302. package/dist/schema/panel.d.ts.map +1 -1
  303. package/dist/schema/panel.js +17 -3
  304. package/dist/schema/panel.js.map +1 -1
  305. package/dist/test/mock-data.d.ts +2 -1
  306. package/dist/test/mock-data.d.ts.map +1 -1
  307. package/dist/test/mock-data.js +6 -0
  308. package/dist/test/mock-data.js.map +1 -1
  309. package/dist/test/render-hook.d.ts.map +1 -1
  310. package/dist/test/render-hook.js.map +1 -1
  311. package/dist/test/render.d.ts.map +1 -1
  312. package/dist/test/render.js.map +1 -1
  313. package/dist/test/setup-tests.d.ts +1 -1
  314. package/dist/test/setup-tests.d.ts.map +1 -1
  315. package/dist/test/setup-tests.js +3 -2
  316. package/dist/test/setup-tests.js.map +1 -1
  317. package/dist/test/test-plugins/bert/index.d.ts.map +1 -1
  318. package/dist/test/test-plugins/bert/index.js.map +1 -1
  319. package/dist/test/test-plugins/ernie/index.d.ts +7 -1
  320. package/dist/test/test-plugins/ernie/index.d.ts.map +1 -1
  321. package/dist/test/test-plugins/ernie/index.js +58 -1
  322. package/dist/test/test-plugins/ernie/index.js.map +1 -1
  323. package/dist/test/utils.d.ts.map +1 -1
  324. package/dist/test/utils.js +1 -1
  325. package/dist/test/utils.js.map +1 -1
  326. package/dist/test-utils/mock-plugin-registry.d.ts.map +1 -1
  327. package/dist/test-utils/mock-plugin-registry.js.map +1 -1
  328. package/dist/utils/csv-export.d.ts.map +1 -1
  329. package/dist/utils/csv-export.js +1 -1
  330. package/dist/utils/csv-export.js.map +1 -1
  331. package/package.json +8 -8
@@ -1 +1 @@
1
- {"version":3,"file":"time-series-queries.d.ts","sourceRoot":"","sources":["../../src/model/time-series-queries.ts"],"names":[],"mappings":"AAaA,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AACxD,OAAO,EAAE,iBAAiB,EAAE,WAAW,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9F,OAAO,EAAE,eAAe,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAC/D,OAAO,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AAEvC;;GAEG;AACH,KAAK,iCAA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M,mBAAmB,GAAG,KAAK,CAAC,cAAc,EAAE,OAAO,EAAE,cAAc,EAAE,QAAQ,CAAC,CAAC;AAE3F,MAAM,MAAM,oBAAoB,GAAG,CAAC,SAAS,EAAE,UAAU,EAAE,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC,CAAC;AAEjF,MAAM,MAAM,WAAW,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;AAE3D,MAAM,MAAM,cAAc,GAAG;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,GAAG,EAAE,MAAM,CAAC;IAAC,OAAO,CAAC,EAAE,WAAW,EAAE,CAAA;CAAE,CAAC;AAErF,MAAM,MAAM,wBAAwB,GAAG,CAAC,eAAe,EAAE,UAAU,EAAE,KAAK,EAAE,cAAc,CAAC,CAAC;AAE5F,wBAAgB,sBAAsB,CAAC,IAAI,EAAE,oBAAoB,GAAG,IAAI,IAAI,oBAAoB,CAG/F;AAED,MAAM,MAAM,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/model/time-series-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 { Query, QueryKey } from '@tanstack/react-query';\nimport { AbsoluteTimeRange, UnknownSpec, TimeSeriesData, UnixTimeMs } from '@perses-dev/spec';\nimport { DatasourceStore, VariableStateMap } from '../runtime';\nimport { Plugin } from './plugin-base';\n\n/**\n * An object containing all the dependencies of a TimeSeriesQuery.\n */\ntype TimeSeriesQueryPluginDependencies = {\n /**\n * Returns a list of variables name this time series query depends on.\n */\n variables?: string[];\n};\n\n/**\n * A plugin for running time series queries.\n */\nexport interface TimeSeriesQueryPlugin<Spec = UnknownSpec> extends Plugin<Spec> {\n getTimeSeriesData: (spec: Spec, ctx: TimeSeriesQueryContext, abortSignal?: AbortSignal) => Promise<TimeSeriesData>;\n\n dependsOn?: (spec: Spec, ctx: TimeSeriesQueryContext) => TimeSeriesQueryPluginDependencies;\n}\n\nexport type TimeSeriesQueryMode = 'instant' | 'range';\n\n/**\n * Context available to TimeSeriesQuery plugins at runtime.\n */\nexport interface TimeSeriesQueryContext {\n suggestedStepMs?: number;\n mode?: TimeSeriesQueryMode;\n timeRange: AbsoluteTimeRange;\n variableState: VariableStateMap;\n datasourceStore: DatasourceStore;\n}\n\nexport type TimeSeriesDataQuery = Query<TimeSeriesData, unknown, TimeSeriesData, QueryKey>;\n\nexport type TimeSeriesValueTuple = [timestamp: UnixTimeMs, value: number | null];\n\nexport type BucketTuple = [number, string, string, string]; // [bucket, upperBound, lowerBound, count]\n\nexport type HistogramValue = { count: number; sum: string; buckets?: BucketTuple[] };\n\nexport type TimeSeriesHistogramTuple = [unixTimeSeconds: UnixTimeMs, value: HistogramValue];\n\nexport function isTimeSeriesValueTuple(data: TimeSeriesValueTuple): data is TimeSeriesValueTuple {\n if (data.length !== 2) return false;\n return true;\n}\n\nexport type Labels = Record<string, string>;\n"],"names":["isTimeSeriesValueTuple","data","length"],"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;AAiDjC,OAAO,SAASA,uBAAuBC,IAA0B;IAC/D,IAAIA,KAAKC,MAAM,KAAK,GAAG,OAAO;IAC9B,OAAO;AACT"}
1
+ {"version":3,"sources":["../../src/model/time-series-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, TimeSeriesData, UnixTimeMs } 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 TimeSeriesQuery.\n */\ntype TimeSeriesQueryPluginDependencies = {\n /**\n * Returns a list of variables name this time series query depends on.\n */\n variables?: string[];\n};\n\n/**\n * A plugin for running time series queries.\n */\nexport interface TimeSeriesQueryPlugin<Spec = UnknownSpec> extends Plugin<Spec> {\n getTimeSeriesData: (spec: Spec, ctx: TimeSeriesQueryContext, abortSignal?: AbortSignal) => Promise<TimeSeriesData>;\n\n dependsOn?: (spec: Spec, ctx: TimeSeriesQueryContext) => TimeSeriesQueryPluginDependencies;\n}\n\nexport type TimeSeriesQueryMode = 'instant' | 'range';\n\n/**\n * Context available to TimeSeriesQuery plugins at runtime.\n */\nexport interface TimeSeriesQueryContext {\n suggestedStepMs?: number;\n mode?: TimeSeriesQueryMode;\n timeRange: AbsoluteTimeRange;\n variableState: VariableStateMap;\n datasourceStore: DatasourceStore;\n}\n\nexport type TimeSeriesDataQuery = Query<TimeSeriesData, unknown, TimeSeriesData, QueryKey>;\n\nexport type TimeSeriesValueTuple = [timestamp: UnixTimeMs, value: number | null];\n\nexport type BucketTuple = [number, string, string, string]; // [bucket, upperBound, lowerBound, count]\n\nexport type HistogramValue = { count: number; sum: string; buckets?: BucketTuple[] };\n\nexport type TimeSeriesHistogramTuple = [unixTimeSeconds: UnixTimeMs, value: HistogramValue];\n\nexport function isTimeSeriesValueTuple(data: TimeSeriesValueTuple): data is TimeSeriesValueTuple {\n if (data.length !== 2) return false;\n return true;\n}\n\nexport type Labels = Record<string, string>;\n"],"names":["isTimeSeriesValueTuple","data","length"],"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;AAkDjC,OAAO,SAASA,uBAAuBC,IAA0B;IAC/D,IAAIA,KAAKC,MAAM,KAAK,GAAG,OAAO;IAC9B,OAAO;AACT"}
@@ -1,5 +1,5 @@
1
- import { Query, QueryKey } from '@tanstack/react-query';
2
1
  import { UnknownSpec, TraceData, AbsoluteTimeRange } from '@perses-dev/spec';
2
+ import { Query, QueryKey } from '@tanstack/react-query';
3
3
  import { DatasourceStore, VariableStateMap } from '../runtime';
4
4
  import { Plugin } from './plugin-base';
5
5
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"trace-queries.d.ts","sourceRoot":"","sources":["../../src/model/trace-queries.ts"],"names":[],"mappings":"AAaA,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AACxD,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AAC7E,OAAO,EAAE,eAAe,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAC/D,OAAO,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AAEvC;;GAEG;AACH,MAAM,MAAM,4BAA4B,GAAG;IACzC;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,EAAE,CAAC;CACtB,CAAC;AAEF;;GAEG;AACH,MAAM,WAAW,gBAAgB,CAAC,IAAI,GAAG,WAAW,CAAE,SAAQ,MAAM,CAAC,IAAI,CAAC;IACxE,YAAY,EAAE,CAAC,IAAI,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AED;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAChC,eAAe,EAAE,eAAe,CAAC;IACjC,iBAAiB,CAAC,EAAE,iBAAiB,CAAC;IACtC,aAAa,EAAE,gBAAgB,CAAC;CACjC;AAED,MAAM,MAAM,cAAc,GAAG,KAAK,CAAC,SAAS,EAAE,OAAO,EAAE,SAAS,EAAE,QAAQ,CAAC,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/model/trace-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 { Query, QueryKey } from '@tanstack/react-query';\nimport { UnknownSpec, TraceData, AbsoluteTimeRange } from '@perses-dev/spec';\nimport { DatasourceStore, VariableStateMap } from '../runtime';\nimport { Plugin } from './plugin-base';\n\n/**\n * An object containing all the dependencies of a TraceQuery.\n */\nexport type TraceQueryPluginDependencies = {\n /**\n * Returns a list of variables name this trace query depends on.\n */\n variables?: string[];\n};\n\n/**\n * A plugin for running trace queries.\n */\nexport interface TraceQueryPlugin<Spec = UnknownSpec> extends Plugin<Spec> {\n getTraceData: (spec: Spec, ctx: TraceQueryContext, abortSignal?: AbortSignal) => Promise<TraceData>;\n dependsOn?: (spec: Spec, ctx: TraceQueryContext) => TraceQueryPluginDependencies;\n}\n\n/**\n * Context available to TraceQuery plugins at runtime.\n */\nexport interface TraceQueryContext {\n datasourceStore: DatasourceStore;\n absoluteTimeRange?: AbsoluteTimeRange;\n variableState: VariableStateMap;\n}\n\nexport type TraceDataQuery = Query<TraceData, unknown, TraceData, 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;AAkCjC,WAA4E"}
1
+ {"version":3,"sources":["../../src/model/trace-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, TraceData, AbsoluteTimeRange } 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 TraceQuery.\n */\nexport type TraceQueryPluginDependencies = {\n /**\n * Returns a list of variables name this trace query depends on.\n */\n variables?: string[];\n};\n\n/**\n * A plugin for running trace queries.\n */\nexport interface TraceQueryPlugin<Spec = UnknownSpec> extends Plugin<Spec> {\n getTraceData: (spec: Spec, ctx: TraceQueryContext, abortSignal?: AbortSignal) => Promise<TraceData>;\n dependsOn?: (spec: Spec, ctx: TraceQueryContext) => TraceQueryPluginDependencies;\n}\n\n/**\n * Context available to TraceQuery plugins at runtime.\n */\nexport interface TraceQueryContext {\n datasourceStore: DatasourceStore;\n absoluteTimeRange?: AbsoluteTimeRange;\n variableState: VariableStateMap;\n}\n\nexport type TraceDataQuery = Query<TraceData, unknown, TraceData, 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;AAmCjC,WAA4E"}
@@ -1,5 +1,5 @@
1
1
  import type { VariableOption } from '@perses-dev/components';
2
- import { AbsoluteTimeRange, UnknownSpec } from '@perses-dev/spec';
2
+ import { AbsoluteTimeRange, UnknownSpec, VariableDefinition } from '@perses-dev/spec';
3
3
  import { DatasourceStore, VariableStateMap } from '../runtime';
4
4
  import { Plugin } from './plugin-base';
5
5
  export type { VariableOption } from '@perses-dev/components';
@@ -29,4 +29,8 @@ export interface VariablePlugin<Spec = UnknownSpec> extends Plugin<Spec> {
29
29
  */
30
30
  dependsOn?: (definition: Spec, ctx: GetVariableOptionsContext) => VariablePluginDependencies;
31
31
  }
32
+ export interface VariableDefinitionGroup {
33
+ source?: string;
34
+ definitions: VariableDefinition[];
35
+ }
32
36
  //# sourceMappingURL=variables.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"variables.d.ts","sourceRoot":"","sources":["../../src/model/variables.ts"],"names":[],"mappings":"AAaA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAC7D,OAAO,EAAE,iBAAiB,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAClE,OAAO,EAAE,eAAe,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAC/D,OAAO,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AAGvC,YAAY,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAE7D,MAAM,WAAW,yBAAyB;IACxC,SAAS,EAAE,gBAAgB,CAAC;IAC5B,eAAe,EAAE,eAAe,CAAC;IACjC,SAAS,EAAE,iBAAiB,CAAC;CAC9B;AAED;;GAEG;AACH,KAAK,0BAA0B,GAAG;IAChC;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,EAAE,CAAC;CACtB,CAAC;AAEF;;GAEG;AACH,MAAM,WAAW,cAAc,CAAC,IAAI,GAAG,WAAW,CAAE,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C,EAAE,CAAC,UAAU,EAAE,IAAI,EAAE,GAAG,EAAE,yBAAyB,KAAK,0BAA0B,CAAC;CAC9F;AAED,MAAM,WAAW,uBAAuB;IACtC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,WAAW,EAAE,kBAAkB,EAAE,CAAC;CACnC"}
@@ -10,8 +10,6 @@
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
- /**
14
- * Plugin for handling custom VariableDefinitions.
15
- */ export { };
13
+ export { };
16
14
 
17
15
  //# sourceMappingURL=variables.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/model/variables.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 { VariableOption } from '@perses-dev/components';\nimport { AbsoluteTimeRange, UnknownSpec } from '@perses-dev/spec';\nimport { DatasourceStore, VariableStateMap } from '../runtime';\nimport { Plugin } from './plugin-base';\n\n// Re-export VariableOption from @perses-dev/components for backwards compatibility\nexport type { VariableOption } from '@perses-dev/components';\n\nexport interface GetVariableOptionsContext {\n variables: VariableStateMap;\n datasourceStore: DatasourceStore;\n timeRange: AbsoluteTimeRange;\n}\n\n/**\n * An object containing all the dependencies of a VariablePlugin.\n */\ntype VariablePluginDependencies = {\n /**\n * Returns a list of variables name this time series query depends on.\n */\n variables?: string[];\n};\n\n/**\n * Plugin for handling custom VariableDefinitions.\n */\nexport interface VariablePlugin<Spec = UnknownSpec> extends Plugin<Spec> {\n getVariableOptions: (\n definition: Spec,\n ctx: GetVariableOptionsContext,\n abortSignal?: AbortSignal\n ) => Promise<{ data: VariableOption[] }>;\n\n /**\n * Returns a list of variables name this variable depends on. Used to optimize fetching\n */\n dependsOn?: (definition: Spec, ctx: GetVariableOptionsContext) => VariablePluginDependencies;\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,WAWC"}
1
+ {"version":3,"sources":["../../src/model/variables.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 { VariableOption } from '@perses-dev/components';\nimport { AbsoluteTimeRange, UnknownSpec, VariableDefinition } from '@perses-dev/spec';\n\nimport { DatasourceStore, VariableStateMap } from '../runtime';\nimport { Plugin } from './plugin-base';\n\n// Re-export VariableOption from @perses-dev/components for backwards compatibility\nexport type { VariableOption } from '@perses-dev/components';\n\nexport interface GetVariableOptionsContext {\n variables: VariableStateMap;\n datasourceStore: DatasourceStore;\n timeRange: AbsoluteTimeRange;\n}\n\n/**\n * An object containing all the dependencies of a VariablePlugin.\n */\ntype VariablePluginDependencies = {\n /**\n * Returns a list of variables name this time series query depends on.\n */\n variables?: string[];\n};\n\n/**\n * Plugin for handling custom VariableDefinitions.\n */\nexport interface VariablePlugin<Spec = UnknownSpec> extends Plugin<Spec> {\n getVariableOptions: (\n definition: Spec,\n ctx: GetVariableOptionsContext,\n abortSignal?: AbortSignal,\n ) => Promise<{ data: VariableOption[] }>;\n\n /**\n * Returns a list of variables name this variable depends on. Used to optimize fetching\n */\n dependsOn?: (definition: Spec, ctx: GetVariableOptionsContext) => VariablePluginDependencies;\n}\n\nexport interface VariableDefinitionGroup {\n source?: string;\n definitions: VariableDefinition[];\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;AA2CjC,WAGC"}
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { PersesPlugin } from './PersesPlugin.types';
3
2
  interface PluginLoaderProps<P> {
4
3
  plugin: PersesPlugin;
@@ -1 +1 @@
1
- {"version":3,"file":"PluginLoaderComponent.d.ts","sourceRoot":"","sources":["../../src/remote/PluginLoaderComponent.tsx"],"names":[],"mappings":";AA4BA,OAAO,EAAE,YAAY,EAAsB,MAAM,sBAAsB,CAAC;AAGxE,UAAU,iBAAiB,CAAC,CAAC;IAC3B,MAAM,EAAE,YAAY,CAAC;IACrB,KAAK,CAAC,EAAE,CAAC,CAAC;IACV,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAYD,wBAAgB,qBAAqB,CAAC,CAAC,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,KAAK,EAAE,EAAE,iBAAiB,CAAC,CAAC,CAAC,GAAG,GAAG,CAAC,OAAO,GAAG,IAAI,CA2D3G"}
1
+ {"version":3,"file":"PluginLoaderComponent.d.ts","sourceRoot":"","sources":["../../src/remote/PluginLoaderComponent.tsx"],"names":[],"mappings":"AA6BA,OAAO,EAAE,YAAY,EAAsB,MAAM,sBAAsB,CAAC;AAGxE,UAAU,iBAAiB,CAAC,CAAC;IAC3B,MAAM,EAAE,YAAY,CAAC;IACrB,KAAK,CAAC,EAAE,CAAC,CAAC;IACV,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAYD,wBAAgB,qBAAqB,CAAC,CAAC,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,KAAK,EAAE,EAAE,iBAAiB,CAAC,CAAC,CAAC,GAAG,GAAG,CAAC,OAAO,GAAG,IAAI,CA2D3G"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/remote/PluginLoaderComponent.tsx"],"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\n/* eslint-disable @typescript-eslint/ban-ts-comment */\n// 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 { useEffect, useRef, useState } from 'react';\nimport { PersesPlugin, RemotePluginModule } from './PersesPlugin.types';\nimport { usePluginRuntime } from './PluginRuntime';\n\ninterface PluginLoaderProps<P> {\n plugin: PersesPlugin;\n props?: P;\n field?: string;\n}\n\nfunction PluginContainer<P>({\n pluginFn,\n props,\n}: {\n pluginFn: (props: P | undefined) => JSX.Element;\n props: P | undefined;\n}): JSX.Element {\n return pluginFn(props);\n}\n\nexport function PluginLoaderComponent<P>({ plugin, props, field }: PluginLoaderProps<P>): JSX.Element | null {\n const { loadPlugin } = usePluginRuntime({ plugin });\n const [pluginModule, setPluginModule] = useState<RemotePluginModule | null>(null);\n const [error, setError] = useState<Error | null>(null);\n\n const name = `${plugin.moduleName}-${plugin.name}`;\n const previousPluginName = useRef<string>(name);\n\n useEffect(() => {\n previousPluginName.current = name;\n setError(null);\n\n loadPlugin()\n .then((module) => {\n setPluginModule(module);\n })\n .catch((error) => {\n setPluginModule(null);\n console.error(\n `PluginLoaderComponent: Error loading plugin ${plugin.name} from module ${plugin.moduleName}:`,\n error\n );\n setError(\n new Error(`PluginLoaderComponent: Error loading plugin ${plugin.name} from module ${plugin.moduleName}`)\n );\n });\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [name]);\n\n if (error) {\n throw error;\n }\n\n if (!pluginModule) {\n return null;\n }\n\n let pluginFunction = pluginModule[plugin.name];\n\n if (field && pluginFunction && typeof pluginFunction === 'object' && field in pluginFunction) {\n pluginFunction = (pluginFunction as Record<string, unknown>)[field];\n }\n\n if (!pluginFunction) {\n throw new Error(`PluginLoaderComponent: Plugin module ${plugin.moduleName} does not have a ${plugin.name} export`);\n }\n\n if (typeof pluginFunction !== 'function') {\n throw new Error(`PluginLoaderComponent: Plugin ${plugin.name} export is not a function`);\n }\n\n // make sure to re mount the plugin when changes, to avoid mismatch in hooks ordering when re rendering\n if (previousPluginName.current !== name) {\n return null;\n }\n\n return (\n <PluginContainer key={name} pluginFn={pluginFunction as (props: P | undefined) => JSX.Element} props={props} />\n );\n}\n"],"names":["useEffect","useRef","useState","usePluginRuntime","PluginContainer","pluginFn","props","PluginLoaderComponent","plugin","field","loadPlugin","pluginModule","setPluginModule","error","setError","name","moduleName","previousPluginName","current","then","module","catch","console","Error","pluginFunction"],"mappings":";AAAA,+BAA+B;AAC/B,oEAAoE;AACpE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,sEAAsE;AACtE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAEjC,oDAAoD,GACpD,+BAA+B;AAC/B,kEAAkE;AAClE,mE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BAAmB,YAAYf,SAASe,gBAAgB;QAC5FA,iBAAiB,AAACA,cAA0C,CAACf,MAAM;IACrE;IAEA,IAAI,CAACe,gBAAgB;QACnB,MAAM,IAAID,MAAM,CAAC,qCAAqC,EAAEf,OAAOQ,UAAU,CAAC,iBAAiB,EAAER,OAAOO,IAAI,CAAC,OAAO,CAAC;IACnH;IAEA,IAAI,OAAOS,mBAAmB,YAAY;QACxC,MAAM,IAAID,MAAM,CAAC,8BAA8B,EAAEf,OAAOO,IAAI,CAAC,yBAAyB,CAAC;IACzF;IAEA,uGAAuG;IACvG,IAAIE,mBAAmBC,OAAO,KAAKH,MAAM;QACvC,OAAO;IACT;IAEA,qBACE,KAACX;QAA2BC,UAAUmB;QAAyDlB,OAAOA;OAAhFS;AAE1B"}
1
+ {"version":3,"sources":["../../src/remote/PluginLoaderComponent.tsx"],"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\n/* eslint-disable @typescript-eslint/ban-ts-comment */\n// 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 { useEffect, useRef, useState } from 'react';\n\nimport { PersesPlugin, RemotePluginModule } from './PersesPlugin.types';\nimport { usePluginRuntime } from './PluginRuntime';\n\ninterface PluginLoaderProps<P> {\n plugin: PersesPlugin;\n props?: P;\n field?: string;\n}\n\nfunction PluginContainer<P>({\n pluginFn,\n props,\n}: {\n pluginFn: (props: P | undefined) => JSX.Element;\n props: P | undefined;\n}): JSX.Element {\n return pluginFn(props);\n}\n\nexport function PluginLoaderComponent<P>({ plugin, props, field }: PluginLoaderProps<P>): JSX.Element | null {\n const { loadPlugin } = usePluginRuntime({ plugin });\n const [pluginModule, setPluginModule] = useState<RemotePluginModule | null>(null);\n const [error, setError] = useState<Error | null>(null);\n\n const name = `${plugin.moduleName}-${plugin.name}`;\n const previousPluginName = useRef<string>(name);\n\n useEffect(() => {\n previousPluginName.current = name;\n setError(null);\n\n loadPlugin()\n .then((module) => {\n setPluginModule(module);\n })\n .catch((error) => {\n setPluginModule(null);\n console.error(\n `PluginLoaderComponent: Error loading plugin ${plugin.name} from module ${plugin.moduleName}:`,\n error,\n );\n setError(\n new Error(`PluginLoaderComponent: Error loading plugin ${plugin.name} from module ${plugin.moduleName}`),\n );\n });\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [name]);\n\n if (error) {\n throw error;\n }\n\n if (!pluginModule) {\n return null;\n }\n\n let pluginFunction = pluginModule[plugin.name];\n\n if (field && pluginFunction && typeof pluginFunction === 'object' && field in pluginFunction) {\n pluginFunction = (pluginFunction as Record<string, unknown>)[field];\n }\n\n if (!pluginFunction) {\n throw new Error(`PluginLoaderComponent: Plugin module ${plugin.moduleName} does not have a ${plugin.name} export`);\n }\n\n if (typeof pluginFunction !== 'function') {\n throw new Error(`PluginLoaderComponent: Plugin ${plugin.name} export is not a function`);\n }\n\n // make sure to re mount the plugin when changes, to avoid mismatch in hooks ordering when re rendering\n if (previousPluginName.current !== name) {\n return null;\n }\n\n return (\n <PluginContainer key={name} pluginFn={pluginFunction as (props: P | undefined) => JSX.Element} props={props} />\n );\n}\n"],"names":["useEffect","useRef","useState","usePluginRuntime","PluginContainer","pluginFn","props","PluginLoaderComponent","plugin","field","loadPlugin","pluginModule","setPluginModule","error","setError","name","moduleName","previousPluginName","current","then","module","catch","console","Error","pluginFunction"],"mappings":";AAAA,+BAA+B;AAC/B,oEAAoE;AACpE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,sEAAsE;AACtE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAEjC,oDAAoD,GACpD,+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,SAASA,SAAS,EAAEC,MAAM,EAAEC,QAAQ,QAAQ,QAAQ;AAGpD,SAASC,gBAAgB,QAAQ,kBAAkB;AAQnD,SAASC,gBAAmB,EAC1BC,QAAQ,EACRC,KAAK,EAIN;IACC,OAAOD,SAASC;AAClB;AAEA,OAAO,SAASC,sBAAyB,EAAEC,MAAM,EAAEF,KAAK,EAAEG,KAAK,EAAwB;IACrF,MAAM,EAAEC,UAAU,EAAE,GAAGP,iBAAiB;QAAEK;IAAO;IACjD,MAAM,CAACG,cAAcC,gBAAgB,GAAGV,SAAoC;IAC5E,MAAM,CAACW,OAAOC,SAAS,GAAGZ,SAAuB;IAEjD,MAAMa,OAAO,GAAGP,OAAOQ,UAAU,CAAC,CAAC,EAAER,OAAOO,IAAI,EAAE;IAClD,MAAME,qBAAqBhB,OAAec;IAE1Cf,UAAU;QACRiB,mBAAmBC,OAAO,GAAGH;QAC7BD,SAAS;QAETJ,aACGS,IAAI,CAAC,CAACC;YACLR,gBAAgBQ;QAClB,GACCC,KAAK,CAAC,CAACR;YACND,gBAAgB;YAChBU,QAAQT,KAAK,CACX,CAAC,4CAA4C,EAAEL,OAAOO,IAAI,CAAC,aAAa,EAAEP,OAAOQ,UAAU,CAAC,CAAC,CAAC,EAC9FH;YAEFC,SACE,IAAIS,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,IAAI,CAOpC,CAAC;AAEF,wBAAgB,gBAAgB,CAAC,EAAE,MAAM,EAAE,EAAE;IAAE,MAAM,EAAE,YAAY,CAAA;CAAE,GAAG;IACtE,aAAa,EAAE,gBAAgB,CAAC;IAChC,UAAU,EAAE,MAAM,OAAO,CAAC,kBAAkB,GAAG,IAAI,CAAC,CAAC;CACtD,CAQA"}
1
+ {"version":3,"file":"PluginRuntime.d.ts","sourceRoot":"","sources":["../../src/remote/PluginRuntime.tsx"],"names":[],"mappings":"AA2BA,OAAO,EAAkB,gBAAgB,EAAE,MAAM,qCAAqC,CAAC;AAOvF,OAAO,EAAE,YAAY,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAqNxE,eAAO,MAAM,UAAU,GAAU,QAAQ;IACvC,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB,KAAG,OAAO,CAAC,kBAAkB,GAAG,IAAI,CAOpC,CAAC;AAEF,wBAAgB,gBAAgB,CAAC,EAAE,MAAM,EAAE,EAAE;IAAE,MAAM,EAAE,YAAY,CAAA;CAAE,GAAG;IACtE,aAAa,EAAE,gBAAgB,CAAC;IAChC,UAAU,EAAE,MAAM,OAAO,CAAC,kBAAkB,GAAG,IAAI,CAAC,CAAC;CACtD,CAQA"}
@@ -84,59 +84,51 @@ const getPluginRuntime = ()=>{
84
84
  }
85
85
  },
86
86
  '@perses-dev/spec': {
87
- version: '0.3.0-beta.1',
87
+ version: '0.3.0-beta.4',
88
88
  lib: ()=>require('@perses-dev/spec'),
89
89
  shareConfig: {
90
90
  singleton: true,
91
- requiredVersion: '^0.3.0-beta.1'
92
- }
93
- },
94
- '@perses-dev/core': {
95
- version: '0.53.1',
96
- lib: ()=>require('@perses-dev/core'),
97
- shareConfig: {
98
- singleton: true,
99
- requiredVersion: '^0.53.1'
91
+ requiredVersion: '^0.3.0-beta.4'
100
92
  }
101
93
  },
102
94
  '@perses-dev/client': {
103
- version: '0.55.0-beta.1',
95
+ version: '0.55.0-beta.3',
104
96
  lib: ()=>require('@perses-dev/client'),
105
97
  shareConfig: {
106
98
  singleton: true,
107
- requiredVersion: '^0.55.0-beta.1'
99
+ requiredVersion: '^0.55.0-beta.3'
108
100
  }
109
101
  },
110
102
  '@perses-dev/components': {
111
- version: '0.55.0-beta.1',
103
+ version: '0.55.0-beta.3',
112
104
  lib: ()=>require('@perses-dev/components'),
113
105
  shareConfig: {
114
106
  singleton: true,
115
- requiredVersion: '^0.55.0-beta.1'
107
+ requiredVersion: '^0.55.0-beta.3'
116
108
  }
117
109
  },
118
110
  '@perses-dev/plugin-system': {
119
- version: '0.55.0-beta.1',
111
+ version: '0.55.0-beta.3',
120
112
  lib: ()=>require('@perses-dev/plugin-system'),
121
113
  shareConfig: {
122
114
  singleton: true,
123
- requiredVersion: '^0.55.0-beta.1'
115
+ requiredVersion: '^0.55.0-beta.3'
124
116
  }
125
117
  },
126
118
  '@perses-dev/explore': {
127
- version: '0.55.0-beta.1',
119
+ version: '0.55.0-beta.3',
128
120
  lib: ()=>require('@perses-dev/explore'),
129
121
  shareConfig: {
130
122
  singleton: true,
131
- requiredVersion: '^0.55.0-beta.1'
123
+ requiredVersion: '^0.55.0-beta.3'
132
124
  }
133
125
  },
134
126
  '@perses-dev/dashboards': {
135
- version: '0.55.0-beta.1',
127
+ version: '0.55.0-beta.3',
136
128
  lib: ()=>require('@perses-dev/dashboards'),
137
129
  shareConfig: {
138
130
  singleton: true,
139
- requiredVersion: '^0.55.0-beta.1'
131
+ requiredVersion: '^0.55.0-beta.3'
140
132
  }
141
133
  },
142
134
  // Below are the shared modules that are used by the plugins, this can be part of the SDK
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/remote/PluginRuntime.tsx"],"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\n/* eslint-disable @typescript-eslint/no-require-imports */\n// 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 { createInstance, ModuleFederation } from '@module-federation/enhanced/runtime';\n\nimport * as ReactQuery from '@tanstack/react-query';\nimport React from 'react';\nimport ReactDOM from 'react-dom';\nimport * as ReactHookForm from 'react-hook-form';\nimport * as ReactRouterDOM from 'react-router-dom';\nimport { PersesPlugin, RemotePluginModule } from './PersesPlugin.types';\n\nlet instance: ModuleFederation | null = null;\n\nconst getPluginRuntime = (): ModuleFederation => {\n if (instance === null) {\n const pluginRuntime = createInstance({\n name: '@perses/perses-ui-host',\n remotes: [], // all remotes are loaded dynamically\n shared: {\n react: {\n version: React.version,\n lib: () => React,\n shareConfig: {\n singleton: true,\n requiredVersion: `^${React.version}`,\n },\n },\n 'react-dom': {\n version: '18.3.1',\n lib: () => ReactDOM,\n shareConfig: {\n singleton: true,\n requiredVersion: `^18.3.1`,\n },\n },\n 'react-router-dom': {\n version: '6.26.0',\n lib: () => ReactRouterDOM,\n shareConfig: {\n singleton: true,\n requiredVersion: '^6.26.0',\n },\n },\n '@tanstack/react-query': {\n version: '4.39.1',\n lib: () => ReactQuery,\n shareConfig: {\n singleton: true,\n requiredVersion: '^4.39.1',\n },\n },\n 'react-hook-form': {\n version: '7.52.2',\n lib: () => ReactHookForm,\n shareConfig: {\n singleton: true,\n requiredVersion: '^7.52.2',\n },\n },\n echarts: {\n version: '5.5.0',\n lib: () => require('echarts'),\n shareConfig: {\n singleton: true,\n requiredVersion: '^5.5.0',\n },\n },\n '@perses-dev/spec': {\n version: '0.3.0-beta.1',\n lib: () => require('@perses-dev/spec'),\n shareConfig: {\n singleton: true,\n requiredVersion: '^0.3.0-beta.1',\n },\n },\n '@perses-dev/core': {\n version: '0.53.1',\n lib: () => require('@perses-dev/core'),\n shareConfig: {\n singleton: true,\n requiredVersion: '^0.53.1',\n },\n },\n '@perses-dev/client': {\n version: '0.55.0-beta.1',\n lib: () => require('@perses-dev/client'),\n shareConfig: {\n singleton: true,\n requiredVersion: '^0.55.0-beta.1',\n },\n },\n '@perses-dev/components': {\n version: '0.55.0-beta.1',\n lib: () => require('@perses-dev/components'),\n shareConfig: {\n singleton: true,\n requiredVersion: '^0.55.0-beta.1',\n },\n },\n '@perses-dev/plugin-system': {\n version: '0.55.0-beta.1',\n lib: () => require('@perses-dev/plugin-system'),\n shareConfig: {\n singleton: true,\n requiredVersion: '^0.55.0-beta.1',\n },\n },\n '@perses-dev/explore': {\n version: '0.55.0-beta.1',\n lib: () => require('@perses-dev/explore'),\n shareConfig: {\n singleton: true,\n requiredVersion: '^0.55.0-beta.1',\n },\n },\n '@perses-dev/dashboards': {\n version: '0.55.0-beta.1',\n lib: () => require('@perses-dev/dashboards'),\n shareConfig: {\n singleton: true,\n requiredVersion: '^0.55.0-beta.1',\n },\n },\n // Below are the shared modules that are used by the plugins, this can be part of the SDK\n 'date-fns': {\n version: '4.1.0',\n lib: () => require('date-fns'),\n shareConfig: {\n singleton: true,\n requiredVersion: '^4.1.0',\n },\n },\n 'date-fns-tz': {\n version: '3.2.0',\n lib: () => require('date-fns-tz'),\n shareConfig: {\n singleton: true,\n requiredVersion: '^3.2.0',\n },\n },\n lodash: {\n version: '4.17.21',\n lib: () => require('lodash'),\n shareConfig: {\n singleton: true,\n requiredVersion: '^4.17.21',\n },\n },\n '@emotion/react': {\n version: '11.11.3',\n lib: () => require('@emotion/react'),\n shareConfig: {\n singleton: true,\n requiredVersion: '^11.11.3',\n },\n },\n '@emotion/styled': {\n version: '11.11.0',\n lib: () => require('@emotion/styled'),\n shareConfig: {\n singleton: true,\n requiredVersion: '^11.11.0',\n },\n },\n '@hookform/resolvers/zod': {\n version: '3.3.4',\n lib: () => require('@hookform/resolvers/zod'),\n shareConfig: {\n singleton: true,\n requiredVersion: '^3.3.4',\n },\n },\n 'use-resize-observer': {\n version: '9.1.0',\n lib: () => require('use-resize-observer'),\n shareConfig: {\n singleton: true,\n requiredVersion: '^9.1.0',\n },\n },\n 'mdi-material-ui': {\n version: '7.4.0',\n lib: () => require('mdi-material-ui'),\n shareConfig: {\n singleton: true,\n requiredVersion: '^7.4.0',\n },\n },\n immer: {\n version: '10.1.1',\n lib: () => require('immer'),\n shareConfig: {\n singleton: true,\n requiredVersion: '^10.1.1',\n },\n },\n },\n });\n\n instance = pluginRuntime;\n\n return instance;\n }\n return instance;\n};\n\nfunction getModuleFederationRemoteName(name: string, registry?: string, version?: string): string {\n return `${name}:${registry ?? ''}:${version ?? ''}`;\n}\n\nconst registerRemote = (name: string, registry?: string, version?: string, baseURL?: string): void => {\n const pluginRuntime = getPluginRuntime();\n const registryName = getModuleFederationRemoteName(name, registry, version);\n\n const existingRemote = pluginRuntime.options.remotes.find((remote) => remote.name === registryName);\n if (!existingRemote) {\n const nameVersionRegistry = [name, version, registry].filter(Boolean).join('~');\n const prefix = baseURL || '/plugins';\n const remoteEntryURL = `${prefix}/${nameVersionRegistry}/mf-manifest.json`;\n\n pluginRuntime.registerRemotes([\n {\n name: registryName,\n entry: remoteEntryURL,\n alias: registryName,\n },\n ]);\n }\n};\n\nexport const loadPlugin = async (target: {\n moduleName: string;\n pluginName: string;\n registry?: string;\n version?: string;\n baseURL?: string;\n}): Promise<RemotePluginModule | null> => {\n const { moduleName, pluginName, registry, version, baseURL } = target;\n registerRemote(moduleName, registry, version, baseURL);\n\n const pluginRuntime = getPluginRuntime();\n const registryName = getModuleFederationRemoteName(moduleName, registry, version);\n return pluginRuntime.loadRemote<RemotePluginModule>(`${registryName}/${pluginName}`);\n};\n\nexport function usePluginRuntime({ plugin }: { plugin: PersesPlugin }): {\n pluginRuntime: ModuleFederation;\n loadPlugin: () => Promise<RemotePluginModule | null>;\n} {\n return {\n pluginRuntime: getPluginRuntime(),\n loadPlugin: (): Promise<RemotePluginModule | null> => {\n const { moduleName, name: pluginName, registry, version, baseURL } = plugin;\n return loadPlugin({ moduleName, pluginName, registry, version, baseURL });\n },\n };\n}\n"],"names":["createInstance","ReactQuery","React","ReactDOM","ReactHookForm","ReactRouterDOM","instance","getPluginRuntime","pluginRuntime","name","remotes","shared","react","version","lib","shareConfig","singleton","requiredVersion","echarts","require","lodash","immer","getModuleFederationRemoteName","registry","registerRemote","baseURL","registryName","existingRemote","options","find","remote","nameVersionRegistry","filter","Boolean","join","prefix","remoteEntryURL","registerRemotes","entry","alias","loadPlugin","target","moduleName","pluginName","loadRemote","usePluginRuntime","plugin"],"mappings":"AAAA,+BAA+B;AAC/B,oEAAoE;AACpE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,sEAAsE;AACtE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAEjC,wDAAwD,GACxD,+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,SAASA,cAAc,QAA0B,sCAAsC;AAEvF,YAAYC,gBAAgB,wBAAwB;AACpD,OAAOC,WAAW,QAAQ;AAC1B,OAAOC,cAAc,YAAY;AACjC,YAAYC,mBAAm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J,8BAA8BoB,YAAYnB,UAAUV;IACzE,OAAOL,cAAcoC,UAAU,CAAqB,GAAGlB,aAAa,CAAC,EAAEiB,YAAY;AACrF,EAAE;AAEF,OAAO,SAASE,iBAAiB,EAAEC,MAAM,EAA4B;IAInE,OAAO;QACLtC,eAAeD;QACfiC,YAAY;YACV,MAAM,EAAEE,UAAU,EAAEjC,MAAMkC,UAAU,EAAEpB,QAAQ,EAAEV,OAAO,EAAEY,OAAO,EAAE,GAAGqB;YACrE,OAAON,WAAW;gBAAEE;gBAAYC;gBAAYpB;gBAAUV;gBAASY;YAAQ;QACzE;IACF;AACF"}
1
+ {"version":3,"sources":["../../src/remote/PluginRuntime.tsx"],"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\n/* eslint-disable @typescript-eslint/no-require-imports */\n// 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 { createInstance, ModuleFederation } from '@module-federation/enhanced/runtime';\nimport * as ReactQuery from '@tanstack/react-query';\nimport React from 'react';\nimport ReactDOM from 'react-dom';\nimport * as ReactHookForm from 'react-hook-form';\nimport * as ReactRouterDOM from 'react-router-dom';\n\nimport { PersesPlugin, RemotePluginModule } from './PersesPlugin.types';\n\nlet instance: ModuleFederation | null = null;\n\nconst getPluginRuntime = (): ModuleFederation => {\n if (instance === null) {\n const pluginRuntime = createInstance({\n name: '@perses/perses-ui-host',\n remotes: [], // all remotes are loaded dynamically\n shared: {\n react: {\n version: React.version,\n lib: () => React,\n shareConfig: {\n singleton: true,\n requiredVersion: `^${React.version}`,\n },\n },\n 'react-dom': {\n version: '18.3.1',\n lib: () => ReactDOM,\n shareConfig: {\n singleton: true,\n requiredVersion: `^18.3.1`,\n },\n },\n 'react-router-dom': {\n version: '6.26.0',\n lib: () => ReactRouterDOM,\n shareConfig: {\n singleton: true,\n requiredVersion: '^6.26.0',\n },\n },\n '@tanstack/react-query': {\n version: '4.39.1',\n lib: () => ReactQuery,\n shareConfig: {\n singleton: true,\n requiredVersion: '^4.39.1',\n },\n },\n 'react-hook-form': {\n version: '7.52.2',\n lib: () => ReactHookForm,\n shareConfig: {\n singleton: true,\n requiredVersion: '^7.52.2',\n },\n },\n echarts: {\n version: '5.5.0',\n lib: () => require('echarts'),\n shareConfig: {\n singleton: true,\n requiredVersion: '^5.5.0',\n },\n },\n '@perses-dev/spec': {\n version: '0.3.0-beta.4',\n lib: () => require('@perses-dev/spec'),\n shareConfig: {\n singleton: true,\n requiredVersion: '^0.3.0-beta.4',\n },\n },\n '@perses-dev/client': {\n version: '0.55.0-beta.3',\n lib: () => require('@perses-dev/client'),\n shareConfig: {\n singleton: true,\n requiredVersion: '^0.55.0-beta.3',\n },\n },\n '@perses-dev/components': {\n version: '0.55.0-beta.3',\n lib: () => require('@perses-dev/components'),\n shareConfig: {\n singleton: true,\n requiredVersion: '^0.55.0-beta.3',\n },\n },\n '@perses-dev/plugin-system': {\n version: '0.55.0-beta.3',\n lib: () => require('@perses-dev/plugin-system'),\n shareConfig: {\n singleton: true,\n requiredVersion: '^0.55.0-beta.3',\n },\n },\n '@perses-dev/explore': {\n version: '0.55.0-beta.3',\n lib: () => require('@perses-dev/explore'),\n shareConfig: {\n singleton: true,\n requiredVersion: '^0.55.0-beta.3',\n },\n },\n '@perses-dev/dashboards': {\n version: '0.55.0-beta.3',\n lib: () => require('@perses-dev/dashboards'),\n shareConfig: {\n singleton: true,\n requiredVersion: '^0.55.0-beta.3',\n },\n },\n // Below are the shared modules that are used by the plugins, this can be part of the SDK\n 'date-fns': {\n version: '4.1.0',\n lib: () => require('date-fns'),\n shareConfig: {\n singleton: true,\n requiredVersion: '^4.1.0',\n },\n },\n 'date-fns-tz': {\n version: '3.2.0',\n lib: () => require('date-fns-tz'),\n shareConfig: {\n singleton: true,\n requiredVersion: '^3.2.0',\n },\n },\n lodash: {\n version: '4.17.21',\n lib: () => require('lodash'),\n shareConfig: {\n singleton: true,\n requiredVersion: '^4.17.21',\n },\n },\n '@emotion/react': {\n version: '11.11.3',\n lib: () => require('@emotion/react'),\n shareConfig: {\n singleton: true,\n requiredVersion: '^11.11.3',\n },\n },\n '@emotion/styled': {\n version: '11.11.0',\n lib: () => require('@emotion/styled'),\n shareConfig: {\n singleton: true,\n requiredVersion: '^11.11.0',\n },\n },\n '@hookform/resolvers/zod': {\n version: '3.3.4',\n lib: () => require('@hookform/resolvers/zod'),\n shareConfig: {\n singleton: true,\n requiredVersion: '^3.3.4',\n },\n },\n 'use-resize-observer': {\n version: '9.1.0',\n lib: () => require('use-resize-observer'),\n shareConfig: {\n singleton: true,\n requiredVersion: '^9.1.0',\n },\n },\n 'mdi-material-ui': {\n version: '7.4.0',\n lib: () => require('mdi-material-ui'),\n shareConfig: {\n singleton: true,\n requiredVersion: '^7.4.0',\n },\n },\n immer: {\n version: '10.1.1',\n lib: () => require('immer'),\n shareConfig: {\n singleton: true,\n requiredVersion: '^10.1.1',\n },\n },\n },\n });\n\n instance = pluginRuntime;\n\n return instance;\n }\n return instance;\n};\n\nfunction getModuleFederationRemoteName(name: string, registry?: string, version?: string): string {\n return `${name}:${registry ?? ''}:${version ?? ''}`;\n}\n\nconst registerRemote = (name: string, registry?: string, version?: string, baseURL?: string): void => {\n const pluginRuntime = getPluginRuntime();\n const registryName = getModuleFederationRemoteName(name, registry, version);\n\n const existingRemote = pluginRuntime.options.remotes.find((remote) => remote.name === registryName);\n if (!existingRemote) {\n const nameVersionRegistry = [name, version, registry].filter(Boolean).join('~');\n const prefix = baseURL || '/plugins';\n const remoteEntryURL = `${prefix}/${nameVersionRegistry}/mf-manifest.json`;\n\n pluginRuntime.registerRemotes([\n {\n name: registryName,\n entry: remoteEntryURL,\n alias: registryName,\n },\n ]);\n }\n};\n\nexport const loadPlugin = async (target: {\n moduleName: string;\n pluginName: string;\n registry?: string;\n version?: string;\n baseURL?: string;\n}): Promise<RemotePluginModule | null> => {\n const { moduleName, pluginName, registry, version, baseURL } = target;\n registerRemote(moduleName, registry, version, baseURL);\n\n const pluginRuntime = getPluginRuntime();\n const registryName = getModuleFederationRemoteName(moduleName, registry, version);\n return pluginRuntime.loadRemote<RemotePluginModule>(`${registryName}/${pluginName}`);\n};\n\nexport function usePluginRuntime({ plugin }: { plugin: PersesPlugin }): {\n pluginRuntime: ModuleFederation;\n loadPlugin: () => Promise<RemotePluginModule | null>;\n} {\n return {\n pluginRuntime: getPluginRuntime(),\n loadPlugin: (): Promise<RemotePluginModule | null> => {\n const { moduleName, name: pluginName, registry, version, baseURL } = plugin;\n return loadPlugin({ moduleName, pluginName, registry, version, baseURL });\n },\n };\n}\n"],"names":["createInstance","ReactQuery","React","ReactDOM","ReactHookForm","ReactRouterDOM","instance","getPluginRuntime","pluginRuntime","name","remotes","shared","react","version","lib","shareConfig","singleton","requiredVersion","echarts","require","lodash","immer","getModuleFederationRemoteName","registry","registerRemote","baseURL","registryName","existingRemote","options","find","remote","nameVersionRegistry","filter","Boolean","join","prefix","remoteEntryURL","registerRemotes","entry","alias","loadPlugin","target","moduleName","pluginName","loadRemote","usePluginRuntime","plugin"],"mappings":"AAAA,+BAA+B;AAC/B,oEAAoE;AACpE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE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;gBACNY,OAAOF;gBACPG,OAAOb;YACT;SACD;IACH;AACF;AAEA,OAAO,MAAMc,aAAa,OAAOC;IAO/B,MAAM,EAAEC,UAAU,EAAEC,UAAU,EAAEpB,QAAQ,EAAEV,OAAO,EAAEY,OAAO,EAAE,GAAGgB;IAC/DjB,eAAekB,YAAYnB,UAAUV,SAASY;IAE9C,MAAMjB,gBAAgBD;IACtB,MAAMmB,eAAeJ,8BAA8BoB,YAAYnB,UAAUV;IACzE,OAAOL,cAAcoC,UAAU,CAAqB,GAAGlB,aAAa,CAAC,EAAEiB,YAAY;AACrF,EAAE;AAEF,OAAO,SAASE,iBAAiB,EAAEC,MAAM,EAA4B;IAInE,OAAO;QACLtC,eAAeD;QACfiC,YAAY;YACV,MAAM,EAAEE,UAAU,EAAEjC,MAAMkC,UAAU,EAAEpB,QAAQ,EAAEV,OAAO,EAAEY,OAAO,EAAE,GAAGqB;YACrE,OAAON,WAAW;gBAAEE;gBAAYC;gBAAYpB;gBAAUV;gBAASY;YAAQ;QACzE;IACF;AACF"}
@@ -1,5 +1,5 @@
1
- import { PluginLoader } from '@perses-dev/plugin-system';
2
1
  import { type FetchFn } from '@perses-dev/client';
2
+ import { PluginLoader } from '@perses-dev/plugin-system';
3
3
  type RemotePluginLoaderOptions = {
4
4
  /**
5
5
  * The API path for fetching available Perses plugins. Used to construct the full URL to the `/api/v1/plugins` endpoint.
@@ -1 +1 @@
1
- {"version":3,"file":"remotePluginLoader.d.ts","sourceRoot":"","sources":["../../src/remote/remotePluginLoader.ts"],"names":[],"mappings":"AAaA,OAAO,EACL,YAAY,EAKb,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAAyB,KAAK,OAAO,EAAE,MAAM,oBAAoB,CAAC;AA8BzE,KAAK,yBAAyB,GAAG;IAC/B;;;QAGI;IACJ,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;;QAGI;IACJ,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB;;OAEG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB,CAAC;AAwBF;;;GAGG;AACH,wBAAgB,kBAAkB,CAAC,OAAO,CAAC,EAAE,yBAAyB,GAAG,YAAY,CA0DpF"}
1
+ {"version":3,"file":"remotePluginLoader.d.ts","sourceRoot":"","sources":["../../src/remote/remotePluginLoader.ts"],"names":[],"mappings":"AAaA,OAAO,EAAyB,KAAK,OAAO,EAAE,MAAM,oBAAoB,CAAC;AACzE,OAAO,EACL,YAAY,EAKb,MAAM,2BAA2B,CAAC;AA+BnC,KAAK,yBAAyB,GAAG;IAC/B;;;QAGI;IACJ,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;;QAGI;IACJ,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB;;OAEG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB,CAAC;AAwBF;;;GAGG;AACH,wBAAgB,kBAAkB,CAAC,OAAO,CAAC,EAAE,yBAAyB,GAAG,YAAY,CA0DpF"}
@@ -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 { getPluginModuleCompoundKey } from '@perses-dev/plugin-system';
14
13
  import { fetch as defaultFetch } from '@perses-dev/client';
14
+ import { getPluginModuleCompoundKey } from '@perses-dev/plugin-system';
15
15
  import { loadPlugin } from './PluginRuntime';
16
16
  const isPluginMetadata = (plugin)=>{
17
17
  return typeof plugin === 'object' && plugin !== null && 'kind' in plugin && 'spec' in plugin && typeof plugin.spec === 'object' && plugin.spec !== null && 'name' in plugin.spec;
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/remote/remotePluginLoader.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 PluginLoader,\n PluginMetadata,\n PluginModuleResource,\n PluginType,\n getPluginModuleCompoundKey,\n} from '@perses-dev/plugin-system';\nimport { fetch as defaultFetch, type FetchFn } from '@perses-dev/client';\nimport { RemotePluginModule } from './PersesPlugin.types';\nimport { loadPlugin } from './PluginRuntime';\n\nconst isPluginMetadata = (plugin: unknown): plugin is PluginMetadata => {\n return (\n typeof plugin === 'object' &&\n plugin !== null &&\n 'kind' in plugin &&\n 'spec' in plugin &&\n typeof plugin.spec === 'object' &&\n plugin.spec !== null &&\n 'name' in plugin.spec\n );\n};\n\nconst isPluginModuleResource = (pluginModule: unknown): pluginModule is PluginModuleResource => {\n return (\n typeof pluginModule === 'object' &&\n pluginModule !== null &&\n 'metadata' in pluginModule &&\n 'spec' in pluginModule &&\n typeof pluginModule.spec === 'object' &&\n pluginModule.spec !== null &&\n 'plugins' in pluginModule.spec &&\n Array.isArray(pluginModule.spec.plugins) &&\n pluginModule.spec.plugins.every(isPluginMetadata)\n );\n};\n\ntype RemotePluginLoaderOptions = {\n /**\n * The API path for fetching available Perses plugins. Used to construct the full URL to the `/api/v1/plugins` endpoint.\n * @default ''\n **/\n apiPrefix?: string;\n /**\n * The base URL for loading plugin assets (e.g., JavaScript files). Used to construct the full URL to the `/plugins` directory\n * @default ''\n **/\n baseURL?: string;\n /**\n * Optional custom fetch function to use for network requests. If not provided, the default fetch implementation will be used.\n */\n fetchFn?: FetchFn;\n};\n\ntype ParsedPluginOptions = {\n pluginsApiPath: string;\n pluginsAssetsPath: string;\n};\n\nconst DEFAULT_PLUGINS_API_PATH = '/api/v1/plugins';\nconst DEFAULT_PLUGINS_ASSETS_PATH = '/plugins';\n\nconst paramToOptions = (options?: RemotePluginLoaderOptions): ParsedPluginOptions => {\n if (options === undefined) {\n return {\n pluginsApiPath: DEFAULT_PLUGINS_API_PATH,\n pluginsAssetsPath: DEFAULT_PLUGINS_ASSETS_PATH,\n };\n }\n\n return {\n pluginsApiPath: `${options?.apiPrefix ?? ''}${DEFAULT_PLUGINS_API_PATH}`,\n pluginsAssetsPath: `${options?.baseURL ?? ''}${DEFAULT_PLUGINS_ASSETS_PATH}`,\n };\n};\n\n/**\n * Get a PluginLoader that fetches the list of installed plugins from a remote server and loads them as needed.\n * @param options - Optional configuration options for the remote plugin loader.\n */\nexport function remotePluginLoader(options?: RemotePluginLoaderOptions): PluginLoader {\n const { pluginsApiPath, pluginsAssetsPath } = paramToOptions(options);\n const fetchFn = options?.fetchFn ?? defaultFetch;\n\n return {\n getInstalledPlugins: async (): Promise<PluginModuleResource[]> => {\n const pluginsResponse = await fetchFn(pluginsApiPath);\n\n const plugins = await pluginsResponse.json();\n let pluginModules: PluginModuleResource[] = [];\n\n if (Array.isArray(plugins)) {\n pluginModules = plugins.filter(isPluginModuleResource);\n } else {\n console.error('RemotePluginLoader: Error loading plugins, response is not an array');\n }\n\n if (!pluginModules.length) {\n console.error('RemotePluginLoader: No valid plugins found');\n }\n\n return pluginModules;\n },\n importPluginModule: async (resource): Promise<RemotePluginModule> => {\n const { name: pluginModuleName, version, registry } = resource.metadata;\n\n const pluginModule: RemotePluginModule = {};\n\n const loadPromises = resource.spec.plugins.map(async (plugin) => {\n const remotePluginModule = await loadPlugin({\n moduleName: pluginModuleName,\n pluginName: plugin.spec.name,\n registry,\n version,\n baseURL: pluginsAssetsPath,\n });\n\n const remotePlugin = remotePluginModule?.[plugin.spec.name];\n if (remotePlugin) {\n return { kind: plugin.kind as PluginType, name: plugin.spec.name, remotePlugin };\n } else {\n console.error(`RemotePluginLoader: Error loading plugin ${plugin.spec.name}`);\n return null;\n }\n });\n\n const loadedPlugins = await Promise.all(loadPromises);\n\n loadedPlugins.forEach((item) => {\n if (item?.remotePlugin) {\n pluginModule[getPluginModuleCompoundKey({ kind: item.kind, name: item.name, registry, version })] =\n item.remotePlugin;\n }\n });\n\n return pluginModule;\n },\n };\n}\n"],"names":["getPluginModuleCompoundKey","fetch","defaultFetch","loadPlugin","isPluginMetadata","plugin","spec","isPluginModuleResource","pluginModule","Array","isArray","plugins","every","DEFAULT_PLUGINS_API_PATH","DEFAULT_PLUGINS_ASSETS_PATH","paramToOptions","options","undefined","pluginsApiPath","pluginsAssetsPath","apiPrefix","baseURL","remotePluginLoader","fetchFn","getInstalledPlugins","pluginsResponse","json","pluginModules","filter","console","error","length","importPluginModule","resource","name","pluginModuleName","version","registry","metadata","loadPromises","map","remotePluginModule","moduleName","pluginName","remotePlugin","kind","loadedPlugins","Promise","all","forEach","item"],"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,SAKEA,0BAA0B,QACrB,4BAA4B;AACnC,SAASC,SAASC,YAAY,QAAsB,qBAAqB;AAEzE,SAASC,UAAU,QAAQ,kBAAkB;AAE7C,MAAMC,mBAAmB,CAACC;IACxB,OACE,OAAOA,WAAW,YAClBA,WAAW,QACX,UAAUA,UACV,UAAUA,UACV,OAAOA,OAAOC,IAAI,KAAK,YACvBD,OAAOC,IAAI,KAAK,QAChB,UAAUD,OAAOC,IAAI;AAEzB;AAEA,MAAMC,yBAAyB,CAACC;IAC9B,OACE,OAAOA,iBAAiB,YACxBA,iBAAiB,QACjB,cAAcA,gBACd,UAAUA,gBACV,OAAOA,aAAaF,IAAI,KAAK,YAC7BE,aAAaF,IAAI,KAAK,QACtB,aAAaE,aAAaF,IAAI,IAC9BG,MAAMC,OAAO,CAACF,aAAaF,IAAI,CAACK,OAAO,KACvCH,aAAaF,IAAI,CAACK,OAAO,CAACC,KAAK,CAACR;AAEpC;AAwBA,MAAMS,2BAA2B;AACjC,MAAMC,8BAA8B;AAEpC,MAAMC,iBAAi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AAOC,IAAI,CAAC4B,IAAI;wBAAEU;oBAAa;gBACjF,OAAO;oBACLf,QAAQC,KAAK,CAAC,CAAC,yCAAyC,EAAEzB,OAAOC,IAAI,CAAC4B,IAAI,EAAE;oBAC5E,OAAO;gBACT;YACF;YAEA,MAAMY,gBAAgB,MAAMC,QAAQC,GAAG,CAACT;YAExCO,cAAcG,OAAO,CAAC,CAACC;gBACrB,IAAIA,MAAMN,cAAc;oBACtBpC,YAAY,CAACR,2BAA2B;wBAAE6C,MAAMK,KAAKL,IAAI;wBAAEX,MAAMgB,KAAKhB,IAAI;wBAAEG;wBAAUD;oBAAQ,GAAG,GAC/Fc,KAAKN,YAAY;gBACrB;YACF;YAEA,OAAOpC;QACT;IACF;AACF"}
1
+ {"version":3,"sources":["../../src/remote/remotePluginLoader.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 { fetch as defaultFetch, type FetchFn } from '@perses-dev/client';\nimport {\n PluginLoader,\n PluginMetadata,\n PluginModuleResource,\n PluginType,\n getPluginModuleCompoundKey,\n} from '@perses-dev/plugin-system';\n\nimport { RemotePluginModule } from './PersesPlugin.types';\nimport { loadPlugin } from './PluginRuntime';\n\nconst isPluginMetadata = (plugin: unknown): plugin is PluginMetadata => {\n return (\n typeof plugin === 'object' &&\n plugin !== null &&\n 'kind' in plugin &&\n 'spec' in plugin &&\n typeof plugin.spec === 'object' &&\n plugin.spec !== null &&\n 'name' in plugin.spec\n );\n};\n\nconst isPluginModuleResource = (pluginModule: unknown): pluginModule is PluginModuleResource => {\n return (\n typeof pluginModule === 'object' &&\n pluginModule !== null &&\n 'metadata' in pluginModule &&\n 'spec' in pluginModule &&\n typeof pluginModule.spec === 'object' &&\n pluginModule.spec !== null &&\n 'plugins' in pluginModule.spec &&\n Array.isArray(pluginModule.spec.plugins) &&\n pluginModule.spec.plugins.every(isPluginMetadata)\n );\n};\n\ntype RemotePluginLoaderOptions = {\n /**\n * The API path for fetching available Perses plugins. Used to construct the full URL to the `/api/v1/plugins` endpoint.\n * @default ''\n **/\n apiPrefix?: string;\n /**\n * The base URL for loading plugin assets (e.g., JavaScript files). Used to construct the full URL to the `/plugins` directory\n * @default ''\n **/\n baseURL?: string;\n /**\n * Optional custom fetch function to use for network requests. If not provided, the default fetch implementation will be used.\n */\n fetchFn?: FetchFn;\n};\n\ntype ParsedPluginOptions = {\n pluginsApiPath: string;\n pluginsAssetsPath: string;\n};\n\nconst DEFAULT_PLUGINS_API_PATH = '/api/v1/plugins';\nconst DEFAULT_PLUGINS_ASSETS_PATH = '/plugins';\n\nconst paramToOptions = (options?: RemotePluginLoaderOptions): ParsedPluginOptions => {\n if (options === undefined) {\n return {\n pluginsApiPath: DEFAULT_PLUGINS_API_PATH,\n pluginsAssetsPath: DEFAULT_PLUGINS_ASSETS_PATH,\n };\n }\n\n return {\n pluginsApiPath: `${options?.apiPrefix ?? ''}${DEFAULT_PLUGINS_API_PATH}`,\n pluginsAssetsPath: `${options?.baseURL ?? ''}${DEFAULT_PLUGINS_ASSETS_PATH}`,\n };\n};\n\n/**\n * Get a PluginLoader that fetches the list of installed plugins from a remote server and loads them as needed.\n * @param options - Optional configuration options for the remote plugin loader.\n */\nexport function remotePluginLoader(options?: RemotePluginLoaderOptions): PluginLoader {\n const { pluginsApiPath, pluginsAssetsPath } = paramToOptions(options);\n const fetchFn = options?.fetchFn ?? defaultFetch;\n\n return {\n getInstalledPlugins: async (): Promise<PluginModuleResource[]> => {\n const pluginsResponse = await fetchFn(pluginsApiPath);\n\n const plugins = await pluginsResponse.json();\n let pluginModules: PluginModuleResource[] = [];\n\n if (Array.isArray(plugins)) {\n pluginModules = plugins.filter(isPluginModuleResource);\n } else {\n console.error('RemotePluginLoader: Error loading plugins, response is not an array');\n }\n\n if (!pluginModules.length) {\n console.error('RemotePluginLoader: No valid plugins found');\n }\n\n return pluginModules;\n },\n importPluginModule: async (resource): Promise<RemotePluginModule> => {\n const { name: pluginModuleName, version, registry } = resource.metadata;\n\n const pluginModule: RemotePluginModule = {};\n\n const loadPromises = resource.spec.plugins.map(async (plugin) => {\n const remotePluginModule = await loadPlugin({\n moduleName: pluginModuleName,\n pluginName: plugin.spec.name,\n registry,\n version,\n baseURL: pluginsAssetsPath,\n });\n\n const remotePlugin = remotePluginModule?.[plugin.spec.name];\n if (remotePlugin) {\n return { kind: plugin.kind as PluginType, name: plugin.spec.name, remotePlugin };\n } else {\n console.error(`RemotePluginLoader: Error loading plugin ${plugin.spec.name}`);\n return null;\n }\n });\n\n const loadedPlugins = await Promise.all(loadPromises);\n\n loadedPlugins.forEach((item) => {\n if (item?.remotePlugin) {\n pluginModule[getPluginModuleCompoundKey({ kind: item.kind, name: item.name, registry, version })] =\n item.remotePlugin;\n }\n });\n\n return pluginModule;\n },\n };\n}\n"],"names":["fetch","defaultFetch","getPluginModuleCompoundKey","loadPlugin","isPluginMetadata","plugin","spec","isPluginModuleResource","pluginModule","Array","isArray","plugins","every","DEFAULT_PLUGINS_API_PATH","DEFAULT_PLUGINS_ASSETS_PATH","paramToOptions","options","undefined","pluginsApiPath","pluginsAssetsPath","apiPrefix","baseURL","remotePluginLoader","fetchFn","getInstalledPlugins","pluginsResponse","json","pluginModules","filter","console","error","length","importPluginModule","resource","name","pluginModuleName","version","registry","metadata","loadPromises","map","remotePluginModule","moduleName","pluginName","remotePlugin","kind","loadedPlugins","Promise","all","forEach","item"],"mappings":"AAAA,+BAA+B;AAC/B,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EA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ProviderProps, UseDataQueryResults, DataQueriesContextType } from './model';
2
+ import { ReactElement } from 'react';
3
+ import { DataQueriesContextType, DataQueriesProviderProps, UseDataQueryResults } from './model';
4
4
  export declare const DataQueriesContext: import("react").Context<DataQueriesContextType | undefined>;
5
5
  export declare function useDataQueriesContext(): DataQueriesContextType;
6
6
  export declare function useDataQueries<T extends keyof QueryType>(queryType: T): UseDataQueryResults<QueryType[T]>;
@@ -1 +1 @@
1
- {"version":3,"file":"DataQueriesProvider.d.ts","sourceRoot":"","sources":["../../../src/runtime/DataQueriesProvider/DataQueriesProvider.tsx"],"names":[],"mappings":"AAaA,OAAO,EAAiB,YAAY,EAAoC,MAAM,OAAO,CAAC;AACtF,OAAO,EAAE,SAAS,EAA6B,MAAM,kBAAkB,CAAC;AASxE,OAAO,EACL,wBAAwB,EACxB,mBAAmB,EAEnB,sBAAsB,EAEvB,MAAM,SAAS,CAAC;AAEjB,eAAO,MAAM,kBAAkB,6DAA+D,CAAC;AAE/F,wBAAgB,qBAAqB,IAAI,sBAAsB,CAM9D;AAED,wBAAgB,cAAc,CAAC,CAAC,SAAS,MAAM,SAAS,EAAE,SAAS,EAAE,CAAC,GAAG,mBAAmB,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,CAuBzG;AAED,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,wBAAwB,GAAG,YAAY,CA2FjF"}
1
+ {"version":3,"file":"DataQueriesProvider.d.ts","sourceRoot":"","sources":["../../../src/runtime/DataQueriesProvider/DataQueriesProvider.tsx"],"names":[],"mappings":"AAaA,OAAO,EAAE,SAAS,EAA6B,MAAM,kBAAkB,CAAC;AACxE,OAAO,EAAiB,YAAY,EAAoC,MAAM,OAAO,CAAC;AAUtF,OAAO,EACL,sBAAsB,EACtB,wBAAwB,EAGxB,mBAAmB,EACpB,MAAM,SAAS,CAAC;AAEjB,eAAO,MAAM,kBAAkB,6DAA+D,CAAC;AAE/F,wBAAgB,qBAAqB,IAAI,sBAAsB,CAM9D;AAED,wBAAgB,cAAc,CAAC,CAAC,SAAS,MAAM,SAAS,EAAE,SAAS,EAAE,CAAC,GAAG,mBAAmB,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,CAuBzG;AAED,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,wBAAwB,GAAG,YAAY,CAkGjF"}
@@ -1,4 +1,3 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
2
1
  // Copyright The Perses Authors
3
2
  // Licensed under the Apache License, Version 2.0 (the "License");
4
3
  // you may not use this file except in compliance with the License.
@@ -11,14 +10,16 @@ import { jsx as _jsx } from "react/jsx-runtime";
11
10
  // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
11
  // See the License for the specific language governing permissions and
13
12
  // limitations under the License.
13
+ import { jsx as _jsx } from "react/jsx-runtime";
14
14
  import { createContext, useCallback, useContext, useMemo } from 'react';
15
- import { useTimeSeriesQueries } from '../time-series-queries';
16
- import { useTraceQueries } from '../trace-queries';
17
- import { useProfileQueries } from '../profile-queries';
18
15
  import { useAlertsQueries } from '../alerts-queries';
16
+ import { useJsonQueries } from '../json-queries';
17
+ import { useLogQueries } from '../log-queries';
18
+ import { useProfileQueries } from '../profile-queries';
19
19
  import { useSilencesQueries } from '../silences-queries';
20
+ import { useTimeSeriesQueries } from '../time-series-queries';
21
+ import { useTraceQueries } from '../trace-queries';
20
22
  import { useUsageMetrics } from '../UsageMetricsProvider';
21
- import { useLogQueries } from '../log-queries';
22
23
  import { transformQueryResults } from './model';
23
24
  export const DataQueriesContext = /*#__PURE__*/ createContext(undefined);
24
25
  export function useDataQueriesContext() {
@@ -62,6 +63,8 @@ export function DataQueriesProvider(props) {
62
63
  const alertsResults = useAlertsQueries(alertsQueries);
63
64
  const silencesQueries = definitions.filter((definition)=>definition.kind === 'SilencesQuery');
64
65
  const silencesResults = useSilencesQueries(silencesQueries);
66
+ const jsonQueries = definitions.filter((definition)=>definition.kind === 'JsonQuery');
67
+ const jsonResults = useJsonQueries(jsonQueries);
65
68
  const refetchAll = useCallback(()=>{
66
69
  timeSeriesResults.forEach((result)=>result.refetch());
67
70
  traceResults.forEach((result)=>result.refetch());
@@ -69,13 +72,15 @@ export function DataQueriesProvider(props) {
69
72
  logResults.forEach((result)=>result.refetch());
70
73
  alertsResults.forEach((result)=>result.refetch());
71
74
  silencesResults.forEach((result)=>result.refetch());
75
+ jsonResults.forEach((result)=>result.refetch());
72
76
  }, [
73
77
  timeSeriesResults,
74
78
  traceResults,
75
79
  profileResults,
76
80
  logResults,
77
81
  alertsResults,
78
- silencesResults
82
+ silencesResults,
83
+ jsonResults
79
84
  ]);
80
85
  const ctx = useMemo(()=>{
81
86
  const mergedQueryResults = [
@@ -84,7 +89,8 @@ export function DataQueriesProvider(props) {
84
89
  ...transformQueryResults(profileResults, profileQueries),
85
90
  ...transformQueryResults(logResults, logQueries),
86
91
  ...transformQueryResults(alertsResults, alertsQueries),
87
- ...transformQueryResults(silencesResults, silencesQueries)
92
+ ...transformQueryResults(silencesResults, silencesQueries),
93
+ ...transformQueryResults(jsonResults, jsonQueries)
88
94
  ];
89
95
  if (queryOptions?.enabled) {
90
96
  for (const result of mergedQueryResults){
@@ -114,6 +120,8 @@ export function DataQueriesProvider(props) {
114
120
  profileResults,
115
121
  silencesQueries,
116
122
  silencesResults,
123
+ jsonQueries,
124
+ jsonResults,
117
125
  timeSeriesQueries,
118
126
  timeSeriesResults,
119
127
  traceQueries,
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/runtime/DataQueriesProvider/DataQueriesProvider.tsx"],"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 { createContext, ReactElement, useCallback, useContext, useMemo } from 'react';\nimport { QueryType, TimeSeriesQueryDefinition } from '@perses-dev/spec';\nimport { useTimeSeriesQueries } from '../time-series-queries';\nimport { useTraceQueries, TraceQueryDefinition } from '../trace-queries';\nimport { useProfileQueries, ProfileQueryDefinition } from '../profile-queries';\nimport { useAlertsQueries, AlertsQueryDefinition } from '../alerts-queries';\nimport { useSilencesQueries, SilencesQueryDefinition } from '../silences-queries';\n\nimport { useUsageMetrics } from '../UsageMetricsProvider';\nimport { LogQueryDefinition, useLogQueries } from '../log-queries';\nimport {\n DataQueriesProviderProps,\n UseDataQueryResults,\n transformQueryResults,\n DataQueriesContextType,\n QueryData,\n} from './model';\n\nexport const DataQueriesContext = createContext<DataQueriesContextType | undefined>(undefined);\n\nexport function useDataQueriesContext(): DataQueriesContextType {\n const ctx = useContext(DataQueriesContext);\n if (ctx === undefined) {\n throw new Error('No DataQueriesContext found. Did you forget a Provider?');\n }\n return ctx;\n}\n\nexport function useDataQueries<T extends keyof QueryType>(queryType: T): UseDataQueryResults<QueryType[T]> {\n const ctx = useDataQueriesContext();\n\n // Filter query definitions based on the specified query type\n const filteredQueryDefinitions = ctx.queryDefinitions.filter((definition) => definition.kind === queryType);\n\n // Filter the query results based on the specified query type\n const filteredQueryResults = ctx.queryResults.filter(\n (queryResult) => queryResult?.definition?.kind === queryType\n ) as Array<QueryData<QueryType[T]>>;\n\n // Filter the errors based on the specified query type\n const filteredErrors = ctx.errors.filter((errors, index) => ctx.queryResults[index]?.definition?.kind === queryType);\n\n // Create a new context object with the filtered results and errors\n return {\n queryDefinitions: filteredQueryDefinitions,\n queryResults: filteredQueryResults,\n isFetching: filteredQueryResults.some((result) => result.isFetching),\n isLoading: filteredQueryResults.some((result) => result.isLoading),\n refetchAll: ctx.refetchAll,\n errors: filteredErrors,\n };\n}\n\nexport function DataQueriesProvider(props: DataQueriesProviderProps): ReactElement {\n const { definitions, options, children, queryOptions } = props;\n\n const usageMetrics = useUsageMetrics();\n\n // Filter definitions for time series query and other future query plugins\n const timeSeriesQueries = definitions.filter(\n (definition) => definition.kind === 'TimeSeriesQuery'\n ) as TimeSeriesQueryDefinition[];\n const timeSeriesResults = useTimeSeriesQueries(timeSeriesQueries, options, queryOptions);\n\n const traceQueries = definitions.filter((definition) => definition.kind === 'TraceQuery') as TraceQueryDefinition[];\n const traceResults = useTraceQueries(traceQueries);\n\n const profileQueries = definitions.filter(\n (definition) => definition.kind === 'ProfileQuery'\n ) as ProfileQueryDefinition[];\n const profileResults = useProfileQueries(profileQueries);\n\n const logQueries = definitions.filter((definition) => definition.kind === 'LogQuery') as LogQueryDefinition[];\n const logResults = useLogQueries(logQueries);\n\n const alertsQueries = definitions.filter(\n (definition) => definition.kind === 'AlertsQuery'\n ) as AlertsQueryDefinition[];\n const alertsResults = useAlertsQueries(alertsQueries);\n\n const silencesQueries = definitions.filter(\n (definition) => definition.kind === 'SilencesQuery'\n ) as SilencesQueryDefinition[];\n const silencesResults = useSilencesQueries(silencesQueries);\n\n const refetchAll = useCallback(() => {\n timeSeriesResults.forEach((result) => result.refetch());\n traceResults.forEach((result) => result.refetch());\n profileResults.forEach((result) => result.refetch());\n logResults.forEach((result) => result.refetch());\n alertsResults.forEach((result) => result.refetch());\n silencesResults.forEach((result) => result.refetch());\n }, [timeSeriesResults, traceResults, profileResults, logResults, alertsResults, silencesResults]);\n\n const ctx = useMemo(() => {\n const mergedQueryResults = [\n ...transformQueryResults(timeSeriesResults, timeSeriesQueries),\n ...transformQueryResults(traceResults, traceQueries),\n ...transformQueryResults(profileResults, profileQueries),\n ...transformQueryResults(logResults, logQueries),\n ...transformQueryResults(alertsResults, alertsQueries),\n ...transformQueryResults(silencesResults, silencesQueries),\n ];\n\n if (queryOptions?.enabled) {\n for (const result of mergedQueryResults) {\n if (!result.isLoading && !result.isFetching && !result.error) {\n usageMetrics.markQuery(result.definition, 'success');\n } else if (result.error) {\n usageMetrics.markQuery(result.definition, 'error');\n } else {\n usageMetrics.markQuery(result.definition, 'pending');\n }\n }\n }\n\n return {\n queryDefinitions: definitions,\n queryResults: mergedQueryResults,\n isFetching: mergedQueryResults.some((result) => result.isFetching),\n isLoading: mergedQueryResults.some((result) => result.isLoading),\n refetchAll,\n errors: mergedQueryResults.map((result) => result.error),\n };\n }, [\n alertsQueries,\n alertsResults,\n logQueries,\n logResults,\n profileQueries,\n profileResults,\n silencesQueries,\n silencesResults,\n timeSeriesQueries,\n timeSeriesResults,\n traceQueries,\n traceResults,\n definitions,\n queryOptions?.enabled,\n refetchAll,\n usageMetrics,\n ]);\n\n return <DataQueriesContext.Provider value={ctx}>{children}</DataQueriesContext.Provider>;\n}\n"],"names":["createContext","useCallback","useContext","useMemo","useTimeSeriesQueries","useTraceQueries","useProfileQueries","useAlertsQueries","useSilencesQueries","useUsageMetrics","useLogQueries","transformQueryResults","DataQueriesContext","undefined","useDataQueriesContext","ctx","Error","useDataQueries","queryType","filteredQueryDefinitions","queryDefinitions","filter","definition","kind","filteredQueryResults","queryResults","queryResult","filteredErrors","errors","index","isFetching","some","result","isLoading","refetchAll","DataQueriesProvider","props","definitions","options","children","queryOptions","usageMetrics","timeSeriesQueries","timeSeriesResults","traceQueries","traceResults","profileQueries","profileResults","logQueries","logResults","alertsQueries","alertsResults","silencesQueries","silencesResults","forEach","refetch","mergedQueryResults","enabled","error","markQuery","map","Provider","value"],"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,SAASA,aAAa,EAAgBC,WAAW,EAAEC,UAAU,EAAEC,OAAO,QAAQ,QAAQ;AAEtF,SAASC,oBAAoB,QAAQ,yBAAyB;AAC9D,SAASC,eAAe,QAA8B,mBAAmB;AACzE,SAASC,iBAAiB,QAAgC,qBAAqB;AAC/E,SAASC,g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iBD;SAC3C;QAED,IAAIZ,cAAciB,SAAS;YACzB,KAAK,MAAMzB,UAAUwB,mBAAoB;gBACvC,IAAI,CAACxB,OAAOC,SAAS,IAAI,CAACD,OAAOF,UAAU,IAAI,CAACE,OAAO0B,KAAK,EAAE;oBAC5DjB,aAAakB,SAAS,CAAC3B,OAAOV,UAAU,EAAE;gBAC5C,OAAO,IAAIU,OAAO0B,KAAK,EAAE;oBACvBjB,aAAakB,SAAS,CAAC3B,OAAOV,UAAU,EAAE;gBAC5C,OAAO;oBACLmB,aAAakB,SAAS,CAAC3B,OAAOV,UAAU,EAAE;gBAC5C;YACF;QACF;QAEA,OAAO;YACLF,kBAAkBiB;YAClBZ,cAAc+B;YACd1B,YAAY0B,mBAAmBzB,IAAI,CAAC,CAACC,SAAWA,OAAOF,UAAU;YACjEG,WAAWuB,mBAAmBzB,IAAI,CAAC,CAACC,SAAWA,OAAOC,SAAS;YAC/DC;YACAN,QAAQ4B,mBAAmBI,GAAG,CAAC,CAAC5B,SAAWA,OAAO0B,KAAK;QACzD;IACF,GAAG;QACDR;QACAC;QACAH;QACAC;QACAH;QACAC;QACAK;QACAC;QACAX;QACAC;QACAC;QACAC;QACAR;QACAG,cAAciB;QACdvB;QACAO;KACD;IAED,qBAAO,KAAC7B,mBAAmBiD,QAAQ;QAACC,OAAO/C;kBAAMwB;;AACnD"}
1
+ {"version":3,"sources":["../../../src/runtime/DataQueriesProvider/DataQueriesProvider.tsx"],"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 { QueryType, TimeSeriesQueryDefinition } from '@perses-dev/spec';\nimport { createContext, ReactElement, useCallback, useContext, useMemo } from 'react';\n\nimport { AlertsQueryDefinition, useAlertsQueries } from '../alerts-queries';\nimport { JsonQueryDefinition, useJsonQueries } from '../json-queries';\nimport { LogQueryDefinition, useLogQueries } from '../log-queries';\nimport { ProfileQueryDefinition, useProfileQueries } from '../profile-queries';\nimport { SilencesQueryDefinition, useSilencesQueries } from '../silences-queries';\nimport { useTimeSeriesQueries } from '../time-series-queries';\nimport { TraceQueryDefinition, useTraceQueries } from '../trace-queries';\nimport { useUsageMetrics } from '../UsageMetricsProvider';\nimport {\n DataQueriesContextType,\n DataQueriesProviderProps,\n QueryData,\n transformQueryResults,\n UseDataQueryResults,\n} from './model';\n\nexport const DataQueriesContext = createContext<DataQueriesContextType | undefined>(undefined);\n\nexport function useDataQueriesContext(): DataQueriesContextType {\n const ctx = useContext(DataQueriesContext);\n if (ctx === undefined) {\n throw new Error('No DataQueriesContext found. Did you forget a Provider?');\n }\n return ctx;\n}\n\nexport function useDataQueries<T extends keyof QueryType>(queryType: T): UseDataQueryResults<QueryType[T]> {\n const ctx = useDataQueriesContext();\n\n // Filter query definitions based on the specified query type\n const filteredQueryDefinitions = ctx.queryDefinitions.filter((definition) => definition.kind === queryType);\n\n // Filter the query results based on the specified query type\n const filteredQueryResults = ctx.queryResults.filter(\n (queryResult) => queryResult?.definition?.kind === queryType,\n ) as Array<QueryData<QueryType[T]>>;\n\n // Filter the errors based on the specified query type\n const filteredErrors = ctx.errors.filter((errors, index) => ctx.queryResults[index]?.definition?.kind === queryType);\n\n // Create a new context object with the filtered results and errors\n return {\n queryDefinitions: filteredQueryDefinitions,\n queryResults: filteredQueryResults,\n isFetching: filteredQueryResults.some((result) => result.isFetching),\n isLoading: filteredQueryResults.some((result) => result.isLoading),\n refetchAll: ctx.refetchAll,\n errors: filteredErrors,\n };\n}\n\nexport function DataQueriesProvider(props: DataQueriesProviderProps): ReactElement {\n const { definitions, options, children, queryOptions } = props;\n\n const usageMetrics = useUsageMetrics();\n\n // Filter definitions for time series query and other future query plugins\n const timeSeriesQueries = definitions.filter(\n (definition) => definition.kind === 'TimeSeriesQuery',\n ) as TimeSeriesQueryDefinition[];\n const timeSeriesResults = useTimeSeriesQueries(timeSeriesQueries, options, queryOptions);\n\n const traceQueries = definitions.filter((definition) => definition.kind === 'TraceQuery') as TraceQueryDefinition[];\n const traceResults = useTraceQueries(traceQueries);\n\n const profileQueries = definitions.filter(\n (definition) => definition.kind === 'ProfileQuery',\n ) as ProfileQueryDefinition[];\n const profileResults = useProfileQueries(profileQueries);\n\n const logQueries = definitions.filter((definition) => definition.kind === 'LogQuery') as LogQueryDefinition[];\n const logResults = useLogQueries(logQueries);\n\n const alertsQueries = definitions.filter(\n (definition) => definition.kind === 'AlertsQuery',\n ) as AlertsQueryDefinition[];\n const alertsResults = useAlertsQueries(alertsQueries);\n\n const silencesQueries = definitions.filter(\n (definition) => definition.kind === 'SilencesQuery',\n ) as SilencesQueryDefinition[];\n const silencesResults = useSilencesQueries(silencesQueries);\n\n const jsonQueries = definitions.filter((definition) => definition.kind === 'JsonQuery') as JsonQueryDefinition[];\n const jsonResults = useJsonQueries(jsonQueries);\n\n const refetchAll = useCallback(() => {\n timeSeriesResults.forEach((result) => result.refetch());\n traceResults.forEach((result) => result.refetch());\n profileResults.forEach((result) => result.refetch());\n logResults.forEach((result) => result.refetch());\n alertsResults.forEach((result) => result.refetch());\n silencesResults.forEach((result) => result.refetch());\n jsonResults.forEach((result) => result.refetch());\n }, [timeSeriesResults, traceResults, profileResults, logResults, alertsResults, silencesResults, jsonResults]);\n\n const ctx = useMemo(() => {\n const mergedQueryResults = [\n ...transformQueryResults(timeSeriesResults, timeSeriesQueries),\n ...transformQueryResults(traceResults, traceQueries),\n ...transformQueryResults(profileResults, profileQueries),\n ...transformQueryResults(logResults, logQueries),\n ...transformQueryResults(alertsResults, alertsQueries),\n ...transformQueryResults(silencesResults, silencesQueries),\n ...transformQueryResults(jsonResults, jsonQueries),\n ];\n\n if (queryOptions?.enabled) {\n for (const result of mergedQueryResults) {\n if (!result.isLoading && !result.isFetching && !result.error) {\n usageMetrics.markQuery(result.definition, 'success');\n } else if (result.error) {\n usageMetrics.markQuery(result.definition, 'error');\n } else {\n usageMetrics.markQuery(result.definition, 'pending');\n }\n }\n }\n\n return {\n queryDefinitions: definitions,\n queryResults: mergedQueryResults,\n isFetching: mergedQueryResults.some((result) => result.isFetching),\n isLoading: mergedQueryResults.some((result) => result.isLoading),\n refetchAll,\n errors: mergedQueryResults.map((result) => result.error),\n };\n }, [\n alertsQueries,\n alertsResults,\n logQueries,\n logResults,\n profileQueries,\n profileResults,\n silencesQueries,\n silencesResults,\n jsonQueries,\n jsonResults,\n timeSeriesQueries,\n timeSeriesResults,\n traceQueries,\n traceResults,\n definitions,\n queryOptions?.enabled,\n refetchAll,\n usageMetrics,\n ]);\n\n return <DataQueriesContext.Provider value={ctx}>{children}</DataQueriesContext.Provider>;\n}\n"],"names":["createContext","useCallback","useContext","useMemo","useAlertsQueries","useJsonQueries","useLogQueries","useProfileQueries","useSilencesQueries","useTimeSeriesQueries","useTraceQueries","useUsageMetrics","transformQueryResults","DataQueriesContext","undefined","useDataQueriesContext","ctx","Error","useDataQueries","queryType","filteredQueryDefinitions","queryDefinitions","filter","definition","kind","filteredQueryResults","queryResults","queryResult","filteredErrors","errors","index","isFetching","some","result","isLoading","refetchAll","DataQueriesProvider","props","definitions","options","children","queryOptions","usageMetrics","timeSeriesQueries","timeSeriesResults","traceQueries","traceResults","profileQueries","profileResults","logQueries","logResults","alertsQueries","alertsResults","silencesQueries","silencesResults","jsonQueries","jsonResults","forEach","refetch","mergedQueryResults","enabled","error","markQuery","map","Provider","value"],"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,aAAa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BmD,QAAQ;QAACC,OAAOjD;kBAAMwB;;AACnD"}
@@ -1,5 +1,5 @@
1
- import React, { ReactElement } from 'react';
2
1
  import { AbsoluteTimeRange, DurationString, TimeRangeValue } from '@perses-dev/spec';
2
+ import React, { ReactElement } from 'react';
3
3
  export interface TimeRangeProviderProps {
4
4
  timeRange: TimeRangeValue;
5
5
  refreshInterval?: DurationString;
@@ -1 +1 @@
1
- {"version":3,"file":"TimeRangeProvider.d.ts","sourceRoot":"","sources":["../../../src/runtime/TimeRangeProvider/TimeRangeProvider.tsx"],"names":[],"mappings":"AAaA,OAAO,KAAK,EAAE,EAAiB,YAAY,EAAyD,MAAM,OAAO,CAAC;AAClH,OAAO,EACL,iBAAiB,EACjB,cAAc,EACd,cAAc,EAIf,MAAM,kBAAkB,CAAC;AAI1B,MAAM,WAAW,sBAAsB;IACrC,SAAS,EAAE,cAAc,CAAC;IAC1B,eAAe,CAAC,EAAE,cAAc,CAAC;IACjC,YAAY,EAAE,CAAC,KAAK,EAAE,cAAc,KAAK,IAAI,CAAC;IAC9C,kBAAkB,EAAE,CAAC,KAAK,EAAE,cAAc,KAAK,IAAI,CAAC;IACpD,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAC5B;AAED,MAAM,WAAW,SAAS;IACxB,SAAS,EAAE,cAAc,CAAC;IAC1B,iBAAiB,EAAE,iBAAiB,CAAC;IACrC,YAAY,EAAE,CAAC,KAAK,EAAE,cAAc,KAAK,IAAI,CAAC;IAC9C,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,eAAe,CAAC,EAAE,cAAc,CAAC;IACjC,mBAAmB,EAAE,MAAM,CAAC;IAC5B,kBAAkB,EAAE,CAAC,KAAK,EAAE,cAAc,KAAK,IAAI,CAAC;CACrD;AAED,eAAO,MAAM,gBAAgB,sCAAkD,CAAC;AAEhF,wBAAgB,mBAAmB,IAAI,SAAS,CAM/C;AAED;;GAEG;AACH,wBAAgB,YAAY,IAAI,SAAS,CAExC;AAED;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