@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,"sources":["../../../../src/test/test-plugins/ernie/index.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 { DatasourceEditorProps, DatasourcePlugin, VariableOption, VariablePlugin } from '../../../model';\n\nconst data: VariableOption[] = [\n { label: 'Grover', value: 'Grover' },\n { label: 'Snuffleupagus', value: 'Snuffleupagus' },\n];\n\n// Dummy plugin to test loading\nconst ErnieVariable1: VariablePlugin<{ variableOption: string }> = {\n getVariableOptions: async () => ({ data }),\n OptionsEditorComponent: function ErnieVariableEditor({ value, onChange }) {\n return (\n <div>\n <label htmlFor=\"editor-input\">ErnieVariable editor</label>\n <input\n type=\"text\"\n id=\"editor-input\"\n value={value.variableOption}\n onChange={(e) => onChange({ ...value, variableOption: e.target.value })}\n />\n </div>\n );\n },\n createInitialOptions: () => ({ variableOption: '' }),\n};\n\nconst ErnieVariable2: VariablePlugin<{ variableOption2: string }> = {\n getVariableOptions: async () => ({ data }),\n OptionsEditorComponent: function ErnieVariableEditor({ value, onChange }) {\n return (\n <div>\n <label htmlFor=\"editor-input\">ErnieVariable2 editor</label>\n <input\n type=\"text\"\n id=\"editor-input\"\n value={value.variableOption2}\n onChange={(e) => onChange({ ...value, variableOption2: e.target.value })}\n />\n </div>\n );\n },\n createInitialOptions: () => ({ variableOption2: '' }),\n};\n\ntype ErnieDatasourceSpec = { url?: string };\n\nconst ErnieDatasource: DatasourcePlugin<ErnieDatasourceSpec> = {\n createClient: () => ({}),\n createInitialOptions: () => ({}),\n healthCheckPath: '/api/v1/query',\n OptionsEditorComponent: function ErnieDatasourceEditor({\n value,\n onChange,\n testConnection,\n }: DatasourceEditorProps<ErnieDatasourceSpec>) {\n return (\n <div>\n <label htmlFor=\"datasource-url\">ErnieDatasource editor</label>\n <input\n type=\"text\"\n id=\"datasource-url\"\n value={value.url ?? ''}\n onChange={(e) => onChange({ ...value, url: e.target.value })}\n />\n {testConnection && <button onClick={testConnection}>test-connection-trigger</button>}\n </div>\n );\n },\n};\n\nconst ErnieDatasourceNoHealthCheck: DatasourcePlugin<ErnieDatasourceSpec> = {\n createClient: () => ({}),\n createInitialOptions: () => ({}),\n OptionsEditorComponent: function ErnieDatasourceNoHealthCheckEditor({\n value,\n onChange,\n testConnection,\n }: DatasourceEditorProps<ErnieDatasourceSpec>) {\n return (\n <div>\n <label htmlFor=\"datasource-url\">ErnieDatasourceNoHealthCheck editor</label>\n <input\n type=\"text\"\n id=\"datasource-url\"\n value={value.url ?? ''}\n onChange={(e) => onChange({ ...value, url: e.target.value })}\n />\n {testConnection && <button onClick={testConnection}>test-connection-trigger</button>}\n </div>\n );\n },\n};\n\nexport const plugins = {\n 'Variable:ErnieVariable1::1.0.0': ErnieVariable1,\n 'Variable:ErnieVariable2::1.0.0': ErnieVariable2,\n 'Datasource:ErnieDatasource::1.0.0': ErnieDatasource,\n 'Datasource:ErnieDatasourceNoHealthCheck::1.0.0': ErnieDatasourceNoHealthCheck,\n};\n"],"names":["data","label","value","ErnieVariable1","getVariableOptions","OptionsEditorComponent","ErnieVariableEditor","onChange","div","htmlFor","input","type","id","variableOption","e","target","createInitialOptions","ErnieVariable2","variableOption2","ErnieDatasource","createClient","healthCheckPath","ErnieDatasourceEditor","testConnection","url","button","onClick","ErnieDatasourceNoHealthCheck","ErnieDatasourceNoHealthCheckEditor","plugins"],"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,MAAMA,OAAyB;IAC7B;QAAEC,OAAO;QAAUC,OAAO;IAAS;IACnC;QAAED,OAAO;QAAiBC,OAAO;IAAgB;CAClD;AAED,+BAA+B;AAC/B,MAAMC,iBAA6D;IACjEC,oBAAoB,UAAa,CAAA;YAAEJ;QAAK,CAAA;IACxCK,wBAAwB,SAASC,oBAAoB,EAAEJ,KAAK,EAAEK,QAAQ,EAAE;QACtE,qBACE,MAACC;;8BACC,KAACP;oBAAMQ,SAAQ;8BAAe;;8BAC9B,KAACC;oBACCC,MAAK;oBACLC,IAAG;oBACHV,OAAOA,MAAMW,cAAc;oBAC3BN,UAAU,CAACO,IAAMP,SAAS;4BAAE,GAAGL,KAAK;4BAAEW,gBAAgBC,EAAEC,MAAM,CAACb,KAAK;wBAAC;;;;IAI7E;IACAc,sBAAsB,IAAO,CAAA;YAAEH,gBAAgB;QAAG,CAAA;AACpD;AAEA,MAAMI,iBAA8D;IAClEb,oBAAoB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AAU,CAACO,IAAMP,SAAS;4BAAE,GAAGL,KAAK;4BAAEsB,KAAKV,EAAEC,MAAM,CAACb,KAAK;wBAAC;;gBAE3DqB,gCAAkB,KAACE;oBAAOC,SAASH;8BAAgB;;;;IAG1D;AACF;AAEA,OAAO,MAAMM,UAAU;IACrB,kCAAkC1B;IAClC,kCAAkCc;IAClC,qCAAqCE;IACrC,kDAAkDQ;AACpD,EAAE"}
|
|
1
|
+
{"version":3,"sources":["../../../../src/test/test-plugins/ernie/index.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 { DatasourceEditorProps, DatasourcePlugin, VariableOption, VariablePlugin } from '../../../model';\n\nconst data: VariableOption[] = [\n { label: 'Grover', value: 'Grover' },\n { label: 'Snuffleupagus', value: 'Snuffleupagus' },\n];\n\n// Dummy plugin to test loading\nconst ErnieVariable1: VariablePlugin<{ variableOption: string }> = {\n getVariableOptions: async () => ({ data }),\n OptionsEditorComponent: function ErnieVariableEditor({ value, onChange }) {\n return (\n <div>\n <label htmlFor=\"editor-input\">ErnieVariable editor</label>\n <input\n type=\"text\"\n id=\"editor-input\"\n value={value.variableOption}\n onChange={(e) => onChange({ ...value, variableOption: e.target.value })}\n />\n </div>\n );\n },\n createInitialOptions: () => ({ variableOption: '' }),\n};\n\nconst ErnieVariable2: VariablePlugin<{ variableOption2: string }> = {\n getVariableOptions: async () => ({ data }),\n OptionsEditorComponent: function ErnieVariableEditor({ value, onChange }) {\n return (\n <div>\n <label htmlFor=\"editor-input\">ErnieVariable2 editor</label>\n <input\n type=\"text\"\n id=\"editor-input\"\n value={value.variableOption2}\n onChange={(e) => onChange({ ...value, variableOption2: e.target.value })}\n />\n </div>\n );\n },\n createInitialOptions: () => ({ variableOption2: '' }),\n};\n\ntype ErnieDatasourceSpec = { url?: string };\n\nconst ErnieDatasource: DatasourcePlugin<ErnieDatasourceSpec> = {\n createClient: () => ({}),\n createInitialOptions: () => ({}),\n healthCheckPath: '/api/v1/query',\n OptionsEditorComponent: function ErnieDatasourceEditor({\n value,\n onChange,\n testConnection,\n }: DatasourceEditorProps<ErnieDatasourceSpec>) {\n return (\n <div>\n <label htmlFor=\"datasource-url\">ErnieDatasource editor</label>\n <input\n type=\"text\"\n id=\"datasource-url\"\n value={value.url ?? ''}\n onChange={(e) => onChange({ ...value, url: e.target.value })}\n />\n {testConnection && <button onClick={testConnection}>test-connection-trigger</button>}\n </div>\n );\n },\n};\n\nconst ErnieDatasourceNoHealthCheck: DatasourcePlugin<ErnieDatasourceSpec> = {\n createClient: () => ({}),\n createInitialOptions: () => ({}),\n OptionsEditorComponent: function ErnieDatasourceNoHealthCheckEditor({\n value,\n onChange,\n testConnection,\n }: DatasourceEditorProps<ErnieDatasourceSpec>) {\n return (\n <div>\n <label htmlFor=\"datasource-url\">ErnieDatasourceNoHealthCheck editor</label>\n <input\n type=\"text\"\n id=\"datasource-url\"\n value={value.url ?? ''}\n onChange={(e) => onChange({ ...value, url: e.target.value })}\n />\n {testConnection && <button onClick={testConnection}>test-connection-trigger</button>}\n </div>\n );\n },\n};\n\nexport const plugins = {\n 'Variable:ErnieVariable1::1.0.0': ErnieVariable1,\n 'Variable:ErnieVariable2::1.0.0': ErnieVariable2,\n 'Datasource:ErnieDatasource::1.0.0': ErnieDatasource,\n 'Datasource:ErnieDatasourceNoHealthCheck::1.0.0': ErnieDatasourceNoHealthCheck,\n};\n"],"names":["data","label","value","ErnieVariable1","getVariableOptions","OptionsEditorComponent","ErnieVariableEditor","onChange","div","htmlFor","input","type","id","variableOption","e","target","createInitialOptions","ErnieVariable2","variableOption2","ErnieDatasource","createClient","healthCheckPath","ErnieDatasourceEditor","testConnection","url","button","onClick","ErnieDatasourceNoHealthCheck","ErnieDatasourceNoHealthCheckEditor","plugins"],"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,MAAMA,OAAyB;IAC7B;QAAEC,OAAO;QAAUC,OAAO;IAAS;IACnC;QAAED,OAAO;QAAiBC,OAAO;IAAgB;CAClD;AAED,+BAA+B;AAC/B,MAAMC,iBAA6D;IACjEC,oBAAoB,UAAa,CAAA;YAAEJ;QAAK,CAAA;IACxCK,wBAAwB,SAASC,oBAAoB,EAAEJ,KAAK,EAAEK,QAAQ,EAAE;QACtE,qBACE,MAACC;;8BACC,KAACP;oBAAMQ,SAAQ;8BAAe;;8BAC9B,KAACC;oBACCC,MAAK;oBACLC,IAAG;oBACHV,OAAOA,MAAMW,cAAc;oBAC3BN,UAAU,CAACO,IAAMP,SAAS;4BAAE,GAAGL,KAAK;4BAAEW,gBAAgBC,EAAEC,MAAM,CAACb,KAAK;wBAAC;;;;IAI7E;IACAc,sBAAsB,IAAO,CAAA;YAAEH,gBAAgB;QAAG,CAAA;AACpD;AAEA,MAAMI,iBAA8D;IAClEb,oBAAoB,UAAa,CAAA;YAAEJ;QAAK,CAAA;IACxCK,wBAAwB,SAASC,oBAAoB,EAAEJ,KAAK,EAAEK,QAAQ,EAAE;QACtE,qBACE,MAACC;;8BACC,KAACP;oBAAMQ,SAAQ;8BAAe;;8BAC9B,KAACC;oBACCC,MAAK;oBACLC,IAAG;oBACHV,OAAOA,MAAMgB,eAAe;oBAC5BX,UAAU,CAACO,IAAMP,SAAS;4BAAE,GAAGL,KAAK;4BAAEgB,iBAAiBJ,EAAEC,MAAM,CAACb,KAAK;wBAAC;;;;IAI9E;IACAc,sBAAsB,I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[],"mappings":"AAaA,OAAO,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/test/test-plugins/index.ts"],"names":[],"mappings":"AAaA,OAAO,KAAK,EAAE,YAAY,EAAwB,MAAM,aAAa,CAAC;AAKtE;;GAEG;AACH,eAAO,MAAM,gBAAgB,EAAE,YAG7B,CAAC"}
|
|
@@ -10,19 +10,19 @@
|
|
|
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 { dynamicImportPluginLoader } from
|
|
14
|
-
import bertResource from
|
|
15
|
-
import ernieResource from
|
|
13
|
+
import { dynamicImportPluginLoader } from "../../model/index.js";
|
|
14
|
+
import bertResource from "./bert/plugin.json";
|
|
15
|
+
import ernieResource from "./ernie/plugin.json";
|
|
16
16
|
/**
|
|
17
17
|
* A PluginLoader for tests that will dynamically load the plugins in this folder.
|
|
18
18
|
*/ export const testPluginLoader = dynamicImportPluginLoader([
|
|
19
19
|
{
|
|
20
20
|
resource: bertResource,
|
|
21
|
-
importPlugin: ()=>import(
|
|
21
|
+
importPlugin: ()=>import("./bert/index.js").then((m)=>m.plugins)
|
|
22
22
|
},
|
|
23
23
|
{
|
|
24
24
|
resource: ernieResource,
|
|
25
|
-
importPlugin: ()=>import(
|
|
25
|
+
importPlugin: ()=>import("./ernie/index.js").then((m)=>m.plugins)
|
|
26
26
|
}
|
|
27
27
|
]);
|
|
28
28
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/test/test-plugins/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\nimport {
|
|
1
|
+
{"version":3,"sources":["../../../src/test/test-plugins/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\nimport type { PluginLoader, PluginModuleResource } from '../../model';\nimport { dynamicImportPluginLoader } from '../../model';\nimport bertResource from './bert/plugin.json';\nimport ernieResource from './ernie/plugin.json';\n\n/**\n * A PluginLoader for tests that will dynamically load the plugins in this folder.\n */\nexport const testPluginLoader: PluginLoader = dynamicImportPluginLoader([\n { resource: bertResource as PluginModuleResource, importPlugin: () => import('./bert').then((m) => m.plugins) },\n { resource: ernieResource as PluginModuleResource, importPlugin: () => import('./ernie').then((m) => m.plugins) },\n]);\n"],"names":["dynamicImportPluginLoader","bertResource","ernieResource","testPluginLoader","resource","importPlugin","then","m","plugins"],"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,yBAAyB,QAAQ,uBAAc;AACxD,OAAOC,kBAAkB,qBAAqB;AAC9C,OAAOC,mBAAmB,sBAAsB;AAEhD;;CAEC,GACD,OAAO,MAAMC,mBAAiCH,0BAA0B;IACtE;QAAEI,UAAUH;QAAsCI,cAAc,IAAM,MAAM,CAAC,mBAAUC,IAAI,CAAC,CAACC,IAAMA,EAAEC,OAAO;IAAE;IAC9G;QAAEJ,UAAUF;QAAuCG,cAAc,IAAM,MAAM,CAAC,oBAAWC,IAAI,CAAC,CAACC,IAAMA,EAAEC,OAAO;IAAE;CACjH,EAAE"}
|
package/dist/test/utils.d.ts
CHANGED
package/dist/test/utils.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/test/utils.tsx"],"names":[],"mappings":"AAeA,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/test/utils.tsx"],"names":[],"mappings":"AAeA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAGvC,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,UAAU,CAAC;AAInD,MAAM,MAAM,cAAc,GAAG;IAC3B,kBAAkB,CAAC,EAAE,kBAAkB,CAAC;CACzC,CAAC;AAEF,wBAAgB,qBAAqB,CAAC,cAAc,CAAC,EAAE,cAAc,IAQ3C,cAAc;IAAE,QAAQ,EAAE,SAAS,CAAA;CAAE,KAAG,SAAS,CAkB1E"}
|
package/dist/test/utils.js
CHANGED
|
@@ -11,10 +11,10 @@
|
|
|
11
11
|
// See the License for the specific language governing permissions and
|
|
12
12
|
// limitations under the License.
|
|
13
13
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
14
|
-
import { QueryClient, QueryClientProvider } from
|
|
15
|
-
import { PluginRegistry } from
|
|
16
|
-
import { TimeRangeProviderBasic } from
|
|
17
|
-
import { testPluginLoader } from
|
|
14
|
+
import { QueryClient, QueryClientProvider } from "@tanstack/react-query";
|
|
15
|
+
import { PluginRegistry } from "../components/index.js";
|
|
16
|
+
import { TimeRangeProviderBasic } from "../runtime/index.js";
|
|
17
|
+
import { testPluginLoader } from "./test-plugins/index.js";
|
|
18
18
|
export function getTestContextWrapper(contextOptions) {
|
|
19
19
|
// Create a new QueryClient for each test to avoid caching issues
|
|
20
20
|
const queryClient = new QueryClient({
|
package/dist/test/utils.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/test/utils.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 { DurationString } from '@perses-dev/spec';\nimport { QueryClient, QueryClientProvider } from '@tanstack/react-query';\nimport { ReactNode } from 'react';\n\nimport { PluginRegistry } from '../components';\nimport { DefaultPluginKinds } from '../model';\nimport { TimeRangeProviderBasic } from '../runtime';\nimport { testPluginLoader } from './test-plugins';\n\nexport type ContextOptions = {\n defaultPluginKinds?: DefaultPluginKinds;\n};\n\nexport function getTestContextWrapper(contextOptions?: ContextOptions) {\n // Create a new QueryClient for each test to avoid caching issues\n const queryClient = new QueryClient({\n defaultOptions: { queries: { refetchOnWindowFocus: false, retry: false } },\n });\n const DEFAULT_DASHBOARD_DURATION: DurationString = '1h';\n const timeRange = { start: new Date(Date.now() - Number(DEFAULT_DASHBOARD_DURATION)), end: new Date() };\n\n return function Wrapper({ children }: { children: ReactNode }): ReactNode {\n return (\n <QueryClientProvider client={queryClient}>\n <TimeRangeProviderBasic initialTimeRange={timeRange}>\n <PluginRegistry\n pluginLoader={testPluginLoader}\n defaultPluginKinds={\n contextOptions?.defaultPluginKinds ?? {\n TimeSeriesQuery: 'PrometheusTimeSeriesQuery',\n }\n }\n >\n {children}\n </PluginRegistry>\n </TimeRangeProviderBasic>\n </QueryClientProvider>\n );\n };\n}\n"],"names":["QueryClient","QueryClientProvider","PluginRegistry","TimeRangeProviderBasic","testPluginLoader","getTestContextWrapper","contextOptions","queryClient","defaultOptions","queries","refetchOnWindowFocus","retry","DEFAULT_DASHBOARD_DURATION","timeRange","start","Date","now","Number","end","Wrapper","children","client","initialTimeRange","pluginLoader","defaultPluginKinds","TimeSeriesQuery"],"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,WAAW,EAAEC,mBAAmB,QAAQ,wBAAwB;AAGzE,SAASC,cAAc,QAAQ,
|
|
1
|
+
{"version":3,"sources":["../../src/test/utils.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 { DurationString } from '@perses-dev/spec';\nimport { QueryClient, QueryClientProvider } from '@tanstack/react-query';\nimport type { ReactNode } from 'react';\n\nimport { PluginRegistry } from '../components';\nimport type { DefaultPluginKinds } from '../model';\nimport { TimeRangeProviderBasic } from '../runtime';\nimport { testPluginLoader } from './test-plugins';\n\nexport type ContextOptions = {\n defaultPluginKinds?: DefaultPluginKinds;\n};\n\nexport function getTestContextWrapper(contextOptions?: ContextOptions) {\n // Create a new QueryClient for each test to avoid caching issues\n const queryClient = new QueryClient({\n defaultOptions: { queries: { refetchOnWindowFocus: false, retry: false } },\n });\n const DEFAULT_DASHBOARD_DURATION: DurationString = '1h';\n const timeRange = { start: new Date(Date.now() - Number(DEFAULT_DASHBOARD_DURATION)), end: new Date() };\n\n return function Wrapper({ children }: { children: ReactNode }): ReactNode {\n return (\n <QueryClientProvider client={queryClient}>\n <TimeRangeProviderBasic initialTimeRange={timeRange}>\n <PluginRegistry\n pluginLoader={testPluginLoader}\n defaultPluginKinds={\n contextOptions?.defaultPluginKinds ?? {\n TimeSeriesQuery: 'PrometheusTimeSeriesQuery',\n }\n }\n >\n {children}\n </PluginRegistry>\n </TimeRangeProviderBasic>\n </QueryClientProvider>\n );\n };\n}\n"],"names":["QueryClient","QueryClientProvider","PluginRegistry","TimeRangeProviderBasic","testPluginLoader","getTestContextWrapper","contextOptions","queryClient","defaultOptions","queries","refetchOnWindowFocus","retry","DEFAULT_DASHBOARD_DURATION","timeRange","start","Date","now","Number","end","Wrapper","children","client","initialTimeRange","pluginLoader","defaultPluginKinds","TimeSeriesQuery"],"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,WAAW,EAAEC,mBAAmB,QAAQ,wBAAwB;AAGzE,SAASC,cAAc,QAAQ,yBAAgB;AAE/C,SAASC,sBAAsB,QAAQ,sBAAa;AACpD,SAASC,gBAAgB,QAAQ,0BAAiB;AAMlD,OAAO,SAASC,sBAAsBC,cAA+B;IACnE,iEAAiE;IACjE,MAAMC,cAAc,IAAIP,YAAY;QAClCQ,gBAAgB;YAAEC,SAAS;gBAAEC,sBAAsB;gBAAOC,OAAO;YAAM;QAAE;IAC3E;IACA,MAAMC,6BAA6C;IACnD,MAAMC,YAAY;QAAEC,OAAO,IAAIC,KAAKA,KAAKC,GAAG,KAAKC,OAAOL;QAA8BM,KAAK,IAAIH;IAAO;IAEtG,OAAO,SAASI,QAAQ,EAAEC,QAAQ,EAA2B;QAC3D,qBACE,KAACnB;YAAoBoB,QAAQd;sBAC3B,cAAA,KAACJ;gBAAuBmB,kBAAkBT;0BACxC,cAAA,KAACX;oBACCqB,cAAcnB;oBACdoB,oBACElB,gBAAgBkB,sBAAsB;wBACpCC,iBAAiB;oBACnB;8BAGDL;;;;IAKX;AACF"}
|
package/dist/test-utils/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 "./mock-plugin-registry.js";
|
|
14
14
|
|
|
15
15
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/test-utils/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 './mock-plugin-registry';\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/test-utils/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 './mock-plugin-registry';\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,4BAAyB"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { PluginRegistryProps } from '../components';
|
|
2
|
-
import { PluginImplementation, PluginType } from '../model';
|
|
1
|
+
import type { PluginRegistryProps } from '../components';
|
|
2
|
+
import type { PluginImplementation, PluginType } from '../model';
|
|
3
3
|
export type MockPlugin = {
|
|
4
4
|
[T in PluginType]: {
|
|
5
5
|
kind: T;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mock-plugin-registry.d.ts","sourceRoot":"","sources":["../../src/test-utils/mock-plugin-registry.tsx"],"names":[],"mappings":"AAeA,OAAO,EAAE,mBAAmB,EAAE,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"mock-plugin-registry.d.ts","sourceRoot":"","sources":["../../src/test-utils/mock-plugin-registry.tsx"],"names":[],"mappings":"AAeA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,eAAe,CAAC;AACzD,OAAO,KAAK,EAA8C,oBAAoB,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAG7G,MAAM,MAAM,UAAU,GAAG;KACtB,CAAC,IAAI,UAAU,GAAG;QACjB,IAAI,EAAE,CAAC,CAAC;QACR,IAAI,EAAE;YAAE,IAAI,EAAE,MAAM,CAAA;SAAE,CAAC;QACvB,MAAM,EAAE,oBAAoB,CAAC,CAAC,CAAC,CAAC;KACjC;CACF,CAAC,UAAU,CAAC,CAAC;AAEd;;;GAGG;AACH,wBAAgB,kBAAkB,CAAC,GAAG,WAAW,EAAE,UAAU,EAAE,GAAG,IAAI,CAAC,mBAAmB,EAAE,UAAU,CAAC,CAiDtG;AAED;;;GAGG;AACH,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,CAExE"}
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
11
11
|
// See the License for the specific language governing permissions and
|
|
12
12
|
// limitations under the License.
|
|
13
|
-
import { getPluginModuleCompoundKey } from
|
|
13
|
+
import { getPluginModuleCompoundKey } from "../model/index.js";
|
|
14
14
|
/**
|
|
15
15
|
* Helper for mocking `PluginRegistry` data during tests. Returns props that can be spread on the `PluginRegistry`
|
|
16
16
|
* component so that it will load the mock plugins you provide.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/test-utils/mock-plugin-registry.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 { UnknownSpec } from '@perses-dev/spec';\n\nimport { PluginRegistryProps } from '../components';\nimport {
|
|
1
|
+
{"version":3,"sources":["../../src/test-utils/mock-plugin-registry.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 { UnknownSpec } from '@perses-dev/spec';\n\nimport type { PluginRegistryProps } from '../components';\nimport type { PluginModuleResource, Plugin, PluginLoader, PluginImplementation, PluginType } from '../model';\nimport { getPluginModuleCompoundKey } from '../model';\n\nexport type MockPlugin = {\n [T in PluginType]: {\n kind: T;\n spec: { name: string };\n plugin: PluginImplementation<T>;\n };\n}[PluginType];\n\n/**\n * Helper for mocking `PluginRegistry` data during tests. Returns props that can be spread on the `PluginRegistry`\n * component so that it will load the mock plugins you provide.\n */\nexport function mockPluginRegistry(...mockPlugins: MockPlugin[]): Omit<PluginRegistryProps, 'children'> {\n const mockPluginResource: PluginModuleResource = {\n kind: 'PluginModule',\n metadata: {\n name: 'Fake Plugin Module for Tests',\n version: '1.0.0',\n },\n spec: {\n // Add metadata for all mock plugins\n plugins: mockPlugins.map(({ kind, spec: { name } }) => ({\n kind,\n spec: {\n name,\n display: {\n name: getMockPluginName(kind, name),\n },\n },\n })),\n },\n };\n\n const mockPluginModule: Record<string, Plugin<UnknownSpec>> = {};\n for (const mockPlugin of mockPlugins) {\n // \"Export\" on the module under the same name as the kind the plugin handles\n mockPluginModule[\n getPluginModuleCompoundKey({\n kind: mockPlugin.kind,\n name: mockPlugin.spec.name,\n registry: mockPluginResource.metadata.registry,\n version: mockPluginResource.metadata.version,\n })\n ] = mockPlugin.plugin;\n }\n\n const pluginLoader: PluginLoader = {\n getInstalledPlugins() {\n return Promise.resolve([mockPluginResource]);\n },\n importPluginModule(/* resource */) {\n return Promise.resolve(mockPluginModule);\n },\n };\n\n return {\n pluginLoader,\n defaultPluginKinds: {\n TimeSeriesQuery: 'PrometheusTimeSeriesQuery',\n },\n };\n}\n\n/**\n * The function that's used to generate the display name of mocked plugins in mockPluginRegistry. Can be useful if you\n * need to interact with some UI component that's displaying it.\n */\nexport function getMockPluginName(kind: PluginType, name: string): string {\n return `${kind} Plugin for ${name}`;\n}\n"],"names":["getPluginModuleCompoundKey","mockPluginRegistry","mockPlugins","mockPluginResource","kind","metadata","name","version","spec","plugins","map","display","getMockPluginName","mockPluginModule","mockPlugin","registry","plugin","pluginLoader","getInstalledPlugins","Promise","resolve","importPluginModule","defaultPluginKinds","TimeSeriesQuery"],"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;AAMjC,SAASA,0BAA0B,QAAQ,oBAAW;AAUtD;;;CAGC,GACD,OAAO,SAASC,mBAAmB,GAAGC,WAAyB;IAC7D,MAAMC,qBAA2C;QAC/CC,MAAM;QACNC,UAAU;YACRC,MAAM;YACNC,SAAS;QACX;QACAC,MAAM;YACJ,oCAAoC;YACpCC,SAASP,YAAYQ,GAAG,CAAC,CAAC,EAAEN,IAAI,EAAEI,MAAM,EAAEF,IAAI,EAAE,EAAE,GAAM,CAAA;oBACtDF;oBACAI,MAAM;wBACJF;wBACAK,SAAS;4BACPL,MAAMM,kBAAkBR,MAAME;wBAChC;oBACF;gBACF,CAAA;QACF;IACF;IAEA,MAAMO,mBAAwD,CAAC;IAC/D,KAAK,MAAMC,cAAcZ,YAAa;QACpC,4EAA4E;QAC5EW,gBAAgB,CACdb,2BAA2B;YACzBI,MAAMU,WAAWV,IAAI;YACrBE,MAAMQ,WAAWN,IAAI,CAACF,IAAI;YAC1BS,UAAUZ,mBAAmBE,QAAQ,CAACU,QAAQ;YAC9CR,SAASJ,mBAAmBE,QAAQ,CAACE,OAAO;QAC9C,GACD,GAAGO,WAAWE,MAAM;IACvB;IAEA,MAAMC,eAA6B;QACjCC;YACE,OAAOC,QAAQC,OAAO,CAAC;gBAACjB;aAAmB;QAC7C;QACAkB;YACE,OAAOF,QAAQC,OAAO,CAACP;QACzB;IACF;IAEA,OAAO;QACLI;QACAK,oBAAoB;YAClBC,iBAAiB;QACnB;IACF;AACF;AAEA;;;CAGC,GACD,OAAO,SAASX,kBAAkBR,IAAgB,EAAEE,IAAY;IAC9D,OAAO,GAAGF,KAAK,YAAY,EAAEE,MAAM;AACrC"}
|
package/dist/utils/csv-export.js
CHANGED
|
@@ -188,7 +188,7 @@ export const exportDataAsCSV = ({ data })=>{
|
|
|
188
188
|
}
|
|
189
189
|
const columnNames = seriesInfo.map((info)=>info.columnName);
|
|
190
190
|
csvString += `DateTime,${columnNames.join(',')}\n`;
|
|
191
|
-
const sortedDateTimes = Object.keys(result).
|
|
191
|
+
const sortedDateTimes = Object.keys(result).toSorted((a, b)=>{
|
|
192
192
|
const dateA = new Date(a).getTime();
|
|
193
193
|
const dateB = new Date(b).getTime();
|
|
194
194
|
return dateA - dateB;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/utils/csv-export.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 interface SeriesDataPoint {\n timestamp: number | string;\n value: unknown;\n}\n\nexport interface DataSeries {\n name?: string;\n formattedName?: string;\n legendName?: string;\n displayName?: string;\n legend?: string;\n labels?: Record<string, string>;\n values: Array<[number | string, unknown]> | SeriesDataPoint[];\n}\n\nexport interface ExportableData {\n series: DataSeries[];\n timeRange?: {\n start: string | number;\n end: string | number;\n };\n stepMs?: number;\n metadata?: Record<string, unknown>;\n}\n\nexport const isExportableData = (data: unknown): data is ExportableData => {\n return !!(\n data &&\n typeof data === 'object' &&\n 'series' in data &&\n Array.isArray((data as ExportableData).series) &&\n (data as ExportableData).series.length > 0\n );\n};\n\nexport interface QueryDataInput {\n data?: unknown;\n error?: unknown;\n isFetching?: boolean;\n}\n\nexport const extractExportableData = (queryResults: QueryDataInput[]): ExportableData | undefined => {\n if (!queryResults || queryResults.length === 0) return undefined;\n\n const allSeries: DataSeries[] = [];\n let timeRange: ExportableData['timeRange'] = undefined;\n let stepMs: number | undefined = undefined;\n let metadata: ExportableData['metadata'] = undefined;\n\n queryResults.forEach((query) => {\n if (query?.data && typeof query.data === 'object' && 'series' in query.data) {\n const data = query.data as ExportableData;\n if (data.series && Array.isArray(data.series) && data.series.length > 0) {\n allSeries.push(...data.series);\n if (!timeRange && data.timeRange) {\n timeRange = data.timeRange;\n }\n if (!stepMs && data.stepMs) {\n stepMs = data.stepMs;\n }\n if (!metadata && data.metadata) {\n metadata = data.metadata;\n }\n }\n }\n });\n\n if (allSeries.length > 0) {\n return {\n series: allSeries,\n timeRange,\n stepMs,\n metadata,\n };\n }\n\n return undefined;\n};\n\nexport const formatLegendName = (series: DataSeries, seriesIndex: number): string => {\n const seriesAny = series as DataSeries & {\n formattedName?: string;\n legendName?: string;\n displayName?: string;\n legend?: string;\n labels?: Record<string, string>;\n };\n\n let legendName = series.formattedName || series.name;\n\n if (!legendName || legendName === `Series ${seriesIndex + 1}`) {\n legendName = seriesAny.legendName || seriesAny.displayName || seriesAny.legend || series.name || '';\n }\n\n if ((!legendName || legendName === series.name) && series.labels) {\n const labels = series.labels;\n const displayLabels = { ...labels };\n const metricName = displayLabels.__name__;\n delete displayLabels.__name__;\n\n const labelPairs = Object.entries(displayLabels)\n .filter(([value]) => value !== undefined && value !== null && value !== '')\n .map(([key, value]) => `${key}=\"${value}\"`)\n .join(', ');\n\n if (metricName && labelPairs) {\n legendName = `${metricName}{${labelPairs}}`;\n } else if (metricName) {\n legendName = metricName;\n } else if (labelPairs) {\n legendName = `{${labelPairs}}`;\n } else {\n legendName = labels.job || labels.instance || labels.metric || `Series ${seriesIndex + 1}`;\n }\n }\n\n if (!legendName || legendName.trim() === '') {\n legendName = `Series ${seriesIndex + 1}`;\n }\n\n return legendName;\n};\n\nexport const sanitizeColumnName = (name: string): string => {\n return name\n .replace(/[,\"\\n\\r]/g, '_')\n .replace(/\\s+/g, '_')\n .replace(/_+/g, '_')\n .replace(/^_|_$/g, '')\n .substring(0, 255);\n};\n\nexport const sanitizeFilename = (filename: string): string => {\n return filename\n .replace(/[<>:\"/\\\\|?*]/g, ' ')\n .trim()\n .split(/\\s+/)\n .filter((word) => word.length > 0)\n .map((word, index) => {\n if (index === 0) {\n return word.toLowerCase();\n }\n return word.charAt(0).toUpperCase() + word.slice(1).toLowerCase();\n })\n .join('');\n};\n\nexport const formatTimestampISO = (timestamp: number | string): string => {\n let timestampMs: number;\n\n if (typeof timestamp === 'string') {\n const date = new Date(timestamp);\n if (isNaN(date.getTime())) {\n return timestamp;\n }\n timestampMs = date.getTime();\n } else {\n timestampMs = timestamp > 1e10 ? timestamp : timestamp * 1000;\n }\n\n const date = new Date(timestampMs);\n if (isNaN(date.getTime())) {\n return new Date(timestampMs).toISOString();\n }\n\n return date.toISOString();\n};\n\nexport const escapeCsvValue = (value: unknown): string => {\n if (value === null || value === undefined) {\n return '';\n }\n\n const stringValue = String(value);\n\n if (\n stringValue.includes(',') ||\n stringValue.includes('\"') ||\n stringValue.includes('\\n') ||\n stringValue.includes('\\r')\n ) {\n return `\"${stringValue.replace(/\"/g, '\"\"')}\"`;\n }\n\n return stringValue;\n};\n\nexport interface ExportDataOptions {\n data: ExportableData;\n}\n\nexport const exportDataAsCSV = ({ data }: ExportDataOptions): Blob => {\n if (!isExportableData(data)) {\n console.warn('No valid data found to export to CSV.');\n return new Blob([''], { type: 'text/csv;charset=utf-8' });\n }\n\n let csvString = '';\n const result: Record<string, Record<string, unknown>> = {};\n const seriesInfo: Array<{ legendName: string; columnName: string; originalName: string }> = [];\n let validSeriesCount = 0;\n\n for (let i = 0; i < data.series.length; i++) {\n const series = data.series[i];\n\n if (!series) {\n continue;\n }\n\n if (!Array.isArray(series.values) || series.values.length === 0) {\n continue;\n }\n\n const legendName = formatLegendName(series, i);\n const columnName = sanitizeColumnName(legendName);\n\n const currentSeriesInfo = {\n legendName,\n columnName: columnName || `Series_${i + 1}`,\n originalName: series.name || '',\n };\n\n seriesInfo.push(currentSeriesInfo);\n validSeriesCount++;\n\n for (let j = 0; j < series.values.length; j++) {\n const entry = series.values[j];\n\n let timestamp: number | string;\n let value: unknown;\n\n if (Array.isArray(entry) && entry.length >= 2) {\n timestamp = entry[0];\n value = entry[1];\n } else if (typeof entry === 'object' && entry !== null && 'timestamp' in entry && 'value' in entry) {\n const dataPoint = entry as SeriesDataPoint;\n timestamp = dataPoint.timestamp;\n value = dataPoint.value;\n } else {\n continue;\n }\n\n if (value === null || value === undefined) {\n continue;\n }\n\n const dateTime = formatTimestampISO(timestamp);\n\n if (!result[dateTime]) {\n result[dateTime] = {};\n }\n /* linter complains, so assert result[dateTime]\n It has already been checked by the if statement\n */\n result[dateTime]![currentSeriesInfo.columnName] = value;\n }\n }\n\n if (validSeriesCount === 0 || seriesInfo.length === 0) {\n console.warn('No valid data found to export to CSV.');\n return new Blob([''], { type: 'text/csv;charset=utf-8' });\n }\n\n const timestampCount = Object.keys(result).length;\n if (timestampCount === 0) {\n console.warn('No valid timestamp data found to export to CSV.');\n return new Blob([''], { type: 'text/csv;charset=utf-8' });\n }\n\n const columnNames = seriesInfo.map((info) => info.columnName);\n csvString += `DateTime,${columnNames.join(',')}\\n`;\n\n const sortedDateTimes = Object.keys(result).sort((a, b) => {\n const dateA = new Date(a).getTime();\n const dateB = new Date(b).getTime();\n return dateA - dateB;\n });\n\n for (const dateTime of sortedDateTimes) {\n const rowData = result[dateTime];\n const values: string[] = [];\n\n if (rowData) {\n for (const columnName of columnNames) {\n const value = rowData[columnName];\n values.push(escapeCsvValue(value));\n }\n\n csvString += `${escapeCsvValue(dateTime)},${values.join(',')}\\n`;\n }\n }\n\n return new Blob([csvString], { type: 'text/csv;charset=utf-8' });\n};\n"],"names":["isExportableData","data","Array","isArray","series","length","extractExportableData","queryResults","undefined","allSeries","timeRange","stepMs","metadata","forEach","query","push","formatLegendName","seriesIndex","seriesAny","legendName","formattedName","name","displayName","legend","labels","displayLabels","metricName","__name__","labelPairs","Object","entries","filter","value","map","key","join","job","instance","metric","trim","sanitizeColumnName","replace","substring","sanitizeFilename","filename","split","word","index","toLowerCase","charAt","toUpperCase","slice","formatTimestampISO","timestamp","timestampMs","date","Date","isNaN","getTime","toISOString","escapeCsvValue","stringValue","String","includes","exportDataAsCSV","console","warn","Blob","type","csvString","result","seriesInfo","validSeriesCount","i","values","columnName","currentSeriesInfo","originalName","j","entry","dataPoint","dateTime","timestampCount","keys","columnNames","info","sortedDateTimes","sort","a","b","dateA","dateB","rowData"],"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;AA2BjC,OAAO,MAAMA,mBAAmB,CAACC;IAC/B,OAAO,CAAC,CACNA,CAAAA,QACA,OAAOA,SAAS,YAChB,YAAYA,QACZC,MAAMC,OAAO,CAAC,AAACF,KAAwBG,MAAM,KAC7C,AAACH,KAAwBG,MAAM,CAACC,MAAM,GAAG,CAAA;AAE7C,EAAE;AAQF,OAAO,MAAMC,wBAAwB,CAACC;IACpC,IAAI,CAACA,gBAAgBA,aAAaF,MAAM,KAAK,GAAG,OAAOG;IAEvD,MAAMC,YAA0B,EAAE;IAClC,IAAIC,YAAyCF;IAC7C,IAAIG,SAA6BH;IACjC,IAAII,WAAuCJ;IAE3CD,aAAaM,OAAO,CAAC,CAACC;QACpB,IAAIA,OAAOb,QAAQ,OAAOa,MAAMb,IAAI,KAAK,YAAY,YAAYa,MAAMb,IAAI,EAAE;YAC3E,MAAMA,OAAOa,MAAMb,IAAI;YACvB,IAAIA,KAAKG,MAAM,IAAIF,MAAMC,OAAO,CAACF,KAAKG,MAAM,KAAKH,KAAKG,MAAM,CAACC,MAAM,GAAG,GAAG;gBACvEI,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KV,UAAU;IAC5DN,aAAa,CAAC,SAAS,EAAEe,YAAYjD,IAAI,CAAC,KAAK,EAAE,CAAC;IAElD,MAAMmD,kBAAkBzD,OAAOsD,IAAI,CAACb,QAAQiB,IAAI,CAAC,CAACC,GAAGC;QACnD,MAAMC,QAAQ,IAAIlC,KAAKgC,GAAG9B,OAAO;QACjC,MAAMiC,QAAQ,IAAInC,KAAKiC,GAAG/B,OAAO;QACjC,OAAOgC,QAAQC;IACjB;IAEA,KAAK,MAAMV,YAAYK,gBAAiB;QACtC,MAAMM,UAAUtB,MAAM,CAACW,SAAS;QAChC,MAAMP,SAAmB,EAAE;QAE3B,IAAIkB,SAAS;YACX,KAAK,MAAMjB,cAAcS,YAAa;gBACpC,MAAMpD,QAAQ4D,OAAO,CAACjB,WAAW;gBACjCD,OAAO3D,IAAI,CAAC6C,eAAe5B;YAC7B;YAEAqC,aAAa,GAAGT,eAAeqB,UAAU,CAAC,EAAEP,OAAOvC,IAAI,CAAC,KAAK,EAAE,CAAC;QAClE;IACF;IAEA,OAAO,IAAIgC,KAAK;QAACE;KAAU,EAAE;QAAED,MAAM;IAAyB;AAChE,EAAE"}
|
|
1
|
+
{"version":3,"sources":["../../src/utils/csv-export.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 interface SeriesDataPoint {\n timestamp: number | string;\n value: unknown;\n}\n\nexport interface DataSeries {\n name?: string;\n formattedName?: string;\n legendName?: string;\n displayName?: string;\n legend?: string;\n labels?: Record<string, string>;\n values: Array<[number | string, unknown]> | SeriesDataPoint[];\n}\n\nexport interface ExportableData {\n series: DataSeries[];\n timeRange?: {\n start: string | number;\n end: string | number;\n };\n stepMs?: number;\n metadata?: Record<string, unknown>;\n}\n\nexport const isExportableData = (data: unknown): data is ExportableData => {\n return !!(\n data &&\n typeof data === 'object' &&\n 'series' in data &&\n Array.isArray((data as ExportableData).series) &&\n (data as ExportableData).series.length > 0\n );\n};\n\nexport interface QueryDataInput {\n data?: unknown;\n error?: unknown;\n isFetching?: boolean;\n}\n\nexport const extractExportableData = (queryResults: QueryDataInput[]): ExportableData | undefined => {\n if (!queryResults || queryResults.length === 0) return undefined;\n\n const allSeries: DataSeries[] = [];\n let timeRange: ExportableData['timeRange'] = undefined;\n let stepMs: number | undefined = undefined;\n let metadata: ExportableData['metadata'] = undefined;\n\n queryResults.forEach((query) => {\n if (query?.data && typeof query.data === 'object' && 'series' in query.data) {\n const data = query.data as ExportableData;\n if (data.series && Array.isArray(data.series) && data.series.length > 0) {\n allSeries.push(...data.series);\n if (!timeRange && data.timeRange) {\n timeRange = data.timeRange;\n }\n if (!stepMs && data.stepMs) {\n stepMs = data.stepMs;\n }\n if (!metadata && data.metadata) {\n metadata = data.metadata;\n }\n }\n }\n });\n\n if (allSeries.length > 0) {\n return {\n series: allSeries,\n timeRange,\n stepMs,\n metadata,\n };\n }\n\n return undefined;\n};\n\nexport const formatLegendName = (series: DataSeries, seriesIndex: number): string => {\n const seriesAny = series as DataSeries & {\n formattedName?: string;\n legendName?: string;\n displayName?: string;\n legend?: string;\n labels?: Record<string, string>;\n };\n\n let legendName = series.formattedName || series.name;\n\n if (!legendName || legendName === `Series ${seriesIndex + 1}`) {\n legendName = seriesAny.legendName || seriesAny.displayName || seriesAny.legend || series.name || '';\n }\n\n if ((!legendName || legendName === series.name) && series.labels) {\n const labels = series.labels;\n const displayLabels = { ...labels };\n const metricName = displayLabels.__name__;\n delete displayLabels.__name__;\n\n const labelPairs = Object.entries(displayLabels)\n .filter(([value]) => value !== undefined && value !== null && value !== '')\n .map(([key, value]) => `${key}=\"${value}\"`)\n .join(', ');\n\n if (metricName && labelPairs) {\n legendName = `${metricName}{${labelPairs}}`;\n } else if (metricName) {\n legendName = metricName;\n } else if (labelPairs) {\n legendName = `{${labelPairs}}`;\n } else {\n legendName = labels.job || labels.instance || labels.metric || `Series ${seriesIndex + 1}`;\n }\n }\n\n if (!legendName || legendName.trim() === '') {\n legendName = `Series ${seriesIndex + 1}`;\n }\n\n return legendName;\n};\n\nexport const sanitizeColumnName = (name: string): string => {\n return name\n .replace(/[,\"\\n\\r]/g, '_')\n .replace(/\\s+/g, '_')\n .replace(/_+/g, '_')\n .replace(/^_|_$/g, '')\n .substring(0, 255);\n};\n\nexport const sanitizeFilename = (filename: string): string => {\n return filename\n .replace(/[<>:\"/\\\\|?*]/g, ' ')\n .trim()\n .split(/\\s+/)\n .filter((word) => word.length > 0)\n .map((word, index) => {\n if (index === 0) {\n return word.toLowerCase();\n }\n return word.charAt(0).toUpperCase() + word.slice(1).toLowerCase();\n })\n .join('');\n};\n\nexport const formatTimestampISO = (timestamp: number | string): string => {\n let timestampMs: number;\n\n if (typeof timestamp === 'string') {\n const date = new Date(timestamp);\n if (isNaN(date.getTime())) {\n return timestamp;\n }\n timestampMs = date.getTime();\n } else {\n timestampMs = timestamp > 1e10 ? timestamp : timestamp * 1000;\n }\n\n const date = new Date(timestampMs);\n if (isNaN(date.getTime())) {\n return new Date(timestampMs).toISOString();\n }\n\n return date.toISOString();\n};\n\nexport const escapeCsvValue = (value: unknown): string => {\n if (value === null || value === undefined) {\n return '';\n }\n\n const stringValue = String(value);\n\n if (\n stringValue.includes(',') ||\n stringValue.includes('\"') ||\n stringValue.includes('\\n') ||\n stringValue.includes('\\r')\n ) {\n return `\"${stringValue.replace(/\"/g, '\"\"')}\"`;\n }\n\n return stringValue;\n};\n\nexport interface ExportDataOptions {\n data: ExportableData;\n}\n\nexport const exportDataAsCSV = ({ data }: ExportDataOptions): Blob => {\n if (!isExportableData(data)) {\n console.warn('No valid data found to export to CSV.');\n return new Blob([''], { type: 'text/csv;charset=utf-8' });\n }\n\n let csvString = '';\n const result: Record<string, Record<string, unknown>> = {};\n const seriesInfo: Array<{ legendName: string; columnName: string; originalName: string }> = [];\n let validSeriesCount = 0;\n\n for (let i = 0; i < data.series.length; i++) {\n const series = data.series[i];\n\n if (!series) {\n continue;\n }\n\n if (!Array.isArray(series.values) || series.values.length === 0) {\n continue;\n }\n\n const legendName = formatLegendName(series, i);\n const columnName = sanitizeColumnName(legendName);\n\n const currentSeriesInfo = {\n legendName,\n columnName: columnName || `Series_${i + 1}`,\n originalName: series.name || '',\n };\n\n seriesInfo.push(currentSeriesInfo);\n validSeriesCount++;\n\n for (let j = 0; j < series.values.length; j++) {\n const entry = series.values[j];\n\n let timestamp: number | string;\n let value: unknown;\n\n if (Array.isArray(entry) && entry.length >= 2) {\n timestamp = entry[0];\n value = entry[1];\n } else if (typeof entry === 'object' && entry !== null && 'timestamp' in entry && 'value' in entry) {\n const dataPoint = entry as SeriesDataPoint;\n timestamp = dataPoint.timestamp;\n value = dataPoint.value;\n } else {\n continue;\n }\n\n if (value === null || value === undefined) {\n continue;\n }\n\n const dateTime = formatTimestampISO(timestamp);\n\n if (!result[dateTime]) {\n result[dateTime] = {};\n }\n /* linter complains, so assert result[dateTime]\n It has already been checked by the if statement\n */\n result[dateTime]![currentSeriesInfo.columnName] = value;\n }\n }\n\n if (validSeriesCount === 0 || seriesInfo.length === 0) {\n console.warn('No valid data found to export to CSV.');\n return new Blob([''], { type: 'text/csv;charset=utf-8' });\n }\n\n const timestampCount = Object.keys(result).length;\n if (timestampCount === 0) {\n console.warn('No valid timestamp data found to export to CSV.');\n return new Blob([''], { type: 'text/csv;charset=utf-8' });\n }\n\n const columnNames = seriesInfo.map((info) => info.columnName);\n csvString += `DateTime,${columnNames.join(',')}\\n`;\n\n const sortedDateTimes = Object.keys(result).toSorted((a, b) => {\n const dateA = new Date(a).getTime();\n const dateB = new Date(b).getTime();\n return dateA - dateB;\n });\n\n for (const dateTime of sortedDateTimes) {\n const rowData = result[dateTime];\n const values: string[] = [];\n\n if (rowData) {\n for (const columnName of columnNames) {\n const value = rowData[columnName];\n values.push(escapeCsvValue(value));\n }\n\n csvString += `${escapeCsvValue(dateTime)},${values.join(',')}\\n`;\n }\n }\n\n return new Blob([csvString], { type: 'text/csv;charset=utf-8' });\n};\n"],"names":["isExportableData","data","Array","isArray","series","length","extractExportableData","queryResults","undefined","allSeries","timeRange","stepMs","metadata","forEach","query","push","formatLegendName","seriesIndex","seriesAny","legendName","formattedName","name","displayName","legend","labels","displayLabels","metricName","__name__","labelPairs","Object","entries","filter","value","map","key","join","job","instance","metric","trim","sanitizeColumnName","replace","substring","sanitizeFilename","filename","split","word","index","toLowerCase","charAt","toUpperCase","slice","formatTimestampISO","timestamp","timestampMs","date","Date","isNaN","getTime","toISOString","escapeCsvValue","stringValue","String","includes","exportDataAsCSV","console","warn","Blob","type","csvString","result","seriesInfo","validSeriesCount","i","values","columnName","currentSeriesInfo","originalName","j","entry","dataPoint","dateTime","timestampCount","keys","columnNames","info","sortedDateTimes","toSorted","a","b","dateA","dateB","rowData"],"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;AA2BjC,OAAO,MAAMA,mBAAmB,CAACC;IAC/B,OAAO,CAAC,CACNA,CAAAA,QACA,OAAOA,SAAS,YAChB,YAAYA,QACZC,MAAMC,OAAO,CAAC,AAACF,KAAwBG,MAAM,KAC7C,AAACH,KAAwBG,MAAM,CAACC,MAAM,GAAG,CAAA;AAE7C,EAAE;AAQF,OAAO,MAAMC,wBAAwB,CAACC;IACpC,IAAI,CAACA,gBAAgBA,aAAaF,MAAM,KAAK,GAAG,OAAOG;IAEvD,MAAMC,YAA0B,EAAE;IAClC,IAAIC,YAAyCF;IAC7C,IAAIG,SAA6BH;IACj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AAK;YAAC;SAAG,EAAE;YAAEC,MAAM;QAAyB;IACzD;IAEA,MAAMc,iBAAiBrD,OAAOsD,IAAI,CAACb,QAAQjE,MAAM;IACjD,IAAI6E,mBAAmB,GAAG;QACxBjB,QAAQC,IAAI,CAAC;QACb,OAAO,IAAIC,KAAK;YAAC;SAAG,EAAE;YAAEC,MAAM;QAAyB;IACzD;IAEA,MAAMgB,cAAcb,WAAWtC,GAAG,CAAC,CAACoD,OAASA,KAAKV,UAAU;IAC5DN,aAAa,CAAC,SAAS,EAAEe,YAAYjD,IAAI,CAAC,KAAK,EAAE,CAAC;IAElD,MAAMmD,kBAAkBzD,OAAOsD,IAAI,CAACb,QAAQiB,QAAQ,CAAC,CAACC,GAAGC;QACvD,MAAMC,QAAQ,IAAIlC,KAAKgC,GAAG9B,OAAO;QACjC,MAAMiC,QAAQ,IAAInC,KAAKiC,GAAG/B,OAAO;QACjC,OAAOgC,QAAQC;IACjB;IAEA,KAAK,MAAMV,YAAYK,gBAAiB;QACtC,MAAMM,UAAUtB,MAAM,CAACW,SAAS;QAChC,MAAMP,SAAmB,EAAE;QAE3B,IAAIkB,SAAS;YACX,KAAK,MAAMjB,cAAcS,YAAa;gBACpC,MAAMpD,QAAQ4D,OAAO,CAACjB,WAAW;gBACjCD,OAAO3D,IAAI,CAAC6C,eAAe5B;YAC7B;YAEAqC,aAAa,GAAGT,eAAeqB,UAAU,CAAC,EAAEP,OAAOvC,IAAI,CAAC,KAAK,EAAE,CAAC;QAClE;IACF;IAEA,OAAO,IAAIgC,KAAK;QAACE;KAAU,EAAE;QAAED,MAAM;IAAyB;AAChE,EAAE"}
|
package/dist/utils/event.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
|
-
import { useRef, useLayoutEffect, useCallback } from
|
|
13
|
+
import { useRef, useLayoutEffect, useCallback } from "react";
|
|
14
14
|
/**
|
|
15
15
|
* A (temporary) userland implementation of `useEvent` from this React RFC: https://github.com/reactjs/rfcs/pull/220.
|
|
16
16
|
*
|
package/dist/utils/index.js
CHANGED
|
@@ -10,8 +10,8 @@
|
|
|
10
10
|
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
11
11
|
// See the License for the specific language governing permissions and
|
|
12
12
|
// limitations under the License.
|
|
13
|
-
export * from
|
|
14
|
-
export * from
|
|
15
|
-
export * from
|
|
13
|
+
export * from "./event.js";
|
|
14
|
+
export * from "./variables.js";
|
|
15
|
+
export * from "./csv-export.js";
|
|
16
16
|
|
|
17
17
|
//# sourceMappingURL=index.js.map
|
package/dist/utils/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/utils/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 './event';\nexport * from './variables';\nexport * from './csv-export';\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/utils/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 './event';\nexport * from './variables';\nexport * from './csv-export';\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,aAAU;AACxB,cAAc,iBAAc;AAC5B,cAAc,kBAAe"}
|
package/dist/utils/variables.js
CHANGED
|
@@ -11,6 +11,6 @@
|
|
|
11
11
|
// See the License for the specific language governing permissions and
|
|
12
12
|
// limitations under the License.
|
|
13
13
|
// Re-export all variable interpolation utilities from @perses-dev/components for backwards compatibility
|
|
14
|
-
export { InterpolationFormat, interpolate, parseVariables, parseVariablesAndFormat, replaceVariable, replaceVariables } from
|
|
14
|
+
export { InterpolationFormat, interpolate, parseVariables, parseVariablesAndFormat, replaceVariable, replaceVariables } from "@perses-dev/components";
|
|
15
15
|
|
|
16
16
|
//# sourceMappingURL=variables.js.map
|
package/package.json
CHANGED
|
@@ -1,24 +1,24 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@perses-dev/plugin-system",
|
|
3
|
-
"version": "0.55.0-beta.
|
|
3
|
+
"version": "0.55.0-beta.7",
|
|
4
4
|
"description": "The plugin feature in Pereses",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"homepage": "https://github.com/perses/perses/blob/main/README.md",
|
|
7
7
|
"repository": {
|
|
8
8
|
"type": "git",
|
|
9
|
-
"url": "git+https://github.com/perses/
|
|
9
|
+
"url": "git+https://github.com/perses/shared.git"
|
|
10
10
|
},
|
|
11
11
|
"bugs": {
|
|
12
12
|
"url": "https://github.com/perses/perses/issues"
|
|
13
13
|
},
|
|
14
|
+
"type": "module",
|
|
14
15
|
"module": "dist/index.js",
|
|
15
|
-
"main": "dist
|
|
16
|
+
"main": "dist/index.js",
|
|
16
17
|
"types": "dist/index.d.ts",
|
|
17
18
|
"sideEffects": false,
|
|
18
19
|
"scripts": {
|
|
19
20
|
"clean": "rimraf dist/",
|
|
20
21
|
"build": "concurrently \"npm:build:*\"",
|
|
21
|
-
"build:cjs": "swc ./src -d dist/cjs --strip-leading-paths --config-file ../.cjs.swcrc",
|
|
22
22
|
"build:esm": "swc ./src -d dist --strip-leading-paths --config-file ../.swcrc",
|
|
23
23
|
"build:types": "tsc --project tsconfig.build.json",
|
|
24
24
|
"type-check": "tsc --noEmit",
|
|
@@ -30,9 +30,9 @@
|
|
|
30
30
|
},
|
|
31
31
|
"dependencies": {
|
|
32
32
|
"@module-federation/enhanced": "^2.8.0",
|
|
33
|
-
"@perses-dev/client": "0.55.0-beta.
|
|
34
|
-
"@perses-dev/components": "0.55.0-beta.
|
|
35
|
-
"@perses-dev/spec": "0.3.0-beta.
|
|
33
|
+
"@perses-dev/client": "0.55.0-beta.7",
|
|
34
|
+
"@perses-dev/components": "0.55.0-beta.7",
|
|
35
|
+
"@perses-dev/spec": "0.3.0-beta.5",
|
|
36
36
|
"date-fns": "^4.1.0",
|
|
37
37
|
"date-fns-tz": "^3.2.0",
|
|
38
38
|
"immer": "^10.1.1",
|
|
@@ -47,8 +47,8 @@
|
|
|
47
47
|
"@hookform/resolvers": "^3.2.0",
|
|
48
48
|
"@mui/material": "^6.1.10",
|
|
49
49
|
"@tanstack/react-query": "^4.39.1",
|
|
50
|
-
"react": "^
|
|
51
|
-
"react-dom": "^
|
|
50
|
+
"react": "^18.3.0",
|
|
51
|
+
"react-dom": "^18.3.0"
|
|
52
52
|
},
|
|
53
53
|
"files": [
|
|
54
54
|
"dist"
|