@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
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
import { useUnwrapPreviews } from "./useUnwrapPreviews.js";
|
|
2
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
+
// src/profiles/editor/UnwrapPreviewList.tsx
|
|
4
|
+
var KIND_LABELS = {
|
|
5
|
+
key_values: "Key/values",
|
|
6
|
+
json: "JSON"
|
|
7
|
+
};
|
|
8
|
+
function UnwrapPreviewList({ draft, rules }) {
|
|
9
|
+
const state = useUnwrapPreviews(draft);
|
|
10
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
11
|
+
"data-unwrap-previews": true,
|
|
12
|
+
className: "mt-2 space-y-2",
|
|
13
|
+
children: [
|
|
14
|
+
state.status === "loading" ? /* @__PURE__ */ jsx("p", {
|
|
15
|
+
className: "text-xs text-muted-foreground",
|
|
16
|
+
children: "Previewing the rules against the source…"
|
|
17
|
+
}) : null,
|
|
18
|
+
state.status === "error" ? /* @__PURE__ */ jsx(Failure, { message: state.message }) : null,
|
|
19
|
+
state.status === "ready" ? rules.map((rule, index) => {
|
|
20
|
+
const preview = state.previews[index];
|
|
21
|
+
return preview ? /* @__PURE__ */ jsx(UnwrapPreviewCard, {
|
|
22
|
+
rule,
|
|
23
|
+
preview,
|
|
24
|
+
sampled: state.sampled
|
|
25
|
+
}, index) : null;
|
|
26
|
+
}) : null
|
|
27
|
+
]
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
function UnwrapPreviewCard({ rule, preview, sampled }) {
|
|
31
|
+
const field = typeof rule.field === "string" && rule.field !== "" ? rule.field : "(no field)";
|
|
32
|
+
const kind = typeof rule.as === "string" ? KIND_LABELS[rule.as] ?? rule.as : "";
|
|
33
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
34
|
+
"data-unwrap-preview": field,
|
|
35
|
+
className: "rounded-md border bg-muted/30 p-2 text-xs",
|
|
36
|
+
children: [
|
|
37
|
+
/* @__PURE__ */ jsxs("div", {
|
|
38
|
+
className: "mb-1 font-medium",
|
|
39
|
+
children: [field, kind ? /* @__PURE__ */ jsxs("span", {
|
|
40
|
+
className: "font-normal text-muted-foreground",
|
|
41
|
+
children: [" as ", kind]
|
|
42
|
+
}) : null]
|
|
43
|
+
}),
|
|
44
|
+
preview.status === "invalid" ? /* @__PURE__ */ jsx(Failure, { message: preview.error ?? "the server returned no error text" }) : null,
|
|
45
|
+
preview.status === "missing" ? /* @__PURE__ */ jsxs("p", {
|
|
46
|
+
className: "text-muted-foreground",
|
|
47
|
+
children: [
|
|
48
|
+
"None of the ",
|
|
49
|
+
sampled,
|
|
50
|
+
" sampled rows carries this field."
|
|
51
|
+
]
|
|
52
|
+
}) : null,
|
|
53
|
+
preview.status === "applied" || preview.status === "failed" ? /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsxs("p", {
|
|
54
|
+
className: "mb-1 text-muted-foreground",
|
|
55
|
+
children: ["Sampled row ", preview.row + 1]
|
|
56
|
+
}), /* @__PURE__ */ jsxs("div", {
|
|
57
|
+
className: "grid gap-2 @md:grid-cols-2",
|
|
58
|
+
children: [/* @__PURE__ */ jsx(Value, {
|
|
59
|
+
heading: "Now",
|
|
60
|
+
value: preview.before
|
|
61
|
+
}), preview.status === "applied" ? /* @__PURE__ */ jsx(Value, {
|
|
62
|
+
heading: "After unwrapping",
|
|
63
|
+
value: preview.after
|
|
64
|
+
}) : /* @__PURE__ */ jsx(Failure, { message: preview.error ?? "the server returned no error text" })]
|
|
65
|
+
})] }) : null
|
|
66
|
+
]
|
|
67
|
+
});
|
|
68
|
+
}
|
|
69
|
+
function Value({ heading, value }) {
|
|
70
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
71
|
+
className: "min-w-0",
|
|
72
|
+
children: [/* @__PURE__ */ jsx("div", {
|
|
73
|
+
className: "mb-0.5 text-muted-foreground",
|
|
74
|
+
children: heading
|
|
75
|
+
}), /* @__PURE__ */ jsx("pre", {
|
|
76
|
+
className: "max-h-40 overflow-auto rounded bg-background p-1.5 font-mono",
|
|
77
|
+
children: JSON.stringify(value, null, 2)
|
|
78
|
+
})]
|
|
79
|
+
});
|
|
80
|
+
}
|
|
81
|
+
function Failure({ message }) {
|
|
82
|
+
return /* @__PURE__ */ jsx("p", {
|
|
83
|
+
role: "alert",
|
|
84
|
+
className: "text-destructive",
|
|
85
|
+
children: message
|
|
86
|
+
});
|
|
87
|
+
}
|
|
88
|
+
export { UnwrapPreviewList };
|
|
89
|
+
|
|
90
|
+
//# sourceMappingURL=UnwrapPreviewList.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"UnwrapPreviewList.js","names":["_Fragment"],"sources":["../../../src/profiles/editor/UnwrapPreviewList.tsx"],"sourcesContent":["import type { ProfileWizardDraft } from \"../wizard/profileWizardModel\";\nimport { useUnwrapPreviews, type RulePreview, type UnwrapRuleDraft } from \"./useUnwrapPreviews\";\n\nconst KIND_LABELS: Record<string, string> = { key_values: \"Key/values\", json: \"JSON\" };\n\nexport function UnwrapPreviewList({ draft, rules }: { draft: ProfileWizardDraft; rules: UnwrapRuleDraft[] }) {\n const state = useUnwrapPreviews(draft);\n return (\n <div data-unwrap-previews className=\"mt-2 space-y-2\">\n {state.status === \"loading\" ? <p className=\"text-xs text-muted-foreground\">Previewing the rules against the source…</p> : null}\n {state.status === \"error\" ? <Failure message={state.message} /> : null}\n {state.status === \"ready\"\n ? rules.map((rule, index) => {\n const preview = state.previews[index];\n return preview ? <UnwrapPreviewCard key={index} rule={rule} preview={preview} sampled={state.sampled} /> : null;\n })\n : null}\n </div>\n );\n}\n\nfunction UnwrapPreviewCard({ rule, preview, sampled }: { rule: UnwrapRuleDraft; preview: RulePreview; sampled: number }) {\n const field = typeof rule.field === \"string\" && rule.field !== \"\" ? rule.field : \"(no field)\";\n const kind = typeof rule.as === \"string\" ? (KIND_LABELS[rule.as] ?? rule.as) : \"\";\n return (\n <div data-unwrap-preview={field} className=\"rounded-md border bg-muted/30 p-2 text-xs\">\n <div className=\"mb-1 font-medium\">\n {field}\n {kind ? <span className=\"font-normal text-muted-foreground\"> as {kind}</span> : null}\n </div>\n {preview.status === \"invalid\" ? <Failure message={preview.error ?? \"the server returned no error text\"} /> : null}\n {preview.status === \"missing\" ? (\n <p className=\"text-muted-foreground\">None of the {sampled} sampled rows carries this field.</p>\n ) : null}\n {preview.status === \"applied\" || preview.status === \"failed\" ? (\n <>\n <p className=\"mb-1 text-muted-foreground\">Sampled row {preview.row + 1}</p>\n <div className=\"grid gap-2 @md:grid-cols-2\">\n <Value heading=\"Now\" value={preview.before} />\n {preview.status === \"applied\" ? (\n <Value heading=\"After unwrapping\" value={preview.after} />\n ) : (\n <Failure message={preview.error ?? \"the server returned no error text\"} />\n )}\n </div>\n </>\n ) : null}\n </div>\n );\n}\n\nfunction Value({ heading, value }: { heading: string; value: unknown }) {\n return (\n <div className=\"min-w-0\">\n <div className=\"mb-0.5 text-muted-foreground\">{heading}</div>\n <pre className=\"max-h-40 overflow-auto rounded bg-background p-1.5 font-mono\">{JSON.stringify(value, null, 2)}</pre>\n </div>\n );\n}\n\nfunction Failure({ message }: { message: string }) {\n return (\n <p role=\"alert\" className=\"text-destructive\">\n {message}\n </p>\n );\n}\n"],"mappings":";;;AAGA,IAAM,cAAsC;CAAE,YAAY;CAAc,MAAM;AAAO;AAErF,SAAgB,kBAAkB,EAAE,OAAO,SAAkE;CAC3G,MAAM,QAAQ,kBAAkB,KAAK;CACrC,OACE,qBAAC,OAAD;EAAK,wBAAA;EAAqB,WAAU;EAApC,UAAA;GACG,MAAM,WAAW,YAAY,oBAAC,KAAD;IAAG,WAAU;IAAgC,UAAA;GAA2C,CAAA,IAAI;GACzH,MAAM,WAAW,UAAU,oBAAC,SAAD,EAAS,SAAS,MAAM,QAAU,CAAA,IAAI;GACjE,MAAM,WAAW,UACd,MAAM,KAAK,MAAM,UAAU;IACzB,MAAM,UAAU,MAAM,SAAS;IAC/B,OAAO,UAAU,oBAAC,mBAAD;KAAqC;KAAe;KAAS,SAAS,MAAM;IAAU,GAA9D,KAA8D,IAAI;GAC7G,CAAC,IACD;EACD;;AAET;AAEA,SAAS,kBAAkB,EAAE,MAAM,SAAS,WAA6E;CACvH,MAAM,QAAQ,OAAO,KAAK,UAAU,YAAY,KAAK,UAAU,KAAK,KAAK,QAAQ;CACjF,MAAM,OAAO,OAAO,KAAK,OAAO,WAAY,YAAY,KAAK,OAAO,KAAK,KA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,31 +5,11 @@ const require_esQueryOperators = require("../elasticsearch/esQueryOperators.cjs"
|
|
|
5
5
|
const require_esQueryBuilderForm = require("../elasticsearch/esQueryBuilderForm.cjs");
|
|
6
6
|
const require_profileApi = require("../profileApi.cjs");
|
|
7
7
|
const require_jsonPathSample = require("../query/jsonPathSample.cjs");
|
|
8
|
+
const require_profileCanonicalTranslate = require("./profileCanonicalTranslate.cjs");
|
|
8
9
|
const require_profileEditorModel = require("./profileEditorModel.cjs");
|
|
9
10
|
let react = require("react");
|
|
10
11
|
let react_jsx_runtime = require("react/jsx-runtime");
|
|
11
12
|
// src/profiles/editor/profileCanonicalQuery.tsx
|
|
12
|
-
async function translate(draft, { direction, signal, layoutOnly = false }) {
|
|
13
|
-
const response = await fetch(require_profileApi.profileApiPath("profile/sample/query"), {
|
|
14
|
-
method: "POST",
|
|
15
|
-
headers: { "Content-Type": "application/json" },
|
|
16
|
-
body: JSON.stringify({
|
|
17
|
-
profile: {
|
|
18
|
-
profile: draft.profile,
|
|
19
|
-
provider: draft.provider,
|
|
20
|
-
search: draft.search,
|
|
21
|
-
spans: draft.spans,
|
|
22
|
-
params: draft.params
|
|
23
|
-
},
|
|
24
|
-
direction,
|
|
25
|
-
params: require_esQueryBuilderForm.defaultParamValues(draft.params),
|
|
26
|
-
...layoutOnly ? { query: {} } : direction === "canonical" && draft.query ? { query: JSON.parse(draft.query) } : {}
|
|
27
|
-
}),
|
|
28
|
-
...signal ? { signal } : {}
|
|
29
|
-
});
|
|
30
|
-
if (!response.ok) throw new Error(await response.text());
|
|
31
|
-
return response.json();
|
|
32
|
-
}
|
|
33
13
|
function ProfileCanonicalQuery({ draft, onChange, onSample }) {
|
|
34
14
|
const [translation, setTranslation] = (0, react.useState)();
|
|
35
15
|
const [catalog, setCatalog] = (0, react.useState)();
|
|
@@ -56,7 +36,7 @@ function ProfileCanonicalQuery({ draft, onChange, onSample }) {
|
|
|
56
36
|
setLayoutError("");
|
|
57
37
|
const controller = new AbortController();
|
|
58
38
|
const timer = setTimeout(() => {
|
|
59
|
-
translate(JSON.parse(sourceSignature), {
|
|
39
|
+
require_profileCanonicalTranslate.translate(JSON.parse(sourceSignature), {
|
|
60
40
|
direction: "source",
|
|
61
41
|
signal: controller.signal,
|
|
62
42
|
layoutOnly: true
|
|
@@ -77,7 +57,7 @@ function ProfileCanonicalQuery({ draft, onChange, onSample }) {
|
|
|
77
57
|
const controller = new AbortController();
|
|
78
58
|
const timer = setTimeout(() => {
|
|
79
59
|
setError("");
|
|
80
|
-
translate(JSON.parse(signature), {
|
|
60
|
+
require_profileCanonicalTranslate.translate(JSON.parse(signature), {
|
|
81
61
|
direction: "source",
|
|
82
62
|
signal: controller.signal
|
|
83
63
|
}).then((result) => {
|
|
@@ -91,30 +71,6 @@ function ProfileCanonicalQuery({ draft, onChange, onSample }) {
|
|
|
91
71
|
clearTimeout(timer);
|
|
92
72
|
};
|
|
93
73
|
}, [signature, Boolean(search)]);
|
|
94
|
-
const convert = async () => {
|
|
95
|
-
setBusy(true);
|
|
96
|
-
setError("");
|
|
97
|
-
try {
|
|
98
|
-
const result = await translate(draft, { direction: "canonical" });
|
|
99
|
-
const options = { ...draft.provider?.options };
|
|
100
|
-
delete options.search;
|
|
101
|
-
onChange({
|
|
102
|
-
...draft,
|
|
103
|
-
query: "",
|
|
104
|
-
search: result.search,
|
|
105
|
-
provider: {
|
|
106
|
-
...draft.provider,
|
|
107
|
-
options
|
|
108
|
-
}
|
|
109
|
-
});
|
|
110
|
-
setTranslation(result);
|
|
111
|
-
setCatalog(result.layout);
|
|
112
|
-
} catch (failure) {
|
|
113
|
-
setError(String(failure));
|
|
114
|
-
} finally {
|
|
115
|
-
setBusy(false);
|
|
116
|
-
}
|
|
117
|
-
};
|
|
118
74
|
const sample = async () => {
|
|
119
75
|
setBusy(true);
|
|
120
76
|
setError("");
|
|
@@ -147,16 +103,13 @@ function ProfileCanonicalQuery({ draft, onChange, onSample }) {
|
|
|
147
103
|
}));
|
|
148
104
|
const optionsSchema = require_profileEditorModel.providerOptionsSchema(draft.provider?.type ?? "", "query");
|
|
149
105
|
if (optionsSchema.properties) delete optionsSchema.properties.search;
|
|
106
|
+
if (!search) return null;
|
|
150
107
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("section", {
|
|
151
108
|
className: "space-y-4 rounded-lg border bg-card p-4",
|
|
152
109
|
children: [
|
|
153
110
|
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("h2", {
|
|
154
111
|
className: "text-lg font-semibold",
|
|
155
|
-
children: "
|
|
156
|
-
}),
|
|
157
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
158
|
-
className: "text-sm text-muted-foreground",
|
|
159
|
-
children: "Canonical conditions stay with the profile. Each connection resolves its index fields and units."
|
|
112
|
+
children: "Query conditions"
|
|
160
113
|
}),
|
|
161
114
|
error || layoutError ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
162
115
|
role: "alert",
|
|
@@ -208,12 +161,7 @@ function ProfileCanonicalQuery({ draft, onChange, onSample }) {
|
|
|
208
161
|
children: translation ? JSON.stringify(translation.native, null, 2) : "Resolving connection layout…"
|
|
209
162
|
})]
|
|
210
163
|
})
|
|
211
|
-
] }) :
|
|
212
|
-
type: "button",
|
|
213
|
-
disabled: busy,
|
|
214
|
-
onClick: () => void convert(),
|
|
215
|
-
children: busy ? "Resolving layout…" : "Use canonical conditions"
|
|
216
|
-
})
|
|
164
|
+
] }) : null
|
|
217
165
|
]
|
|
218
166
|
});
|
|
219
167
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"profileCanonicalQuery.cjs","names":["profileApiPath","defaultParamValues","useState","sampleRequestProfile","providerOptionsSchema","_Fragment","JsonSchemaForm","EsQueryBuilder","esBuilderVocabulary","profileSchema","Button"],"sources":["../../../src/profiles/editor/profileCanonicalQuery.tsx"],"sourcesContent":["import { useEffect, useState } from \"react\";\nimport { Button } from \"../../components/button\";\nimport { JsonSchemaForm } from \"../../components/JsonSchemaForm\";\nimport { EsQueryBuilder } from \"../elasticsearch/esQueryBuilder\";\nimport {\n esBuilderVocabulary,\n type EsFieldMapping,\n} from \"../elasticsearch/esQueryOperators\";\nimport { defaultParamValues } from \"../elasticsearch/esQueryBuilderForm\";\nimport type { EsSearch } from \"../elasticsearch/esQueryBuilderModel\";\nimport { profileApiPath, profileSchema } from \"../profileApi\";\nimport { sampleRequestProfile } from \"../query/jsonPathSample\";\nimport type { ProfileSample } from \"../wizard/profileWizardQueryStep\";\nimport type { ProfileWizardDraft } from \"../wizard/profileWizardModel\";\nimport { providerOptionsSchema } from \"./profileEditorModel\";\n\ntype Translation = {\n search: EsSearch;\n native: unknown;\n layout: { fields: Record<string, { type?: string }> };\n};\n\nasync function translate(\n draft: ProfileWizardDraft,\n {\n direction,\n signal,\n layoutOnly = false,\n }: {\n direction: \"source\" | \"canonical\";\n signal?: AbortSignal;\n layoutOnly?: boolean;\n },\n): Promise<Translation> {\n const response = await fetch(profileApiPath(\"profile/sample/query\"), {\n method: \"POST\",\n headers: { \"Content-Type\": \"application/json\" },\n body: JSON.stringify({\n profile: {\n profile: draft.profile,\n provider: draft.provider,\n search: draft.search,\n spans: draft.spans,\n params: draft.params,\n },\n direction,\n params: defaultParamValues(draft.params),\n ...(layoutOnly\n ? { query: {} }\n : direction === \"canonical\" && draft.query\n ? { query: JSON.parse(draft.query) }\n : {}),\n }),\n ...(signal ? { signal } : {}),\n });\n if (!response.ok) throw new Error(await response.text());\n return response.json() as Promise<Translation>;\n}\n\nexport function ProfileCanonicalQuery({\n draft,\n onChange,\n onSample,\n}: {\n draft: ProfileWizardDraft;\n onChange: (next: ProfileWizardDraft) => void;\n onSample: (sample: ProfileSample) => void;\n}) {\n const [translation, setTranslation] = useState<Translation>();\n const [catalog, setCatalog] = useState<Translation[\"layout\"]>();\n const [layoutError, setLayoutError] = useState(\"\");\n const [error, setError] = useState(\"\");\n const [busy, setBusy] = useState(false);\n const search = draft.search as EsSearch | undefined;\n const signature = JSON.stringify({\n profile: draft.profile,\n provider: draft.provider,\n search: draft.search,\n spans: draft.spans,\n params: draft.params,\n });\n const sourceSignature = JSON.stringify({\n profile: draft.profile,\n provider: draft.provider,\n spans: draft.spans,\n params: draft.params,\n });\n useEffect(() => {\n if (!search) return;\n setCatalog(undefined);\n setLayoutError(\"\");\n const controller = new AbortController();\n const timer = setTimeout(() => {\n void translate(JSON.parse(sourceSignature) as ProfileWizardDraft, {\n direction: \"source\",\n signal: controller.signal,\n layoutOnly: true,\n })\n .then((result) => {\n if (!controller.signal.aborted) setCatalog(result.layout);\n })\n .catch((failure: unknown) => {\n if (!controller.signal.aborted) setLayoutError(String(failure));\n });\n }, 250);\n return () => {\n controller.abort();\n clearTimeout(timer);\n };\n }, [sourceSignature, Boolean(search)]);\n useEffect(() => {\n if (!search) return;\n setTranslation(undefined);\n const controller = new AbortController();\n const timer = setTimeout(() => {\n setError(\"\");\n void translate(JSON.parse(signature) as ProfileWizardDraft, {\n direction: \"source\",\n signal: controller.signal,\n })\n .then((result) => {\n if (!controller.signal.aborted) setTranslation(result);\n })\n .catch((failure: unknown) => {\n if (!controller.signal.aborted) setError(String(failure));\n });\n }, 250);\n return () => {\n controller.abort();\n clearTimeout(timer);\n };\n }, [signature, Boolean(search)]);\n const convert = async () => {\n setBusy(true);\n setError(\"\");\n try {\n const result = await translate(draft, { direction: \"canonical\" });\n const options = { ...draft.provider?.options };\n delete options.search;\n onChange({\n ...draft,\n query: \"\",\n search: result.search,\n provider: { ...draft.provider, options },\n });\n setTranslation(result);\n setCatalog(result.layout);\n } catch (failure) {\n setError(String(failure));\n } finally {\n setBusy(false);\n }\n };\n const sample = async () => {\n setBusy(true);\n setError(\"\");\n try {\n const response = await fetch(profileApiPath(\"profile/sample\"), {\n method: \"POST\",\n headers: { \"Content-Type\": \"application/json\" },\n body: JSON.stringify({\n profile: sampleRequestProfile(draft),\n params: defaultParamValues(draft.params),\n previewProcessors: true,\n }),\n });\n if (!response.ok) throw new Error(await response.text());\n const result = (await response.json()) as Omit<\n ProfileSample,\n \"sourceDraft\"\n >;\n onSample({ ...result, sourceDraft: draft });\n } catch (failure) {\n setError(String(failure));\n } finally {\n setBusy(false);\n }\n };\n const fields: EsFieldMapping[] = Object.entries(catalog?.fields ?? {}).map(\n ([name, field]) => ({\n name,\n dataType:\n name === \"timestamp\"\n ? \"date\"\n : name === \"duration_ms\"\n ? \"double\"\n : name === \"status\"\n ? \"keyword\"\n : (field.type ?? \"keyword\"),\n searchable: true,\n aggregatable: true,\n }),\n );\n const optionsSchema = providerOptionsSchema(draft.provider?.type ?? \"\", \"query\");\n if (optionsSchema.properties) delete optionsSchema.properties.search;\n return (\n <section className=\"space-y-4 rounded-lg border bg-card p-4\">\n <h2 className=\"text-lg font-semibold\">Logical span conditions</h2>\n <p className=\"text-sm text-muted-foreground\">\n Canonical conditions stay with the profile. Each connection resolves its\n index fields and units.\n </p>\n {error || layoutError ? (\n <p role=\"alert\" className=\"text-sm text-destructive\">\n {error || layoutError}\n </p>\n ) : null}\n {search ? (\n <>\n <JsonSchemaForm\n schema={optionsSchema}\n value={draft.provider?.options ?? {}}\n onChange={(options) =>\n onChange({ ...draft, provider: { ...draft.provider, options } })\n }\n idPrefix=\"canonical-source\"\n showPreferencesMenu={false}\n />\n <EsQueryBuilder\n search={search}\n fields={fields}\n vocabulary={esBuilderVocabulary(profileSchema())}\n params={draft.params ?? []}\n onChange={(next) => onChange({ ...draft, search: next })}\n onMappingChange={(edit) =>\n onChange({ ...draft, search: edit.search, params: edit.params })\n }\n />\n <Button type=\"button\" disabled={busy} onClick={() => void sample()}>\n {busy ? \"Running…\" : \"Run sample\"}\n </Button>\n <details open>\n <summary className=\"cursor-pointer text-sm font-medium\">\n Resolved OpenSearch query\n </summary>\n <pre className=\"mt-2 overflow-auto text-xs\">\n {translation\n ? JSON.stringify(translation.native, null, 2)\n : \"Resolving connection layout…\"}\n </pre>\n </details>\n </>\n ) : (\n <Button type=\"button\" disabled={busy} onClick={() => void convert()}>\n {busy ? \"Resolving layout…\" : \"Use canonical conditions\"}\n </Button>\n )}\n </section>\n );\n}\n"],"mappings":";;;;;;;;;;;AAsBA,eAAe,UACb,OACA,EACE,WACA,QACA,aAAa,SAMO;CACtB,MAAM,WAAW,MAAM,MAAMA,mBAAAA,eAAe,sBAAsB,GAAG;EACnE,QAAQ;EACR,SAAS,EAAE,gBAAgB,mBAAmB;EAC9C,MAAM,KAAK,UAAU;GACnB,SAAS;IACP,SAAS,MAAM;IACf,UAAU,MAAM;IAChB,QAAQ,MAAM;IACd,OAAO,MAAM;IACb,QAAQ,MAAM;GAChB;GACA;GACA,QAAQC,2BAAAA,mBAAmB,MAAM,MAAM;GACvC,GAAI,aACA,EAAE,OAAO,CAAC,EAAE,IACZ,cAAc,eAAe,MAAM,QACjC,EAAE,OAAO,KAAK,MAAM,MAAM,KAAK,EAAE,IACjC,CAAC;EACT,CAAC;EACD,GAAI,SAAS,EAAE,OAAO,IAAI,CAAC;CAC7B,CAAC;CACD,IAAI,CAAC,SAAS,IAAI,MAAM,IAAI,MAAM,MAAM,SAAS,KAAK,CAAC;CACvD,OAAO,SAAS,KAAK;AACvB;AAEA,SAAgB,sBAAsB,EACpC,OACA,UACA,YAKC;CACD,MAAM,CAAC,aAAa,mBAAA,GAAkBC,MAAAA,SAAAA,CAAsB;CAC5D,MAAM,CAAC,SAAS,eAAA,GAAcA,MAAAA,SAAAA,CAAgC;CAC9D,MAAM,CAAC,aAAa,mBAAA,GAAkBA,MAAAA,SAAAA,CAAS,EAAE;CACjD,MAAM,CAAC,OAAO,aAAA,GAAYA,MAAAA,SAAAA,CAAS,EAAE;CACrC,MAAM,CAAC,MAAM,YAAA,GAAWA,MAAAA,SAAAA,CAAS,KAAK;CACtC,MAAM,SAAS,MAAM;CACrB,MAAM,YAAY,KAAK,UAAU;EAC/B,SAAS,MAAM;EACf,UAAU,MAAM;EAChB,QAAQ,MAAM;EACd,OAAO,MAAM;EACb,QAAQ,MAAM;CAChB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AA,GAAA,kBAAA,IAAA,CAAC,WAAD;MAAS,WAAU;MAAqC,UAAA;KAE/C,CAAA,GACT,iBAAA,GAAA,kBAAA,IAAA,CAAC,OAAD;MAAK,WAAU;MACZ,UAAA,cACG,KAAK,UAAU,YAAY,QAAQ,MAAM,CAAC,IAC1C;KACD,CAAA,CACE;;GACT,EAAA,CAAA,IAEF,iBAAA,GAAA,kBAAA,IAAA,CAACA,eAAAA,QAAD;IAAQ,MAAK;IAAS,UAAU;IAAM,eAAe,KAAK,QAAQ;IAC/D,UAAA,OAAO,sBAAsB;GACxB,CAAA;EAEH;;AAEb"}
|
|
1
|
+
{"version":3,"file":"profileCanonicalQuery.cjs","names":["useState","translate","profileApiPath","sampleRequestProfile","defaultParamValues","providerOptionsSchema","_Fragment","JsonSchemaForm","EsQueryBuilder","esBuilderVocabulary","profileSchema","Button"],"sources":["../../../src/profiles/editor/profileCanonicalQuery.tsx"],"sourcesContent":["import { useEffect, useState } from \"react\";\nimport { Button } from \"../../components/button\";\nimport { JsonSchemaForm } from \"../../components/JsonSchemaForm\";\nimport { EsQueryBuilder } from \"../elasticsearch/esQueryBuilder\";\nimport {\n esBuilderVocabulary,\n type EsFieldMapping,\n} from \"../elasticsearch/esQueryOperators\";\nimport { defaultParamValues } from \"../elasticsearch/esQueryBuilderForm\";\nimport type { EsSearch } from \"../elasticsearch/esQueryBuilderModel\";\nimport { profileApiPath, profileSchema } from \"../profileApi\";\nimport { sampleRequestProfile } from \"../query/jsonPathSample\";\nimport type { ProfileSample } from \"../wizard/profileWizardQueryStep\";\nimport type { ProfileWizardDraft } from \"../wizard/profileWizardModel\";\nimport { translate, type Translation } from \"./profileCanonicalTranslate\";\nimport { providerOptionsSchema } from \"./profileEditorModel\";\n\nexport function ProfileCanonicalQuery({\n draft,\n onChange,\n onSample,\n}: {\n draft: ProfileWizardDraft;\n onChange: (next: ProfileWizardDraft) => void;\n onSample: (sample: ProfileSample) => void;\n}) {\n const [translation, setTranslation] = useState<Translation>();\n const [catalog, setCatalog] = useState<Translation[\"layout\"]>();\n const [layoutError, setLayoutError] = useState(\"\");\n const [error, setError] = useState(\"\");\n const [busy, setBusy] = useState(false);\n const search = draft.search as EsSearch | undefined;\n const signature = JSON.stringify({\n profile: draft.profile,\n provider: draft.provider,\n search: draft.search,\n spans: draft.spans,\n params: draft.params,\n });\n const sourceSignature = JSON.stringify({\n profile: draft.profile,\n provider: draft.provider,\n spans: draft.spans,\n params: draft.params,\n });\n useEffect(() => {\n if (!search) return;\n setCatalog(undefined);\n setLayoutError(\"\");\n const controller = new AbortController();\n const timer = setTimeout(() => {\n void translate(JSON.parse(sourceSignature) as ProfileWizardDraft, {\n direction: \"source\",\n signal: controller.signal,\n layoutOnly: true,\n })\n .then((result) => {\n if (!controller.signal.aborted) setCatalog(result.layout);\n })\n .catch((failure: unknown) => {\n if (!controller.signal.aborted) setLayoutError(String(failure));\n });\n }, 250);\n return () => {\n controller.abort();\n clearTimeout(timer);\n };\n }, [sourceSignature, Boolean(search)]);\n useEffect(() => {\n if (!search) return;\n setTranslation(undefined);\n const controller = new AbortController();\n const timer = setTimeout(() => {\n setError(\"\");\n void translate(JSON.parse(signature) as ProfileWizardDraft, {\n direction: \"source\",\n signal: controller.signal,\n })\n .then((result) => {\n if (!controller.signal.aborted) setTranslation(result);\n })\n .catch((failure: unknown) => {\n if (!controller.signal.aborted) setError(String(failure));\n });\n }, 250);\n return () => {\n controller.abort();\n clearTimeout(timer);\n };\n }, [signature, Boolean(search)]);\n const sample = async () => {\n setBusy(true);\n setError(\"\");\n try {\n const response = await fetch(profileApiPath(\"profile/sample\"), {\n method: \"POST\",\n headers: { \"Content-Type\": \"application/json\" },\n body: JSON.stringify({\n profile: sampleRequestProfile(draft),\n params: defaultParamValues(draft.params),\n previewProcessors: true,\n }),\n });\n if (!response.ok) throw new Error(await response.text());\n const result = (await response.json()) as Omit<\n ProfileSample,\n \"sourceDraft\"\n >;\n onSample({ ...result, sourceDraft: draft });\n } catch (failure) {\n setError(String(failure));\n } finally {\n setBusy(false);\n }\n };\n const fields: EsFieldMapping[] = Object.entries(catalog?.fields ?? {}).map(\n ([name, field]) => ({\n name,\n dataType:\n name === \"timestamp\"\n ? \"date\"\n : name === \"duration_ms\"\n ? \"double\"\n : name === \"status\"\n ? \"keyword\"\n : (field.type ?? \"keyword\"),\n searchable: true,\n aggregatable: true,\n }),\n );\n const optionsSchema = providerOptionsSchema(draft.provider?.type ?? \"\", \"query\");\n if (optionsSchema.properties) delete optionsSchema.properties.search;\n // Switching to canonical conditions is offered from the Source help, where the\n // idea is explained; this is the query editor once a profile has them.\n if (!search) return null;\n return (\n <section className=\"space-y-4 rounded-lg border bg-card p-4\">\n <h2 className=\"text-lg font-semibold\">Query conditions</h2>\n {error || layoutError ? (\n <p role=\"alert\" className=\"text-sm text-destructive\">\n {error || layoutError}\n </p>\n ) : null}\n {search ? (\n <>\n <JsonSchemaForm\n schema={optionsSchema}\n value={draft.provider?.options ?? {}}\n onChange={(options) =>\n onChange({ ...draft, provider: { ...draft.provider, options } })\n }\n idPrefix=\"canonical-source\"\n showPreferencesMenu={false}\n />\n <EsQueryBuilder\n search={search}\n fields={fields}\n vocabulary={esBuilderVocabulary(profileSchema())}\n params={draft.params ?? []}\n onChange={(next) => onChange({ ...draft, search: next })}\n onMappingChange={(edit) =>\n onChange({ ...draft, search: edit.search, params: edit.params })\n }\n />\n <Button type=\"button\" disabled={busy} onClick={() => void sample()}>\n {busy ? \"Running…\" : \"Run sample\"}\n </Button>\n <details open>\n <summary className=\"cursor-pointer text-sm font-medium\">\n Resolved OpenSearch query\n </summary>\n <pre className=\"mt-2 overflow-auto text-xs\">\n {translation\n ? JSON.stringify(translation.native, null, 2)\n : \"Resolving connection layout…\"}\n </pre>\n </details>\n </>\n ) : null}\n </section>\n );\n}\n"],"mappings":";;;;;;;;;;;;AAiBA,SAAgB,sBAAsB,EACpC,OACA,UACA,YAKC;CACD,MAAM,CAAC,aAAa,mBAAA,GAAkBA,MAAAA,SAAA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AA;KAE/C,CAAA,GACT,iBAAA,GAAA,kBAAA,IAAA,CAAC,OAAD;MAAK,WAAU;MACZ,UAAA,cACG,KAAK,UAAU,YAAY,QAAQ,MAAM,CAAC,IAC1C;KACD,CAAA,CACE;;GACT,EAAA,CAAA,IACA;EACG;;AAEb"}
|
|
@@ -4,5 +4,5 @@ export declare function ProfileCanonicalQuery({ draft, onChange, onSample, }: {
|
|
|
4
4
|
draft: ProfileWizardDraft;
|
|
5
5
|
onChange: (next: ProfileWizardDraft) => void;
|
|
6
6
|
onSample: (sample: ProfileSample) => void;
|
|
7
|
-
}): import("react").JSX.Element;
|
|
7
|
+
}): import("react").JSX.Element | null;
|
|
8
8
|
//# sourceMappingURL=profileCanonicalQuery.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"profileCanonicalQuery.d.ts","sourceRoot":"","sources":["../../../src/profiles/editor/profileCanonicalQuery.tsx"],"names":[],"mappings":"AAYA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,kCAAkC,CAAC;AACtE,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,8BAA8B,CAAC;
|
|
1
|
+
{"version":3,"file":"profileCanonicalQuery.d.ts","sourceRoot":"","sources":["../../../src/profiles/editor/profileCanonicalQuery.tsx"],"names":[],"mappings":"AAYA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,kCAAkC,CAAC;AACtE,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,8BAA8B,CAAC;AAIvE,wBAAgB,qBAAqB,CAAC,EACpC,KAAK,EACL,QAAQ,EACR,QAAQ,GACT,EAAE;IACD,KAAK,EAAE,kBAAkB,CAAC;IAC1B,QAAQ,EAAE,CAAC,IAAI,EAAE,kBAAkB,KAAK,IAAI,CAAC;IAC7C,QAAQ,EAAE,CAAC,MAAM,EAAE,aAAa,KAAK,IAAI,CAAC;CAC3C,sCA4JA"}
|
|
@@ -5,31 +5,11 @@ import { esBuilderVocabulary } from "../elasticsearch/esQueryOperators.js";
|
|
|
5
5
|
import { defaultParamValues } from "../elasticsearch/esQueryBuilderForm.js";
|
|
6
6
|
import { profileApiPath, profileSchema } from "../profileApi.js";
|
|
7
7
|
import { sampleRequestProfile } from "../query/jsonPathSample.js";
|
|
8
|
+
import { translate } from "./profileCanonicalTranslate.js";
|
|
8
9
|
import { providerOptionsSchema } from "./profileEditorModel.js";
|
|
9
10
|
import { useEffect, useState } from "react";
|
|
10
11
|
import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
|
|
11
12
|
// src/profiles/editor/profileCanonicalQuery.tsx
|
|
12
|
-
async function translate(draft, { direction, signal, layoutOnly = false }) {
|
|
13
|
-
const response = await fetch(profileApiPath("profile/sample/query"), {
|
|
14
|
-
method: "POST",
|
|
15
|
-
headers: { "Content-Type": "application/json" },
|
|
16
|
-
body: JSON.stringify({
|
|
17
|
-
profile: {
|
|
18
|
-
profile: draft.profile,
|
|
19
|
-
provider: draft.provider,
|
|
20
|
-
search: draft.search,
|
|
21
|
-
spans: draft.spans,
|
|
22
|
-
params: draft.params
|
|
23
|
-
},
|
|
24
|
-
direction,
|
|
25
|
-
params: defaultParamValues(draft.params),
|
|
26
|
-
...layoutOnly ? { query: {} } : direction === "canonical" && draft.query ? { query: JSON.parse(draft.query) } : {}
|
|
27
|
-
}),
|
|
28
|
-
...signal ? { signal } : {}
|
|
29
|
-
});
|
|
30
|
-
if (!response.ok) throw new Error(await response.text());
|
|
31
|
-
return response.json();
|
|
32
|
-
}
|
|
33
13
|
function ProfileCanonicalQuery({ draft, onChange, onSample }) {
|
|
34
14
|
const [translation, setTranslation] = useState();
|
|
35
15
|
const [catalog, setCatalog] = useState();
|
|
@@ -91,30 +71,6 @@ function ProfileCanonicalQuery({ draft, onChange, onSample }) {
|
|
|
91
71
|
clearTimeout(timer);
|
|
92
72
|
};
|
|
93
73
|
}, [signature, Boolean(search)]);
|
|
94
|
-
const convert = async () => {
|
|
95
|
-
setBusy(true);
|
|
96
|
-
setError("");
|
|
97
|
-
try {
|
|
98
|
-
const result = await translate(draft, { direction: "canonical" });
|
|
99
|
-
const options = { ...draft.provider?.options };
|
|
100
|
-
delete options.search;
|
|
101
|
-
onChange({
|
|
102
|
-
...draft,
|
|
103
|
-
query: "",
|
|
104
|
-
search: result.search,
|
|
105
|
-
provider: {
|
|
106
|
-
...draft.provider,
|
|
107
|
-
options
|
|
108
|
-
}
|
|
109
|
-
});
|
|
110
|
-
setTranslation(result);
|
|
111
|
-
setCatalog(result.layout);
|
|
112
|
-
} catch (failure) {
|
|
113
|
-
setError(String(failure));
|
|
114
|
-
} finally {
|
|
115
|
-
setBusy(false);
|
|
116
|
-
}
|
|
117
|
-
};
|
|
118
74
|
const sample = async () => {
|
|
119
75
|
setBusy(true);
|
|
120
76
|
setError("");
|
|
@@ -147,16 +103,13 @@ function ProfileCanonicalQuery({ draft, onChange, onSample }) {
|
|
|
147
103
|
}));
|
|
148
104
|
const optionsSchema = providerOptionsSchema(draft.provider?.type ?? "", "query");
|
|
149
105
|
if (optionsSchema.properties) delete optionsSchema.properties.search;
|
|
106
|
+
if (!search) return null;
|
|
150
107
|
return /* @__PURE__ */ jsxs("section", {
|
|
151
108
|
className: "space-y-4 rounded-lg border bg-card p-4",
|
|
152
109
|
children: [
|
|
153
110
|
/* @__PURE__ */ jsx("h2", {
|
|
154
111
|
className: "text-lg font-semibold",
|
|
155
|
-
children: "
|
|
156
|
-
}),
|
|
157
|
-
/* @__PURE__ */ jsx("p", {
|
|
158
|
-
className: "text-sm text-muted-foreground",
|
|
159
|
-
children: "Canonical conditions stay with the profile. Each connection resolves its index fields and units."
|
|
112
|
+
children: "Query conditions"
|
|
160
113
|
}),
|
|
161
114
|
error || layoutError ? /* @__PURE__ */ jsx("p", {
|
|
162
115
|
role: "alert",
|
|
@@ -208,12 +161,7 @@ function ProfileCanonicalQuery({ draft, onChange, onSample }) {
|
|
|
208
161
|
children: translation ? JSON.stringify(translation.native, null, 2) : "Resolving connection layout…"
|
|
209
162
|
})]
|
|
210
163
|
})
|
|
211
|
-
] }) :
|
|
212
|
-
type: "button",
|
|
213
|
-
disabled: busy,
|
|
214
|
-
onClick: () => void convert(),
|
|
215
|
-
children: busy ? "Resolving layout…" : "Use canonical conditions"
|
|
216
|
-
})
|
|
164
|
+
] }) : null
|
|
217
165
|
]
|
|
218
166
|
});
|
|
219
167
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"profileCanonicalQuery.js","names":["_Fragment"],"sources":["../../../src/profiles/editor/profileCanonicalQuery.tsx"],"sourcesContent":["import { useEffect, useState } from \"react\";\nimport { Button } from \"../../components/button\";\nimport { JsonSchemaForm } from \"../../components/JsonSchemaForm\";\nimport { EsQueryBuilder } from \"../elasticsearch/esQueryBuilder\";\nimport {\n esBuilderVocabulary,\n type EsFieldMapping,\n} from \"../elasticsearch/esQueryOperators\";\nimport { defaultParamValues } from \"../elasticsearch/esQueryBuilderForm\";\nimport type { EsSearch } from \"../elasticsearch/esQueryBuilderModel\";\nimport { profileApiPath, profileSchema } from \"../profileApi\";\nimport { sampleRequestProfile } from \"../query/jsonPathSample\";\nimport type { ProfileSample } from \"../wizard/profileWizardQueryStep\";\nimport type { ProfileWizardDraft } from \"../wizard/profileWizardModel\";\nimport { providerOptionsSchema } from \"./profileEditorModel\";\n\ntype Translation = {\n search: EsSearch;\n native: unknown;\n layout: { fields: Record<string, { type?: string }> };\n};\n\nasync function translate(\n draft: ProfileWizardDraft,\n {\n direction,\n signal,\n layoutOnly = false,\n }: {\n direction: \"source\" | \"canonical\";\n signal?: AbortSignal;\n layoutOnly?: boolean;\n },\n): Promise<Translation> {\n const response = await fetch(profileApiPath(\"profile/sample/query\"), {\n method: \"POST\",\n headers: { \"Content-Type\": \"application/json\" },\n body: JSON.stringify({\n profile: {\n profile: draft.profile,\n provider: draft.provider,\n search: draft.search,\n spans: draft.spans,\n params: draft.params,\n },\n direction,\n params: defaultParamValues(draft.params),\n ...(layoutOnly\n ? { query: {} }\n : direction === \"canonical\" && draft.query\n ? { query: JSON.parse(draft.query) }\n : {}),\n }),\n ...(signal ? { signal } : {}),\n });\n if (!response.ok) throw new Error(await response.text());\n return response.json() as Promise<Translation>;\n}\n\nexport function ProfileCanonicalQuery({\n draft,\n onChange,\n onSample,\n}: {\n draft: ProfileWizardDraft;\n onChange: (next: ProfileWizardDraft) => void;\n onSample: (sample: ProfileSample) => void;\n}) {\n const [translation, setTranslation] = useState<Translation>();\n const [catalog, setCatalog] = useState<Translation[\"layout\"]>();\n const [layoutError, setLayoutError] = useState(\"\");\n const [error, setError] = useState(\"\");\n const [busy, setBusy] = useState(false);\n const search = draft.search as EsSearch | undefined;\n const signature = JSON.stringify({\n profile: draft.profile,\n provider: draft.provider,\n search: draft.search,\n spans: draft.spans,\n params: draft.params,\n });\n const sourceSignature = JSON.stringify({\n profile: draft.profile,\n provider: draft.provider,\n spans: draft.spans,\n params: draft.params,\n });\n useEffect(() => {\n if (!search) return;\n setCatalog(undefined);\n setLayoutError(\"\");\n const controller = new AbortController();\n const timer = setTimeout(() => {\n void translate(JSON.parse(sourceSignature) as ProfileWizardDraft, {\n direction: \"source\",\n signal: controller.signal,\n layoutOnly: true,\n })\n .then((result) => {\n if (!controller.signal.aborted) setCatalog(result.layout);\n })\n .catch((failure: unknown) => {\n if (!controller.signal.aborted) setLayoutError(String(failure));\n });\n }, 250);\n return () => {\n controller.abort();\n clearTimeout(timer);\n };\n }, [sourceSignature, Boolean(search)]);\n useEffect(() => {\n if (!search) return;\n setTranslation(undefined);\n const controller = new AbortController();\n const timer = setTimeout(() => {\n setError(\"\");\n void translate(JSON.parse(signature) as ProfileWizardDraft, {\n direction: \"source\",\n signal: controller.signal,\n })\n .then((result) => {\n if (!controller.signal.aborted) setTranslation(result);\n })\n .catch((failure: unknown) => {\n if (!controller.signal.aborted) setError(String(failure));\n });\n }, 250);\n return () => {\n controller.abort();\n clearTimeout(timer);\n };\n }, [signature, Boolean(search)]);\n const convert = async () => {\n setBusy(true);\n setError(\"\");\n try {\n const result = await translate(draft, { direction: \"canonical\" });\n const options = { ...draft.provider?.options };\n delete options.search;\n onChange({\n ...draft,\n query: \"\",\n search: result.search,\n provider: { ...draft.provider, options },\n });\n setTranslation(result);\n setCatalog(result.layout);\n } catch (failure) {\n setError(String(failure));\n } finally {\n setBusy(false);\n }\n };\n const sample = async () => {\n setBusy(true);\n setError(\"\");\n try {\n const response = await fetch(profileApiPath(\"profile/sample\"), {\n method: \"POST\",\n headers: { \"Content-Type\": \"application/json\" },\n body: JSON.stringify({\n profile: sampleRequestProfile(draft),\n params: defaultParamValues(draft.params),\n previewProcessors: true,\n }),\n });\n if (!response.ok) throw new Error(await response.text());\n const result = (await response.json()) as Omit<\n ProfileSample,\n \"sourceDraft\"\n >;\n onSample({ ...result, sourceDraft: draft });\n } catch (failure) {\n setError(String(failure));\n } finally {\n setBusy(false);\n }\n };\n const fields: EsFieldMapping[] = Object.entries(catalog?.fields ?? {}).map(\n ([name, field]) => ({\n name,\n dataType:\n name === \"timestamp\"\n ? \"date\"\n : name === \"duration_ms\"\n ? \"double\"\n : name === \"status\"\n ? \"keyword\"\n : (field.type ?? \"keyword\"),\n searchable: true,\n aggregatable: true,\n }),\n );\n const optionsSchema = providerOptionsSchema(draft.provider?.type ?? \"\", \"query\");\n if (optionsSchema.properties) delete optionsSchema.properties.search;\n return (\n <section className=\"space-y-4 rounded-lg border bg-card p-4\">\n <h2 className=\"text-lg font-semibold\">Logical span conditions</h2>\n <p className=\"text-sm text-muted-foreground\">\n Canonical conditions stay with the profile. Each connection resolves its\n index fields and units.\n </p>\n {error || layoutError ? (\n <p role=\"alert\" className=\"text-sm text-destructive\">\n {error || layoutError}\n </p>\n ) : null}\n {search ? (\n <>\n <JsonSchemaForm\n schema={optionsSchema}\n value={draft.provider?.options ?? {}}\n onChange={(options) =>\n onChange({ ...draft, provider: { ...draft.provider, options } })\n }\n idPrefix=\"canonical-source\"\n showPreferencesMenu={false}\n />\n <EsQueryBuilder\n search={search}\n fields={fields}\n vocabulary={esBuilderVocabulary(profileSchema())}\n params={draft.params ?? []}\n onChange={(next) => onChange({ ...draft, search: next })}\n onMappingChange={(edit) =>\n onChange({ ...draft, search: edit.search, params: edit.params })\n }\n />\n <Button type=\"button\" disabled={busy} onClick={() => void sample()}>\n {busy ? \"Running…\" : \"Run sample\"}\n </Button>\n <details open>\n <summary className=\"cursor-pointer text-sm font-medium\">\n Resolved OpenSearch query\n </summary>\n <pre className=\"mt-2 overflow-auto text-xs\">\n {translation\n ? JSON.stringify(translation.native, null, 2)\n : \"Resolving connection layout…\"}\n </pre>\n </details>\n </>\n ) : (\n <Button type=\"button\" disabled={busy} onClick={() => void convert()}>\n {busy ? \"Resolving layout…\" : \"Use canonical conditions\"}\n </Button>\n )}\n </section>\n );\n}\n"],"mappings":";;;;;;;;;;;AAsBA,eAAe,UACb,OACA,EACE,WACA,QACA,aAAa,SAMO;CACtB,MAAM,WAAW,MAAM,MAAM,eAAe,sBAAsB,GAAG;EACnE,QAAQ;EACR,SAAS,EAAE,gBAAgB,mBAAmB;EAC9C,MAAM,KAAK,UAAU;GACnB,SAAS;IACP,SAAS,MAAM;IACf,UAAU,MAAM;IAChB,QAAQ,MAAM;IACd,OAAO,MAAM;IACb,QAAQ,MAAM;GAChB;GACA;GACA,QAAQ,mBAAmB,MAAM,MAAM;GACvC,GAAI,aACA,EAAE,OAAO,CAAC,EAAE,IACZ,cAAc,eAAe,MAAM,QACjC,EAAE,OAAO,KAAK,MAAM,MAAM,KAAK,EAAE,IACjC,CAAC;EACT,CAAC;EACD,GAAI,SAAS,EAAE,OAAO,IAAI,CAAC;CAC7B,CAAC;CACD,IAAI,CAAC,SAAS,IAAI,MAAM,IAAI,MAAM,MAAM,SAAS,KAAK,CAAC;CACvD,OAAO,SAAS,KAAK;AACvB;AAEA,SAAgB,sBAAsB,EACpC,OACA,UACA,YAKC;CACD,MAAM,CAAC,aAAa,kBAAkB,SAAsB;CAC5D,MAAM,CAAC,SAAS,cAA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WAAU;MACZ,UAAA,cACG,KAAK,UAAU,YAAY,QAAQ,MAAM,CAAC,IAC1C;KACD,CAAA,CACE;;GACT,EAAA,CAAA,IAEF,oBAAC,QAAD;IAAQ,MAAK;IAAS,UAAU;IAAM,eAAe,KAAK,QAAQ;IAC/D,UAAA,OAAO,sBAAsB;GACxB,CAAA;EAEH;;AAEb"}
|
|
1
|
+
{"version":3,"file":"profileCanonicalQuery.js","names":["_Fragment"],"sources":["../../../src/profiles/editor/profileCanonicalQuery.tsx"],"sourcesContent":["import { useEffect, useState } from \"react\";\nimport { Button } from \"../../components/button\";\nimport { JsonSchemaForm } from \"../../components/JsonSchemaForm\";\nimport { EsQueryBuilder } from \"../elasticsearch/esQueryBuilder\";\nimport {\n esBuilderVocabulary,\n type EsFieldMapping,\n} from \"../elasticsearch/esQueryOperators\";\nimport { defaultParamValues } from \"../elasticsearch/esQueryBuilderForm\";\nimport type { EsSearch } from \"../elasticsearch/esQueryBuilderModel\";\nimport { profileApiPath, profileSchema } from \"../profileApi\";\nimport { sampleRequestProfile } from \"../query/jsonPathSample\";\nimport type { ProfileSample } from \"../wizard/profileWizardQueryStep\";\nimport type { ProfileWizardDraft } from \"../wizard/profileWizardModel\";\nimport { translate, type Translation } from \"./profileCanonicalTranslate\";\nimport { providerOptionsSchema } from \"./profileEditorModel\";\n\nexport function ProfileCanonicalQuery({\n draft,\n onChange,\n onSample,\n}: {\n draft: ProfileWizardDraft;\n onChange: (next: ProfileWizardDraft) => void;\n onSample: (sample: ProfileSample) => void;\n}) {\n const [translation, setTranslation] = useState<Translation>();\n const [catalog, setCatalog] = useState<Translation[\"layout\"]>();\n const [layoutError, setLayoutError] = useState(\"\");\n const [error, setError] = useState(\"\");\n const [busy, setBusy] = useState(false);\n const search = draft.search as EsSearch | undefined;\n const signature = JSON.stringify({\n profile: draft.profile,\n provider: draft.provider,\n search: draft.search,\n spans: draft.spans,\n params: draft.params,\n });\n const sourceSignature = JSON.stringify({\n profile: draft.profile,\n provider: draft.provider,\n spans: draft.spans,\n params: draft.params,\n });\n useEffect(() => {\n if (!search) return;\n setCatalog(undefined);\n setLayoutError(\"\");\n const controller = new AbortController();\n const timer = setTimeout(() => {\n void translate(JSON.parse(sourceSignature) as ProfileWizardDraft, {\n direction: \"source\",\n signal: controller.signal,\n layoutOnly: true,\n })\n .then((result) => {\n if (!controller.signal.aborted) setCatalog(result.layout);\n })\n .catch((failure: unknown) => {\n if (!controller.signal.aborted) setLayoutError(String(failure));\n });\n }, 250);\n return () => {\n controller.abort();\n clearTimeout(timer);\n };\n }, [sourceSignature, Boolean(search)]);\n useEffect(() => {\n if (!search) return;\n setTranslation(undefined);\n const controller = new AbortController();\n const timer = setTimeout(() => {\n setError(\"\");\n void translate(JSON.parse(signature) as ProfileWizardDraft, {\n direction: \"source\",\n signal: controller.signal,\n })\n .then((result) => {\n if (!controller.signal.aborted) setTranslation(result);\n })\n .catch((failure: unknown) => {\n if (!controller.signal.aborted) setError(String(failure));\n });\n }, 250);\n return () => {\n controller.abort();\n clearTimeout(timer);\n };\n }, [signature, Boolean(search)]);\n const sample = async () => {\n setBusy(true);\n setError(\"\");\n try {\n const response = await fetch(profileApiPath(\"profile/sample\"), {\n method: \"POST\",\n headers: { \"Content-Type\": \"application/json\" },\n body: JSON.stringify({\n profile: sampleRequestProfile(draft),\n params: defaultParamValues(draft.params),\n previewProcessors: true,\n }),\n });\n if (!response.ok) throw new Error(await response.text());\n const result = (await response.json()) as Omit<\n ProfileSample,\n \"sourceDraft\"\n >;\n onSample({ ...result, sourceDraft: draft });\n } catch (failure) {\n setError(String(failure));\n } finally {\n setBusy(false);\n }\n };\n const fields: EsFieldMapping[] = Object.entries(catalog?.fields ?? {}).map(\n ([name, field]) => ({\n name,\n dataType:\n name === \"timestamp\"\n ? \"date\"\n : name === \"duration_ms\"\n ? \"double\"\n : name === \"status\"\n ? \"keyword\"\n : (field.type ?? \"keyword\"),\n searchable: true,\n aggregatable: true,\n }),\n );\n const optionsSchema = providerOptionsSchema(draft.provider?.type ?? \"\", \"query\");\n if (optionsSchema.properties) delete optionsSchema.properties.search;\n // Switching to canonical conditions is offered from the Source help, where the\n // idea is explained; this is the query editor once a profile has them.\n if (!search) return null;\n return (\n <section className=\"space-y-4 rounded-lg border bg-card p-4\">\n <h2 className=\"text-lg font-semibold\">Query conditions</h2>\n {error || layoutError ? (\n <p role=\"alert\" className=\"text-sm text-destructive\">\n {error || layoutError}\n </p>\n ) : null}\n {search ? (\n <>\n <JsonSchemaForm\n schema={optionsSchema}\n value={draft.provider?.options ?? {}}\n onChange={(options) =>\n onChange({ ...draft, provider: { ...draft.provider, options } })\n }\n idPrefix=\"canonical-source\"\n showPreferencesMenu={false}\n />\n <EsQueryBuilder\n search={search}\n fields={fields}\n vocabulary={esBuilderVocabulary(profileSchema())}\n params={draft.params ?? []}\n onChange={(next) => onChange({ ...draft, search: next })}\n onMappingChange={(edit) =>\n onChange({ ...draft, search: edit.search, params: edit.params })\n }\n />\n <Button type=\"button\" disabled={busy} onClick={() => void sample()}>\n {busy ? \"Running…\" : \"Run sample\"}\n </Button>\n <details open>\n <summary className=\"cursor-pointer text-sm font-medium\">\n Resolved OpenSearch query\n </summary>\n <pre className=\"mt-2 overflow-auto text-xs\">\n {translation\n ? JSON.stringify(translation.native, null, 2)\n : \"Resolving connection layout…\"}\n </pre>\n </details>\n </>\n ) : null}\n </section>\n );\n}\n"],"mappings":";;;;;;;;;;;;AAiBA,SAAgB,sBAAsB,EACpC,OACA,UACA,YAKC;CACD,MAAM,CAAC,aAAa,kBAAkB,SAAsB;CAC5D,MAAM,CAAC,SAAS,cAAc,SAAgC;CAC9D,MAAM,CAAC,aAAa,kBAAkB,SAAS,EAAE;CACjD,MAAM,CAAC,OAAO,YAAY,SAAS,EAAE;CACrC,MAAM,CAAC,MAAM,WAAW,SAAS,KAAK;CACtC,MAAM,SAAS,MAAM;CACrB,MAAM,YAAY,KAAK,UAAU;EAC/B,SAAS,MAAM;EACf,UAAU,MAAM;EAChB,QA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AAE,CAAC;KAEjE,UAAS;KACT,qBAAqB;IACtB,CAAA;IACD,oBAAC,gBAAD;KACU;KACA;KACR,YAAY,oBAAoB,cAAc,CAAC;KAC/C,QAAQ,MAAM,UAAU,CAAC;KACzB,WAAW,SAAS,SAAS;MAAE,GAAG;MAAO,QAAQ;KAAK,CAAC;KACvD,kBAAkB,SAChB,SAAS;MAAE,GAAG;MAAO,QAAQ,KAAK;MAAQ,QAAQ,KAAK;KAAO,CAAC;IAElE,CAAA;IACD,oBAAC,QAAD;KAAQ,MAAK;KAAS,UAAU;KAAM,eAAe,KAAK,OAAO;KAC9D,UAAA,OAAO,aAAa;IACf,CAAA;IACR,qBAAC,WAAD;KAAS,MAAA;KAAT,UAAA,CACE,oBAAC,WAAD;MAAS,WAAU;MAAqC,UAAA;KAE/C,CAAA,GACT,oBAAC,OAAD;MAAK,WAAU;MACZ,UAAA,cACG,KAAK,UAAU,YAAY,QAAQ,MAAM,CAAC,IAC1C;KACD,CAAA,CACE;;GACT,EAAA,CAAA,IACA;EACG;;AAEb"}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
const require_esQueryBuilderForm = require("../elasticsearch/esQueryBuilderForm.cjs");
|
|
2
|
+
const require_profileApi = require("../profileApi.cjs");
|
|
3
|
+
// src/profiles/editor/profileCanonicalTranslate.ts
|
|
4
|
+
async function translate(draft, { direction, signal, layoutOnly = false }) {
|
|
5
|
+
const response = await fetch(require_profileApi.profileApiPath("profile/sample/query"), {
|
|
6
|
+
method: "POST",
|
|
7
|
+
headers: { "Content-Type": "application/json" },
|
|
8
|
+
body: JSON.stringify({
|
|
9
|
+
profile: {
|
|
10
|
+
profile: draft.profile,
|
|
11
|
+
provider: draft.provider,
|
|
12
|
+
search: draft.search,
|
|
13
|
+
spans: draft.spans,
|
|
14
|
+
params: draft.params
|
|
15
|
+
},
|
|
16
|
+
direction,
|
|
17
|
+
params: require_esQueryBuilderForm.defaultParamValues(draft.params),
|
|
18
|
+
...layoutOnly ? { query: {} } : direction === "canonical" && draft.query ? { query: JSON.parse(draft.query) } : {}
|
|
19
|
+
}),
|
|
20
|
+
...signal ? { signal } : {}
|
|
21
|
+
});
|
|
22
|
+
if (!response.ok) throw new Error(await response.text());
|
|
23
|
+
return response.json();
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* The draft with its native query replaced by the canonical conditions the
|
|
27
|
+
* server translates it to. The provider keeps every option but `search`: the
|
|
28
|
+
* conditions now live on the profile, which is the one place a profile holds
|
|
29
|
+
* them.
|
|
30
|
+
*/
|
|
31
|
+
async function convertToCanonical(draft) {
|
|
32
|
+
const result = await translate(draft, { direction: "canonical" });
|
|
33
|
+
const options = { ...draft.provider?.options };
|
|
34
|
+
delete options.search;
|
|
35
|
+
return {
|
|
36
|
+
...draft,
|
|
37
|
+
query: "",
|
|
38
|
+
search: result.search,
|
|
39
|
+
provider: {
|
|
40
|
+
...draft.provider,
|
|
41
|
+
options
|
|
42
|
+
}
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
exports.convertToCanonical = convertToCanonical;
|
|
46
|
+
exports.translate = translate;
|
|
47
|
+
|
|
48
|
+
//# sourceMappingURL=profileCanonicalTranslate.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"profileCanonicalTranslate.cjs","names":["profileApiPath","defaultParamValues"],"sources":["../../../src/profiles/editor/profileCanonicalTranslate.ts"],"sourcesContent":["import { defaultParamValues } from \"../elasticsearch/esQueryBuilderForm\";\nimport type { EsSearch } from \"../elasticsearch/esQueryBuilderModel\";\nimport { profileApiPath } from \"../profileApi\";\nimport type { ProfileWizardDraft } from \"../wizard/profileWizardModel\";\n\nexport type Translation = {\n search: EsSearch;\n native: unknown;\n layout: { fields: Record<string, { type?: string }> };\n};\n\nexport async function translate(\n draft: ProfileWizardDraft,\n {\n direction,\n signal,\n layoutOnly = false,\n }: {\n direction: \"source\" | \"canonical\";\n signal?: AbortSignal;\n layoutOnly?: boolean;\n },\n): Promise<Translation> {\n const response = await fetch(profileApiPath(\"profile/sample/query\"), {\n method: \"POST\",\n headers: { \"Content-Type\": \"application/json\" },\n body: JSON.stringify({\n profile: {\n profile: draft.profile,\n provider: draft.provider,\n search: draft.search,\n spans: draft.spans,\n params: draft.params,\n },\n direction,\n params: defaultParamValues(draft.params),\n ...(layoutOnly\n ? { query: {} }\n : direction === \"canonical\" && draft.query\n ? { query: JSON.parse(draft.query) }\n : {}),\n }),\n ...(signal ? { signal } : {}),\n });\n if (!response.ok) throw new Error(await response.text());\n return response.json() as Promise<Translation>;\n}\n\n/**\n * The draft with its native query replaced by the canonical conditions the\n * server translates it to. The provider keeps every option but `search`: the\n * conditions now live on the profile, which is the one place a profile holds\n * them.\n */\nexport async function convertToCanonical(\n draft: ProfileWizardDraft,\n): Promise<ProfileWizardDraft> {\n const result = await translate(draft, { direction: \"canonical\" });\n const options = { ...draft.provider?.options };\n delete options.search;\n return {\n ...draft,\n query: \"\",\n search: result.search,\n provider: { ...draft.provider, options },\n };\n}\n"],"mappings":";;;AAWA,eAAsB,UACpB,OACA,EACE,WACA,QACA,aAAa,SAMO;CACtB,MAAM,WAAW,MAAM,MAAMA,mBAAAA,eAAe,sBAAsB,GAAG;EACnE,QAAQ;EACR,SAAS,EAAE,gBAAgB,mBAAmB;EAC9C,MAAM,KAAK,UAAU;GACnB,SAAS;IACP,SAAS,MAAM;IACf,UAAU,MAAM;IAChB,QAAQ,MAAM;IACd,OAAO,MAAM;IACb,QAAQ,MAAM;GAChB;GACA;GACA,QAAQC,2BAAAA,mBAAmB,MAAM,MAAM;GACvC,GAAI,aACA,EAAE,OAAO,CAAC,EAAE,IACZ,cAAc,eAAe,MAAM,QACjC,EAAE,OAAO,KAAK,MAAM,MAAM,KAAK,EAAE,IACjC,CAAC;EACT,CAAC;EACD,GAAI,SAAS,EAAE,OAAO,IAAI,CAAC;CAC7B,CAAC;CACD,IAAI,CAAC,SAAS,IAAI,MAAM,IAAI,MAAM,MAAM,SAAS,KAAK,CAAC;CACvD,OAAO,SAAS,KAAK;AACvB;;;;;;;AAQA,eAAsB,mBACpB,OAC6B;CAC7B,MAAM,SAAS,MAAM,UAAU,OAAO,EAAE,WAAW,YAAY,CAAC;CAChE,MAAM,UAAU,EAAE,GAAG,MAAM,UAAU,QAAQ;CAC7C,OAAO,QAAQ;CACf,OAAO;EACL,GAAG;EACH,OAAO;EACP,QAAQ,OAAO;EACf,UAAU;GAAE,GAAG,MAAM;GAAU;EAAQ;CACzC;AACF"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { EsSearch } from '../elasticsearch/esQueryBuilderModel.js';
|
|
2
|
+
import { ProfileWizardDraft } from '../wizard/profileWizardModel.js';
|
|
3
|
+
export type Translation = {
|
|
4
|
+
search: EsSearch;
|
|
5
|
+
native: unknown;
|
|
6
|
+
layout: {
|
|
7
|
+
fields: Record<string, {
|
|
8
|
+
type?: string;
|
|
9
|
+
}>;
|
|
10
|
+
};
|
|
11
|
+
};
|
|
12
|
+
export declare function translate(draft: ProfileWizardDraft, { direction, signal, layoutOnly, }: {
|
|
13
|
+
direction: "source" | "canonical";
|
|
14
|
+
signal?: AbortSignal;
|
|
15
|
+
layoutOnly?: boolean;
|
|
16
|
+
}): Promise<Translation>;
|
|
17
|
+
/**
|
|
18
|
+
* The draft with its native query replaced by the canonical conditions the
|
|
19
|
+
* server translates it to. The provider keeps every option but `search`: the
|
|
20
|
+
* conditions now live on the profile, which is the one place a profile holds
|
|
21
|
+
* them.
|
|
22
|
+
*/
|
|
23
|
+
export declare function convertToCanonical(draft: ProfileWizardDraft): Promise<ProfileWizardDraft>;
|
|
24
|
+
//# sourceMappingURL=profileCanonicalTranslate.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"profileCanonicalTranslate.d.ts","sourceRoot":"","sources":["../../../src/profiles/editor/profileCanonicalTranslate.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,sCAAsC,CAAC;AAErE,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,8BAA8B,CAAC;AAEvE,MAAM,MAAM,WAAW,GAAG;IACxB,MAAM,EAAE,QAAQ,CAAC;IACjB,MAAM,EAAE,OAAO,CAAC;IAChB,MAAM,EAAE;QAAE,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE;YAAE,IAAI,CAAC,EAAE,MAAM,CAAA;SAAE,CAAC,CAAA;KAAE,CAAC;CACvD,CAAC;AAEF,wBAAsB,SAAS,CAC7B,KAAK,EAAE,kBAAkB,EACzB,EACE,SAAS,EACT,MAAM,EACN,UAAkB,GACnB,EAAE;IACD,SAAS,EAAE,QAAQ,GAAG,WAAW,CAAC;IAClC,MAAM,CAAC,EAAE,WAAW,CAAC;IACrB,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB,GACA,OAAO,CAAC,WAAW,CAAC,CAwBtB;AAED;;;;;GAKG;AACH,wBAAsB,kBAAkB,CACtC,KAAK,EAAE,kBAAkB,GACxB,OAAO,CAAC,kBAAkB,CAAC,CAU7B"}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { defaultParamValues } from "../elasticsearch/esQueryBuilderForm.js";
|
|
2
|
+
import { profileApiPath } from "../profileApi.js";
|
|
3
|
+
// src/profiles/editor/profileCanonicalTranslate.ts
|
|
4
|
+
async function translate(draft, { direction, signal, layoutOnly = false }) {
|
|
5
|
+
const response = await fetch(profileApiPath("profile/sample/query"), {
|
|
6
|
+
method: "POST",
|
|
7
|
+
headers: { "Content-Type": "application/json" },
|
|
8
|
+
body: JSON.stringify({
|
|
9
|
+
profile: {
|
|
10
|
+
profile: draft.profile,
|
|
11
|
+
provider: draft.provider,
|
|
12
|
+
search: draft.search,
|
|
13
|
+
spans: draft.spans,
|
|
14
|
+
params: draft.params
|
|
15
|
+
},
|
|
16
|
+
direction,
|
|
17
|
+
params: defaultParamValues(draft.params),
|
|
18
|
+
...layoutOnly ? { query: {} } : direction === "canonical" && draft.query ? { query: JSON.parse(draft.query) } : {}
|
|
19
|
+
}),
|
|
20
|
+
...signal ? { signal } : {}
|
|
21
|
+
});
|
|
22
|
+
if (!response.ok) throw new Error(await response.text());
|
|
23
|
+
return response.json();
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* The draft with its native query replaced by the canonical conditions the
|
|
27
|
+
* server translates it to. The provider keeps every option but `search`: the
|
|
28
|
+
* conditions now live on the profile, which is the one place a profile holds
|
|
29
|
+
* them.
|
|
30
|
+
*/
|
|
31
|
+
async function convertToCanonical(draft) {
|
|
32
|
+
const result = await translate(draft, { direction: "canonical" });
|
|
33
|
+
const options = { ...draft.provider?.options };
|
|
34
|
+
delete options.search;
|
|
35
|
+
return {
|
|
36
|
+
...draft,
|
|
37
|
+
query: "",
|
|
38
|
+
search: result.search,
|
|
39
|
+
provider: {
|
|
40
|
+
...draft.provider,
|
|
41
|
+
options
|
|
42
|
+
}
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
export { convertToCanonical, translate };
|
|
46
|
+
|
|
47
|
+
//# sourceMappingURL=profileCanonicalTranslate.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"profileCanonicalTranslate.js","names":[],"sources":["../../../src/profiles/editor/profileCanonicalTranslate.ts"],"sourcesContent":["import { defaultParamValues } from \"../elasticsearch/esQueryBuilderForm\";\nimport type { EsSearch } from \"../elasticsearch/esQueryBuilderModel\";\nimport { profileApiPath } from \"../profileApi\";\nimport type { ProfileWizardDraft } from \"../wizard/profileWizardModel\";\n\nexport type Translation = {\n search: EsSearch;\n native: unknown;\n layout: { fields: Record<string, { type?: string }> };\n};\n\nexport async function translate(\n draft: ProfileWizardDraft,\n {\n direction,\n signal,\n layoutOnly = false,\n }: {\n direction: \"source\" | \"canonical\";\n signal?: AbortSignal;\n layoutOnly?: boolean;\n },\n): Promise<Translation> {\n const response = await fetch(profileApiPath(\"profile/sample/query\"), {\n method: \"POST\",\n headers: { \"Content-Type\": \"application/json\" },\n body: JSON.stringify({\n profile: {\n profile: draft.profile,\n provider: draft.provider,\n search: draft.search,\n spans: draft.spans,\n params: draft.params,\n },\n direction,\n params: defaultParamValues(draft.params),\n ...(layoutOnly\n ? { query: {} }\n : direction === \"canonical\" && draft.query\n ? { query: JSON.parse(draft.query) }\n : {}),\n }),\n ...(signal ? { signal } : {}),\n });\n if (!response.ok) throw new Error(await response.text());\n return response.json() as Promise<Translation>;\n}\n\n/**\n * The draft with its native query replaced by the canonical conditions the\n * server translates it to. The provider keeps every option but `search`: the\n * conditions now live on the profile, which is the one place a profile holds\n * them.\n */\nexport async function convertToCanonical(\n draft: ProfileWizardDraft,\n): Promise<ProfileWizardDraft> {\n const result = await translate(draft, { direction: \"canonical\" });\n const options = { ...draft.provider?.options };\n delete options.search;\n return {\n ...draft,\n query: \"\",\n search: result.search,\n provider: { ...draft.provider, options },\n };\n}\n"],"mappings":";;;AAWA,eAAsB,UACpB,OACA,EACE,WACA,QACA,aAAa,SAMO;CACtB,MAAM,WAAW,MAAM,MAAM,eAAe,sBAAsB,GAAG;EACnE,QAAQ;EACR,SAAS,EAAE,gBAAgB,mBAAmB;EAC9C,MAAM,KAAK,UAAU;GACnB,SAAS;IACP,SAAS,MAAM;IACf,UAAU,MAAM;IAChB,QAAQ,MAAM;IACd,OAAO,MAAM;IACb,QAAQ,MAAM;GAChB;GACA;GACA,QAAQ,mBAAmB,MAAM,MAAM;GACvC,GAAI,aACA,EAAE,OAAO,CAAC,EAAE,IACZ,cAAc,eAAe,MAAM,QACjC,EAAE,OAAO,KAAK,MAAM,MAAM,KAAK,EAAE,IACjC,CAAC;EACT,CAAC;EACD,GAAI,SAAS,EAAE,OAAO,IAAI,CAAC;CAC7B,CAAC;CACD,IAAI,CAAC,SAAS,IAAI,MAAM,IAAI,MAAM,MAAM,SAAS,KAAK,CAAC;CACvD,OAAO,SAAS,KAAK;AACvB;;;;;;;AAQA,eAAsB,mBACpB,OAC6B;CAC7B,MAAM,SAAS,MAAM,UAAU,OAAO,EAAE,WAAW,YAAY,CAAC;CAChE,MAAM,UAAU,EAAE,GAAG,MAAM,UAAU,QAAQ;CAC7C,OAAO,QAAQ;CACf,OAAO;EACL,GAAG;EACH,OAAO;EACP,QAAQ,OAAO;EACf,UAAU;GAAE,GAAG,MAAM;GAAU;EAAQ;CACzC;AACF"}
|