@perses-dev/plugin-system 0.0.0-snapshot-scatterplot-fix-imports-95e1b59 → 0.0.0-snapshot-histogram-types-78c5104

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 (401) hide show
  1. package/dist/cjs/components/DatasourceEditorForm/DatasourceEditorForm.js +82 -162
  2. package/dist/cjs/components/DatasourceSelect.js +8 -13
  3. package/dist/cjs/components/HTTPSettingsEditor/HTTPSettingsEditor.js +534 -0
  4. package/dist/cjs/components/{TimeSeriesQueryEditor → HTTPSettingsEditor}/index.js +2 -2
  5. package/dist/cjs/components/LegendOptionsEditor/LegendOptionsEditor.js +8 -7
  6. package/dist/cjs/components/MetricLabelInput/MetricLabelInput.js +41 -0
  7. package/dist/cjs/components/{TraceQueryEditor → MetricLabelInput}/index.js +2 -2
  8. package/dist/cjs/components/{TimeSeriesQueryEditor/TimeSeriesQueryEditor.js → MultiQueryEditor/MultiQueryEditor.js} +30 -23
  9. package/dist/cjs/components/{TimeSeriesQueryEditor/TimeSeriesQueryInput.js → MultiQueryEditor/QueryEditorContainer.js} +25 -13
  10. package/dist/cjs/{stories/shared-utils → components/MultiQueryEditor}/index.js +2 -2
  11. package/dist/cjs/components/PanelSpecEditor/PanelSpecEditor.js +51 -59
  12. package/dist/cjs/components/PluginEditor/PluginEditor.js +16 -13
  13. package/dist/cjs/components/PluginEditor/plugin-editor-api.js +43 -32
  14. package/dist/cjs/components/PluginKindSelect/PluginKindSelect.js +55 -7
  15. package/dist/cjs/components/PluginRegistry/PluginRegistry.js +8 -9
  16. package/dist/cjs/components/PluginRegistry/plugin-indexes.js +17 -14
  17. package/dist/cjs/components/PluginSpecEditor/PluginSpecEditor.js +1 -1
  18. package/dist/cjs/components/ProjectSelect.js +5 -5
  19. package/dist/cjs/components/TimeRangeControls/TimeRangeControls.js +10 -71
  20. package/dist/cjs/components/Variables/VariableEditorForm/VariableEditorForm.js +391 -442
  21. package/dist/cjs/components/Variables/VariableEditorForm/VariablePreview.js +7 -7
  22. package/dist/cjs/components/Variables/VariableEditorForm/variable-editor-form-model.js +6 -11
  23. package/dist/cjs/components/Variables/variable-model.js +26 -27
  24. package/dist/cjs/components/index.js +3 -1
  25. package/dist/cjs/context/ProjectStoreProvider.js +7 -4
  26. package/dist/cjs/context/ValidationProvider.js +69 -0
  27. package/dist/cjs/context/index.js +1 -0
  28. package/dist/cjs/index.js +1 -1
  29. package/dist/{components/TimeSeriesQueryEditor/index.js → cjs/model/explore.js} +4 -3
  30. package/dist/cjs/remote/PersesPlugin.types.js +16 -0
  31. package/dist/cjs/remote/PluginLoaderComponent.js +75 -0
  32. package/dist/cjs/remote/PluginRuntime.js +273 -0
  33. package/dist/cjs/{validation → remote}/index.js +2 -5
  34. package/dist/cjs/remote/remotePluginLoader.js +61 -0
  35. package/dist/cjs/runtime/DataQueriesProvider/DataQueriesProvider.js +18 -9
  36. package/dist/cjs/runtime/DataQueriesProvider/model.js +10 -9
  37. package/dist/cjs/{stories/shared-utils/decorators/WithPluginRegistry.js → runtime/QueryCountProvider.js} +22 -39
  38. package/dist/cjs/runtime/TimeRangeProvider/TimeRangeProvider.js +17 -4
  39. package/dist/cjs/runtime/TimeRangeProvider/TimeRangeSettingsProvider.js +100 -0
  40. package/dist/cjs/runtime/TimeRangeProvider/index.js +2 -1
  41. package/dist/cjs/runtime/TimeRangeProvider/query-params.js +4 -7
  42. package/dist/cjs/runtime/UsageMetricsProvider.js +99 -0
  43. package/dist/cjs/runtime/builtin-variables.js +2 -2
  44. package/dist/cjs/runtime/datasources.js +23 -14
  45. package/dist/cjs/runtime/index.js +4 -2
  46. package/dist/cjs/runtime/plugin-registry.js +49 -28
  47. package/dist/cjs/runtime/time-series-queries.js +23 -28
  48. package/dist/cjs/runtime/trace-queries.js +1 -2
  49. package/dist/cjs/runtime/{template-variables.js → variables.js} +29 -47
  50. package/dist/cjs/test/mock-data.js +25 -4
  51. package/dist/cjs/test/render.js +2 -11
  52. package/dist/cjs/test/test-plugins/bert/index.js +20 -19
  53. package/dist/cjs/test-utils/mock-plugin-registry.js +10 -10
  54. package/dist/cjs/utils/variables.js +24 -24
  55. package/dist/components/CalculationSelector/CalculationSelector.d.ts +2 -1
  56. package/dist/components/CalculationSelector/CalculationSelector.d.ts.map +1 -1
  57. package/dist/components/CalculationSelector/CalculationSelector.js.map +1 -1
  58. package/dist/components/DatasourceEditorForm/DatasourceEditorForm.d.ts +6 -5
  59. package/dist/components/DatasourceEditorForm/DatasourceEditorForm.d.ts.map +1 -1
  60. package/dist/components/DatasourceEditorForm/DatasourceEditorForm.js +85 -165
  61. package/dist/components/DatasourceEditorForm/DatasourceEditorForm.js.map +1 -1
  62. package/dist/components/DatasourceSelect.d.ts +5 -4
  63. package/dist/components/DatasourceSelect.d.ts.map +1 -1
  64. package/dist/components/DatasourceSelect.js +8 -13
  65. package/dist/components/DatasourceSelect.js.map +1 -1
  66. package/dist/components/HTTPSettingsEditor/HTTPSettingsEditor.d.ts +11 -0
  67. package/dist/components/HTTPSettingsEditor/HTTPSettingsEditor.d.ts.map +1 -0
  68. package/dist/components/HTTPSettingsEditor/HTTPSettingsEditor.js +480 -0
  69. package/dist/components/HTTPSettingsEditor/HTTPSettingsEditor.js.map +1 -0
  70. package/dist/components/HTTPSettingsEditor/index.d.ts +2 -0
  71. package/dist/components/HTTPSettingsEditor/index.d.ts.map +1 -0
  72. package/dist/components/HTTPSettingsEditor/index.js +15 -0
  73. package/dist/components/HTTPSettingsEditor/index.js.map +1 -0
  74. package/dist/components/LegendOptionsEditor/LegendOptionsEditor.d.ts +3 -1
  75. package/dist/components/LegendOptionsEditor/LegendOptionsEditor.d.ts.map +1 -1
  76. package/dist/components/LegendOptionsEditor/LegendOptionsEditor.js +10 -9
  77. package/dist/components/LegendOptionsEditor/LegendOptionsEditor.js.map +1 -1
  78. package/dist/components/MetricLabelInput/MetricLabelInput.d.ts +7 -0
  79. package/dist/components/MetricLabelInput/MetricLabelInput.d.ts.map +1 -0
  80. package/dist/components/MetricLabelInput/MetricLabelInput.js +33 -0
  81. package/dist/components/MetricLabelInput/MetricLabelInput.js.map +1 -0
  82. package/dist/components/MetricLabelInput/index.d.ts +2 -0
  83. package/dist/components/MetricLabelInput/index.d.ts.map +1 -0
  84. package/dist/components/MetricLabelInput/index.js +15 -0
  85. package/dist/components/MetricLabelInput/index.js.map +1 -0
  86. package/dist/components/MultiQueryEditor/MultiQueryEditor.d.ts +17 -0
  87. package/dist/components/MultiQueryEditor/MultiQueryEditor.d.ts.map +1 -0
  88. package/dist/components/{TimeSeriesQueryEditor/TimeSeriesQueryEditor.js → MultiQueryEditor/MultiQueryEditor.js} +37 -23
  89. package/dist/components/MultiQueryEditor/MultiQueryEditor.js.map +1 -0
  90. package/dist/components/MultiQueryEditor/QueryEditorContainer.d.ts +29 -0
  91. package/dist/components/MultiQueryEditor/QueryEditorContainer.d.ts.map +1 -0
  92. package/dist/components/{TraceQueryEditor/TraceQueryInput.js → MultiQueryEditor/QueryEditorContainer.js} +35 -12
  93. package/dist/components/MultiQueryEditor/QueryEditorContainer.js.map +1 -0
  94. package/dist/components/MultiQueryEditor/index.d.ts +2 -0
  95. package/dist/components/MultiQueryEditor/index.d.ts.map +1 -0
  96. package/dist/components/MultiQueryEditor/index.js +15 -0
  97. package/dist/components/{TraceQueryEditor → MultiQueryEditor}/index.js.map +1 -1
  98. package/dist/components/OptionsEditorRadios/OptionsEditorRadios.d.ts +2 -2
  99. package/dist/components/OptionsEditorRadios/OptionsEditorRadios.d.ts.map +1 -1
  100. package/dist/components/OptionsEditorRadios/OptionsEditorRadios.js.map +1 -1
  101. package/dist/components/OptionsEditorTabPanel/OptionsEditorTabPanel.d.ts +2 -2
  102. package/dist/components/OptionsEditorTabPanel/OptionsEditorTabPanel.d.ts.map +1 -1
  103. package/dist/components/OptionsEditorTabPanel/OptionsEditorTabPanel.js.map +1 -1
  104. package/dist/components/OptionsEditorTabs/OptionsEditorTabs.d.ts +3 -3
  105. package/dist/components/OptionsEditorTabs/OptionsEditorTabs.d.ts.map +1 -1
  106. package/dist/components/OptionsEditorTabs/OptionsEditorTabs.js.map +1 -1
  107. package/dist/components/PanelSpecEditor/PanelSpecEditor.d.ts +5 -2
  108. package/dist/components/PanelSpecEditor/PanelSpecEditor.d.ts.map +1 -1
  109. package/dist/components/PanelSpecEditor/PanelSpecEditor.js +53 -61
  110. package/dist/components/PanelSpecEditor/PanelSpecEditor.js.map +1 -1
  111. package/dist/components/PluginEditor/PluginEditor.d.ts +2 -1
  112. package/dist/components/PluginEditor/PluginEditor.d.ts.map +1 -1
  113. package/dist/components/PluginEditor/PluginEditor.js +16 -13
  114. package/dist/components/PluginEditor/PluginEditor.js.map +1 -1
  115. package/dist/components/PluginEditor/plugin-editor-api.d.ts +15 -8
  116. package/dist/components/PluginEditor/plugin-editor-api.d.ts.map +1 -1
  117. package/dist/components/PluginEditor/plugin-editor-api.js +43 -32
  118. package/dist/components/PluginEditor/plugin-editor-api.js.map +1 -1
  119. package/dist/components/PluginKindSelect/PluginKindSelect.d.ts +10 -4
  120. package/dist/components/PluginKindSelect/PluginKindSelect.d.ts.map +1 -1
  121. package/dist/components/PluginKindSelect/PluginKindSelect.js +61 -10
  122. package/dist/components/PluginKindSelect/PluginKindSelect.js.map +1 -1
  123. package/dist/components/PluginRegistry/PluginRegistry.d.ts +2 -2
  124. package/dist/components/PluginRegistry/PluginRegistry.d.ts.map +1 -1
  125. package/dist/components/PluginRegistry/PluginRegistry.js +8 -9
  126. package/dist/components/PluginRegistry/PluginRegistry.js.map +1 -1
  127. package/dist/components/PluginRegistry/plugin-indexes.d.ts +4 -4
  128. package/dist/components/PluginRegistry/plugin-indexes.d.ts.map +1 -1
  129. package/dist/components/PluginRegistry/plugin-indexes.js +17 -14
  130. package/dist/components/PluginRegistry/plugin-indexes.js.map +1 -1
  131. package/dist/components/PluginSpecEditor/PluginSpecEditor.d.ts +5 -4
  132. package/dist/components/PluginSpecEditor/PluginSpecEditor.d.ts.map +1 -1
  133. package/dist/components/PluginSpecEditor/PluginSpecEditor.js +1 -1
  134. package/dist/components/PluginSpecEditor/PluginSpecEditor.js.map +1 -1
  135. package/dist/components/ProjectSelect.d.ts +2 -1
  136. package/dist/components/ProjectSelect.d.ts.map +1 -1
  137. package/dist/components/ProjectSelect.js +5 -5
  138. package/dist/components/ProjectSelect.js.map +1 -1
  139. package/dist/components/TimeRangeControls/TimeRangeControls.d.ts +3 -2
  140. package/dist/components/TimeRangeControls/TimeRangeControls.d.ts.map +1 -1
  141. package/dist/components/TimeRangeControls/TimeRangeControls.js +12 -70
  142. package/dist/components/TimeRangeControls/TimeRangeControls.js.map +1 -1
  143. package/dist/components/Variables/VariableEditorForm/VariableEditorForm.d.ts +4 -3
  144. package/dist/components/Variables/VariableEditorForm/VariableEditorForm.d.ts.map +1 -1
  145. package/dist/components/Variables/VariableEditorForm/VariableEditorForm.js +395 -446
  146. package/dist/components/Variables/VariableEditorForm/VariableEditorForm.js.map +1 -1
  147. package/dist/components/Variables/VariableEditorForm/VariablePreview.d.ts +3 -2
  148. package/dist/components/Variables/VariableEditorForm/VariablePreview.d.ts.map +1 -1
  149. package/dist/components/Variables/VariableEditorForm/VariablePreview.js +7 -7
  150. package/dist/components/Variables/VariableEditorForm/VariablePreview.js.map +1 -1
  151. package/dist/components/Variables/VariableEditorForm/variable-editor-form-model.d.ts +2 -2
  152. package/dist/components/Variables/VariableEditorForm/variable-editor-form-model.d.ts.map +1 -1
  153. package/dist/components/Variables/VariableEditorForm/variable-editor-form-model.js +6 -11
  154. package/dist/components/Variables/VariableEditorForm/variable-editor-form-model.js.map +1 -1
  155. package/dist/components/Variables/variable-model.d.ts +2 -1
  156. package/dist/components/Variables/variable-model.d.ts.map +1 -1
  157. package/dist/components/Variables/variable-model.js +27 -28
  158. package/dist/components/Variables/variable-model.js.map +1 -1
  159. package/dist/components/index.d.ts +3 -1
  160. package/dist/components/index.d.ts.map +1 -1
  161. package/dist/components/index.js +3 -1
  162. package/dist/components/index.js.map +1 -1
  163. package/dist/context/ProjectStoreProvider.d.ts +4 -4
  164. package/dist/context/ProjectStoreProvider.d.ts.map +1 -1
  165. package/dist/context/ProjectStoreProvider.js +7 -4
  166. package/dist/context/ProjectStoreProvider.js.map +1 -1
  167. package/dist/context/ValidationProvider.d.ts +19 -0
  168. package/dist/context/ValidationProvider.d.ts.map +1 -0
  169. package/dist/context/ValidationProvider.js +52 -0
  170. package/dist/context/ValidationProvider.js.map +1 -0
  171. package/dist/context/index.d.ts +1 -0
  172. package/dist/context/index.d.ts.map +1 -1
  173. package/dist/context/index.js +1 -0
  174. package/dist/context/index.js.map +1 -1
  175. package/dist/context/query-params.d.ts.map +1 -1
  176. package/dist/context/query-params.js.map +1 -1
  177. package/dist/index.d.ts +1 -1
  178. package/dist/index.d.ts.map +1 -1
  179. package/dist/index.js +1 -1
  180. package/dist/index.js.map +1 -1
  181. package/dist/model/explore.d.ts +13 -0
  182. package/dist/model/explore.d.ts.map +1 -0
  183. package/dist/{validation/index.js → model/explore.js} +4 -6
  184. package/dist/model/explore.js.map +1 -0
  185. package/dist/model/legend.d.ts.map +1 -1
  186. package/dist/model/legend.js.map +1 -1
  187. package/dist/model/panels.d.ts +27 -5
  188. package/dist/model/panels.d.ts.map +1 -1
  189. package/dist/model/panels.js.map +1 -1
  190. package/dist/model/plugin-loading.js.map +1 -1
  191. package/dist/model/plugins.d.ts +31 -17
  192. package/dist/model/plugins.d.ts.map +1 -1
  193. package/dist/model/plugins.js.map +1 -1
  194. package/dist/model/time-series-queries.d.ts +2 -1
  195. package/dist/model/time-series-queries.d.ts.map +1 -1
  196. package/dist/model/time-series-queries.js.map +1 -1
  197. package/dist/remote/PersesPlugin.types.d.ts +7 -0
  198. package/dist/remote/PersesPlugin.types.d.ts.map +1 -0
  199. package/dist/{stories/shared-utils/index.js → remote/PersesPlugin.types.js} +3 -3
  200. package/dist/remote/PersesPlugin.types.js.map +1 -0
  201. package/dist/remote/PluginLoaderComponent.d.ts +10 -0
  202. package/dist/remote/PluginLoaderComponent.d.ts.map +1 -0
  203. package/dist/remote/PluginLoaderComponent.js +67 -0
  204. package/dist/remote/PluginLoaderComponent.js.map +1 -0
  205. package/dist/remote/PluginRuntime.d.ts +10 -0
  206. package/dist/remote/PluginRuntime.d.ts.map +1 -0
  207. package/dist/remote/PluginRuntime.js +211 -0
  208. package/dist/remote/PluginRuntime.js.map +1 -0
  209. package/dist/remote/index.d.ts +3 -0
  210. package/dist/remote/index.d.ts.map +1 -0
  211. package/dist/{components/TraceQueryEditor → remote}/index.js +2 -1
  212. package/dist/remote/index.js.map +1 -0
  213. package/dist/remote/remotePluginLoader.d.ts +3 -0
  214. package/dist/remote/remotePluginLoader.d.ts.map +1 -0
  215. package/dist/remote/remotePluginLoader.js +53 -0
  216. package/dist/remote/remotePluginLoader.js.map +1 -0
  217. package/dist/runtime/DataQueriesProvider/DataQueriesProvider.d.ts +2 -2
  218. package/dist/runtime/DataQueriesProvider/DataQueriesProvider.d.ts.map +1 -1
  219. package/dist/runtime/DataQueriesProvider/DataQueriesProvider.js +18 -9
  220. package/dist/runtime/DataQueriesProvider/DataQueriesProvider.js.map +1 -1
  221. package/dist/runtime/DataQueriesProvider/model.d.ts +5 -6
  222. package/dist/runtime/DataQueriesProvider/model.d.ts.map +1 -1
  223. package/dist/runtime/DataQueriesProvider/model.js +10 -9
  224. package/dist/runtime/DataQueriesProvider/model.js.map +1 -1
  225. package/dist/runtime/QueryCountProvider.d.ts +9 -0
  226. package/dist/runtime/QueryCountProvider.d.ts.map +1 -0
  227. package/dist/{validation/duration.js → runtime/QueryCountProvider.js} +13 -4
  228. package/dist/runtime/QueryCountProvider.js.map +1 -0
  229. package/dist/runtime/TimeRangeProvider/TimeRangeProvider.d.ts +2 -2
  230. package/dist/runtime/TimeRangeProvider/TimeRangeProvider.d.ts.map +1 -1
  231. package/dist/runtime/TimeRangeProvider/TimeRangeProvider.js +17 -4
  232. package/dist/runtime/TimeRangeProvider/TimeRangeProvider.js.map +1 -1
  233. package/dist/runtime/TimeRangeProvider/TimeRangeProviderWithQueryParams.d.ts +2 -2
  234. package/dist/runtime/TimeRangeProvider/TimeRangeProviderWithQueryParams.d.ts.map +1 -1
  235. package/dist/runtime/TimeRangeProvider/TimeRangeProviderWithQueryParams.js.map +1 -1
  236. package/dist/runtime/TimeRangeProvider/TimeRangeSettingsProvider.d.ts +32 -0
  237. package/dist/runtime/TimeRangeProvider/TimeRangeSettingsProvider.d.ts.map +1 -0
  238. package/dist/runtime/TimeRangeProvider/TimeRangeSettingsProvider.js +82 -0
  239. package/dist/runtime/TimeRangeProvider/TimeRangeSettingsProvider.js.map +1 -0
  240. package/dist/runtime/TimeRangeProvider/index.d.ts +1 -0
  241. package/dist/runtime/TimeRangeProvider/index.d.ts.map +1 -1
  242. package/dist/runtime/TimeRangeProvider/index.js +2 -1
  243. package/dist/runtime/TimeRangeProvider/index.js.map +1 -1
  244. package/dist/runtime/TimeRangeProvider/query-params.d.ts.map +1 -1
  245. package/dist/runtime/TimeRangeProvider/query-params.js +4 -7
  246. package/dist/runtime/TimeRangeProvider/query-params.js.map +1 -1
  247. package/dist/runtime/TimeRangeProvider/refresh-interval.d.ts.map +1 -1
  248. package/dist/runtime/TimeRangeProvider/refresh-interval.js.map +1 -1
  249. package/dist/runtime/UsageMetricsProvider.d.ts +25 -0
  250. package/dist/runtime/UsageMetricsProvider.d.ts.map +1 -0
  251. package/dist/runtime/UsageMetricsProvider.js +77 -0
  252. package/dist/runtime/UsageMetricsProvider.js.map +1 -0
  253. package/dist/runtime/builtin-variables.d.ts +1 -1
  254. package/dist/runtime/builtin-variables.d.ts.map +1 -1
  255. package/dist/runtime/builtin-variables.js +2 -2
  256. package/dist/runtime/builtin-variables.js.map +1 -1
  257. package/dist/runtime/datasources.d.ts +5 -4
  258. package/dist/runtime/datasources.d.ts.map +1 -1
  259. package/dist/runtime/datasources.js +23 -14
  260. package/dist/runtime/datasources.js.map +1 -1
  261. package/dist/runtime/index.d.ts +3 -1
  262. package/dist/runtime/index.d.ts.map +1 -1
  263. package/dist/runtime/index.js +4 -2
  264. package/dist/runtime/index.js.map +1 -1
  265. package/dist/runtime/plugin-registry.d.ts +10 -10
  266. package/dist/runtime/plugin-registry.d.ts.map +1 -1
  267. package/dist/runtime/plugin-registry.js +49 -28
  268. package/dist/runtime/plugin-registry.js.map +1 -1
  269. package/dist/runtime/time-series-queries.d.ts +5 -4
  270. package/dist/runtime/time-series-queries.d.ts.map +1 -1
  271. package/dist/runtime/time-series-queries.js +23 -28
  272. package/dist/runtime/time-series-queries.js.map +1 -1
  273. package/dist/runtime/trace-queries.d.ts +4 -3
  274. package/dist/runtime/trace-queries.d.ts.map +1 -1
  275. package/dist/runtime/trace-queries.js +2 -3
  276. package/dist/runtime/trace-queries.js.map +1 -1
  277. package/dist/runtime/{template-variables.d.ts → variables.d.ts} +4 -4
  278. package/dist/runtime/variables.d.ts.map +1 -0
  279. package/dist/runtime/{template-variables.js → variables.js} +28 -45
  280. package/dist/runtime/variables.js.map +1 -0
  281. package/dist/test/mock-data.d.ts.map +1 -1
  282. package/dist/test/mock-data.js +25 -4
  283. package/dist/test/mock-data.js.map +1 -1
  284. package/dist/test/render.d.ts +3 -3
  285. package/dist/test/render.d.ts.map +1 -1
  286. package/dist/test/render.js +2 -11
  287. package/dist/test/render.js.map +1 -1
  288. package/dist/test/test-plugins/bert/index.d.ts.map +1 -1
  289. package/dist/test/test-plugins/bert/index.js +20 -19
  290. package/dist/test/test-plugins/bert/index.js.map +1 -1
  291. package/dist/test-utils/mock-plugin-registry.d.ts +5 -3
  292. package/dist/test-utils/mock-plugin-registry.d.ts.map +1 -1
  293. package/dist/test-utils/mock-plugin-registry.js +10 -10
  294. package/dist/test-utils/mock-plugin-registry.js.map +1 -1
  295. package/dist/utils/variables.d.ts +4 -4
  296. package/dist/utils/variables.d.ts.map +1 -1
  297. package/dist/utils/variables.js +19 -19
  298. package/dist/utils/variables.js.map +1 -1
  299. package/package.json +10 -11
  300. package/dist/cjs/components/TraceQueryEditor/TraceQueryEditor.js +0 -143
  301. package/dist/cjs/components/TraceQueryEditor/TraceQueryInput.js +0 -96
  302. package/dist/cjs/stories/shared-utils/decorators/WithDataQueries.js +0 -41
  303. package/dist/cjs/stories/shared-utils/decorators/WithPluginSystemBuiltinVariables.js +0 -42
  304. package/dist/cjs/stories/shared-utils/decorators/WithPluginSystemDatasourceStore.js +0 -101
  305. package/dist/cjs/stories/shared-utils/decorators/WithPluginSystemTemplateVariables.js +0 -42
  306. package/dist/cjs/stories/shared-utils/decorators/WithTimeRange.js +0 -41
  307. package/dist/cjs/stories/shared-utils/decorators/index.js +0 -35
  308. package/dist/cjs/validation/datasource.js +0 -30
  309. package/dist/cjs/validation/duration.js +0 -25
  310. package/dist/cjs/validation/resource.js +0 -24
  311. package/dist/cjs/validation/role.js +0 -86
  312. package/dist/cjs/validation/rolebinding.js +0 -55
  313. package/dist/cjs/validation/secret.js +0 -176
  314. package/dist/cjs/validation/user.js +0 -46
  315. package/dist/cjs/validation/variable.js +0 -48
  316. package/dist/components/TimeSeriesQueryEditor/TimeSeriesQueryEditor.d.ts +0 -7
  317. package/dist/components/TimeSeriesQueryEditor/TimeSeriesQueryEditor.d.ts.map +0 -1
  318. package/dist/components/TimeSeriesQueryEditor/TimeSeriesQueryEditor.js.map +0 -1
  319. package/dist/components/TimeSeriesQueryEditor/TimeSeriesQueryInput.d.ts +0 -12
  320. package/dist/components/TimeSeriesQueryEditor/TimeSeriesQueryInput.d.ts.map +0 -1
  321. package/dist/components/TimeSeriesQueryEditor/TimeSeriesQueryInput.js +0 -83
  322. package/dist/components/TimeSeriesQueryEditor/TimeSeriesQueryInput.js.map +0 -1
  323. package/dist/components/TimeSeriesQueryEditor/index.d.ts +0 -2
  324. package/dist/components/TimeSeriesQueryEditor/index.d.ts.map +0 -1
  325. package/dist/components/TimeSeriesQueryEditor/index.js.map +0 -1
  326. package/dist/components/TraceQueryEditor/TraceQueryEditor.d.ts +0 -8
  327. package/dist/components/TraceQueryEditor/TraceQueryEditor.d.ts.map +0 -1
  328. package/dist/components/TraceQueryEditor/TraceQueryEditor.js +0 -130
  329. package/dist/components/TraceQueryEditor/TraceQueryEditor.js.map +0 -1
  330. package/dist/components/TraceQueryEditor/TraceQueryInput.d.ts +0 -12
  331. package/dist/components/TraceQueryEditor/TraceQueryInput.d.ts.map +0 -1
  332. package/dist/components/TraceQueryEditor/TraceQueryInput.js.map +0 -1
  333. package/dist/components/TraceQueryEditor/index.d.ts +0 -2
  334. package/dist/components/TraceQueryEditor/index.d.ts.map +0 -1
  335. package/dist/runtime/template-variables.d.ts.map +0 -1
  336. package/dist/runtime/template-variables.js.map +0 -1
  337. package/dist/stories/shared-utils/decorators/WithDataQueries.d.ts +0 -12
  338. package/dist/stories/shared-utils/decorators/WithDataQueries.d.ts.map +0 -1
  339. package/dist/stories/shared-utils/decorators/WithDataQueries.js +0 -33
  340. package/dist/stories/shared-utils/decorators/WithDataQueries.js.map +0 -1
  341. package/dist/stories/shared-utils/decorators/WithPluginRegistry.d.ts +0 -3
  342. package/dist/stories/shared-utils/decorators/WithPluginRegistry.d.ts.map +0 -1
  343. package/dist/stories/shared-utils/decorators/WithPluginRegistry.js +0 -46
  344. package/dist/stories/shared-utils/decorators/WithPluginRegistry.js.map +0 -1
  345. package/dist/stories/shared-utils/decorators/WithPluginSystemBuiltinVariables.d.ts +0 -12
  346. package/dist/stories/shared-utils/decorators/WithPluginSystemBuiltinVariables.d.ts.map +0 -1
  347. package/dist/stories/shared-utils/decorators/WithPluginSystemBuiltinVariables.js +0 -39
  348. package/dist/stories/shared-utils/decorators/WithPluginSystemBuiltinVariables.js.map +0 -1
  349. package/dist/stories/shared-utils/decorators/WithPluginSystemDatasourceStore.d.ts +0 -12
  350. package/dist/stories/shared-utils/decorators/WithPluginSystemDatasourceStore.d.ts.map +0 -1
  351. package/dist/stories/shared-utils/decorators/WithPluginSystemDatasourceStore.js +0 -95
  352. package/dist/stories/shared-utils/decorators/WithPluginSystemDatasourceStore.js.map +0 -1
  353. package/dist/stories/shared-utils/decorators/WithPluginSystemTemplateVariables.d.ts +0 -12
  354. package/dist/stories/shared-utils/decorators/WithPluginSystemTemplateVariables.d.ts.map +0 -1
  355. package/dist/stories/shared-utils/decorators/WithPluginSystemTemplateVariables.js +0 -39
  356. package/dist/stories/shared-utils/decorators/WithPluginSystemTemplateVariables.js.map +0 -1
  357. package/dist/stories/shared-utils/decorators/WithTimeRange.d.ts +0 -12
  358. package/dist/stories/shared-utils/decorators/WithTimeRange.d.ts.map +0 -1
  359. package/dist/stories/shared-utils/decorators/WithTimeRange.js +0 -33
  360. package/dist/stories/shared-utils/decorators/WithTimeRange.js.map +0 -1
  361. package/dist/stories/shared-utils/decorators/index.d.ts +0 -7
  362. package/dist/stories/shared-utils/decorators/index.d.ts.map +0 -1
  363. package/dist/stories/shared-utils/decorators/index.js +0 -20
  364. package/dist/stories/shared-utils/decorators/index.js.map +0 -1
  365. package/dist/stories/shared-utils/index.d.ts +0 -2
  366. package/dist/stories/shared-utils/index.d.ts.map +0 -1
  367. package/dist/stories/shared-utils/index.js.map +0 -1
  368. package/dist/validation/datasource.d.ts +0 -19
  369. package/dist/validation/datasource.d.ts.map +0 -1
  370. package/dist/validation/datasource.js +0 -22
  371. package/dist/validation/datasource.js.map +0 -1
  372. package/dist/validation/duration.d.ts +0 -3
  373. package/dist/validation/duration.d.ts.map +0 -1
  374. package/dist/validation/duration.js.map +0 -1
  375. package/dist/validation/index.d.ts +0 -6
  376. package/dist/validation/index.d.ts.map +0 -1
  377. package/dist/validation/index.js.map +0 -1
  378. package/dist/validation/resource.d.ts +0 -3
  379. package/dist/validation/resource.d.ts.map +0 -1
  380. package/dist/validation/resource.js +0 -16
  381. package/dist/validation/resource.js.map +0 -1
  382. package/dist/validation/role.d.ts +0 -228
  383. package/dist/validation/role.d.ts.map +0 -1
  384. package/dist/validation/role.js +0 -67
  385. package/dist/validation/role.js.map +0 -1
  386. package/dist/validation/rolebinding.d.ts +0 -137
  387. package/dist/validation/rolebinding.d.ts.map +0 -1
  388. package/dist/validation/rolebinding.js +0 -47
  389. package/dist/validation/rolebinding.js.map +0 -1
  390. package/dist/validation/secret.d.ts +0 -964
  391. package/dist/validation/secret.d.ts.map +0 -1
  392. package/dist/validation/secret.js +0 -157
  393. package/dist/validation/secret.js.map +0 -1
  394. package/dist/validation/user.d.ts +0 -93
  395. package/dist/validation/user.d.ts.map +0 -1
  396. package/dist/validation/user.js +0 -38
  397. package/dist/validation/user.js.map +0 -1
  398. package/dist/validation/variable.d.ts +0 -96
  399. package/dist/validation/variable.d.ts.map +0 -1
  400. package/dist/validation/variable.js +0 -40
  401. package/dist/validation/variable.js.map +0 -1
@@ -1,6 +1,6 @@
1
1
  import { UseQueryResult } from '@tanstack/react-query';
2
- import { ReactNode } from 'react';
3
- import { ProjectResource } from '@perses-dev/core';
2
+ import { ReactNode, ReactElement } from 'react';
3
+ import { ProjectResource, StatusError } from '@perses-dev/core';
4
4
  export interface ProjectStore {
5
5
  setProject: (project: ProjectResource) => void;
6
6
  project: ProjectResource;
@@ -10,7 +10,7 @@ export interface ProjectStoreProviderProps {
10
10
  enabledURLParams?: boolean;
11
11
  }
12
12
  export declare const ProjectStoreContext: import("react").Context<ProjectStore | undefined>;
13
- export declare function useProjectList(): UseQueryResult<ProjectResource[], Error>;
13
+ export declare function useProjectList(): UseQueryResult<ProjectResource[], StatusError>;
14
14
  export declare function useProjectStore(): ProjectStore;
15
- export declare function ProjectStoreProvider(props: ProjectStoreProviderProps): import("react/jsx-runtime").JSX.Element;
15
+ export declare function ProjectStoreProvider(props: ProjectStoreProviderProps): ReactElement;
16
16
  //# sourceMappingURL=ProjectStoreProvider.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"ProjectStoreProvider.d.ts","sourceRoot":"","sources":["../../src/context/ProjectStoreProvider.tsx"],"names":[],"mappings":"AAaA,OAAO,EAAY,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACjE,OAAO,EAAE,SAAS,EAAsC,MAAM,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,10 +17,13 @@ import { fetchJson } from '@perses-dev/core';
17
17
  import { useSetProjectParams } from './query-params';
18
18
  export const ProjectStoreContext = /*#__PURE__*/ createContext(undefined);
19
19
  export function useProjectList() {
20
- return useQuery([
21
- 'projects'
22
- ], ()=>{
23
- return fetchJson('/api/v1/projects');
20
+ return useQuery({
21
+ queryKey: [
22
+ 'projects'
23
+ ],
24
+ queryFn: ()=>{
25
+ return fetchJson('/api/v1/projects');
26
+ }
24
27
  });
25
28
  }
26
29
  export function useProjectStore() {
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/context/ProjectStoreProvider.tsx"],"sourcesContent":["// Copyright 2023 The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport { useQuery, UseQueryResult } from '@tanstack/react-query';\nimport { ReactNode, createContext, useContext, useMemo } from 'react';\nimport { fetchJson, ProjectResource } from '@perses-dev/core';\nimport { useSetProjectParams } from './query-params';\n\nexport interface ProjectStore {\n setProject: (project: ProjectResource) => void;\n project: ProjectResource;\n}\n\nexport interface ProjectStoreProviderProps {\n children?: ReactNode;\n enabledURLParams?: boolean;\n}\n\nexport const ProjectStoreContext = createContext<ProjectStore | undefined>(undefined);\n\nexport function useProjectList(): UseQueryResult<ProjectResource[], Error> {\n return useQuery<ProjectResource[], Error>(['projects'], () => {\n return fetchJson<ProjectResource[]>('/api/v1/projects');\n });\n}\n\nexport function useProjectStore() {\n const ctx = useContext(ProjectStoreContext);\n if (ctx === undefined) {\n throw new Error('No ProjectStoreContext found. Did you forget a Provider?');\n }\n return ctx;\n}\n\nexport function ProjectStoreProvider(props: ProjectStoreProviderProps) {\n const { children, enabledURLParams } = props;\n const { project, setProject } = useSetProjectParams(enabledURLParams);\n\n const contextValue = useMemo(\n () => ({\n project: {\n kind: 'Project',\n metadata: {\n name: project,\n },\n } as ProjectResource,\n setProject: (project: ProjectResource) => {\n setProject(project.metadata.name);\n },\n }),\n [project, setProject]\n );\n\n return <ProjectStoreContext.Provider value={contextValue}>{children}</ProjectStoreContext.Provider>;\n}\n"],"names":["useQuery","createContext","useContext","useMemo","fetchJson","useSetProjectParams","ProjectStoreContext","undefined","useProjectList","useProjectStore","ctx","Error","ProjectStoreProvider","props","children","enabledURLParams","project","setProject","contextValue","kind","metadata","name","Provider","value"],"mappings":"AAAA,oCAAoC;AACpC,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;;AAEjC,SAASA,QAAQ,QAAwB,wBAAwB;AACjE,SAAoBC,aAAa,EAAEC,UAAU,EAAEC,OAAO,QAAQ,QAAQ;AACtE,SAASC,SAAS,QAAyB,mBAAmB;AAC9D,SAASC,mBAAmB,QAAQ,iBAAiB;AAYrD,OAAO,MAAMC,oCAAsBL,cAAwCM,WAAW;AAEtF,OAAO,SAASC;IACd,OAAOR,SAAmC;QAAC;KAAW,EAAE;QACtD,OAAOI,UAA6B;IACtC;AACF;AAEA,OAAO,SAASK;IACd,MAAMC,MAAMR,WAAWI;IACvB,IAAII,QAAQH,WAAW;QACrB,MAAM,IAAII,MAAM;IAClB;IACA,OAAOD;AACT;AAEA,OAAO,SAASE,qBAAqBC,KAAgC;IACnE,MAAM,EAAEC,QAAQ,EAAEC,gBAAgB,EAAE,GAAGF;IACvC,MAAM,EAAEG,OAAO,EAAEC,UAAU,EAAE,GAAGZ,oBAAoBU;IAEpD,MAAMG,eAAef,QACnB,IAAO,CAAA;YACLa,SAAS;gBACPG,MAAM;gBACNC,UAAU;oBACRC,MAAML;gBACR;YACF;YACAC,YAAY,CAACD;gBACXC,WAAWD,QAAQI,QAAQ,CAACC,IAAI;YAClC;QACF,CAAA,GACA;QAACL;QAASC;KAAW;IAGvB,qBAAO,KAACX,oBAAoBgB,QAAQ;QAACC,OAAOL;kBAAeJ;;AAC7D"}
1
+ {"version":3,"sources":["../../src/context/ProjectStoreProvider.tsx"],"sourcesContent":["// Copyright 2023 The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport { useQuery, UseQueryResult } from '@tanstack/react-query';\nimport { ReactNode, createContext, useContext, useMemo, ReactElement } from 'react';\nimport { fetchJson, ProjectResource, StatusError } from '@perses-dev/core';\nimport { useSetProjectParams } from './query-params';\n\nexport interface ProjectStore {\n setProject: (project: ProjectResource) => void;\n project: ProjectResource;\n}\n\nexport interface ProjectStoreProviderProps {\n children?: ReactNode;\n enabledURLParams?: boolean;\n}\n\nexport const ProjectStoreContext = createContext<ProjectStore | undefined>(undefined);\n\nexport function useProjectList(): UseQueryResult<ProjectResource[], StatusError> {\n return useQuery<ProjectResource[], StatusError>({\n queryKey: ['projects'],\n queryFn: () => {\n return fetchJson<ProjectResource[]>('/api/v1/projects');\n },\n });\n}\n\nexport function useProjectStore(): ProjectStore {\n const ctx = useContext(ProjectStoreContext);\n if (ctx === undefined) {\n throw new Error('No ProjectStoreContext found. Did you forget a Provider?');\n }\n return ctx;\n}\n\nexport function ProjectStoreProvider(props: ProjectStoreProviderProps): ReactElement {\n const { children, enabledURLParams } = props;\n const { project, setProject } = useSetProjectParams(enabledURLParams);\n\n const contextValue = useMemo(\n () => ({\n project: {\n kind: 'Project',\n metadata: {\n name: project,\n },\n } as ProjectResource,\n setProject: (project: ProjectResource): void => {\n setProject(project.metadata.name);\n },\n }),\n [project, setProject]\n );\n\n return <ProjectStoreContext.Provider value={contextValue}>{children}</ProjectStoreContext.Provider>;\n}\n"],"names":["useQuery","createContext","useContext","useMemo","fetchJson","useSetProjectParams","ProjectStoreContext","undefined","useProjectList","queryKey","queryFn","useProjectStore","ctx","Error","ProjectStoreProvider","props","children","enabledURLParams","project","setProject","contextValue","kind","metadata","name","Provider","value"],"mappings":"AAAA,oCAAoC;AACpC,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;;AAEjC,SAASA,QAAQ,QAAwB,wBAAwB;AACjE,SAAoBC,aAAa,EAAEC,UAAU,EAAEC,OAAO,QAAsB,QAAQ;AACpF,SAASC,SAAS,QAAsC,mBAAmB;AAC3E,SAASC,mBAAmB,QAAQ,iBAAiB;AAYrD,OAAO,MAAMC,oCAAsBL,cAAwCM,WAAW;AAEtF,OAAO,SAASC;IACd,OAAOR,SAAyC;QAC9CS,UAAU;YAAC;SAAW;QACtBC,SAAS;YACP,OAAON,UAA6B;QACtC;IACF;AACF;AAEA,OAAO,SAASO;IACd,MAAMC,MAAMV,WAAWI;IACvB,IAAIM,QAAQL,WAAW;QACrB,MAAM,IAAIM,MAAM;IAClB;IACA,OAAOD;AACT;AAEA,OAAO,SAASE,qBAAqBC,KAAgC;IACnE,MAAM,EAAEC,QAAQ,EAAEC,gBAAgB,EAAE,GAAGF;IACvC,MAAM,EAAEG,OAAO,EAAEC,UAAU,EAAE,GAAGd,oBAAoBY;IAEpD,MAAMG,eAAejB,QACnB,IAAO,CAAA;YACLe,SAAS;gBACPG,MAAM;gBACNC,UAAU;oBACRC,MAAML;gBACR;YACF;YACAC,YAAY,CAACD;gBACXC,WAAWD,QAAQI,QAAQ,CAACC,IAAI;YAClC;QACF,CAAA,GACA;QAACL;QAASC;KAAW;IAGvB,qBAAO,KAACb,oBAAoBkB,QAAQ;QAACC,OAAOL;kBAAeJ;;AAC7D"}
@@ -0,0 +1,19 @@
1
+ import { ReactElement, ReactNode } from 'react';
2
+ import { DatasourceDefinition, PanelEditorValues, VariableDefinition, PluginSchema } from '@perses-dev/core';
3
+ import { z } from 'zod';
4
+ export interface ValidationSchemas {
5
+ datasourceEditorSchema: z.Schema<DatasourceDefinition>;
6
+ panelEditorSchema: z.Schema<PanelEditorValues>;
7
+ variableEditorSchema: z.Schema<VariableDefinition>;
8
+ setDatasourceEditorSchemaPlugin: (pluginSchema: PluginSchema) => void;
9
+ setPanelEditorSchemaPlugin: (pluginSchema: PluginSchema) => void;
10
+ setVariableEditorSchemaPlugin: (pluginSchema: PluginSchema) => void;
11
+ }
12
+ export declare const ValidationSchemasContext: import("react").Context<ValidationSchemas | undefined>;
13
+ export declare function useValidationSchemas(): ValidationSchemas;
14
+ interface ValidationProviderProps {
15
+ children: ReactNode;
16
+ }
17
+ export declare function ValidationProvider({ children }: ValidationProviderProps): ReactElement;
18
+ export {};
19
+ //# sourceMappingURL=ValidationProvider.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ValidationProvider.d.ts","sourceRoot":"","sources":["../../src/context/ValidationProvider.tsx"],"names":[],"mappings":"AAaA,OAAO,EAAiB,YAAY,EAAE,SAAS,EAAwB,MAAM,OAAO,CAAC;AACrF,OAAO,EACL,oBAAoB,EACpB,iBAAiB,EACjB,kBAAkB,EAClB,YAAY,EAOb,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,MAAM,WAAW,iBAAiB;IAChC,sBAAsB,EAAE,CAAC,CAAC,MAAM,CAAC,oBAAoB,CAAC,CAAC;IACvD,iBAAiB,EAAE,CAAC,CAAC,MAAM,CAAC,iBAAiB,CAAC,CAAC;IAC/C,oBAAoB,EAAE,CAAC,CAAC,MAAM,CAAC,kBAAkB,CAAC,CAAC;IACnD,+BAA+B,EAAE,CAAC,YAAY,EAAE,YAAY,KAAK,IAAI,CAAC;IACtE,0BAA0B,EAAE,CAAC,YAAY,EAAE,YAAY,KAAK,IAAI,CAAC;IACjE,6BAA6B,EAAE,CAAC,YAAY,EAAE,YAAY,KAAK,IAAI,CAAC;CACrE;AAED,eAAO,MAAM,wBAAwB,wDAA0D,CAAC;AAEhG,wBAAgB,oBAAoB,IAAI,iBAAiB,CAMxD;AAED,UAAU,uBAAuB;IAC/B,QAAQ,EAAE,SAAS,CAAC;CACrB;AAKD,wBAAgB,kBAAkB,CAAC,EAAE,QAAQ,EAAE,EAAE,uBAAuB,GAAG,YAAY,CAiCtF"}
@@ -0,0 +1,52 @@
1
+ // Copyright 2024 The Perses Authors
2
+ // Licensed under the Apache License, Version 2.0 (the "License");
3
+ // you may not use this file except in compliance with the License.
4
+ // You may obtain a copy of the License at
5
+ //
6
+ // http://www.apache.org/licenses/LICENSE-2.0
7
+ //
8
+ // Unless required by applicable law or agreed to in writing, software
9
+ // distributed under the License is distributed on an "AS IS" BASIS,
10
+ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11
+ // See the License for the specific language governing permissions and
12
+ // limitations under the License.
13
+ import { jsx as _jsx } from "react/jsx-runtime";
14
+ import { createContext, useContext, useState } from 'react';
15
+ import { datasourceDefinitionSchema, panelEditorSchema as defaultPanelEditorSchema, variableDefinitionSchema, buildDatasourceDefinitionSchema, buildPanelEditorSchema, buildVariableDefinitionSchema } from '@perses-dev/core';
16
+ export const ValidationSchemasContext = /*#__PURE__*/ createContext(undefined);
17
+ export function useValidationSchemas() {
18
+ const ctx = useContext(ValidationSchemasContext);
19
+ if (ctx === undefined) {
20
+ throw new Error('No ValidationSchemasContext found. Did you forget a Provider?');
21
+ }
22
+ return ctx;
23
+ }
24
+ /*
25
+ * Provide validation schemas for forms handling plugins (datasources, variables, panels).
26
+ */ export function ValidationProvider({ children }) {
27
+ const [datasourceEditorSchema, setDatasourceEditorSchema] = useState(datasourceDefinitionSchema);
28
+ const [panelEditorSchema, setPanelEditorSchema] = useState(defaultPanelEditorSchema);
29
+ const [variableEditorSchema, setVariableEditorSchema] = useState(variableDefinitionSchema);
30
+ function setDatasourceEditorSchemaPlugin(pluginSchema) {
31
+ setDatasourceEditorSchema(buildDatasourceDefinitionSchema(pluginSchema));
32
+ }
33
+ function setPanelEditorSchemaPlugin(pluginSchema) {
34
+ setPanelEditorSchema(buildPanelEditorSchema(pluginSchema));
35
+ }
36
+ function setVariableEditorSchemaPlugin(pluginSchema) {
37
+ setVariableEditorSchema(buildVariableDefinitionSchema(pluginSchema));
38
+ }
39
+ return /*#__PURE__*/ _jsx(ValidationSchemasContext.Provider, {
40
+ value: {
41
+ datasourceEditorSchema,
42
+ panelEditorSchema,
43
+ variableEditorSchema,
44
+ setDatasourceEditorSchemaPlugin,
45
+ setPanelEditorSchemaPlugin,
46
+ setVariableEditorSchemaPlugin
47
+ },
48
+ children: children
49
+ });
50
+ }
51
+
52
+ //# sourceMappingURL=ValidationProvider.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/context/ValidationProvider.tsx"],"sourcesContent":["// Copyright 2024 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, ReactNode, useContext, useState } from 'react';\nimport {\n DatasourceDefinition,\n PanelEditorValues,\n VariableDefinition,\n PluginSchema,\n datasourceDefinitionSchema,\n panelEditorSchema as defaultPanelEditorSchema,\n variableDefinitionSchema,\n buildDatasourceDefinitionSchema,\n buildPanelEditorSchema,\n buildVariableDefinitionSchema,\n} from '@perses-dev/core';\nimport { z } from 'zod';\n\nexport interface ValidationSchemas {\n datasourceEditorSchema: z.Schema<DatasourceDefinition>;\n panelEditorSchema: z.Schema<PanelEditorValues>;\n variableEditorSchema: z.Schema<VariableDefinition>;\n setDatasourceEditorSchemaPlugin: (pluginSchema: PluginSchema) => void;\n setPanelEditorSchemaPlugin: (pluginSchema: PluginSchema) => void;\n setVariableEditorSchemaPlugin: (pluginSchema: PluginSchema) => void;\n}\n\nexport const ValidationSchemasContext = createContext<ValidationSchemas | undefined>(undefined);\n\nexport function useValidationSchemas(): ValidationSchemas {\n const ctx = useContext(ValidationSchemasContext);\n if (ctx === undefined) {\n throw new Error('No ValidationSchemasContext found. Did you forget a Provider?');\n }\n return ctx;\n}\n\ninterface ValidationProviderProps {\n children: ReactNode;\n}\n\n/*\n * Provide validation schemas for forms handling plugins (datasources, variables, panels).\n */\nexport function ValidationProvider({ children }: ValidationProviderProps): ReactElement {\n const [datasourceEditorSchema, setDatasourceEditorSchema] =\n useState<z.Schema<DatasourceDefinition>>(datasourceDefinitionSchema);\n const [panelEditorSchema, setPanelEditorSchema] = useState<z.Schema<PanelEditorValues>>(defaultPanelEditorSchema);\n const [variableEditorSchema, setVariableEditorSchema] =\n useState<z.Schema<VariableDefinition>>(variableDefinitionSchema);\n\n function setDatasourceEditorSchemaPlugin(pluginSchema: PluginSchema): void {\n setDatasourceEditorSchema(buildDatasourceDefinitionSchema(pluginSchema));\n }\n\n function setPanelEditorSchemaPlugin(pluginSchema: PluginSchema): void {\n setPanelEditorSchema(buildPanelEditorSchema(pluginSchema));\n }\n\n function setVariableEditorSchemaPlugin(pluginSchema: PluginSchema): void {\n setVariableEditorSchema(buildVariableDefinitionSchema(pluginSchema));\n }\n\n return (\n <ValidationSchemasContext.Provider\n value={{\n datasourceEditorSchema,\n panelEditorSchema,\n variableEditorSchema,\n setDatasourceEditorSchemaPlugin,\n setPanelEditorSchemaPlugin,\n setVariableEditorSchemaPlugin,\n }}\n >\n {children}\n </ValidationSchemasContext.Provider>\n );\n}\n"],"names":["createContext","useContext","useState","datasourceDefinitionSchema","panelEditorSchema","defaultPanelEditorSchema","variableDefinitionSchema","buildDatasourceDefinitionSchema","buildPanelEditorSchema","buildVariableDefinitionSchema","ValidationSchemasContext","undefined","useValidationSchemas","ctx","Error","ValidationProvider","children","datasourceEditorSchema","setDatasourceEditorSchema","setPanelEditorSchema","variableEditorSchema","setVariableEditorSchema","setDatasourceEditorSchemaPlugin","pluginSchema","setPanelEditorSchemaPlugin","setVariableEditorSchemaPlugin","Provider","value"],"mappings":"AAAA,oCAAoC;AACpC,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;;AAEjC,SAASA,aAAa,EAA2BC,UAAU,EAAEC,QAAQ,QAAQ,QAAQ;AACrF,SAKEC,0BAA0B,EAC1BC,qBAAqBC,wBAAwB,EAC7CC,wBAAwB,EACxBC,+BAA+B,EAC/BC,sBAAsB,EACtBC,6BAA6B,QACxB,mBAAmB;AAY1B,OAAO,MAAMC,yCAA2BV,cAA6CW,WAAW;AAEhG,OAAO,SAASC;IACd,MAAMC,MAAMZ,WAAWS;IACvB,IAAIG,QAAQF,WAAW;QACrB,MAAM,IAAIG,MAAM;IAClB;IACA,OAAOD;AACT;AAMA;;CAEC,GACD,OAAO,SAASE,mBAAmB,EAAEC,QAAQ,EAA2B;IACtE,MAAM,CAACC,wBAAwBC,0BAA0B,GACvDhB,SAAyCC;IAC3C,MAAM,CAACC,mBAAmBe,qBAAqB,GAAGjB,SAAsCG;IACxF,MAAM,CAACe,sBAAsBC,wBAAwB,GACnDnB,SAAuCI;IAEzC,SAASgB,gCAAgCC,YAA0B;QACjEL,0BAA0BX,gCAAgCgB;IAC5D;IAEA,SAASC,2BAA2BD,YAA0B;QAC5DJ,qBAAqBX,uBAAuBe;IAC9C;IAEA,SAASE,8BAA8BF,YAA0B;QAC/DF,wBAAwBZ,8BAA8Bc;IACxD;IAEA,qBACE,KAACb,yBAAyBgB,QAAQ;QAChCC,OAAO;YACLV;YACAb;YACAgB;YACAE;YACAE;YACAC;QACF;kBAECT;;AAGP"}
@@ -1,2 +1,3 @@
1
1
  export * from './ProjectStoreProvider';
2
+ export * from './ValidationProvider';
2
3
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/context/index.ts"],"names":[],"mappings":"AAaA,cAAc,wBAAwB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/context/index.ts"],"names":[],"mappings":"AAaA,cAAc,wBAAwB,CAAC;AACvC,cAAc,sBAAsB,CAAC"}
@@ -11,5 +11,6 @@
11
11
  // See the License for the specific language governing permissions and
12
12
  // limitations under the License.
13
13
  export * from './ProjectStoreProvider';
14
+ export * from './ValidationProvider';
14
15
 
15
16
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/context/index.ts"],"sourcesContent":["// Copyright 2023 The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nexport * from './ProjectStoreProvider';\n"],"names":[],"mappings":"AAAA,oCAAoC;AACpC,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAEjC,cAAc,yBAAyB"}
1
+ {"version":3,"sources":["../../src/context/index.ts"],"sourcesContent":["// Copyright 2023 The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nexport * from './ProjectStoreProvider';\nexport * from './ValidationProvider';\n"],"names":[],"mappings":"AAAA,oCAAoC;AACpC,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAEjC,cAAc,yBAAyB;AACvC,cAAc,uBAAuB"}
@@ -1 +1 @@
1
- {"version":3,"file":"query-params.d.ts","sourceRoot":"","sources":["../../src/context/query-params.ts"],"names":[],"mappings":"AAgBA,wBAAgB,mBAAmB,CAAC,gBAAgB,UAAO;;0BAM7C,MAAM;EAiBnB"}
1
+ {"version":3,"file":"query-params.d.ts","sourceRoot":"","sources":["../../src/context/query-params.ts"],"names":[],"mappings":"AAgBA,wBAAgB,mBAAmB,CAAC,gBAAgB,UAAO,GAAG;IAC5D,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC;CACvC,CAuBA"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/context/query-params.ts"],"sourcesContent":["// Copyright 2023 The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport { useCallback, useState } from 'react';\nimport { useQueryParams } from 'use-query-params';\n\nexport function useSetProjectParams(enabledURLParams = true) {\n const [query, setQuery] = useQueryParams({ project: '' }, { updateType: 'replaceIn' });\n\n const [projectState, setProjectState] = useState<string>('none');\n\n const setProject = useCallback(\n (project: string) => {\n return setQuery({ project });\n },\n [setQuery]\n );\n\n if (enabledURLParams) {\n return {\n project: query.project || 'none',\n setProject,\n };\n }\n\n return {\n project: projectState,\n setProject: setProjectState,\n };\n}\n"],"names":["useCallback","useState","useQueryParams","useSetProjectParams","enabledURLParams","query","setQuery","project","updateType","projectState","setProjectState","setProject"],"mappings":"AAAA,oCAAoC;AACpC,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAEjC,SAASA,WAAW,EAAEC,QAAQ,QAAQ,QAAQ;AAC9C,SAASC,cAAc,QAAQ,mBAAmB;AAElD,OAAO,SAASC,oBAAoBC,mBAAmB,IAAI;IACzD,MAAM,CAACC,OAAOC,SAAS,GAAGJ,eAAe;QAAEK,SAAS;IAAG,GAAG;QAAEC,YAAY;IAAY;IAEpF,MAAM,CAACC,cAAcC,gBAAgB,GAAGT,SAAiB;IAEzD,MAAMU,aAAaX,YACjB,CAACO;QACC,OAAOD,SAAS;YAAEC;QAAQ;IAC5B,GACA;QAACD;KAAS;IAGZ,IAAIF,kBAAkB;QACpB,OAAO;YACLG,SAASF,MAAME,OAAO,IAAI;YAC1BI;QACF;IACF;IAEA,OAAO;QACLJ,SAASE;QACTE,YAAYD;IACd;AACF"}
1
+ {"version":3,"sources":["../../src/context/query-params.ts"],"sourcesContent":["// Copyright 2023 The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport { useCallback, useState } from 'react';\nimport { useQueryParams } from 'use-query-params';\n\nexport function useSetProjectParams(enabledURLParams = true): {\n project: string;\n setProject: (project: string) => void;\n} {\n const [query, setQuery] = useQueryParams({ project: '' }, { updateType: 'replaceIn' });\n\n const [projectState, setProjectState] = useState<string>('none');\n\n const setProject = useCallback(\n (project: string) => {\n return setQuery({ project });\n },\n [setQuery]\n );\n\n if (enabledURLParams) {\n return {\n project: query.project || 'none',\n setProject,\n };\n }\n\n return {\n project: projectState,\n setProject: setProjectState,\n };\n}\n"],"names":["useCallback","useState","useQueryParams","useSetProjectParams","enabledURLParams","query","setQuery","project","updateType","projectState","setProjectState","setProject"],"mappings":"AAAA,oCAAoC;AACpC,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAEjC,SAASA,WAAW,EAAEC,QAAQ,QAAQ,QAAQ;AAC9C,SAASC,cAAc,QAAQ,mBAAmB;AAElD,OAAO,SAASC,oBAAoBC,mBAAmB,IAAI;IAIzD,MAAM,CAACC,OAAOC,SAAS,GAAGJ,eAAe;QAAEK,SAAS;IAAG,GAAG;QAAEC,YAAY;IAAY;IAEpF,MAAM,CAACC,cAAcC,gBAAgB,GAAGT,SAAiB;IAEzD,MAAMU,aAAaX,YACjB,CAACO;QACC,OAAOD,SAAS;YAAEC;QAAQ;IAC5B,GACA;QAACD;KAAS;IAGZ,IAAIF,kBAAkB;QACpB,OAAO;YACLG,SAASF,MAAME,OAAO,IAAI;YAC1BI;QACF;IACF;IAEA,OAAO;QACLJ,SAASE;QACTE,YAAYD;IACd;AACF"}
package/dist/index.d.ts CHANGED
@@ -4,6 +4,6 @@ export * from './model';
4
4
  export * from './runtime';
5
5
  export * from './test-utils';
6
6
  export * from './utils';
7
- export * from './validation';
8
7
  export * from './context';
8
+ export * from './remote';
9
9
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAaA,cAAc,cAAc,CAAC;AAC7B,cAAc,aAAa,CAAC;AAC5B,cAAc,SAAS,CAAC;AACxB,cAAc,WAAW,CAAC;AAC1B,cAAc,cAAc,CAAC;AAC7B,cAAc,SAAS,CAAC;AACxB,cAAc,cAAc,CAAC;AAC7B,cAAc,WAAW,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAaA,cAAc,cAAc,CAAC;AAC7B,cAAc,aAAa,CAAC;AAC5B,cAAc,SAAS,CAAC;AACxB,cAAc,WAAW,CAAC;AAC1B,cAAc,cAAc,CAAC;AAC7B,cAAc,SAAS,CAAC;AACxB,cAAc,WAAW,CAAC;AAC1B,cAAc,UAAU,CAAC"}
package/dist/index.js CHANGED
@@ -16,7 +16,7 @@ export * from './model';
16
16
  export * from './runtime';
17
17
  export * from './test-utils';
18
18
  export * from './utils';
19
- export * from './validation';
20
19
  export * from './context';
20
+ export * from './remote';
21
21
 
22
22
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/index.ts"],"sourcesContent":["// Copyright 2023 The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nexport * from './components';\nexport * from './constants';\nexport * from './model';\nexport * from './runtime';\nexport * from './test-utils';\nexport * from './utils';\nexport * from './validation';\nexport * from './context';\n"],"names":[],"mappings":"AAAA,oCAAoC;AACpC,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAEjC,cAAc,eAAe;AAC7B,cAAc,cAAc;AAC5B,cAAc,UAAU;AACxB,cAAc,YAAY;AAC1B,cAAc,eAAe;AAC7B,cAAc,UAAU;AACxB,cAAc,eAAe;AAC7B,cAAc,YAAY"}
1
+ {"version":3,"sources":["../src/index.ts"],"sourcesContent":["// Copyright 2023 The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nexport * from './components';\nexport * from './constants';\nexport * from './model';\nexport * from './runtime';\nexport * from './test-utils';\nexport * from './utils';\nexport * from './context';\nexport * from './remote';\n"],"names":[],"mappings":"AAAA,oCAAoC;AACpC,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAEjC,cAAc,eAAe;AAC7B,cAAc,cAAc;AAC5B,cAAc,UAAU;AACxB,cAAc,YAAY;AAC1B,cAAc,eAAe;AAC7B,cAAc,UAAU;AACxB,cAAc,YAAY;AAC1B,cAAc,WAAW"}
@@ -0,0 +1,13 @@
1
+ /// <reference types="react" />
2
+ import { UnknownSpec } from '@perses-dev/core';
3
+ import { Plugin } from './plugin-base';
4
+ export interface ExploreComponentProps<Spec> {
5
+ spec: Spec;
6
+ }
7
+ /**
8
+ * Plugin that defines options for an external system that Perses talks to for data.
9
+ */
10
+ export interface ExplorePlugin<Spec = UnknownSpec> extends Plugin<Spec> {
11
+ ExploreComponent: React.ComponentType<ExploreComponentProps<Spec>>;
12
+ }
13
+ //# sourceMappingURL=explore.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"explore.d.ts","sourceRoot":"","sources":["../../src/model/explore.ts"],"names":[],"mappings":";AAaA,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAC/C,OAAO,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AAEvC,MAAM,WAAW,qBAAqB,CAAC,IAAI;IACzC,IAAI,EAAE,IAAI,CAAC;CACZ;AAED;;GAEG;AACH,MAAM,WAAW,aAAa,CAAC,IAAI,GAAG,WAAW,CAAE,SAAQ,MAAM,CAAC,IAAI,CAAC;IACrE,gBAAgB,EAAE,KAAK,CAAC,aAAa,CAAC,qBAAqB,CAAC,IAAI,CAAC,CAAC,CAAC;CACpE"}
@@ -10,10 +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
- export * from './datasource';
14
- export * from './duration';
15
- export * from './resource';
16
- export * from './secret';
17
- export * from './variable';
13
+ /**
14
+ * Plugin that defines options for an external system that Perses talks to for data.
15
+ */ export { };
18
16
 
19
- //# sourceMappingURL=index.js.map
17
+ //# sourceMappingURL=explore.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/model/explore.ts"],"sourcesContent":["// Copyright 2023 The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport { UnknownSpec } from '@perses-dev/core';\nimport { Plugin } from './plugin-base';\n\nexport interface ExploreComponentProps<Spec> {\n spec: Spec;\n}\n\n/**\n * Plugin that defines options for an external system that Perses talks to for data.\n */\nexport interface ExplorePlugin<Spec = UnknownSpec> extends Plugin<Spec> {\n ExploreComponent: React.ComponentType<ExploreComponentProps<Spec>>;\n}\n"],"names":[],"mappings":"AAAA,oCAAoC;AACpC,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AASjC;;CAEC,GACD,WAEC"}
@@ -1 +1 @@
1
- {"version":3,"file":"legend.d.ts","sourceRoot":"","sources":["../../src/model/legend.ts"],"names":[],"mappings":"AAaA,OAAO,EAEL,eAAe,EACf,UAAU,EACV,iBAAiB,EACjB,eAAe,EAGf,UAAU,EAEX,MAAM,kBAAkB,CAAC;AAU1B,eAAO,MAAM,YAAY,EAAE,eAAe,EASzC,CAAC;AACF,MAAM,MAAM,WAAW,GAAG,CAAC,OAAO,YAAY,CAAC,CAAC,MAAM,CAAC,CAAC;AAKxD,MAAM,WAAW,iBAAkB,SAAQ,iBAAiB;IAC1D,MAAM,CAAC,EAAE,WAAW,EAAE,CAAC;CACxB;AAED,MAAM,MAAM,wBAAwB,GAAG;IACrC,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB,CAAC;AAEF,eAAO,MAAM,uBAAuB,EAAE,QAAQ,CAAC,MAAM,CAAC,eAAe,EAAE,wBAAwB,CAAC,CAG/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
1
- {"version":3,"sources":["../../src/model/legend.ts"],"sourcesContent":["// Copyright 2023 The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport {\n CALCULATIONS_CONFIG,\n CalculationType,\n LegendMode,\n LegendOptionsBase,\n LegendPositions,\n isValidLegendMode,\n isValidLegendPosition,\n LegendSize,\n isValidLegendSize,\n} from '@perses-dev/core';\n\n// This file contains legend-related model code specific to panel plugin specs.\n// See the `core` package for common/shared legend model code and the\n// `components` package for legend model code specific to the Legend component.\n\n// Explicity listing the calculations we intend to use for legend values because\n// we want them ordered in a specific way, and it may be possible in the future\n// that we only use a subset of calculations for the legend because the calculations\n// are also used by other features.\nexport const legendValues: CalculationType[] = [\n 'mean',\n 'first',\n 'first-number',\n 'last',\n 'last-number',\n 'min',\n 'max',\n 'sum',\n];\nexport type LegendValue = (typeof legendValues)[number];\n\n// Note: explicitly defining different options for the legend spec and\n// legend component that extend from some common options, so we can allow the\n// component and the spec to diverge in some upcoming work.\nexport interface LegendSpecOptions extends LegendOptionsBase {\n values?: LegendValue[];\n}\n\nexport type LegendSingleSelectConfig = {\n label: string;\n description?: string;\n};\n\nexport const LEGEND_POSITIONS_CONFIG: Readonly<Record<LegendPositions, LegendSingleSelectConfig>> = {\n bottom: { label: 'Bottom' },\n right: { label: 'Right' },\n};\n\nexport const LEGEND_MODE_CONFIG: Readonly<Record<LegendMode, LegendSingleSelectConfig>> = {\n list: { label: 'List' },\n table: { label: 'Table' },\n};\n\nexport const LEGEND_SIZE_CONFIG: Readonly<Record<LegendSize, LegendSingleSelectConfig>> = {\n small: { label: 'Small' },\n medium: { label: 'Medium' },\n};\n\nexport const LEGEND_VALUE_CONFIG = legendValues.reduce(\n (config, value) => {\n config[value] = CALCULATIONS_CONFIG[value];\n\n return config;\n },\n {} as Partial<Record<LegendValue, LegendSingleSelectConfig>>\n);\n\nexport function validateLegendSpec(legend?: LegendOptionsBase) {\n if (legend === undefined) {\n // undefined is valid since this is how legend is hidden by default\n return true;\n }\n if (!isValidLegendPosition(legend.position)) {\n return false;\n }\n if (legend.mode && !isValidLegendMode(legend.mode)) {\n return false;\n }\n if (legend.size && !isValidLegendSize(legend.size)) {\n return false;\n }\n\n return true;\n}\n"],"names":["CALCULATIONS_CONFIG","isValidLegendMode","isValidLegendPosition","isValidLegendSize","legendValues","LEGEND_POSITIONS_CONFIG","bottom","label","right","LEGEND_MODE_CONFIG","list","table","LEGEND_SIZE_CONFIG","small","medium","LEGEND_VALUE_CONFIG","reduce","config","value","validateLegendSpec","legend","undefined","position","mode","size"],"mappings":"AAAA,oCAAoC;AACpC,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAEjC,SACEA,mBAAmB,EAKnBC,iBAAiB,EACjBC,qBAAqB,EAErBC,iBAAiB,QACZ,mBAAmB;AAE1B,+EAA+E;AAC/E,qEAAqE;AACrE,+EAA+E;AAE/E,gFAAgF;AAChF,+EAA+E;AAC/E,oFAAoF;AACpF,mCAAmC;AACnC,OAAO,MAAMC,eAAkC;IAC7C;IACA;IACA;IACA;IACA;IACA;IACA;IACA;CACD,CAAC;AAeF,OAAO,MAAMC,0BAAuF;IAClGC,QAAQ;QAAEC,OAAO;IAAS;IAC1BC,OAAO;QAAED,OAAO;IAAQ;AAC1B,EAAE;AAEF,OAAO,MAAME,qBAA6E;IACxFC,MAAM;QAAEH,OAAO;IAAO;IACtBI,OAAO;QAAEJ,OAAO;IAAQ;AAC1B,EAAE;AAEF,OAAO,MAAMK,qBAA6E;IACxFC,OAAO;QAAEN,OAAO;IAAQ;IACxBO,QAAQ;QAAEP,OAAO;IAAS;AAC5B,EAAE;AAEF,OAAO,MAAMQ,sBAAsBX,aAAaY,MAAM,CACpD,CAACC,QAAQC;IACPD,MAAM,CAACC,MAAM,GAAGlB,mBAAmB,CAACkB,MAAM;IAE1C,OAAOD;AACT,GACA,CAAC,GACD;AAEF,OAAO,SAASE,mBAAmBC,MAA0B;IAC3D,IAAIA,WAAWC,WAAW;QACxB,mEAAmE;QACnE,OAAO;IACT;IACA,IAAI,CAACnB,sBAAsBkB,OAAOE,QAAQ,GAAG;QAC3C,OAAO;IACT;IACA,IAAIF,OAAOG,IAAI,IAAI,CAACtB,kBAAkBmB,OAAOG,IAAI,GAAG;QAClD,OAAO;IACT;IACA,IAAIH,OAAOI,IAAI,IAAI,CAACrB,kBAAkBiB,OAAOI,IAAI,GAAG;QAClD,OAAO;IACT;IAEA,OAAO;AACT"}
1
+ {"version":3,"sources":["../../src/model/legend.ts"],"sourcesContent":["// Copyright 2023 The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport {\n CALCULATIONS_CONFIG,\n CalculationType,\n LegendMode,\n LegendOptionsBase,\n LegendPositions,\n isValidLegendMode,\n isValidLegendPosition,\n LegendSize,\n isValidLegendSize,\n} from '@perses-dev/core';\n\n// This file contains legend-related model code specific to panel plugin specs.\n// See the `core` package for common/shared legend model code and the\n// `components` package for legend model code specific to the Legend component.\n\n// Explicity listing the calculations we intend to use for legend values because\n// we want them ordered in a specific way, and it may be possible in the future\n// that we only use a subset of calculations for the legend because the calculations\n// are also used by other features.\nexport const legendValues: CalculationType[] = [\n 'mean',\n 'first',\n 'first-number',\n 'last',\n 'last-number',\n 'min',\n 'max',\n 'sum',\n];\nexport type LegendValue = (typeof legendValues)[number];\n\n// Note: explicitly defining different options for the legend spec and\n// legend component that extend from some common options, so we can allow the\n// component and the spec to diverge in some upcoming work.\nexport interface LegendSpecOptions extends LegendOptionsBase {\n values?: LegendValue[];\n}\n\nexport type LegendSingleSelectConfig = {\n label: string;\n description?: string;\n};\n\nexport const LEGEND_POSITIONS_CONFIG: Readonly<Record<LegendPositions, LegendSingleSelectConfig>> = {\n bottom: { label: 'Bottom' },\n right: { label: 'Right' },\n};\n\nexport const LEGEND_MODE_CONFIG: Readonly<Record<LegendMode, LegendSingleSelectConfig>> = {\n list: { label: 'List' },\n table: { label: 'Table' },\n};\n\nexport const LEGEND_SIZE_CONFIG: Readonly<Record<LegendSize, LegendSingleSelectConfig>> = {\n small: { label: 'Small' },\n medium: { label: 'Medium' },\n};\n\nexport const LEGEND_VALUE_CONFIG = legendValues.reduce(\n (config, value) => {\n config[value] = CALCULATIONS_CONFIG[value];\n\n return config;\n },\n {} as Partial<Record<LegendValue, LegendSingleSelectConfig>>\n);\n\nexport function validateLegendSpec(legend?: LegendOptionsBase): boolean {\n if (legend === undefined) {\n // undefined is valid since this is how legend is hidden by default\n return true;\n }\n if (!isValidLegendPosition(legend.position)) {\n return false;\n }\n if (legend.mode && !isValidLegendMode(legend.mode)) {\n return false;\n }\n if (legend.size && !isValidLegendSize(legend.size)) {\n return false;\n }\n\n return true;\n}\n"],"names":["CALCULATIONS_CONFIG","isValidLegendMode","isValidLegendPosition","isValidLegendSize","legendValues","LEGEND_POSITIONS_CONFIG","bottom","label","right","LEGEND_MODE_CONFIG","list","table","LEGEND_SIZE_CONFIG","small","medium","LEGEND_VALUE_CONFIG","reduce","config","value","validateLegendSpec","legend","undefined","position","mode","size"],"mappings":"AAAA,oCAAoC;AACpC,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0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
  import React from 'react';
2
- import { UnknownSpec, PanelDefinition } from '@perses-dev/core';
2
+ import { UnknownSpec, PanelDefinition, QueryPluginType, QueryDataType, QueryDefinition } from '@perses-dev/core';
3
3
  import { OptionsEditorTab } from '../components';
4
+ import { QueryOptions } from '../runtime';
4
5
  import { OptionsEditorProps, Plugin } from './plugin-base';
5
6
  export type PanelOptionsEditorComponent<T> = Pick<OptionsEditorTab, 'label'> & {
6
7
  content: React.ComponentType<OptionsEditorProps<T>>;
7
8
  };
8
9
  /**
9
- * Plugin the provides custom visualizations inside of a Panel.
10
+ * Plugin the provides custom visualizations inside a Panel.
10
11
  */
11
- export interface PanelPlugin<Spec = UnknownSpec> extends Plugin<Spec> {
12
- PanelComponent: React.ComponentType<PanelProps<Spec>>;
12
+ export interface PanelPlugin<Spec = UnknownSpec, TPanelProps = PanelProps<Spec>> extends Plugin<Spec> {
13
+ PanelComponent: React.ComponentType<TPanelProps>;
13
14
  /**
14
15
  * React components for custom tabs
15
16
  */
16
17
  panelOptionsEditorComponents?: Array<PanelOptionsEditorComponent<Spec>>;
18
+ /**
19
+ * Show a custom React component when the query is loading.
20
+ * Default: <LoadingOverlay />
21
+ */
22
+ LoadingComponent?: React.ComponentType<TPanelProps>;
23
+ /**
24
+ * List of query types supported by this panel.
25
+ * @default [] (no query types supported) only relevant if hideQueryEditor is true
26
+ */
27
+ supportedQueryTypes?: QueryPluginType[];
28
+ /**
29
+ * Static options for the queries that will be executed.
30
+ * Each {@link QueryPluginType} implementation can have its own options.
31
+ * For example see {@link UseTimeSeriesQueryOptions} for time series queries.
32
+ */
33
+ queryOptions?: QueryOptions | ((spec: Spec) => QueryOptions);
17
34
  /**
18
35
  * If true, query editor will be hidden for panel plugin
19
36
  * @default false
@@ -23,12 +40,17 @@ export interface PanelPlugin<Spec = UnknownSpec> extends Plugin<Spec> {
23
40
  /**
24
41
  * The props provided by Perses to a panel plugin's PanelComponent.
25
42
  */
26
- export interface PanelProps<Spec> {
43
+ export interface PanelProps<Spec, SupportedQueryTypes = QueryDataType> {
27
44
  spec: Spec;
28
45
  contentDimensions?: {
29
46
  width: number;
30
47
  height: number;
31
48
  };
32
49
  definition?: PanelDefinition;
50
+ queryResults: Array<PanelData<SupportedQueryTypes>>;
51
+ }
52
+ export interface PanelData<SupportedQueryTypes = QueryDataType> {
53
+ definition: QueryDefinition;
54
+ data: SupportedQueryTypes;
33
55
  }
34
56
  //# sourceMappingURL=panels.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"panels.d.ts","sourceRoot":"","sources":["../../src/model/panels.ts"],"names":[],"mappings":"AAaA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAChE,OAAO,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AACjD,OAAO,EAAE,kBAAkB,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AAE3D,MAAM,MAAM,2BAA2B,CAAC,CAAC,IAAI,IAAI,CAAC,gBAAgB,EAAE,OAAO,CAAC,GAAG;IAC7E,OAAO,EAAE,KAAK,CAAC,aAAa,CAAC,kBAAkB,CAAC,CAAC,CAAC,CAAC,CAAC;CACrD,CAAC;AACF;;GAEG;AACH,MAAM,WAAW,WAAW,CAAC,IAAI,GAAG,WAAW,CAAE,SAAQ,MAAM,CAAC,IAAI,CAAC;IACnE,cAAc,EAAE,KAAK,CAAC,aAAa,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC,CAAC;IACtD;;OAEG;IACH,4BAA4B,CAAC,EAAE,KAAK,CAAC,2BAA2B,CAAC,IAAI,CAAC,CAAC,CAAC;IACxE;;;OAGG;IACH,eAAe,CAAC,EAAE,OAAO,CAAC;CAC3B;AAED;;GAEG;AACH,MAAM,WAAW,UAAU,CAAC,IAAI;IAC9B,IAAI,EAAE,IAAI,CAAC;IACX,iBAAiB,CAAC,EAAE;QAClB,KAAK,EAAE,MAAM,CAAC;QACd,MAAM,EAAE,M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M,WAAW,UAAU,CAAC,IAAI,EAAE,mBAAmB,GAAG,aAAa;IACnE,IAAI,EAAE,IAAI,CAAC;IACX,iBAAiB,CAAC,EAAE;QAClB,KAAK,EAAE,MAAM,CAAC;QACd,MAAM,EAAE,MAAM,CAAC;KAChB,CAAC;IACF,UAAU,CAAC,EAAE,eAAe,CAAC;IAC7B,YAAY,EAAE,KAAK,CAAC,SAAS,CAAC,mBAAmB,CAAC,CAAC,CAAC;CACrD;AAED,MAAM,WAAW,SAAS,CAAC,mBAAmB,GAAG,aAAa;IAC5D,UAAU,EAAE,eAAe,CAAC;IAC5B,IAAI,EAAE,mBAAmB,CAAC;CAC3B"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/model/panels.ts"],"sourcesContent":["// Copyright 2023 The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport React from 'react';\nimport { UnknownSpec, PanelDefinition } from '@perses-dev/core';\nimport { OptionsEditorTab } from '../components';\nimport { OptionsEditorProps, Plugin } from './plugin-base';\n\nexport type PanelOptionsEditorComponent<T> = Pick<OptionsEditorTab, 'label'> & {\n content: React.ComponentType<OptionsEditorProps<T>>;\n};\n/**\n * Plugin the provides custom visualizations inside of a Panel.\n */\nexport interface PanelPlugin<Spec = UnknownSpec> extends Plugin<Spec> {\n PanelComponent: React.ComponentType<PanelProps<Spec>>;\n /**\n * React components for custom tabs\n */\n panelOptionsEditorComponents?: Array<PanelOptionsEditorComponent<Spec>>;\n /**\n * If true, query editor will be hidden for panel plugin\n * @default false\n */\n hideQueryEditor?: boolean;\n}\n\n/**\n * The props provided by Perses to a panel plugin's PanelComponent.\n */\nexport interface PanelProps<Spec> {\n spec: Spec;\n contentDimensions?: {\n width: number;\n height: number;\n };\n definition?: PanelDefinition;\n}\n"],"names":["React"],"mappings":"AAAA,oCAAoC;AACpC,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAEjC,OAAOA,WAAW,QAAQ"}
1
+ {"version":3,"sources":["../../src/model/panels.ts"],"sourcesContent":["// Copyright 2023 The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport React from 'react';\nimport { UnknownSpec, PanelDefinition, QueryPluginType, QueryDataType, QueryDefinition } from '@perses-dev/core';\nimport { OptionsEditorTab } from '../components';\nimport { QueryOptions } from '../runtime';\nimport { OptionsEditorProps, Plugin } from './plugin-base';\n\nexport type PanelOptionsEditorComponent<T> = Pick<OptionsEditorTab, 'label'> & {\n content: React.ComponentType<OptionsEditorProps<T>>;\n};\n\n/**\n * Plugin the provides custom visualizations inside a Panel.\n */\nexport interface PanelPlugin<Spec = UnknownSpec, TPanelProps = PanelProps<Spec>> extends Plugin<Spec> {\n PanelComponent: React.ComponentType<TPanelProps>;\n /**\n * React components for custom tabs\n */\n panelOptionsEditorComponents?: Array<PanelOptionsEditorComponent<Spec>>;\n /**\n * Show a custom React component when the query is loading.\n * Default: <LoadingOverlay />\n */\n LoadingComponent?: React.ComponentType<TPanelProps>;\n /**\n * List of query types supported by this panel.\n * @default [] (no query types supported) only relevant if hideQueryEditor is true\n */\n supportedQueryTypes?: QueryPluginType[];\n /**\n * Static options for the queries that will be executed.\n * Each {@link QueryPluginType} implementation can have its own options.\n * For example see {@link UseTimeSeriesQueryOptions} for time series queries.\n */\n queryOptions?: QueryOptions | ((spec: Spec) => QueryOptions);\n /**\n * If true, query editor will be hidden for panel plugin\n * @default false\n */\n hideQueryEditor?: boolean;\n}\n\n/**\n * The props provided by Perses to a panel plugin's PanelComponent.\n */\nexport interface PanelProps<Spec, SupportedQueryTypes = QueryDataType> {\n spec: Spec;\n contentDimensions?: {\n width: number;\n height: number;\n };\n definition?: PanelDefinition;\n queryResults: Array<PanelData<SupportedQueryTypes>>;\n}\n\nexport interface PanelData<SupportedQueryTypes = QueryDataType> {\n definition: QueryDefinition;\n data: SupportedQueryTypes;\n}\n"],"names":["React"],"mappings":"AAAA,oCAAoC;AACpC,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAEjC,OAAOA,WAAW,QAAQ"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/model/plugin-loading.ts"],"sourcesContent":["// Copyright 2023 The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport { PluginModuleResource } from './plugins';\n\n/**\n * A component capable of loading the resource/metadata for all available plugins, then loading individual plugins for\n * those resources on-demand.\n */\nexport interface PluginLoader {\n getInstalledPlugins: () => Promise<PluginModuleResource[]>;\n importPluginModule: (resource: PluginModuleResource) => Promise<unknown>;\n}\n\n/**\n * The dynamic import for a single plugin resource.\n */\nexport interface DynamicImportPlugin {\n resource: PluginModuleResource;\n importPlugin(): Promise<unknown>;\n}\n\n/**\n * A PluginLoader for the common pattern in Perses where we eagerly import a plugin's resource file, and then lazy load\n * the plugin itself via a dynamic `import()` statement.\n */\nexport function dynamicImportPluginLoader(plugins: DynamicImportPlugin[]): PluginLoader {\n const importMap: Map<PluginModuleResource, DynamicImportPlugin['importPlugin']> = new Map(\n plugins.map((plugin) => [plugin.resource, plugin.importPlugin])\n );\n\n return {\n async getInstalledPlugins() {\n return Promise.resolve(Array.from(importMap.keys()));\n },\n importPluginModule(resource) {\n const importFn = importMap.get(resource);\n if (importFn === undefined) {\n throw new Error('Plugin not found');\n }\n return importFn();\n },\n };\n}\n"],"names":["dynamicImportPluginLoader","plugins","importMap","Map","map","plugin","resource","importPlugin","getInstalledPlugins","Promise","resolve","Array","from","keys","importPluginModule","importFn","get","undefined","Error"],"mappings":"AAAA,oCAAoC;AACpC,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAqBjC;;;CAGC,GACD,OAAO,SAASA,0BAA0BC,OAA8B;IACtE,MAAMC,YAA4E,IAAIC,IACpFF,QAAQG,GAAG,CAAC,CAACC,SAAW;YAACA,OAAOC,QAAQ;YAAED,OAAOE,YAAY;SAAC;IAGhE,OAAO;QACL,MAAMC;YACJ,OAAOC,QAAQC,OAAO,CAACC,MAAMC,IAAI,CAACV,UAAUW,IAAI;QAClD;QACAC,oBAAmBR,QAAQ;YACzB,MAAMS,WAAWb,UAAUc,GAAG,CAACV;YAC/B,IAAIS,aAAaE,WAAW;gBAC1B,MAAM,IAAIC,MAAM;YAClB;YACA,OAAOH;QACT;IACF;AACF"}
1
+ {"version":3,"sources":["../../src/model/plugin-loading.ts"],"sourcesContent":["// Copyright 2023 The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport { PluginModuleResource } from './plugins';\n\n/**\n * A component capable of loading the resource/metadata for all available plugins, then loading individual plugins for\n * those resources on-demand.\n */\nexport interface PluginLoader {\n getInstalledPlugins: () => Promise<PluginModuleResource[]>;\n importPluginModule: (resource: PluginModuleResource) => Promise<unknown>;\n}\n\n/**\n * The dynamic import for a single plugin resource.\n */\nexport interface DynamicImportPlugin {\n resource: PluginModuleResource;\n importPlugin(): Promise<unknown>;\n}\n\n/**\n * A PluginLoader for the common pattern in Perses where we eagerly import a plugin's resource file, and then lazy load\n * the plugin itself via a dynamic `import()` statement.\n */\nexport function dynamicImportPluginLoader(plugins: DynamicImportPlugin[]): PluginLoader {\n const importMap: Map<PluginModuleResource, DynamicImportPlugin['importPlugin']> = new Map(\n plugins.map((plugin) => [plugin.resource, plugin.importPlugin])\n );\n\n return {\n async getInstalledPlugins(): Promise<PluginModuleResource[]> {\n return Promise.resolve(Array.from(importMap.keys()));\n },\n importPluginModule(resource): Promise<unknown> {\n const importFn = importMap.get(resource);\n if (importFn === undefined) {\n throw new Error('Plugin not found');\n }\n return importFn();\n },\n };\n}\n"],"names":["dynamicImportPluginLoader","plugins","importMap","Map","map","plugin","resource","importPlugin","getInstalledPlugins","Promise","resolve","Array","from","keys","importPluginModule","importFn","get","undefined","Error"],"mappings":"AAAA,oCAAoC;AACpC,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAqBjC;;;CAGC,GACD,OAAO,SAASA,0BAA0BC,OAA8B;IACtE,MAAMC,YAA4E,IAAIC,IACpFF,QAAQG,GAAG,CAAC,CAACC,SAAW;YAACA,OAAOC,QAAQ;YAAED,OAAOE,YAAY;SAAC;IAGhE,OAAO;QACL,MAAMC;YACJ,OAAOC,QAAQC,OAAO,CAACC,MAAMC,IAAI,CAACV,UAAUW,IAAI;QAClD;QACAC,oBAAmBR,QAAQ;YACzB,MAAMS,WAAWb,UAAUc,GAAG,CAACV;YAC/B,IAAIS,aAAaE,WAAW;gBAC1B,MAAM,IAAIC,MAAM;YAClB;YACA,OAAOH;QACT;IACF;AACF"}
@@ -1,32 +1,45 @@
1
- import { Metadata, UnknownSpec } from '@perses-dev/core';
2
- import { TimeSeriesQueryPlugin } from './time-series-queries';
3
- import { PanelPlugin } from './panels';
4
- import { VariablePlugin } from './variables';
1
+ import { UnknownSpec } from '@perses-dev/core';
5
2
  import { DatasourcePlugin } from './datasource';
3
+ import { PanelPlugin } from './panels';
6
4
  import { Plugin } from './plugin-base';
5
+ import { TimeSeriesQueryPlugin } from './time-series-queries';
7
6
  import { TraceQueryPlugin } from './trace-queries';
8
- /**
9
- * Information about a module/package that contains plugins.
10
- */
11
- export interface PluginModuleResource {
12
- kind: 'PluginModule';
13
- metadata: Metadata;
14
- spec: PluginSpec;
15
- }
16
- export interface PluginSpec {
7
+ import { VariablePlugin } from './variables';
8
+ import { ExplorePlugin } from './explore';
9
+ export interface PluginModuleSpec {
17
10
  plugins: PluginMetadata[];
18
11
  }
12
+ export interface PluginMetadataWithModule extends PluginMetadata {
13
+ module: PluginModuleMetadata;
14
+ }
19
15
  /**
20
16
  * Metadata about an individual plugin that's part of a PluginModule.
21
17
  */
22
18
  export interface PluginMetadata {
23
- pluginType: PluginType;
24
- kind: string;
25
- display: {
19
+ kind: PluginType;
20
+ spec: {
26
21
  name: string;
27
- description?: string;
22
+ display: {
23
+ name: string;
24
+ description?: string;
25
+ };
28
26
  };
29
27
  }
28
+ /**
29
+ * Metadata about a module/package that contains plugins.
30
+ */
31
+ export interface PluginModuleMetadata {
32
+ name: string;
33
+ version: string;
34
+ }
35
+ /**
36
+ * Information about a module/package that contains plugins.
37
+ */
38
+ export interface PluginModuleResource {
39
+ kind: 'PluginModule';
40
+ metadata: PluginModuleMetadata;
41
+ spec: PluginModuleSpec;
42
+ }
30
43
  /**
31
44
  * All supported plugin types. A plugin's implementation must extend from `Plugin<UnknownSpec>` to be considered a valid
32
45
  * `PluginType`.
@@ -44,6 +57,7 @@ export interface SupportedPlugins {
44
57
  TimeSeriesQuery: TimeSeriesQueryPlugin;
45
58
  TraceQuery: TraceQueryPlugin;
46
59
  Datasource: DatasourcePlugin;
60
+ Explore: ExplorePlugin;
47
61
  }
48
62
  /**
49
63
  * The implementation for a given plugin type.
@@ -1 +1 @@
1
- {"version":3,"file":"plugins.d.ts","sourceRoot":"","sources":["../../src/model/plugins.ts"],"names":[],"mappings":"AAaA,OAAO,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AACzD,OAAO,EAAE,qBAAqB,EAAE,MAAM,uBAAuB,CAAC;AAC9D,OAAO,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AACvC,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAC7C,OAAO,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAChD,OAAO,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AACvC,OAAO,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AAEnD;;GAEG;AACH,MAAM,WAAW,oBAAoB;IACnC,IAAI,EAAE,cAAc,CAAC;IACrB,QAAQ,EAAE,QAAQ,CAAC;IACnB,IAAI,EAAE,UAAU,CAAC;CAClB;AAED,MAAM,WAAW,UAAU;IACzB,OAAO,EAAE,cAAc,EAAE,CAAC;CAC3B;AAED;;GAEG;AACH,MAAM,WAAW,cAAc;IAC7B,UAAU,EAAE,UAAU,CAAC;IACvB,IAAI,EAAE,MAAM,C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,CAAC,IAAI,CAAC,CAAC;AAEnF;;GAEG;AACH,KAAK,WAAW,GAAG,OAAO,CAAC,MAAM,CAAC,UAAU,EAAE,MAAM,CAAC,CAAC,CAAC;AACvD,MAAM,MAAM,kBAAkB,GAAG,QAAQ,CAAC,IAAI,CAAC,WAAW,EAAE,iBAAiB,CAAC,CAAC,GAAG,IAAI,CAAC,WAAW,EAAE,iBAAiB,CAAC,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/model/plugins.ts"],"sourcesContent":["// Copyright 2023 The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport { Metadata, UnknownSpec } from '@perses-dev/core';\nimport { TimeSeriesQueryPlugin } from './time-series-queries';\nimport { PanelPlugin } from './panels';\nimport { VariablePlugin } from './variables';\nimport { DatasourcePlugin } from './datasource';\nimport { Plugin } from './plugin-base';\nimport { TraceQueryPlugin } from './trace-queries';\n\n/**\n * Information about a module/package that contains plugins.\n */\nexport interface PluginModuleResource {\n kind: 'PluginModule';\n metadata: Metadata;\n spec: PluginSpec;\n}\n\nexport interface PluginSpec {\n plugins: PluginMetadata[];\n}\n\n/**\n * Metadata about an individual plugin that's part of a PluginModule.\n */\nexport interface PluginMetadata {\n pluginType: PluginType;\n kind: string;\n display: {\n name: string;\n description?: string;\n };\n}\n\n/**\n * All supported plugin types. A plugin's implementation must extend from `Plugin<UnknownSpec>` to be considered a valid\n * `PluginType`.\n */\nexport type PluginType = {\n // Filter out implementations on SupportedPlugins that don't extend `Plugin<UnknownSpec>`\n [K in keyof SupportedPlugins]: SupportedPlugins[K] extends Plugin<UnknownSpec> ? K : never;\n}[keyof SupportedPlugins];\n\n/**\n * Map of plugin type key/string -> implementation type. Use Typescript module augmentation to extend the plugin system\n * with new plugin types.\n */\nexport interface SupportedPlugins {\n Variable: VariablePlugin;\n Panel: PanelPlugin;\n TimeSeriesQuery: TimeSeriesQueryPlugin;\n TraceQuery: TraceQueryPlugin;\n Datasource: DatasourcePlugin;\n}\n\n/**\n * The implementation for a given plugin type.\n */\nexport type PluginImplementation<Type extends PluginType> = SupportedPlugins[Type];\n\n/**\n * Default plugin kinds by plugin type.\n */\ntype PluginKinds = Partial<Record<PluginType, string>>;\nexport type DefaultPluginKinds = Required<Pick<PluginKinds, 'TimeSeriesQuery'>> & Omit<PluginKinds, 'TimeSeriesQuery'>;\n"],"names":[],"mappings":"AAAA,oCAAoC;AACpC,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAiEjC,WAAuH"}
1
+ {"version":3,"sources":["../../src/model/plugins.ts"],"sourcesContent":["// Copyright 2023 The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport { UnknownSpec } from '@perses-dev/core';\nimport { DatasourcePlugin } from './datasource';\nimport { PanelPlugin } from './panels';\nimport { Plugin } from './plugin-base';\nimport { TimeSeriesQueryPlugin } from './time-series-queries';\nimport { TraceQueryPlugin } from './trace-queries';\nimport { VariablePlugin } from './variables';\nimport { ExplorePlugin } from './explore';\n\nexport interface PluginModuleSpec {\n plugins: PluginMetadata[];\n}\n\nexport interface PluginMetadataWithModule extends PluginMetadata {\n module: PluginModuleMetadata;\n}\n\n/**\n * Metadata about an individual plugin that's part of a PluginModule.\n */\nexport interface PluginMetadata {\n kind: PluginType;\n spec: {\n name: string;\n display: {\n name: string;\n description?: string;\n };\n };\n}\n\n/**\n * Metadata about a module/package that contains plugins.\n */\nexport interface PluginModuleMetadata {\n name: string;\n version: string;\n}\n\n/**\n * Information about a module/package that contains plugins.\n */\nexport interface PluginModuleResource {\n kind: 'PluginModule';\n metadata: PluginModuleMetadata;\n spec: PluginModuleSpec;\n}\n\n/**\n * All supported plugin types. A plugin's implementation must extend from `Plugin<UnknownSpec>` to be considered a valid\n * `PluginType`.\n */\nexport type PluginType = {\n // Filter out implementations on SupportedPlugins that don't extend `Plugin<UnknownSpec>`\n [K in keyof SupportedPlugins]: SupportedPlugins[K] extends Plugin<UnknownSpec> ? K : never;\n}[keyof SupportedPlugins];\n\n/**\n * Map of plugin type key/string -> implementation type. Use Typescript module augmentation to extend the plugin system\n * with new plugin types.\n */\nexport interface SupportedPlugins {\n Variable: VariablePlugin;\n Panel: PanelPlugin;\n TimeSeriesQuery: TimeSeriesQueryPlugin;\n TraceQuery: TraceQueryPlugin;\n Datasource: DatasourcePlugin;\n Explore: ExplorePlugin;\n}\n\n/**\n * The implementation for a given plugin type.\n */\nexport type PluginImplementation<Type extends PluginType> = SupportedPlugins[Type];\n\n/**\n * Default plugin kinds by plugin type.\n */\ntype PluginKinds = Partial<Record<PluginType, string>>;\nexport type DefaultPluginKinds = Required<Pick<PluginKinds, 'TimeSeriesQuery'>> & Omit<PluginKinds, 'TimeSeriesQuery'>;\n"],"names":[],"mappings":"AAAA,oCAAoC;AACpC,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAiFjC,WAAuH"}
@@ -18,16 +18,17 @@ export interface TimeSeriesQueryPlugin<Spec = UnknownSpec> extends Plugin<Spec>
18
18
  getTimeSeriesData: (spec: Spec, ctx: TimeSeriesQueryContext) => Promise<TimeSeriesData>;
19
19
  dependsOn?: (spec: Spec, ctx: TimeSeriesQueryContext) => TimeSeriesQueryPluginDependencies;
20
20
  }
21
+ export type TimeSeriesQueryMode = 'instant' | 'range';
21
22
  /**
22
23
  * Context available to TimeSeriesQuery plugins at runtime.
23
24
  */
24
25
  export interface TimeSeriesQueryContext {
25
26
  suggestedStepMs?: number;
27
+ mode?: TimeSeriesQueryMode;
26
28
  timeRange: AbsoluteTimeRange;
27
29
  variableState: VariableStateMap;
28
30
  datasourceStore: DatasourceStore;
29
31
  refreshKey: string;
30
- refreshIntervalInMs: number;
31
32
  }
32
33
  export type TimeSeriesDataQuery = Query<TimeSeriesData, unknown, TimeSeriesData, QueryKey>;
33
34
  export {};
@@ -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,MAAM,kBAAkB,CAAC;AAClF,OAAO,EAAE,eAAe,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAC/D,OAAO,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AAEvC;;GAEG;AACH,KAAK,iCAAiC,GAAG;IACvC;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,EAAE,CAAC;CACtB,CAAC;AAEF;;GAEG;AACH,MAAM,WAAW,qBAAqB,CAAC,IAAI,GAAG,WAAW,CAAE,SAAQ,MAAM,CAAC,IAAI,CAAC;IAC7E,iBAAiB,EAAE,CAAC,IAAI,EAAE,IAAI,EAAE,GAAG,EAAE,sBAAsB,KAAK,OAAO,CAAC,cAAc,CAAC,CAAC;IAExF,SAAS,CAAC,EAAE,CAAC,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AACH,MAAM,WAAW,sBAAsB;IACrC,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,IAAI,CAAC,EAAE,mBAAmB,CAAC;IAC3B,SAAS,EAAE,iBAAiB,CAAC;IAC7B,aAAa,EAAE,gBAAgB,CAAC;IAChC,eAAe,EAAE,eAAe,CAAC;IACjC,UAAU,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,MAAM,mBAAmB,GAAG,KAAK,CAAC,cAAc,EAAE,OAAO,EAAE,cAAc,EAAE,QAAQ,CAAC,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/model/time-series-queries.ts"],"sourcesContent":["// Copyright 2023 The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport { Query, QueryKey } from '@tanstack/react-query';\nimport { AbsoluteTimeRange, UnknownSpec, TimeSeriesData } from '@perses-dev/core';\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) => Promise<TimeSeriesData>;\n\n dependsOn?: (spec: Spec, ctx: TimeSeriesQueryContext) => TimeSeriesQueryPluginDependencies;\n}\n\n/**\n * Context available to TimeSeriesQuery plugins at runtime.\n */\nexport interface TimeSeriesQueryContext {\n suggestedStepMs?: number;\n timeRange: AbsoluteTimeRange;\n variableState: VariableStateMap;\n datasourceStore: DatasourceStore;\n refreshKey: string;\n refreshIntervalInMs: number;\n}\n\nexport type TimeSeriesDataQuery = Query<TimeSeriesData, unknown, TimeSeriesData, QueryKey>;\n"],"names":[],"mappings":"AAAA,oCAAoC;AACpC,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAsCjC,WAA2F"}
1
+ {"version":3,"sources":["../../src/model/time-series-queries.ts"],"sourcesContent":["// Copyright 2023 The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport { Query, QueryKey } from '@tanstack/react-query';\nimport { AbsoluteTimeRange, UnknownSpec, TimeSeriesData } from '@perses-dev/core';\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) => 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 refreshKey: string;\n}\n\nexport type TimeSeriesDataQuery = Query<TimeSeriesData, unknown, TimeSeriesData, QueryKey>;\n"],"names":[],"mappings":"AAAA,oCAAoC;AACpC,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAwCjC,WAA2F"}
@@ -0,0 +1,7 @@
1
+ export interface PersesPlugin {
2
+ name: string;
3
+ moduleName: string;
4
+ baseURL?: string;
5
+ }
6
+ export type RemotePluginModule = Record<string, unknown>;
7
+ //# sourceMappingURL=PersesPlugin.types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PersesPlugin.types.d.ts","sourceRoot":"","sources":["../../src/remote/PersesPlugin.types.ts"],"names":[],"mappings":"AAaA,MAAM,WAAW,YAAY;IAC3B,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,EAAE,MAAM,CAAC;IACnB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,MAAM,kBAAkB,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC"}
@@ -1,4 +1,4 @@
1
- // Copyright 2023 The Perses Authors
1
+ // Copyright 2024 The Perses Authors
2
2
  // Licensed under the Apache License, Version 2.0 (the "License");
3
3
  // you may not use this file except in compliance with the License.
4
4
  // You may obtain a copy of the License at
@@ -10,6 +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
- export * from './decorators';
13
+ export { };
14
14
 
15
- //# sourceMappingURL=index.js.map
15
+ //# sourceMappingURL=PersesPlugin.types.js.map