@flanksource/clicky-ui 0.3.77 → 0.3.79
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/NOTICE.md +16 -0
- package/dist/ai.cjs +2 -2
- package/dist/ai.js +2 -2
- package/dist/comments/CommentThreadList.cjs +13 -14
- package/dist/comments/CommentThreadList.cjs.map +1 -1
- package/dist/comments/CommentThreadList.d.ts.map +1 -1
- package/dist/comments/CommentThreadList.js +13 -14
- package/dist/comments/CommentThreadList.js.map +1 -1
- package/dist/components/EndpointSelector.cjs +7 -1
- package/dist/components/EndpointSelector.cjs.map +1 -1
- package/dist/components/EndpointSelector.d.ts.map +1 -1
- package/dist/components/EndpointSelector.js +7 -1
- package/dist/components/EndpointSelector.js.map +1 -1
- package/dist/components/FilterBar.cjs +36 -12
- package/dist/components/FilterBar.cjs.map +1 -1
- package/dist/components/FilterBar.d.ts +14 -2
- package/dist/components/FilterBar.d.ts.map +1 -1
- package/dist/components/FilterBar.js +36 -12
- package/dist/components/FilterBar.js.map +1 -1
- package/dist/components/FormLookupProvider.cjs +12 -4
- package/dist/components/FormLookupProvider.cjs.map +1 -1
- package/dist/components/FormLookupProvider.d.ts.map +1 -1
- package/dist/components/FormLookupProvider.js +13 -5
- package/dist/components/FormLookupProvider.js.map +1 -1
- package/dist/components/JSONPathPlayground.cjs +124 -233
- package/dist/components/JSONPathPlayground.cjs.map +1 -1
- package/dist/components/JSONPathPlayground.d.ts +15 -13
- package/dist/components/JSONPathPlayground.d.ts.map +1 -1
- package/dist/components/JSONPathPlayground.js +125 -234
- package/dist/components/JSONPathPlayground.js.map +1 -1
- package/dist/components/JsonSchemaForm.cjs +6 -0
- package/dist/components/JsonSchemaForm.cjs.map +1 -1
- package/dist/components/JsonSchemaForm.js +6 -0
- package/dist/components/JsonSchemaForm.js.map +1 -1
- package/dist/components/SegmentedControl.cjs +1 -1
- package/dist/components/SegmentedControl.cjs.map +1 -1
- package/dist/components/SegmentedControl.d.ts.map +1 -1
- package/dist/components/SegmentedControl.js +1 -1
- package/dist/components/SegmentedControl.js.map +1 -1
- package/dist/components/TimeRange.cjs +133 -60
- package/dist/components/TimeRange.cjs.map +1 -1
- package/dist/components/TimeRange.d.ts +8 -1
- package/dist/components/TimeRange.d.ts.map +1 -1
- package/dist/components/TimeRange.js +133 -60
- package/dist/components/TimeRange.js.map +1 -1
- package/dist/components/json-schema-form-accordion-array.cjs +8 -6
- package/dist/components/json-schema-form-accordion-array.cjs.map +1 -1
- package/dist/components/json-schema-form-accordion-array.d.ts.map +1 -1
- package/dist/components/json-schema-form-accordion-array.js +9 -7
- package/dist/components/json-schema-form-accordion-array.js.map +1 -1
- package/dist/components/json-schema-form-array-rows.cjs +45 -0
- package/dist/components/json-schema-form-array-rows.cjs.map +1 -0
- package/dist/components/json-schema-form-array-rows.d.ts +10 -0
- package/dist/components/json-schema-form-array-rows.d.ts.map +1 -0
- package/dist/components/json-schema-form-array-rows.js +45 -0
- package/dist/components/json-schema-form-array-rows.js.map +1 -0
- package/dist/components/json-schema-form-item-summary.cjs +3 -5
- package/dist/components/json-schema-form-item-summary.cjs.map +1 -1
- package/dist/components/json-schema-form-item-summary.d.ts +1 -1
- package/dist/components/json-schema-form-item-summary.d.ts.map +1 -1
- package/dist/components/json-schema-form-item-summary.js +3 -5
- package/dist/components/json-schema-form-item-summary.js.map +1 -1
- package/dist/components/json-schema-form-render.cjs +11 -2
- package/dist/components/json-schema-form-render.cjs.map +1 -1
- package/dist/components/json-schema-form-render.d.ts.map +1 -1
- package/dist/components/json-schema-form-render.js +12 -3
- package/dist/components/json-schema-form-render.js.map +1 -1
- package/dist/components/json-schema-form-resolve.cjs +10 -0
- package/dist/components/json-schema-form-resolve.cjs.map +1 -1
- package/dist/components/json-schema-form-resolve.d.ts +1 -0
- package/dist/components/json-schema-form-resolve.d.ts.map +1 -1
- package/dist/components/json-schema-form-resolve.js +10 -1
- package/dist/components/json-schema-form-resolve.js.map +1 -1
- package/dist/components/json-schema-form-runtime-types.d.ts +4 -0
- package/dist/components/json-schema-form-runtime-types.d.ts.map +1 -1
- package/dist/components/json-schema-form-table-array.cjs +25 -16
- package/dist/components/json-schema-form-table-array.cjs.map +1 -1
- package/dist/components/json-schema-form-table-array.d.ts +1 -1
- package/dist/components/json-schema-form-table-array.d.ts.map +1 -1
- package/dist/components/json-schema-form-table-array.js +26 -17
- package/dist/components/json-schema-form-table-array.js.map +1 -1
- package/dist/components/json-schema-form-types.d.ts +0 -2
- package/dist/components/json-schema-form-types.d.ts.map +1 -1
- package/dist/components/jsonPathPlaygroundEvaluator.cjs +53 -0
- package/dist/components/jsonPathPlaygroundEvaluator.cjs.map +1 -0
- package/dist/components/jsonPathPlaygroundEvaluator.d.ts +23 -0
- package/dist/components/jsonPathPlaygroundEvaluator.d.ts.map +1 -0
- package/dist/components/jsonPathPlaygroundEvaluator.js +53 -0
- package/dist/components/jsonPathPlaygroundEvaluator.js.map +1 -0
- package/dist/components/jsonPathTree.cjs +1 -0
- package/dist/components/jsonPathTree.cjs.map +1 -1
- package/dist/components/jsonPathTree.d.ts +6 -0
- package/dist/components/jsonPathTree.d.ts.map +1 -1
- package/dist/components/jsonPathTree.js +1 -0
- package/dist/components/jsonPathTree.js.map +1 -1
- package/dist/data/Clicky.cjs +37 -18
- package/dist/data/Clicky.cjs.map +1 -1
- package/dist/data/Clicky.d.ts +5 -0
- package/dist/data/Clicky.d.ts.map +1 -1
- package/dist/data/Clicky.js +37 -18
- package/dist/data/Clicky.js.map +1 -1
- package/dist/data/DataTable.cjs +49 -12
- package/dist/data/DataTable.cjs.map +1 -1
- package/dist/data/DataTable.d.ts +17 -2
- package/dist/data/DataTable.d.ts.map +1 -1
- package/dist/data/DataTable.js +49 -12
- package/dist/data/DataTable.js.map +1 -1
- package/dist/data/TaskPoolUsage.cjs +2 -1
- package/dist/data/TaskPoolUsage.cjs.map +1 -1
- package/dist/data/TaskPoolUsage.d.ts.map +1 -1
- package/dist/data/TaskPoolUsage.js +2 -1
- package/dist/data/TaskPoolUsage.js.map +1 -1
- package/dist/data/TimeseriesPanel.axes.cjs +18 -3
- package/dist/data/TimeseriesPanel.axes.cjs.map +1 -1
- package/dist/data/TimeseriesPanel.axes.d.ts +10 -1
- package/dist/data/TimeseriesPanel.axes.d.ts.map +1 -1
- package/dist/data/TimeseriesPanel.axes.js +17 -4
- package/dist/data/TimeseriesPanel.axes.js.map +1 -1
- package/dist/data/TimeseriesPanel.cjs +57 -23
- package/dist/data/TimeseriesPanel.cjs.map +1 -1
- package/dist/data/TimeseriesPanel.d.ts.map +1 -1
- package/dist/data/TimeseriesPanel.js +59 -25
- package/dist/data/TimeseriesPanel.js.map +1 -1
- package/dist/data/TimeseriesPanel.model.cjs +10 -7
- package/dist/data/TimeseriesPanel.model.cjs.map +1 -1
- package/dist/data/TimeseriesPanel.model.d.ts +7 -4
- package/dist/data/TimeseriesPanel.model.d.ts.map +1 -1
- package/dist/data/TimeseriesPanel.model.js +11 -8
- package/dist/data/TimeseriesPanel.model.js.map +1 -1
- package/dist/data/TimeseriesPanel.readout.cjs +11 -0
- package/dist/data/TimeseriesPanel.readout.cjs.map +1 -0
- package/dist/data/TimeseriesPanel.readout.d.ts +4 -0
- package/dist/data/TimeseriesPanel.readout.d.ts.map +1 -0
- package/dist/data/TimeseriesPanel.readout.js +10 -0
- package/dist/data/TimeseriesPanel.readout.js.map +1 -0
- package/dist/data/TimeseriesPanel.segments.cjs +67 -0
- package/dist/data/TimeseriesPanel.segments.cjs.map +1 -0
- package/dist/data/TimeseriesPanel.segments.d.ts +27 -0
- package/dist/data/TimeseriesPanel.segments.d.ts.map +1 -0
- package/dist/data/TimeseriesPanel.segments.js +67 -0
- package/dist/data/TimeseriesPanel.segments.js.map +1 -0
- package/dist/data/TreeDataTable.cjs +12 -3
- package/dist/data/TreeDataTable.cjs.map +1 -1
- package/dist/data/TreeDataTable.d.ts +15 -3
- package/dist/data/TreeDataTable.d.ts.map +1 -1
- package/dist/data/TreeDataTable.js +12 -3
- package/dist/data/TreeDataTable.js.map +1 -1
- package/dist/data/TreeNode.cjs +18 -3
- package/dist/data/TreeNode.cjs.map +1 -1
- package/dist/data/TreeNode.d.ts +7 -1
- package/dist/data/TreeNode.d.ts.map +1 -1
- package/dist/data/TreeNode.js +18 -3
- package/dist/data/TreeNode.js.map +1 -1
- package/dist/data/ai/SessionChatComposer.cjs +2 -0
- package/dist/data/ai/SessionChatComposer.cjs.map +1 -1
- package/dist/data/ai/SessionChatComposer.d.ts.map +1 -1
- package/dist/data/ai/SessionChatComposer.js +2 -0
- package/dist/data/ai/SessionChatComposer.js.map +1 -1
- package/dist/data/ai/SessionInspector.panels.cjs +47 -1
- package/dist/data/ai/SessionInspector.panels.cjs.map +1 -1
- package/dist/data/ai/SessionInspector.panels.d.ts.map +1 -1
- package/dist/data/ai/SessionInspector.panels.js +48 -2
- package/dist/data/ai/SessionInspector.panels.js.map +1 -1
- package/dist/data/ai/SessionViewer.unified.d.ts +48 -0
- package/dist/data/ai/SessionViewer.unified.d.ts.map +1 -1
- package/dist/data/ai/index.d.ts +2 -2
- package/dist/data/ai/index.d.ts.map +1 -1
- package/dist/data/ai/runtime-profiles/PresetWorkspace.cjs +97 -100
- package/dist/data/ai/runtime-profiles/PresetWorkspace.cjs.map +1 -1
- package/dist/data/ai/runtime-profiles/PresetWorkspace.d.ts.map +1 -1
- package/dist/data/ai/runtime-profiles/PresetWorkspace.js +97 -100
- package/dist/data/ai/runtime-profiles/PresetWorkspace.js.map +1 -1
- package/dist/data/ai/runtime-profiles/ProfileWorkspace.cjs +40 -38
- package/dist/data/ai/runtime-profiles/ProfileWorkspace.cjs.map +1 -1
- package/dist/data/ai/runtime-profiles/ProfileWorkspace.d.ts.map +1 -1
- package/dist/data/ai/runtime-profiles/ProfileWorkspace.js +41 -39
- package/dist/data/ai/runtime-profiles/ProfileWorkspace.js.map +1 -1
- package/dist/data/ai/runtime-profiles/ResolutionPreview.cjs +53 -0
- package/dist/data/ai/runtime-profiles/ResolutionPreview.cjs.map +1 -0
- package/dist/data/ai/runtime-profiles/ResolutionPreview.d.ts +7 -0
- package/dist/data/ai/runtime-profiles/ResolutionPreview.d.ts.map +1 -0
- package/dist/data/ai/runtime-profiles/ResolutionPreview.js +53 -0
- package/dist/data/ai/runtime-profiles/ResolutionPreview.js.map +1 -0
- package/dist/data/ai/runtime-profiles/index.d.ts +1 -1
- package/dist/data/ai/runtime-profiles/index.d.ts.map +1 -1
- package/dist/data/ai/sessionSubmitVariant.cjs +30 -0
- package/dist/data/ai/sessionSubmitVariant.cjs.map +1 -0
- package/dist/data/ai/sessionSubmitVariant.d.ts +7 -0
- package/dist/data/ai/sessionSubmitVariant.d.ts.map +1 -0
- package/dist/data/ai/sessionSubmitVariant.js +30 -0
- package/dist/data/ai/sessionSubmitVariant.js.map +1 -0
- package/dist/data/cells/Timestamp.cjs +15 -4
- package/dist/data/cells/Timestamp.cjs.map +1 -1
- package/dist/data/cells/Timestamp.d.ts.map +1 -1
- package/dist/data/cells/Timestamp.js +15 -4
- package/dist/data/cells/Timestamp.js.map +1 -1
- package/dist/data/cells/timestamp-format.cjs +28 -8
- package/dist/data/cells/timestamp-format.cjs.map +1 -1
- package/dist/data/cells/timestamp-format.d.ts +3 -1
- package/dist/data/cells/timestamp-format.d.ts.map +1 -1
- package/dist/data/cells/timestamp-format.js +28 -8
- package/dist/data/cells/timestamp-format.js.map +1 -1
- package/dist/data/charts/TrendChart.cjs +65 -31
- package/dist/data/charts/TrendChart.cjs.map +1 -1
- package/dist/data/charts/TrendChart.d.ts +12 -3
- package/dist/data/charts/TrendChart.d.ts.map +1 -1
- package/dist/data/charts/TrendChart.js +67 -33
- package/dist/data/charts/TrendChart.js.map +1 -1
- package/dist/data/charts/index.d.ts +1 -1
- package/dist/data/charts/index.d.ts.map +1 -1
- package/dist/data/chat/PromptInput.cjs +11 -2
- package/dist/data/chat/PromptInput.cjs.map +1 -1
- package/dist/data/chat/PromptInput.d.ts +15 -1
- package/dist/data/chat/PromptInput.d.ts.map +1 -1
- package/dist/data/chat/PromptInput.js +11 -2
- package/dist/data/chat/PromptInput.js.map +1 -1
- package/dist/data/chat/index.d.ts +1 -1
- package/dist/data/chat/index.d.ts.map +1 -1
- package/dist/data/data-table-filter-values.cjs.map +1 -1
- package/dist/data/data-table-filter-values.d.ts +1 -1
- package/dist/data/data-table-filter-values.d.ts.map +1 -1
- package/dist/data/data-table-filter-values.js.map +1 -1
- package/dist/data/data-table-server-filters.cjs +2 -6
- package/dist/data/data-table-server-filters.cjs.map +1 -1
- package/dist/data/data-table-server-filters.d.ts +1 -1
- package/dist/data/data-table-server-filters.d.ts.map +1 -1
- package/dist/data/data-table-server-filters.js +1 -5
- package/dist/data/data-table-server-filters.js.map +1 -1
- package/dist/data/diagnostics/ErrorDetails.cjs +2 -1
- package/dist/data/diagnostics/ErrorDetails.cjs.map +1 -1
- package/dist/data/diagnostics/ErrorDetails.d.ts +2 -1
- package/dist/data/diagnostics/ErrorDetails.d.ts.map +1 -1
- package/dist/data/diagnostics/ErrorDetails.js +2 -1
- package/dist/data/diagnostics/ErrorDetails.js.map +1 -1
- package/dist/data/gauge-stats.cjs +7 -3
- package/dist/data/gauge-stats.cjs.map +1 -1
- package/dist/data/gauge-stats.d.ts.map +1 -1
- package/dist/data/gauge-stats.js +7 -3
- package/dist/data/gauge-stats.js.map +1 -1
- package/dist/data/query-browser/QueryBrowser.cjs +41 -17
- package/dist/data/query-browser/QueryBrowser.cjs.map +1 -1
- package/dist/data/query-browser/QueryBrowser.d.ts +1 -1
- package/dist/data/query-browser/QueryBrowser.d.ts.map +1 -1
- package/dist/data/query-browser/QueryBrowser.fieldNames.cjs +23 -0
- package/dist/data/query-browser/QueryBrowser.fieldNames.cjs.map +1 -0
- package/dist/data/query-browser/QueryBrowser.fieldNames.d.ts +11 -0
- package/dist/data/query-browser/QueryBrowser.fieldNames.d.ts.map +1 -0
- package/dist/data/query-browser/QueryBrowser.fieldNames.js +23 -0
- package/dist/data/query-browser/QueryBrowser.fieldNames.js.map +1 -0
- package/dist/data/query-browser/QueryBrowser.js +41 -17
- package/dist/data/query-browser/QueryBrowser.js.map +1 -1
- package/dist/data/query-browser/QueryBrowser.types.cjs.map +1 -1
- package/dist/data/query-browser/QueryBrowser.types.d.ts +18 -0
- package/dist/data/query-browser/QueryBrowser.types.d.ts.map +1 -1
- package/dist/data/query-browser/QueryBrowser.types.js.map +1 -1
- package/dist/data/runtime/RuntimeBarLayout.cjs +3 -2
- package/dist/data/runtime/RuntimeBarLayout.cjs.map +1 -1
- package/dist/data/runtime/RuntimeBarLayout.d.ts.map +1 -1
- package/dist/data/runtime/RuntimeBarLayout.js +3 -2
- package/dist/data/runtime/RuntimeBarLayout.js.map +1 -1
- package/dist/data/test-runner/TestRunner.cjs +3 -1
- package/dist/data/test-runner/TestRunner.cjs.map +1 -1
- package/dist/data/test-runner/TestRunner.d.ts +8 -1
- package/dist/data/test-runner/TestRunner.d.ts.map +1 -1
- package/dist/data/test-runner/TestRunner.js +3 -1
- package/dist/data/test-runner/TestRunner.js.map +1 -1
- package/dist/data/test-runner/TestTree.cjs +1 -0
- package/dist/data/test-runner/TestTree.cjs.map +1 -1
- package/dist/data/test-runner/TestTree.d.ts.map +1 -1
- package/dist/data/test-runner/TestTree.js +1 -0
- package/dist/data/test-runner/TestTree.js.map +1 -1
- package/dist/data/test-runner/context.cjs.map +1 -1
- package/dist/data/test-runner/context.d.ts +2 -0
- package/dist/data/test-runner/context.d.ts.map +1 -1
- package/dist/data/test-runner/context.js.map +1 -1
- package/dist/data/timeseries-query.cjs +2 -2
- package/dist/data/timeseries-query.cjs.map +1 -1
- package/dist/data/timeseries-query.d.ts +1 -1
- package/dist/data/timeseries-query.d.ts.map +1 -1
- package/dist/data/timeseries-query.js +2 -2
- package/dist/data/timeseries-query.js.map +1 -1
- package/dist/data/version-info.cjs +3 -3
- package/dist/data/version-info.js +3 -3
- package/dist/data.cjs +33 -0
- package/dist/data.d.ts +1 -1
- package/dist/data.d.ts.map +1 -1
- package/dist/data.js +18 -2
- package/dist/expressions/playground/EmbeddedPlayground.cjs +40 -0
- package/dist/expressions/playground/EmbeddedPlayground.cjs.map +1 -0
- package/dist/expressions/playground/EmbeddedPlayground.d.ts +30 -0
- package/dist/expressions/playground/EmbeddedPlayground.d.ts.map +1 -0
- package/dist/expressions/playground/EmbeddedPlayground.js +40 -0
- package/dist/expressions/playground/EmbeddedPlayground.js.map +1 -0
- package/dist/expressions/playground/ExpressionPlayground.cjs +6 -6
- package/dist/expressions/playground/ExpressionPlayground.cjs.map +1 -1
- package/dist/expressions/playground/ExpressionPlayground.d.ts +10 -3
- package/dist/expressions/playground/ExpressionPlayground.d.ts.map +1 -1
- package/dist/expressions/playground/ExpressionPlayground.js +6 -6
- package/dist/expressions/playground/ExpressionPlayground.js.map +1 -1
- package/dist/expressions/playground/LazyEmbeddedPlayground.cjs +22 -0
- package/dist/expressions/playground/LazyEmbeddedPlayground.cjs.map +1 -0
- package/dist/expressions/playground/LazyEmbeddedPlayground.d.ts +4 -0
- package/dist/expressions/playground/LazyEmbeddedPlayground.d.ts.map +1 -0
- package/dist/expressions/playground/LazyEmbeddedPlayground.js +22 -0
- package/dist/expressions/playground/LazyEmbeddedPlayground.js.map +1 -0
- package/dist/expressions/playground/api.cjs.map +1 -1
- package/dist/expressions/playground/api.d.ts +10 -0
- package/dist/expressions/playground/api.d.ts.map +1 -1
- package/dist/expressions/playground/api.js.map +1 -1
- package/dist/expressions/playground/hostEvaluation.cjs +67 -0
- package/dist/expressions/playground/hostEvaluation.cjs.map +1 -0
- package/dist/expressions/playground/hostEvaluation.d.ts +39 -0
- package/dist/expressions/playground/hostEvaluation.d.ts.map +1 -0
- package/dist/expressions/playground/hostEvaluation.js +63 -0
- package/dist/expressions/playground/hostEvaluation.js.map +1 -0
- package/dist/expressions/playground/panels/GraphPanel.cjs +8 -3
- package/dist/expressions/playground/panels/GraphPanel.cjs.map +1 -1
- package/dist/expressions/playground/panels/GraphPanel.d.ts +2 -1
- package/dist/expressions/playground/panels/GraphPanel.d.ts.map +1 -1
- package/dist/expressions/playground/panels/GraphPanel.js +8 -3
- package/dist/expressions/playground/panels/GraphPanel.js.map +1 -1
- package/dist/expressions/playground/panels/graphNodes.cjs +6 -2
- package/dist/expressions/playground/panels/graphNodes.cjs.map +1 -1
- package/dist/expressions/playground/panels/graphNodes.d.ts +6 -2
- package/dist/expressions/playground/panels/graphNodes.d.ts.map +1 -1
- package/dist/expressions/playground/panels/graphNodes.js +6 -2
- package/dist/expressions/playground/panels/graphNodes.js.map +1 -1
- package/dist/expressions/playground.d.ts +1 -1
- package/dist/expressions/playground.d.ts.map +1 -1
- package/dist/hooks/use-element-height.cjs +26 -0
- package/dist/hooks/use-element-height.cjs.map +1 -0
- package/dist/hooks/use-element-height.d.ts +10 -0
- package/dist/hooks/use-element-height.d.ts.map +1 -0
- package/dist/hooks/use-element-height.js +26 -0
- package/dist/hooks/use-element-height.js.map +1 -0
- package/dist/icons/components/UiGlobeShare.cjs +33 -0
- package/dist/icons/components/UiGlobeShare.cjs.map +1 -0
- package/dist/icons/components/UiGlobeShare.d.ts +9 -0
- package/dist/icons/components/UiGlobeShare.d.ts.map +1 -0
- package/dist/icons/components/UiGlobeShare.js +31 -0
- package/dist/icons/components/UiGlobeShare.js.map +1 -0
- package/dist/icons/components/UiKubernetesLink.cjs +38 -0
- package/dist/icons/components/UiKubernetesLink.cjs.map +1 -0
- package/dist/icons/components/UiKubernetesLink.d.ts +9 -0
- package/dist/icons/components/UiKubernetesLink.d.ts.map +1 -0
- package/dist/icons/components/UiKubernetesLink.js +36 -0
- package/dist/icons/components/UiKubernetesLink.js.map +1 -0
- package/dist/icons/components/UiLogoAws.cjs +29 -0
- package/dist/icons/components/UiLogoAws.cjs.map +1 -0
- package/dist/icons/components/UiLogoAws.d.ts +9 -0
- package/dist/icons/components/UiLogoAws.d.ts.map +1 -0
- package/dist/icons/components/UiLogoAws.js +27 -0
- package/dist/icons/components/UiLogoAws.js.map +1 -0
- package/dist/icons/components/UiLogoAzure.cjs +29 -0
- package/dist/icons/components/UiLogoAzure.cjs.map +1 -0
- package/dist/icons/components/UiLogoAzure.d.ts +9 -0
- package/dist/icons/components/UiLogoAzure.d.ts.map +1 -0
- package/dist/icons/components/UiLogoAzure.js +27 -0
- package/dist/icons/components/UiLogoAzure.js.map +1 -0
- package/dist/icons/components/UiLogoAzureDevops.cjs +29 -0
- package/dist/icons/components/UiLogoAzureDevops.cjs.map +1 -0
- package/dist/icons/components/UiLogoAzureDevops.d.ts +9 -0
- package/dist/icons/components/UiLogoAzureDevops.d.ts.map +1 -0
- package/dist/icons/components/UiLogoAzureDevops.js +27 -0
- package/dist/icons/components/UiLogoAzureDevops.js.map +1 -0
- package/dist/icons/components/UiLogoGit.cjs +29 -0
- package/dist/icons/components/UiLogoGit.cjs.map +1 -0
- package/dist/icons/components/UiLogoGit.d.ts +9 -0
- package/dist/icons/components/UiLogoGit.d.ts.map +1 -0
- package/dist/icons/components/UiLogoGit.js +27 -0
- package/dist/icons/components/UiLogoGit.js.map +1 -0
- package/dist/icons/components/UiLogoGithub.cjs +29 -0
- package/dist/icons/components/UiLogoGithub.cjs.map +1 -0
- package/dist/icons/components/UiLogoGithub.d.ts +9 -0
- package/dist/icons/components/UiLogoGithub.d.ts.map +1 -0
- package/dist/icons/components/UiLogoGithub.js +27 -0
- package/dist/icons/components/UiLogoGithub.js.map +1 -0
- package/dist/icons/components/UiLogoJava.cjs +29 -0
- package/dist/icons/components/UiLogoJava.cjs.map +1 -0
- package/dist/icons/components/UiLogoJava.d.ts +9 -0
- package/dist/icons/components/UiLogoJava.d.ts.map +1 -0
- package/dist/icons/components/UiLogoJava.js +27 -0
- package/dist/icons/components/UiLogoJava.js.map +1 -0
- package/dist/icons/components/UiLogoKubernetes.cjs +29 -0
- package/dist/icons/components/UiLogoKubernetes.cjs.map +1 -0
- package/dist/icons/components/UiLogoKubernetes.d.ts +9 -0
- package/dist/icons/components/UiLogoKubernetes.d.ts.map +1 -0
- package/dist/icons/components/UiLogoKubernetes.js +27 -0
- package/dist/icons/components/UiLogoKubernetes.js.map +1 -0
- package/dist/icons/components/UiLogoMssql.cjs +29 -0
- package/dist/icons/components/UiLogoMssql.cjs.map +1 -0
- package/dist/icons/components/UiLogoMssql.d.ts +9 -0
- package/dist/icons/components/UiLogoMssql.d.ts.map +1 -0
- package/dist/icons/components/UiLogoMssql.js +27 -0
- package/dist/icons/components/UiLogoMssql.js.map +1 -0
- package/dist/icons/components/UiLogoOpenjdk.cjs +29 -0
- package/dist/icons/components/UiLogoOpenjdk.cjs.map +1 -0
- package/dist/icons/components/UiLogoOpenjdk.d.ts +9 -0
- package/dist/icons/components/UiLogoOpenjdk.d.ts.map +1 -0
- package/dist/icons/components/UiLogoOpenjdk.js +27 -0
- package/dist/icons/components/UiLogoOpenjdk.js.map +1 -0
- package/dist/icons/components/UiLogoOpensearch.cjs +29 -0
- package/dist/icons/components/UiLogoOpensearch.cjs.map +1 -0
- package/dist/icons/components/UiLogoOpensearch.d.ts +9 -0
- package/dist/icons/components/UiLogoOpensearch.d.ts.map +1 -0
- package/dist/icons/components/UiLogoOpensearch.js +27 -0
- package/dist/icons/components/UiLogoOpensearch.js.map +1 -0
- package/dist/icons/components/UiLogoOpentelemetry.cjs +29 -0
- package/dist/icons/components/UiLogoOpentelemetry.cjs.map +1 -0
- package/dist/icons/components/UiLogoOpentelemetry.d.ts +9 -0
- package/dist/icons/components/UiLogoOpentelemetry.d.ts.map +1 -0
- package/dist/icons/components/UiLogoOpentelemetry.js +27 -0
- package/dist/icons/components/UiLogoOpentelemetry.js.map +1 -0
- package/dist/icons/components/UiLogoPostgres.cjs +29 -0
- package/dist/icons/components/UiLogoPostgres.cjs.map +1 -0
- package/dist/icons/components/UiLogoPostgres.d.ts +9 -0
- package/dist/icons/components/UiLogoPostgres.d.ts.map +1 -0
- package/dist/icons/components/UiLogoPostgres.js +27 -0
- package/dist/icons/components/UiLogoPostgres.js.map +1 -0
- package/dist/icons/components/UiLogoSqlite.cjs +29 -0
- package/dist/icons/components/UiLogoSqlite.cjs.map +1 -0
- package/dist/icons/components/UiLogoSqlite.d.ts +9 -0
- package/dist/icons/components/UiLogoSqlite.d.ts.map +1 -0
- package/dist/icons/components/UiLogoSqlite.js +27 -0
- package/dist/icons/components/UiLogoSqlite.js.map +1 -0
- package/dist/icons/components/UiWebLink.cjs +40 -0
- package/dist/icons/components/UiWebLink.cjs.map +1 -0
- package/dist/icons/components/UiWebLink.d.ts +9 -0
- package/dist/icons/components/UiWebLink.d.ts.map +1 -0
- package/dist/icons/components/UiWebLink.js +38 -0
- package/dist/icons/components/UiWebLink.js.map +1 -0
- package/dist/icons/index.d.ts +16 -0
- package/dist/icons/index.d.ts.map +1 -1
- package/dist/icons/registry.cjs +32 -0
- package/dist/icons/registry.cjs.map +1 -1
- package/dist/icons/registry.d.ts.map +1 -1
- package/dist/icons/registry.js +32 -0
- package/dist/icons/registry.js.map +1 -1
- package/dist/icons.cjs +32 -0
- package/dist/icons.js +17 -1
- package/dist/index.cjs +38 -5
- package/dist/index.js +23 -7
- package/dist/jvm/classes/PatchedClassList.cjs +11 -2
- package/dist/jvm/classes/PatchedClassList.cjs.map +1 -1
- package/dist/jvm/classes/PatchedClassList.d.ts.map +1 -1
- package/dist/jvm/classes/PatchedClassList.js +11 -2
- package/dist/jvm/classes/PatchedClassList.js.map +1 -1
- package/dist/jvm/fixtures/fake-client.d.ts.map +1 -1
- package/dist/jvm/model/patches.cjs +4 -2
- package/dist/jvm/model/patches.cjs.map +1 -1
- package/dist/jvm/model/patches.d.ts +3 -1
- package/dist/jvm/model/patches.d.ts.map +1 -1
- package/dist/jvm/model/patches.js +4 -2
- package/dist/jvm/model/patches.js.map +1 -1
- package/dist/jvm/protocol/client.d.ts +7 -2
- package/dist/jvm/protocol/client.d.ts.map +1 -1
- package/dist/jvm/protocol/operation-client.cjs +30 -11
- package/dist/jvm/protocol/operation-client.cjs.map +1 -1
- package/dist/jvm/protocol/operation-client.d.ts.map +1 -1
- package/dist/jvm/protocol/operation-client.js +30 -11
- package/dist/jvm/protocol/operation-client.js.map +1 -1
- package/dist/jvm/protocol/query-keys.cjs +1 -1
- package/dist/jvm/protocol/query-keys.cjs.map +1 -1
- package/dist/jvm/protocol/query-keys.d.ts +1 -1
- package/dist/jvm/protocol/query-keys.d.ts.map +1 -1
- package/dist/jvm/protocol/query-keys.js +1 -1
- package/dist/jvm/protocol/query-keys.js.map +1 -1
- package/dist/jvm/protocol/status.cjs +38 -0
- package/dist/jvm/protocol/status.cjs.map +1 -0
- package/dist/jvm/protocol/status.d.ts +13 -0
- package/dist/jvm/protocol/status.d.ts.map +1 -0
- package/dist/jvm/protocol/status.js +38 -0
- package/dist/jvm/protocol/status.js.map +1 -0
- package/dist/jvm/protocol/types.d.ts +16 -4
- package/dist/jvm/protocol/types.d.ts.map +1 -1
- package/dist/jvm/runtime/GcSummary.cjs +7 -1
- package/dist/jvm/runtime/GcSummary.cjs.map +1 -1
- package/dist/jvm/runtime/GcSummary.d.ts.map +1 -1
- package/dist/jvm/runtime/GcSummary.js +7 -1
- package/dist/jvm/runtime/GcSummary.js.map +1 -1
- package/dist/jvm/surfaces/ClassesSurface.cjs +11 -10
- package/dist/jvm/surfaces/ClassesSurface.cjs.map +1 -1
- package/dist/jvm/surfaces/ClassesSurface.d.ts.map +1 -1
- package/dist/jvm/surfaces/ClassesSurface.js +12 -11
- package/dist/jvm/surfaces/ClassesSurface.js.map +1 -1
- package/dist/jvm/surfaces/JvmDiagnosticsWorkspace.cjs +11 -3
- package/dist/jvm/surfaces/JvmDiagnosticsWorkspace.cjs.map +1 -1
- package/dist/jvm/surfaces/JvmDiagnosticsWorkspace.d.ts +2 -0
- package/dist/jvm/surfaces/JvmDiagnosticsWorkspace.d.ts.map +1 -1
- package/dist/jvm/surfaces/JvmDiagnosticsWorkspace.js +11 -3
- package/dist/jvm/surfaces/JvmDiagnosticsWorkspace.js.map +1 -1
- package/dist/jvm/surfaces/PatchesSurface.cjs +3 -8
- package/dist/jvm/surfaces/PatchesSurface.cjs.map +1 -1
- package/dist/jvm/surfaces/PatchesSurface.d.ts +2 -1
- package/dist/jvm/surfaces/PatchesSurface.d.ts.map +1 -1
- package/dist/jvm/surfaces/PatchesSurface.js +4 -9
- package/dist/jvm/surfaces/PatchesSurface.js.map +1 -1
- package/dist/jvm/surfaces/ThreadsSurface.cjs +7 -4
- package/dist/jvm/surfaces/ThreadsSurface.cjs.map +1 -1
- package/dist/jvm/surfaces/ThreadsSurface.d.ts +4 -1
- package/dist/jvm/surfaces/ThreadsSurface.d.ts.map +1 -1
- package/dist/jvm/surfaces/ThreadsSurface.js +7 -4
- package/dist/jvm/surfaces/ThreadsSurface.js.map +1 -1
- package/dist/jvm/surfaces/jvm-context.cjs +23 -4
- package/dist/jvm/surfaces/jvm-context.cjs.map +1 -1
- package/dist/jvm/surfaces/jvm-context.d.ts +7 -0
- package/dist/jvm/surfaces/jvm-context.d.ts.map +1 -1
- package/dist/jvm/surfaces/jvm-context.js +23 -5
- package/dist/jvm/surfaces/jvm-context.js.map +1 -1
- package/dist/jvm/surfaces/use-patch-actions.cjs +2 -2
- package/dist/jvm/surfaces/use-patch-actions.cjs.map +1 -1
- package/dist/jvm/surfaces/use-patch-actions.js +2 -2
- package/dist/jvm/surfaces/use-patch-actions.js.map +1 -1
- package/dist/jvm/threads/FoldedStackTrace.cjs +3 -2
- package/dist/jvm/threads/FoldedStackTrace.cjs.map +1 -1
- package/dist/jvm/threads/FoldedStackTrace.d.ts +4 -1
- package/dist/jvm/threads/FoldedStackTrace.d.ts.map +1 -1
- package/dist/jvm/threads/FoldedStackTrace.js +3 -2
- package/dist/jvm/threads/FoldedStackTrace.js.map +1 -1
- package/dist/jvm/threads/ThreadDetail.cjs +6 -2
- package/dist/jvm/threads/ThreadDetail.cjs.map +1 -1
- package/dist/jvm/threads/ThreadDetail.d.ts +4 -1
- package/dist/jvm/threads/ThreadDetail.d.ts.map +1 -1
- package/dist/jvm/threads/ThreadDetail.js +6 -2
- package/dist/jvm/threads/ThreadDetail.js.map +1 -1
- package/dist/jvm.cjs +3 -0
- package/dist/jvm.d.ts +2 -1
- package/dist/jvm.d.ts.map +1 -1
- package/dist/jvm.js +3 -2
- package/dist/layout/AppShell.cjs.map +1 -1
- package/dist/layout/AppShell.d.ts +16 -0
- package/dist/layout/AppShell.d.ts.map +1 -1
- package/dist/layout/AppShell.js.map +1 -1
- package/dist/layout/AppShell.nav.cjs +21 -2
- package/dist/layout/AppShell.nav.cjs.map +1 -1
- package/dist/layout/AppShell.nav.js +21 -2
- package/dist/layout/AppShell.nav.js.map +1 -1
- package/dist/layout/Workspace.cjs +66 -21
- package/dist/layout/Workspace.cjs.map +1 -1
- package/dist/layout/Workspace.d.ts +6 -1
- package/dist/layout/Workspace.d.ts.map +1 -1
- package/dist/layout/Workspace.js +66 -21
- package/dist/layout/Workspace.js.map +1 -1
- package/dist/layout/Workspace.model.cjs +20 -0
- package/dist/layout/Workspace.model.cjs.map +1 -1
- package/dist/layout/Workspace.model.d.ts +17 -0
- package/dist/layout/Workspace.model.d.ts.map +1 -1
- package/dist/layout/Workspace.model.js +20 -1
- package/dist/layout/Workspace.model.js.map +1 -1
- package/dist/layout/Workspace.regions.cjs +10 -6
- package/dist/layout/Workspace.regions.cjs.map +1 -1
- package/dist/layout/Workspace.regions.d.ts +4 -1
- package/dist/layout/Workspace.regions.d.ts.map +1 -1
- package/dist/layout/Workspace.regions.js +10 -6
- package/dist/layout/Workspace.regions.js.map +1 -1
- package/dist/lib/duration.cjs +20 -0
- package/dist/lib/duration.cjs.map +1 -1
- package/dist/lib/duration.d.ts +8 -0
- package/dist/lib/duration.d.ts.map +1 -1
- package/dist/lib/duration.js +19 -1
- package/dist/lib/duration.js.map +1 -1
- package/dist/monaco/MonacoEditor.cjs +34 -30
- package/dist/monaco/MonacoEditor.cjs.map +1 -1
- package/dist/monaco/MonacoEditor.d.ts.map +1 -1
- package/dist/monaco/MonacoEditor.js +34 -30
- package/dist/monaco/MonacoEditor.js.map +1 -1
- package/dist/overlay/ConfirmDialog.cjs +5 -2
- package/dist/overlay/ConfirmDialog.cjs.map +1 -1
- package/dist/overlay/ConfirmDialog.d.ts +14 -2
- package/dist/overlay/ConfirmDialog.d.ts.map +1 -1
- package/dist/overlay/ConfirmDialog.js +5 -2
- package/dist/overlay/ConfirmDialog.js.map +1 -1
- package/dist/profiles/cel/celEditor.cjs +94 -285
- package/dist/profiles/cel/celEditor.cjs.map +1 -1
- package/dist/profiles/cel/celEditor.d.ts +10 -15
- package/dist/profiles/cel/celEditor.d.ts.map +1 -1
- package/dist/profiles/cel/celEditor.js +97 -287
- package/dist/profiles/cel/celEditor.js.map +1 -1
- package/dist/profiles/cel/celExpression.cjs +1 -61
- package/dist/profiles/cel/celExpression.cjs.map +1 -1
- package/dist/profiles/cel/celExpression.d.ts +2 -38
- package/dist/profiles/cel/celExpression.d.ts.map +1 -1
- package/dist/profiles/cel/celExpression.js +2 -58
- package/dist/profiles/cel/celExpression.js.map +1 -1
- package/dist/profiles/cel/celPlayground.cjs +122 -0
- package/dist/profiles/cel/celPlayground.cjs.map +1 -0
- package/dist/profiles/cel/celPlayground.d.ts +43 -0
- package/dist/profiles/cel/celPlayground.d.ts.map +1 -0
- package/dist/profiles/cel/celPlayground.js +118 -0
- package/dist/profiles/cel/celPlayground.js.map +1 -0
- package/dist/profiles/connections/connectionBrowserModel.cjs +2 -2
- package/dist/profiles/connections/connectionBrowserModel.cjs.map +1 -1
- package/dist/profiles/connections/connectionBrowserModel.d.ts +5 -1
- package/dist/profiles/connections/connectionBrowserModel.d.ts.map +1 -1
- package/dist/profiles/connections/connectionBrowserModel.js +2 -2
- package/dist/profiles/connections/connectionBrowserModel.js.map +1 -1
- package/dist/profiles/connections/connectionQueryWorkspace.cjs +2 -1
- package/dist/profiles/connections/connectionQueryWorkspace.cjs.map +1 -1
- package/dist/profiles/connections/connectionQueryWorkspace.d.ts +3 -1
- package/dist/profiles/connections/connectionQueryWorkspace.d.ts.map +1 -1
- package/dist/profiles/connections/connectionQueryWorkspace.js +2 -1
- package/dist/profiles/connections/connectionQueryWorkspace.js.map +1 -1
- package/dist/profiles/editor/UnwrapPreviewList.cjs +90 -0
- package/dist/profiles/editor/UnwrapPreviewList.cjs.map +1 -0
- package/dist/profiles/editor/UnwrapPreviewList.d.ts +7 -0
- package/dist/profiles/editor/UnwrapPreviewList.d.ts.map +1 -0
- package/dist/profiles/editor/UnwrapPreviewList.js +90 -0
- package/dist/profiles/editor/UnwrapPreviewList.js.map +1 -0
- package/dist/profiles/editor/profileCanonicalQuery.cjs +6 -58
- package/dist/profiles/editor/profileCanonicalQuery.cjs.map +1 -1
- package/dist/profiles/editor/profileCanonicalQuery.d.ts +1 -1
- package/dist/profiles/editor/profileCanonicalQuery.d.ts.map +1 -1
- package/dist/profiles/editor/profileCanonicalQuery.js +4 -56
- package/dist/profiles/editor/profileCanonicalQuery.js.map +1 -1
- package/dist/profiles/editor/profileCanonicalTranslate.cjs +48 -0
- package/dist/profiles/editor/profileCanonicalTranslate.cjs.map +1 -0
- package/dist/profiles/editor/profileCanonicalTranslate.d.ts +24 -0
- package/dist/profiles/editor/profileCanonicalTranslate.d.ts.map +1 -0
- package/dist/profiles/editor/profileCanonicalTranslate.js +47 -0
- package/dist/profiles/editor/profileCanonicalTranslate.js.map +1 -0
- package/dist/profiles/editor/profileEditor.cjs +126 -38
- package/dist/profiles/editor/profileEditor.cjs.map +1 -1
- package/dist/profiles/editor/profileEditor.d.ts +5 -1
- package/dist/profiles/editor/profileEditor.d.ts.map +1 -1
- package/dist/profiles/editor/profileEditor.js +127 -39
- package/dist/profiles/editor/profileEditor.js.map +1 -1
- package/dist/profiles/editor/profileEditorModel.cjs +65 -19
- package/dist/profiles/editor/profileEditorModel.cjs.map +1 -1
- package/dist/profiles/editor/profileEditorModel.d.ts +24 -8
- package/dist/profiles/editor/profileEditorModel.d.ts.map +1 -1
- package/dist/profiles/editor/profileEditorModel.js +64 -18
- package/dist/profiles/editor/profileEditorModel.js.map +1 -1
- package/dist/profiles/editor/profileEditorPreview.cjs +129 -29
- package/dist/profiles/editor/profileEditorPreview.cjs.map +1 -1
- package/dist/profiles/editor/profileEditorPreview.d.ts +18 -5
- package/dist/profiles/editor/profileEditorPreview.d.ts.map +1 -1
- package/dist/profiles/editor/profileEditorPreview.js +129 -29
- package/dist/profiles/editor/profileEditorPreview.js.map +1 -1
- package/dist/profiles/editor/profileEditorSections.cjs +137 -88
- package/dist/profiles/editor/profileEditorSections.cjs.map +1 -1
- package/dist/profiles/editor/profileEditorSections.d.ts +18 -2
- package/dist/profiles/editor/profileEditorSections.d.ts.map +1 -1
- package/dist/profiles/editor/profileEditorSections.js +138 -90
- package/dist/profiles/editor/profileEditorSections.js.map +1 -1
- package/dist/profiles/editor/profileMappingPreview.cjs +22 -6
- package/dist/profiles/editor/profileMappingPreview.cjs.map +1 -1
- package/dist/profiles/editor/profileMappingPreview.d.ts +17 -1
- package/dist/profiles/editor/profileMappingPreview.d.ts.map +1 -1
- package/dist/profiles/editor/profileMappingPreview.js +23 -7
- package/dist/profiles/editor/profileMappingPreview.js.map +1 -1
- package/dist/profiles/editor/profileSaveAsDialog.cjs +93 -0
- package/dist/profiles/editor/profileSaveAsDialog.cjs.map +1 -0
- package/dist/profiles/editor/profileSaveAsDialog.d.ts +17 -0
- package/dist/profiles/editor/profileSaveAsDialog.d.ts.map +1 -0
- package/dist/profiles/editor/profileSaveAsDialog.js +93 -0
- package/dist/profiles/editor/profileSaveAsDialog.js.map +1 -0
- package/dist/profiles/editor/profileSourceExtensions.cjs +71 -0
- package/dist/profiles/editor/profileSourceExtensions.cjs.map +1 -0
- package/dist/profiles/editor/profileSourceExtensions.d.ts +26 -0
- package/dist/profiles/editor/profileSourceExtensions.d.ts.map +1 -0
- package/dist/profiles/editor/profileSourceExtensions.js +70 -0
- package/dist/profiles/editor/profileSourceExtensions.js.map +1 -0
- package/dist/profiles/editor/samplePaths.cjs +54 -0
- package/dist/profiles/editor/samplePaths.cjs.map +1 -0
- package/dist/profiles/editor/samplePaths.d.ts +27 -0
- package/dist/profiles/editor/samplePaths.d.ts.map +1 -0
- package/dist/profiles/editor/samplePaths.js +53 -0
- package/dist/profiles/editor/samplePaths.js.map +1 -0
- package/dist/profiles/editor/testSchema.d.ts.map +1 -1
- package/dist/profiles/editor/useUnwrapPreviews.cjs +60 -0
- package/dist/profiles/editor/useUnwrapPreviews.cjs.map +1 -0
- package/dist/profiles/editor/useUnwrapPreviews.d.ts +38 -0
- package/dist/profiles/editor/useUnwrapPreviews.d.ts.map +1 -0
- package/dist/profiles/editor/useUnwrapPreviews.js +60 -0
- package/dist/profiles/editor/useUnwrapPreviews.js.map +1 -0
- package/dist/profiles/elasticsearch/esQueryBuilder.cjs +10 -1
- package/dist/profiles/elasticsearch/esQueryBuilder.cjs.map +1 -1
- package/dist/profiles/elasticsearch/esQueryBuilder.d.ts.map +1 -1
- package/dist/profiles/elasticsearch/esQueryBuilder.js +11 -2
- package/dist/profiles/elasticsearch/esQueryBuilder.js.map +1 -1
- package/dist/profiles/elasticsearch/esQueryBuilderForm.cjs +38 -0
- package/dist/profiles/elasticsearch/esQueryBuilderForm.cjs.map +1 -1
- package/dist/profiles/elasticsearch/esQueryBuilderForm.d.ts +17 -0
- package/dist/profiles/elasticsearch/esQueryBuilderForm.d.ts.map +1 -1
- package/dist/profiles/elasticsearch/esQueryBuilderForm.js +37 -1
- package/dist/profiles/elasticsearch/esQueryBuilderForm.js.map +1 -1
- package/dist/profiles/elasticsearch/esQueryConditionRow.cjs +4 -3
- package/dist/profiles/elasticsearch/esQueryConditionRow.cjs.map +1 -1
- package/dist/profiles/elasticsearch/esQueryConditionRow.d.ts.map +1 -1
- package/dist/profiles/elasticsearch/esQueryConditionRow.js +4 -3
- package/dist/profiles/elasticsearch/esQueryConditionRow.js.map +1 -1
- package/dist/profiles/elasticsearch/esQueryOperators.cjs.map +1 -1
- package/dist/profiles/elasticsearch/esQueryOperators.d.ts +8 -0
- package/dist/profiles/elasticsearch/esQueryOperators.d.ts.map +1 -1
- package/dist/profiles/elasticsearch/esQueryOperators.js.map +1 -1
- package/dist/profiles/fields/profileFieldControls.cjs +3 -2
- package/dist/profiles/fields/profileFieldControls.cjs.map +1 -1
- package/dist/profiles/fields/profileFieldControls.d.ts +3 -1
- package/dist/profiles/fields/profileFieldControls.d.ts.map +1 -1
- package/dist/profiles/fields/profileFieldControls.js +3 -2
- package/dist/profiles/fields/profileFieldControls.js.map +1 -1
- package/dist/profiles/fields/profileFieldEditor.cjs +98 -185
- package/dist/profiles/fields/profileFieldEditor.cjs.map +1 -1
- package/dist/profiles/fields/profileFieldEditor.d.ts +11 -3
- package/dist/profiles/fields/profileFieldEditor.d.ts.map +1 -1
- package/dist/profiles/fields/profileFieldEditor.js +99 -186
- package/dist/profiles/fields/profileFieldEditor.js.map +1 -1
- package/dist/profiles/fields/profileFieldFilterEditor.cjs +115 -81
- package/dist/profiles/fields/profileFieldFilterEditor.cjs.map +1 -1
- package/dist/profiles/fields/profileFieldFilterEditor.d.ts.map +1 -1
- package/dist/profiles/fields/profileFieldFilterEditor.js +116 -82
- package/dist/profiles/fields/profileFieldFilterEditor.js.map +1 -1
- package/dist/profiles/fields/profileFieldIcons.cjs +2 -0
- package/dist/profiles/fields/profileFieldIcons.cjs.map +1 -1
- package/dist/profiles/fields/profileFieldIcons.d.ts.map +1 -1
- package/dist/profiles/fields/profileFieldIcons.js +2 -0
- package/dist/profiles/fields/profileFieldIcons.js.map +1 -1
- package/dist/profiles/fields/profileFieldList.cjs +23 -1
- package/dist/profiles/fields/profileFieldList.cjs.map +1 -1
- package/dist/profiles/fields/profileFieldList.d.ts.map +1 -1
- package/dist/profiles/fields/profileFieldList.js +23 -1
- package/dist/profiles/fields/profileFieldList.js.map +1 -1
- package/dist/profiles/fields/profileFieldPreview.cjs +111 -0
- package/dist/profiles/fields/profileFieldPreview.cjs.map +1 -0
- package/dist/profiles/fields/profileFieldPreview.d.ts +25 -0
- package/dist/profiles/fields/profileFieldPreview.d.ts.map +1 -0
- package/dist/profiles/fields/profileFieldPreview.js +110 -0
- package/dist/profiles/fields/profileFieldPreview.js.map +1 -0
- package/dist/profiles/fields/profileFieldSample.cjs +182 -0
- package/dist/profiles/fields/profileFieldSample.cjs.map +1 -0
- package/dist/profiles/fields/profileFieldSample.d.ts +35 -0
- package/dist/profiles/fields/profileFieldSample.d.ts.map +1 -0
- package/dist/profiles/fields/profileFieldSample.js +180 -0
- package/dist/profiles/fields/profileFieldSample.js.map +1 -0
- package/dist/profiles/fields/profileFieldTypeField.cjs +104 -0
- package/dist/profiles/fields/profileFieldTypeField.cjs.map +1 -0
- package/dist/profiles/fields/profileFieldTypeField.d.ts +17 -0
- package/dist/profiles/fields/profileFieldTypeField.d.ts.map +1 -0
- package/dist/profiles/fields/profileFieldTypeField.js +104 -0
- package/dist/profiles/fields/profileFieldTypeField.js.map +1 -0
- package/dist/profiles/fields/profileFieldTypes.cjs +1 -0
- package/dist/profiles/fields/profileFieldTypes.cjs.map +1 -1
- package/dist/profiles/fields/profileFieldTypes.d.ts +1 -1
- package/dist/profiles/fields/profileFieldTypes.d.ts.map +1 -1
- package/dist/profiles/fields/profileFieldTypes.js +1 -0
- package/dist/profiles/fields/profileFieldTypes.js.map +1 -1
- package/dist/profiles/fields/profileFieldValueEditor.cjs +298 -0
- package/dist/profiles/fields/profileFieldValueEditor.cjs.map +1 -0
- package/dist/profiles/fields/profileFieldValueEditor.d.ts +18 -0
- package/dist/profiles/fields/profileFieldValueEditor.d.ts.map +1 -0
- package/dist/profiles/fields/profileFieldValueEditor.js +298 -0
- package/dist/profiles/fields/profileFieldValueEditor.js.map +1 -0
- package/dist/profiles/fields/profileFieldValueMode.cjs +61 -0
- package/dist/profiles/fields/profileFieldValueMode.cjs.map +1 -0
- package/dist/profiles/fields/profileFieldValueMode.d.ts +34 -0
- package/dist/profiles/fields/profileFieldValueMode.d.ts.map +1 -0
- package/dist/profiles/fields/profileFieldValueMode.js +59 -0
- package/dist/profiles/fields/profileFieldValueMode.js.map +1 -0
- package/dist/profiles/processor/processorConfig.cjs +79 -79
- package/dist/profiles/processor/processorConfig.cjs.map +1 -1
- package/dist/profiles/processor/processorConfig.d.ts +30 -3
- package/dist/profiles/processor/processorConfig.d.ts.map +1 -1
- package/dist/profiles/processor/processorConfig.js +78 -78
- package/dist/profiles/processor/processorConfig.js.map +1 -1
- package/dist/profiles/processor/processorPipeline.cjs +24 -8
- package/dist/profiles/processor/processorPipeline.cjs.map +1 -1
- package/dist/profiles/processor/processorPipeline.d.ts +3 -3
- package/dist/profiles/processor/processorPipeline.d.ts.map +1 -1
- package/dist/profiles/processor/processorPipeline.js +25 -9
- package/dist/profiles/processor/processorPipeline.js.map +1 -1
- package/dist/profiles/processor/processorPipelineEditor.cjs +38 -94
- package/dist/profiles/processor/processorPipelineEditor.cjs.map +1 -1
- package/dist/profiles/processor/processorPipelineEditor.d.ts +3 -3
- package/dist/profiles/processor/processorPipelineEditor.d.ts.map +1 -1
- package/dist/profiles/processor/processorPipelineEditor.js +39 -95
- package/dist/profiles/processor/processorPipelineEditor.js.map +1 -1
- package/dist/profiles/processor/processorPipelineExtension.cjs +3 -2
- package/dist/profiles/processor/processorPipelineExtension.cjs.map +1 -1
- package/dist/profiles/processor/processorPipelineExtension.d.ts.map +1 -1
- package/dist/profiles/processor/processorPipelineExtension.js +3 -2
- package/dist/profiles/processor/processorPipelineExtension.js.map +1 -1
- package/dist/profiles/query/profileSampleFilterLookup.cjs.map +1 -1
- package/dist/profiles/query/profileSampleFilterLookup.d.ts +6 -3
- package/dist/profiles/query/profileSampleFilterLookup.d.ts.map +1 -1
- package/dist/profiles/query/profileSampleFilterLookup.js.map +1 -1
- package/dist/profiles/wizard/profileWizardModel.cjs +10 -1
- package/dist/profiles/wizard/profileWizardModel.cjs.map +1 -1
- package/dist/profiles/wizard/profileWizardModel.d.ts +6 -0
- package/dist/profiles/wizard/profileWizardModel.d.ts.map +1 -1
- package/dist/profiles/wizard/profileWizardModel.js +10 -1
- package/dist/profiles/wizard/profileWizardModel.js.map +1 -1
- package/dist/profiles/wizard/profileWizardQueryStep.cjs +10 -22
- package/dist/profiles/wizard/profileWizardQueryStep.cjs.map +1 -1
- package/dist/profiles/wizard/profileWizardQueryStep.d.ts +8 -1
- package/dist/profiles/wizard/profileWizardQueryStep.d.ts.map +1 -1
- package/dist/profiles/wizard/profileWizardQueryStep.js +11 -23
- package/dist/profiles/wizard/profileWizardQueryStep.js.map +1 -1
- package/dist/profiles/wizard/useProfileInspection.cjs +39 -0
- package/dist/profiles/wizard/useProfileInspection.cjs.map +1 -0
- package/dist/profiles/wizard/useProfileInspection.d.ts +21 -0
- package/dist/profiles/wizard/useProfileInspection.d.ts.map +1 -0
- package/dist/profiles/wizard/useProfileInspection.js +39 -0
- package/dist/profiles/wizard/useProfileInspection.js.map +1 -0
- package/dist/profiles.cjs +9 -11
- package/dist/profiles.js +8 -8
- package/dist/rpc/EntityExplorerApp.cjs +7 -3
- package/dist/rpc/EntityExplorerApp.cjs.map +1 -1
- package/dist/rpc/EntityExplorerApp.d.ts +16 -1
- package/dist/rpc/EntityExplorerApp.d.ts.map +1 -1
- package/dist/rpc/EntityExplorerApp.js +7 -3
- package/dist/rpc/EntityExplorerApp.js.map +1 -1
- package/dist/rpc/InlineError.cjs +30 -10
- package/dist/rpc/InlineError.cjs.map +1 -1
- package/dist/rpc/InlineError.d.ts +10 -1
- package/dist/rpc/InlineError.d.ts.map +1 -1
- package/dist/rpc/InlineError.js +30 -10
- package/dist/rpc/InlineError.js.map +1 -1
- package/dist/rpc/SchemaActionForm.cjs +9 -6
- package/dist/rpc/SchemaActionForm.cjs.map +1 -1
- package/dist/rpc/SchemaActionForm.d.ts.map +1 -1
- package/dist/rpc/SchemaActionForm.js +9 -6
- package/dist/rpc/SchemaActionForm.js.map +1 -1
- package/dist/rpc/SessionHeader.cjs +117 -111
- package/dist/rpc/SessionHeader.cjs.map +1 -1
- package/dist/rpc/SessionHeader.d.ts +3 -1
- package/dist/rpc/SessionHeader.d.ts.map +1 -1
- package/dist/rpc/SessionHeader.js +117 -111
- package/dist/rpc/SessionHeader.js.map +1 -1
- package/dist/rpc/formMetadata.cjs +2 -6
- package/dist/rpc/formMetadata.cjs.map +1 -1
- package/dist/rpc/formMetadata.d.ts.map +1 -1
- package/dist/rpc/formMetadata.js +1 -5
- package/dist/rpc/formMetadata.js.map +1 -1
- package/dist/rpc/surfaceNav.cjs +5 -0
- package/dist/rpc/surfaceNav.cjs.map +1 -1
- package/dist/rpc/surfaceNav.d.ts.map +1 -1
- package/dist/rpc/surfaceNav.js +5 -0
- package/dist/rpc/surfaceNav.js.map +1 -1
- package/dist/runtime/barrels.json +8944 -8877
- package/dist/runtime/importmap.json +2168 -2129
- package/dist/styles.css +1 -1
- package/package.json +1 -1
- package/dist/data/ai/runtime-profiles/ResolutionInspector.cjs +0 -91
- package/dist/data/ai/runtime-profiles/ResolutionInspector.cjs.map +0 -1
- package/dist/data/ai/runtime-profiles/ResolutionInspector.d.ts +0 -7
- package/dist/data/ai/runtime-profiles/ResolutionInspector.d.ts.map +0 -1
- package/dist/data/ai/runtime-profiles/ResolutionInspector.js +0 -91
- package/dist/data/ai/runtime-profiles/ResolutionInspector.js.map +0 -1
- package/dist/profiles/cel/celEditorResults.cjs +0 -158
- package/dist/profiles/cel/celEditorResults.cjs.map +0 -1
- package/dist/profiles/cel/celEditorResults.d.ts +0 -37
- package/dist/profiles/cel/celEditorResults.d.ts.map +0 -1
- package/dist/profiles/cel/celEditorResults.js +0 -156
- package/dist/profiles/cel/celEditorResults.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"profileEditorModel.cjs","names":["profileSchema","validateProfileParams","stripSurroundingChars"],"sources":["../../../src/profiles/editor/profileEditorModel.ts"],"sourcesContent":["import type { JsonSchemaObject } from \"../../components/json-schema-form-types\";\nimport { stripSurroundingChars } from \"../../lib/string\";\nimport { profileSchema } from \"../profileApi\";\nimport { validateProfileParams } from \"../fields/profileParamModel\";\nimport type {\n ProfileColumn,\n ProfileWizardDraft,\n} from \"../wizard/profileWizardModel\";\n\n/**\n * The schema the raw-YAML editor validates against. It is read through the\n * configured accessor rather than bundled: the document is generated from\n * commons-db's Go types and served by the host, so a copy here would drift.\n */\nexport function profileEditorSchema(): JsonSchemaObject {\n return profileSchema();\n}\n\nexport const profileEditorSections = [\n { id: \"spans\", label: \"Spans\", hint: \"Canonical fields and attributes\" },\n { id: \"general\", label: \"General\", hint: \"Name, namespace, render mode\" },\n {\n id: \"source\",\n label: \"Source & Query\",\n hint: \"Provider, connection, sample\",\n },\n { id: \"columns\", label: \"Columns\", hint: \"Fields, labels, expressions\" },\n { id: \"parameters\", label: \"Parameters\", hint: \"Named query inputs\" },\n {\n id: \"processors\",\n label: \"Processors\",\n hint: \"Ordered post-query transformations\",\n },\n { id: \"raw\", label: \"Raw YAML\", hint: \"Edit the document directly\" },\n] as const;\n\nexport type ProfileEditorSection = (typeof profileEditorSections)[number][\"id\"];\n\nexport const profileGeneralOptionKeys = [\n \"imports\",\n \"aliases\",\n \"output\",\n \"ignore\",\n];\nexport const profileProcessorKeys = [\"processors\"];\n\nexport type ProfileSectionStatus = {\n badge?: string | undefined;\n attention?: boolean | undefined;\n};\n\n/**\n * Rail annotations per section. The route replaced tabs with a vertical rail,\n * which has room to say how much each section holds — so a stale sample or an\n * empty column set is visible without opening the section.\n */\nexport function profileEditorSectionStatus({\n draft,\n availableColumns,\n sampleStale,\n}: {\n draft: ProfileWizardDraft;\n availableColumns: number;\n sampleStale: boolean;\n}): Record<ProfileEditorSection, ProfileSectionStatus> {\n const configured = draft.columns?.length ?? 0;\n const params = Array.isArray(draft.params) ? draft.params.length : 0;\n const processors = Array.isArray(draft.processors)\n ? draft.processors.length\n : 0;\n return {\n spans: {},\n general: { attention: !draft.profile?.trim() },\n source: {\n badge: draft.provider?.type || undefined,\n attention: sampleStale || !draft.provider?.type?.trim(),\n },\n columns: {\n badge: `${configured}/${Math.max(availableColumns, configured)}`,\n attention: configured === 0,\n },\n parameters: { badge: params ? String(params) : undefined },\n processors: { badge: processors ? String(processors) : undefined },\n raw: {},\n };\n}\n\nexport function cloneProfileDraft(\n value: Record<string, unknown>,\n): ProfileWizardDraft {\n return structuredClone(value) as ProfileWizardDraft;\n}\n\nexport function profileSchemaProjection(keys: string[]): JsonSchemaObject {\n const properties = Object.fromEntries(\n keys.flatMap((key) => {\n const property = profileSchema().properties?.[key];\n return property ? [[key, property]] : [];\n }),\n );\n return {\n type: \"object\",\n properties,\n required: (profileSchema().required ?? []).filter((key) =>\n keys.includes(key),\n ),\n };\n}\n\n// An option rendered with the workload-URL selector is an inline address used\n// instead of a saved connection, so it belongs beside the connection picker.\nconst INLINE_CONNECTION_COMPONENT = \"k8s-url-selector\";\n\n/**\n * A provider's options schema. `part` splits it: \"connection\" keeps only the\n * inline-address options that stand in for a saved connection, \"query\" keeps\n * everything else.\n */\nexport function providerOptionsSchema(\n providerType: string,\n part: \"connection\" | \"query\",\n): JsonSchemaObject {\n const definition = profileSchema().$defs?.[providerType];\n const options = definition?.properties?.options;\n if (!options || options.type !== \"object\") {\n return part === \"connection\"\n ? { type: \"object\", properties: {} }\n : { type: \"object\", properties: {}, additionalProperties: true };\n }\n const schema = structuredClone(options) as JsonSchemaObject;\n schema.properties = Object.fromEntries(\n Object.entries(schema.properties ?? {}).filter(\n ([, field]) =>\n (field[\"x-clicky-component\"] === INLINE_CONNECTION_COMPONENT) ===\n (part === \"connection\"),\n ),\n );\n if (schema.required)\n schema.required = schema.required.filter((key) => key in schema.properties!);\n return schema;\n}\n\nexport function providerConnectionSchema(): JsonSchemaObject {\n const connection =\n profileSchema().properties?.provider?.properties?.connection;\n if (!connection) {\n throw new Error(\"profile schema is missing provider.connection\");\n }\n return { type: \"object\", properties: { connection } };\n}\n\nexport function providerTypes(): string[] {\n const values = profileSchema().properties?.provider?.properties?.type?.enum;\n return Array.isArray(values)\n ? values.filter((value): value is string => typeof value === \"string\")\n : [];\n}\n\nexport function mergeProfileProjection(\n draft: ProfileWizardDraft,\n keys: string[],\n next: Record<string, unknown>,\n): ProfileWizardDraft {\n const merged = { ...draft };\n for (const key of keys) delete merged[key];\n for (const key of keys) {\n if (Object.prototype.hasOwnProperty.call(next, key))\n merged[key] = next[key];\n }\n return merged;\n}\n\nexport function mergeSampledProfileColumns(\n configured: ProfileColumn[],\n sampled: ProfileColumn[],\n): ProfileColumn[] {\n const configuredNames = new Set(configured.map((column) => column.name));\n return [\n ...configured.map((column) => ({ ...column })),\n ...sampled\n .filter((column) => !configuredNames.has(column.name))\n .map((column) => ({ ...column })),\n ];\n}\n\nexport function resetProfileColumns(\n draft: ProfileWizardDraft,\n sampled: ProfileColumn[],\n): ProfileWizardDraft {\n if (sampled.length === 0) {\n throw new Error(\"Cannot reset profile columns without sampled columns\");\n }\n return { ...draft, columns: structuredClone(sampled) };\n}\n\nexport function profileColumnResetState({\n providerType,\n sampledColumnCount,\n sampleStale,\n}: {\n providerType: string;\n sampledColumnCount: number;\n sampleStale: boolean;\n}) {\n if (providerType !== \"opensearch\") {\n return { visible: false, disabled: true, title: \"\" };\n }\n if (sampledColumnCount === 0) {\n return {\n visible: true,\n disabled: true,\n title: \"Run a sample before resetting columns\",\n };\n }\n if (sampleStale) {\n return {\n visible: true,\n disabled: true,\n title: \"Run another sample for the current source and query\",\n };\n }\n return {\n visible: true,\n disabled: false,\n title: \"Replace configured columns with the latest sample\",\n };\n}\n\nexport function profileSampleSignature(draft: ProfileWizardDraft): string {\n return JSON.stringify({\n provider: draft.provider ?? {},\n query: draft.query ?? \"\",\n search:draft.search,\n namespace: draft.namespace,\n imports: draft.imports,\n params: draft.params,\n processors: draft.processors,\n });\n}\n\nexport function validateProfileEditorDraft(\n draft: ProfileWizardDraft,\n): string | null {\n if (!draft.profile?.trim()) return \"Profile name is required\";\n if (!draft.provider?.type?.trim()) return \"Provider type is required\";\n const names = new Set<string>();\n for (const column of draft.columns ?? []) {\n const name = column.name.trim();\n if (!name) return \"Every column needs a name\";\n if (names.has(name)) return `Column name \"${name}\" is duplicated`;\n names.add(name);\n }\n return validateProfileParams(draft.params, draft.provider?.type);\n}\n\nexport function profileUpdateConflictTarget(error: string): string | null {\n if (!error.includes(\"PROFILE_NAME_CONFLICT\")) return null;\n return error.match(/existing profile \"([^\"]+)\"/)?.[1] ?? null;\n}\n\nexport function profileRoute(name: string): string {\n const slug = stripSurroundingChars(\n Array.from(name.trim().toLowerCase())\n .map((character) =>\n /[a-z0-9]/.test(character)\n ? character\n : /[ ._/-]/.test(character)\n ? \"-\"\n : \"\",\n )\n .join(\"\"),\n \"-\",\n );\n return `/profile-${slug}`;\n}\n\n/** Deep-linkable editor route for a profile surface (`profile-os2`). */\nexport function profileEditRoute(surfaceKey: string): string {\n return `/${surfaceKey}/edit`;\n}\n\n/** Surface key an edit route addresses, or null when the path is not one. */\nexport function profileEditSurfaceKey(pathname: string): string | null {\n return pathname.match(/^\\/(profile-[^/]+)\\/edit\\/?$/)?.[1] ?? null;\n}\n"],"mappings":";;;;;;;;;AAcA,SAAgB,sBAAwC;CACtD,OAAOA,mBAAAA,cAAc;AACvB;AAEA,IAAa,wBAAwB;CACnC;EAAE,IAAI;EAAS,OAAO;EAAS,MAAM;CAAkC;CACvE;EAAE,IAAI;EAAW,OAAO;EAAW,MAAM;CAA+B;CACxE;EACE,IAAI;EACJ,OAAO;EACP,MAAM;CACR;CACA;EAAE,IAAI;EAAW,OAAO;EAAW,MAAM;CAA8B;CACvE;EAAE,IAAI;EAAc,OAAO;EAAc,MAAM;CAAqB;CACpE;EACE,IAAI;EACJ,OAAO;EACP,MAAM;CACR;CACA;EAAE,IAAI;EAAO,OAAO;EAAY,MAAM;CAA6B;AACrE;AAIA,IAAa,2BAA2B;CACtC;CACA;CACA;CACA;AACF;AACA,IAAa,uBAAuB,CAAC,YAAY;;;;;;AAYjD,SAAgB,2BAA2B,EACzC,OACA,kBACA,eAKqD;CACrD,MAAM,aAAa,MAAM,SAAS,UAAU;CAC5C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AAK,KAAK,KAAK,CAAC,CAAC,YAAY,CAAC,CAAC,CAClC,KAAK,cACJ,WAAW,KAAK,SAAS,IACrB,YACA,UAAU,KAAK,SAAS,IACtB,MACA,EACR,CAAC,CACA,KAAK,EAAE,GACV,GAEiB;AACrB;;AAGA,SAAgB,iBAAiB,YAA4B;CAC3D,OAAO,IAAI,WAAW;AACxB;;AAGA,SAAgB,sBAAsB,UAAiC;CACrE,OAAO,SAAS,MAAM,8BAA8B,CAAC,GAAG,MAAM;AAChE"}
|
|
1
|
+
{"version":3,"file":"profileEditorModel.cjs","names":["profileSchema","validateProfileParams","stripSurroundingChars"],"sources":["../../../src/profiles/editor/profileEditorModel.ts"],"sourcesContent":["import type {\n JsonSchemaObject,\n JsonSchemaProperty,\n} from \"../../components/json-schema-form-types\";\nimport { stripSurroundingChars } from \"../../lib/string\";\nimport { profileSchema } from \"../profileApi\";\nimport { validateProfileParams } from \"../fields/profileParamModel\";\nimport type {\n ProfileColumn,\n ProfileWizardDraft,\n} from \"../wizard/profileWizardModel\";\n\n/**\n * The schema the raw-YAML editor validates against. It is read through the\n * configured accessor rather than bundled: the document is generated from\n * commons-db's Go types and served by the host, so a copy here would drift.\n */\nexport function profileEditorSchema(): JsonSchemaObject {\n return profileSchema();\n}\n\nexport const profileEditorSections = [\n { id: \"spans\", label: \"Spans\", hint: \"Canonical fields and attributes\" },\n { id: \"general\", label: \"General\", hint: \"Name, source, options\" },\n {\n id: \"source\",\n label: \"Query\",\n hint: \"Query, conditions, sample\",\n },\n { id: \"columns\", label: \"Columns\", hint: \"Fields, labels, expressions\" },\n { id: \"parameters\", label: \"Parameters\", hint: \"Named query inputs\" },\n {\n id: \"processors\",\n label: \"Processors\",\n hint: \"Ordered post-query transformations\",\n },\n { id: \"raw\", label: \"Raw YAML\", hint: \"Edit the document directly\" },\n] as const;\n\nexport type ProfileEditorSection = (typeof profileEditorSections)[number][\"id\"];\n\nexport const profileGeneralOptionKeys = [\n \"imports\",\n \"aliases\",\n \"output\",\n \"ignore\",\n];\nexport const profileProcessorKeys = [\"processors\"];\n\nexport type ProfileSectionStatus = {\n badge?: string | undefined;\n attention?: boolean | undefined;\n};\n\n/**\n * Rail annotations per section. The route replaced tabs with a vertical rail,\n * which has room to say how much each section holds — so a stale sample or an\n * empty column set is visible without opening the section.\n */\nexport function profileEditorSectionStatus({\n draft,\n availableColumns,\n sampleStale,\n}: {\n draft: ProfileWizardDraft;\n availableColumns: number;\n sampleStale: boolean;\n}): Record<ProfileEditorSection, ProfileSectionStatus> {\n const configured = draft.columns?.length ?? 0;\n const params = Array.isArray(draft.params) ? draft.params.length : 0;\n const processors = Array.isArray(draft.processors)\n ? draft.processors.length\n : 0;\n return {\n spans: {},\n // The source lives in General, so it carries the provider and its absence.\n general: {\n badge: draft.provider?.type || undefined,\n attention: !draft.profile?.trim() || !draft.provider?.type?.trim(),\n },\n source: { attention: sampleStale },\n columns: {\n badge: `${configured}/${Math.max(availableColumns, configured)}`,\n attention: configured === 0,\n },\n parameters: { badge: params ? String(params) : undefined },\n processors: { badge: processors ? String(processors) : undefined },\n raw: {},\n };\n}\n\nexport function cloneProfileDraft(\n value: Record<string, unknown>,\n): ProfileWizardDraft {\n return structuredClone(value) as ProfileWizardDraft;\n}\n\nexport function profileSchemaProjection(keys: string[]): JsonSchemaObject {\n const properties = Object.fromEntries(\n keys.flatMap((key) => {\n const property = profileSchema().properties?.[key];\n return property ? [[key, property]] : [];\n }),\n );\n return {\n type: \"object\",\n properties,\n required: (profileSchema().required ?? []).filter((key) =>\n keys.includes(key),\n ),\n };\n}\n\n// An option rendered with the workload-URL selector is an inline address used\n// instead of a saved connection, so it belongs beside the connection picker.\nconst INLINE_CONNECTION_COMPONENT = \"k8s-url-selector\";\n\n// An option the schema places in the Source panel: it describes the documents\n// the provider reads (their format, which fields hold a span's identity), not\n// the query it runs.\nconst SOURCE_SECTION = \"source\";\n\nfunction belongsToSource(field: JsonSchemaProperty): boolean {\n return (\n field[\"x-clicky-component\"] === INLINE_CONNECTION_COMPONENT ||\n field[\"x-clicky-section\"] === SOURCE_SECTION\n );\n}\n\n/**\n * A provider's options schema. `part` splits it: \"connection\" keeps the options\n * the Source panel shows — inline addresses that stand in for a saved\n * connection, and options marked `x-clicky-section: source` — and \"query\"\n * keeps everything else.\n */\nexport function providerOptionsSchema(\n providerType: string,\n part: \"connection\" | \"query\",\n): JsonSchemaObject {\n const definition = profileSchema().$defs?.[providerType];\n const options = definition?.properties?.options;\n if (!options || options.type !== \"object\") {\n return part === \"connection\"\n ? { type: \"object\", properties: {} }\n : { type: \"object\", properties: {}, additionalProperties: true };\n }\n const schema = structuredClone(options) as JsonSchemaObject;\n schema.properties = Object.fromEntries(\n Object.entries(schema.properties ?? {}).filter(\n ([, field]) => belongsToSource(field) === (part === \"connection\"),\n ),\n );\n if (schema.required)\n schema.required = schema.required.filter((key) => key in schema.properties!);\n return schema;\n}\n\n/**\n * The Source section's one flat form: the provider type, the saved connection\n * and the provider's inline connection options (address and friends). They are\n * one schema so they share a single label/value grid, which is what makes the\n * section a single inline column rather than two forms with misaligned labels.\n */\nexport function providerSourceSchema(\n inlineConnection: JsonSchemaObject,\n): JsonSchemaObject {\n const provider = profileSchema().properties?.provider?.properties;\n if (!provider?.type) {\n throw new Error(\"profile schema is missing provider.type\");\n }\n if (!provider.connection) {\n throw new Error(\"profile schema is missing provider.connection\");\n }\n const inline = inlineConnection.properties ?? {};\n const clash = Object.keys(inline).filter(\n (key) => key === \"type\" || key === \"connection\",\n );\n if (clash.length > 0) {\n throw new Error(\n `inline connection options collide with the provider source fields: ${clash.join(\", \")}`,\n );\n }\n return {\n type: \"object\",\n required: [\"type\", ...(inlineConnection.required ?? [])],\n // The provider and its connection lead, ahead of any option that carries\n // its own order (the OpenTelemetry document fields do).\n properties: {\n type: { ...provider.type, title: \"Provider type\", \"x-clicky-order\": 0 },\n connection: { ...provider.connection, \"x-clicky-order\": 1 },\n ...inline,\n },\n };\n}\n\n/**\n * Folds an edit of the Source form back into the draft's provider. Only what\n * actually changed is written, so editing one field never rewrites another and\n * the provider keeps every key the form does not render.\n */\nexport function applyProviderSourceEdit({\n draft,\n next,\n inlineKeys,\n}: {\n draft: ProfileWizardDraft;\n next: Record<string, unknown>;\n inlineKeys: string[];\n}): ProfileWizardDraft {\n if (typeof next.type !== \"string\") {\n throw new Error(\"provider.type must be a string\");\n }\n if (typeof next.connection !== \"string\") {\n throw new Error(\"provider.connection must be a string\");\n }\n const current = draft.provider?.options ?? {};\n const edited = inlineKeys.filter(\n (key) =>\n key in next && JSON.stringify(next[key]) !== JSON.stringify(current[key]),\n );\n return {\n ...draft,\n provider: {\n ...draft.provider,\n ...(next.type !== (draft.provider?.type ?? \"\") ? { type: next.type } : {}),\n ...(next.connection !== (draft.provider?.connection ?? \"\")\n ? { connection: next.connection }\n : {}),\n ...(edited.length > 0\n ? {\n options: {\n ...current,\n ...Object.fromEntries(edited.map((key) => [key, next[key]])),\n },\n }\n : {}),\n },\n };\n}\n\nexport function mergeProfileProjection(\n draft: ProfileWizardDraft,\n keys: string[],\n next: Record<string, unknown>,\n): ProfileWizardDraft {\n const merged = { ...draft };\n for (const key of keys) delete merged[key];\n for (const key of keys) {\n if (Object.prototype.hasOwnProperty.call(next, key))\n merged[key] = next[key];\n }\n return merged;\n}\n\nexport function mergeSampledProfileColumns(\n configured: ProfileColumn[],\n sampled: ProfileColumn[],\n): ProfileColumn[] {\n const configuredNames = new Set(configured.map((column) => column.name));\n return [\n ...configured.map((column) => ({ ...column })),\n ...sampled\n .filter((column) => !configuredNames.has(column.name))\n .map((column) => ({ ...column })),\n ];\n}\n\nexport function resetProfileColumns(\n draft: ProfileWizardDraft,\n sampled: ProfileColumn[],\n): ProfileWizardDraft {\n if (sampled.length === 0) {\n throw new Error(\"Cannot reset profile columns without sampled columns\");\n }\n return { ...draft, columns: structuredClone(sampled) };\n}\n\nexport function profileColumnResetState({\n providerType,\n sampledColumnCount,\n sampleStale,\n}: {\n providerType: string;\n sampledColumnCount: number;\n sampleStale: boolean;\n}) {\n if (providerType !== \"opensearch\") {\n return { visible: false, disabled: true, title: \"\" };\n }\n if (sampledColumnCount === 0) {\n return {\n visible: true,\n disabled: true,\n title: \"Run a sample before resetting columns\",\n };\n }\n if (sampleStale) {\n return {\n visible: true,\n disabled: true,\n title: \"Run another sample for the current source and query\",\n };\n }\n return {\n visible: true,\n disabled: false,\n title: \"Replace configured columns with the latest sample\",\n };\n}\n\nexport function profileSampleSignature(draft: ProfileWizardDraft): string {\n return JSON.stringify({\n provider: draft.provider ?? {},\n query: draft.query ?? \"\",\n search:draft.search,\n namespace: draft.namespace,\n imports: draft.imports,\n params: draft.params,\n processors: draft.processors,\n });\n}\n\nexport function validateProfileEditorDraft(\n draft: ProfileWizardDraft,\n): string | null {\n if (!draft.profile?.trim()) return \"Profile name is required\";\n if (!draft.provider?.type?.trim()) return \"Provider type is required\";\n const names = new Set<string>();\n for (const column of draft.columns ?? []) {\n const name = column.name.trim();\n if (!name) return \"Every column needs a name\";\n if (names.has(name)) return `Column name \"${name}\" is duplicated`;\n names.add(name);\n }\n return validateProfileParams(draft.params, draft.provider?.type);\n}\n\nexport function profileUpdateConflictTarget(error: string): string | null {\n if (!error.includes(\"PROFILE_NAME_CONFLICT\")) return null;\n return error.match(/existing profile \"([^\"]+)\"/)?.[1] ?? null;\n}\n\nexport function profileRoute(name: string): string {\n const slug = stripSurroundingChars(\n Array.from(name.trim().toLowerCase())\n .map((character) =>\n /[a-z0-9]/.test(character)\n ? character\n : /[ ._/-]/.test(character)\n ? \"-\"\n : \"\",\n )\n .join(\"\"),\n \"-\",\n );\n return `/profile-${slug}`;\n}\n\n/** Deep-linkable editor route for a profile surface (`profile-os2`). */\nexport function profileEditRoute(surfaceKey: string): string {\n return `/${surfaceKey}/edit`;\n}\n\n/** Surface key an edit route addresses, or null when the path is not one. */\nexport function profileEditSurfaceKey(pathname: string): string | null {\n return pathname.match(/^\\/(profile-[^/]+)\\/edit\\/?$/)?.[1] ?? null;\n}\n"],"mapp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MAAM,UAAU,MAAM,WAAW,CAAC,GAAG;EACxC,MAAM,OAAO,OAAO,KAAK,KAAK;EAC9B,IAAI,CAAC,MAAM,OAAO;EAClB,IAAI,MAAM,IAAI,IAAI,GAAG,OAAO,gBAAgB,KAAK;EACjD,MAAM,IAAI,IAAI;CAChB;CACA,OAAOC,0BAAAA,sBAAsB,MAAM,QAAQ,MAAM,UAAU,IAAI;AACjE;AAEA,SAAgB,4BAA4B,OAA8B;CACxE,IAAI,CAAC,MAAM,SAAS,uBAAuB,GAAG,OAAO;CACrD,OAAO,MAAM,MAAM,4BAA4B,CAAC,GAAG,MAAM;AAC3D;AAEA,SAAgB,aAAa,MAAsB;CAajD,OAAO,YAZMC,eAAAA,sBACX,MAAM,KAAK,KAAK,KAAK,CAAC,CAAC,YAAY,CAAC,CAAC,CAClC,KAAK,cACJ,WAAW,KAAK,SAAS,IACrB,YACA,UAAU,KAAK,SAAS,IACtB,MACA,EACR,CAAC,CACA,KAAK,EAAE,GACV,GAEiB;AACrB;;AAGA,SAAgB,iBAAiB,YAA4B;CAC3D,OAAO,IAAI,WAAW;AACxB;;AAGA,SAAgB,sBAAsB,UAAiC;CACrE,OAAO,SAAS,MAAM,8BAA8B,CAAC,GAAG,MAAM;AAChE"}
|
|
@@ -13,11 +13,11 @@ export declare const profileEditorSections: readonly [{
|
|
|
13
13
|
}, {
|
|
14
14
|
readonly id: "general";
|
|
15
15
|
readonly label: "General";
|
|
16
|
-
readonly hint: "Name,
|
|
16
|
+
readonly hint: "Name, source, options";
|
|
17
17
|
}, {
|
|
18
18
|
readonly id: "source";
|
|
19
|
-
readonly label: "
|
|
20
|
-
readonly hint: "
|
|
19
|
+
readonly label: "Query";
|
|
20
|
+
readonly hint: "Query, conditions, sample";
|
|
21
21
|
}, {
|
|
22
22
|
readonly id: "columns";
|
|
23
23
|
readonly label: "Columns";
|
|
@@ -55,13 +55,29 @@ export declare function profileEditorSectionStatus({ draft, availableColumns, sa
|
|
|
55
55
|
export declare function cloneProfileDraft(value: Record<string, unknown>): ProfileWizardDraft;
|
|
56
56
|
export declare function profileSchemaProjection(keys: string[]): JsonSchemaObject;
|
|
57
57
|
/**
|
|
58
|
-
* A provider's options schema. `part` splits it: "connection" keeps
|
|
59
|
-
* inline
|
|
60
|
-
*
|
|
58
|
+
* A provider's options schema. `part` splits it: "connection" keeps the options
|
|
59
|
+
* the Source panel shows — inline addresses that stand in for a saved
|
|
60
|
+
* connection, and options marked `x-clicky-section: source` — and "query"
|
|
61
|
+
* keeps everything else.
|
|
61
62
|
*/
|
|
62
63
|
export declare function providerOptionsSchema(providerType: string, part: "connection" | "query"): JsonSchemaObject;
|
|
63
|
-
|
|
64
|
-
|
|
64
|
+
/**
|
|
65
|
+
* The Source section's one flat form: the provider type, the saved connection
|
|
66
|
+
* and the provider's inline connection options (address and friends). They are
|
|
67
|
+
* one schema so they share a single label/value grid, which is what makes the
|
|
68
|
+
* section a single inline column rather than two forms with misaligned labels.
|
|
69
|
+
*/
|
|
70
|
+
export declare function providerSourceSchema(inlineConnection: JsonSchemaObject): JsonSchemaObject;
|
|
71
|
+
/**
|
|
72
|
+
* Folds an edit of the Source form back into the draft's provider. Only what
|
|
73
|
+
* actually changed is written, so editing one field never rewrites another and
|
|
74
|
+
* the provider keeps every key the form does not render.
|
|
75
|
+
*/
|
|
76
|
+
export declare function applyProviderSourceEdit({ draft, next, inlineKeys, }: {
|
|
77
|
+
draft: ProfileWizardDraft;
|
|
78
|
+
next: Record<string, unknown>;
|
|
79
|
+
inlineKeys: string[];
|
|
80
|
+
}): ProfileWizardDraft;
|
|
65
81
|
export declare function mergeProfileProjection(draft: ProfileWizardDraft, keys: string[], next: Record<string, unknown>): ProfileWizardDraft;
|
|
66
82
|
export declare function mergeSampledProfileColumns(configured: ProfileColumn[], sampled: ProfileColumn[]): ProfileColumn[];
|
|
67
83
|
export declare function resetProfileColumns(draft: ProfileWizardDraft, sampled: ProfileColumn[]): ProfileWizardDraft;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"profileEditorModel.d.ts","sourceRoot":"","sources":["../../../src/profiles/editor/profileEditorModel.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"profileEditorModel.d.ts","sourceRoot":"","sources":["../../../src/profiles/editor/profileEditorModel.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,gBAAgB,EAEjB,MAAM,yCAAyC,CAAC;AAIjD,OAAO,KAAK,EACV,aAAa,EACb,kBAAkB,EACnB,MAAM,8BAA8B,CAAC;AAEtC;;;;GAIG;AACH,wBAAgB,mBAAmB,IAAI,gBAAgB,CAEtD;AAED,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAgBxB,CAAC;AAEX,MAAM,MAAM,oBAAoB,GAAG,CAAC,OAAO,qBAAqB,CAAC,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,CAAC;AAEhF,eAAO,MAAM,wBAAwB,UAKpC,CAAC;AACF,eAAO,MAAM,oBAAoB,UAAiB,CAAC;AAEnD,MAAM,MAAM,oBAAoB,GAAG;IACjC,KAAK,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC3B,SAAS,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;CACjC,CAAC;AAEF;;;;GAIG;AACH,wBAAgB,0BAA0B,CAAC,EACzC,KAAK,EACL,gBAAgB,EAChB,WAAW,GACZ,EAAE;IACD,KAAK,EAAE,kBAAkB,CAAC;IAC1B,gBAAgB,EAAE,MAAM,CAAC;IACzB,WAAW,EAAE,OAAO,CAAC;CACtB,GAAG,MAAM,CAAC,oBAAoB,EAAE,oBAAoB,CAAC,CAsBrD;AAED,wBAAgB,iBAAiB,CAC/B,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAC7B,kBAAkB,CAEpB;AAED,wBAAgB,uBAAuB,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,gBAAgB,CAcxE;AAkBD;;;;;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,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAcjD;AAED,wEAAwE;AACxE,wBAAgB,gBAAgB,CAAC,UAAU,EAAE,MAAM,GAAG,MAAM,CAE3D;AAED,6EAA6E;AAC7E,wBAAgB,qBAAqB,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAErE"}
|
|
@@ -19,12 +19,12 @@ var profileEditorSections = [
|
|
|
19
19
|
{
|
|
20
20
|
id: "general",
|
|
21
21
|
label: "General",
|
|
22
|
-
hint: "Name,
|
|
22
|
+
hint: "Name, source, options"
|
|
23
23
|
},
|
|
24
24
|
{
|
|
25
25
|
id: "source",
|
|
26
|
-
label: "
|
|
27
|
-
hint: "
|
|
26
|
+
label: "Query",
|
|
27
|
+
hint: "Query, conditions, sample"
|
|
28
28
|
},
|
|
29
29
|
{
|
|
30
30
|
id: "columns",
|
|
@@ -65,11 +65,11 @@ function profileEditorSectionStatus({ draft, availableColumns, sampleStale }) {
|
|
|
65
65
|
const processors = Array.isArray(draft.processors) ? draft.processors.length : 0;
|
|
66
66
|
return {
|
|
67
67
|
spans: {},
|
|
68
|
-
general: {
|
|
69
|
-
source: {
|
|
68
|
+
general: {
|
|
70
69
|
badge: draft.provider?.type || void 0,
|
|
71
|
-
attention:
|
|
70
|
+
attention: !draft.profile?.trim() || !draft.provider?.type?.trim()
|
|
72
71
|
},
|
|
72
|
+
source: { attention: sampleStale },
|
|
73
73
|
columns: {
|
|
74
74
|
badge: `${configured}/${Math.max(availableColumns, configured)}`,
|
|
75
75
|
attention: configured === 0
|
|
@@ -93,10 +93,15 @@ function profileSchemaProjection(keys) {
|
|
|
93
93
|
};
|
|
94
94
|
}
|
|
95
95
|
var INLINE_CONNECTION_COMPONENT = "k8s-url-selector";
|
|
96
|
+
var SOURCE_SECTION = "source";
|
|
97
|
+
function belongsToSource(field) {
|
|
98
|
+
return field["x-clicky-component"] === INLINE_CONNECTION_COMPONENT || field["x-clicky-section"] === SOURCE_SECTION;
|
|
99
|
+
}
|
|
96
100
|
/**
|
|
97
|
-
* A provider's options schema. `part` splits it: "connection" keeps
|
|
98
|
-
* inline
|
|
99
|
-
*
|
|
101
|
+
* A provider's options schema. `part` splits it: "connection" keeps the options
|
|
102
|
+
* the Source panel shows — inline addresses that stand in for a saved
|
|
103
|
+
* connection, and options marked `x-clicky-section: source` — and "query"
|
|
104
|
+
* keeps everything else.
|
|
100
105
|
*/
|
|
101
106
|
function providerOptionsSchema(providerType, part) {
|
|
102
107
|
const options = (profileSchema().$defs?.[providerType])?.properties?.options;
|
|
@@ -109,21 +114,62 @@ function providerOptionsSchema(providerType, part) {
|
|
|
109
114
|
additionalProperties: true
|
|
110
115
|
};
|
|
111
116
|
const schema = structuredClone(options);
|
|
112
|
-
schema.properties = Object.fromEntries(Object.entries(schema.properties ?? {}).filter(([, field]) => field
|
|
117
|
+
schema.properties = Object.fromEntries(Object.entries(schema.properties ?? {}).filter(([, field]) => belongsToSource(field) === (part === "connection")));
|
|
113
118
|
if (schema.required) schema.required = schema.required.filter((key) => key in schema.properties);
|
|
114
119
|
return schema;
|
|
115
120
|
}
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
121
|
+
/**
|
|
122
|
+
* The Source section's one flat form: the provider type, the saved connection
|
|
123
|
+
* and the provider's inline connection options (address and friends). They are
|
|
124
|
+
* one schema so they share a single label/value grid, which is what makes the
|
|
125
|
+
* section a single inline column rather than two forms with misaligned labels.
|
|
126
|
+
*/
|
|
127
|
+
function providerSourceSchema(inlineConnection) {
|
|
128
|
+
const provider = profileSchema().properties?.provider?.properties;
|
|
129
|
+
if (!provider?.type) throw new Error("profile schema is missing provider.type");
|
|
130
|
+
if (!provider.connection) throw new Error("profile schema is missing provider.connection");
|
|
131
|
+
const inline = inlineConnection.properties ?? {};
|
|
132
|
+
const clash = Object.keys(inline).filter((key) => key === "type" || key === "connection");
|
|
133
|
+
if (clash.length > 0) throw new Error(`inline connection options collide with the provider source fields: ${clash.join(", ")}`);
|
|
119
134
|
return {
|
|
120
135
|
type: "object",
|
|
121
|
-
|
|
136
|
+
required: ["type", ...inlineConnection.required ?? []],
|
|
137
|
+
properties: {
|
|
138
|
+
type: {
|
|
139
|
+
...provider.type,
|
|
140
|
+
title: "Provider type",
|
|
141
|
+
"x-clicky-order": 0
|
|
142
|
+
},
|
|
143
|
+
connection: {
|
|
144
|
+
...provider.connection,
|
|
145
|
+
"x-clicky-order": 1
|
|
146
|
+
},
|
|
147
|
+
...inline
|
|
148
|
+
}
|
|
122
149
|
};
|
|
123
150
|
}
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
151
|
+
/**
|
|
152
|
+
* Folds an edit of the Source form back into the draft's provider. Only what
|
|
153
|
+
* actually changed is written, so editing one field never rewrites another and
|
|
154
|
+
* the provider keeps every key the form does not render.
|
|
155
|
+
*/
|
|
156
|
+
function applyProviderSourceEdit({ draft, next, inlineKeys }) {
|
|
157
|
+
if (typeof next.type !== "string") throw new Error("provider.type must be a string");
|
|
158
|
+
if (typeof next.connection !== "string") throw new Error("provider.connection must be a string");
|
|
159
|
+
const current = draft.provider?.options ?? {};
|
|
160
|
+
const edited = inlineKeys.filter((key) => key in next && JSON.stringify(next[key]) !== JSON.stringify(current[key]));
|
|
161
|
+
return {
|
|
162
|
+
...draft,
|
|
163
|
+
provider: {
|
|
164
|
+
...draft.provider,
|
|
165
|
+
...next.type !== (draft.provider?.type ?? "") ? { type: next.type } : {},
|
|
166
|
+
...next.connection !== (draft.provider?.connection ?? "") ? { connection: next.connection } : {},
|
|
167
|
+
...edited.length > 0 ? { options: {
|
|
168
|
+
...current,
|
|
169
|
+
...Object.fromEntries(edited.map((key) => [key, next[key]]))
|
|
170
|
+
} } : {}
|
|
171
|
+
}
|
|
172
|
+
};
|
|
127
173
|
}
|
|
128
174
|
function mergeProfileProjection(draft, keys, next) {
|
|
129
175
|
const merged = { ...draft };
|
|
@@ -202,6 +248,6 @@ function profileEditRoute(surfaceKey) {
|
|
|
202
248
|
function profileEditSurfaceKey(pathname) {
|
|
203
249
|
return pathname.match(/^\/(profile-[^/]+)\/edit\/?$/)?.[1] ?? null;
|
|
204
250
|
}
|
|
205
|
-
export { cloneProfileDraft, mergeProfileProjection, mergeSampledProfileColumns, profileColumnResetState, profileEditRoute, profileEditSurfaceKey, profileEditorSchema, profileEditorSectionStatus, profileEditorSections, profileGeneralOptionKeys, profileProcessorKeys, profileRoute, profileSampleSignature, profileSchemaProjection, profileUpdateConflictTarget,
|
|
251
|
+
export { applyProviderSourceEdit, cloneProfileDraft, mergeProfileProjection, mergeSampledProfileColumns, profileColumnResetState, profileEditRoute, profileEditSurfaceKey, profileEditorSchema, profileEditorSectionStatus, profileEditorSections, profileGeneralOptionKeys, profileProcessorKeys, profileRoute, profileSampleSignature, profileSchemaProjection, profileUpdateConflictTarget, providerOptionsSchema, providerSourceSchema, resetProfileColumns, validateProfileEditorDraft };
|
|
206
252
|
|
|
207
253
|
//# sourceMappingURL=profileEditorModel.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"profileEditorModel.js","names":[],"sources":["../../../src/profiles/editor/profileEditorModel.ts"],"sourcesContent":["import type { JsonSchemaObject } from \"../../components/json-schema-form-types\";\nimport { stripSurroundingChars } from \"../../lib/string\";\nimport { profileSchema } from \"../profileApi\";\nimport { validateProfileParams } from \"../fields/profileParamModel\";\nimport type {\n ProfileColumn,\n ProfileWizardDraft,\n} from \"../wizard/profileWizardModel\";\n\n/**\n * The schema the raw-YAML editor validates against. It is read through the\n * configured accessor rather than bundled: the document is generated from\n * commons-db's Go types and served by the host, so a copy here would drift.\n */\nexport function profileEditorSchema(): JsonSchemaObject {\n return profileSchema();\n}\n\nexport const profileEditorSections = [\n { id: \"spans\", label: \"Spans\", hint: \"Canonical fields and attributes\" },\n { id: \"general\", label: \"General\", hint: \"Name, namespace, render mode\" },\n {\n id: \"source\",\n label: \"Source & Query\",\n hint: \"Provider, connection, sample\",\n },\n { id: \"columns\", label: \"Columns\", hint: \"Fields, labels, expressions\" },\n { id: \"parameters\", label: \"Parameters\", hint: \"Named query inputs\" },\n {\n id: \"processors\",\n label: \"Processors\",\n hint: \"Ordered post-query transformations\",\n },\n { id: \"raw\", label: \"Raw YAML\", hint: \"Edit the document directly\" },\n] as const;\n\nexport type ProfileEditorSection = (typeof profileEditorSections)[number][\"id\"];\n\nexport const profileGeneralOptionKeys = [\n \"imports\",\n \"aliases\",\n \"output\",\n \"ignore\",\n];\nexport const profileProcessorKeys = [\"processors\"];\n\nexport type ProfileSectionStatus = {\n badge?: string | undefined;\n attention?: boolean | undefined;\n};\n\n/**\n * Rail annotations per section. The route replaced tabs with a vertical rail,\n * which has room to say how much each section holds — so a stale sample or an\n * empty column set is visible without opening the section.\n */\nexport function profileEditorSectionStatus({\n draft,\n availableColumns,\n sampleStale,\n}: {\n draft: ProfileWizardDraft;\n availableColumns: number;\n sampleStale: boolean;\n}): Record<ProfileEditorSection, ProfileSectionStatus> {\n const configured = draft.columns?.length ?? 0;\n const params = Array.isArray(draft.params) ? draft.params.length : 0;\n const processors = Array.isArray(draft.processors)\n ? draft.processors.length\n : 0;\n return {\n spans: {},\n general: { attention: !draft.profile?.trim() },\n source: {\n badge: draft.provider?.type || undefined,\n attention: sampleStale || !draft.provider?.type?.trim(),\n },\n columns: {\n badge: `${configured}/${Math.max(availableColumns, configured)}`,\n attention: configured === 0,\n },\n parameters: { badge: params ? String(params) : undefined },\n processors: { badge: processors ? String(processors) : undefined },\n raw: {},\n };\n}\n\nexport function cloneProfileDraft(\n value: Record<string, unknown>,\n): ProfileWizardDraft {\n return structuredClone(value) as ProfileWizardDraft;\n}\n\nexport function profileSchemaProjection(keys: string[]): JsonSchemaObject {\n const properties = Object.fromEntries(\n keys.flatMap((key) => {\n const property = profileSchema().properties?.[key];\n return property ? [[key, property]] : [];\n }),\n );\n return {\n type: \"object\",\n properties,\n required: (profileSchema().required ?? []).filter((key) =>\n keys.includes(key),\n ),\n };\n}\n\n// An option rendered with the workload-URL selector is an inline address used\n// instead of a saved connection, so it belongs beside the connection picker.\nconst INLINE_CONNECTION_COMPONENT = \"k8s-url-selector\";\n\n/**\n * A provider's options schema. `part` splits it: \"connection\" keeps only the\n * inline-address options that stand in for a saved connection, \"query\" keeps\n * everything else.\n */\nexport function providerOptionsSchema(\n providerType: string,\n part: \"connection\" | \"query\",\n): JsonSchemaObject {\n const definition = profileSchema().$defs?.[providerType];\n const options = definition?.properties?.options;\n if (!options || options.type !== \"object\") {\n return part === \"connection\"\n ? { type: \"object\", properties: {} }\n : { type: \"object\", properties: {}, additionalProperties: true };\n }\n const schema = structuredClone(options) as JsonSchemaObject;\n schema.properties = Object.fromEntries(\n Object.entries(schema.properties ?? {}).filter(\n ([, field]) =>\n (field[\"x-clicky-component\"] === INLINE_CONNECTION_COMPONENT) ===\n (part === \"connection\"),\n ),\n );\n if (schema.required)\n schema.required = schema.required.filter((key) => key in schema.properties!);\n return schema;\n}\n\nexport function providerConnectionSchema(): JsonSchemaObject {\n const connection =\n profileSchema().properties?.provider?.properties?.connection;\n if (!connection) {\n throw new Error(\"profile schema is missing provider.connection\");\n }\n return { type: \"object\", properties: { connection } };\n}\n\nexport function providerTypes(): string[] {\n const values = profileSchema().properties?.provider?.properties?.type?.enum;\n return Array.isArray(values)\n ? values.filter((value): value is string => typeof value === \"string\")\n : [];\n}\n\nexport function mergeProfileProjection(\n draft: ProfileWizardDraft,\n keys: string[],\n next: Record<string, unknown>,\n): ProfileWizardDraft {\n const merged = { ...draft };\n for (const key of keys) delete merged[key];\n for (const key of keys) {\n if (Object.prototype.hasOwnProperty.call(next, key))\n merged[key] = next[key];\n }\n return merged;\n}\n\nexport function mergeSampledProfileColumns(\n configured: ProfileColumn[],\n sampled: ProfileColumn[],\n): ProfileColumn[] {\n const configuredNames = new Set(configured.map((column) => column.name));\n return [\n ...configured.map((column) => ({ ...column })),\n ...sampled\n .filter((column) => !configuredNames.has(column.name))\n .map((column) => ({ ...column })),\n ];\n}\n\nexport function resetProfileColumns(\n draft: ProfileWizardDraft,\n sampled: ProfileColumn[],\n): ProfileWizardDraft {\n if (sampled.length === 0) {\n throw new Error(\"Cannot reset profile columns without sampled columns\");\n }\n return { ...draft, columns: structuredClone(sampled) };\n}\n\nexport function profileColumnResetState({\n providerType,\n sampledColumnCount,\n sampleStale,\n}: {\n providerType: string;\n sampledColumnCount: number;\n sampleStale: boolean;\n}) {\n if (providerType !== \"opensearch\") {\n return { visible: false, disabled: true, title: \"\" };\n }\n if (sampledColumnCount === 0) {\n return {\n visible: true,\n disabled: true,\n title: \"Run a sample before resetting columns\",\n };\n }\n if (sampleStale) {\n return {\n visible: true,\n disabled: true,\n title: \"Run another sample for the current source and query\",\n };\n }\n return {\n visible: true,\n disabled: false,\n title: \"Replace configured columns with the latest sample\",\n };\n}\n\nexport function profileSampleSignature(draft: ProfileWizardDraft): string {\n return JSON.stringify({\n provider: draft.provider ?? {},\n query: draft.query ?? \"\",\n search:draft.search,\n namespace: draft.namespace,\n imports: draft.imports,\n params: draft.params,\n processors: draft.processors,\n });\n}\n\nexport function validateProfileEditorDraft(\n draft: ProfileWizardDraft,\n): string | null {\n if (!draft.profile?.trim()) return \"Profile name is required\";\n if (!draft.provider?.type?.trim()) return \"Provider type is required\";\n const names = new Set<string>();\n for (const column of draft.columns ?? []) {\n const name = column.name.trim();\n if (!name) return \"Every column needs a name\";\n if (names.has(name)) return `Column name \"${name}\" is duplicated`;\n names.add(name);\n }\n return validateProfileParams(draft.params, draft.provider?.type);\n}\n\nexport function profileUpdateConflictTarget(error: string): string | null {\n if (!error.includes(\"PROFILE_NAME_CONFLICT\")) return null;\n return error.match(/existing profile \"([^\"]+)\"/)?.[1] ?? null;\n}\n\nexport function profileRoute(name: string): string {\n const slug = stripSurroundingChars(\n Array.from(name.trim().toLowerCase())\n .map((character) =>\n /[a-z0-9]/.test(character)\n ? character\n : /[ ._/-]/.test(character)\n ? \"-\"\n : \"\",\n )\n .join(\"\"),\n \"-\",\n );\n return `/profile-${slug}`;\n}\n\n/** Deep-linkable editor route for a profile surface (`profile-os2`). */\nexport function profileEditRoute(surfaceKey: string): string {\n return `/${surfaceKey}/edit`;\n}\n\n/** Surface key an edit route addresses, or null when the path is not one. */\nexport function profileEditSurfaceKey(pathname: string): string | null {\n return pathname.match(/^\\/(profile-[^/]+)\\/edit\\/?$/)?.[1] ?? null;\n}\n"],"mappings":";;;;;;;;;AAcA,SAAgB,sBAAwC;CACtD,OAAO,cAAc;AACvB;AAEA,IAAa,wBAAwB;CACnC;EAAE,IAAI;EAAS,OAAO;EAAS,MAAM;CAAkC;CACvE;EAAE,IAAI;EAAW,OAAO;EAAW,MAAM;CAA+B;CACxE;EACE,IAAI;EACJ,OAAO;EACP,MAAM;CACR;CACA;EAAE,IAAI;EAAW,OAAO;EAAW,MAAM;CAA8B;CACvE;EAAE,IAAI;EAAc,OAAO;EAAc,MAAM;CAAqB;CACpE;EACE,IAAI;EACJ,OAAO;EACP,MAAM;CACR;CACA;EAAE,IAAI;EAAO,OAAO;EAAY,MAAM;CAA6B;AACrE;AAIA,IAAa,2BAA2B;CACtC;CACA;CACA;CACA;AACF;AACA,IAAa,uBAAuB,CAAC,YAAY;;;;;;AAYjD,SAAgB,2BAA2B,EACzC,OACA,kBACA,eAKqD;CACrD,MAAM,aAAa,MAAM,SAAS,UAAU;CAC5C,MAAM,SAAS,MAAM,QAAQ,MAAM,MAAM,IAAI,MAAM,OAAO,SAAS;CACnE,MAAM,aAAa,MAAM,QAAQ,MAAM,UAAU,IAC7C,MAAM,WAAW,SACjB;CACJ,OAAO;EACL,OAAO,CAAC;EACR,SAAS,EAAE,WAAW,CAAC,MAAM,SAAS,KAAK,EAAE;EAC7C,QAAQ;GACN,OAAO,MAAM,UAAU,QAAQ,KAAA;GAC/B,WAAW,eAAe,CAAC,MAAM,UAAU,MAAM,KAAK;EACxD;EACA,SAAS;GACP,OAAO,GAAG,WAAW,GAAG,KAAK,IAAI,kBAAkB,UAAU;GAC7D,WAAW,eAAe;EAC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AAM,YAAY,CAAC;EAC7B,OAAO,MAAM,SAAS;EACtB,QAAO,MAAM;EACb,WAAW,MAAM;EACjB,SAAS,MAAM;EACf,QAAQ,MAAM;EACd,YAAY,MAAM;CACpB,CAAC;AACH;AAEA,SAAgB,2BACd,OACe;CACf,IAAI,CAAC,MAAM,SAAS,KAAK,GAAG,OAAO;CACnC,IAAI,CAAC,MAAM,UAAU,MAAM,KAAK,GAAG,OAAO;CAC1C,MAAM,wBAAQ,IAAI,IAAY;CAC9B,KAAK,MAAM,UAAU,MAAM,WAAW,CAAC,GAAG;EACxC,MAAM,OAAO,OAAO,KAAK,KAAK;EAC9B,IAAI,CAAC,MAAM,OAAO;EAClB,IAAI,MAAM,IAAI,IAAI,GAAG,OAAO,gBAAgB,KAAK;EACjD,MAAM,IAAI,IAAI;CAChB;CACA,OAAO,sBAAsB,MAAM,QAAQ,MAAM,UAAU,IAAI;AACjE;AAEA,SAAgB,4BAA4B,OAA8B;CACxE,IAAI,CAAC,MAAM,SAAS,uBAAuB,GAAG,OAAO;CACrD,OAAO,MAAM,MAAM,4BAA4B,CAAC,GAAG,MAAM;AAC3D;AAEA,SAAgB,aAAa,MAAsB;CAajD,OAAO,YAZM,sBACX,MAAM,KAAK,KAAK,KAAK,CAAC,CAAC,YAAY,CAAC,CAAC,CAClC,KAAK,cACJ,WAAW,KAAK,SAAS,IACrB,YACA,UAAU,KAAK,SAAS,IACtB,MACA,EACR,CAAC,CACA,KAAK,EAAE,GACV,GAEiB;AACrB;;AAGA,SAAgB,iBAAiB,YAA4B;CAC3D,OAAO,IAAI,WAAW;AACxB;;AAGA,SAAgB,sBAAsB,UAAiC;CACrE,OAAO,SAAS,MAAM,8BAA8B,CAAC,GAAG,MAAM;AAChE"}
|
|
1
|
+
{"version":3,"file":"profileEditorModel.js","names":[],"sources":["../../../src/profiles/editor/profileEditorModel.ts"],"sourcesContent":["import type {\n JsonSchemaObject,\n JsonSchemaProperty,\n} from \"../../components/json-schema-form-types\";\nimport { stripSurroundingChars } from \"../../lib/string\";\nimport { profileSchema } from \"../profileApi\";\nimport { validateProfileParams } from \"../fields/profileParamModel\";\nimport type {\n ProfileColumn,\n ProfileWizardDraft,\n} from \"../wizard/profileWizardModel\";\n\n/**\n * The schema the raw-YAML editor validates against. It is read through the\n * configured accessor rather than bundled: the document is generated from\n * commons-db's Go types and served by the host, so a copy here would drift.\n */\nexport function profileEditorSchema(): JsonSchemaObject {\n return profileSchema();\n}\n\nexport const profileEditorSections = [\n { id: \"spans\", label: \"Spans\", hint: \"Canonical fields and attributes\" },\n { id: \"general\", label: \"General\", hint: \"Name, source, options\" },\n {\n id: \"source\",\n label: \"Query\",\n hint: \"Query, conditions, sample\",\n },\n { id: \"columns\", label: \"Columns\", hint: \"Fields, labels, expressions\" },\n { id: \"parameters\", label: \"Parameters\", hint: \"Named query inputs\" },\n {\n id: \"processors\",\n label: \"Processors\",\n hint: \"Ordered post-query transformations\",\n },\n { id: \"raw\", label: \"Raw YAML\", hint: \"Edit the document directly\" },\n] as const;\n\nexport type ProfileEditorSection = (typeof profileEditorSections)[number][\"id\"];\n\nexport const profileGeneralOptionKeys = [\n \"imports\",\n \"aliases\",\n \"output\",\n \"ignore\",\n];\nexport const profileProcessorKeys = [\"processors\"];\n\nexport type ProfileSectionStatus = {\n badge?: string | undefined;\n attention?: boolean | undefined;\n};\n\n/**\n * Rail annotations per section. The route replaced tabs with a vertical rail,\n * which has room to say how much each section holds — so a stale sample or an\n * empty column set is visible without opening the section.\n */\nexport function profileEditorSectionStatus({\n draft,\n availableColumns,\n sampleStale,\n}: {\n draft: ProfileWizardDraft;\n availableColumns: number;\n sampleStale: boolean;\n}): Record<ProfileEditorSection, ProfileSectionStatus> {\n const configured = draft.columns?.length ?? 0;\n const params = Array.isArray(draft.params) ? draft.params.length : 0;\n const processors = Array.isArray(draft.processors)\n ? draft.processors.length\n : 0;\n return {\n spans: {},\n // The source lives in General, so it carries the provider and its absence.\n general: {\n badge: draft.provider?.type || undefined,\n attention: !draft.profile?.trim() || !draft.provider?.type?.trim(),\n },\n source: { attention: sampleStale },\n columns: {\n badge: `${configured}/${Math.max(availableColumns, configured)}`,\n attention: configured === 0,\n },\n parameters: { badge: params ? String(params) : undefined },\n processors: { badge: processors ? String(processors) : undefined },\n raw: {},\n };\n}\n\nexport function cloneProfileDraft(\n value: Record<string, unknown>,\n): ProfileWizardDraft {\n return structuredClone(value) as ProfileWizardDraft;\n}\n\nexport function profileSchemaProjection(keys: string[]): JsonSchemaObject {\n const properties = Object.fromEntries(\n keys.flatMap((key) => {\n const property = profileSchema().properties?.[key];\n return property ? [[key, property]] : [];\n }),\n );\n return {\n type: \"object\",\n properties,\n required: (profileSchema().required ?? []).filter((key) =>\n keys.includes(key),\n ),\n };\n}\n\n// An option rendered with the workload-URL selector is an inline address used\n// instead of a saved connection, so it belongs beside the connection picker.\nconst INLINE_CONNECTION_COMPONENT = \"k8s-url-selector\";\n\n// An option the schema places in the Source panel: it describes the documents\n// the provider reads (their format, which fields hold a span's identity), not\n// the query it runs.\nconst SOURCE_SECTION = \"source\";\n\nfunction belongsToSource(field: JsonSchemaProperty): boolean {\n return (\n field[\"x-clicky-component\"] === INLINE_CONNECTION_COMPONENT ||\n field[\"x-clicky-section\"] === SOURCE_SECTION\n );\n}\n\n/**\n * A provider's options schema. `part` splits it: \"connection\" keeps the options\n * the Source panel shows — inline addresses that stand in for a saved\n * connection, and options marked `x-clicky-section: source` — and \"query\"\n * keeps everything else.\n */\nexport function providerOptionsSchema(\n providerType: string,\n part: \"connection\" | \"query\",\n): JsonSchemaObject {\n const definition = profileSchema().$defs?.[providerType];\n const options = definition?.properties?.options;\n if (!options || options.type !== \"object\") {\n return part === \"connection\"\n ? { type: \"object\", properties: {} }\n : { type: \"object\", properties: {}, additionalProperties: true };\n }\n const schema = structuredClone(options) as JsonSchemaObject;\n schema.properties = Object.fromEntries(\n Object.entries(schema.properties ?? {}).filter(\n ([, field]) => belongsToSource(field) === (part === \"connection\"),\n ),\n );\n if (schema.required)\n schema.required = schema.required.filter((key) => key in schema.properties!);\n return schema;\n}\n\n/**\n * The Source section's one flat form: the provider type, the saved connection\n * and the provider's inline connection options (address and friends). They are\n * one schema so they share a single label/value grid, which is what makes the\n * section a single inline column rather than two forms with misaligned labels.\n */\nexport function providerSourceSchema(\n inlineConnection: JsonSchemaObject,\n): JsonSchemaObject {\n const provider = profileSchema().properties?.provider?.properties;\n if (!provider?.type) {\n throw new Error(\"profile schema is missing provider.type\");\n }\n if (!provider.connection) {\n throw new Error(\"profile schema is missing provider.connection\");\n }\n const inline = inlineConnection.properties ?? {};\n const clash = Object.keys(inline).filter(\n (key) => key === \"type\" || key === \"connection\",\n );\n if (clash.length > 0) {\n throw new Error(\n `inline connection options collide with the provider source fields: ${clash.join(\", \")}`,\n );\n }\n return {\n type: \"object\",\n required: [\"type\", ...(inlineConnection.required ?? [])],\n // The provider and its connection lead, ahead of any option that carries\n // its own order (the OpenTelemetry document fields do).\n properties: {\n type: { ...provider.type, title: \"Provider type\", \"x-clicky-order\": 0 },\n connection: { ...provider.connection, \"x-clicky-order\": 1 },\n ...inline,\n },\n };\n}\n\n/**\n * Folds an edit of the Source form back into the draft's provider. Only what\n * actually changed is written, so editing one field never rewrites another and\n * the provider keeps every key the form does not render.\n */\nexport function applyProviderSourceEdit({\n draft,\n next,\n inlineKeys,\n}: {\n draft: ProfileWizardDraft;\n next: Record<string, unknown>;\n inlineKeys: string[];\n}): ProfileWizardDraft {\n if (typeof next.type !== \"string\") {\n throw new Error(\"provider.type must be a string\");\n }\n if (typeof next.connection !== \"string\") {\n throw new Error(\"provider.connection must be a string\");\n }\n const current = draft.provider?.options ?? {};\n const edited = inlineKeys.filter(\n (key) =>\n key in next && JSON.stringify(next[key]) !== JSON.stringify(current[key]),\n );\n return {\n ...draft,\n provider: {\n ...draft.provider,\n ...(next.type !== (draft.provider?.type ?? \"\") ? { type: next.type } : {}),\n ...(next.connection !== (draft.provider?.connection ?? \"\")\n ? { connection: next.connection }\n : {}),\n ...(edited.length > 0\n ? {\n options: {\n ...current,\n ...Object.fromEntries(edited.map((key) => [key, next[key]])),\n },\n }\n : {}),\n },\n };\n}\n\nexport function mergeProfileProjection(\n draft: ProfileWizardDraft,\n keys: string[],\n next: Record<string, unknown>,\n): ProfileWizardDraft {\n const merged = { ...draft };\n for (const key of keys) delete merged[key];\n for (const key of keys) {\n if (Object.prototype.hasOwnProperty.call(next, key))\n merged[key] = next[key];\n }\n return merged;\n}\n\nexport function mergeSampledProfileColumns(\n configured: ProfileColumn[],\n sampled: ProfileColumn[],\n): ProfileColumn[] {\n const configuredNames = new Set(configured.map((column) => column.name));\n return [\n ...configured.map((column) => ({ ...column })),\n ...sampled\n .filter((column) => !configuredNames.has(column.name))\n .map((column) => ({ ...column })),\n ];\n}\n\nexport function resetProfileColumns(\n draft: ProfileWizardDraft,\n sampled: ProfileColumn[],\n): ProfileWizardDraft {\n if (sampled.length === 0) {\n throw new Error(\"Cannot reset profile columns without sampled columns\");\n }\n return { ...draft, columns: structuredClone(sampled) };\n}\n\nexport function profileColumnResetState({\n providerType,\n sampledColumnCount,\n sampleStale,\n}: {\n providerType: string;\n sampledColumnCount: number;\n sampleStale: boolean;\n}) {\n if (providerType !== \"opensearch\") {\n return { visible: false, disabled: true, title: \"\" };\n }\n if (sampledColumnCount === 0) {\n return {\n visible: true,\n disabled: true,\n title: \"Run a sample before resetting columns\",\n };\n }\n if (sampleStale) {\n return {\n visible: true,\n disabled: true,\n title: \"Run another sample for the current source and query\",\n };\n }\n return {\n visible: true,\n disabled: false,\n title: \"Replace configured columns with the latest sample\",\n };\n}\n\nexport function profileSampleSignature(draft: ProfileWizardDraft): string {\n return JSON.stringify({\n provider: draft.provider ?? {},\n query: draft.query ?? \"\",\n search:draft.search,\n namespace: draft.namespace,\n imports: draft.imports,\n params: draft.params,\n processors: draft.processors,\n });\n}\n\nexport function validateProfileEditorDraft(\n draft: ProfileWizardDraft,\n): string | null {\n if (!draft.profile?.trim()) return \"Profile name is required\";\n if (!draft.provider?.type?.trim()) return \"Provider type is required\";\n const names = new Set<string>();\n for (const column of draft.columns ?? []) {\n const name = column.name.trim();\n if (!name) return \"Every column needs a name\";\n if (names.has(name)) return `Column name \"${name}\" is duplicated`;\n names.add(name);\n }\n return validateProfileParams(draft.params, draft.provider?.type);\n}\n\nexport function profileUpdateConflictTarget(error: string): string | null {\n if (!error.includes(\"PROFILE_NAME_CONFLICT\")) return null;\n return error.match(/existing profile \"([^\"]+)\"/)?.[1] ?? null;\n}\n\nexport function profileRoute(name: string): string {\n const slug = stripSurroundingChars(\n Array.from(name.trim().toLowerCase())\n .map((character) =>\n /[a-z0-9]/.test(character)\n ? character\n : /[ ._/-]/.test(character)\n ? \"-\"\n : \"\",\n )\n .join(\"\"),\n \"-\",\n );\n return `/profile-${slug}`;\n}\n\n/** Deep-linkable editor route for a profile surface (`profile-os2`). */\nexport function profileEditRoute(surfaceKey: string): string {\n return `/${surfaceKey}/edit`;\n}\n\n/** Surface key an edit route addresses, or null when the path is not one. */\nexport function profileEditSurfaceKey(pathname: string): string | null {\n return pathname.match(/^\\/(profile-[^/]+)\\/edit\\/?$/)?.[1] ?? null;\n}\n"],"mappings":";;;;;;;;;AAiBA,SAAgB,sBAAwC;CACtD,OAAO,cAAc;AACvB;AAEA,IAAa,wBAAwB;CACnC;EAAE,IAAI;EAAS,OAAO;EAAS,MAAM;CAAkC;CACvE;EAAE,IAAI;EAAW,OAAO;EAAW,MAAM;CAAwB;CACjE;EACE,IAAI;EACJ,OAAO;EACP,MAAM;CACR;CACA;EAAE,IAAI;EAAW,OAAO;EAAW,MAAM;CAA8B;CACvE;EAAE,IAAI;EAAc,OAAO;EAAc,MAAM;CAAqB;CACpE;EACE,IAAI;EACJ,OAAO;EACP,MAAM;CACR;CACA;EAAE,IAAI;EAAO,OAAO;EAAY,MAAM;CAA6B;AACrE;AAIA,IAAa,2BAA2B;CACtC;CACA;CACA;CACA;AACF;AACA,IAAa,uBAAuB,CAAC,YAAY;;;;;;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S,IACtB,MACA,EACR,CAAC,CACA,KAAK,EAAE,GACV,GAEiB;AACrB;;AAGA,SAAgB,iBAAiB,YAA4B;CAC3D,OAAO,IAAI,WAAW;AACxB;;AAGA,SAAgB,sBAAsB,UAAiC;CACrE,OAAO,SAAS,MAAM,8BAA8B,CAAC,GAAG,MAAM;AAChE"}
|
|
@@ -1,50 +1,150 @@
|
|
|
1
|
+
const require_debugConsoleSignal = require("../../data/debugConsoleSignal.cjs");
|
|
2
|
+
const require_connectionBrowserModel = require("../connections/connectionBrowserModel.cjs");
|
|
3
|
+
const require_profileApi = require("../profileApi.cjs");
|
|
4
|
+
const require_profileSampleFilterLookup = require("../query/profileSampleFilterLookup.cjs");
|
|
5
|
+
const require_jsonPathSample = require("../query/jsonPathSample.cjs");
|
|
1
6
|
const require_profileMappingPreview = require("./profileMappingPreview.cjs");
|
|
7
|
+
let react = require("react");
|
|
2
8
|
let react_jsx_runtime = require("react/jsx-runtime");
|
|
3
9
|
// src/profiles/editor/profileEditorPreview.tsx
|
|
10
|
+
var NO_FILTERS = {};
|
|
4
11
|
/**
|
|
5
|
-
* The
|
|
6
|
-
*
|
|
7
|
-
* without leaving the editor.
|
|
8
|
-
*
|
|
12
|
+
* The draft's results as the saved profile's page will show them, so the effect
|
|
13
|
+
* of including a field, relabelling it, typing it or hiding it is visible
|
|
14
|
+
* without leaving the editor.
|
|
15
|
+
*
|
|
16
|
+
* The rows are the sample's source rows, not a client-side projection of them:
|
|
17
|
+
* the profile service maps them through the draft's columns and renders the same
|
|
18
|
+
* clicky document it serves the saved profile's results page, which this shows
|
|
19
|
+
* with the same Clicky component — a key_values column is tag pills, a datetime
|
|
20
|
+
* is a timestamp, a duration is a duration. Rows only exist after a sample runs —
|
|
21
|
+
* there is no placeholder data, because a fabricated preview is worse than none.
|
|
22
|
+
*
|
|
23
|
+
* The filter bar offers the filters the draft's columns declare. Filtering is
|
|
24
|
+
* the backend's, so applying one samples again with it; the rows are never
|
|
25
|
+
* filtered in the browser.
|
|
9
26
|
*/
|
|
10
27
|
function ProfileEditorPreview({ columns, rows, profile, stale = false, onNormalized }) {
|
|
11
28
|
if (stale) return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
12
29
|
role: "status",
|
|
13
30
|
children: "Source or query settings changed. Run a new sample to refresh the mapping preview."
|
|
14
31
|
});
|
|
15
|
-
if (profile
|
|
32
|
+
if (profile.render === "traces") return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_profileMappingPreview.ProfileMappingPreview, {
|
|
16
33
|
profile,
|
|
17
34
|
rows,
|
|
18
35
|
...onNormalized ? { onNormalized } : {}
|
|
19
36
|
});
|
|
20
|
-
const
|
|
21
|
-
if (rows.length === 0 ||
|
|
37
|
+
const included = columns.some((column) => !column.hidden);
|
|
38
|
+
if (rows.length === 0 || !included) return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
22
39
|
className: "grid h-full place-items-center px-6 text-center text-xs text-muted-foreground",
|
|
23
|
-
children:
|
|
40
|
+
children: included ? "Run a sample in Query to preview rows." : "No columns included yet."
|
|
24
41
|
});
|
|
25
|
-
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
42
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(FilterableTablePreview, {
|
|
43
|
+
profile,
|
|
44
|
+
rows
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
function FilterableTablePreview({ profile, rows }) {
|
|
48
|
+
const [selection, setSelection] = (0, react.useState)(NO_FILTERS);
|
|
49
|
+
const filtered = useFilteredSample({
|
|
50
|
+
profile,
|
|
51
|
+
selection
|
|
52
|
+
});
|
|
53
|
+
(0, react.useEffect)(() => setSelection(NO_FILTERS), [rows]);
|
|
54
|
+
const lookupValues = (0, react.useCallback)((request) => require_profileSampleFilterLookup.lookupProfileSampleFilterValues({
|
|
55
|
+
draft: profile,
|
|
56
|
+
params: {},
|
|
57
|
+
filterColumns: profile.columns ?? [],
|
|
58
|
+
request: {
|
|
59
|
+
...request,
|
|
60
|
+
filters: selection
|
|
61
|
+
}
|
|
62
|
+
}), [profile, selection]);
|
|
63
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
64
|
+
className: "flex h-full min-h-0 flex-col",
|
|
65
|
+
children: [filtered.error ? /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("p", {
|
|
66
|
+
role: "alert",
|
|
67
|
+
className: "shrink-0 px-3 py-1 text-xs text-destructive",
|
|
68
|
+
children: ["Cannot apply the filter to the sample: ", filtered.error]
|
|
69
|
+
}) : null, /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_profileMappingPreview.ProfileMappingPreview, {
|
|
70
|
+
profile,
|
|
71
|
+
rows: filtered.error ? [] : filtered.rows ?? rows,
|
|
72
|
+
filters: {
|
|
73
|
+
selection,
|
|
74
|
+
onChange: setSelection,
|
|
75
|
+
lookupValues
|
|
76
|
+
}
|
|
77
|
+
})]
|
|
43
78
|
});
|
|
44
79
|
}
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
80
|
+
/**
|
|
81
|
+
* The sample's source rows for a draft with `selection` applied by the backend,
|
|
82
|
+
* or null rows while nothing is selected (the unfiltered sample stands).
|
|
83
|
+
*/
|
|
84
|
+
function useFilteredSample({ profile, selection }) {
|
|
85
|
+
const [state, setState] = (0, react.useState)({
|
|
86
|
+
rows: null,
|
|
87
|
+
error: ""
|
|
88
|
+
});
|
|
89
|
+
const active = Object.keys(selection).length > 0;
|
|
90
|
+
const selectionKey = JSON.stringify(selection);
|
|
91
|
+
const draft = (0, react.useRef)(profile);
|
|
92
|
+
draft.current = profile;
|
|
93
|
+
(0, react.useEffect)(() => {
|
|
94
|
+
if (!active) {
|
|
95
|
+
setState({
|
|
96
|
+
rows: null,
|
|
97
|
+
error: ""
|
|
98
|
+
});
|
|
99
|
+
return;
|
|
100
|
+
}
|
|
101
|
+
const sampled = require_jsonPathSample.sampleRequestProfile(draft.current);
|
|
102
|
+
if (!sampled) {
|
|
103
|
+
setState({
|
|
104
|
+
rows: [],
|
|
105
|
+
error: "the draft has no provider to sample"
|
|
106
|
+
});
|
|
107
|
+
return;
|
|
108
|
+
}
|
|
109
|
+
let current = true;
|
|
110
|
+
setState((previous) => ({
|
|
111
|
+
...previous,
|
|
112
|
+
error: ""
|
|
113
|
+
}));
|
|
114
|
+
require_connectionBrowserModel.fetchJSON(require_profileApi.profileApiPath("profile/sample"), {
|
|
115
|
+
method: "POST",
|
|
116
|
+
headers: {
|
|
117
|
+
"Content-Type": "application/json",
|
|
118
|
+
...require_debugConsoleSignal.debugCaptureHeaders()
|
|
119
|
+
},
|
|
120
|
+
body: JSON.stringify({
|
|
121
|
+
profile: sampled,
|
|
122
|
+
params: {},
|
|
123
|
+
previewProcessors: true,
|
|
124
|
+
filterColumns: draft.current.columns ?? [],
|
|
125
|
+
filters: JSON.parse(selectionKey)
|
|
126
|
+
})
|
|
127
|
+
}).then((response) => {
|
|
128
|
+
if (!current) return;
|
|
129
|
+
if (!response.mappingInputRows) return setState({
|
|
130
|
+
rows: [],
|
|
131
|
+
error: "the sample response is missing mappingInputRows"
|
|
132
|
+
});
|
|
133
|
+
setState({
|
|
134
|
+
rows: response.mappingInputRows,
|
|
135
|
+
error: ""
|
|
136
|
+
});
|
|
137
|
+
}, (error) => {
|
|
138
|
+
if (current) setState({
|
|
139
|
+
rows: [],
|
|
140
|
+
error: error instanceof Error ? error.message : String(error)
|
|
141
|
+
});
|
|
142
|
+
});
|
|
143
|
+
return () => {
|
|
144
|
+
current = false;
|
|
145
|
+
};
|
|
146
|
+
}, [active, selectionKey]);
|
|
147
|
+
return state;
|
|
48
148
|
}
|
|
49
149
|
exports.ProfileEditorPreview = ProfileEditorPreview;
|
|
50
150
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"profileEditorPreview.cjs","names":["ProfileMappingPreview"],"sources":["../../../src/profiles/editor/profileEditorPreview.tsx"],"sourcesContent":["import type { ProfileColumn } from \"../wizard/profileWizardModel\";\nimport type { ProfileWizardDraft } from \"../wizard/profileWizardModel\";\nimport { ProfileMappingPreview } from \"./profileMappingPreview\";\n\n/**\n * The
|
|
1
|
+
{"version":3,"file":"profileEditorPreview.cjs","names":["ProfileMappingPreview","useState","useCallback","lookupProfileSampleFilterValues","useRef","sampleRequestProfile","profileApiPath","debugCaptureHeaders"],"sources":["../../../src/profiles/editor/profileEditorPreview.tsx"],"sourcesContent":["import { useCallback, useEffect, useRef, useState } from \"react\";\nimport type { DataTableFilterSelection } from \"../../data/data-table-filter-values\";\nimport type { DataTableFilterLookup } from \"../../data/data-table-server-filters\";\nimport { debugCaptureHeaders } from \"../../data/debugConsoleSignal\";\nimport { fetchJSON } from \"../connections/connectionBrowserModel\";\nimport { profileApiPath } from \"../profileApi\";\nimport { lookupProfileSampleFilterValues } from \"../query/profileSampleFilterLookup\";\nimport { sampleRequestProfile } from \"../query/jsonPathSample\";\nimport type { ProfileColumn } from \"../wizard/profileWizardModel\";\nimport type { ProfileWizardDraft } from \"../wizard/profileWizardModel\";\nimport { ProfileMappingPreview } from \"./profileMappingPreview\";\n\nconst NO_FILTERS: DataTableFilterSelection = {};\n\n/**\n * The draft's results as the saved profile's page will show them, so the effect\n * of including a field, relabelling it, typing it or hiding it is visible\n * without leaving the editor.\n *\n * The rows are the sample's source rows, not a client-side projection of them:\n * the profile service maps them through the draft's columns and renders the same\n * clicky document it serves the saved profile's results page, which this shows\n * with the same Clicky component — a key_values column is tag pills, a datetime\n * is a timestamp, a duration is a duration. Rows only exist after a sample runs —\n * there is no placeholder data, because a fabricated preview is worse than none.\n *\n * The filter bar offers the filters the draft's columns declare. Filtering is\n * the backend's, so applying one samples again with it; the rows are never\n * filtered in the browser.\n */\nexport function ProfileEditorPreview({\n columns,\n rows,\n profile,\n stale = false,\n onNormalized,\n}: {\n columns: ProfileColumn[];\n /** The sample's source rows, ahead of the draft's column mapping. */\n rows: Record<string, unknown>[];\n /** The draft being edited: its columns, aliases and filters are what the rows are mapped through. */\n profile: ProfileWizardDraft;\n stale?: boolean;\n /** Receives the span-normalised rows and columns of a traces profile. */\n onNormalized?: (rows: Record<string, unknown>[], columns: ProfileColumn[]) => void;\n}) {\n if (stale)\n return (\n <p role=\"status\">\n Source or query settings changed. Run a new sample to refresh the\n mapping preview.\n </p>\n );\n if (profile.render === \"traces\")\n return <ProfileMappingPreview profile={profile} rows={rows} {...(onNormalized ? {onNormalized} : {})} />;\n\n const included = columns.some((column) => !column.hidden);\n if (rows.length === 0 || !included) {\n return (\n <p className=\"grid h-full place-items-center px-6 text-center text-xs text-muted-foreground\">\n {included ? \"Run a sample in Query to preview rows.\" : \"No columns included yet.\"}\n </p>\n );\n }\n return <FilterableTablePreview profile={profile} rows={rows} />;\n}\n\nfunction FilterableTablePreview({\n profile,\n rows,\n}: {\n profile: ProfileWizardDraft;\n rows: Record<string, unknown>[];\n}) {\n const [selection, setSelection] = useState(NO_FILTERS);\n const filtered = useFilteredSample({ profile, selection });\n // A new sample starts from no filters: the filtered rows belong to the old one.\n useEffect(() => setSelection(NO_FILTERS), [rows]);\n\n const lookupValues = useCallback<DataTableFilterLookup>(\n (request) =>\n lookupProfileSampleFilterValues({\n draft: profile,\n params: {},\n filterColumns: profile.columns ?? [],\n request: { ...request, filters: selection },\n }),\n [profile, selection],\n );\n\n return (\n <div className=\"flex h-full min-h-0 flex-col\">\n {filtered.error ? (\n <p role=\"alert\" className=\"shrink-0 px-3 py-1 text-xs text-destructive\">\n Cannot apply the filter to the sample: {filtered.error}\n </p>\n ) : null}\n <ProfileMappingPreview\n profile={profile}\n rows={filtered.error ? [] : (filtered.rows ?? rows)}\n filters={{ selection, onChange: setSelection, lookupValues }}\n />\n </div>\n );\n}\n\n/**\n * The sample's source rows for a draft with `selection` applied by the backend,\n * or null rows while nothing is selected (the unfiltered sample stands).\n */\nfunction useFilteredSample({\n profile,\n selection,\n}: {\n profile: ProfileWizardDraft;\n selection: DataTableFilterSelection;\n}): { rows: Record<string, unknown>[] | null; error: string } {\n const [state, setState] = useState<{ rows: Record<string, unknown>[] | null; error: string }>({\n rows: null,\n error: \"\",\n });\n const active = Object.keys(selection).length > 0;\n const selectionKey = JSON.stringify(selection);\n // The draft's columns are edited without sampling again: only a changed\n // selection queries the backend, with the draft as it stands then.\n const draft = useRef(profile);\n draft.current = profile;\n\n useEffect(() => {\n if (!active) {\n setState({ rows: null, error: \"\" });\n return;\n }\n const sampled = sampleRequestProfile(draft.current);\n if (!sampled) {\n setState({ rows: [], error: \"the draft has no provider to sample\" });\n return;\n }\n let current = true;\n setState((previous) => ({ ...previous, error: \"\" }));\n fetchJSON<{ mappingInputRows?: Record<string, unknown>[] }>(profileApiPath(\"profile/sample\"), {\n method: \"POST\",\n headers: { \"Content-Type\": \"application/json\", ...debugCaptureHeaders() },\n body: JSON.stringify({\n profile: sampled,\n params: {},\n previewProcessors: true,\n // The sample request leaves the draft's columns out, so the columns that\n // bind each filter key to a field travel beside the selection.\n filterColumns: draft.current.columns ?? [],\n filters: JSON.parse(selectionKey) as DataTableFilterSelection,\n }),\n }).then(\n (response) => {\n if (!current) return;\n if (!response.mappingInputRows)\n return setState({ rows: [], error: \"the sample response is missing mappingInputRows\" });\n setState({ rows: response.mappingInputRows, error: \"\" });\n },\n (error: unknown) => {\n if (current) setState({ rows: [], error: error instanceof Error ? error.message : String(error) });\n },\n );\n return () => {\n current = false;\n };\n }, [active, selectionKey]);\n\n return state;\n}\n"],"mappings":";;;;;;;;;AAYA,IAAM,aAAuC,CAAC;;;;;;;;;;;;;;;;;AAkB9C,SAAgB,qBAAqB,EACnC,SACA,MACA,SACA,QAAQ,OACR,gBAUC;CACD,IAAI,OACF,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IAAI,SAAS,SAAS;IAAE,MAAM,CAAC;IAAG,OAAO,iBAAiB,QAAQ,MAAM,UAAU,OAAO,KAAK;GAAE,CAAC;EACnG,CACF;EACA,aAAa;GACX,UAAU;EACZ;CACF,GAAG,CAAC,QAAQ,YAAY,CAAC;CAEzB,OAAO;AACT"}
|
|
@@ -1,15 +1,28 @@
|
|
|
1
1
|
import { ProfileColumn, ProfileWizardDraft } from '../wizard/profileWizardModel.js';
|
|
2
2
|
/**
|
|
3
|
-
* The
|
|
4
|
-
*
|
|
5
|
-
* without leaving the editor.
|
|
6
|
-
*
|
|
3
|
+
* The draft's results as the saved profile's page will show them, so the effect
|
|
4
|
+
* of including a field, relabelling it, typing it or hiding it is visible
|
|
5
|
+
* without leaving the editor.
|
|
6
|
+
*
|
|
7
|
+
* The rows are the sample's source rows, not a client-side projection of them:
|
|
8
|
+
* the profile service maps them through the draft's columns and renders the same
|
|
9
|
+
* clicky document it serves the saved profile's results page, which this shows
|
|
10
|
+
* with the same Clicky component — a key_values column is tag pills, a datetime
|
|
11
|
+
* is a timestamp, a duration is a duration. Rows only exist after a sample runs —
|
|
12
|
+
* there is no placeholder data, because a fabricated preview is worse than none.
|
|
13
|
+
*
|
|
14
|
+
* The filter bar offers the filters the draft's columns declare. Filtering is
|
|
15
|
+
* the backend's, so applying one samples again with it; the rows are never
|
|
16
|
+
* filtered in the browser.
|
|
7
17
|
*/
|
|
8
18
|
export declare function ProfileEditorPreview({ columns, rows, profile, stale, onNormalized, }: {
|
|
9
19
|
columns: ProfileColumn[];
|
|
20
|
+
/** The sample's source rows, ahead of the draft's column mapping. */
|
|
10
21
|
rows: Record<string, unknown>[];
|
|
11
|
-
|
|
22
|
+
/** The draft being edited: its columns, aliases and filters are what the rows are mapped through. */
|
|
23
|
+
profile: ProfileWizardDraft;
|
|
12
24
|
stale?: boolean;
|
|
25
|
+
/** Receives the span-normalised rows and columns of a traces profile. */
|
|
13
26
|
onNormalized?: (rows: Record<string, unknown>[], columns: ProfileColumn[]) => void;
|
|
14
27
|
}): import("react").JSX.Element;
|
|
15
28
|
//# sourceMappingURL=profileEditorPreview.d.ts.map
|