@perses-dev/plugin-system 0.0.0-snapshot-panel-extra-content-3-17f9c42 → 0.0.0-snapshot-scatterplot-fix-imports-95e1b59
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/cjs/components/CalculationSelector/CalculationSelector.js +7 -5
- package/dist/cjs/components/CalculationSelector/index.js +10 -8
- package/dist/cjs/components/DatasourceEditorForm/DatasourceEditorForm.js +350 -0
- package/dist/cjs/components/DatasourceEditorForm/index.js +30 -0
- package/dist/cjs/components/DatasourceSelect.js +137 -25
- package/dist/cjs/components/LegendOptionsEditor/LegendOptionsEditor.js +19 -17
- package/dist/cjs/components/LegendOptionsEditor/index.js +10 -8
- package/dist/cjs/components/OptionsEditorRadios/OptionsEditorRadios.js +25 -30
- package/dist/cjs/components/OptionsEditorRadios/index.js +10 -8
- package/dist/cjs/components/OptionsEditorTabPanel/OptionsEditorTabPanel.js +7 -5
- package/dist/cjs/components/OptionsEditorTabPanel/index.js +10 -8
- package/dist/cjs/components/OptionsEditorTabs/OptionsEditorTabs.js +13 -11
- package/dist/cjs/components/OptionsEditorTabs/index.js +10 -8
- package/dist/cjs/components/PanelSpecEditor/PanelSpecEditor.js +60 -19
- package/dist/cjs/components/PanelSpecEditor/index.js +10 -8
- package/dist/cjs/components/PluginEditor/PluginEditor.js +25 -32
- package/dist/cjs/components/PluginEditor/index.js +11 -9
- package/dist/cjs/components/PluginEditor/plugin-editor-api.js +8 -6
- package/dist/cjs/components/PluginKindSelect/PluginKindSelect.js +25 -14
- package/dist/cjs/components/PluginKindSelect/index.js +10 -8
- package/dist/cjs/components/PluginRegistry/PluginRegistry.js +11 -9
- package/dist/cjs/components/PluginRegistry/index.js +10 -8
- package/dist/cjs/components/PluginRegistry/plugin-indexes.js +7 -3
- package/dist/cjs/components/PluginSpecEditor/PluginSpecEditor.js +9 -7
- package/dist/cjs/components/PluginSpecEditor/index.js +10 -8
- package/dist/cjs/components/ProjectSelect.js +96 -0
- package/dist/cjs/components/TimeRangeControls/TimeRangeControls.js +192 -0
- package/dist/cjs/components/TimeRangeControls/index.js +30 -0
- package/dist/cjs/components/TimeSeriesQueryEditor/TimeSeriesQueryEditor.js +45 -49
- package/dist/cjs/components/TimeSeriesQueryEditor/TimeSeriesQueryInput.js +23 -21
- package/dist/cjs/components/TimeSeriesQueryEditor/index.js +10 -8
- package/dist/cjs/components/TraceQueryEditor/TraceQueryEditor.js +143 -0
- package/dist/cjs/components/TraceQueryEditor/TraceQueryInput.js +96 -0
- package/dist/cjs/components/TraceQueryEditor/index.js +30 -0
- package/dist/cjs/components/Variables/VariableEditorForm/VariableEditorForm.js +445 -230
- package/dist/cjs/components/Variables/VariableEditorForm/VariablePreview.js +38 -32
- package/dist/cjs/components/Variables/VariableEditorForm/index.js +11 -9
- package/dist/cjs/components/Variables/VariableEditorForm/variable-editor-form-model.js +36 -37
- package/dist/cjs/components/Variables/index.js +11 -9
- package/dist/cjs/components/Variables/variable-model.js +24 -17
- package/dist/cjs/components/index.js +24 -19
- package/dist/cjs/constants/index.js +10 -8
- package/dist/cjs/constants/user-interface-text.js +7 -2
- package/dist/cjs/context/ProjectStoreProvider.js +78 -0
- package/dist/cjs/context/index.js +30 -0
- package/dist/cjs/context/query-params.js +49 -0
- package/dist/cjs/index.js +17 -13
- package/dist/cjs/model/index.js +18 -15
- package/dist/cjs/model/legend.js +32 -20
- package/dist/cjs/model/panels.js +2 -2
- package/dist/cjs/model/plugin-base.js +2 -2
- package/dist/cjs/model/plugin-loading.js +3 -1
- package/dist/cjs/model/trace-queries.js +16 -0
- package/dist/cjs/runtime/DataQueriesProvider/DataQueriesProvider.js +67 -35
- package/dist/cjs/runtime/DataQueriesProvider/index.js +11 -9
- package/dist/cjs/runtime/DataQueriesProvider/model.js +81 -0
- package/dist/cjs/runtime/TimeRangeProvider/TimeRangeProvider.js +55 -27
- package/dist/cjs/runtime/TimeRangeProvider/TimeRangeProviderWithQueryParams.js +43 -0
- package/dist/cjs/runtime/TimeRangeProvider/index.js +12 -9
- package/dist/cjs/runtime/TimeRangeProvider/query-params.js +45 -59
- package/dist/cjs/runtime/TimeRangeProvider/refresh-interval.js +30 -0
- package/dist/cjs/runtime/builtin-variables.js +81 -0
- package/dist/cjs/runtime/datasources.js +31 -12
- package/dist/cjs/runtime/index.js +17 -13
- package/dist/cjs/runtime/plugin-registry.js +44 -14
- package/dist/cjs/runtime/template-variables.js +51 -13
- package/dist/cjs/runtime/time-series-queries.js +43 -31
- package/dist/cjs/runtime/trace-queries.js +76 -0
- package/dist/cjs/stories/shared-utils/decorators/WithDataQueries.js +7 -5
- package/dist/cjs/stories/shared-utils/decorators/WithPluginRegistry.js +21 -16
- package/dist/cjs/stories/shared-utils/decorators/WithPluginSystemBuiltinVariables.js +42 -0
- package/dist/cjs/stories/shared-utils/decorators/WithPluginSystemDatasourceStore.js +31 -13
- package/dist/cjs/stories/shared-utils/decorators/WithPluginSystemTemplateVariables.js +6 -4
- package/dist/cjs/stories/shared-utils/decorators/WithTimeRange.js +9 -7
- package/dist/cjs/stories/shared-utils/decorators/index.js +15 -12
- package/dist/cjs/stories/shared-utils/index.js +10 -8
- package/dist/cjs/test/index.js +11 -8
- package/dist/cjs/test/mock-data.js +80 -0
- package/dist/cjs/test/render.js +13 -11
- package/dist/cjs/test/test-plugins/bert/index.js +16 -12
- package/dist/cjs/test/test-plugins/ernie/index.js +15 -11
- package/dist/cjs/test/test-plugins/index.js +14 -10
- package/dist/cjs/test-utils/index.js +10 -8
- package/dist/cjs/test-utils/mock-plugin-registry.js +9 -5
- package/dist/cjs/utils/action.js +43 -0
- package/dist/cjs/utils/index.js +11 -8
- package/dist/cjs/utils/variables.js +26 -8
- package/dist/cjs/validation/datasource.js +30 -0
- package/dist/cjs/validation/duration.js +25 -0
- package/dist/cjs/validation/index.js +34 -0
- package/dist/cjs/validation/resource.js +24 -0
- package/dist/cjs/validation/role.js +86 -0
- package/dist/cjs/validation/rolebinding.js +55 -0
- package/dist/cjs/validation/secret.js +176 -0
- package/dist/cjs/validation/user.js +46 -0
- package/dist/cjs/validation/variable.js +48 -0
- package/dist/components/CalculationSelector/CalculationSelector.d.ts +1 -2
- package/dist/components/CalculationSelector/CalculationSelector.d.ts.map +1 -1
- package/dist/components/CalculationSelector/CalculationSelector.js +1 -1
- package/dist/components/CalculationSelector/CalculationSelector.js.map +1 -1
- package/dist/components/CalculationSelector/index.js.map +1 -1
- package/dist/components/DatasourceEditorForm/DatasourceEditorForm.d.ts +14 -0
- package/dist/components/DatasourceEditorForm/DatasourceEditorForm.d.ts.map +1 -0
- package/dist/components/DatasourceEditorForm/DatasourceEditorForm.js +342 -0
- package/dist/components/DatasourceEditorForm/DatasourceEditorForm.js.map +1 -0
- package/dist/components/DatasourceEditorForm/index.d.ts +2 -0
- package/dist/components/DatasourceEditorForm/index.d.ts.map +1 -0
- package/dist/components/DatasourceEditorForm/index.js +15 -0
- package/dist/components/DatasourceEditorForm/index.js.map +1 -0
- package/dist/components/DatasourceSelect.d.ts +8 -3
- package/dist/components/DatasourceSelect.d.ts.map +1 -1
- package/dist/components/DatasourceSelect.js +120 -23
- package/dist/components/DatasourceSelect.js.map +1 -1
- package/dist/components/LegendOptionsEditor/LegendOptionsEditor.d.ts +1 -2
- package/dist/components/LegendOptionsEditor/LegendOptionsEditor.d.ts.map +1 -1
- package/dist/components/LegendOptionsEditor/LegendOptionsEditor.js +3 -3
- package/dist/components/LegendOptionsEditor/LegendOptionsEditor.js.map +1 -1
- package/dist/components/LegendOptionsEditor/index.js.map +1 -1
- package/dist/components/OptionsEditorRadios/OptionsEditorRadios.d.ts +5 -5
- package/dist/components/OptionsEditorRadios/OptionsEditorRadios.d.ts.map +1 -1
- package/dist/components/OptionsEditorRadios/OptionsEditorRadios.js +18 -25
- package/dist/components/OptionsEditorRadios/OptionsEditorRadios.js.map +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.map +1 -1
- package/dist/components/OptionsEditorTabs/OptionsEditorTabs.d.ts +3 -3
- package/dist/components/OptionsEditorTabs/OptionsEditorTabs.d.ts.map +1 -1
- package/dist/components/OptionsEditorTabs/OptionsEditorTabs.js +3 -3
- package/dist/components/OptionsEditorTabs/OptionsEditorTabs.js.map +1 -1
- package/dist/components/OptionsEditorTabs/index.js.map +1 -1
- package/dist/components/PanelSpecEditor/PanelSpecEditor.d.ts +2 -3
- package/dist/components/PanelSpecEditor/PanelSpecEditor.d.ts.map +1 -1
- package/dist/components/PanelSpecEditor/PanelSpecEditor.js +50 -11
- package/dist/components/PanelSpecEditor/PanelSpecEditor.js.map +1 -1
- package/dist/components/PanelSpecEditor/index.js.map +1 -1
- package/dist/components/PluginEditor/PluginEditor.d.ts +1 -2
- package/dist/components/PluginEditor/PluginEditor.d.ts.map +1 -1
- package/dist/components/PluginEditor/PluginEditor.js +17 -26
- package/dist/components/PluginEditor/PluginEditor.js.map +1 -1
- 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 +5 -5
- 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 +23 -14
- package/dist/components/PluginKindSelect/PluginKindSelect.js.map +1 -1
- package/dist/components/PluginKindSelect/index.js.map +1 -1
- package/dist/components/PluginRegistry/PluginRegistry.d.ts +4 -4
- package/dist/components/PluginRegistry/PluginRegistry.d.ts.map +1 -1
- package/dist/components/PluginRegistry/PluginRegistry.js +3 -3
- package/dist/components/PluginRegistry/PluginRegistry.js.map +1 -1
- package/dist/components/PluginRegistry/index.js.map +1 -1
- package/dist/components/PluginRegistry/plugin-indexes.js +1 -1
- package/dist/components/PluginRegistry/plugin-indexes.js.map +1 -1
- package/dist/components/PluginSpecEditor/PluginSpecEditor.d.ts +2 -2
- package/dist/components/PluginSpecEditor/PluginSpecEditor.d.ts.map +1 -1
- package/dist/components/PluginSpecEditor/PluginSpecEditor.js +3 -3
- package/dist/components/PluginSpecEditor/PluginSpecEditor.js.map +1 -1
- package/dist/components/PluginSpecEditor/index.js.map +1 -1
- package/dist/components/ProjectSelect.d.ts +14 -0
- package/dist/components/ProjectSelect.d.ts.map +1 -0
- package/dist/components/ProjectSelect.js +91 -0
- package/dist/components/ProjectSelect.js.map +1 -0
- package/dist/components/TimeRangeControls/TimeRangeControls.d.ts +13 -0
- package/dist/components/TimeRangeControls/TimeRangeControls.d.ts.map +1 -0
- package/dist/components/TimeRangeControls/TimeRangeControls.js +168 -0
- package/dist/components/TimeRangeControls/TimeRangeControls.js.map +1 -0
- package/dist/components/TimeRangeControls/index.d.ts +2 -0
- package/dist/components/TimeRangeControls/index.d.ts.map +1 -0
- package/dist/components/TimeRangeControls/index.js +15 -0
- package/dist/components/TimeRangeControls/index.js.map +1 -0
- package/dist/components/TimeSeriesQueryEditor/TimeSeriesQueryEditor.d.ts +1 -2
- package/dist/components/TimeSeriesQueryEditor/TimeSeriesQueryEditor.d.ts.map +1 -1
- package/dist/components/TimeSeriesQueryEditor/TimeSeriesQueryEditor.js +38 -44
- package/dist/components/TimeSeriesQueryEditor/TimeSeriesQueryEditor.js.map +1 -1
- package/dist/components/TimeSeriesQueryEditor/TimeSeriesQueryInput.d.ts +1 -2
- package/dist/components/TimeSeriesQueryEditor/TimeSeriesQueryInput.d.ts.map +1 -1
- package/dist/components/TimeSeriesQueryEditor/TimeSeriesQueryInput.js +3 -3
- package/dist/components/TimeSeriesQueryEditor/TimeSeriesQueryInput.js.map +1 -1
- package/dist/components/TimeSeriesQueryEditor/index.js.map +1 -1
- package/dist/components/TraceQueryEditor/TraceQueryEditor.d.ts +8 -0
- package/dist/components/TraceQueryEditor/TraceQueryEditor.d.ts.map +1 -0
- package/dist/components/TraceQueryEditor/TraceQueryEditor.js +130 -0
- package/dist/components/TraceQueryEditor/TraceQueryEditor.js.map +1 -0
- package/dist/components/TraceQueryEditor/TraceQueryInput.d.ts +12 -0
- package/dist/components/TraceQueryEditor/TraceQueryInput.d.ts.map +1 -0
- package/dist/components/TraceQueryEditor/TraceQueryInput.js +83 -0
- package/dist/components/TraceQueryEditor/TraceQueryInput.js.map +1 -0
- package/dist/components/TraceQueryEditor/index.d.ts +2 -0
- package/dist/components/TraceQueryEditor/index.d.ts.map +1 -0
- package/dist/components/TraceQueryEditor/index.js +15 -0
- package/dist/components/TraceQueryEditor/index.js.map +1 -0
- package/dist/components/Variables/VariableEditorForm/VariableEditorForm.d.ts +10 -8
- package/dist/components/Variables/VariableEditorForm/VariableEditorForm.d.ts.map +1 -1
- package/dist/components/Variables/VariableEditorForm/VariableEditorForm.js +395 -184
- package/dist/components/Variables/VariableEditorForm/VariableEditorForm.js.map +1 -1
- package/dist/components/Variables/VariableEditorForm/VariablePreview.d.ts +2 -3
- package/dist/components/Variables/VariableEditorForm/VariablePreview.d.ts.map +1 -1
- package/dist/components/Variables/VariableEditorForm/VariablePreview.js +4 -4
- package/dist/components/Variables/VariableEditorForm/VariablePreview.js.map +1 -1
- package/dist/components/Variables/VariableEditorForm/index.js.map +1 -1
- package/dist/components/Variables/VariableEditorForm/variable-editor-form-model.d.ts +8 -19
- package/dist/components/Variables/VariableEditorForm/variable-editor-form-model.d.ts.map +1 -1
- package/dist/components/Variables/VariableEditorForm/variable-editor-form-model.js +30 -35
- package/dist/components/Variables/VariableEditorForm/variable-editor-form-model.js.map +1 -1
- package/dist/components/Variables/index.js.map +1 -1
- package/dist/components/Variables/variable-model.d.ts.map +1 -1
- package/dist/components/Variables/variable-model.js +9 -10
- package/dist/components/Variables/variable-model.js.map +1 -1
- package/dist/components/index.d.ts +3 -0
- package/dist/components/index.d.ts.map +1 -1
- package/dist/components/index.js +3 -0
- package/dist/components/index.js.map +1 -1
- package/dist/constants/index.js.map +1 -1
- package/dist/constants/user-interface-text.d.ts +2 -0
- package/dist/constants/user-interface-text.d.ts.map +1 -1
- package/dist/constants/user-interface-text.js +4 -1
- package/dist/constants/user-interface-text.js.map +1 -1
- package/dist/context/ProjectStoreProvider.d.ts +16 -0
- package/dist/context/ProjectStoreProvider.d.ts.map +1 -0
- package/dist/context/ProjectStoreProvider.js +56 -0
- package/dist/context/ProjectStoreProvider.js.map +1 -0
- package/dist/context/index.d.ts +2 -0
- package/dist/context/index.d.ts.map +1 -0
- package/dist/context/index.js +15 -0
- package/dist/context/index.js.map +1 -0
- package/dist/context/query-params.d.ts +5 -0
- package/dist/context/query-params.d.ts.map +1 -0
- package/dist/context/query-params.js +41 -0
- package/dist/context/query-params.js.map +1 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -1
- package/dist/model/datasource.d.ts +2 -1
- package/dist/model/datasource.d.ts.map +1 -1
- package/dist/model/datasource.js +3 -1
- package/dist/model/datasource.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 +1 -0
- package/dist/model/index.js.map +1 -1
- package/dist/model/legend.d.ts +3 -3
- package/dist/model/legend.d.ts.map +1 -1
- package/dist/model/legend.js +14 -14
- package/dist/model/legend.js.map +1 -1
- package/dist/model/panels.d.ts +3 -2
- package/dist/model/panels.d.ts.map +1 -1
- package/dist/model/panels.js.map +1 -1
- package/dist/model/plugin-base.js.map +1 -1
- package/dist/model/plugin-loading.js.map +1 -1
- package/dist/model/plugins.d.ts +6 -4
- package/dist/model/plugins.d.ts.map +1 -1
- package/dist/model/plugins.js.map +1 -1
- package/dist/model/time-series-queries.d.ts +2 -2
- 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 +19 -0
- package/dist/model/trace-queries.d.ts.map +1 -0
- package/dist/model/trace-queries.js +15 -0
- package/dist/model/trace-queries.js.map +1 -0
- package/dist/model/variables.d.ts +2 -2
- package/dist/model/variables.d.ts.map +1 -1
- package/dist/model/variables.js +3 -1
- package/dist/model/variables.js.map +1 -1
- package/dist/runtime/DataQueriesProvider/DataQueriesProvider.d.ts +6 -6
- package/dist/runtime/DataQueriesProvider/DataQueriesProvider.d.ts.map +1 -1
- package/dist/runtime/DataQueriesProvider/DataQueriesProvider.js +52 -28
- package/dist/runtime/DataQueriesProvider/DataQueriesProvider.js.map +1 -1
- package/dist/runtime/DataQueriesProvider/index.js.map +1 -1
- package/dist/runtime/DataQueriesProvider/model.d.ts +18 -13
- package/dist/runtime/DataQueriesProvider/model.d.ts.map +1 -1
- package/dist/runtime/DataQueriesProvider/model.js +67 -1
- package/dist/runtime/DataQueriesProvider/model.js.map +1 -1
- package/dist/runtime/TimeRangeProvider/TimeRangeProvider.d.ts +9 -4
- package/dist/runtime/TimeRangeProvider/TimeRangeProvider.d.ts.map +1 -1
- package/dist/runtime/TimeRangeProvider/TimeRangeProvider.js +37 -20
- package/dist/runtime/TimeRangeProvider/TimeRangeProvider.js.map +1 -1
- package/dist/runtime/TimeRangeProvider/TimeRangeProviderWithQueryParams.d.ts +9 -0
- package/dist/runtime/TimeRangeProvider/TimeRangeProviderWithQueryParams.d.ts.map +1 -0
- package/dist/runtime/TimeRangeProvider/TimeRangeProviderWithQueryParams.js +30 -0
- package/dist/runtime/TimeRangeProvider/TimeRangeProviderWithQueryParams.js.map +1 -0
- package/dist/runtime/TimeRangeProvider/index.d.ts +1 -0
- package/dist/runtime/TimeRangeProvider/index.d.ts.map +1 -1
- package/dist/runtime/TimeRangeProvider/index.js +1 -0
- package/dist/runtime/TimeRangeProvider/index.js.map +1 -1
- package/dist/runtime/TimeRangeProvider/query-params.d.ts +5 -5
- package/dist/runtime/TimeRangeProvider/query-params.d.ts.map +1 -1
- package/dist/runtime/TimeRangeProvider/query-params.js +13 -45
- package/dist/runtime/TimeRangeProvider/query-params.js.map +1 -1
- package/dist/runtime/TimeRangeProvider/refresh-interval.d.ts +7 -0
- package/dist/runtime/TimeRangeProvider/refresh-interval.d.ts.map +1 -0
- package/dist/runtime/TimeRangeProvider/refresh-interval.js +25 -0
- package/dist/runtime/TimeRangeProvider/refresh-interval.js.map +1 -0
- package/dist/runtime/builtin-variables.d.ts +11 -0
- package/dist/runtime/builtin-variables.d.ts.map +1 -0
- package/dist/runtime/builtin-variables.js +59 -0
- package/dist/runtime/builtin-variables.js.map +1 -0
- package/dist/runtime/datasources.d.ts +42 -7
- package/dist/runtime/datasources.d.ts.map +1 -1
- package/dist/runtime/datasources.js +15 -7
- package/dist/runtime/datasources.js.map +1 -1
- package/dist/runtime/index.d.ts +2 -0
- package/dist/runtime/index.d.ts.map +1 -1
- package/dist/runtime/index.js +2 -0
- package/dist/runtime/index.js.map +1 -1
- package/dist/runtime/plugin-registry.d.ts +5 -3
- package/dist/runtime/plugin-registry.d.ts.map +1 -1
- package/dist/runtime/plugin-registry.js +22 -5
- package/dist/runtime/plugin-registry.js.map +1 -1
- package/dist/runtime/template-variables.d.ts +6 -5
- package/dist/runtime/template-variables.d.ts.map +1 -1
- package/dist/runtime/template-variables.js +36 -9
- package/dist/runtime/template-variables.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 +21 -19
- package/dist/runtime/time-series-queries.js.map +1 -1
- package/dist/runtime/trace-queries.d.ts +14 -0
- package/dist/runtime/trace-queries.d.ts.map +1 -0
- package/dist/runtime/trace-queries.js +61 -0
- package/dist/runtime/trace-queries.js.map +1 -0
- package/dist/stories/shared-utils/decorators/WithDataQueries.d.ts +2 -3
- package/dist/stories/shared-utils/decorators/WithDataQueries.d.ts.map +1 -1
- package/dist/stories/shared-utils/decorators/WithDataQueries.js.map +1 -1
- package/dist/stories/shared-utils/decorators/WithPluginRegistry.d.ts +1 -2
- package/dist/stories/shared-utils/decorators/WithPluginRegistry.d.ts.map +1 -1
- package/dist/stories/shared-utils/decorators/WithPluginRegistry.js +2 -1
- package/dist/stories/shared-utils/decorators/WithPluginRegistry.js.map +1 -1
- package/dist/stories/shared-utils/decorators/WithPluginSystemBuiltinVariables.d.ts +12 -0
- package/dist/stories/shared-utils/decorators/WithPluginSystemBuiltinVariables.d.ts.map +1 -0
- package/dist/stories/shared-utils/decorators/WithPluginSystemBuiltinVariables.js +39 -0
- package/dist/stories/shared-utils/decorators/WithPluginSystemBuiltinVariables.js.map +1 -0
- package/dist/stories/shared-utils/decorators/WithPluginSystemDatasourceStore.d.ts +2 -3
- package/dist/stories/shared-utils/decorators/WithPluginSystemDatasourceStore.d.ts.map +1 -1
- package/dist/stories/shared-utils/decorators/WithPluginSystemDatasourceStore.js +24 -8
- package/dist/stories/shared-utils/decorators/WithPluginSystemDatasourceStore.js.map +1 -1
- package/dist/stories/shared-utils/decorators/WithPluginSystemTemplateVariables.d.ts +2 -3
- package/dist/stories/shared-utils/decorators/WithPluginSystemTemplateVariables.d.ts.map +1 -1
- package/dist/stories/shared-utils/decorators/WithPluginSystemTemplateVariables.js.map +1 -1
- package/dist/stories/shared-utils/decorators/WithTimeRange.d.ts +4 -5
- package/dist/stories/shared-utils/decorators/WithTimeRange.d.ts.map +1 -1
- package/dist/stories/shared-utils/decorators/WithTimeRange.js +2 -2
- package/dist/stories/shared-utils/decorators/WithTimeRange.js.map +1 -1
- package/dist/stories/shared-utils/decorators/index.d.ts +1 -0
- package/dist/stories/shared-utils/decorators/index.d.ts.map +1 -1
- package/dist/stories/shared-utils/decorators/index.js +1 -0
- package/dist/stories/shared-utils/decorators/index.js.map +1 -1
- package/dist/stories/shared-utils/index.js.map +1 -1
- package/dist/test/index.d.ts +1 -0
- package/dist/test/index.d.ts.map +1 -1
- package/dist/test/index.js +1 -0
- package/dist/test/index.js.map +1 -1
- package/dist/test/mock-data.d.ts +4 -0
- package/dist/test/mock-data.d.ts.map +1 -0
- package/dist/test/mock-data.js +64 -0
- package/dist/test/mock-data.js.map +1 -0
- package/dist/test/render.d.ts +1 -1
- package/dist/test/render.d.ts.map +1 -1
- package/dist/test/render.js +2 -2
- package/dist/test/render.js.map +1 -1
- package/dist/test/setup-tests.js.map +1 -1
- package/dist/test/test-plugins/bert/index.js +2 -2
- package/dist/test/test-plugins/bert/index.js.map +1 -1
- package/dist/test/test-plugins/ernie/index.js +2 -2
- package/dist/test/test-plugins/ernie/index.js.map +1 -1
- package/dist/test/test-plugins/index.js.map +1 -1
- package/dist/test-utils/index.js.map +1 -1
- package/dist/test-utils/mock-plugin-registry.d.ts +1 -1
- package/dist/test-utils/mock-plugin-registry.d.ts.map +1 -1
- package/dist/test-utils/mock-plugin-registry.js +3 -3
- package/dist/test-utils/mock-plugin-registry.js.map +1 -1
- package/dist/utils/action.d.ts +4 -0
- package/dist/utils/action.d.ts.map +1 -0
- package/dist/utils/action.js +27 -0
- package/dist/utils/action.js.map +1 -0
- package/dist/utils/index.d.ts +1 -0
- package/dist/utils/index.d.ts.map +1 -1
- package/dist/utils/index.js +1 -0
- package/dist/utils/index.js.map +1 -1
- package/dist/utils/variables.d.ts.map +1 -1
- package/dist/utils/variables.js +17 -5
- package/dist/utils/variables.js.map +1 -1
- package/dist/validation/datasource.d.ts +19 -0
- package/dist/validation/datasource.d.ts.map +1 -0
- package/dist/validation/datasource.js +22 -0
- package/dist/validation/datasource.js.map +1 -0
- package/dist/validation/duration.d.ts +3 -0
- package/dist/validation/duration.d.ts.map +1 -0
- package/dist/validation/duration.js +17 -0
- package/dist/validation/duration.js.map +1 -0
- package/dist/validation/index.d.ts +6 -0
- package/dist/validation/index.d.ts.map +1 -0
- package/dist/validation/index.js +19 -0
- package/dist/validation/index.js.map +1 -0
- package/dist/validation/resource.d.ts +3 -0
- package/dist/validation/resource.d.ts.map +1 -0
- package/dist/validation/resource.js +16 -0
- package/dist/validation/resource.js.map +1 -0
- package/dist/validation/role.d.ts +228 -0
- package/dist/validation/role.d.ts.map +1 -0
- package/dist/validation/role.js +67 -0
- package/dist/validation/role.js.map +1 -0
- package/dist/validation/rolebinding.d.ts +137 -0
- package/dist/validation/rolebinding.d.ts.map +1 -0
- package/dist/validation/rolebinding.js +47 -0
- package/dist/validation/rolebinding.js.map +1 -0
- package/dist/validation/secret.d.ts +964 -0
- package/dist/validation/secret.d.ts.map +1 -0
- package/dist/validation/secret.js +157 -0
- package/dist/validation/secret.js.map +1 -0
- package/dist/validation/user.d.ts +93 -0
- package/dist/validation/user.d.ts.map +1 -0
- package/dist/validation/user.js +38 -0
- package/dist/validation/user.js.map +1 -0
- package/dist/validation/variable.d.ts +96 -0
- package/dist/validation/variable.d.ts.map +1 -0
- package/dist/validation/variable.js +40 -0
- package/dist/validation/variable.js.map +1 -0
- package/package.json +9 -6
|
@@ -14,19 +14,22 @@
|
|
|
14
14
|
Object.defineProperty(exports, "__esModule", {
|
|
15
15
|
value: true
|
|
16
16
|
});
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
17
|
+
_export_star(require("./WithDataQueries"), exports);
|
|
18
|
+
_export_star(require("./WithPluginRegistry"), exports);
|
|
19
|
+
_export_star(require("./WithPluginSystemBuiltinVariables"), exports);
|
|
20
|
+
_export_star(require("./WithPluginSystemDatasourceStore"), exports);
|
|
21
|
+
_export_star(require("./WithPluginSystemTemplateVariables"), exports);
|
|
22
|
+
_export_star(require("./WithTimeRange"), exports);
|
|
23
|
+
function _export_star(from, to) {
|
|
23
24
|
Object.keys(from).forEach(function(k) {
|
|
24
|
-
if (k !== "default" && !Object.prototype.hasOwnProperty.call(to, k))
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
25
|
+
if (k !== "default" && !Object.prototype.hasOwnProperty.call(to, k)) {
|
|
26
|
+
Object.defineProperty(to, k, {
|
|
27
|
+
enumerable: true,
|
|
28
|
+
get: function() {
|
|
29
|
+
return from[k];
|
|
30
|
+
}
|
|
31
|
+
});
|
|
32
|
+
}
|
|
30
33
|
});
|
|
31
34
|
return from;
|
|
32
35
|
}
|
|
@@ -14,15 +14,17 @@
|
|
|
14
14
|
Object.defineProperty(exports, "__esModule", {
|
|
15
15
|
value: true
|
|
16
16
|
});
|
|
17
|
-
|
|
18
|
-
function
|
|
17
|
+
_export_star(require("./decorators"), exports);
|
|
18
|
+
function _export_star(from, to) {
|
|
19
19
|
Object.keys(from).forEach(function(k) {
|
|
20
|
-
if (k !== "default" && !Object.prototype.hasOwnProperty.call(to, k))
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
20
|
+
if (k !== "default" && !Object.prototype.hasOwnProperty.call(to, k)) {
|
|
21
|
+
Object.defineProperty(to, k, {
|
|
22
|
+
enumerable: true,
|
|
23
|
+
get: function() {
|
|
24
|
+
return from[k];
|
|
25
|
+
}
|
|
26
|
+
});
|
|
27
|
+
}
|
|
26
28
|
});
|
|
27
29
|
return from;
|
|
28
30
|
}
|
package/dist/cjs/test/index.js
CHANGED
|
@@ -14,15 +14,18 @@
|
|
|
14
14
|
Object.defineProperty(exports, "__esModule", {
|
|
15
15
|
value: true
|
|
16
16
|
});
|
|
17
|
-
|
|
18
|
-
|
|
17
|
+
_export_star(require("./render"), exports);
|
|
18
|
+
_export_star(require("./mock-data"), exports);
|
|
19
|
+
function _export_star(from, to) {
|
|
19
20
|
Object.keys(from).forEach(function(k) {
|
|
20
|
-
if (k !== "default" && !Object.prototype.hasOwnProperty.call(to, k))
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
21
|
+
if (k !== "default" && !Object.prototype.hasOwnProperty.call(to, k)) {
|
|
22
|
+
Object.defineProperty(to, k, {
|
|
23
|
+
enumerable: true,
|
|
24
|
+
get: function() {
|
|
25
|
+
return from[k];
|
|
26
|
+
}
|
|
27
|
+
});
|
|
28
|
+
}
|
|
26
29
|
});
|
|
27
30
|
return from;
|
|
28
31
|
}
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
// Copyright 2023 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: all[name]
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
_export(exports, {
|
|
24
|
+
MOCK_TIME_SERIES_DATA: function() {
|
|
25
|
+
return MOCK_TIME_SERIES_DATA;
|
|
26
|
+
},
|
|
27
|
+
MOCK_TRACE_DATA: function() {
|
|
28
|
+
return MOCK_TRACE_DATA;
|
|
29
|
+
}
|
|
30
|
+
});
|
|
31
|
+
const MOCK_TIME_SERIES_DATA = {
|
|
32
|
+
timeRange: {
|
|
33
|
+
start: new Date(1666625490000),
|
|
34
|
+
end: new Date(1666625535000)
|
|
35
|
+
},
|
|
36
|
+
stepMs: 24379,
|
|
37
|
+
series: [
|
|
38
|
+
{
|
|
39
|
+
name: 'device="/dev/vda1", env="demo", fstype="ext4", instance="demo.do.prometheus.io:9100", job="node", mountpoint="/"',
|
|
40
|
+
values: [
|
|
41
|
+
[
|
|
42
|
+
1666479357903,
|
|
43
|
+
0.27700745551584494
|
|
44
|
+
],
|
|
45
|
+
[
|
|
46
|
+
1666479382282,
|
|
47
|
+
0.27701284657366565
|
|
48
|
+
]
|
|
49
|
+
]
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
name: 'device="/dev/vda15", env="demo", fstype="vfat", instance="demo.do.prometheus.io:9100", job="node", mountpoint="/boot/efi"',
|
|
53
|
+
values: [
|
|
54
|
+
[
|
|
55
|
+
1666479357903,
|
|
56
|
+
0.08486496097624885
|
|
57
|
+
],
|
|
58
|
+
[
|
|
59
|
+
1666479382282,
|
|
60
|
+
0.08486496097624885
|
|
61
|
+
]
|
|
62
|
+
]
|
|
63
|
+
}
|
|
64
|
+
]
|
|
65
|
+
};
|
|
66
|
+
const MOCK_TRACE_DATA = {
|
|
67
|
+
traces: [
|
|
68
|
+
{
|
|
69
|
+
durationMs: 1120,
|
|
70
|
+
errorCount: 0,
|
|
71
|
+
spanCount: 10,
|
|
72
|
+
startTimeUnixMs: 1699916103945861,
|
|
73
|
+
traceId: '95ba9202315c29c801b5aa41452aa775',
|
|
74
|
+
name: 'rootServiceName="shop-backend", rootTraceName="shop-backend"'
|
|
75
|
+
}
|
|
76
|
+
],
|
|
77
|
+
metadata: {
|
|
78
|
+
executedQueryString: '{ duration > 1000ms }'
|
|
79
|
+
}
|
|
80
|
+
};
|
package/dist/cjs/test/render.js
CHANGED
|
@@ -16,13 +16,15 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
16
16
|
});
|
|
17
17
|
Object.defineProperty(exports, "renderWithContext", {
|
|
18
18
|
enumerable: true,
|
|
19
|
-
get: ()
|
|
19
|
+
get: function() {
|
|
20
|
+
return renderWithContext;
|
|
21
|
+
}
|
|
20
22
|
});
|
|
21
|
-
const
|
|
23
|
+
const _jsxruntime = require("react/jsx-runtime");
|
|
22
24
|
const _react = require("@testing-library/react");
|
|
23
|
-
const
|
|
24
|
-
const
|
|
25
|
-
const
|
|
25
|
+
const _reactquery = require("@tanstack/react-query");
|
|
26
|
+
const _PluginRegistry = require("../components/PluginRegistry");
|
|
27
|
+
const _testplugins = require("./test-plugins");
|
|
26
28
|
const testLogger = {
|
|
27
29
|
log: console.log,
|
|
28
30
|
warn: console.warn,
|
|
@@ -32,7 +34,7 @@ const testLogger = {
|
|
|
32
34
|
};
|
|
33
35
|
function renderWithContext(ui, renderOptions, contextOptions) {
|
|
34
36
|
// Create a new QueryClient for each test to avoid caching issues
|
|
35
|
-
const queryClient = new
|
|
37
|
+
const queryClient = new _reactquery.QueryClient({
|
|
36
38
|
defaultOptions: {
|
|
37
39
|
queries: {
|
|
38
40
|
refetchOnWindowFocus: false,
|
|
@@ -41,12 +43,12 @@ function renderWithContext(ui, renderOptions, contextOptions) {
|
|
|
41
43
|
},
|
|
42
44
|
logger: testLogger
|
|
43
45
|
});
|
|
44
|
-
var
|
|
45
|
-
return (0, _react.render)(/*#__PURE__*/ (0,
|
|
46
|
+
var _contextOptions_defaultPluginKinds;
|
|
47
|
+
return (0, _react.render)(/*#__PURE__*/ (0, _jsxruntime.jsx)(_reactquery.QueryClientProvider, {
|
|
46
48
|
client: queryClient,
|
|
47
|
-
children: /*#__PURE__*/ (0,
|
|
48
|
-
pluginLoader:
|
|
49
|
-
defaultPluginKinds: (
|
|
49
|
+
children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_PluginRegistry.PluginRegistry, {
|
|
50
|
+
pluginLoader: _testplugins.testPluginLoader,
|
|
51
|
+
defaultPluginKinds: (_contextOptions_defaultPluginKinds = contextOptions === null || contextOptions === void 0 ? void 0 : contextOptions.defaultPluginKinds) !== null && _contextOptions_defaultPluginKinds !== void 0 ? _contextOptions_defaultPluginKinds : {
|
|
50
52
|
TimeSeriesQuery: 'PrometheusTimeSeriesQuery'
|
|
51
53
|
},
|
|
52
54
|
children: ui
|
|
@@ -21,18 +21,22 @@ function _export(target, all) {
|
|
|
21
21
|
});
|
|
22
22
|
}
|
|
23
23
|
_export(exports, {
|
|
24
|
-
BertPanel1: ()
|
|
25
|
-
|
|
24
|
+
BertPanel1: function() {
|
|
25
|
+
return BertPanel1;
|
|
26
|
+
},
|
|
27
|
+
BertPanel2: function() {
|
|
28
|
+
return BertPanel2;
|
|
29
|
+
}
|
|
26
30
|
});
|
|
27
|
-
const
|
|
28
|
-
function BertPanel1Editor({ value
|
|
29
|
-
return /*#__PURE__*/ (0,
|
|
31
|
+
const _jsxruntime = require("react/jsx-runtime");
|
|
32
|
+
function BertPanel1Editor({ value, onChange }) {
|
|
33
|
+
return /*#__PURE__*/ (0, _jsxruntime.jsxs)("div", {
|
|
30
34
|
children: [
|
|
31
|
-
/*#__PURE__*/ (0,
|
|
35
|
+
/*#__PURE__*/ (0, _jsxruntime.jsx)("label", {
|
|
32
36
|
htmlFor: "editor-input",
|
|
33
37
|
children: "BertPanel1 editor"
|
|
34
38
|
}),
|
|
35
|
-
/*#__PURE__*/ (0,
|
|
39
|
+
/*#__PURE__*/ (0, _jsxruntime.jsx)("input", {
|
|
36
40
|
type: "text",
|
|
37
41
|
id: "editor-input",
|
|
38
42
|
value: value.option1,
|
|
@@ -61,14 +65,14 @@ const BertPanel2 = {
|
|
|
61
65
|
panelOptionsEditorComponents: [
|
|
62
66
|
{
|
|
63
67
|
label: 'Settings',
|
|
64
|
-
content: function BertPanel2Editor({ value
|
|
65
|
-
return /*#__PURE__*/ (0,
|
|
68
|
+
content: function BertPanel2Editor({ value, onChange }) {
|
|
69
|
+
return /*#__PURE__*/ (0, _jsxruntime.jsxs)("div", {
|
|
66
70
|
children: [
|
|
67
|
-
/*#__PURE__*/ (0,
|
|
71
|
+
/*#__PURE__*/ (0, _jsxruntime.jsx)("label", {
|
|
68
72
|
htmlFor: "editor-input",
|
|
69
73
|
children: "BertPanel2 editor"
|
|
70
74
|
}),
|
|
71
|
-
/*#__PURE__*/ (0,
|
|
75
|
+
/*#__PURE__*/ (0, _jsxruntime.jsx)("input", {
|
|
72
76
|
type: "text",
|
|
73
77
|
id: "editor-input",
|
|
74
78
|
value: value.option2,
|
|
@@ -84,7 +88,7 @@ const BertPanel2 = {
|
|
|
84
88
|
{
|
|
85
89
|
label: 'Custom Tab',
|
|
86
90
|
content: function Editor() {
|
|
87
|
-
return /*#__PURE__*/ (0,
|
|
91
|
+
return /*#__PURE__*/ (0, _jsxruntime.jsx)("div", {
|
|
88
92
|
children: "custom content"
|
|
89
93
|
});
|
|
90
94
|
}
|
|
@@ -21,10 +21,14 @@ function _export(target, all) {
|
|
|
21
21
|
});
|
|
22
22
|
}
|
|
23
23
|
_export(exports, {
|
|
24
|
-
ErnieVariable1: ()
|
|
25
|
-
|
|
24
|
+
ErnieVariable1: function() {
|
|
25
|
+
return ErnieVariable1;
|
|
26
|
+
},
|
|
27
|
+
ErnieVariable2: function() {
|
|
28
|
+
return ErnieVariable2;
|
|
29
|
+
}
|
|
26
30
|
});
|
|
27
|
-
const
|
|
31
|
+
const _jsxruntime = require("react/jsx-runtime");
|
|
28
32
|
const data = [
|
|
29
33
|
{
|
|
30
34
|
label: 'Grover',
|
|
@@ -39,14 +43,14 @@ const ErnieVariable1 = {
|
|
|
39
43
|
getVariableOptions: async ()=>({
|
|
40
44
|
data
|
|
41
45
|
}),
|
|
42
|
-
OptionsEditorComponent: function ErnieVariableEditor({ value
|
|
43
|
-
return /*#__PURE__*/ (0,
|
|
46
|
+
OptionsEditorComponent: function ErnieVariableEditor({ value, onChange }) {
|
|
47
|
+
return /*#__PURE__*/ (0, _jsxruntime.jsxs)("div", {
|
|
44
48
|
children: [
|
|
45
|
-
/*#__PURE__*/ (0,
|
|
49
|
+
/*#__PURE__*/ (0, _jsxruntime.jsx)("label", {
|
|
46
50
|
htmlFor: "editor-input",
|
|
47
51
|
children: "ErnieVariable editor"
|
|
48
52
|
}),
|
|
49
|
-
/*#__PURE__*/ (0,
|
|
53
|
+
/*#__PURE__*/ (0, _jsxruntime.jsx)("input", {
|
|
50
54
|
type: "text",
|
|
51
55
|
id: "editor-input",
|
|
52
56
|
value: value.variableOption,
|
|
@@ -66,14 +70,14 @@ const ErnieVariable2 = {
|
|
|
66
70
|
getVariableOptions: async ()=>({
|
|
67
71
|
data
|
|
68
72
|
}),
|
|
69
|
-
OptionsEditorComponent: function ErnieVariableEditor({ value
|
|
70
|
-
return /*#__PURE__*/ (0,
|
|
73
|
+
OptionsEditorComponent: function ErnieVariableEditor({ value, onChange }) {
|
|
74
|
+
return /*#__PURE__*/ (0, _jsxruntime.jsxs)("div", {
|
|
71
75
|
children: [
|
|
72
|
-
/*#__PURE__*/ (0,
|
|
76
|
+
/*#__PURE__*/ (0, _jsxruntime.jsx)("label", {
|
|
73
77
|
htmlFor: "editor-input",
|
|
74
78
|
children: "ErnieVariable2 editor"
|
|
75
79
|
}),
|
|
76
|
-
/*#__PURE__*/ (0,
|
|
80
|
+
/*#__PURE__*/ (0, _jsxruntime.jsx)("input", {
|
|
77
81
|
type: "text",
|
|
78
82
|
id: "editor-input",
|
|
79
83
|
value: value.variableOption2,
|
|
@@ -16,12 +16,14 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
16
16
|
});
|
|
17
17
|
Object.defineProperty(exports, "testPluginLoader", {
|
|
18
18
|
enumerable: true,
|
|
19
|
-
get: ()
|
|
19
|
+
get: function() {
|
|
20
|
+
return testPluginLoader;
|
|
21
|
+
}
|
|
20
22
|
});
|
|
21
23
|
const _model = require("../../model");
|
|
22
|
-
const
|
|
23
|
-
const
|
|
24
|
-
function
|
|
24
|
+
const _pluginjson = /*#__PURE__*/ _interop_require_default(require("./bert/plugin.json"));
|
|
25
|
+
const _pluginjson1 = /*#__PURE__*/ _interop_require_default(require("./ernie/plugin.json"));
|
|
26
|
+
function _interop_require_default(obj) {
|
|
25
27
|
return obj && obj.__esModule ? obj : {
|
|
26
28
|
default: obj
|
|
27
29
|
};
|
|
@@ -34,7 +36,7 @@ function _getRequireWildcardCache(nodeInterop) {
|
|
|
34
36
|
return nodeInterop ? cacheNodeInterop : cacheBabelInterop;
|
|
35
37
|
})(nodeInterop);
|
|
36
38
|
}
|
|
37
|
-
function
|
|
39
|
+
function _interop_require_wildcard(obj, nodeInterop) {
|
|
38
40
|
if (!nodeInterop && obj && obj.__esModule) {
|
|
39
41
|
return obj;
|
|
40
42
|
}
|
|
@@ -47,7 +49,9 @@ function _interopRequireWildcard(obj, nodeInterop) {
|
|
|
47
49
|
if (cache && cache.has(obj)) {
|
|
48
50
|
return cache.get(obj);
|
|
49
51
|
}
|
|
50
|
-
var newObj = {
|
|
52
|
+
var newObj = {
|
|
53
|
+
__proto__: null
|
|
54
|
+
};
|
|
51
55
|
var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;
|
|
52
56
|
for(var key in obj){
|
|
53
57
|
if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) {
|
|
@@ -67,11 +71,11 @@ function _interopRequireWildcard(obj, nodeInterop) {
|
|
|
67
71
|
}
|
|
68
72
|
const testPluginLoader = (0, _model.dynamicImportPluginLoader)([
|
|
69
73
|
{
|
|
70
|
-
resource:
|
|
71
|
-
importPlugin: ()=>Promise.resolve().then(()=>/*#__PURE__*/
|
|
74
|
+
resource: _pluginjson.default,
|
|
75
|
+
importPlugin: ()=>Promise.resolve().then(()=>/*#__PURE__*/ _interop_require_wildcard(require("./bert")))
|
|
72
76
|
},
|
|
73
77
|
{
|
|
74
|
-
resource:
|
|
75
|
-
importPlugin: ()=>Promise.resolve().then(()=>/*#__PURE__*/
|
|
78
|
+
resource: _pluginjson1.default,
|
|
79
|
+
importPlugin: ()=>Promise.resolve().then(()=>/*#__PURE__*/ _interop_require_wildcard(require("./ernie")))
|
|
76
80
|
}
|
|
77
81
|
]);
|
|
@@ -14,15 +14,17 @@
|
|
|
14
14
|
Object.defineProperty(exports, "__esModule", {
|
|
15
15
|
value: true
|
|
16
16
|
});
|
|
17
|
-
|
|
18
|
-
function
|
|
17
|
+
_export_star(require("./mock-plugin-registry"), exports);
|
|
18
|
+
function _export_star(from, to) {
|
|
19
19
|
Object.keys(from).forEach(function(k) {
|
|
20
|
-
if (k !== "default" && !Object.prototype.hasOwnProperty.call(to, k))
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
20
|
+
if (k !== "default" && !Object.prototype.hasOwnProperty.call(to, k)) {
|
|
21
|
+
Object.defineProperty(to, k, {
|
|
22
|
+
enumerable: true,
|
|
23
|
+
get: function() {
|
|
24
|
+
return from[k];
|
|
25
|
+
}
|
|
26
|
+
});
|
|
27
|
+
}
|
|
26
28
|
});
|
|
27
29
|
return from;
|
|
28
30
|
}
|
|
@@ -21,21 +21,25 @@ function _export(target, all) {
|
|
|
21
21
|
});
|
|
22
22
|
}
|
|
23
23
|
_export(exports, {
|
|
24
|
-
|
|
25
|
-
|
|
24
|
+
getMockPluginName: function() {
|
|
25
|
+
return getMockPluginName;
|
|
26
|
+
},
|
|
27
|
+
mockPluginRegistry: function() {
|
|
28
|
+
return mockPluginRegistry;
|
|
29
|
+
}
|
|
26
30
|
});
|
|
27
31
|
function mockPluginRegistry(...mockPlugins) {
|
|
28
32
|
const mockPluginResource = {
|
|
29
33
|
kind: 'PluginModule',
|
|
30
34
|
metadata: {
|
|
31
35
|
name: 'Fake Plugin Module for Tests',
|
|
32
|
-
|
|
33
|
-
|
|
36
|
+
createdAt: '',
|
|
37
|
+
updatedAt: '',
|
|
34
38
|
version: 0
|
|
35
39
|
},
|
|
36
40
|
spec: {
|
|
37
41
|
// Add metadata for all mock plugins
|
|
38
|
-
plugins: mockPlugins.map(({ pluginType
|
|
42
|
+
plugins: mockPlugins.map(({ pluginType, kind })=>({
|
|
39
43
|
pluginType,
|
|
40
44
|
kind,
|
|
41
45
|
display: {
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
// Copyright 2023 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: all[name]
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
_export(exports, {
|
|
24
|
+
getSubmitText: function() {
|
|
25
|
+
return getSubmitText;
|
|
26
|
+
},
|
|
27
|
+
getTitleAction: function() {
|
|
28
|
+
return getTitleAction;
|
|
29
|
+
}
|
|
30
|
+
});
|
|
31
|
+
function getTitleAction(action, isDraft) {
|
|
32
|
+
if (action === 'read') return 'View';
|
|
33
|
+
if (isDraft && action === 'create') return 'Add';
|
|
34
|
+
if (!isDraft && action === 'create') return 'Create';
|
|
35
|
+
if (action === 'update') return 'Edit';
|
|
36
|
+
return '';
|
|
37
|
+
}
|
|
38
|
+
function getSubmitText(action, isDraft) {
|
|
39
|
+
if (isDraft && action === 'create') return 'Add';
|
|
40
|
+
if (isDraft && action === 'update') return 'Apply';
|
|
41
|
+
if (!isDraft) return 'Save';
|
|
42
|
+
return '';
|
|
43
|
+
}
|
package/dist/cjs/utils/index.js
CHANGED
|
@@ -14,15 +14,18 @@
|
|
|
14
14
|
Object.defineProperty(exports, "__esModule", {
|
|
15
15
|
value: true
|
|
16
16
|
});
|
|
17
|
-
|
|
18
|
-
|
|
17
|
+
_export_star(require("./action"), exports);
|
|
18
|
+
_export_star(require("./variables"), exports);
|
|
19
|
+
function _export_star(from, to) {
|
|
19
20
|
Object.keys(from).forEach(function(k) {
|
|
20
|
-
if (k !== "default" && !Object.prototype.hasOwnProperty.call(to, k))
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
21
|
+
if (k !== "default" && !Object.prototype.hasOwnProperty.call(to, k)) {
|
|
22
|
+
Object.defineProperty(to, k, {
|
|
23
|
+
enumerable: true,
|
|
24
|
+
get: function() {
|
|
25
|
+
return from[k];
|
|
26
|
+
}
|
|
27
|
+
});
|
|
28
|
+
}
|
|
26
29
|
});
|
|
27
30
|
return from;
|
|
28
31
|
}
|
|
@@ -21,14 +21,23 @@ function _export(target, all) {
|
|
|
21
21
|
});
|
|
22
22
|
}
|
|
23
23
|
_export(exports, {
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
24
|
+
parseTemplateVariables: function() {
|
|
25
|
+
return parseTemplateVariables;
|
|
26
|
+
},
|
|
27
|
+
replaceTemplateVariable: function() {
|
|
28
|
+
return replaceTemplateVariable;
|
|
29
|
+
},
|
|
30
|
+
replaceTemplateVariables: function() {
|
|
31
|
+
return replaceTemplateVariables;
|
|
32
|
+
}
|
|
27
33
|
});
|
|
28
34
|
function replaceTemplateVariables(text, variableState) {
|
|
29
35
|
const variables = parseTemplateVariables(text);
|
|
30
36
|
let finalText = text;
|
|
31
|
-
variables.
|
|
37
|
+
variables// Sorting variables by their length.
|
|
38
|
+
// In order to not have a variable name have contained in another variable name.
|
|
39
|
+
// i.e.: $__range replacing $__range_ms => '3600_ms' instead of '3600000'
|
|
40
|
+
.sort((a, b)=>b.length - a.length).forEach((v)=>{
|
|
32
41
|
const variable = variableState[v];
|
|
33
42
|
if (variable && (variable === null || variable === void 0 ? void 0 : variable.value)) {
|
|
34
43
|
finalText = replaceTemplateVariable(finalText, v, variable === null || variable === void 0 ? void 0 : variable.value);
|
|
@@ -38,6 +47,7 @@ function replaceTemplateVariables(text, variableState) {
|
|
|
38
47
|
}
|
|
39
48
|
function replaceTemplateVariable(text, varName, templateVariableValue) {
|
|
40
49
|
const variableTemplate = '$' + varName;
|
|
50
|
+
const bracketsVariableTemplate = '${' + varName + '}';
|
|
41
51
|
let replaceString = '';
|
|
42
52
|
if (Array.isArray(templateVariableValue)) {
|
|
43
53
|
replaceString = `(${templateVariableValue.join('|')})`; // regex style
|
|
@@ -45,12 +55,14 @@ function replaceTemplateVariable(text, varName, templateVariableValue) {
|
|
|
45
55
|
if (typeof templateVariableValue === 'string') {
|
|
46
56
|
replaceString = templateVariableValue;
|
|
47
57
|
}
|
|
48
|
-
|
|
58
|
+
text = text.replaceAll(variableTemplate, replaceString);
|
|
59
|
+
return text.replaceAll(bracketsVariableTemplate, replaceString);
|
|
49
60
|
}
|
|
50
61
|
// This regular expression is designed to identify variable references in a template string.
|
|
51
62
|
// It supports two formats for referencing variables:
|
|
52
63
|
// 1. $variableName - This is a simpler format, and the regular expression captures the variable name (\w+ matches one or more word characters).
|
|
53
|
-
// 2.
|
|
64
|
+
// 2. ${variableName} - This is a more complex format and the regular expression captures the variable name (\w+ matches one or more word characters) in the curly braces.
|
|
65
|
+
// 3. [COMING SOON] ${variableName:value} - This is a more complex format that allows specifying a format function as well.
|
|
54
66
|
// TODO: Fix this lint error
|
|
55
67
|
// eslint-disable-next-line no-useless-escape
|
|
56
68
|
const TEMPLATE_VARIABLE_REGEX = /\$(\w+)|\${(\w+)(?:\.([^:^\}]+))?(?::([^\}]+))?}/gm;
|
|
@@ -59,8 +71,14 @@ const parseTemplateVariables = (text)=>{
|
|
|
59
71
|
const matches = new Set();
|
|
60
72
|
let match;
|
|
61
73
|
while((match = regex.exec(text)) !== null){
|
|
62
|
-
if (match
|
|
63
|
-
|
|
74
|
+
if (match) {
|
|
75
|
+
if (match[1]) {
|
|
76
|
+
// \$(\w+)\
|
|
77
|
+
matches.add(match[1]);
|
|
78
|
+
} else if (match[2]) {
|
|
79
|
+
// \${(\w+)}\
|
|
80
|
+
matches.add(match[2]);
|
|
81
|
+
}
|
|
64
82
|
}
|
|
65
83
|
}
|
|
66
84
|
// return unique matches
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
// Copyright 2023 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, "datasourceEditValidationSchema", {
|
|
18
|
+
enumerable: true,
|
|
19
|
+
get: function() {
|
|
20
|
+
return datasourceEditValidationSchema;
|
|
21
|
+
}
|
|
22
|
+
});
|
|
23
|
+
const _zod = require("zod");
|
|
24
|
+
const _resource = require("./resource");
|
|
25
|
+
const datasourceEditValidationSchema = _zod.z.object({
|
|
26
|
+
name: _resource.resourceIdValidationSchema,
|
|
27
|
+
title: _zod.z.string().optional(),
|
|
28
|
+
description: _zod.z.string().optional(),
|
|
29
|
+
default: _zod.z.boolean()
|
|
30
|
+
});
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
// Copyright 2024 The Perses Authors
|
|
2
|
+
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
3
|
+
// you may not use this file except in compliance with the License.
|
|
4
|
+
// You may obtain a copy of the License at
|
|
5
|
+
//
|
|
6
|
+
// http://www.apache.org/licenses/LICENSE-2.0
|
|
7
|
+
//
|
|
8
|
+
// Unless required by applicable law or agreed to in writing, software
|
|
9
|
+
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
10
|
+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
11
|
+
// See the License for the specific language governing permissions and
|
|
12
|
+
// limitations under the License.
|
|
13
|
+
"use strict";
|
|
14
|
+
Object.defineProperty(exports, "__esModule", {
|
|
15
|
+
value: true
|
|
16
|
+
});
|
|
17
|
+
Object.defineProperty(exports, "durationValidationSchema", {
|
|
18
|
+
enumerable: true,
|
|
19
|
+
get: function() {
|
|
20
|
+
return durationValidationSchema;
|
|
21
|
+
}
|
|
22
|
+
});
|
|
23
|
+
const _core = require("@perses-dev/core");
|
|
24
|
+
const _zod = require("zod");
|
|
25
|
+
const durationValidationSchema = _zod.z.string().nonempty('Required').regex(_core.DURATION_REGEX, 'Must be a valid duration string');
|