@perses-dev/plugin-system 0.55.0-beta.3 → 0.55.0-beta.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/Annotations/AnnotationEditorForm/AnnotationEditorForm.d.ts +3 -3
- package/dist/components/Annotations/AnnotationEditorForm/AnnotationEditorForm.d.ts.map +1 -1
- package/dist/components/Annotations/AnnotationEditorForm/AnnotationEditorForm.js +11 -11
- package/dist/components/Annotations/AnnotationEditorForm/AnnotationEditorForm.js.map +1 -1
- package/dist/components/Annotations/AnnotationEditorForm/AnnotationPreview.d.ts +3 -3
- package/dist/components/Annotations/AnnotationEditorForm/AnnotationPreview.d.ts.map +1 -1
- package/dist/components/Annotations/AnnotationEditorForm/AnnotationPreview.js +6 -6
- package/dist/components/Annotations/AnnotationEditorForm/AnnotationPreview.js.map +1 -1
- package/dist/components/Annotations/AnnotationEditorForm/index.js +1 -1
- package/dist/components/Annotations/AnnotationEditorForm/index.js.map +1 -1
- package/dist/components/Annotations/index.js +2 -2
- package/dist/components/Annotations/index.js.map +1 -1
- package/dist/components/CalculationSelector/CalculationSelector.d.ts +2 -2
- package/dist/components/CalculationSelector/CalculationSelector.d.ts.map +1 -1
- package/dist/components/CalculationSelector/CalculationSelector.js +2 -2
- package/dist/components/CalculationSelector/CalculationSelector.js.map +1 -1
- package/dist/components/CalculationSelector/index.js +1 -1
- package/dist/components/CalculationSelector/index.js.map +1 -1
- package/dist/components/DatasourceEditorForm/DatasourceEditorForm.d.ts +2 -2
- package/dist/components/DatasourceEditorForm/DatasourceEditorForm.d.ts.map +1 -1
- package/dist/components/DatasourceEditorForm/DatasourceEditorForm.js +7 -7
- package/dist/components/DatasourceEditorForm/DatasourceEditorForm.js.map +1 -1
- package/dist/components/DatasourceEditorForm/index.js +1 -1
- package/dist/components/DatasourceEditorForm/index.js.map +1 -1
- package/dist/components/DatasourceSelect/DatasourceSelect.d.ts +4 -4
- package/dist/components/DatasourceSelect/DatasourceSelect.d.ts.map +1 -1
- package/dist/components/DatasourceSelect/DatasourceSelect.js +7 -7
- package/dist/components/DatasourceSelect/DatasourceSelect.js.map +1 -1
- package/dist/components/DatasourceSelect/index.js +1 -1
- package/dist/components/DatasourceSelect/index.js.map +1 -1
- package/dist/components/DatasourceTestConnectionButton/DatasourceTestConnectionButton.d.ts +2 -2
- package/dist/components/DatasourceTestConnectionButton/DatasourceTestConnectionButton.d.ts.map +1 -1
- package/dist/components/DatasourceTestConnectionButton/DatasourceTestConnectionButton.js +4 -4
- package/dist/components/DatasourceTestConnectionButton/DatasourceTestConnectionButton.js.map +1 -1
- package/dist/components/DatasourceTestConnectionButton/index.js +1 -1
- package/dist/components/DatasourceTestConnectionButton/index.js.map +1 -1
- package/dist/components/HTTPSettingsEditor/HTTPSettingsEditor.d.ts +2 -2
- package/dist/components/HTTPSettingsEditor/HTTPSettingsEditor.d.ts.map +1 -1
- package/dist/components/HTTPSettingsEditor/HTTPSettingsEditor.js +9 -9
- package/dist/components/HTTPSettingsEditor/HTTPSettingsEditor.js.map +1 -1
- package/dist/components/HTTPSettingsEditor/index.js +1 -1
- package/dist/components/HTTPSettingsEditor/index.js.map +1 -1
- package/dist/components/ItemSelectionActionsOptionsEditor/ItemSelectionActionsOptionsEditor.d.ts +1 -1
- package/dist/components/ItemSelectionActionsOptionsEditor/ItemSelectionActionsOptionsEditor.d.ts.map +1 -1
- package/dist/components/ItemSelectionActionsOptionsEditor/ItemSelectionActionsOptionsEditor.js +28 -28
- package/dist/components/ItemSelectionActionsOptionsEditor/ItemSelectionActionsOptionsEditor.js.map +1 -1
- package/dist/components/ItemSelectionActionsOptionsEditor/index.js +1 -1
- package/dist/components/ItemSelectionActionsOptionsEditor/index.js.map +1 -1
- package/dist/components/LayoutEditor/LayoutEditor.d.ts +4 -4
- package/dist/components/LayoutEditor/LayoutEditor.d.ts.map +1 -1
- package/dist/components/LayoutEditor/LayoutEditor.js +7 -7
- package/dist/components/LayoutEditor/LayoutEditor.js.map +1 -1
- package/dist/components/LayoutEditor/RepeatLayoutPreview.d.ts +1 -1
- package/dist/components/LayoutEditor/RepeatLayoutPreview.d.ts.map +1 -1
- package/dist/components/LayoutEditor/RepeatLayoutPreview.js +4 -4
- package/dist/components/LayoutEditor/RepeatLayoutPreview.js.map +1 -1
- package/dist/components/LayoutEditor/RepeatVariableEditor.d.ts +4 -4
- package/dist/components/LayoutEditor/RepeatVariableEditor.d.ts.map +1 -1
- package/dist/components/LayoutEditor/RepeatVariableEditor.js +3 -3
- package/dist/components/LayoutEditor/RepeatVariableEditor.js.map +1 -1
- package/dist/components/LayoutEditor/index.js +3 -3
- package/dist/components/LayoutEditor/index.js.map +1 -1
- package/dist/components/LegendOptionsEditor/LegendOptionsEditor.d.ts +2 -2
- package/dist/components/LegendOptionsEditor/LegendOptionsEditor.d.ts.map +1 -1
- package/dist/components/LegendOptionsEditor/LegendOptionsEditor.js +5 -5
- package/dist/components/LegendOptionsEditor/LegendOptionsEditor.js.map +1 -1
- package/dist/components/LegendOptionsEditor/index.js +1 -1
- package/dist/components/LegendOptionsEditor/index.js.map +1 -1
- package/dist/components/LinksEditor/LinksEditor.d.ts +3 -3
- package/dist/components/LinksEditor/LinksEditor.d.ts.map +1 -1
- package/dist/components/LinksEditor/LinksEditor.js +6 -6
- package/dist/components/LinksEditor/LinksEditor.js.map +1 -1
- package/dist/components/LinksEditor/index.js +1 -1
- package/dist/components/LinksEditor/index.js.map +1 -1
- package/dist/components/MetricLabelInput/MetricLabelInput.d.ts +1 -1
- package/dist/components/MetricLabelInput/MetricLabelInput.d.ts.map +1 -1
- package/dist/components/MetricLabelInput/MetricLabelInput.js +2 -2
- package/dist/components/MetricLabelInput/MetricLabelInput.js.map +1 -1
- package/dist/components/MetricLabelInput/index.js +1 -1
- package/dist/components/MetricLabelInput/index.js.map +1 -1
- package/dist/components/MultiQueryEditor/MultiQueryEditor.d.ts +3 -3
- package/dist/components/MultiQueryEditor/MultiQueryEditor.d.ts.map +1 -1
- package/dist/components/MultiQueryEditor/MultiQueryEditor.js +6 -6
- package/dist/components/MultiQueryEditor/MultiQueryEditor.js.map +1 -1
- package/dist/components/MultiQueryEditor/QueryEditorContainer.d.ts +3 -3
- package/dist/components/MultiQueryEditor/QueryEditorContainer.d.ts.map +1 -1
- package/dist/components/MultiQueryEditor/QueryEditorContainer.js +14 -14
- package/dist/components/MultiQueryEditor/QueryEditorContainer.js.map +1 -1
- package/dist/components/MultiQueryEditor/index.js +2 -2
- package/dist/components/MultiQueryEditor/index.js.map +1 -1
- package/dist/components/MultiQueryEditor/utils.d.ts +1 -1
- package/dist/components/MultiQueryEditor/utils.d.ts.map +1 -1
- package/dist/components/MultiQueryEditor/utils.js.map +1 -1
- package/dist/components/OptionsEditorRadios/OptionsEditorRadios.d.ts +1 -1
- package/dist/components/OptionsEditorRadios/OptionsEditorRadios.d.ts.map +1 -1
- package/dist/components/OptionsEditorRadios/OptionsEditorRadios.js +4 -4
- package/dist/components/OptionsEditorRadios/OptionsEditorRadios.js.map +1 -1
- package/dist/components/OptionsEditorRadios/index.js +1 -1
- package/dist/components/OptionsEditorRadios/index.js.map +1 -1
- package/dist/components/OptionsEditorTabPanel/OptionsEditorTabPanel.d.ts +1 -1
- package/dist/components/OptionsEditorTabPanel/OptionsEditorTabPanel.d.ts.map +1 -1
- package/dist/components/OptionsEditorTabPanel/OptionsEditorTabPanel.js +1 -1
- package/dist/components/OptionsEditorTabPanel/OptionsEditorTabPanel.js.map +1 -1
- package/dist/components/OptionsEditorTabPanel/index.js +1 -1
- package/dist/components/OptionsEditorTabPanel/index.js.map +1 -1
- package/dist/components/OptionsEditorTabs/OptionsEditorTabs.d.ts +1 -1
- package/dist/components/OptionsEditorTabs/OptionsEditorTabs.d.ts.map +1 -1
- package/dist/components/OptionsEditorTabs/OptionsEditorTabs.js +4 -4
- package/dist/components/OptionsEditorTabs/OptionsEditorTabs.js.map +1 -1
- package/dist/components/OptionsEditorTabs/index.js +1 -1
- package/dist/components/OptionsEditorTabs/index.js.map +1 -1
- package/dist/components/PanelSpecEditor/PanelAnnotationsEditor.d.ts +2 -2
- package/dist/components/PanelSpecEditor/PanelAnnotationsEditor.d.ts.map +1 -1
- package/dist/components/PanelSpecEditor/PanelAnnotationsEditor.js +9 -9
- package/dist/components/PanelSpecEditor/PanelAnnotationsEditor.js.map +1 -1
- package/dist/components/PanelSpecEditor/PanelSpecEditor.d.ts +5 -5
- package/dist/components/PanelSpecEditor/PanelSpecEditor.d.ts.map +1 -1
- package/dist/components/PanelSpecEditor/PanelSpecEditor.js +9 -9
- package/dist/components/PanelSpecEditor/PanelSpecEditor.js.map +1 -1
- package/dist/components/PanelSpecEditor/index.js +1 -1
- package/dist/components/PanelSpecEditor/index.js.map +1 -1
- package/dist/components/PluginEditor/PluginEditor.d.ts +2 -2
- package/dist/components/PluginEditor/PluginEditor.d.ts.map +1 -1
- package/dist/components/PluginEditor/PluginEditor.js +7 -7
- package/dist/components/PluginEditor/PluginEditor.js.map +1 -1
- package/dist/components/PluginEditor/index.js +2 -2
- package/dist/components/PluginEditor/index.js.map +1 -1
- package/dist/components/PluginEditor/plugin-editor-api.d.ts +3 -3
- package/dist/components/PluginEditor/plugin-editor-api.d.ts.map +1 -1
- package/dist/components/PluginEditor/plugin-editor-api.js +4 -4
- package/dist/components/PluginEditor/plugin-editor-api.js.map +1 -1
- package/dist/components/PluginKindSelect/PluginKindSelect.d.ts +3 -3
- package/dist/components/PluginKindSelect/PluginKindSelect.d.ts.map +1 -1
- package/dist/components/PluginKindSelect/PluginKindSelect.js +6 -6
- package/dist/components/PluginKindSelect/PluginKindSelect.js.map +1 -1
- package/dist/components/PluginKindSelect/index.js +1 -1
- package/dist/components/PluginKindSelect/index.js.map +1 -1
- package/dist/components/PluginRegistry/PluginRegistry.d.ts +2 -2
- package/dist/components/PluginRegistry/PluginRegistry.d.ts.map +1 -1
- package/dist/components/PluginRegistry/PluginRegistry.js +5 -5
- package/dist/components/PluginRegistry/PluginRegistry.js.map +1 -1
- package/dist/components/PluginRegistry/getPluginSearchHelper.d.ts +2 -2
- package/dist/components/PluginRegistry/getPluginSearchHelper.d.ts.map +1 -1
- package/dist/components/PluginRegistry/getPluginSearchHelper.js +2 -2
- package/dist/components/PluginRegistry/getPluginSearchHelper.js.map +1 -1
- package/dist/components/PluginRegistry/index.js +1 -1
- package/dist/components/PluginRegistry/index.js.map +1 -1
- package/dist/components/PluginRegistry/plugin-indexes.d.ts +2 -1
- package/dist/components/PluginRegistry/plugin-indexes.d.ts.map +1 -1
- package/dist/components/PluginRegistry/plugin-indexes.js +3 -3
- package/dist/components/PluginRegistry/plugin-indexes.js.map +1 -1
- package/dist/components/PluginSpecEditor/DatasourceSpecEditor.d.ts +3 -3
- package/dist/components/PluginSpecEditor/DatasourceSpecEditor.d.ts.map +1 -1
- package/dist/components/PluginSpecEditor/DatasourceSpecEditor.js +3 -3
- package/dist/components/PluginSpecEditor/DatasourceSpecEditor.js.map +1 -1
- package/dist/components/PluginSpecEditor/PluginSpecEditor.d.ts +4 -4
- package/dist/components/PluginSpecEditor/PluginSpecEditor.d.ts.map +1 -1
- package/dist/components/PluginSpecEditor/PluginSpecEditor.js +4 -4
- package/dist/components/PluginSpecEditor/PluginSpecEditor.js.map +1 -1
- package/dist/components/PluginSpecEditor/index.js +1 -1
- package/dist/components/PluginSpecEditor/index.js.map +1 -1
- package/dist/components/SelectionOptionsEditor/SelectionOptionsEditor.d.ts +1 -1
- package/dist/components/SelectionOptionsEditor/SelectionOptionsEditor.d.ts.map +1 -1
- package/dist/components/SelectionOptionsEditor/SelectionOptionsEditor.js +3 -3
- package/dist/components/SelectionOptionsEditor/SelectionOptionsEditor.js.map +1 -1
- package/dist/components/SelectionOptionsEditor/index.js +1 -1
- package/dist/components/SelectionOptionsEditor/index.js.map +1 -1
- package/dist/components/TimeRangeControls/TimeRangeControls.d.ts +4 -4
- package/dist/components/TimeRangeControls/TimeRangeControls.d.ts.map +1 -1
- package/dist/components/TimeRangeControls/TimeRangeControls.js +15 -51
- package/dist/components/TimeRangeControls/TimeRangeControls.js.map +1 -1
- package/dist/components/TimeRangeControls/index.js +1 -1
- package/dist/components/TimeRangeControls/index.js.map +1 -1
- package/dist/components/Variables/VariableEditorForm/VariableEditorForm.d.ts +3 -3
- package/dist/components/Variables/VariableEditorForm/VariableEditorForm.d.ts.map +1 -1
- package/dist/components/Variables/VariableEditorForm/VariableEditorForm.js +11 -11
- package/dist/components/Variables/VariableEditorForm/VariableEditorForm.js.map +1 -1
- package/dist/components/Variables/VariableEditorForm/VariablePreview.d.ts +2 -2
- package/dist/components/Variables/VariableEditorForm/VariablePreview.d.ts.map +1 -1
- package/dist/components/Variables/VariableEditorForm/VariablePreview.js +8 -7
- package/dist/components/Variables/VariableEditorForm/VariablePreview.js.map +1 -1
- package/dist/components/Variables/VariableEditorForm/index.js +3 -3
- package/dist/components/Variables/VariableEditorForm/index.js.map +1 -1
- package/dist/components/Variables/VariableEditorForm/variable-editor-form-model.d.ts +2 -2
- package/dist/components/Variables/VariableEditorForm/variable-editor-form-model.d.ts.map +1 -1
- package/dist/components/Variables/VariableEditorForm/variable-editor-form-model.js +6 -6
- package/dist/components/Variables/VariableEditorForm/variable-editor-form-model.js.map +1 -1
- package/dist/components/Variables/index.js +2 -2
- package/dist/components/Variables/index.js.map +1 -1
- package/dist/components/Variables/variable-model.d.ts +4 -4
- package/dist/components/Variables/variable-model.d.ts.map +1 -1
- package/dist/components/Variables/variable-model.js +3 -3
- package/dist/components/Variables/variable-model.js.map +1 -1
- package/dist/components/index.js +21 -21
- package/dist/components/index.js.map +1 -1
- package/dist/constants/index.js +2 -2
- package/dist/constants/index.js.map +1 -1
- package/dist/context/ValidationProvider.d.ts +5 -5
- package/dist/context/ValidationProvider.d.ts.map +1 -1
- package/dist/context/ValidationProvider.js +5 -5
- package/dist/context/ValidationProvider.js.map +1 -1
- package/dist/context/index.js +1 -1
- package/dist/context/index.js.map +1 -1
- package/dist/index.js +9 -9
- package/dist/index.js.map +1 -1
- package/dist/model/alerts-queries.d.ts +4 -4
- package/dist/model/alerts-queries.d.ts.map +1 -1
- package/dist/model/alerts-queries.js.map +1 -1
- package/dist/model/annotations.d.ts +3 -3
- package/dist/model/annotations.d.ts.map +1 -1
- package/dist/model/annotations.js.map +1 -1
- package/dist/model/calculations.d.ts +1 -1
- package/dist/model/calculations.d.ts.map +1 -1
- package/dist/model/calculations.js.map +1 -1
- package/dist/model/datasource.d.ts +2 -2
- package/dist/model/datasource.d.ts.map +1 -1
- package/dist/model/datasource.js.map +1 -1
- package/dist/model/explore.d.ts +2 -2
- package/dist/model/explore.d.ts.map +1 -1
- package/dist/model/explore.js.map +1 -1
- package/dist/model/index.js +17 -17
- package/dist/model/index.js.map +1 -1
- package/dist/model/json-queries.d.ts +3 -3
- package/dist/model/json-queries.d.ts.map +1 -1
- package/dist/model/json-queries.js.map +1 -1
- package/dist/model/legend.d.ts +2 -2
- package/dist/model/legend.d.ts.map +1 -1
- package/dist/model/legend.js +2 -2
- package/dist/model/legend.js.map +1 -1
- package/dist/model/log-queries.d.ts +3 -3
- package/dist/model/log-queries.d.ts.map +1 -1
- package/dist/model/log-queries.js.map +1 -1
- package/dist/model/panels.d.ts +4 -4
- package/dist/model/panels.d.ts.map +1 -1
- package/dist/model/panels.js.map +1 -1
- package/dist/model/plugin-base.d.ts +1 -1
- package/dist/model/plugin-base.d.ts.map +1 -1
- package/dist/model/plugin-base.js.map +1 -1
- package/dist/model/plugin-loading.d.ts +1 -1
- package/dist/model/plugin-loading.d.ts.map +1 -1
- package/dist/model/plugin-loading.js +1 -1
- package/dist/model/plugin-loading.js.map +1 -1
- package/dist/model/plugins.d.ts +14 -14
- package/dist/model/plugins.d.ts.map +1 -1
- package/dist/model/plugins.js.map +1 -1
- package/dist/model/profile-queries.d.ts +4 -4
- package/dist/model/profile-queries.d.ts.map +1 -1
- package/dist/model/profile-queries.js.map +1 -1
- package/dist/model/silences-queries.d.ts +4 -4
- package/dist/model/silences-queries.d.ts.map +1 -1
- package/dist/model/silences-queries.js.map +1 -1
- package/dist/model/time-series-queries.d.ts +4 -4
- package/dist/model/time-series-queries.d.ts.map +1 -1
- package/dist/model/time-series-queries.js.map +1 -1
- package/dist/model/trace-queries.d.ts +4 -4
- package/dist/model/trace-queries.d.ts.map +1 -1
- package/dist/model/trace-queries.js.map +1 -1
- package/dist/model/variables.d.ts +3 -3
- package/dist/model/variables.d.ts.map +1 -1
- package/dist/model/variables.js.map +1 -1
- package/dist/remote/PluginLoaderComponent.d.ts +1 -1
- package/dist/remote/PluginLoaderComponent.d.ts.map +1 -1
- package/dist/remote/PluginLoaderComponent.js +2 -2
- package/dist/remote/PluginLoaderComponent.js.map +1 -1
- package/dist/remote/PluginRuntime.d.ts +11 -2
- package/dist/remote/PluginRuntime.d.ts.map +1 -1
- package/dist/remote/PluginRuntime.js +65 -54
- package/dist/remote/PluginRuntime.js.map +1 -1
- package/dist/remote/index.d.ts +1 -0
- package/dist/remote/index.d.ts.map +1 -1
- package/dist/remote/index.js +3 -2
- package/dist/remote/index.js.map +1 -1
- package/dist/remote/remotePluginLoader.d.ts +2 -2
- package/dist/remote/remotePluginLoader.d.ts.map +1 -1
- package/dist/remote/remotePluginLoader.js +3 -3
- package/dist/remote/remotePluginLoader.js.map +1 -1
- package/dist/runtime/DataQueriesProvider/DataQueriesProvider.d.ts +3 -3
- package/dist/runtime/DataQueriesProvider/DataQueriesProvider.d.ts.map +1 -1
- package/dist/runtime/DataQueriesProvider/DataQueriesProvider.js +10 -10
- package/dist/runtime/DataQueriesProvider/DataQueriesProvider.js.map +1 -1
- package/dist/runtime/DataQueriesProvider/index.js +2 -2
- package/dist/runtime/DataQueriesProvider/index.js.map +1 -1
- package/dist/runtime/DataQueriesProvider/model.d.ts +3 -3
- package/dist/runtime/DataQueriesProvider/model.d.ts.map +1 -1
- package/dist/runtime/DataQueriesProvider/model.js.map +1 -1
- package/dist/runtime/RouterProvider.d.ts +2 -1
- package/dist/runtime/RouterProvider.d.ts.map +1 -1
- package/dist/runtime/RouterProvider.js +3 -3
- package/dist/runtime/RouterProvider.js.map +1 -1
- package/dist/runtime/TimeRangeProvider/TimeRangeProvider.d.ts +3 -2
- package/dist/runtime/TimeRangeProvider/TimeRangeProvider.d.ts.map +1 -1
- package/dist/runtime/TimeRangeProvider/TimeRangeProvider.js +6 -6
- package/dist/runtime/TimeRangeProvider/TimeRangeProvider.js.map +1 -1
- package/dist/runtime/TimeRangeProvider/TimeRangeProviders.d.ts +3 -2
- package/dist/runtime/TimeRangeProvider/TimeRangeProviders.d.ts.map +1 -1
- package/dist/runtime/TimeRangeProvider/TimeRangeProviders.js +4 -4
- package/dist/runtime/TimeRangeProvider/TimeRangeProviders.js.map +1 -1
- package/dist/runtime/TimeRangeProvider/TimeRangeSettingsProvider.d.ts +6 -2
- package/dist/runtime/TimeRangeProvider/TimeRangeSettingsProvider.d.ts.map +1 -1
- package/dist/runtime/TimeRangeProvider/TimeRangeSettingsProvider.js +52 -4
- package/dist/runtime/TimeRangeProvider/TimeRangeSettingsProvider.js.map +1 -1
- package/dist/runtime/TimeRangeProvider/index.js +4 -4
- package/dist/runtime/TimeRangeProvider/index.js.map +1 -1
- package/dist/runtime/TimeRangeProvider/query-params.d.ts +3 -3
- package/dist/runtime/TimeRangeProvider/query-params.d.ts.map +1 -1
- package/dist/runtime/TimeRangeProvider/query-params.js +4 -4
- package/dist/runtime/TimeRangeProvider/query-params.js.map +1 -1
- package/dist/runtime/TimeRangeProvider/refresh-interval.d.ts +1 -1
- package/dist/runtime/TimeRangeProvider/refresh-interval.d.ts.map +1 -1
- package/dist/runtime/TimeRangeProvider/refresh-interval.js +2 -2
- package/dist/runtime/TimeRangeProvider/refresh-interval.js.map +1 -1
- package/dist/runtime/UsageMetricsProvider.d.ts +3 -3
- package/dist/runtime/UsageMetricsProvider.d.ts.map +1 -1
- package/dist/runtime/UsageMetricsProvider.js +3 -3
- package/dist/runtime/UsageMetricsProvider.js.map +1 -1
- package/dist/runtime/alerts-queries.d.ts +2 -2
- package/dist/runtime/alerts-queries.d.ts.map +1 -1
- package/dist/runtime/alerts-queries.js +5 -5
- package/dist/runtime/alerts-queries.js.map +1 -1
- package/dist/runtime/annotations.d.ts +2 -2
- package/dist/runtime/annotations.d.ts.map +1 -1
- package/dist/runtime/annotations.js +6 -6
- package/dist/runtime/annotations.js.map +1 -1
- package/dist/runtime/builtin-variables.d.ts +2 -2
- package/dist/runtime/builtin-variables.d.ts.map +1 -1
- package/dist/runtime/builtin-variables.js +1 -1
- package/dist/runtime/builtin-variables.js.map +1 -1
- package/dist/runtime/datasources.d.ts +2 -2
- package/dist/runtime/datasources.d.ts.map +1 -1
- package/dist/runtime/datasources.js +2 -2
- package/dist/runtime/datasources.js.map +1 -1
- package/dist/runtime/index.js +16 -16
- package/dist/runtime/index.js.map +1 -1
- package/dist/runtime/item-actions.d.ts +3 -3
- package/dist/runtime/item-actions.d.ts.map +1 -1
- package/dist/runtime/item-actions.js +1 -1
- package/dist/runtime/item-actions.js.map +1 -1
- package/dist/runtime/json-queries.d.ts +2 -2
- package/dist/runtime/json-queries.d.ts.map +1 -1
- package/dist/runtime/json-queries.js +4 -4
- package/dist/runtime/json-queries.js.map +1 -1
- package/dist/runtime/log-queries.d.ts +3 -3
- package/dist/runtime/log-queries.d.ts.map +1 -1
- package/dist/runtime/log-queries.js +5 -5
- package/dist/runtime/log-queries.js.map +1 -1
- package/dist/runtime/plugin-registry.d.ts +3 -3
- package/dist/runtime/plugin-registry.d.ts.map +1 -1
- package/dist/runtime/plugin-registry.js +2 -2
- package/dist/runtime/plugin-registry.js.map +1 -1
- package/dist/runtime/profile-queries.d.ts +2 -2
- package/dist/runtime/profile-queries.d.ts.map +1 -1
- package/dist/runtime/profile-queries.js +4 -4
- package/dist/runtime/profile-queries.js.map +1 -1
- package/dist/runtime/silences-queries.d.ts +2 -2
- package/dist/runtime/silences-queries.d.ts.map +1 -1
- package/dist/runtime/silences-queries.js +5 -5
- package/dist/runtime/silences-queries.js.map +1 -1
- package/dist/runtime/time-series-queries.d.ts +3 -3
- package/dist/runtime/time-series-queries.d.ts.map +1 -1
- package/dist/runtime/time-series-queries.js +6 -6
- package/dist/runtime/time-series-queries.js.map +1 -1
- package/dist/runtime/trace-queries.d.ts +2 -2
- package/dist/runtime/trace-queries.d.ts.map +1 -1
- package/dist/runtime/trace-queries.js +6 -6
- package/dist/runtime/trace-queries.js.map +1 -1
- package/dist/runtime/utils.d.ts +1 -1
- package/dist/runtime/utils.d.ts.map +1 -1
- package/dist/runtime/utils.js.map +1 -1
- package/dist/runtime/variables.d.ts +1 -1
- package/dist/runtime/variables.d.ts.map +1 -1
- package/dist/runtime/variables.js +4 -4
- package/dist/runtime/variables.js.map +1 -1
- package/dist/schema/index.js +1 -1
- package/dist/schema/index.js.map +1 -1
- package/dist/schema/panel.d.ts +2 -2
- package/dist/schema/panel.d.ts.map +1 -1
- package/dist/schema/panel.js +2 -2
- package/dist/schema/panel.js.map +1 -1
- package/dist/test/index.js +2 -2
- package/dist/test/index.js.map +1 -1
- package/dist/test/mock-data.d.ts +1 -1
- package/dist/test/mock-data.d.ts.map +1 -1
- package/dist/test/mock-data.js.map +1 -1
- package/dist/test/render-hook.d.ts +2 -2
- package/dist/test/render-hook.d.ts.map +1 -1
- package/dist/test/render-hook.js +2 -2
- package/dist/test/render-hook.js.map +1 -1
- package/dist/test/render.d.ts +3 -3
- package/dist/test/render.d.ts.map +1 -1
- package/dist/test/render.js +3 -3
- package/dist/test/render.js.map +1 -1
- package/dist/test/setup-tests.js +1 -1
- package/dist/test/test-plugins/bert/index.d.ts +3 -3
- package/dist/test/test-plugins/bert/index.d.ts.map +1 -1
- package/dist/test/test-plugins/bert/index.js.map +1 -1
- package/dist/test/test-plugins/ernie/index.d.ts +1 -1
- package/dist/test/test-plugins/ernie/index.d.ts.map +1 -1
- package/dist/test/test-plugins/ernie/index.js.map +1 -1
- package/dist/test/test-plugins/index.d.ts +1 -1
- package/dist/test/test-plugins/index.d.ts.map +1 -1
- package/dist/test/test-plugins/index.js +5 -5
- package/dist/test/test-plugins/index.js.map +1 -1
- package/dist/test/utils.d.ts +2 -2
- package/dist/test/utils.d.ts.map +1 -1
- package/dist/test/utils.js +4 -4
- package/dist/test/utils.js.map +1 -1
- package/dist/test-utils/index.js +1 -1
- package/dist/test-utils/index.js.map +1 -1
- package/dist/test-utils/mock-plugin-registry.d.ts +2 -2
- package/dist/test-utils/mock-plugin-registry.d.ts.map +1 -1
- package/dist/test-utils/mock-plugin-registry.js +1 -1
- package/dist/test-utils/mock-plugin-registry.js.map +1 -1
- package/dist/utils/csv-export.js +1 -1
- package/dist/utils/csv-export.js.map +1 -1
- package/dist/utils/event.js +1 -1
- package/dist/utils/index.js +3 -3
- package/dist/utils/index.js.map +1 -1
- package/dist/utils/variables.js +1 -1
- package/package.json +9 -9
- package/dist/cjs/components/Annotations/AnnotationEditorForm/AnnotationEditorForm.js +0 -283
- package/dist/cjs/components/Annotations/AnnotationEditorForm/AnnotationPreview.js +0 -197
- package/dist/cjs/components/Annotations/AnnotationEditorForm/index.js +0 -30
- package/dist/cjs/components/Annotations/constants.js +0 -23
- package/dist/cjs/components/Annotations/index.js +0 -31
- package/dist/cjs/components/CalculationSelector/CalculationSelector.js +0 -49
- package/dist/cjs/components/CalculationSelector/index.js +0 -30
- package/dist/cjs/components/DatasourceEditorForm/DatasourceEditorForm.js +0 -271
- package/dist/cjs/components/DatasourceEditorForm/index.js +0 -30
- package/dist/cjs/components/DatasourceSelect/DatasourceSelect.js +0 -266
- package/dist/cjs/components/DatasourceSelect/index.js +0 -30
- package/dist/cjs/components/DatasourceTestConnectionButton/DatasourceTestConnectionButton.js +0 -53
- package/dist/cjs/components/DatasourceTestConnectionButton/index.js +0 -30
- package/dist/cjs/components/HTTPSettingsEditor/HTTPSettingsEditor.js +0 -593
- package/dist/cjs/components/HTTPSettingsEditor/index.js +0 -30
- package/dist/cjs/components/ItemSelectionActionsOptionsEditor/ItemSelectionActionsOptionsEditor.js +0 -1175
- package/dist/cjs/components/ItemSelectionActionsOptionsEditor/index.js +0 -30
- package/dist/cjs/components/LayoutEditor/LayoutEditor.js +0 -123
- package/dist/cjs/components/LayoutEditor/RepeatLayoutPreview.js +0 -105
- package/dist/cjs/components/LayoutEditor/RepeatVariableEditor.js +0 -176
- package/dist/cjs/components/LayoutEditor/index.js +0 -32
- package/dist/cjs/components/LegendOptionsEditor/LegendOptionsEditor.js +0 -211
- package/dist/cjs/components/LegendOptionsEditor/index.js +0 -30
- package/dist/cjs/components/LinksEditor/LinksEditor.js +0 -162
- package/dist/cjs/components/LinksEditor/index.js +0 -30
- package/dist/cjs/components/MetricLabelInput/MetricLabelInput.js +0 -41
- package/dist/cjs/components/MetricLabelInput/index.js +0 -30
- package/dist/cjs/components/MultiQueryEditor/MultiQueryEditor.js +0 -162
- package/dist/cjs/components/MultiQueryEditor/QueryEditorContainer.js +0 -250
- package/dist/cjs/components/MultiQueryEditor/index.js +0 -31
- package/dist/cjs/components/MultiQueryEditor/utils.js +0 -36
- package/dist/cjs/components/OptionsEditorRadios/OptionsEditorRadios.js +0 -69
- package/dist/cjs/components/OptionsEditorRadios/index.js +0 -30
- package/dist/cjs/components/OptionsEditorTabPanel/OptionsEditorTabPanel.js +0 -39
- package/dist/cjs/components/OptionsEditorTabPanel/index.js +0 -30
- package/dist/cjs/components/OptionsEditorTabs/OptionsEditorTabs.js +0 -61
- package/dist/cjs/components/OptionsEditorTabs/index.js +0 -30
- package/dist/cjs/components/PanelSpecEditor/PanelAnnotationsEditor.js +0 -246
- package/dist/cjs/components/PanelSpecEditor/PanelSpecEditor.js +0 -144
- package/dist/cjs/components/PanelSpecEditor/index.js +0 -30
- package/dist/cjs/components/PluginEditor/PluginEditor.js +0 -99
- package/dist/cjs/components/PluginEditor/index.js +0 -31
- package/dist/cjs/components/PluginEditor/plugin-editor-api.js +0 -136
- package/dist/cjs/components/PluginKindSelect/PluginKindSelect.js +0 -109
- package/dist/cjs/components/PluginKindSelect/index.js +0 -30
- package/dist/cjs/components/PluginRegistry/PluginRegistry.js +0 -86
- package/dist/cjs/components/PluginRegistry/getPluginSearchHelper.js +0 -92
- package/dist/cjs/components/PluginRegistry/index.js +0 -30
- package/dist/cjs/components/PluginRegistry/plugin-indexes.js +0 -88
- package/dist/cjs/components/PluginSpecEditor/DatasourceSpecEditor.js +0 -70
- package/dist/cjs/components/PluginSpecEditor/PluginSpecEditor.js +0 -69
- package/dist/cjs/components/PluginSpecEditor/index.js +0 -30
- package/dist/cjs/components/SelectionOptionsEditor/SelectionOptionsEditor.js +0 -43
- package/dist/cjs/components/SelectionOptionsEditor/index.js +0 -30
- package/dist/cjs/components/TimeRangeControls/TimeRangeControls.js +0 -235
- package/dist/cjs/components/TimeRangeControls/index.js +0 -30
- package/dist/cjs/components/Variables/VariableEditorForm/VariableEditorForm.js +0 -613
- package/dist/cjs/components/Variables/VariableEditorForm/VariablePreview.js +0 -193
- package/dist/cjs/components/Variables/VariableEditorForm/index.js +0 -32
- package/dist/cjs/components/Variables/VariableEditorForm/variable-editor-form-model.js +0 -143
- package/dist/cjs/components/Variables/index.js +0 -31
- package/dist/cjs/components/Variables/variable-model.js +0 -211
- package/dist/cjs/components/index.js +0 -50
- package/dist/cjs/constants/index.js +0 -31
- package/dist/cjs/constants/repeat.js +0 -32
- package/dist/cjs/constants/user-interface-text.js +0 -32
- package/dist/cjs/context/ValidationProvider.js +0 -77
- package/dist/cjs/context/index.js +0 -30
- package/dist/cjs/index.js +0 -38
- package/dist/cjs/model/alerts-queries.js +0 -16
- package/dist/cjs/model/annotations.js +0 -16
- package/dist/cjs/model/calculations.js +0 -178
- package/dist/cjs/model/datasource.js +0 -16
- package/dist/cjs/model/explore.js +0 -16
- package/dist/cjs/model/index.js +0 -46
- package/dist/cjs/model/json-queries.js +0 -16
- package/dist/cjs/model/legend.js +0 -111
- package/dist/cjs/model/log-queries.js +0 -16
- package/dist/cjs/model/log-volume-utils.js +0 -124
- package/dist/cjs/model/panels.js +0 -16
- package/dist/cjs/model/plugin-base.js +0 -16
- package/dist/cjs/model/plugin-loading.js +0 -56
- package/dist/cjs/model/plugins.js +0 -26
- package/dist/cjs/model/profile-queries.js +0 -16
- package/dist/cjs/model/silences-queries.js +0 -16
- package/dist/cjs/model/time-series-queries.js +0 -26
- package/dist/cjs/model/trace-queries.js +0 -16
- package/dist/cjs/model/variables.js +0 -16
- package/dist/cjs/remote/PersesPlugin.types.js +0 -16
- package/dist/cjs/remote/PluginLoaderComponent.js +0 -87
- package/dist/cjs/remote/PluginRuntime.js +0 -323
- package/dist/cjs/remote/index.js +0 -31
- package/dist/cjs/remote/remotePluginLoader.js +0 -101
- package/dist/cjs/runtime/DataQueriesProvider/DataQueriesProvider.js +0 -162
- package/dist/cjs/runtime/DataQueriesProvider/index.js +0 -31
- package/dist/cjs/runtime/DataQueriesProvider/model.js +0 -34
- package/dist/cjs/runtime/RouterProvider.js +0 -114
- package/dist/cjs/runtime/TimeRangeProvider/TimeRangeProvider.js +0 -215
- package/dist/cjs/runtime/TimeRangeProvider/TimeRangeProviders.js +0 -66
- package/dist/cjs/runtime/TimeRangeProvider/TimeRangeSettingsProvider.js +0 -126
- package/dist/cjs/runtime/TimeRangeProvider/index.js +0 -33
- package/dist/cjs/runtime/TimeRangeProvider/query-params.js +0 -250
- package/dist/cjs/runtime/TimeRangeProvider/refresh-interval.js +0 -30
- package/dist/cjs/runtime/UsageMetricsProvider.js +0 -102
- package/dist/cjs/runtime/alerts-queries.js +0 -101
- package/dist/cjs/runtime/annotations.js +0 -148
- package/dist/cjs/runtime/builtin-variables.js +0 -81
- package/dist/cjs/runtime/datasources.js +0 -80
- package/dist/cjs/runtime/index.js +0 -45
- package/dist/cjs/runtime/item-actions.js +0 -302
- package/dist/cjs/runtime/json-queries.js +0 -70
- package/dist/cjs/runtime/log-queries.js +0 -76
- package/dist/cjs/runtime/plugin-registry.js +0 -135
- package/dist/cjs/runtime/profile-queries.js +0 -73
- package/dist/cjs/runtime/silences-queries.js +0 -101
- package/dist/cjs/runtime/time-series-queries.js +0 -165
- package/dist/cjs/runtime/trace-queries.js +0 -106
- package/dist/cjs/runtime/utils.js +0 -39
- package/dist/cjs/runtime/variables.js +0 -160
- package/dist/cjs/schema/index.js +0 -30
- package/dist/cjs/schema/panel.js +0 -56
- package/dist/cjs/test/index.js +0 -31
- package/dist/cjs/test/mock-data.js +0 -366
- package/dist/cjs/test/render-hook.js +0 -31
- package/dist/cjs/test/render.js +0 -31
- package/dist/cjs/test/setup-tests.js +0 -26
- package/dist/cjs/test/test-plugins/bert/index.js +0 -99
- package/dist/cjs/test/test-plugins/ernie/index.js +0 -149
- package/dist/cjs/test/test-plugins/index.js +0 -81
- package/dist/cjs/test/utils.js +0 -58
- package/dist/cjs/test-utils/index.js +0 -30
- package/dist/cjs/test-utils/mock-plugin-registry.js +0 -81
- package/dist/cjs/utils/csv-export.js +0 -248
- package/dist/cjs/utils/event.js +0 -30
- package/dist/cjs/utils/index.js +0 -32
- package/dist/cjs/utils/variables.js +0 -44
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"variable-editor-form-model.d.ts","sourceRoot":"","sources":["../../../../src/components/Variables/VariableEditorForm/variable-editor-form-model.ts"],"names":[],"mappings":"AAaA,OAAO,EAAE,gBAAgB,EAA0B,gBAAgB,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"variable-editor-form-model.d.ts","sourceRoot":"","sources":["../../../../src/components/Variables/VariableEditorForm/variable-editor-form-model.ts"],"names":[],"mappings":"AAaA,OAAO,KAAK,EAAE,gBAAgB,EAA0B,gBAAgB,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AAEvH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAErD,MAAM,MAAM,cAAc,GACtB,MAAM,GACN,kBAAkB,GAClB,mBAAmB,GACnB,eAAe,GACf,gBAAgB,GAChB,qBAAqB,GACrB,sBAAsB,CAAC;AAE3B,eAAO,MAAM,YAAY,EAAE,MAAM,CAC/B,cAAc,EACd;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,CAAC,KAAK,EAAE,cAAc,EAAE,KAAK,cAAc,EAAE,CAAA;CAAE,CA4CvE,CAAC;AAEF,MAAM,MAAM,mBAAmB,GAAG;IAChC,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,cAAc,GAAG,cAAc,GAAG,iBAAiB,CAAC;IAC1D,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,kBAAkB,EAAE,IAAI,CAAC,gBAAgB,EAAE,MAAM,GAAG,SAAS,CAAC,CAAC;IAC/D,kBAAkB,EAAE,IAAI,CAAC,gBAAgB,EAAE,MAAM,GAAG,SAAS,CAAC,CAAC;CAChE,CAAC;AAEF,wBAAgB,eAAe,CAAC,yBAAyB,EAAE,kBAAkB,GAAG,mBAAmB,CAkClG;AAED,wBAAgB,8BAA8B,CAAC,KAAK,EAAE,mBAAmB,GAAG,kBAAkB,CAgC7F"}
|
|
@@ -20,37 +20,37 @@ export const SORT_METHODS = {
|
|
|
20
20
|
'alphabetical-asc': {
|
|
21
21
|
label: 'Alphabetical, asc',
|
|
22
22
|
sort: (input)=>{
|
|
23
|
-
return input.slice().
|
|
23
|
+
return input.slice().toSorted((a, b)=>a.label > b.label ? 1 : -1);
|
|
24
24
|
}
|
|
25
25
|
},
|
|
26
26
|
'alphabetical-desc': {
|
|
27
27
|
label: 'Alphabetical, desc',
|
|
28
28
|
sort: (input)=>{
|
|
29
|
-
return input.slice().
|
|
29
|
+
return input.slice().toSorted((a, b)=>a.label > b.label ? -1 : 1);
|
|
30
30
|
}
|
|
31
31
|
},
|
|
32
32
|
'numerical-asc': {
|
|
33
33
|
label: 'Numerical, asc',
|
|
34
34
|
sort: (input)=>{
|
|
35
|
-
return input.slice().
|
|
35
|
+
return input.slice().toSorted((a, b)=>parseInt(a.label) > parseInt(b.label) ? 1 : -1);
|
|
36
36
|
}
|
|
37
37
|
},
|
|
38
38
|
'numerical-desc': {
|
|
39
39
|
label: 'Numerical, desc',
|
|
40
40
|
sort: (input)=>{
|
|
41
|
-
return input.slice().
|
|
41
|
+
return input.slice().toSorted((a, b)=>parseInt(a.label) < parseInt(b.label) ? 1 : -1);
|
|
42
42
|
}
|
|
43
43
|
},
|
|
44
44
|
'alphabetical-ci-asc': {
|
|
45
45
|
label: 'Alphabetical, case-insensitive, asc',
|
|
46
46
|
sort: (input)=>{
|
|
47
|
-
return input.slice().
|
|
47
|
+
return input.slice().toSorted((a, b)=>a.label.toLowerCase() > b.label.toLowerCase() ? 1 : -1);
|
|
48
48
|
}
|
|
49
49
|
},
|
|
50
50
|
'alphabetical-ci-desc': {
|
|
51
51
|
label: 'Alphabetical, case-insensitive, desc',
|
|
52
52
|
sort: (input)=>{
|
|
53
|
-
return input.slice().
|
|
53
|
+
return input.slice().toSorted((a, b)=>a.label.toLowerCase() > b.label.toLowerCase() ? -1 : 1);
|
|
54
54
|
}
|
|
55
55
|
}
|
|
56
56
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/components/Variables/VariableEditorForm/variable-editor-form-model.ts"],"sourcesContent":["// Copyright The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport { ListVariableSpec, TextVariableDefinition, TextVariableSpec, VariableDefinition } from '@perses-dev/spec';\n\nimport { VariableOption } from '../../../model';\n\nexport type SortMethodName =\n | 'none'\n | 'alphabetical-asc'\n | 'alphabetical-desc'\n | 'numerical-asc'\n | 'numerical-desc'\n | 'alphabetical-ci-asc'\n | 'alphabetical-ci-desc';\n\nexport const SORT_METHODS: Record<\n SortMethodName,\n { label: string; sort: (input: VariableOption[]) => VariableOption[] }\n> = {\n none: {\n label: 'None',\n sort: (input: VariableOption[]): VariableOption[] => {\n return input.slice();\n },\n },\n 'alphabetical-asc': {\n label: 'Alphabetical, asc',\n sort: (input: VariableOption[]): VariableOption[] => {\n return input.slice().
|
|
1
|
+
{"version":3,"sources":["../../../../src/components/Variables/VariableEditorForm/variable-editor-form-model.ts"],"sourcesContent":["// Copyright The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport type { ListVariableSpec, TextVariableDefinition, TextVariableSpec, VariableDefinition } from '@perses-dev/spec';\n\nimport type { VariableOption } from '../../../model';\n\nexport type SortMethodName =\n | 'none'\n | 'alphabetical-asc'\n | 'alphabetical-desc'\n | 'numerical-asc'\n | 'numerical-desc'\n | 'alphabetical-ci-asc'\n | 'alphabetical-ci-desc';\n\nexport const SORT_METHODS: Record<\n SortMethodName,\n { label: string; sort: (input: VariableOption[]) => VariableOption[] }\n> = {\n none: {\n label: 'None',\n sort: (input: VariableOption[]): VariableOption[] => {\n return input.slice();\n },\n },\n 'alphabetical-asc': {\n label: 'Alphabetical, asc',\n sort: (input: VariableOption[]): VariableOption[] => {\n return input.slice().toSorted((a, b) => (a.label > b.label ? 1 : -1));\n },\n },\n 'alphabetical-desc': {\n label: 'Alphabetical, desc',\n sort: (input: VariableOption[]): VariableOption[] => {\n return input.slice().toSorted((a, b) => (a.label > b.label ? -1 : 1));\n },\n },\n 'numerical-asc': {\n label: 'Numerical, asc',\n sort: (input: VariableOption[]): VariableOption[] => {\n return input.slice().toSorted((a, b) => (parseInt(a.label) > parseInt(b.label) ? 1 : -1));\n },\n },\n 'numerical-desc': {\n label: 'Numerical, desc',\n sort: (input: VariableOption[]): VariableOption[] => {\n return input.slice().toSorted((a, b) => (parseInt(a.label) < parseInt(b.label) ? 1 : -1));\n },\n },\n 'alphabetical-ci-asc': {\n label: 'Alphabetical, case-insensitive, asc',\n sort: (input: VariableOption[]): VariableOption[] => {\n return input.slice().toSorted((a, b) => (a.label.toLowerCase() > b.label.toLowerCase() ? 1 : -1));\n },\n },\n 'alphabetical-ci-desc': {\n label: 'Alphabetical, case-insensitive, desc',\n sort: (input: VariableOption[]): VariableOption[] => {\n return input.slice().toSorted((a, b) => (a.label.toLowerCase() > b.label.toLowerCase() ? -1 : 1));\n },\n },\n};\n\nexport type VariableEditorState = {\n name: string;\n title?: string;\n kind: 'TextVariable' | 'ListVariable' | 'BuiltinVariable';\n description?: string;\n listVariableFields: Omit<ListVariableSpec, 'name' | 'display'>;\n textVariableFields: Omit<TextVariableSpec, 'name' | 'display'>;\n};\n\nexport function getInitialState(initialVariableDefinition: VariableDefinition): VariableEditorState {\n const textVariableFields: Omit<TextVariableSpec, 'name' | 'display'> = {\n value: (initialVariableDefinition as TextVariableDefinition).spec.value ?? '',\n constant: (initialVariableDefinition as TextVariableDefinition).spec.constant ?? false,\n };\n\n const listVariableFields: Omit<ListVariableSpec, 'name' | 'display'> = {\n allowMultiple: false,\n allowAllValue: false,\n customAllValue: undefined,\n capturingRegexp: undefined,\n sort: undefined,\n plugin: {\n kind: '',\n spec: {},\n },\n };\n if (initialVariableDefinition.kind === 'ListVariable') {\n listVariableFields.allowMultiple = initialVariableDefinition.spec.allowMultiple ?? false;\n listVariableFields.allowAllValue = initialVariableDefinition.spec.allowAllValue ?? false;\n listVariableFields.customAllValue = initialVariableDefinition.spec.customAllValue;\n listVariableFields.capturingRegexp = initialVariableDefinition.spec.capturingRegexp;\n listVariableFields.sort = initialVariableDefinition.spec.sort;\n listVariableFields.plugin = initialVariableDefinition.spec.plugin;\n }\n\n return {\n name: initialVariableDefinition.spec.name,\n title: initialVariableDefinition.spec.display?.name ?? '',\n kind: initialVariableDefinition.kind,\n description: initialVariableDefinition.spec.display?.description ?? '',\n listVariableFields,\n textVariableFields,\n };\n}\n\nexport function getVariableDefinitionFromState(state: VariableEditorState): VariableDefinition {\n const { name, title, kind, description } = state;\n\n const display = { name: title, description: description };\n\n if (kind === 'TextVariable') {\n return {\n kind,\n spec: {\n name,\n display,\n ...state.textVariableFields,\n },\n };\n }\n\n if (kind === 'ListVariable') {\n return {\n kind,\n spec: {\n name,\n display,\n allowMultiple: state.listVariableFields.allowMultiple,\n allowAllValue: state.listVariableFields.allowAllValue,\n customAllValue: state.listVariableFields.customAllValue,\n capturingRegexp: state.listVariableFields.capturingRegexp,\n sort: state.listVariableFields.sort,\n plugin: state.listVariableFields.plugin,\n },\n };\n }\n throw new Error(`Unknown variable kind: ${kind}`);\n}\n"],"names":["SORT_METHODS","none","label","sort","input","slice","toSorted","a","b","parseInt","toLowerCase","getInitialState","initialVariableDefinition","textVariableFields","value","spec","constant","listVariableFields","allowMultiple","allowAllValue","customAllValue","undefined","capturingRegexp","plugin","kind","name","title","display","description","getVariableDefinitionFromState","state","Error"],"mappings":"AAAA,+BAA+B;AAC/B,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAejC,OAAO,MAAMA,eAGT;IACFC,MAAM;QACJC,OAAO;QACPC,MAAM,CAACC;YACL,OAAOA,MAAMC,KAAK;QACpB;IACF;IACA,oBAAoB;QAClBH,OAAO;QACPC,MAAM,CAACC;YACL,OAAOA,MAAMC,KAAK,GAAGC,QAAQ,CAAC,CAACC,GAAGC,IAAOD,EAAEL,KAAK,GAAGM,EAAEN,KAAK,GAAG,IAAI,CAAC;QACpE;IACF;IACA,qBAAq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,kBAAkB,CAACd,IAAI;gBACnCoB,QAAQO,MAAMb,kBAAkB,CAACM,MAAM;YACzC;QACF;IACF;IACA,MAAM,IAAIQ,MAAM,CAAC,uBAAuB,EAAEP,MAAM;AAClD"}
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
11
11
|
// See the License for the specific language governing permissions and
|
|
12
12
|
// limitations under the License.
|
|
13
|
-
export * from
|
|
14
|
-
export * from
|
|
13
|
+
export * from "./variable-model.js";
|
|
14
|
+
export * from "./VariableEditorForm/index.js";
|
|
15
15
|
|
|
16
16
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/components/Variables/index.ts"],"sourcesContent":["// Copyright The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nexport * from './variable-model';\nexport * from './VariableEditorForm';\n"],"names":[],"mappings":"AAAA,+BAA+B;AAC/B,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAEjC,cAAc,
|
|
1
|
+
{"version":3,"sources":["../../../src/components/Variables/index.ts"],"sourcesContent":["// Copyright The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nexport * from './variable-model';\nexport * from './VariableEditorForm';\n"],"names":[],"mappings":"AAAA,+BAA+B;AAC/B,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAEjC,cAAc,sBAAmB;AACjC,cAAc,gCAAuB"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { ListVariableDefinition, VariableDefinition, VariableValue } from '@perses-dev/spec';
|
|
2
|
-
import { UseQueryResult } from '@tanstack/react-query';
|
|
3
|
-
import { VariableOption } from '../../model';
|
|
4
|
-
import { VariableStateMap } from '../../runtime';
|
|
1
|
+
import type { ListVariableDefinition, VariableDefinition, VariableValue } from '@perses-dev/spec';
|
|
2
|
+
import type { UseQueryResult } from '@tanstack/react-query';
|
|
3
|
+
import type { VariableOption } from '../../model';
|
|
4
|
+
import type { VariableStateMap } from '../../runtime';
|
|
5
5
|
export declare function filterVariableList(data: VariableOption[], capturedRegexp: RegExp): VariableOption[];
|
|
6
6
|
export declare function useListVariablePluginValues(definition: ListVariableDefinition): UseQueryResult<VariableOption[]>;
|
|
7
7
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"variable-model.d.ts","sourceRoot":"","sources":["../../../src/components/Variables/variable-model.ts"],"names":[],"mappings":"AAaA,OAAO,EAAE,sBAAsB,EAAE,kBAAkB,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"variable-model.d.ts","sourceRoot":"","sources":["../../../src/components/Variables/variable-model.ts"],"names":[],"mappings":"AAaA,OAAO,KAAK,EAAE,sBAAsB,EAAE,kBAAkB,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAClG,OAAO,KAAK,EAAmB,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAI7E,OAAO,KAAK,EAA6B,cAAc,EAAkB,MAAM,aAAa,CAAC;AAC7F,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AAGtD,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,cAAc,EAAE,EAAE,cAAc,EAAE,MAAM,GAAG,cAAc,EAAE,CAqBnG;AAgDD,wBAAgB,2BAA2B,CAAC,UAAU,EAAE,sBAAsB,GAAG,cAAc,CAAC,cAAc,EAAE,CAAC,CAahH;AAcD;;;GAGG;AACH,wBAAgB,4BAA4B,CAAC,mBAAmB,EAAE,kBAAkB,EAAE,GAAG;IACvF,qBAAqB,EAAE,MAAM,CAAC,MAAM,EAAE,aAAa,CAAC,CAAC;IACrD,SAAS,EAAE,OAAO,CAAC;CACpB,CAqEA;AAED;;GAEG;AACH,wBAAgB,oBAAoB,CAAC,CAAC,EAAE,gBAAgB,GAAG,MAAM,CAIhE;AAED,eAAO,MAAM,cAAc;;;;;;EAGjB,CAAC"}
|
|
@@ -10,9 +10,9 @@
|
|
|
10
10
|
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
11
11
|
// See the License for the specific language governing permissions and
|
|
12
12
|
// limitations under the License.
|
|
13
|
-
import { useQueries, useQuery } from
|
|
14
|
-
import { useCallback, useMemo, useState } from
|
|
15
|
-
import { useAllVariableValues, useDatasourceStore, usePlugin, usePlugins, useTimeRange } from
|
|
13
|
+
import { useQueries, useQuery } from "@tanstack/react-query";
|
|
14
|
+
import { useCallback, useMemo, useState } from "react";
|
|
15
|
+
import { useAllVariableValues, useDatasourceStore, usePlugin, usePlugins, useTimeRange } from "../../runtime/index.js";
|
|
16
16
|
export function filterVariableList(data, capturedRegexp) {
|
|
17
17
|
const result = [];
|
|
18
18
|
const filteredSet = new Set();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/components/Variables/variable-model.ts"],"sourcesContent":["// Copyright The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport { ListVariableDefinition, VariableDefinition, VariableValue } from '@perses-dev/spec';\nimport { useQueries, useQuery, UseQueryOptions, UseQueryResult } from '@tanstack/react-query';\nimport { useCallback, useMemo, useState } from 'react';\n\nimport { GetVariableOptionsContext, VariableOption, VariablePlugin } from '../../model';\nimport {\n useAllVariableValues,\n useDatasourceStore,\n usePlugin,\n usePlugins,\n useTimeRange,\n VariableStateMap,\n} from '../../runtime';\n\nexport function filterVariableList(data: VariableOption[], capturedRegexp: RegExp): VariableOption[] {\n const result: VariableOption[] = [];\n const filteredSet = new Set<string>();\n for (const variableValue of data) {\n const matches = variableValue.value.matchAll(capturedRegexp);\n let concat = '';\n for (const match of matches) {\n for (let i = 1; i < match.length; i++) {\n const m = match[i];\n if (m !== undefined) {\n concat = `${concat}${m}`;\n }\n }\n }\n if (concat !== '' && !filteredSet.has(concat)) {\n // like that we are avoiding to have duplicating variable value\n filteredSet.add(concat);\n result.push({ label: variableValue.label, value: concat });\n }\n }\n return result;\n}\n\nfunction useVariablePluginContext(): GetVariableOptionsContext {\n const datasourceStore = useDatasourceStore();\n const allVariables = useAllVariableValues();\n const { absoluteTimeRange: timeRange } = useTimeRange();\n\n return { timeRange, datasourceStore, variables: allVariables };\n}\n\nconst getVariableQueryConfig = (\n definition: ListVariableDefinition,\n variablePluginCtx: GetVariableOptionsContext,\n variablePlugin: VariablePlugin | undefined,\n enabled: boolean,\n onFetched?: (name: string, options: VariableOption[], definition: ListVariableDefinition) => void,\n): UseQueryOptions<VariableOption[]> => {\n const capturingRegexp =\n definition.spec.capturingRegexp !== undefined ? new RegExp(definition.spec.capturingRegexp, 'g') : undefined;\n const variablesValueKey = getVariableValuesKey(variablePluginCtx.variables);\n return {\n queryKey: ['variable', definition, variablePluginCtx.timeRange, variablesValueKey],\n queryFn: async ({ signal }): Promise<VariableOption[]> => {\n const resp = await variablePlugin?.getVariableOptions(definition.spec.plugin.spec, variablePluginCtx, signal);\n if (!resp?.data?.length) {\n onFetched?.(definition.spec.name, [], definition);\n return [];\n }\n const options = capturingRegexp ? filterVariableList(resp.data, capturingRegexp) : resp.data;\n onFetched?.(definition.spec.name, options, definition);\n return options;\n },\n enabled,\n };\n};\n\nfunction resolveDependsOnVariables(\n variablePlugin: VariablePlugin | undefined,\n variablePluginCtx: GetVariableOptionsContext,\n definition: ListVariableDefinition,\n): string[] {\n if (variablePlugin?.dependsOn) {\n const dependencies = variablePlugin.dependsOn(definition.spec.plugin.spec, variablePluginCtx);\n return dependencies.variables ? dependencies.variables.filter((v) => v !== definition.spec.name) : []; // Exclude self variable to avoid circular dependency and default to empty array to avoid deadlock\n }\n return [];\n}\n\nexport function useListVariablePluginValues(definition: ListVariableDefinition): UseQueryResult<VariableOption[]> {\n const { data: variablePlugin } = usePlugin('Variable', definition.spec.plugin.kind);\n\n const variablePluginCtx = useVariablePluginContext();\n\n const dependsOnVariables = resolveDependsOnVariables(variablePlugin, variablePluginCtx, definition);\n\n const dependentVariables = useAllVariableValues(dependsOnVariables);\n const waitToLoad = dependsOnVariables.some((v) => dependentVariables[v]?.loading);\n\n const ctx = { ...variablePluginCtx, variables: dependentVariables };\n\n return useQuery(getVariableQueryConfig(definition, ctx, variablePlugin, !!variablePlugin && !waitToLoad));\n}\n\nfunction resolveDefaultValue(definition: ListVariableDefinition, options: VariableOption[]): VariableValue {\n const { defaultValue, allowMultiple } = definition.spec;\n if (defaultValue !== undefined && defaultValue !== null) {\n return defaultValue;\n }\n if (options[0]?.value) {\n const first = options[0].value;\n return allowMultiple ? [first] : first;\n }\n return allowMultiple ? [] : '';\n}\n\n/**\n * Resolves initial values for all ListVariable definitions by fetching their options in dependency order.\n * Returns a map of variable names to their resolved default values, merging with any already-provided outer variables.\n */\nexport function useResolveListVariableValues(variableDefinitions: VariableDefinition[]): {\n initialVariableValues: Record<string, VariableValue>;\n isLoading: boolean;\n} {\n const { timeRange, datasourceStore, variables: outerVariableValues } = useVariablePluginContext();\n\n const listVariables = useMemo(\n () => variableDefinitions.filter((v): v is ListVariableDefinition => v.kind === 'ListVariable'),\n [variableDefinitions],\n );\n\n const pluginResults = usePlugins(\n 'Variable',\n listVariables.map((d) => ({ kind: d.spec.plugin.kind })),\n );\n\n // Resolved variable state. Updated by onFetched when queries resolve.\n // Needed because of dependencies between variables that require multiple rounds of fetching.\n const [resolvedVariables, setResolvedVariables] = useState<VariableStateMap>({});\n\n const allVariables = useMemo(() => {\n return { ...outerVariableValues, ...resolvedVariables };\n }, [outerVariableValues, resolvedVariables]);\n\n const onFetched = useCallback((name: string, options: VariableOption[], definition: ListVariableDefinition) => {\n setResolvedVariables((prev) => ({\n ...prev,\n [name]: { value: resolveDefaultValue(definition, options), loading: false, options },\n }));\n }, []);\n\n const queryResults = useQueries({\n queries: listVariables.map((definition, index) => {\n const plugin = pluginResults[index]?.data;\n const isPluginLoading = pluginResults[index]?.isLoading ?? true;\n\n const dependsOn = resolveDependsOnVariables(\n plugin,\n { timeRange, datasourceStore, variables: allVariables },\n definition,\n );\n\n const hasPendingDeps = dependsOn.some(\n (v) =>\n (resolvedVariables[v] === undefined && listVariables.some((lv) => lv.spec.name === v)) ||\n allVariables[v]?.loading,\n );\n\n const dependentVariables: VariableStateMap = {};\n for (const v of dependsOn) {\n const state = allVariables[v];\n if (state) {\n dependentVariables[v] = state;\n }\n }\n\n const ctx = { timeRange, datasourceStore, variables: dependentVariables };\n return getVariableQueryConfig(definition, ctx, plugin, !hasPendingDeps && !isPluginLoading, onFetched);\n }),\n });\n\n const initialVariableValues: Record<string, VariableValue> = useMemo(\n () =>\n Object.fromEntries(\n Object.entries(allVariables)\n .filter(([, state]) => state?.value !== undefined)\n .map(([name, state]) => [name, state!.value]),\n ),\n [allVariables],\n );\n\n return { initialVariableValues, isLoading: queryResults.some((r) => r.isLoading) };\n}\n\n/**\n * Returns a serialized string of the current state of variable values.\n */\nexport function getVariableValuesKey(v: VariableStateMap): string {\n return Object.values(v)\n .map((v) => JSON.stringify(v.value))\n .join(',');\n}\n\nexport const VARIABLE_TYPES = [\n { label: 'List', kind: 'ListVariable' },\n { label: 'Text', kind: 'TextVariable' },\n] as const;\n"],"names":["useQueries","useQuery","useCallback","useMemo","useState","useAllVariableValues","useDatasourceStore","usePlugin","usePlugins","useTimeRange","filterVariableList","data","capturedRegexp","result","filteredSet","Set","variableValue","matches","value","matchAll","concat","match","i","length","m","undefined","has","add","push","label","useVariablePluginContext","datasourceStore","allVariables","absoluteTimeRange","timeRange","variables","getVariableQueryConfig","definition","variablePluginCtx","variablePlugin","enabled","onFetched","capturingRegexp","spec","RegExp","variablesValueKey","getVariableValuesKey","queryKey","queryFn","signal","resp","getVariableOptions","plugin","name","options","resolveDependsOnVariables","dependsOn","dependencies","filter","v","useListVariablePluginValues","kind","dependsOnVariables","dependentVariables","waitToLoad","some","loading","ctx","resolveDefaultValue","defaultValue","allowMultiple","first","useResolveListVariableValues","variableDefinitions","outerVariableValues","listVariables","pluginResults","map","d","resolvedVariables","setResolvedVariables","prev","queryResults","queries","index","isPluginLoading","isLoading","hasPendingDeps","lv","state","initialVariableValues","Object","fromEntries","entries","r","values","JSON","stringify","join","VARIABLE_TYPES"],"mappings":"AAAA,+BAA+B;AAC/B,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAGjC,SAASA,UAAU,EAAEC,QAAQ,QAAyC,wBAAwB;AAC9F,SAASC,WAAW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qBAAqBa,CAAmB;IACtD,OAAOgC,OAAOI,MAAM,CAACpC,GAClBkB,GAAG,CAAC,CAAClB,IAAMqC,KAAKC,SAAS,CAACtC,EAAEzC,KAAK,GACjCgF,IAAI,CAAC;AACV;AAEA,OAAO,MAAMC,iBAAiB;IAC5B;QAAEtE,OAAO;QAAQgC,MAAM;IAAe;IACtC;QAAEhC,OAAO;QAAQgC,MAAM;IAAe;CACvC,CAAU"}
|
|
1
|
+
{"version":3,"sources":["../../../src/components/Variables/variable-model.ts"],"sourcesContent":["// Copyright The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport type { ListVariableDefinition, VariableDefinition, VariableValue } from '@perses-dev/spec';\nimport type { UseQueryOptions, UseQueryResult } from '@tanstack/react-query';\nimport { useQueries, useQuery } from '@tanstack/react-query';\nimport { useCallback, useMemo, useState } from 'react';\n\nimport type { GetVariableOptionsContext, VariableOption, VariablePlugin } from '../../model';\nimport type { VariableStateMap } from '../../runtime';\nimport { useAllVariableValues, useDatasourceStore, usePlugin, usePlugins, useTimeRange } from '../../runtime';\n\nexport function filterVariableList(data: VariableOption[], capturedRegexp: RegExp): VariableOption[] {\n const result: VariableOption[] = [];\n const filteredSet = new Set<string>();\n for (const variableValue of data) {\n const matches = variableValue.value.matchAll(capturedRegexp);\n let concat = '';\n for (const match of matches) {\n for (let i = 1; i < match.length; i++) {\n const m = match[i];\n if (m !== undefined) {\n concat = `${concat}${m}`;\n }\n }\n }\n if (concat !== '' && !filteredSet.has(concat)) {\n // like that we are avoiding to have duplicating variable value\n filteredSet.add(concat);\n result.push({ label: variableValue.label, value: concat });\n }\n }\n return result;\n}\n\nfunction useVariablePluginContext(): GetVariableOptionsContext {\n const datasourceStore = useDatasourceStore();\n const allVariables = useAllVariableValues();\n const { absoluteTimeRange: timeRange } = useTimeRange();\n\n return { timeRange, datasourceStore, variables: allVariables };\n}\n\nconst getVariableQueryConfig = (\n definition: ListVariableDefinition,\n variablePluginCtx: GetVariableOptionsContext,\n variablePlugin: VariablePlugin | undefined,\n enabled: boolean,\n onFetched?: (name: string, options: VariableOption[], definition: ListVariableDefinition) => void,\n): UseQueryOptions<VariableOption[]> => {\n const capturingRegexp =\n definition.spec.capturingRegexp !== undefined ? new RegExp(definition.spec.capturingRegexp, 'g') : undefined;\n const variablesValueKey = getVariableValuesKey(variablePluginCtx.variables);\n return {\n queryKey: ['variable', definition, variablePluginCtx.timeRange, variablesValueKey],\n queryFn: async ({ signal }): Promise<VariableOption[]> => {\n const resp = await variablePlugin?.getVariableOptions(definition.spec.plugin.spec, variablePluginCtx, signal);\n if (!resp?.data?.length) {\n onFetched?.(definition.spec.name, [], definition);\n return [];\n }\n const options = capturingRegexp ? filterVariableList(resp.data, capturingRegexp) : resp.data;\n onFetched?.(definition.spec.name, options, definition);\n return options;\n },\n enabled,\n };\n};\n\nfunction resolveDependsOnVariables(\n variablePlugin: VariablePlugin | undefined,\n variablePluginCtx: GetVariableOptionsContext,\n definition: ListVariableDefinition,\n): string[] {\n if (variablePlugin?.dependsOn) {\n const dependencies = variablePlugin.dependsOn(definition.spec.plugin.spec, variablePluginCtx);\n return dependencies.variables ? dependencies.variables.filter((v) => v !== definition.spec.name) : []; // Exclude self variable to avoid circular dependency and default to empty array to avoid deadlock\n }\n return [];\n}\n\nexport function useListVariablePluginValues(definition: ListVariableDefinition): UseQueryResult<VariableOption[]> {\n const { data: variablePlugin } = usePlugin('Variable', definition.spec.plugin.kind);\n\n const variablePluginCtx = useVariablePluginContext();\n\n const dependsOnVariables = resolveDependsOnVariables(variablePlugin, variablePluginCtx, definition);\n\n const dependentVariables = useAllVariableValues(dependsOnVariables);\n const waitToLoad = dependsOnVariables.some((v) => dependentVariables[v]?.loading);\n\n const ctx = { ...variablePluginCtx, variables: dependentVariables };\n\n return useQuery(getVariableQueryConfig(definition, ctx, variablePlugin, !!variablePlugin && !waitToLoad));\n}\n\nfunction resolveDefaultValue(definition: ListVariableDefinition, options: VariableOption[]): VariableValue {\n const { defaultValue, allowMultiple } = definition.spec;\n if (defaultValue !== undefined && defaultValue !== null) {\n return defaultValue;\n }\n if (options[0]?.value) {\n const first = options[0].value;\n return allowMultiple ? [first] : first;\n }\n return allowMultiple ? [] : '';\n}\n\n/**\n * Resolves initial values for all ListVariable definitions by fetching their options in dependency order.\n * Returns a map of variable names to their resolved default values, merging with any already-provided outer variables.\n */\nexport function useResolveListVariableValues(variableDefinitions: VariableDefinition[]): {\n initialVariableValues: Record<string, VariableValue>;\n isLoading: boolean;\n} {\n const { timeRange, datasourceStore, variables: outerVariableValues } = useVariablePluginContext();\n\n const listVariables = useMemo(\n () => variableDefinitions.filter((v): v is ListVariableDefinition => v.kind === 'ListVariable'),\n [variableDefinitions],\n );\n\n const pluginResults = usePlugins(\n 'Variable',\n listVariables.map((d) => ({ kind: d.spec.plugin.kind })),\n );\n\n // Resolved variable state. Updated by onFetched when queries resolve.\n // Needed because of dependencies between variables that require multiple rounds of fetching.\n const [resolvedVariables, setResolvedVariables] = useState<VariableStateMap>({});\n\n const allVariables = useMemo(() => {\n return { ...outerVariableValues, ...resolvedVariables };\n }, [outerVariableValues, resolvedVariables]);\n\n const onFetched = useCallback((name: string, options: VariableOption[], definition: ListVariableDefinition) => {\n setResolvedVariables((prev) => ({\n ...prev,\n [name]: { value: resolveDefaultValue(definition, options), loading: false, options },\n }));\n }, []);\n\n const queryResults = useQueries({\n queries: listVariables.map((definition, index) => {\n const plugin = pluginResults[index]?.data;\n const isPluginLoading = pluginResults[index]?.isLoading ?? true;\n\n const dependsOn = resolveDependsOnVariables(\n plugin,\n { timeRange, datasourceStore, variables: allVariables },\n definition,\n );\n\n const hasPendingDeps = dependsOn.some(\n (v) =>\n (resolvedVariables[v] === undefined && listVariables.some((lv) => lv.spec.name === v)) ||\n allVariables[v]?.loading,\n );\n\n const dependentVariables: VariableStateMap = {};\n for (const v of dependsOn) {\n const state = allVariables[v];\n if (state) {\n dependentVariables[v] = state;\n }\n }\n\n const ctx = { timeRange, datasourceStore, variables: dependentVariables };\n return getVariableQueryConfig(definition, ctx, plugin, !hasPendingDeps && !isPluginLoading, onFetched);\n }),\n });\n\n const initialVariableValues: Record<string, VariableValue> = useMemo(\n () =>\n Object.fromEntries(\n Object.entries(allVariables)\n .filter(([, state]) => state?.value !== undefined)\n .map(([name, state]) => [name, state!.value]),\n ),\n [allVariables],\n );\n\n return { initialVariableValues, isLoading: queryResults.some((r) => r.isLoading) };\n}\n\n/**\n * Returns a serialized string of the current state of variable values.\n */\nexport function getVariableValuesKey(v: VariableStateMap): string {\n return Object.values(v)\n .map((v) => JSON.stringify(v.value))\n .join(',');\n}\n\nexport const VARIABLE_TYPES = [\n { label: 'List', kind: 'ListVariable' },\n { label: 'Text', kind: 'TextVariable' },\n] as const;\n"],"names":["useQueries","useQuery","useCallback","useMemo","useState","useAllVariableValues","useDatasourceStore","usePlugin","usePlugins","useTimeRange","filterVariableList","data","capturedRegexp","result","filteredSet","Set","variableValue","matches","value","matchAll","concat","match","i","length","m","undefined","has","add","push","label","useVariablePluginContext","datasourceStore","allVariables","absoluteTimeRange","timeRange","variables","getVariableQueryConfig","definition","variablePluginCtx","variablePlugin","enabled","onFetched","capturingRegexp","spec","RegExp","variablesValueKey","getVariableValuesKey","queryKey","queryFn","signal","resp","getVariableOptions","plugin","name","options","resolveDependsOnVariables","dependsOn","dependencies","filter","v","useListVariablePluginValues","kind","dependsOnVariables","dependentVariables","waitToLoad","some","loading","ctx","resolveDefaultValue","defaultValue","allowMultiple","first","useResolveListVariableValues","variableDefinitions","outerVariableValues","listVariables","pluginResults","map","d","resolvedVariables","setResolvedVariables","prev","queryResults","queries","index","isPluginLoading","isLoading","hasPendingDeps","lv","state","initialVariableValues","Object","fromEntries","entries","r","values","JSON","stringify","join","VARIABLE_TYPES"],"mappings":"AAAA,+BAA+B;AAC/B,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAIjC,SAASA,UAAU,EAAEC,QAAQ,QAAQ,wBAAwB;AAC7D,SAASC,WAAW,EAAEC,OAAO,EAAEC,QAAQ,QAAQ,QAAQ;AAIvD,SAASC,oBAAoB,EAAEC,kBAAkB,EAAEC,SAAS,EAAEC,UAAU,EAAEC,YAAY,QAAQ,yBAAgB;AAE9G,OAAO,SAASC,mBAAmBC,IAAsB,EAAEC,cAAsB;IAC/E,MAAMC,SAA2B,EAAE;IACnC,MAAMC,cAAc,IAAIC;IACxB,KAAK,MAAMC,iBAAiBL,KAAM;QAChC,MAAMM,UAAUD,cAAcE,KAAK,CAACC,QAAQ,CAACP;QAC7C,IAAIQ,SAAS;QACb,KAAK,MAAMC,SAASJ,QAAS;YAC3B,IAAK,IAAIK,IAAI,GAAGA,IAAID,MAAME,MAAM,EAAED,IAAK;gBACrC,MAAME,IAAIH,KAAK,CAACC,EAAE;gBAClB,IAAIE,MAAMC,WAAW;oBACnBL,SAAS,GAAGA,SAASI,GAAG;gBAC1B;YACF;QACF;QACA,IAAIJ,WAAW,MAAM,CAACN,YAAYY,GAAG,CAACN,SAAS;YAC7C,+DAA+D;YAC/DN,YAAYa,GAAG,CAACP;YAChBP,OAAOe,IAAI,CAAC;gBAAEC,OAAOb,cAAca,KAAK;gBAAEX,OAAOE;YAAO;QAC1D;IACF;IACA,OAAOP;AACT;AAEA,SAASiB;IACP,MAAMC,kBAAkBzB;IACxB,MAAM0B,eAAe3B;IACrB,MAAM,EAAE4B,mBAAmBC,SAAS,EAAE,GAAGzB;IAEzC,OAAO;QAAEyB;QAAWH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ChBD,OAAOE,OAAO,CAAC7D,cACZ0B,MAAM,CAAC,CAAC,GAAG+B,MAAM,GAAKA,OAAOvE,UAAUO,WACvCoD,GAAG,CAAC,CAAC,CAACxB,MAAMoC,MAAM,GAAK;gBAACpC;gBAAMoC,MAAOvE,KAAK;aAAC,IAElD;QAACc;KAAa;IAGhB,OAAO;QAAE0D;QAAuBJ,WAAWJ,aAAajB,IAAI,CAAC,CAAC6B,IAAMA,EAAER,SAAS;IAAE;AACnF;AAEA;;CAEC,GACD,OAAO,SAASxC,qBAAqBa,CAAmB;IACtD,OAAOgC,OAAOI,MAAM,CAACpC,GAClBkB,GAAG,CAAC,CAAClB,IAAMqC,KAAKC,SAAS,CAACtC,EAAEzC,KAAK,GACjCgF,IAAI,CAAC;AACV;AAEA,OAAO,MAAMC,iBAAiB;IAC5B;QAAEtE,OAAO;QAAQgC,MAAM;IAAe;IACtC;QAAEhC,OAAO;QAAQgC,MAAM;IAAe;CACvC,CAAU"}
|
package/dist/components/index.js
CHANGED
|
@@ -10,26 +10,26 @@
|
|
|
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
|
|
14
|
-
export * from
|
|
15
|
-
export * from
|
|
16
|
-
export * from
|
|
17
|
-
export * from
|
|
18
|
-
export * from
|
|
19
|
-
export * from
|
|
20
|
-
export * from
|
|
21
|
-
export * from
|
|
22
|
-
export * from
|
|
23
|
-
export * from
|
|
24
|
-
export * from
|
|
25
|
-
export * from
|
|
26
|
-
export * from
|
|
27
|
-
export * from
|
|
28
|
-
export * from
|
|
29
|
-
export * from
|
|
30
|
-
export * from
|
|
31
|
-
export * from
|
|
32
|
-
export * from
|
|
33
|
-
export * from
|
|
13
|
+
export * from "./Annotations/index.js";
|
|
14
|
+
export * from "./CalculationSelector/index.js";
|
|
15
|
+
export * from "./DatasourceEditorForm/index.js";
|
|
16
|
+
export * from "./DatasourceSelect/index.js";
|
|
17
|
+
export * from "./HTTPSettingsEditor/index.js";
|
|
18
|
+
export * from "./ItemSelectionActionsOptionsEditor/index.js";
|
|
19
|
+
export * from "./LayoutEditor/index.js";
|
|
20
|
+
export * from "./LegendOptionsEditor/index.js";
|
|
21
|
+
export * from "./LinksEditor/index.js";
|
|
22
|
+
export * from "./MultiQueryEditor/index.js";
|
|
23
|
+
export * from "./OptionsEditorRadios/index.js";
|
|
24
|
+
export * from "./OptionsEditorTabs/index.js";
|
|
25
|
+
export * from "./PanelSpecEditor/index.js";
|
|
26
|
+
export * from "./PluginEditor/index.js";
|
|
27
|
+
export * from "./PluginKindSelect/index.js";
|
|
28
|
+
export * from "./PluginRegistry/index.js";
|
|
29
|
+
export * from "./PluginSpecEditor/index.js";
|
|
30
|
+
export * from "./TimeRangeControls/index.js";
|
|
31
|
+
export * from "./Variables/index.js";
|
|
32
|
+
export * from "./MetricLabelInput/index.js";
|
|
33
|
+
export * from "./DatasourceTestConnectionButton/index.js";
|
|
34
34
|
|
|
35
35
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/components/index.ts"],"sourcesContent":["// Copyright The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nexport * from './Annotations';\nexport * from './CalculationSelector';\nexport * from './DatasourceEditorForm';\nexport * from './DatasourceSelect';\nexport * from './HTTPSettingsEditor';\nexport * from './ItemSelectionActionsOptionsEditor';\nexport * from './LayoutEditor';\nexport * from './LegendOptionsEditor';\nexport * from './LinksEditor';\nexport * from './MultiQueryEditor';\nexport * from './OptionsEditorRadios';\nexport * from './OptionsEditorTabs';\nexport * from './PanelSpecEditor';\nexport * from './PluginEditor';\nexport * from './PluginKindSelect';\nexport * from './PluginRegistry';\nexport * from './PluginSpecEditor';\nexport * from './TimeRangeControls';\nexport * from './Variables';\nexport * from './MetricLabelInput';\nexport * from './DatasourceTestConnectionButton';\n"],"names":[],"mappings":"AAAA,+BAA+B;AAC/B,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAEjC,cAAc,
|
|
1
|
+
{"version":3,"sources":["../../src/components/index.ts"],"sourcesContent":["// Copyright The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nexport * from './Annotations';\nexport * from './CalculationSelector';\nexport * from './DatasourceEditorForm';\nexport * from './DatasourceSelect';\nexport * from './HTTPSettingsEditor';\nexport * from './ItemSelectionActionsOptionsEditor';\nexport * from './LayoutEditor';\nexport * from './LegendOptionsEditor';\nexport * from './LinksEditor';\nexport * from './MultiQueryEditor';\nexport * from './OptionsEditorRadios';\nexport * from './OptionsEditorTabs';\nexport * from './PanelSpecEditor';\nexport * from './PluginEditor';\nexport * from './PluginKindSelect';\nexport * from './PluginRegistry';\nexport * from './PluginSpecEditor';\nexport * from './TimeRangeControls';\nexport * from './Variables';\nexport * from './MetricLabelInput';\nexport * from './DatasourceTestConnectionButton';\n"],"names":[],"mappings":"AAAA,+BAA+B;AAC/B,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAEjC,cAAc,yBAAgB;AAC9B,cAAc,iCAAwB;AACtC,cAAc,kCAAyB;AACvC,cAAc,8BAAqB;AACnC,cAAc,gCAAuB;AACrC,cAAc,+CAAsC;AACpD,cAAc,0BAAiB;AAC/B,cAAc,iCAAwB;AACtC,cAAc,yBAAgB;AAC9B,cAAc,8BAAqB;AACnC,cAAc,iCAAwB;AACtC,cAAc,+BAAsB;AACpC,cAAc,6BAAoB;AAClC,cAAc,0BAAiB;AAC/B,cAAc,8BAAqB;AACnC,cAAc,4BAAmB;AACjC,cAAc,8BAAqB;AACnC,cAAc,+BAAsB;AACpC,cAAc,uBAAc;AAC5B,cAAc,8BAAqB;AACnC,cAAc,4CAAmC"}
|
package/dist/constants/index.js
CHANGED
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
11
11
|
// See the License for the specific language governing permissions and
|
|
12
12
|
// limitations under the License.
|
|
13
|
-
export * from
|
|
14
|
-
export * from
|
|
13
|
+
export * from "./repeat.js";
|
|
14
|
+
export * from "./user-interface-text.js";
|
|
15
15
|
|
|
16
16
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/constants/index.ts"],"sourcesContent":["// Copyright The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nexport * from './repeat';\nexport * from './user-interface-text';\n"],"names":[],"mappings":"AAAA,+BAA+B;AAC/B,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAEjC,cAAc,
|
|
1
|
+
{"version":3,"sources":["../../src/constants/index.ts"],"sourcesContent":["// Copyright The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nexport * from './repeat';\nexport * from './user-interface-text';\n"],"names":[],"mappings":"AAAA,+BAA+B;AAC/B,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAEjC,cAAc,cAAW;AACzB,cAAc,2BAAwB"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { DatasourceDefinition } from '@perses-dev/client';
|
|
2
|
-
import { AnnotationSpec, PluginSchema, VariableDefinition } from '@perses-dev/spec';
|
|
3
|
-
import { ReactElement, ReactNode } from 'react';
|
|
4
|
-
import { z } from 'zod';
|
|
5
|
-
import { PanelEditorValues } from '../model';
|
|
1
|
+
import type { DatasourceDefinition } from '@perses-dev/client';
|
|
2
|
+
import type { AnnotationSpec, PluginSchema, VariableDefinition } from '@perses-dev/spec';
|
|
3
|
+
import type { ReactElement, ReactNode } from 'react';
|
|
4
|
+
import type { z } from 'zod';
|
|
5
|
+
import type { PanelEditorValues } from '../model';
|
|
6
6
|
export interface ValidationSchemas {
|
|
7
7
|
datasourceEditorSchema: z.Schema<DatasourceDefinition>;
|
|
8
8
|
panelEditorSchema: z.Schema<PanelEditorValues>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ValidationProvider.d.ts","sourceRoot":"","sources":["../../src/context/ValidationProvider.tsx"],"names":[],"mappings":"AAaA,OAAO,
|
|
1
|
+
{"version":3,"file":"ValidationProvider.d.ts","sourceRoot":"","sources":["../../src/context/ValidationProvider.tsx"],"names":[],"mappings":"AAaA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,oBAAoB,CAAC;AAE/D,OAAO,KAAK,EAAE,cAAc,EAAE,YAAY,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AAOzF,OAAO,KAAK,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAErD,OAAO,KAAK,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAE7B,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAGlD,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,sBAAsB,EAAE,CAAC,CAAC,MAAM,CAAC,cAAc,CAAC,CAAC;IACjD,+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;IACpE,+BAA+B,CAAC,EAAE,CAAC,YAAY,EAAE,YAAY,KAAK,IAAI,CAAC;CACxE;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,CAwCtF"}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
1
|
// Copyright The Perses Authors
|
|
3
2
|
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
3
|
// you may not use this file except in compliance with the License.
|
|
@@ -11,10 +10,11 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
11
10
|
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12
11
|
// See the License for the specific language governing permissions and
|
|
13
12
|
// limitations under the License.
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
13
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
14
|
+
import { buildDatasourceDefinitionSchema, datasourceDefinitionSchema } from "@perses-dev/client";
|
|
15
|
+
import { annotationSpecSchema, buildAnnotationSpecSchema, buildVariableDefinitionSchema, variableDefinitionSchema } from "@perses-dev/spec";
|
|
16
|
+
import { createContext, useContext, useState } from "react";
|
|
17
|
+
import { buildPanelEditorSchema, panelEditorSchema as defaultPanelEditorSchema } from "../schema/index.js";
|
|
18
18
|
export const ValidationSchemasContext = /*#__PURE__*/ createContext(undefined);
|
|
19
19
|
export function useValidationSchemas() {
|
|
20
20
|
const ctx = useContext(ValidationSchemasContext);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/context/ValidationProvider.tsx"],"sourcesContent":["// Copyright The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport { buildDatasourceDefinitionSchema,
|
|
1
|
+
{"version":3,"sources":["../../src/context/ValidationProvider.tsx"],"sourcesContent":["// Copyright The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport type { DatasourceDefinition } from '@perses-dev/client';\nimport { buildDatasourceDefinitionSchema, datasourceDefinitionSchema } from '@perses-dev/client';\nimport type { AnnotationSpec, PluginSchema, VariableDefinition } from '@perses-dev/spec';\nimport {\n annotationSpecSchema,\n buildAnnotationSpecSchema,\n buildVariableDefinitionSchema,\n variableDefinitionSchema,\n} from '@perses-dev/spec';\nimport type { ReactElement, ReactNode } from 'react';\nimport { createContext, useContext, useState } from 'react';\nimport type { z } from 'zod';\n\nimport type { PanelEditorValues } from '../model';\nimport { buildPanelEditorSchema, panelEditorSchema as defaultPanelEditorSchema } from '../schema';\n\nexport interface ValidationSchemas {\n datasourceEditorSchema: z.Schema<DatasourceDefinition>;\n panelEditorSchema: z.Schema<PanelEditorValues>;\n variableEditorSchema: z.Schema<VariableDefinition>;\n annotationEditorSchema: z.Schema<AnnotationSpec>;\n setDatasourceEditorSchemaPlugin: (pluginSchema: PluginSchema) => void;\n setPanelEditorSchemaPlugin: (pluginSchema: PluginSchema) => void;\n setVariableEditorSchemaPlugin: (pluginSchema: PluginSchema) => void;\n setAnnotationEditorSchemaPlugin?: (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); // TODO I don't get why this does not compile\n const [variableEditorSchema, setVariableEditorSchema] =\n useState<z.Schema<VariableDefinition>>(variableDefinitionSchema);\n const [annotationEditorSchema, setAnnotationEditorSchema] = useState<z.Schema<AnnotationSpec>>(annotationSpecSchema);\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 function setAnnotationEditorSchemaPlugin(pluginSchema: PluginSchema): void {\n setAnnotationEditorSchema(buildAnnotationSpecSchema(pluginSchema));\n }\n\n return (\n <ValidationSchemasContext.Provider\n value={{\n datasourceEditorSchema,\n panelEditorSchema,\n variableEditorSchema,\n annotationEditorSchema,\n setDatasourceEditorSchemaPlugin,\n setPanelEditorSchemaPlugin,\n setVariableEditorSchemaPlugin,\n setAnnotationEditorSchemaPlugin,\n }}\n >\n {children}\n </ValidationSchemasContext.Provider>\n );\n}\n"],"names":["buildDatasourceDefinitionSchema","datasourceDefinitionSchema","annotationSpecSchema","buildAnnotationSpecSchema","buildVariableDefinitionSchema","variableDefinitionSchema","createContext","useContext","useState","buildPanelEditorSchema","panelEditorSchema","defaultPanelEditorSchema","ValidationSchemasContext","undefined","useValidationSchemas","ctx","Error","ValidationProvider","children","datasourceEditorSchema","setDatasourceEditorSchema","setPanelEditorSchema","variableEditorSchema","setVariableEditorSchema","annotationEditorSchema","setAnnotationEditorSchema","setDatasourceEditorSchemaPlugin","pluginSchema","setPanelEditorSchemaPlugin","setVariableEditorSchemaPlugin","setAnnotationEditorSchemaPlugin","Provider","value"],"mappings":"AAAA,+BAA+B;AAC/B,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;;AAGjC,SAASA,+BAA+B,EAAEC,0BAA0B,QAAQ,qBAAqB;AAEjG,SACEC,oBAAoB,EACpBC,yBAAyB,EACzBC,6BAA6B,EAC7BC,wBAAwB,QACnB,mBAAmB;AAE1B,SAASC,aAAa,EAAEC,UAAU,EAAEC,QAAQ,QAAQ,QAAQ;AAI5D,SAASC,sBAAsB,EAAEC,qBAAqBC,wBAAwB,QAAQ,qBAAY;AAalG,OAAO,MAAMC,yCAA2BN,cAA6CO,WAAW;AAEhG,OAAO,SAASC;IACd,MAAMC,MAAMR,WAAWK;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,GACvDZ,SAAyCP;IAC3C,MAAM,CAACS,mBAAmBW,qBAAqB,GAAGb,SAAsCG,2BAA2B,6CAA6C;IAChK,MAAM,CAACW,sBAAsBC,wBAAwB,GACnDf,SAAuCH;IACzC,MAAM,CAACmB,wBAAwBC,0BAA0B,GAAGjB,SAAmCN;IAE/F,SAASwB,gCAAgCC,YAA0B;QACjEP,0BAA0BpB,gCAAgC2B;IAC5D;IAEA,SAASC,2BAA2BD,YAA0B;QAC5DN,qBAAqBZ,uBAAuBkB;IAC9C;IAEA,SAASE,8BAA8BF,YAA0B;QAC/DJ,wBAAwBnB,8BAA8BuB;IACxD;IAEA,SAASG,gCAAgCH,YAA0B;QACjEF,0BAA0BtB,0BAA0BwB;IACtD;IAEA,qBACE,KAACf,yBAAyBmB,QAAQ;QAChCC,OAAO;YACLb;YACAT;YACAY;YACAE;YACAE;YACAE;YACAC;YACAC;QACF;kBAECZ;;AAGP"}
|
package/dist/context/index.js
CHANGED
|
@@ -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
|
|
13
|
+
export * from "./ValidationProvider.js";
|
|
14
14
|
|
|
15
15
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/context/index.ts"],"sourcesContent":["// Copyright The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nexport * from './ValidationProvider';\n"],"names":[],"mappings":"AAAA,+BAA+B;AAC/B,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAEjC,cAAc,
|
|
1
|
+
{"version":3,"sources":["../../src/context/index.ts"],"sourcesContent":["// Copyright The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nexport * from './ValidationProvider';\n"],"names":[],"mappings":"AAAA,+BAA+B;AAC/B,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAEjC,cAAc,0BAAuB"}
|
package/dist/index.js
CHANGED
|
@@ -10,14 +10,14 @@
|
|
|
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
|
|
14
|
-
export * from
|
|
15
|
-
export * from
|
|
16
|
-
export * from
|
|
17
|
-
export * from
|
|
18
|
-
export * from
|
|
19
|
-
export * from
|
|
20
|
-
export * from
|
|
21
|
-
export * from
|
|
13
|
+
export * from "./components/index.js";
|
|
14
|
+
export * from "./constants/index.js";
|
|
15
|
+
export * from "./model/index.js";
|
|
16
|
+
export * from "./runtime/index.js";
|
|
17
|
+
export * from "./schema/index.js";
|
|
18
|
+
export * from "./test-utils/index.js";
|
|
19
|
+
export * from "./utils/index.js";
|
|
20
|
+
export * from "./context/index.js";
|
|
21
|
+
export * from "./remote/index.js";
|
|
22
22
|
|
|
23
23
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/index.ts"],"sourcesContent":["// Copyright The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nexport * from './components';\nexport * from './constants';\nexport * from './model';\nexport * from './runtime';\nexport * from './schema';\nexport * from './test-utils';\nexport * from './utils';\nexport * from './context';\nexport * from './remote';\n"],"names":[],"mappings":"AAAA,+BAA+B;AAC/B,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAEjC,cAAc,
|
|
1
|
+
{"version":3,"sources":["../src/index.ts"],"sourcesContent":["// Copyright The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nexport * from './components';\nexport * from './constants';\nexport * from './model';\nexport * from './runtime';\nexport * from './schema';\nexport * from './test-utils';\nexport * from './utils';\nexport * from './context';\nexport * from './remote';\n"],"names":[],"mappings":"AAAA,+BAA+B;AAC/B,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAEjC,cAAc,wBAAe;AAC7B,cAAc,uBAAc;AAC5B,cAAc,mBAAU;AACxB,cAAc,qBAAY;AAC1B,cAAc,oBAAW;AACzB,cAAc,wBAAe;AAC7B,cAAc,mBAAU;AACxB,cAAc,qBAAY;AAC1B,cAAc,oBAAW"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { AlertsData, UnknownSpec } from '@perses-dev/spec';
|
|
2
|
-
import { Query, QueryKey } from '@tanstack/react-query';
|
|
3
|
-
import { DatasourceStore, VariableStateMap } from '../runtime';
|
|
4
|
-
import { Plugin } from './plugin-base';
|
|
1
|
+
import type { AlertsData, UnknownSpec } from '@perses-dev/spec';
|
|
2
|
+
import type { Query, QueryKey } from '@tanstack/react-query';
|
|
3
|
+
import type { DatasourceStore, VariableStateMap } from '../runtime';
|
|
4
|
+
import type { Plugin } from './plugin-base';
|
|
5
5
|
/**
|
|
6
6
|
* An object containing all the dependencies of an AlertsQuery.
|
|
7
7
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"alerts-queries.d.ts","sourceRoot":"","sources":["../../src/model/alerts-queries.ts"],"names":[],"mappings":"AAaA,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"alerts-queries.d.ts","sourceRoot":"","sources":["../../src/model/alerts-queries.ts"],"names":[],"mappings":"AAaA,OAAO,KAAK,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAChE,OAAO,KAAK,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAE7D,OAAO,KAAK,EAAE,eAAe,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AACpE,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AAE5C;;GAEG;AACH,KAAK,6BAA6B,GAAG;IACnC;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,EAAE,CAAC;CACtB,CAAC;AAEF;;;;GAIG;AACH,MAAM,WAAW,iBAAiB,CAAC,IAAI,GAAG,WAAW,CAAE,SAAQ,MAAM,CAAC,IAAI,CAAC;IACzE,aAAa,EAAE,CAAC,IAAI,EAAE,IAAI,EAAE,GAAG,EAAE,kBAAkB,EAAE,WAAW,CAAC,EAAE,WAAW,KAAK,OAAO,CAAC,UAAU,CAAC,CAAC;IACvG,SAAS,CAAC,EAAE,CAAC,IAAI,EAAE,IAAI,EAAE,GAAG,EAAE,kBAAkB,KAAK,6BAA6B,CAAC;CACpF;AAED;;;GAGG;AACH,MAAM,WAAW,kBAAkB;IACjC,eAAe,EAAE,eAAe,CAAC;IACjC,aAAa,EAAE,gBAAgB,CAAC;CACjC;AAED,MAAM,MAAM,eAAe,GAAG,KAAK,CAAC,UAAU,EAAE,OAAO,EAAE,UAAU,EAAE,QAAQ,CAAC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/model/alerts-queries.ts"],"sourcesContent":["// Copyright The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport { AlertsData, UnknownSpec } from '@perses-dev/spec';\nimport { Query, QueryKey } from '@tanstack/react-query';\n\nimport { DatasourceStore, VariableStateMap } from '../runtime';\nimport { Plugin } from './plugin-base';\n\n/**\n * An object containing all the dependencies of an AlertsQuery.\n */\ntype AlertsQueryPluginDependencies = {\n /**\n * Returns a list of variables name this alerts query depends on.\n */\n variables?: string[];\n};\n\n/**\n * A plugin for running alerts queries.\n * Alerts represent current state, not historical data, so the context\n * does NOT include absoluteTimeRange.\n */\nexport interface AlertsQueryPlugin<Spec = UnknownSpec> extends Plugin<Spec> {\n getAlertsData: (spec: Spec, ctx: AlertsQueryContext, abortSignal?: AbortSignal) => Promise<AlertsData>;\n dependsOn?: (spec: Spec, ctx: AlertsQueryContext) => AlertsQueryPluginDependencies;\n}\n\n/**\n * Context available to AlertsQuery plugins at runtime.\n * Note: No absoluteTimeRange since alerts represent current state.\n */\nexport interface AlertsQueryContext {\n datasourceStore: DatasourceStore;\n variableState: VariableStateMap;\n}\n\nexport type AlertsDataQuery = Query<AlertsData, unknown, AlertsData, QueryKey>;\n"],"names":[],"mappings":"AAAA,+BAA+B;AAC/B,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAqCjC,WAA+E"}
|
|
1
|
+
{"version":3,"sources":["../../src/model/alerts-queries.ts"],"sourcesContent":["// Copyright The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport type { AlertsData, UnknownSpec } from '@perses-dev/spec';\nimport type { Query, QueryKey } from '@tanstack/react-query';\n\nimport type { DatasourceStore, VariableStateMap } from '../runtime';\nimport type { Plugin } from './plugin-base';\n\n/**\n * An object containing all the dependencies of an AlertsQuery.\n */\ntype AlertsQueryPluginDependencies = {\n /**\n * Returns a list of variables name this alerts query depends on.\n */\n variables?: string[];\n};\n\n/**\n * A plugin for running alerts queries.\n * Alerts represent current state, not historical data, so the context\n * does NOT include absoluteTimeRange.\n */\nexport interface AlertsQueryPlugin<Spec = UnknownSpec> extends Plugin<Spec> {\n getAlertsData: (spec: Spec, ctx: AlertsQueryContext, abortSignal?: AbortSignal) => Promise<AlertsData>;\n dependsOn?: (spec: Spec, ctx: AlertsQueryContext) => AlertsQueryPluginDependencies;\n}\n\n/**\n * Context available to AlertsQuery plugins at runtime.\n * Note: No absoluteTimeRange since alerts represent current state.\n */\nexport interface AlertsQueryContext {\n datasourceStore: DatasourceStore;\n variableState: VariableStateMap;\n}\n\nexport type AlertsDataQuery = Query<AlertsData, unknown, AlertsData, QueryKey>;\n"],"names":[],"mappings":"AAAA,+BAA+B;AAC/B,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAqCjC,WAA+E"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { AbsoluteTimeRange, AnnotationData, UnknownSpec } from '@perses-dev/spec';
|
|
2
|
-
import { DatasourceStore, VariableStateMap } from '../runtime';
|
|
3
|
-
import { Plugin } from './plugin-base';
|
|
1
|
+
import type { AbsoluteTimeRange, AnnotationData, UnknownSpec } from '@perses-dev/spec';
|
|
2
|
+
import type { DatasourceStore, VariableStateMap } from '../runtime';
|
|
3
|
+
import type { Plugin } from './plugin-base';
|
|
4
4
|
/**
|
|
5
5
|
* An object containing all the dependencies of a AnnotationQuery.
|
|
6
6
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"annotations.d.ts","sourceRoot":"","sources":["../../src/model/annotations.ts"],"names":[],"mappings":"AAaA,OAAO,EAAE,iBAAiB,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"annotations.d.ts","sourceRoot":"","sources":["../../src/model/annotations.ts"],"names":[],"mappings":"AAaA,OAAO,KAAK,EAAE,iBAAiB,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAEvF,OAAO,KAAK,EAAE,eAAe,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AACpE,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AAE5C;;GAEG;AACH,MAAM,MAAM,iCAAiC,GAAG;IAC9C;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,EAAE,CAAC;CACtB,CAAC;AAEF;;GAEG;AACH,MAAM,WAAW,gBAAgB,CAAC,IAAI,GAAG,WAAW,CAAE,SAAQ,MAAM,CAAC,IAAI,CAAC;IACxE,iBAAiB,EAAE,CAAC,IAAI,EAAE,IAAI,EAAE,GAAG,EAAE,iBAAiB,EAAE,WAAW,CAAC,EAAE,WAAW,KAAK,OAAO,CAAC,cAAc,EAAE,CAAC,CAAC;IAChH,SAAS,CAAC,EAAE,CAAC,IAAI,EAAE,IAAI,EAAE,GAAG,EAAE,iBAAiB,KAAK,iCAAiC,CAAC;CACvF;AAED;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAChC,eAAe,EAAE,eAAe,CAAC;IACjC,iBAAiB,EAAE,iBAAiB,CAAC;IACrC,aAAa,EAAE,gBAAgB,CAAC;CACjC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/model/annotations.ts"],"sourcesContent":["// Copyright The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport { AbsoluteTimeRange, AnnotationData, UnknownSpec } from '@perses-dev/spec';\n\nimport { DatasourceStore, VariableStateMap } from '../runtime';\nimport { Plugin } from './plugin-base';\n\n/**\n * An object containing all the dependencies of a AnnotationQuery.\n */\nexport type AnnotationQueryPluginDependencies = {\n /**\n * Returns a list of variables name this annotation query depends on.\n */\n variables?: string[];\n};\n\n/**\n * A plugin for running annotation queries.\n */\nexport interface AnnotationPlugin<Spec = UnknownSpec> extends Plugin<Spec> {\n getAnnotationData: (spec: Spec, ctx: AnnotationContext, abortSignal?: AbortSignal) => Promise<AnnotationData[]>;\n dependsOn?: (spec: Spec, ctx: AnnotationContext) => AnnotationQueryPluginDependencies;\n}\n\n/**\n * Context available to AnnotationQuery plugins at runtime.\n */\nexport interface AnnotationContext {\n datasourceStore: DatasourceStore;\n absoluteTimeRange: AbsoluteTimeRange;\n variableState: VariableStateMap;\n}\n"],"names":[],"mappings":"AAAA,+BAA+B;AAC/B,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAyBjC;;CAEC,GACD,WAIC"}
|
|
1
|
+
{"version":3,"sources":["../../src/model/annotations.ts"],"sourcesContent":["// Copyright The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport type { AbsoluteTimeRange, AnnotationData, UnknownSpec } from '@perses-dev/spec';\n\nimport type { DatasourceStore, VariableStateMap } from '../runtime';\nimport type { Plugin } from './plugin-base';\n\n/**\n * An object containing all the dependencies of a AnnotationQuery.\n */\nexport type AnnotationQueryPluginDependencies = {\n /**\n * Returns a list of variables name this annotation query depends on.\n */\n variables?: string[];\n};\n\n/**\n * A plugin for running annotation queries.\n */\nexport interface AnnotationPlugin<Spec = UnknownSpec> extends Plugin<Spec> {\n getAnnotationData: (spec: Spec, ctx: AnnotationContext, abortSignal?: AbortSignal) => Promise<AnnotationData[]>;\n dependsOn?: (spec: Spec, ctx: AnnotationContext) => AnnotationQueryPluginDependencies;\n}\n\n/**\n * Context available to AnnotationQuery plugins at runtime.\n */\nexport interface AnnotationContext {\n datasourceStore: DatasourceStore;\n absoluteTimeRange: AbsoluteTimeRange;\n variableState: VariableStateMap;\n}\n"],"names":[],"mappings":"AAAA,+BAA+B;AAC/B,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAyBjC;;CAEC,GACD,WAIC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"calculations.d.ts","sourceRoot":"","sources":["../../src/model/calculations.ts"],"names":[],"mappings":"AAaA,OAAO,EAAE,oBAAoB,EAAE,MAAM,uBAAuB,CAAC;
|
|
1
|
+
{"version":3,"file":"calculations.d.ts","sourceRoot":"","sources":["../../src/model/calculations.ts"],"names":[],"mappings":"AAaA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,uBAAuB,CAAC;AAElE,eAAO,MAAM,mBAAmB,EAAE,eAAwB,CAAC;AAE3D,eAAO,MAAM,eAAe;;;;;;;;;CAS3B,CAAC;AAEF,MAAM,MAAM,eAAe,GAAG,MAAM,OAAO,eAAe,CAAC;AAE3D,MAAM,MAAM,iBAAiB,GAAG;IAC9B,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,EAAE,MAAM,CAAC;CACrB,CAAC;AAEF,eAAO,MAAM,mBAAmB,EAAE,QAAQ,CAAC,MAAM,CAAC,eAAe,EAAE,iBAAiB,CAAC,CAiC3E,CAAC;AAEX,KAAK,gBAAgB,GAAG,MAAM,GAAG,IAAI,GAAG,SAAS,CAAC;AAElD;;;;;GAKG;AACH,wBAAgB,eAAe,CAAC,YAAY,SAAS,eAAe,EAAE,EACpE,MAAM,EAAE,oBAAoB,EAAE,EAC9B,mBAAmB,EAAE,YAAY,GAChC,MAAM,CAGP,OAAO,CAAC,eAAe,E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