@perses-dev/plugin-system 0.55.0-beta.2 → 0.55.0-beta.6
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 +3 -2
- package/dist/components/DatasourceEditorForm/DatasourceEditorForm.d.ts.map +1 -1
- package/dist/components/DatasourceEditorForm/DatasourceEditorForm.js +10 -9
- 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 +8 -0
- package/dist/components/DatasourceTestConnectionButton/DatasourceTestConnectionButton.d.ts.map +1 -0
- package/dist/components/DatasourceTestConnectionButton/DatasourceTestConnectionButton.js +45 -0
- package/dist/components/DatasourceTestConnectionButton/DatasourceTestConnectionButton.js.map +1 -0
- package/dist/components/DatasourceTestConnectionButton/index.d.ts +2 -0
- package/dist/components/DatasourceTestConnectionButton/index.d.ts.map +1 -0
- package/dist/{cjs/model/alerts-queries.js → components/DatasourceTestConnectionButton/index.js} +3 -4
- package/dist/components/DatasourceTestConnectionButton/index.js.map +1 -0
- package/dist/components/HTTPSettingsEditor/HTTPSettingsEditor.d.ts +3 -2
- package/dist/components/HTTPSettingsEditor/HTTPSettingsEditor.d.ts.map +1 -1
- package/dist/components/HTTPSettingsEditor/HTTPSettingsEditor.js +54 -29
- 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 +24 -24
- 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 +16 -0
- package/dist/components/LayoutEditor/LayoutEditor.d.ts.map +1 -0
- package/dist/components/LayoutEditor/LayoutEditor.js +115 -0
- package/dist/components/LayoutEditor/LayoutEditor.js.map +1 -0
- package/dist/components/LayoutEditor/RepeatLayoutPreview.d.ts +7 -0
- package/dist/components/LayoutEditor/RepeatLayoutPreview.d.ts.map +1 -0
- package/dist/components/LayoutEditor/RepeatLayoutPreview.js +92 -0
- package/dist/components/LayoutEditor/RepeatLayoutPreview.js.map +1 -0
- package/dist/components/LayoutEditor/RepeatVariableEditor.d.ts +18 -0
- package/dist/components/LayoutEditor/RepeatVariableEditor.d.ts.map +1 -0
- package/dist/components/LayoutEditor/RepeatVariableEditor.js +168 -0
- package/dist/components/LayoutEditor/RepeatVariableEditor.js.map +1 -0
- package/dist/components/LayoutEditor/index.d.ts +4 -0
- package/dist/components/LayoutEditor/index.d.ts.map +1 -0
- package/dist/{cjs/model/explore.js → components/LayoutEditor/index.js} +5 -4
- package/dist/components/LayoutEditor/index.js.map +1 -0
- 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 -4
- package/dist/components/MultiQueryEditor/MultiQueryEditor.d.ts.map +1 -1
- package/dist/components/MultiQueryEditor/MultiQueryEditor.js +12 -9
- package/dist/components/MultiQueryEditor/MultiQueryEditor.js.map +1 -1
- package/dist/components/MultiQueryEditor/QueryEditorContainer.d.ts +3 -4
- 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 +7 -5
- package/dist/components/PanelSpecEditor/PanelSpecEditor.d.ts.map +1 -1
- package/dist/components/PanelSpecEditor/PanelSpecEditor.js +19 -10
- 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 +10 -9
- 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 +4 -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 -4
- package/dist/components/PluginKindSelect/PluginKindSelect.d.ts.map +1 -1
- package/dist/components/PluginKindSelect/PluginKindSelect.js +4 -4
- 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 +10 -0
- package/dist/components/PluginSpecEditor/DatasourceSpecEditor.d.ts.map +1 -0
- package/dist/components/PluginSpecEditor/DatasourceSpecEditor.js +62 -0
- package/dist/components/PluginSpecEditor/DatasourceSpecEditor.js.map +1 -0
- package/dist/components/PluginSpecEditor/PluginSpecEditor.d.ts +5 -4
- package/dist/components/PluginSpecEditor/PluginSpecEditor.d.ts.map +1 -1
- package/dist/components/PluginSpecEditor/PluginSpecEditor.js +19 -5
- 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 +2 -2
- package/dist/components/TimeRangeControls/TimeRangeControls.d.ts.map +1 -1
- package/dist/components/TimeRangeControls/TimeRangeControls.js +13 -14
- 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 +7 -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.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.d.ts +2 -0
- package/dist/components/index.d.ts.map +1 -1
- package/dist/components/index.js +21 -19
- package/dist/components/index.js.map +1 -1
- package/dist/constants/index.d.ts +1 -0
- package/dist/constants/index.d.ts.map +1 -1
- package/dist/constants/index.js +2 -1
- package/dist/constants/index.js.map +1 -1
- package/dist/constants/repeat.d.ts +3 -0
- package/dist/constants/repeat.d.ts.map +1 -0
- package/dist/{cjs/model/datasource.js → constants/repeat.js} +4 -4
- package/dist/constants/repeat.js.map +1 -0
- 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 +10 -3
- package/dist/model/datasource.d.ts.map +1 -1
- package/dist/model/datasource.js +1 -1
- package/dist/model/datasource.js.map +1 -1
- package/dist/model/explore.d.ts +2 -3
- package/dist/model/explore.d.ts.map +1 -1
- package/dist/model/explore.js.map +1 -1
- package/dist/model/index.d.ts +1 -0
- package/dist/model/index.d.ts.map +1 -1
- package/dist/model/index.js +17 -16
- package/dist/model/index.js.map +1 -1
- package/dist/model/json-queries.d.ts +29 -0
- package/dist/model/json-queries.d.ts.map +1 -0
- package/dist/{cjs/model/annotations.js → model/json-queries.js} +5 -4
- package/dist/model/json-queries.js.map +1 -0
- 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 +13 -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 +3 -3
- 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 +15 -13
- 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 +7 -3
- package/dist/model/variables.d.ts.map +1 -1
- package/dist/model/variables.js +1 -3
- package/dist/model/variables.js.map +1 -1
- package/dist/remote/PluginLoaderComponent.d.ts +1 -2
- 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 +2 -2
- package/dist/remote/PluginRuntime.d.ts.map +1 -1
- package/dist/remote/PluginRuntime.js +18 -26
- package/dist/remote/PluginRuntime.js.map +1 -1
- package/dist/remote/index.js +2 -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 +20 -12
- 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 +22 -8
- 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 +5 -5
- package/dist/runtime/TimeRangeProvider/TimeRangeProviders.js.map +1 -1
- package/dist/runtime/TimeRangeProvider/TimeRangeSettingsProvider.d.ts +9 -2
- package/dist/runtime/TimeRangeProvider/TimeRangeSettingsProvider.d.ts.map +1 -1
- package/dist/runtime/TimeRangeProvider/TimeRangeSettingsProvider.js +16 -3
- 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 -3
- 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 -3
- 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.d.ts +1 -0
- package/dist/runtime/index.d.ts.map +1 -1
- package/dist/runtime/index.js +16 -15
- 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 +2 -2
- package/dist/runtime/item-actions.js.map +1 -1
- package/dist/runtime/json-queries.d.ts +11 -0
- package/dist/runtime/json-queries.d.ts.map +1 -0
- package/dist/runtime/json-queries.js +58 -0
- package/dist/runtime/json-queries.js.map +1 -0
- 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 -4
- 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 -2
- 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 +18 -4
- 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 +2 -1
- package/dist/test/mock-data.d.ts.map +1 -1
- package/dist/test/mock-data.js +6 -0
- 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.d.ts +1 -1
- package/dist/test/setup-tests.d.ts.map +1 -1
- package/dist/test/setup-tests.js +3 -2
- package/dist/test/setup-tests.js.map +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 +7 -1
- package/dist/test/test-plugins/ernie/index.d.ts.map +1 -1
- package/dist/test/test-plugins/ernie/index.js +58 -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 +5 -5
- 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.d.ts.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 +11 -11
- 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 -270
- 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/HTTPSettingsEditor/HTTPSettingsEditor.js +0 -568
- 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/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 -159
- 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 -135
- package/dist/cjs/components/PanelSpecEditor/index.js +0 -30
- package/dist/cjs/components/PluginEditor/PluginEditor.js +0 -98
- 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/PluginSpecEditor.js +0 -55
- 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 -236
- 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 -48
- package/dist/cjs/constants/index.js +0 -30
- 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/calculations.js +0 -178
- package/dist/cjs/model/index.js +0 -45
- 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 -331
- package/dist/cjs/remote/index.js +0 -31
- package/dist/cjs/remote/remotePluginLoader.js +0 -101
- package/dist/cjs/runtime/DataQueriesProvider/DataQueriesProvider.js +0 -154
- 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 -201
- package/dist/cjs/runtime/TimeRangeProvider/TimeRangeProviders.js +0 -66
- package/dist/cjs/runtime/TimeRangeProvider/TimeRangeSettingsProvider.js +0 -113
- 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 -44
- package/dist/cjs/runtime/item-actions.js +0 -302
- 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 -42
- package/dist/cjs/test/index.js +0 -31
- package/dist/cjs/test/mock-data.js +0 -357
- 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 -20
- package/dist/cjs/test/test-plugins/bert/index.js +0 -99
- package/dist/cjs/test/test-plugins/ernie/index.js +0 -92
- 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,148 +0,0 @@
|
|
|
1
|
-
// Copyright The Perses Authors
|
|
2
|
-
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
3
|
-
// you may not use this file except in compliance with the License.
|
|
4
|
-
// You may obtain a copy of the License at
|
|
5
|
-
//
|
|
6
|
-
// http://www.apache.org/licenses/LICENSE-2.0
|
|
7
|
-
//
|
|
8
|
-
// Unless required by applicable law or agreed to in writing, software
|
|
9
|
-
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
10
|
-
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
11
|
-
// See the License for the specific language governing permissions and
|
|
12
|
-
// limitations under the License.
|
|
13
|
-
"use strict";
|
|
14
|
-
Object.defineProperty(exports, "__esModule", {
|
|
15
|
-
value: true
|
|
16
|
-
});
|
|
17
|
-
function _export(target, all) {
|
|
18
|
-
for(var name in all)Object.defineProperty(target, name, {
|
|
19
|
-
enumerable: true,
|
|
20
|
-
get: Object.getOwnPropertyDescriptor(all, name).get
|
|
21
|
-
});
|
|
22
|
-
}
|
|
23
|
-
_export(exports, {
|
|
24
|
-
get ANNOTATION_KEY () {
|
|
25
|
-
return ANNOTATION_KEY;
|
|
26
|
-
},
|
|
27
|
-
get useAnnotationData () {
|
|
28
|
-
return useAnnotationData;
|
|
29
|
-
},
|
|
30
|
-
get useAnnotations () {
|
|
31
|
-
return useAnnotations;
|
|
32
|
-
}
|
|
33
|
-
});
|
|
34
|
-
const _reactquery = require("@tanstack/react-query");
|
|
35
|
-
const _pluginregistry = require("./plugin-registry");
|
|
36
|
-
const _TimeRangeProvider = require("./TimeRangeProvider");
|
|
37
|
-
const _variables = require("./variables");
|
|
38
|
-
const _datasources = require("./datasources");
|
|
39
|
-
const _utils = require("./utils");
|
|
40
|
-
const ANNOTATION_KEY = 'Annotation';
|
|
41
|
-
function useAnnotationContext() {
|
|
42
|
-
const { absoluteTimeRange } = (0, _TimeRangeProvider.useTimeRange)();
|
|
43
|
-
const variableState = (0, _variables.useAllVariableValues)();
|
|
44
|
-
const datasourceStore = (0, _datasources.useDatasourceStore)();
|
|
45
|
-
return {
|
|
46
|
-
variableState,
|
|
47
|
-
datasourceStore,
|
|
48
|
-
absoluteTimeRange
|
|
49
|
-
};
|
|
50
|
-
}
|
|
51
|
-
function getQueryOptions({ plugin, definition, context }) {
|
|
52
|
-
const { variableState, absoluteTimeRange } = context;
|
|
53
|
-
const dependencies = plugin?.dependsOn ? plugin.dependsOn(definition.plugin.spec, context) : {};
|
|
54
|
-
const variableDependencies = dependencies?.variables;
|
|
55
|
-
const filteredVariableState = (0, _utils.filterVariableStateMap)(variableState, variableDependencies);
|
|
56
|
-
const variablesValueKey = (0, _utils.getVariableValuesKey)(filteredVariableState);
|
|
57
|
-
const queryKey = [
|
|
58
|
-
ANNOTATION_KEY,
|
|
59
|
-
definition,
|
|
60
|
-
absoluteTimeRange,
|
|
61
|
-
variablesValueKey
|
|
62
|
-
];
|
|
63
|
-
let waitToLoad = false;
|
|
64
|
-
if (variableDependencies) {
|
|
65
|
-
waitToLoad = variableDependencies.some((v)=>variableState[v]?.loading);
|
|
66
|
-
}
|
|
67
|
-
const queryEnabled = plugin !== undefined && !waitToLoad;
|
|
68
|
-
return {
|
|
69
|
-
queryKey,
|
|
70
|
-
queryEnabled
|
|
71
|
-
};
|
|
72
|
-
}
|
|
73
|
-
function useAnnotations(definitions) {
|
|
74
|
-
const { getPlugin } = (0, _pluginregistry.usePluginRegistry)();
|
|
75
|
-
const context = useAnnotationContext();
|
|
76
|
-
const pluginLoaderResponse = (0, _pluginregistry.usePlugins)('Annotation', definitions.map((d)=>({
|
|
77
|
-
kind: d.plugin.kind
|
|
78
|
-
})));
|
|
79
|
-
// useQueries() handles data fetching from query plugins
|
|
80
|
-
return (0, _reactquery.useQueries)({
|
|
81
|
-
queries: definitions.map((definition, idx)=>{
|
|
82
|
-
const plugin = pluginLoaderResponse[idx]?.data;
|
|
83
|
-
const { queryEnabled, queryKey } = getQueryOptions({
|
|
84
|
-
context,
|
|
85
|
-
definition,
|
|
86
|
-
plugin
|
|
87
|
-
});
|
|
88
|
-
const annotationKind = definition?.plugin?.kind;
|
|
89
|
-
return {
|
|
90
|
-
enabled: queryEnabled,
|
|
91
|
-
queryKey: queryKey,
|
|
92
|
-
refetchOnMount: false,
|
|
93
|
-
refetchOnWindowFocus: false,
|
|
94
|
-
refetchOnReconnect: false,
|
|
95
|
-
staleTime: Infinity,
|
|
96
|
-
queryFn: async ({ signal })=>{
|
|
97
|
-
const plugin = await getPlugin({
|
|
98
|
-
kind: ANNOTATION_KEY,
|
|
99
|
-
name: annotationKind
|
|
100
|
-
});
|
|
101
|
-
const data = await plugin.getAnnotationData(definition.plugin.spec, context, signal);
|
|
102
|
-
return data;
|
|
103
|
-
}
|
|
104
|
-
};
|
|
105
|
-
})
|
|
106
|
-
});
|
|
107
|
-
}
|
|
108
|
-
function useAnnotationData(spec) {
|
|
109
|
-
const { data: annotationPlugin } = (0, _pluginregistry.usePlugin)('Annotation', spec.plugin.kind);
|
|
110
|
-
const datasourceStore = (0, _datasources.useDatasourceStore)();
|
|
111
|
-
const allVariables = (0, _variables.useAllVariableValues)();
|
|
112
|
-
const { absoluteTimeRange: timeRange } = (0, _TimeRangeProvider.useTimeRange)();
|
|
113
|
-
const variablePluginCtx = {
|
|
114
|
-
absoluteTimeRange: timeRange,
|
|
115
|
-
datasourceStore,
|
|
116
|
-
variableState: allVariables
|
|
117
|
-
};
|
|
118
|
-
let dependsOnVariables = Object.keys(allVariables); // Default to all variables
|
|
119
|
-
if (annotationPlugin?.dependsOn) {
|
|
120
|
-
const dependencies = annotationPlugin.dependsOn(spec.plugin.spec, variablePluginCtx);
|
|
121
|
-
dependsOnVariables = dependencies.variables ? dependencies.variables : dependsOnVariables;
|
|
122
|
-
}
|
|
123
|
-
const variables = (0, _variables.useAllVariableValues)(dependsOnVariables);
|
|
124
|
-
let waitToLoad = false;
|
|
125
|
-
if (dependsOnVariables) {
|
|
126
|
-
waitToLoad = dependsOnVariables.some((v)=>variables[v]?.loading);
|
|
127
|
-
}
|
|
128
|
-
const variablesValueKey = (0, _utils.getVariableValuesKey)(variables);
|
|
129
|
-
return (0, _reactquery.useQuery)({
|
|
130
|
-
queryKey: [
|
|
131
|
-
'annotation',
|
|
132
|
-
spec,
|
|
133
|
-
timeRange,
|
|
134
|
-
variablesValueKey
|
|
135
|
-
],
|
|
136
|
-
queryFn: async ({ signal })=>{
|
|
137
|
-
const resp = await annotationPlugin?.getAnnotationData(spec.plugin.spec, {
|
|
138
|
-
...variablePluginCtx,
|
|
139
|
-
variableState: variables
|
|
140
|
-
}, signal);
|
|
141
|
-
if (!resp?.length) {
|
|
142
|
-
return [];
|
|
143
|
-
}
|
|
144
|
-
return resp;
|
|
145
|
-
},
|
|
146
|
-
enabled: !!annotationPlugin || waitToLoad
|
|
147
|
-
});
|
|
148
|
-
}
|
|
@@ -1,81 +0,0 @@
|
|
|
1
|
-
// Copyright The Perses Authors
|
|
2
|
-
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
3
|
-
// you may not use this file except in compliance with the License.
|
|
4
|
-
// You may obtain a copy of the License at
|
|
5
|
-
//
|
|
6
|
-
// http://www.apache.org/licenses/LICENSE-2.0
|
|
7
|
-
//
|
|
8
|
-
// Unless required by applicable law or agreed to in writing, software
|
|
9
|
-
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
10
|
-
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
11
|
-
// See the License for the specific language governing permissions and
|
|
12
|
-
// limitations under the License.
|
|
13
|
-
"use strict";
|
|
14
|
-
Object.defineProperty(exports, "__esModule", {
|
|
15
|
-
value: true
|
|
16
|
-
});
|
|
17
|
-
function _export(target, all) {
|
|
18
|
-
for(var name in all)Object.defineProperty(target, name, {
|
|
19
|
-
enumerable: true,
|
|
20
|
-
get: Object.getOwnPropertyDescriptor(all, name).get
|
|
21
|
-
});
|
|
22
|
-
}
|
|
23
|
-
_export(exports, {
|
|
24
|
-
get BuiltinVariableContext () {
|
|
25
|
-
return BuiltinVariableContext;
|
|
26
|
-
},
|
|
27
|
-
get useBuiltinVariableContext () {
|
|
28
|
-
return useBuiltinVariableContext;
|
|
29
|
-
},
|
|
30
|
-
get useBuiltinVariableDefinitions () {
|
|
31
|
-
return useBuiltinVariableDefinitions;
|
|
32
|
-
},
|
|
33
|
-
get useBuiltinVariableValues () {
|
|
34
|
-
return useBuiltinVariableValues;
|
|
35
|
-
}
|
|
36
|
-
});
|
|
37
|
-
const _react = require("react");
|
|
38
|
-
const BuiltinVariableContext = (0, _react.createContext)(undefined);
|
|
39
|
-
function useBuiltinVariableContext() {
|
|
40
|
-
const ctx = (0, _react.useContext)(BuiltinVariableContext);
|
|
41
|
-
if (ctx === undefined) {
|
|
42
|
-
throw new Error('No BuiltinVariableContext found. Did you forget a Provider?');
|
|
43
|
-
}
|
|
44
|
-
return ctx;
|
|
45
|
-
}
|
|
46
|
-
function useBuiltinVariableValues(names) {
|
|
47
|
-
const { variables } = useBuiltinVariableContext();
|
|
48
|
-
const states = (0, _react.useMemo)(()=>{
|
|
49
|
-
const values = {};
|
|
50
|
-
for (const variable of variables){
|
|
51
|
-
values[variable.spec.name] = {
|
|
52
|
-
loading: false,
|
|
53
|
-
value: variable.spec.value()
|
|
54
|
-
};
|
|
55
|
-
}
|
|
56
|
-
return values;
|
|
57
|
-
}, [
|
|
58
|
-
variables
|
|
59
|
-
]);
|
|
60
|
-
const values = (0, _react.useMemo)(()=>{
|
|
61
|
-
const values = {};
|
|
62
|
-
names?.forEach((name)=>{
|
|
63
|
-
const s = states[name];
|
|
64
|
-
if (s) {
|
|
65
|
-
values[name] = s;
|
|
66
|
-
}
|
|
67
|
-
});
|
|
68
|
-
return values;
|
|
69
|
-
}, [
|
|
70
|
-
names,
|
|
71
|
-
states
|
|
72
|
-
]);
|
|
73
|
-
if (names === undefined) {
|
|
74
|
-
return states;
|
|
75
|
-
}
|
|
76
|
-
return values;
|
|
77
|
-
}
|
|
78
|
-
function useBuiltinVariableDefinitions() {
|
|
79
|
-
const { variables } = useBuiltinVariableContext();
|
|
80
|
-
return variables;
|
|
81
|
-
}
|
|
@@ -1,80 +0,0 @@
|
|
|
1
|
-
// Copyright The Perses Authors
|
|
2
|
-
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
3
|
-
// you may not use this file except in compliance with the License.
|
|
4
|
-
// You may obtain a copy of the License at
|
|
5
|
-
//
|
|
6
|
-
// http://www.apache.org/licenses/LICENSE-2.0
|
|
7
|
-
//
|
|
8
|
-
// Unless required by applicable law or agreed to in writing, software
|
|
9
|
-
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
10
|
-
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
11
|
-
// See the License for the specific language governing permissions and
|
|
12
|
-
// limitations under the License.
|
|
13
|
-
"use strict";
|
|
14
|
-
Object.defineProperty(exports, "__esModule", {
|
|
15
|
-
value: true
|
|
16
|
-
});
|
|
17
|
-
function _export(target, all) {
|
|
18
|
-
for(var name in all)Object.defineProperty(target, name, {
|
|
19
|
-
enumerable: true,
|
|
20
|
-
get: Object.getOwnPropertyDescriptor(all, name).get
|
|
21
|
-
});
|
|
22
|
-
}
|
|
23
|
-
_export(exports, {
|
|
24
|
-
get DatasourceStoreContext () {
|
|
25
|
-
return DatasourceStoreContext;
|
|
26
|
-
},
|
|
27
|
-
get useDatasource () {
|
|
28
|
-
return useDatasource;
|
|
29
|
-
},
|
|
30
|
-
get useDatasourceClient () {
|
|
31
|
-
return useDatasourceClient;
|
|
32
|
-
},
|
|
33
|
-
get useDatasourceStore () {
|
|
34
|
-
return useDatasourceStore;
|
|
35
|
-
},
|
|
36
|
-
get useListDatasourceSelectItems () {
|
|
37
|
-
return useListDatasourceSelectItems;
|
|
38
|
-
}
|
|
39
|
-
});
|
|
40
|
-
const _reactquery = require("@tanstack/react-query");
|
|
41
|
-
const _react = require("react");
|
|
42
|
-
const DatasourceStoreContext = (0, _react.createContext)(undefined);
|
|
43
|
-
function useDatasourceStore() {
|
|
44
|
-
const ctx = (0, _react.useContext)(DatasourceStoreContext);
|
|
45
|
-
if (ctx === undefined) {
|
|
46
|
-
throw new Error('No DatasourceStoreContext found. Did you forget a Provider?');
|
|
47
|
-
}
|
|
48
|
-
return ctx;
|
|
49
|
-
}
|
|
50
|
-
function useListDatasourceSelectItems(datasourcePluginName, project) {
|
|
51
|
-
const { listDatasourceSelectItems } = useDatasourceStore();
|
|
52
|
-
return (0, _reactquery.useQuery)({
|
|
53
|
-
queryKey: [
|
|
54
|
-
'listDatasourceSelectItems',
|
|
55
|
-
datasourcePluginName,
|
|
56
|
-
project
|
|
57
|
-
],
|
|
58
|
-
queryFn: ()=>listDatasourceSelectItems(datasourcePluginName)
|
|
59
|
-
});
|
|
60
|
-
}
|
|
61
|
-
function useDatasourceClient(selector) {
|
|
62
|
-
const store = useDatasourceStore();
|
|
63
|
-
return (0, _reactquery.useQuery)({
|
|
64
|
-
queryKey: [
|
|
65
|
-
'getDatasourceClient',
|
|
66
|
-
selector
|
|
67
|
-
],
|
|
68
|
-
queryFn: ()=>store.getDatasourceClient(selector)
|
|
69
|
-
});
|
|
70
|
-
}
|
|
71
|
-
function useDatasource(selector) {
|
|
72
|
-
const store = useDatasourceStore();
|
|
73
|
-
return (0, _reactquery.useQuery)({
|
|
74
|
-
queryKey: [
|
|
75
|
-
'getDatasource',
|
|
76
|
-
selector
|
|
77
|
-
],
|
|
78
|
-
queryFn: ()=>store.getDatasource(selector)
|
|
79
|
-
});
|
|
80
|
-
}
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
// Copyright The Perses Authors
|
|
2
|
-
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
3
|
-
// you may not use this file except in compliance with the License.
|
|
4
|
-
// You may obtain a copy of the License at
|
|
5
|
-
//
|
|
6
|
-
// http://www.apache.org/licenses/LICENSE-2.0
|
|
7
|
-
//
|
|
8
|
-
// Unless required by applicable law or agreed to in writing, software
|
|
9
|
-
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
10
|
-
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
11
|
-
// See the License for the specific language governing permissions and
|
|
12
|
-
// limitations under the License.
|
|
13
|
-
"use strict";
|
|
14
|
-
Object.defineProperty(exports, "__esModule", {
|
|
15
|
-
value: true
|
|
16
|
-
});
|
|
17
|
-
_export_star(require("./annotations"), exports);
|
|
18
|
-
_export_star(require("./builtin-variables"), exports);
|
|
19
|
-
_export_star(require("./datasources"), exports);
|
|
20
|
-
_export_star(require("./plugin-registry"), exports);
|
|
21
|
-
_export_star(require("./variables"), exports);
|
|
22
|
-
_export_star(require("./TimeRangeProvider"), exports);
|
|
23
|
-
_export_star(require("./time-series-queries"), exports);
|
|
24
|
-
_export_star(require("./trace-queries"), exports);
|
|
25
|
-
_export_star(require("./profile-queries"), exports);
|
|
26
|
-
_export_star(require("./alerts-queries"), exports);
|
|
27
|
-
_export_star(require("./silences-queries"), exports);
|
|
28
|
-
_export_star(require("./item-actions"), exports);
|
|
29
|
-
_export_star(require("./DataQueriesProvider"), exports);
|
|
30
|
-
_export_star(require("./RouterProvider"), exports);
|
|
31
|
-
_export_star(require("./UsageMetricsProvider"), exports);
|
|
32
|
-
function _export_star(from, to) {
|
|
33
|
-
Object.keys(from).forEach(function(k) {
|
|
34
|
-
if (k !== "default" && !Object.prototype.hasOwnProperty.call(to, k)) {
|
|
35
|
-
Object.defineProperty(to, k, {
|
|
36
|
-
enumerable: true,
|
|
37
|
-
get: function() {
|
|
38
|
-
return from[k];
|
|
39
|
-
}
|
|
40
|
-
});
|
|
41
|
-
}
|
|
42
|
-
});
|
|
43
|
-
return from;
|
|
44
|
-
}
|
|
@@ -1,302 +0,0 @@
|
|
|
1
|
-
// Copyright The Perses Authors
|
|
2
|
-
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
3
|
-
// you may not use this file except in compliance with the License.
|
|
4
|
-
// You may obtain a copy of the License at
|
|
5
|
-
//
|
|
6
|
-
// http://www.apache.org/licenses/LICENSE-2.0
|
|
7
|
-
//
|
|
8
|
-
// Unless required by applicable law or agreed to in writing, software
|
|
9
|
-
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
10
|
-
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
11
|
-
// See the License for the specific language governing permissions and
|
|
12
|
-
// limitations under the License.
|
|
13
|
-
"use strict";
|
|
14
|
-
Object.defineProperty(exports, "__esModule", {
|
|
15
|
-
value: true
|
|
16
|
-
});
|
|
17
|
-
Object.defineProperty(exports, "executeAction", {
|
|
18
|
-
enumerable: true,
|
|
19
|
-
get: function() {
|
|
20
|
-
return executeAction;
|
|
21
|
-
}
|
|
22
|
-
});
|
|
23
|
-
const _components = require("@perses-dev/components");
|
|
24
|
-
const BODY_METHODS = new Set([
|
|
25
|
-
'POST',
|
|
26
|
-
'PUT',
|
|
27
|
-
'PATCH'
|
|
28
|
-
]);
|
|
29
|
-
function buildWebhookHeaders(action) {
|
|
30
|
-
const headers = {
|
|
31
|
-
...action.headers ?? {}
|
|
32
|
-
};
|
|
33
|
-
const contentType = action.contentType ?? 'none';
|
|
34
|
-
const supportsBody = BODY_METHODS.has(action.method);
|
|
35
|
-
if (supportsBody && contentType === 'json') {
|
|
36
|
-
headers['Content-Type'] = 'application/json';
|
|
37
|
-
} else if (supportsBody && contentType === 'text') {
|
|
38
|
-
headers['Content-Type'] = 'text/plain; charset=utf-8';
|
|
39
|
-
}
|
|
40
|
-
return headers;
|
|
41
|
-
}
|
|
42
|
-
/**
|
|
43
|
-
* Execute an event action by dispatching a single CustomEvent with batch data
|
|
44
|
-
*/ function executeEventBatch(action, selectionMap, variableState, setActionStatus) {
|
|
45
|
-
try {
|
|
46
|
-
setActionStatus(action.name, {
|
|
47
|
-
loading: true
|
|
48
|
-
});
|
|
49
|
-
const items = Array.from(selectionMap.values());
|
|
50
|
-
// Interpolate body template if provided
|
|
51
|
-
let body;
|
|
52
|
-
if (action.bodyTemplate) {
|
|
53
|
-
const bodyResult = (0, _components.interpolateSelectionBatch)(action.bodyTemplate, items, variableState);
|
|
54
|
-
body = bodyResult.text;
|
|
55
|
-
} else {
|
|
56
|
-
body = JSON.stringify({
|
|
57
|
-
items
|
|
58
|
-
});
|
|
59
|
-
}
|
|
60
|
-
const event = new CustomEvent(action.eventName, {
|
|
61
|
-
detail: body,
|
|
62
|
-
bubbles: true,
|
|
63
|
-
cancelable: true
|
|
64
|
-
});
|
|
65
|
-
window.dispatchEvent(event);
|
|
66
|
-
setActionStatus(action.name, {
|
|
67
|
-
loading: false,
|
|
68
|
-
success: true
|
|
69
|
-
});
|
|
70
|
-
return {
|
|
71
|
-
success: true
|
|
72
|
-
};
|
|
73
|
-
} catch (error) {
|
|
74
|
-
const err = error instanceof Error ? error : new Error(String(error));
|
|
75
|
-
setActionStatus(action.name, {
|
|
76
|
-
loading: false,
|
|
77
|
-
error: err
|
|
78
|
-
});
|
|
79
|
-
return {
|
|
80
|
-
success: false,
|
|
81
|
-
error: err
|
|
82
|
-
};
|
|
83
|
-
}
|
|
84
|
-
}
|
|
85
|
-
/**
|
|
86
|
-
* Execute events actions by dispatching one CustomEvent per selection
|
|
87
|
-
*/ function executeEventIndividual(action, selectionMap, variableState, setActionStatus) {
|
|
88
|
-
const entries = Array.from(selectionMap.entries());
|
|
89
|
-
const count = entries.length;
|
|
90
|
-
const itemResults = new Map();
|
|
91
|
-
// Initialize all items as loading
|
|
92
|
-
setActionStatus(action.name, {
|
|
93
|
-
loading: true,
|
|
94
|
-
itemStatuses: new Map()
|
|
95
|
-
});
|
|
96
|
-
for(let index = 0; index < entries.length; index++){
|
|
97
|
-
const [id, item] = entries[index];
|
|
98
|
-
setActionStatus(action.name, {
|
|
99
|
-
loading: true
|
|
100
|
-
}, id);
|
|
101
|
-
try {
|
|
102
|
-
// Interpolate body template if provided
|
|
103
|
-
let body;
|
|
104
|
-
if (action.bodyTemplate) {
|
|
105
|
-
const bodyResult = (0, _components.interpolateSelectionIndividual)(action.bodyTemplate, item, index, count, variableState);
|
|
106
|
-
body = bodyResult.text;
|
|
107
|
-
} else {
|
|
108
|
-
body = JSON.stringify({
|
|
109
|
-
id,
|
|
110
|
-
data: item
|
|
111
|
-
});
|
|
112
|
-
}
|
|
113
|
-
const event = new CustomEvent(action.eventName, {
|
|
114
|
-
detail: body,
|
|
115
|
-
bubbles: true,
|
|
116
|
-
cancelable: true
|
|
117
|
-
});
|
|
118
|
-
window.dispatchEvent(event);
|
|
119
|
-
itemResults.set(id, {
|
|
120
|
-
success: true
|
|
121
|
-
});
|
|
122
|
-
setActionStatus(action.name, {
|
|
123
|
-
loading: false,
|
|
124
|
-
success: true
|
|
125
|
-
}, id);
|
|
126
|
-
} catch (error) {
|
|
127
|
-
const err = error instanceof Error ? error : new Error(String(error));
|
|
128
|
-
setActionStatus(action.name, {
|
|
129
|
-
loading: false,
|
|
130
|
-
error: err
|
|
131
|
-
}, id);
|
|
132
|
-
itemResults.set(id, {
|
|
133
|
-
success: false,
|
|
134
|
-
error: err
|
|
135
|
-
});
|
|
136
|
-
}
|
|
137
|
-
}
|
|
138
|
-
setActionStatus(action.name, {
|
|
139
|
-
loading: false,
|
|
140
|
-
success: true
|
|
141
|
-
});
|
|
142
|
-
return {
|
|
143
|
-
success: true,
|
|
144
|
-
itemResults
|
|
145
|
-
};
|
|
146
|
-
}
|
|
147
|
-
/**
|
|
148
|
-
* Execute a webhook action in individual mode (one request per selection)
|
|
149
|
-
*/ async function executeWebhookIndividual(action, selectionMap, variableState, setActionStatus, fetchFn) {
|
|
150
|
-
const entries = Array.from(selectionMap.entries());
|
|
151
|
-
const count = entries.length;
|
|
152
|
-
const itemResults = new Map();
|
|
153
|
-
// Initialize all items as loading
|
|
154
|
-
setActionStatus(action.name, {
|
|
155
|
-
loading: true,
|
|
156
|
-
itemStatuses: new Map()
|
|
157
|
-
});
|
|
158
|
-
// Execute requests sequentially to avoid overwhelming the server
|
|
159
|
-
for(let index = 0; index < entries.length; index++){
|
|
160
|
-
const [id, item] = entries[index];
|
|
161
|
-
setActionStatus(action.name, {
|
|
162
|
-
loading: true
|
|
163
|
-
}, id);
|
|
164
|
-
try {
|
|
165
|
-
// Interpolate URL
|
|
166
|
-
const urlResult = (0, _components.interpolateSelectionIndividual)(action.url, item, index, count, variableState);
|
|
167
|
-
// Interpolate body template if provided
|
|
168
|
-
const contentType = action.contentType ?? 'none';
|
|
169
|
-
const supportsBody = BODY_METHODS.has(action.method) && contentType !== 'none';
|
|
170
|
-
let body;
|
|
171
|
-
if (supportsBody && action.bodyTemplate) {
|
|
172
|
-
const bodyResult = (0, _components.interpolateSelectionIndividual)(action.bodyTemplate, item, index, count, variableState);
|
|
173
|
-
body = bodyResult.text;
|
|
174
|
-
}
|
|
175
|
-
// Make the request
|
|
176
|
-
const response = await fetchFn(urlResult.text, {
|
|
177
|
-
method: action.method,
|
|
178
|
-
headers: buildWebhookHeaders(action),
|
|
179
|
-
body: body
|
|
180
|
-
});
|
|
181
|
-
if (!response.ok) {
|
|
182
|
-
throw new Error(`HTTP ${response.status}: ${response.statusText}`);
|
|
183
|
-
}
|
|
184
|
-
setActionStatus(action.name, {
|
|
185
|
-
loading: false,
|
|
186
|
-
success: true
|
|
187
|
-
}, id);
|
|
188
|
-
itemResults.set(id, {
|
|
189
|
-
success: true
|
|
190
|
-
});
|
|
191
|
-
} catch (error) {
|
|
192
|
-
const err = error instanceof Error ? error : new Error(String(error));
|
|
193
|
-
setActionStatus(action.name, {
|
|
194
|
-
loading: false,
|
|
195
|
-
error: err
|
|
196
|
-
}, id);
|
|
197
|
-
itemResults.set(id, {
|
|
198
|
-
success: false,
|
|
199
|
-
error: err
|
|
200
|
-
});
|
|
201
|
-
}
|
|
202
|
-
}
|
|
203
|
-
// Update overall action status
|
|
204
|
-
const allSucceeded = Array.from(itemResults.values()).every((r)=>r.success);
|
|
205
|
-
const anyFailed = Array.from(itemResults.values()).some((r)=>!r.success);
|
|
206
|
-
if (allSucceeded) {
|
|
207
|
-
setActionStatus(action.name, {
|
|
208
|
-
loading: false,
|
|
209
|
-
success: true
|
|
210
|
-
});
|
|
211
|
-
} else if (anyFailed) {
|
|
212
|
-
setActionStatus(action.name, {
|
|
213
|
-
loading: false,
|
|
214
|
-
error: new Error('Some requests failed')
|
|
215
|
-
});
|
|
216
|
-
}
|
|
217
|
-
return {
|
|
218
|
-
success: allSucceeded,
|
|
219
|
-
itemResults
|
|
220
|
-
};
|
|
221
|
-
}
|
|
222
|
-
/**
|
|
223
|
-
* Execute a webhook action in batch mode (single request with all selections)
|
|
224
|
-
*/ async function executeWebhookBatch(action, selectionMap, variableState, setActionStatus, fetchFn) {
|
|
225
|
-
const items = Array.from(selectionMap.values());
|
|
226
|
-
setActionStatus(action.name, {
|
|
227
|
-
loading: true
|
|
228
|
-
});
|
|
229
|
-
try {
|
|
230
|
-
// Interpolate URL
|
|
231
|
-
const urlResult = (0, _components.interpolateSelectionBatch)(action.url, items, variableState);
|
|
232
|
-
// Interpolate body template if provided
|
|
233
|
-
const contentType = action.contentType ?? 'none';
|
|
234
|
-
const supportsBody = BODY_METHODS.has(action.method) && contentType !== 'none';
|
|
235
|
-
let body;
|
|
236
|
-
if (supportsBody && action.bodyTemplate) {
|
|
237
|
-
const bodyResult = (0, _components.interpolateSelectionBatch)(action.bodyTemplate, items, variableState);
|
|
238
|
-
body = bodyResult.text;
|
|
239
|
-
}
|
|
240
|
-
// Make the request
|
|
241
|
-
const response = await fetchFn(urlResult.text, {
|
|
242
|
-
method: action.method,
|
|
243
|
-
headers: buildWebhookHeaders(action),
|
|
244
|
-
body: body
|
|
245
|
-
});
|
|
246
|
-
if (!response.ok) {
|
|
247
|
-
throw new Error(`HTTP ${response.status}: ${response.statusText}`);
|
|
248
|
-
}
|
|
249
|
-
setActionStatus(action.name, {
|
|
250
|
-
loading: false,
|
|
251
|
-
success: true
|
|
252
|
-
});
|
|
253
|
-
return {
|
|
254
|
-
success: true
|
|
255
|
-
};
|
|
256
|
-
} catch (error) {
|
|
257
|
-
const err = error instanceof Error ? error : new Error(String(error));
|
|
258
|
-
setActionStatus(action.name, {
|
|
259
|
-
loading: false,
|
|
260
|
-
error: err
|
|
261
|
-
});
|
|
262
|
-
return {
|
|
263
|
-
success: false,
|
|
264
|
-
error: err
|
|
265
|
-
};
|
|
266
|
-
}
|
|
267
|
-
}
|
|
268
|
-
/**
|
|
269
|
-
* Execute a webhook action
|
|
270
|
-
*/ async function executeWebhookAction(action, selectionMap, variableState, setActionStatus, fetchFn) {
|
|
271
|
-
if (action.batchMode === 'batch') {
|
|
272
|
-
return executeWebhookBatch(action, selectionMap, variableState, setActionStatus, fetchFn);
|
|
273
|
-
} else {
|
|
274
|
-
return executeWebhookIndividual(action, selectionMap, variableState, setActionStatus, fetchFn);
|
|
275
|
-
}
|
|
276
|
-
}
|
|
277
|
-
/**
|
|
278
|
-
* Execute an event action
|
|
279
|
-
*/ async function executeEventAction(action, selectionMap, variableState, setActionStatus) {
|
|
280
|
-
if (action.batchMode === 'batch') {
|
|
281
|
-
return executeEventBatch(action, selectionMap, variableState, setActionStatus);
|
|
282
|
-
} else {
|
|
283
|
-
return executeEventIndividual(action, selectionMap, variableState, setActionStatus);
|
|
284
|
-
}
|
|
285
|
-
}
|
|
286
|
-
async function executeAction(params) {
|
|
287
|
-
const { action, selectionMap, variableState, setActionStatus, fetchFn } = params;
|
|
288
|
-
if (selectionMap.size === 0) {
|
|
289
|
-
return {
|
|
290
|
-
success: true
|
|
291
|
-
};
|
|
292
|
-
}
|
|
293
|
-
if (action.type === 'event') {
|
|
294
|
-
return executeEventAction(action, selectionMap, variableState, setActionStatus);
|
|
295
|
-
} else if (action.type === 'webhook') {
|
|
296
|
-
return executeWebhookAction(action, selectionMap, variableState, setActionStatus, fetchFn);
|
|
297
|
-
}
|
|
298
|
-
return {
|
|
299
|
-
success: false,
|
|
300
|
-
error: new Error(`Unknown action type`)
|
|
301
|
-
};
|
|
302
|
-
}
|