@flanksource/clicky-ui 0.3.78 → 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/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 +1 -0
- package/dist/data.d.ts +1 -1
- package/dist/data.d.ts.map +1 -1
- package/dist/data.js +2 -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/index.cjs +6 -5
- package/dist/index.js +7 -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 +106 -37
- package/dist/profiles/editor/profileEditor.cjs.map +1 -1
- package/dist/profiles/editor/profileEditor.d.ts.map +1 -1
- package/dist/profiles/editor/profileEditor.js +107 -38
- 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 +21 -13
- package/dist/profiles/editor/profileSaveAsDialog.cjs.map +1 -1
- package/dist/profiles/editor/profileSaveAsDialog.d.ts.map +1 -1
- package/dist/profiles/editor/profileSaveAsDialog.js +21 -13
- package/dist/profiles/editor/profileSaveAsDialog.js.map +1 -1
- 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 +8 -6
- 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 +9 -7
- 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 +3 -3
- package/dist/rpc/SessionHeader.cjs.map +1 -1
- package/dist/rpc/SessionHeader.d.ts.map +1 -1
- package/dist/rpc/SessionHeader.js +3 -3
- 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 +4982 -4979
- package/dist/runtime/importmap.json +2168 -2146
- 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,53 @@
|
|
|
1
|
+
// src/profiles/editor/samplePaths.ts
|
|
2
|
+
var isObject = (value) => typeof value === "object" && value !== null && !Array.isArray(value);
|
|
3
|
+
/**
|
|
4
|
+
* Reads a dotted path out of a sampled row the way the query engine resolves a
|
|
5
|
+
* column's source (commons-db query/row_path.go lookupRowPath): a literal key
|
|
6
|
+
* wins over splitting, at every level. After a key_values unwrap a document holds
|
|
7
|
+
* keys that contain dots themselves (`process.tags` is `{"host.name": …}`), so
|
|
8
|
+
* `process.tags.host.name` is `process` → `tags` → the literal `host.name`.
|
|
9
|
+
* Keep it in step with that function.
|
|
10
|
+
*/
|
|
11
|
+
function lookupSamplePath(document, path) {
|
|
12
|
+
if (!isObject(document)) return { found: false };
|
|
13
|
+
if (Object.hasOwn(document, path)) return {
|
|
14
|
+
found: true,
|
|
15
|
+
value: document[path]
|
|
16
|
+
};
|
|
17
|
+
for (let dot = path.indexOf("."); dot !== -1; dot = path.indexOf(".", dot + 1)) {
|
|
18
|
+
const head = path.slice(0, dot);
|
|
19
|
+
const nested = Object.hasOwn(document, head) ? document[head] : void 0;
|
|
20
|
+
if (!isObject(nested)) continue;
|
|
21
|
+
const found = lookupSamplePath(nested, path.slice(dot + 1));
|
|
22
|
+
if (found.found) return found;
|
|
23
|
+
}
|
|
24
|
+
return { found: false };
|
|
25
|
+
}
|
|
26
|
+
function jsType(value) {
|
|
27
|
+
if (value === null) return "null";
|
|
28
|
+
if (Array.isArray(value)) return "array";
|
|
29
|
+
return typeof value;
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Every field path the sampled rows carry: nested objects contribute their keys
|
|
33
|
+
* as dotted paths, arrays and scalars are leaves. Each path lists the types it
|
|
34
|
+
* held, since rows disagree (a list in one, JSON text in another).
|
|
35
|
+
*/
|
|
36
|
+
function sampleFieldPaths(rows) {
|
|
37
|
+
const types = /* @__PURE__ */ new Map();
|
|
38
|
+
const visit = (value, prefix) => {
|
|
39
|
+
for (const [key, child] of Object.entries(value)) {
|
|
40
|
+
const path = prefix ? `${prefix}.${key}` : key;
|
|
41
|
+
if (isObject(child)) visit(child, path);
|
|
42
|
+
else types.set(path, (types.get(path) ?? /* @__PURE__ */ new Set()).add(jsType(child)));
|
|
43
|
+
}
|
|
44
|
+
};
|
|
45
|
+
for (const row of rows) visit(row, "");
|
|
46
|
+
return [...types].sort(([a], [b]) => a.localeCompare(b)).map(([path, held]) => ({
|
|
47
|
+
path,
|
|
48
|
+
types: [...held].sort()
|
|
49
|
+
}));
|
|
50
|
+
}
|
|
51
|
+
export { lookupSamplePath, sampleFieldPaths };
|
|
52
|
+
|
|
53
|
+
//# sourceMappingURL=samplePaths.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"samplePaths.js","names":[],"sources":["../../../src/profiles/editor/samplePaths.ts"],"sourcesContent":["// Reading field paths out of sampled rows. Nothing here changes a row: unwrap\n// rules are applied by the server alone, and the rows the editor holds are\n// already what it produced.\n\ntype Row = Record<string, unknown>;\n\nconst isObject = (value: unknown): value is Row =>\n typeof value === \"object\" && value !== null && !Array.isArray(value);\n\nexport type SamplePathLookup = { found: true; value: unknown } | { found: false };\n\n/**\n * Reads a dotted path out of a sampled row the way the query engine resolves a\n * column's source (commons-db query/row_path.go lookupRowPath): a literal key\n * wins over splitting, at every level. After a key_values unwrap a document holds\n * keys that contain dots themselves (`process.tags` is `{\"host.name\": …}`), so\n * `process.tags.host.name` is `process` → `tags` → the literal `host.name`.\n * Keep it in step with that function.\n */\nexport function lookupSamplePath(document: unknown, path: string): SamplePathLookup {\n if (!isObject(document)) return { found: false };\n if (Object.hasOwn(document, path)) return { found: true, value: document[path] };\n for (let dot = path.indexOf(\".\"); dot !== -1; dot = path.indexOf(\".\", dot + 1)) {\n const head = path.slice(0, dot);\n const nested = Object.hasOwn(document, head) ? document[head] : undefined;\n if (!isObject(nested)) continue;\n const found = lookupSamplePath(nested, path.slice(dot + 1));\n if (found.found) return found;\n }\n return { found: false };\n}\n\nfunction jsType(value: unknown): string {\n if (value === null) return \"null\";\n if (Array.isArray(value)) return \"array\";\n return typeof value;\n}\n\n/**\n * Every field path the sampled rows carry: nested objects contribute their keys\n * as dotted paths, arrays and scalars are leaves. Each path lists the types it\n * held, since rows disagree (a list in one, JSON text in another).\n */\nexport function sampleFieldPaths(rows: Row[]): { path: string; types: string[] }[] {\n const types = new Map<string, Set<string>>();\n const visit = (value: Row, prefix: string) => {\n for (const [key, child] of Object.entries(value)) {\n const path = prefix ? `${prefix}.${key}` : key;\n if (isObject(child)) visit(child, path);\n else types.set(path, (types.get(path) ?? new Set()).add(jsType(child)));\n }\n };\n for (const row of rows) vis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AO,KAAK,CAAC,CAAC;EACxE;CACF;CACA,KAAK,MAAM,OAAO,MAAM,MAAM,KAAK,EAAE;CACrC,OAAO,CAAC,GAAG,KAAK,CAAC,CACd,MAAM,CAAC,IAAI,CAAC,OAAO,EAAE,cAAc,CAAC,CAAC,CAAC,CACtC,KAAK,CAAC,MAAM,WAAW;EAAE;EAAM,OAAO,CAAC,GAAG,IAAI,CAAC,CAAC,KAAK;CAAE,EAAE;AAC9D"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"testSchema.d.ts","sourceRoot":"","sources":["../../../src/profiles/editor/testSchema.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;
|
|
1
|
+
{"version":3,"file":"testSchema.d.ts","sourceRoot":"","sources":["../../../src/profiles/editor/testSchema.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAGH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAGnD,eAAO,MAAM,iBAAiB,EAAE,aAgH/B,CAAC"}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
const require_connectionBrowserModel = require("../connections/connectionBrowserModel.cjs");
|
|
2
|
+
const require_esQueryBuilderForm = require("../elasticsearch/esQueryBuilderForm.cjs");
|
|
3
|
+
const require_profileApi = require("../profileApi.cjs");
|
|
4
|
+
const require_jsonPathSample = require("../query/jsonPathSample.cjs");
|
|
5
|
+
let react = require("react");
|
|
6
|
+
// src/profiles/editor/useUnwrapPreviews.ts
|
|
7
|
+
var DEBOUNCE_MS = 400;
|
|
8
|
+
/**
|
|
9
|
+
* What each of the draft's unwrap rules does to its field, asked of the server.
|
|
10
|
+
*
|
|
11
|
+
* Unwrap runs only there (the provider's span.Unwrap), so a sample's rows come
|
|
12
|
+
* back already unwrapped and cannot show the field as the backend holds it. The
|
|
13
|
+
* server reads the same documents with the rules left out and runs the rules
|
|
14
|
+
* itself; the editor shows the answer and applies nothing. It re-asks when the
|
|
15
|
+
* draft's source changes, without a new sample.
|
|
16
|
+
*/
|
|
17
|
+
function useUnwrapPreviews(draft) {
|
|
18
|
+
const profile = (0, react.useMemo)(() => require_jsonPathSample.sampleRequestProfile(draft), [draft]);
|
|
19
|
+
const params = require_esQueryBuilderForm.defaultParamValues(draft.params);
|
|
20
|
+
const body = profile ? JSON.stringify({
|
|
21
|
+
profile,
|
|
22
|
+
params
|
|
23
|
+
}) : null;
|
|
24
|
+
const [state, setState] = (0, react.useState)({ status: "idle" });
|
|
25
|
+
(0, react.useEffect)(() => {
|
|
26
|
+
if (body === null) {
|
|
27
|
+
setState({ status: "idle" });
|
|
28
|
+
return;
|
|
29
|
+
}
|
|
30
|
+
const controller = new AbortController();
|
|
31
|
+
setState({ status: "loading" });
|
|
32
|
+
const timer = setTimeout(() => {
|
|
33
|
+
require_connectionBrowserModel.fetchJSON(require_profileApi.profileApiPath("profile/sample/unwrap"), {
|
|
34
|
+
method: "POST",
|
|
35
|
+
headers: { "Content-Type": "application/json" },
|
|
36
|
+
body,
|
|
37
|
+
signal: controller.signal
|
|
38
|
+
}).then((result) => {
|
|
39
|
+
if (!controller.signal.aborted) setState({
|
|
40
|
+
status: "ready",
|
|
41
|
+
previews: result.previews,
|
|
42
|
+
sampled: result.sampled
|
|
43
|
+
});
|
|
44
|
+
}, (error) => {
|
|
45
|
+
if (!controller.signal.aborted) setState({
|
|
46
|
+
status: "error",
|
|
47
|
+
message: error instanceof Error ? error.message : String(error)
|
|
48
|
+
});
|
|
49
|
+
});
|
|
50
|
+
}, DEBOUNCE_MS);
|
|
51
|
+
return () => {
|
|
52
|
+
clearTimeout(timer);
|
|
53
|
+
controller.abort();
|
|
54
|
+
};
|
|
55
|
+
}, [body]);
|
|
56
|
+
return state;
|
|
57
|
+
}
|
|
58
|
+
exports.useUnwrapPreviews = useUnwrapPreviews;
|
|
59
|
+
|
|
60
|
+
//# sourceMappingURL=useUnwrapPreviews.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useUnwrapPreviews.cjs","names":["useMemo","sampleRequestProfile","defaultParamValues","useState","profileApiPath"],"sources":["../../../src/profiles/editor/useUnwrapPreviews.ts"],"sourcesContent":["import { useEffect, useMemo, useState } from \"react\";\nimport { fetchJSON } from \"../connections/connectionBrowserModel\";\nimport { defaultParamValues } from \"../elasticsearch/esQueryBuilderForm\";\nimport { profileApiPath } from \"../profileApi\";\nimport { sampleRequestProfile } from \"../query/jsonPathSample\";\nimport type { ProfileWizardDraft } from \"../wizard/profileWizardModel\";\n\n/** A rule as the draft holds it; the server decides what is valid. */\nexport type UnwrapRuleDraft = { field?: unknown; as?: unknown };\n\n/** What the server's unwrap did, or raised, for one rule (otel/span RulePreview). */\nexport type RulePreview = {\n rule: UnwrapRuleDraft;\n status: \"applied\" | \"failed\" | \"missing\" | \"invalid\";\n row: number;\n before?: unknown;\n after?: unknown;\n error?: string;\n};\n\nexport type UnwrapPreviewState =\n | { status: \"idle\" }\n | { status: \"loading\" }\n | { status: \"error\"; message: string }\n | { status: \"ready\"; previews: RulePreview[]; sampled: number };\n\nconst DEBOUNCE_MS = 400;\n\n/**\n * What each of the draft's unwrap rules does to its field, asked of the server.\n *\n * Unwrap runs only there (the provider's span.Unwrap), so a sample's rows come\n * back already unwrapped and cannot show the field as the backend holds it. The\n * server reads the same documents with the rules left out and runs the rules\n * itself; the editor shows the answer and applies nothing. It re-asks when the\n * draft's source changes, without a new sample.\n */\nexport function useUnwrapPreviews(draft: ProfileWizardDraft): UnwrapPreviewState {\n const profile = useMemo(() => sampleRequestProfile(draft), [draft]);\n const params = defaultParamValues(draft.params);\n const body = profile ? JSON.stringify({ profile, params }) : null;\n const [state, setState] = useState<UnwrapPreviewState>({ status: \"idle\" });\n\n useEffect(() => {\n if (body === null) {\n setState({ status: \"idle\" });\n return;\n }\n const controller = new AbortController();\n setState({ status: \"loading\" });\n const timer = setTimeout(() => {\n fetchJSON<{ previews: RulePreview[]; sampled: number }>(profileApiPath(\"profile/sample/unwrap\"), {\n method: \"POST\",\n headers: { \"Content-Type\": \"application/json\" },\n body,\n signal: controller.signal,\n }).then(\n (result) => {\n if (!controller.signal.aborted) setState({ status: \"ready\", previews: result.previews, sampled: result.sampled });\n },\n (error: unknown) => {\n if (!controller.signal.aborted) {\n setState({ status: \"error\", message: error instanceof Error ? error.message : String(error) });\n }\n },\n );\n }, DEBOUNCE_MS);\n return () => {\n clearTimeout(timer);\n controller.abort();\n };\n }, [body]);\n\n return state;\n}\n"],"mappings":";;;;;;AA0BA,IAAM,cAAc;;;;;;;;;;AAWpB,SAAgB,kBAAkB,OAA+C;CAC/E,MAAM,WAAA,GAAUA,MAAAA,QAAAA,OAAcC,uBAAAA,qBAAqB,KAAK,GAAG,CAAC,KAAK,CAAC;CAClE,MAAM,SAASC,2BAAAA,mBAAmB,MAAM,MAAM;CAC9C,MAAM,OAAO,UAAU,KAAK,UAAU;EAAE;EAAS;CAAO,CAAC,IAAI;CAC7D,MAAM,CAAC,OAAO,aAAA,GAAYC,MAAAA,SAAAA,CAA6B,EAAE,QAAQ,OAAO,CAAC;CAEzE,CAAA,GAAA,MAAA,UAAA,OAAgB;EACd,IAAI,SAAS,MAAM;GACjB,SAAS,EAAE,QAAQ,OAAO,CAAC;GAC3B;EACF;EACA,MAAM,aAAa,IAAI,gBAAgB;EACvC,SAAS,EAAE,QAAQ,UAAU,CAAC;EAC9B,MAAM,QAAQ,iBAAiB;GAC7B,+BAAA,UAAwDC,mBAAAA,eAAe,uBAAuB,GAAG;IAC/F,QAAQ;IACR,SAAS,EAAE,gBAAgB,mBAAmB;IAC9C;IACA,QAAQ,WAAW;GACrB,CAAC,CAAC,CAAC,MACA,WAAW;IACV,IAAI,CAAC,WAAW,OAAO,SAAS,SAAS;KAAE,QAAQ;KAAS,UAAU,OAAO;KAAU,SAAS,OAAO;IAAQ,CAAC;GAClH,IACC,UAAmB;IAClB,IAAI,CAAC,WAAW,OAAO,SACrB,SAAS;KAAE,QAAQ;KAAS,SAAS,iBAAiB,QAAQ,MAAM,UAAU,OAAO,KAAK;IAAE,CAAC;GAEjG,CACF;EACF,GAAG,WAAW;EACd,aAAa;GACX,aAAa,KAAK;GAClB,WAAW,MAAM;EACnB;CACF,GAAG,CAAC,IAAI,CAAC;CAET,OAAO;AACT"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { ProfileWizardDraft } from '../wizard/profileWizardModel.js';
|
|
2
|
+
/** A rule as the draft holds it; the server decides what is valid. */
|
|
3
|
+
export type UnwrapRuleDraft = {
|
|
4
|
+
field?: unknown;
|
|
5
|
+
as?: unknown;
|
|
6
|
+
};
|
|
7
|
+
/** What the server's unwrap did, or raised, for one rule (otel/span RulePreview). */
|
|
8
|
+
export type RulePreview = {
|
|
9
|
+
rule: UnwrapRuleDraft;
|
|
10
|
+
status: "applied" | "failed" | "missing" | "invalid";
|
|
11
|
+
row: number;
|
|
12
|
+
before?: unknown;
|
|
13
|
+
after?: unknown;
|
|
14
|
+
error?: string;
|
|
15
|
+
};
|
|
16
|
+
export type UnwrapPreviewState = {
|
|
17
|
+
status: "idle";
|
|
18
|
+
} | {
|
|
19
|
+
status: "loading";
|
|
20
|
+
} | {
|
|
21
|
+
status: "error";
|
|
22
|
+
message: string;
|
|
23
|
+
} | {
|
|
24
|
+
status: "ready";
|
|
25
|
+
previews: RulePreview[];
|
|
26
|
+
sampled: number;
|
|
27
|
+
};
|
|
28
|
+
/**
|
|
29
|
+
* What each of the draft's unwrap rules does to its field, asked of the server.
|
|
30
|
+
*
|
|
31
|
+
* Unwrap runs only there (the provider's span.Unwrap), so a sample's rows come
|
|
32
|
+
* back already unwrapped and cannot show the field as the backend holds it. The
|
|
33
|
+
* server reads the same documents with the rules left out and runs the rules
|
|
34
|
+
* itself; the editor shows the answer and applies nothing. It re-asks when the
|
|
35
|
+
* draft's source changes, without a new sample.
|
|
36
|
+
*/
|
|
37
|
+
export declare function useUnwrapPreviews(draft: ProfileWizardDraft): UnwrapPreviewState;
|
|
38
|
+
//# sourceMappingURL=useUnwrapPreviews.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useUnwrapPreviews.d.ts","sourceRoot":"","sources":["../../../src/profiles/editor/useUnwrapPreviews.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,8BAA8B,CAAC;AAEvE,sEAAsE;AACtE,MAAM,MAAM,eAAe,GAAG;IAAE,KAAK,CAAC,EAAE,OAAO,CAAC;IAAC,EAAE,CAAC,EAAE,OAAO,CAAA;CAAE,CAAC;AAEhE,qFAAqF;AACrF,MAAM,MAAM,WAAW,GAAG;IACxB,IAAI,EAAE,eAAe,CAAC;IACtB,MAAM,EAAE,SAAS,GAAG,QAAQ,GAAG,SAAS,GAAG,SAAS,CAAC;IACrD,GAAG,EAAE,MAAM,CAAC;IACZ,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF,MAAM,MAAM,kBAAkB,GAC1B;IAAE,MAAM,EAAE,MAAM,CAAA;CAAE,GAClB;IAAE,MAAM,EAAE,SAAS,CAAA;CAAE,GACrB;IAAE,MAAM,EAAE,OAAO,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,GACpC;IAAE,MAAM,EAAE,OAAO,CAAC;IAAC,QAAQ,EAAE,WAAW,EAAE,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,CAAC;AAIlE;;;;;;;;GAQG;AACH,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,kBAAkB,GAAG,kBAAkB,CAqC/E"}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { fetchJSON } from "../connections/connectionBrowserModel.js";
|
|
2
|
+
import { defaultParamValues } from "../elasticsearch/esQueryBuilderForm.js";
|
|
3
|
+
import { profileApiPath } from "../profileApi.js";
|
|
4
|
+
import { sampleRequestProfile } from "../query/jsonPathSample.js";
|
|
5
|
+
import { useEffect, useMemo, useState } from "react";
|
|
6
|
+
// src/profiles/editor/useUnwrapPreviews.ts
|
|
7
|
+
var DEBOUNCE_MS = 400;
|
|
8
|
+
/**
|
|
9
|
+
* What each of the draft's unwrap rules does to its field, asked of the server.
|
|
10
|
+
*
|
|
11
|
+
* Unwrap runs only there (the provider's span.Unwrap), so a sample's rows come
|
|
12
|
+
* back already unwrapped and cannot show the field as the backend holds it. The
|
|
13
|
+
* server reads the same documents with the rules left out and runs the rules
|
|
14
|
+
* itself; the editor shows the answer and applies nothing. It re-asks when the
|
|
15
|
+
* draft's source changes, without a new sample.
|
|
16
|
+
*/
|
|
17
|
+
function useUnwrapPreviews(draft) {
|
|
18
|
+
const profile = useMemo(() => sampleRequestProfile(draft), [draft]);
|
|
19
|
+
const params = defaultParamValues(draft.params);
|
|
20
|
+
const body = profile ? JSON.stringify({
|
|
21
|
+
profile,
|
|
22
|
+
params
|
|
23
|
+
}) : null;
|
|
24
|
+
const [state, setState] = useState({ status: "idle" });
|
|
25
|
+
useEffect(() => {
|
|
26
|
+
if (body === null) {
|
|
27
|
+
setState({ status: "idle" });
|
|
28
|
+
return;
|
|
29
|
+
}
|
|
30
|
+
const controller = new AbortController();
|
|
31
|
+
setState({ status: "loading" });
|
|
32
|
+
const timer = setTimeout(() => {
|
|
33
|
+
fetchJSON(profileApiPath("profile/sample/unwrap"), {
|
|
34
|
+
method: "POST",
|
|
35
|
+
headers: { "Content-Type": "application/json" },
|
|
36
|
+
body,
|
|
37
|
+
signal: controller.signal
|
|
38
|
+
}).then((result) => {
|
|
39
|
+
if (!controller.signal.aborted) setState({
|
|
40
|
+
status: "ready",
|
|
41
|
+
previews: result.previews,
|
|
42
|
+
sampled: result.sampled
|
|
43
|
+
});
|
|
44
|
+
}, (error) => {
|
|
45
|
+
if (!controller.signal.aborted) setState({
|
|
46
|
+
status: "error",
|
|
47
|
+
message: error instanceof Error ? error.message : String(error)
|
|
48
|
+
});
|
|
49
|
+
});
|
|
50
|
+
}, DEBOUNCE_MS);
|
|
51
|
+
return () => {
|
|
52
|
+
clearTimeout(timer);
|
|
53
|
+
controller.abort();
|
|
54
|
+
};
|
|
55
|
+
}, [body]);
|
|
56
|
+
return state;
|
|
57
|
+
}
|
|
58
|
+
export { useUnwrapPreviews };
|
|
59
|
+
|
|
60
|
+
//# sourceMappingURL=useUnwrapPreviews.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useUnwrapPreviews.js","names":[],"sources":["../../../src/profiles/editor/useUnwrapPreviews.ts"],"sourcesContent":["import { useEffect, useMemo, useState } from \"react\";\nimport { fetchJSON } from \"../connections/connectionBrowserModel\";\nimport { defaultParamValues } from \"../elasticsearch/esQueryBuilderForm\";\nimport { profileApiPath } from \"../profileApi\";\nimport { sampleRequestProfile } from \"../query/jsonPathSample\";\nimport type { ProfileWizardDraft } from \"../wizard/profileWizardModel\";\n\n/** A rule as the draft holds it; the server decides what is valid. */\nexport type UnwrapRuleDraft = { field?: unknown; as?: unknown };\n\n/** What the server's unwrap did, or raised, for one rule (otel/span RulePreview). */\nexport type RulePreview = {\n rule: UnwrapRuleDraft;\n status: \"applied\" | \"failed\" | \"missing\" | \"invalid\";\n row: number;\n before?: unknown;\n after?: unknown;\n error?: string;\n};\n\nexport type UnwrapPreviewState =\n | { status: \"idle\" }\n | { status: \"loading\" }\n | { status: \"error\"; message: string }\n | { status: \"ready\"; previews: RulePreview[]; sampled: number };\n\nconst DEBOUNCE_MS = 400;\n\n/**\n * What each of the draft's unwrap rules does to its field, asked of the server.\n *\n * Unwrap runs only there (the provider's span.Unwrap), so a sample's rows come\n * back already unwrapped and cannot show the field as the backend holds it. The\n * server reads the same documents with the rules left out and runs the rules\n * itself; the editor shows the answer and applies nothing. It re-asks when the\n * draft's source changes, without a new sample.\n */\nexport function useUnwrapPreviews(draft: ProfileWizardDraft): UnwrapPreviewState {\n const profile = useMemo(() => sampleRequestProfile(draft), [draft]);\n const params = defaultParamValues(draft.params);\n const body = profile ? JSON.stringify({ profile, params }) : null;\n const [state, setState] = useState<UnwrapPreviewState>({ status: \"idle\" });\n\n useEffect(() => {\n if (body === null) {\n setState({ status: \"idle\" });\n return;\n }\n const controller = new AbortController();\n setState({ status: \"loading\" });\n const timer = setTimeout(() => {\n fetchJSON<{ previews: RulePreview[]; sampled: number }>(profileApiPath(\"profile/sample/unwrap\"), {\n method: \"POST\",\n headers: { \"Content-Type\": \"application/json\" },\n body,\n signal: controller.signal,\n }).then(\n (result) => {\n if (!controller.signal.aborted) setState({ status: \"ready\", previews: result.previews, sampled: result.sampled });\n },\n (error: unknown) => {\n if (!controller.signal.aborted) {\n setState({ status: \"error\", message: error instanceof Error ? error.message : String(error) });\n }\n },\n );\n }, DEBOUNCE_MS);\n return () => {\n clearTimeout(timer);\n controller.abort();\n };\n }, [body]);\n\n return state;\n}\n"],"mappings":";;;;;;AA0BA,IAAM,cAAc;;;;;;;;;;AAWpB,SAAgB,kBAAkB,OAA+C;CAC/E,MAAM,UAAU,cAAc,qBAAqB,KAAK,GAAG,CAAC,KAAK,CAAC;CAClE,MAAM,SAAS,mBAAmB,MAAM,MAAM;CAC9C,MAAM,OAAO,UAAU,KAAK,UAAU;EAAE;EAAS;CAAO,CAAC,IAAI;CAC7D,MAAM,CAAC,OAAO,YAAY,SAA6B,EAAE,QAAQ,OAAO,CAAC;CAEzE,gBAAgB;EACd,IAAI,SAAS,MAAM;GACjB,SAAS,EAAE,QAAQ,OAAO,CAAC;GAC3B;EACF;EACA,MAAM,aAAa,IAAI,gBAAgB;EACvC,SAAS,EAAE,QAAQ,UAAU,CAAC;EAC9B,MAAM,QAAQ,iBAAiB;GAC7B,UAAwD,eAAe,uBAAuB,GAAG;IAC/F,QAAQ;IACR,SAAS,EAAE,gBAAgB,mBAAmB;IAC9C;IACA,QAAQ,WAAW;GACrB,CAAC,CAAC,CAAC,MACA,WAAW;IACV,IAAI,CAAC,WAAW,OAAO,SAAS,SAAS;KAAE,QAAQ;KAAS,UAAU,OAAO;KAAU,SAAS,OAAO;IAAQ,CAAC;GAClH,IACC,UAAmB;IAClB,IAAI,CAAC,WAAW,OAAO,SACrB,SAAS;KAAE,QAAQ;KAAS,SAAS,iBAAiB,QAAQ,MAAM,UAAU,OAAO,KAAK;IAAE,CAAC;GAEjG,CACF;EACF,GAAG,WAAW;EACd,aAAa;GACX,aAAa,KAAK;GAClB,WAAW,MAAM;EACnB;CACF,GAAG,CAAC,IAAI,CAAC;CAET,OAAO;AACT"}
|
|
@@ -22,6 +22,7 @@ let react_jsx_runtime = require("react/jsx-runtime");
|
|
|
22
22
|
function EsQueryBuilder({ search, onChange, fields, vocabulary, params = [], onMappingChange, values, compilation, className }) {
|
|
23
23
|
const root = search.query ?? require_esQueryBuilderModel.emptyGroup();
|
|
24
24
|
const requiresTimeFieldFormat = require_esQueryBuilderForm.timeFieldFormatRequired(fields, search.timeField);
|
|
25
|
+
const dateField = search.timeField && !requiresTimeFieldFormat ? fields.find((field) => field.name === search.timeField) : void 0;
|
|
25
26
|
const mappingFieldsChanged = (edit) => edit.params.some((param, index) => param.field !== params[index]?.field);
|
|
26
27
|
const commitMappingEdit = (edit) => {
|
|
27
28
|
if (onMappingChange) {
|
|
@@ -140,7 +141,7 @@ function EsQueryBuilder({ search, onChange, fields, vocabulary, params = [], onM
|
|
|
140
141
|
})),
|
|
141
142
|
placeholder: "Select epoch unit…",
|
|
142
143
|
allowCustomValue: false
|
|
143
|
-
})] }) : null,
|
|
144
|
+
})] }) : dateField ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(TimeFieldUnitReadout, { field: dateField }) : null,
|
|
144
145
|
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
145
146
|
className: "text-xs text-muted-foreground",
|
|
146
147
|
children: "Where time-from and time-to parameters apply"
|
|
@@ -224,6 +225,14 @@ function EsQueryBuilderField({ search, onChange, schema, rootValue, onRootChange
|
|
|
224
225
|
compilation
|
|
225
226
|
});
|
|
226
227
|
}
|
|
228
|
+
function TimeFieldUnitReadout({ field }) {
|
|
229
|
+
const { state, text } = require_esQueryBuilderForm.timeFieldUnitReadout(field);
|
|
230
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
231
|
+
"data-es-time-unit": state,
|
|
232
|
+
className: state === "conflicting" ? "text-xs text-destructive" : "text-xs text-foreground",
|
|
233
|
+
children: text
|
|
234
|
+
});
|
|
235
|
+
}
|
|
227
236
|
function timeFieldFormatLabel(format) {
|
|
228
237
|
switch (format) {
|
|
229
238
|
case "epoch_second": return "Seconds";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"esQueryBuilder.cjs","names":["emptyGroup","timeFieldFormatRequired","reconcileSearchParamMappings","valueLookupField","removeAt","EsQueryClauseGroup","updateAt","insertAt","conditionAt","bindParamOperand","removeParamMapping","Combobox","selectTimeField","timeFieldMappings","_Fragment","EsQuerySortEditor","EsQueryOutputEditor","EsQueryPreview","savedConnectionID","browserBaseUrl","useInspection","paramRoles","defaultParamValues","useCompiledSearch","makeFieldValueLookup","esQueryFields","esBuilderVocabulary"],"sources":["../../../src/profiles/elasticsearch/esQueryBuilder.tsx"],"sourcesContent":["/**\n * The query builder panel and the form extension that mounts it. The panel is\n * pure: it takes a specification and the vocabulary the schema described, and\n * reports edits. Everything that needs a connection — field mappings and the\n * compiled preview — is wired by the host that has one.\n */\n\nimport { Combobox } from \"../../components/Combobox\";\nimport type { JsonSchemaProperty } from \"../../components/json-schema-form-types\";\nimport {\n browserBaseUrl,\n savedConnectionID,\n} from \"../connections/connectionBrowserModel\";\nimport { useInspection } from \"../connections/useInspection\";\nimport {\n conditionAt,\n emptyGroup,\n insertAt,\n removeAt,\n updateAt,\n type EsSearch,\n type EsTimeFieldFormat,\n} from \"./esQueryBuilderModel\";\nimport {\n makeFieldValueLookup,\n valueLookupField,\n type FieldValuesSource,\n} from \"./esFieldValues\";\nimport { EsQueryClauseGroup } from \"./esQueryClauseGroup\";\nimport type { EsQueryContext, EsQueryTreeActions } from \"./esQueryConditionRow\";\nimport {\n esBuilderVocabulary,\n type EsBuilderVocabulary,\n type EsFieldMapping,\n} from \"./esQueryOperators\";\nimport { EsQueryOutputEditor } from \"./esQueryOutputEditor\";\nimport { EsQueryPreview } from \"./esQueryPreview\";\nimport { EsQuerySortEditor } from \"./esQuerySortEditor\";\nimport type { ProfileDraft } from \"../editor/profileBuilderWorkspace\";\nimport type { ParamDraft } from \"../wizard/profileWizardModel\";\nimport {\n bindParamOperand,\n reconcileSearchParamMappings,\n removeParamMapping,\n type ParamMappingEdit,\n} from \"./esParamMappingModel\";\nimport {\n defaultParamValues,\n esQueryFields,\n paramRoles,\n selectTimeField,\n timeFieldFormatRequired,\n timeFieldMappings,\n} from \"./esQueryBuilderForm\";\nimport { useCompiledSearch, type EsCompilation } from \"./esQueryCompile\";\n\nexport type EsQueryBuilderProps = {\n search: EsSearch;\n onChange: (search: EsSearch) => void;\n fields: EsFieldMapping[];\n vocabulary: EsBuilderVocabulary;\n /** Declared profile parameters an operand can bind to. */\n params?: ParamDraft[];\n onMappingChange?: (edit: ParamMappingEdit) => void;\n /** Where a field's own values come from; absent without a connection. */\n values?: FieldValuesSource;\n compilation?: EsCompilation;\n className?: string;\n};\n\nexport function EsQueryBuilder({\n search,\n onChange,\n fields,\n vocabulary,\n params = [],\n onMappingChange,\n values,\n compilation,\n className,\n}: EsQueryBuilderProps) {\n const root = search.query ?? emptyGroup();\n const requiresTimeFieldFormat = timeFieldFormatRequired(\n fields,\n search.timeField,\n );\n const mappingFieldsChanged = (edit: ParamMappingEdit) =>\n edit.params.some((param, index) => param.field !== params[index]?.field);\n const commitMappingEdit = (edit: ParamMappingEdit) => {\n if (onMappingChange) {\n onMappingChange(edit);\n return;\n }\n if (mappingFieldsChanged(edit)) {\n throw new Error(\n \"list parameter mappings require an atomic mapping change handler\",\n );\n }\n onChange(edit.search);\n };\n const commitSearchEdit = (nextSearch: EsSearch) => {\n const edit = reconcileSearchParamMappings({\n previousSearch: search,\n nextSearch,\n params,\n });\n if (mappingFieldsChanged(edit)) {\n commitMappingEdit(edit);\n return;\n }\n onChange(nextSearch);\n };\n const context: EsQueryContext = {\n fields,\n vocabulary,\n params,\n // The builder owns the tree, so it — not the host — decides what a lookup is\n // scoped by: the query without the row being edited. Leaving that row in\n // would filter the suggestions by the half-typed value they are meant to\n // complete.\n ...(values\n ? {\n values: ({ path, field }) => {\n const target = valueLookupField(fields, field);\n if (!target) return undefined;\n return values({\n field: target,\n search: { ...search, query: removeAt(root, path) },\n });\n },\n }\n : {}),\n };\n const actions: EsQueryTreeActions = {\n update: (path, update) =>\n commitSearchEdit({ ...search, query: updateAt(root, path, update) }),\n insert: (groupPath, condition) =>\n commitSearchEdit({\n ...search,\n query: insertAt(\n root,\n groupPath,\n conditionAt(root, groupPath)?.conditions?.length ?? 0,\n condition,\n ),\n }),\n remove: (path) =>\n commitSearchEdit({ ...search, query: removeAt(root, path) }),\n mapParam: (path, operand, name) => {\n const edit = bindParamOperand({ search, params, path, operand, name });\n commitMappingEdit(edit);\n },\n unmapParam: (path, name) => {\n const edit = removeParamMapping({ search, params, name, path });\n commitMappingEdit(edit);\n },\n };\n\n return (\n <div className={className ?? \"flex min-w-0 flex-col gap-3\"}>\n <EsQueryClauseGroup\n condition={root}\n path={[]}\n context={context}\n actions={actions}\n root\n />\n <div className=\"flex flex-wrap items-center gap-2\">\n <span className=\"text-xs text-muted-foreground\">Time field</span>\n <Combobox\n ariaLabel=\"Time field\"\n className=\"min-w-48\"\n value={search.timeField ?? \"\"}\n onChange={(next) => onChange(selectTimeField(search, fields, next))}\n options={timeFieldMappings(fields).map((field) => ({\n value: field.name,\n label: field.name,\n }))}\n placeholder=\"Timestamp field…\"\n allowCustomValue\n />\n {requiresTimeFieldFormat ? (\n <>\n <span className=\"text-xs text-muted-foreground\">Epoch unit</span>\n <Combobox\n ariaLabel=\"Time field format\"\n ariaRequired\n required\n invalid={!search.timeFieldFormat}\n className=\"min-w-40\"\n value={search.timeFieldFormat ?? \"\"}\n onChange={(next) =>\n onChange({\n ...search,\n timeFieldFormat: (next || undefined) as\n | EsTimeFieldFormat\n | undefined,\n })\n }\n options={(vocabulary.timeFieldFormats ?? []).map((format) => ({\n value: format,\n label: timeFieldFormatLabel(format),\n }))}\n placeholder=\"Select epoch unit…\"\n allowCustomValue={false}\n />\n </>\n ) : null}\n <span className=\"text-xs text-muted-foreground\">\n Where time-from and time-to parameters apply\n </span>\n </div>\n <EsQuerySortEditor\n sort={search.sort ?? []}\n fields={fields}\n orders={vocabulary.sortOrders}\n onChange={(sort) =>\n onChange({ ...search, sort: sort.length ? sort : undefined })\n }\n />\n <EsQueryOutputEditor\n search={search}\n onChange={(patch) => onChange({ ...search, ...patch })}\n />\n {compilation ? <EsQueryPreview compilation={compilation} /> : null}\n </div>\n );\n}\n\n/**\n * The builder as the profile form mounts it. The form knows the connection and\n * the index, so the field mappings and the compiled preview come from the same\n * browser endpoints the connection browser uses.\n */\nexport function EsQueryBuilderField({\n search,\n onChange,\n schema,\n rootValue,\n onRootChange,\n}: {\n search: EsSearch;\n onChange: (next: unknown) => void;\n schema: JsonSchemaProperty;\n rootValue: ProfileDraft;\n onRootChange?: ((next: Record<string, unknown>) => void) | undefined;\n}) {\n const connectionID = savedConnectionID(rootValue.provider?.connection);\n const baseUrl = connectionID ? browserBaseUrl(connectionID) : \"\";\n const target = String(rootValue.provider?.options?.index ?? \"\");\n const inspection = useInspection({\n cacheKey: \"es-query-builder\",\n id: connectionID ?? \"\",\n baseUrl,\n enabled: baseUrl !== \"\",\n database: \"\",\n target,\n });\n const roles = paramRoles(rootValue.params);\n const params = defaultParamValues(rootValue.params);\n const compilation = useCompiledSearch({\n baseUrl,\n index: target,\n search,\n params,\n roles,\n enabled: baseUrl !== \"\",\n });\n const values = makeFieldValueLookup({\n baseUrl,\n index: target,\n params,\n roles,\n });\n\n return (\n <EsQueryBuilder\n search={search}\n onChange={(next) => onChange(next)}\n fields={esQueryFields(inspection.completion)}\n vocabulary={esBuilderVocabulary({ properties: { search: schema } })}\n params={rootValue.params ?? []}\n onMappingChange={(edit) => {\n if (!onRootChange) {\n throw new Error(\n \"query parameter mappings require an atomic root form update\",\n );\n }\n onRootChange({\n ...rootValue,\n params: edit.params,\n provider: {\n ...rootValue.provider,\n options: {\n ...rootValue.provider?.options,\n search: edit.search,\n },\n },\n });\n }}\n {...(values ? { values } : {})}\n compilation={compilation}\n />\n );\n}\n\nfunction timeFieldFormatLabel(format: EsTimeFieldFormat): string {\n switch (format) {\n case \"epoch_second\":\n return \"Seconds\";\n case \"epoch_millis\":\n return \"Milliseconds\";\n case \"epoch_micros\":\n return \"Microseconds\";\n case \"epoch_nanos\":\n return \"Nanoseconds\";\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAsEA,SAAgB,eAAe,EAC7B,QACA,UACA,QACA,YACA,SAAS,CAAC,GACV,iBACA,QACA,aACA,aACsB;CACtB,MAAM,OAAO,OAAO,SAASA,4BAAAA,WAAW;CACxC,MAAM,0BAA0BC,2BAAAA,wBAC9B,QACA,OAAO,SACT;CACA,MAAM,wBAAwB,SAC5B,KAAK,OAAO,MAAM,OAAO,UAAU,MAAM,UAAU,OAAO,MAAM,EAAE,KAAK;CACzE,MAAM,qBAAqB,SAA2B;EACpD,IAAI,iBAAiB;GACnB,gBAAgB,IAAI;GACpB;EACF;EACA,IAAI,qBAAqB,IAAI,GAC3B,MAAM,IAAI,MACR,kEACF;EAEF,SAAS,KAAK,MAAM;CACtB;CACA,MAAM,oBAAoB,eAAyB;EACjD,MAAM,OAAOC,4BAAAA,6BAA6B;GACxC,gBAAgB;GAChB;GACA;EACF,CAAC;EACD,IAAI,qBAAqB,IAAI,GAAG;GAC9B,kBAAkB,IAAI;GACtB;EACF;EACA,SAAS,UAAU;CACrB;CACA,MAAM,UAA0B;EAC9B;EACA;EACA;EAKA,GAAI,SACA,EACE,SAAS,EAAE,MAAM,YAAY;GAC3B,MAAM,SAASC,sBAAAA,iBAAiB,Q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AAK,gBACH,OAAO;EACT,KAAK,gBACH,OAAO;EACT,KAAK,eACH,OAAO;CACX;AACF"}
|
|
1
|
+
{"version":3,"file":"esQueryBuilder.cjs","names":["emptyGroup","timeFieldFormatRequired","reconcileSearchParamMappings","valueLookupField","removeAt","EsQueryClauseGroup","updateAt","insertAt","conditionAt","bindParamOperand","removeParamMapping","Combobox","selectTimeField","timeFieldMappings","_Fragment","EsQuerySortEditor","EsQueryOutputEditor","EsQueryPreview","savedConnectionID","browserBaseUrl","useInspection","paramRoles","defaultParamValues","useCompiledSearch","makeFieldValueLookup","esQueryFields","esBuilderVocabulary","timeFieldUnitReadout"],"sources":["../../../src/profiles/elasticsearch/esQueryBuilder.tsx"],"sourcesContent":["/**\n * The query builder panel and the form extension that mounts it. The panel is\n * pure: it takes a specification and the vocabulary the schema described, and\n * reports edits. Everything that needs a connection — field mappings and the\n * compiled preview — is wired by the host that has one.\n */\n\nimport { Combobox } from \"../../components/Combobox\";\nimport type { JsonSchemaProperty } from \"../../components/json-schema-form-types\";\nimport {\n browserBaseUrl,\n savedConnectionID,\n} from \"../connections/connectionBrowserModel\";\nimport { useInspection } from \"../connections/useInspection\";\nimport {\n conditionAt,\n emptyGroup,\n insertAt,\n removeAt,\n updateAt,\n type EsSearch,\n type EsTimeFieldFormat,\n} from \"./esQueryBuilderModel\";\nimport {\n makeFieldValueLookup,\n valueLookupField,\n type FieldValuesSource,\n} from \"./esFieldValues\";\nimport { EsQueryClauseGroup } from \"./esQueryClauseGroup\";\nimport type { EsQueryContext, EsQueryTreeActions } from \"./esQueryConditionRow\";\nimport {\n esBuilderVocabulary,\n type EsBuilderVocabulary,\n type EsFieldMapping,\n} from \"./esQueryOperators\";\nimport { EsQueryOutputEditor } from \"./esQueryOutputEditor\";\nimport { EsQueryPreview } from \"./esQueryPreview\";\nimport { EsQuerySortEditor } from \"./esQuerySortEditor\";\nimport type { ProfileDraft } from \"../editor/profileBuilderWorkspace\";\nimport type { ParamDraft } from \"../wizard/profileWizardModel\";\nimport {\n bindParamOperand,\n reconcileSearchParamMappings,\n removeParamMapping,\n type ParamMappingEdit,\n} from \"./esParamMappingModel\";\nimport {\n defaultParamValues,\n esQueryFields,\n paramRoles,\n selectTimeField,\n timeFieldFormatRequired,\n timeFieldMappings,\n timeFieldUnitReadout,\n} from \"./esQueryBuilderForm\";\nimport { useCompiledSearch, type EsCompilation } from \"./esQueryCompile\";\n\nexport type EsQueryBuilderProps = {\n search: EsSearch;\n onChange: (search: EsSearch) => void;\n fields: EsFieldMapping[];\n vocabulary: EsBuilderVocabulary;\n /** Declared profile parameters an operand can bind to. */\n params?: ParamDraft[];\n onMappingChange?: (edit: ParamMappingEdit) => void;\n /** Where a field's own values come from; absent without a connection. */\n values?: FieldValuesSource;\n compilation?: EsCompilation;\n className?: string;\n};\n\nexport function EsQueryBuilder({\n search,\n onChange,\n fields,\n vocabulary,\n params = [],\n onMappingChange,\n values,\n compilation,\n className,\n}: EsQueryBuilderProps) {\n const root = search.query ?? emptyGroup();\n const requiresTimeFieldFormat = timeFieldFormatRequired(\n fields,\n search.timeField,\n );\n const dateField =\n search.timeField && !requiresTimeFieldFormat\n ? fields.find((field) => field.name === search.timeField)\n : undefined;\n const mappingFieldsChanged = (edit: ParamMappingEdit) =>\n edit.params.some((param, index) => param.field !== params[index]?.field);\n const commitMappingEdit = (edit: ParamMappingEdit) => {\n if (onMappingChange) {\n onMappingChange(edit);\n return;\n }\n if (mappingFieldsChanged(edit)) {\n throw new Error(\n \"list parameter mappings require an atomic mapping change handler\",\n );\n }\n onChange(edit.search);\n };\n const commitSearchEdit = (nextSearch: EsSearch) => {\n const edit = reconcileSearchParamMappings({\n previousSearch: search,\n nextSearch,\n params,\n });\n if (mappingFieldsChanged(edit)) {\n commitMappingEdit(edit);\n return;\n }\n onChange(nextSearch);\n };\n const context: EsQueryContext = {\n fields,\n vocabulary,\n params,\n // The builder owns the tree, so it — not the host — decides what a lookup is\n // scoped by: the query without the row being edited. Leaving that row in\n // would filter the suggestions by the half-typed value they are meant to\n // complete.\n ...(values\n ? {\n values: ({ path, field }) => {\n const target = valueLookupField(fields, field);\n if (!target) return undefined;\n return values({\n field: target,\n search: { ...search, query: removeAt(root, path) },\n });\n },\n }\n : {}),\n };\n const actions: EsQueryTreeActions = {\n update: (path, update) =>\n commitSearchEdit({ ...search, query: updateAt(root, path, update) }),\n insert: (groupPath, condition) =>\n commitSearchEdit({\n ...search,\n query: insertAt(\n root,\n groupPath,\n conditionAt(root, groupPath)?.conditions?.length ?? 0,\n condition,\n ),\n }),\n remove: (path) =>\n commitSearchEdit({ ...search, query: removeAt(root, path) }),\n mapParam: (path, operand, name) => {\n const edit = bindParamOperand({ search, params, path, operand, name });\n commitMappingEdit(edit);\n },\n unmapParam: (path, name) => {\n const edit = removeParamMapping({ search, params, name, path });\n commitMappingEdit(edit);\n },\n };\n\n return (\n <div className={className ?? \"flex min-w-0 flex-col gap-3\"}>\n <EsQueryClauseGroup\n condition={root}\n path={[]}\n context={context}\n actions={actions}\n root\n />\n <div className=\"flex flex-wrap items-center gap-2\">\n <span className=\"text-xs text-muted-foreground\">Time field</span>\n <Combobox\n ariaLabel=\"Time field\"\n className=\"min-w-48\"\n value={search.timeField ?? \"\"}\n onChange={(next) => onChange(selectTimeField(search, fields, next))}\n options={timeFieldMappings(fields).map((field) => ({\n value: field.name,\n label: field.name,\n }))}\n placeholder=\"Timestamp field…\"\n allowCustomValue\n />\n {requiresTimeFieldFormat ? (\n <>\n <span className=\"text-xs text-muted-foreground\">Epoch unit</span>\n <Combobox\n ariaLabel=\"Time field format\"\n ariaRequired\n required\n invalid={!search.timeFieldFormat}\n className=\"min-w-40\"\n value={search.timeFieldFormat ?? \"\"}\n onChange={(next) =>\n onChange({\n ...search,\n timeFieldFormat: (next || undefined) as\n | EsTimeFieldFormat\n | undefined,\n })\n }\n options={(vocabulary.timeFieldFormats ?? []).map((format) => ({\n value: format,\n label: timeFieldFormatLabel(format),\n }))}\n placeholder=\"Select epoch unit…\"\n allowCustomValue={false}\n />\n </>\n ) : dateField ? (\n <TimeFieldUnitReadout field={dateField} />\n ) : null}\n <span className=\"text-xs text-muted-foreground\">\n Where time-from and time-to parameters apply\n </span>\n </div>\n <EsQuerySortEditor\n sort={search.sort ?? []}\n fields={fields}\n orders={vocabulary.sortOrders}\n onChange={(sort) =>\n onChange({ ...search, sort: sort.length ? sort : undefined })\n }\n />\n <EsQueryOutputEditor\n search={search}\n onChange={(patch) => onChange({ ...search, ...patch })}\n />\n {compilation ? <EsQueryPreview compilation={compilation} /> : null}\n </div>\n );\n}\n\n/**\n * The builder as the profile form mounts it. The form knows the connection and\n * the index, so the field mappings and the compiled preview come from the same\n * browser endpoints the connection browser uses.\n */\nexport function EsQueryBuilderField({\n search,\n onChange,\n schema,\n rootValue,\n onRootChange,\n}: {\n search: EsSearch;\n onChange: (next: unknown) => void;\n schema: JsonSchemaProperty;\n rootValue: ProfileDraft;\n onRootChange?: ((next: Record<string, unknown>) => void) | undefined;\n}) {\n const connectionID = savedConnectionID(rootValue.provider?.connection);\n const baseUrl = connectionID ? browserBaseUrl(connectionID) : \"\";\n const target = String(rootValue.provider?.options?.index ?? \"\");\n const inspection = useInspection({\n cacheKey: \"es-query-builder\",\n id: connectionID ?? \"\",\n baseUrl,\n enabled: baseUrl !== \"\",\n database: \"\",\n target,\n });\n const roles = paramRoles(rootValue.params);\n const params = defaultParamValues(rootValue.params);\n const compilation = useCompiledSearch({\n baseUrl,\n index: target,\n search,\n params,\n roles,\n enabled: baseUrl !== \"\",\n });\n const values = makeFieldValueLookup({\n baseUrl,\n index: target,\n params,\n roles,\n });\n\n return (\n <EsQueryBuilder\n search={search}\n onChange={(next) => onChange(next)}\n fields={esQueryFields(inspection.completion)}\n vocabulary={esBuilderVocabulary({ properties: { search: schema } })}\n params={rootValue.params ?? []}\n onMappingChange={(edit) => {\n if (!onRootChange) {\n throw new Error(\n \"query parameter mappings require an atomic root form update\",\n );\n }\n onRootChange({\n ...rootValue,\n params: edit.params,\n provider: {\n ...rootValue.provider,\n options: {\n ...rootValue.provider?.options,\n search: edit.search,\n },\n },\n });\n }}\n {...(values ? { values } : {})}\n compilation={compilation}\n />\n );\n}\n\nfunction TimeFieldUnitReadout({ field }: { field: EsFieldMapping }) {\n const { state, text } = timeFieldUnitReadout(field);\n return (\n <span\n data-es-time-unit={state}\n className={\n state === \"conflicting\"\n ? \"text-xs text-destructive\"\n : \"text-xs text-foreground\"\n }\n >\n {text}\n </span>\n );\n}\n\nfunction timeFieldFormatLabel(format: EsTimeFieldFormat): string {\n switch (format) {\n case \"epoch_second\":\n return \"Seconds\";\n case \"epoch_millis\":\n return \"Milliseconds\";\n case \"epoch_micros\":\n return \"Microseconds\";\n case \"epoch_nanos\":\n return \"Nanoseconds\";\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAuEA,SAAgB,eAAe,EAC7B,QACA,UACA,QACA,YACA,SAAS,CAAC,GACV,iBACA,QACA,aACA,aACsB;CACtB,MAAM,OAAO,OAAO,SAASA,4BAAAA,WAAW;CACxC,MAAM,0BAA0BC,2BAAAA,wBAC9B,QACA,OAAO,SACT;CACA,MAAM,YACJ,OAAO,aAAa,CAAC,0BACjB,OAAO,MAAM,UAAU,MAAM,SAAS,OAAO,SAAS,IACtD,KAAA;CACN,MAAM,wBAAwB,SAC5B,KAAK,OAAO,MAAM,OAAO,UAAU,MAAM,UAAU,OAAO,MAAM,EAAE,KAAK;CACzE,MAAM,qBAAqB,SAA2B;EACpD,IAAI,iBAAiB;GACnB,gBAAgB,IAAI;GACpB;EACF;EACA,IAAI,qBAAqB,IAAI,GAC3B,MAAM,IAAI,MACR,kEACF;EAEF,SAAS,KAAK,MAAM;CACtB;CACA,MAAM,oBAAoB,eAAyB;EACjD,MAAM,OAAOC,4BAAAA,6BAA6B;GACxC,gBAAgB;GAChB;GACA;EACF,CAAC;EACD,IAAI,qBAAqB,IAAI,GAAG;GAC9B,kBAAkB,IAAI;GACtB;EACF;EACA,SAAS,UAAU;CACr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UAAU,UAAU;MACvB,QAAQ,KAAK;KACf;IACF;GACF,CAAC;EACH;EACA,GAAK,SAAS,EAAE,OAAO,IAAI,CAAC;EACf;CACd,CAAA;AAEL;AAEA,SAAS,qBAAqB,EAAE,SAAoC;CAClE,MAAM,EAAE,OAAO,SAASC,2BAAAA,qBAAqB,KAAK;CAClD,OACE,iBAAA,GAAA,kBAAA,IAAA,CAAC,QAAD;EACE,qBAAmB;EACnB,WACE,UAAU,gBACN,6BACA;EAGL,UAAA;CACG,CAAA;AAEV;AAEA,SAAS,qBAAqB,QAAmC;CAC/D,QAAQ,QAAR;EACE,KAAK,gBACH,OAAO;EACT,KAAK,gBACH,OAAO;EACT,KAAK,gBACH,OAAO;EACT,KAAK,eACH,OAAO;CACX;AACF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"esQueryBuilder.d.ts","sourceRoot":"","sources":["../../../src/profiles/elasticsearch/esQueryBuilder.tsx"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,yCAAyC,CAAC;AAMlF,OAAO,EAML,KAAK,QAAQ,EAEd,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAGL,KAAK,iBAAiB,EACvB,MAAM,iBAAiB,CAAC;AAGzB,OAAO,EAEL,KAAK,mBAAmB,EACxB,KAAK,cAAc,EACpB,MAAM,oBAAoB,CAAC;AAI5B,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mCAAmC,CAAC;AACtE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,8BAA8B,CAAC;AAC/D,OAAO,EAIL,KAAK,gBAAgB,EACtB,MAAM,uBAAuB,CAAC;
|
|
1
|
+
{"version":3,"file":"esQueryBuilder.d.ts","sourceRoot":"","sources":["../../../src/profiles/elasticsearch/esQueryBuilder.tsx"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,yCAAyC,CAAC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KAAK,IAAI,CAAC;IAClC,MAAM,EAAE,kBAAkB,CAAC;IAC3B,SAAS,EAAE,YAAY,CAAC;IACxB,YAAY,CAAC,EAAE,CAAC,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAK,IAAI,CAAC,GAAG,SAAS,CAAC;CACtE,+BA0DA"}
|
|
@@ -9,7 +9,7 @@ import { EsQueryOutputEditor } from "./esQueryOutputEditor.js";
|
|
|
9
9
|
import { EsQueryPreview } from "./esQueryPreview.js";
|
|
10
10
|
import { EsQuerySortEditor } from "./esQuerySortEditor.js";
|
|
11
11
|
import { bindParamOperand, reconcileSearchParamMappings, removeParamMapping } from "./esParamMappingModel.js";
|
|
12
|
-
import { defaultParamValues, esQueryFields, paramRoles, selectTimeField, timeFieldFormatRequired, timeFieldMappings } from "./esQueryBuilderForm.js";
|
|
12
|
+
import { defaultParamValues, esQueryFields, paramRoles, selectTimeField, timeFieldFormatRequired, timeFieldMappings, timeFieldUnitReadout } from "./esQueryBuilderForm.js";
|
|
13
13
|
import { useCompiledSearch } from "./esQueryCompile.js";
|
|
14
14
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
15
15
|
// src/profiles/elasticsearch/esQueryBuilder.tsx
|
|
@@ -22,6 +22,7 @@ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
|
22
22
|
function EsQueryBuilder({ search, onChange, fields, vocabulary, params = [], onMappingChange, values, compilation, className }) {
|
|
23
23
|
const root = search.query ?? emptyGroup();
|
|
24
24
|
const requiresTimeFieldFormat = timeFieldFormatRequired(fields, search.timeField);
|
|
25
|
+
const dateField = search.timeField && !requiresTimeFieldFormat ? fields.find((field) => field.name === search.timeField) : void 0;
|
|
25
26
|
const mappingFieldsChanged = (edit) => edit.params.some((param, index) => param.field !== params[index]?.field);
|
|
26
27
|
const commitMappingEdit = (edit) => {
|
|
27
28
|
if (onMappingChange) {
|
|
@@ -140,7 +141,7 @@ function EsQueryBuilder({ search, onChange, fields, vocabulary, params = [], onM
|
|
|
140
141
|
})),
|
|
141
142
|
placeholder: "Select epoch unit…",
|
|
142
143
|
allowCustomValue: false
|
|
143
|
-
})] }) : null,
|
|
144
|
+
})] }) : dateField ? /* @__PURE__ */ jsx(TimeFieldUnitReadout, { field: dateField }) : null,
|
|
144
145
|
/* @__PURE__ */ jsx("span", {
|
|
145
146
|
className: "text-xs text-muted-foreground",
|
|
146
147
|
children: "Where time-from and time-to parameters apply"
|
|
@@ -224,6 +225,14 @@ function EsQueryBuilderField({ search, onChange, schema, rootValue, onRootChange
|
|
|
224
225
|
compilation
|
|
225
226
|
});
|
|
226
227
|
}
|
|
228
|
+
function TimeFieldUnitReadout({ field }) {
|
|
229
|
+
const { state, text } = timeFieldUnitReadout(field);
|
|
230
|
+
return /* @__PURE__ */ jsx("span", {
|
|
231
|
+
"data-es-time-unit": state,
|
|
232
|
+
className: state === "conflicting" ? "text-xs text-destructive" : "text-xs text-foreground",
|
|
233
|
+
children: text
|
|
234
|
+
});
|
|
235
|
+
}
|
|
227
236
|
function timeFieldFormatLabel(format) {
|
|
228
237
|
switch (format) {
|
|
229
238
|
case "epoch_second": return "Seconds";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"esQueryBuilder.js","names":["_Fragment"],"sources":["../../../src/profiles/elasticsearch/esQueryBuilder.tsx"],"sourcesContent":["/**\n * The query builder panel and the form extension that mounts it. The panel is\n * pure: it takes a specification and the vocabulary the schema described, and\n * reports edits. Everything that needs a connection — field mappings and the\n * compiled preview — is wired by the host that has one.\n */\n\nimport { Combobox } from \"../../components/Combobox\";\nimport type { JsonSchemaProperty } from \"../../components/json-schema-form-types\";\nimport {\n browserBaseUrl,\n savedConnectionID,\n} from \"../connections/connectionBrowserModel\";\nimport { useInspection } from \"../connections/useInspection\";\nimport {\n conditionAt,\n emptyGroup,\n insertAt,\n removeAt,\n updateAt,\n type EsSearch,\n type EsTimeFieldFormat,\n} from \"./esQueryBuilderModel\";\nimport {\n makeFieldValueLookup,\n valueLookupField,\n type FieldValuesSource,\n} from \"./esFieldValues\";\nimport { EsQueryClauseGroup } from \"./esQueryClauseGroup\";\nimport type { EsQueryContext, EsQueryTreeActions } from \"./esQueryConditionRow\";\nimport {\n esBuilderVocabulary,\n type EsBuilderVocabulary,\n type EsFieldMapping,\n} from \"./esQueryOperators\";\nimport { EsQueryOutputEditor } from \"./esQueryOutputEditor\";\nimport { EsQueryPreview } from \"./esQueryPreview\";\nimport { EsQuerySortEditor } from \"./esQuerySortEditor\";\nimport type { ProfileDraft } from \"../editor/profileBuilderWorkspace\";\nimport type { ParamDraft } from \"../wizard/profileWizardModel\";\nimport {\n bindParamOperand,\n reconcileSearchParamMappings,\n removeParamMapping,\n type ParamMappingEdit,\n} from \"./esParamMappingModel\";\nimport {\n defaultParamValues,\n esQueryFields,\n paramRoles,\n selectTimeField,\n timeFieldFormatRequired,\n timeFieldMappings,\n} from \"./esQueryBuilderForm\";\nimport { useCompiledSearch, type EsCompilation } from \"./esQueryCompile\";\n\nexport type EsQueryBuilderProps = {\n search: EsSearch;\n onChange: (search: EsSearch) => void;\n fields: EsFieldMapping[];\n vocabulary: EsBuilderVocabulary;\n /** Declared profile parameters an operand can bind to. */\n params?: ParamDraft[];\n onMappingChange?: (edit: ParamMappingEdit) => void;\n /** Where a field's own values come from; absent without a connection. */\n values?: FieldValuesSource;\n compilation?: EsCompilation;\n className?: string;\n};\n\nexport function EsQueryBuilder({\n search,\n onChange,\n fields,\n vocabulary,\n params = [],\n onMappingChange,\n values,\n compilation,\n className,\n}: EsQueryBuilderProps) {\n const root = search.query ?? emptyGroup();\n const requiresTimeFieldFormat = timeFieldFormatRequired(\n fields,\n search.timeField,\n );\n const mappingFieldsChanged = (edit: ParamMappingEdit) =>\n edit.params.some((param, index) => param.field !== params[index]?.field);\n const commitMappingEdit = (edit: ParamMappingEdit) => {\n if (onMappingChange) {\n onMappingChange(edit);\n return;\n }\n if (mappingFieldsChanged(edit)) {\n throw new Error(\n \"list parameter mappings require an atomic mapping change handler\",\n );\n }\n onChange(edit.search);\n };\n const commitSearchEdit = (nextSearch: EsSearch) => {\n const edit = reconcileSearchParamMappings({\n previousSearch: search,\n nextSearch,\n params,\n });\n if (mappingFieldsChanged(edit)) {\n commitMappingEdit(edit);\n return;\n }\n onChange(nextSearch);\n };\n const context: EsQueryContext = {\n fields,\n vocabulary,\n params,\n // The builder owns the tree, so it — not the host — decides what a lookup is\n // scoped by: the query without the row being edited. Leaving that row in\n // would filter the suggestions by the half-typed value they are meant to\n // complete.\n ...(values\n ? {\n values: ({ path, field }) => {\n const target = valueLookupField(fields, field);\n if (!target) return undefined;\n return values({\n field: target,\n search: { ...search, query: removeAt(root, path) },\n });\n },\n }\n : {}),\n };\n const actions: EsQueryTreeActions = {\n update: (path, update) =>\n commitSearchEdit({ ...search, query: updateAt(root, path, update) }),\n insert: (groupPath, condition) =>\n commitSearchEdit({\n ...search,\n query: insertAt(\n root,\n groupPath,\n conditionAt(root, groupPath)?.conditions?.length ?? 0,\n condition,\n ),\n }),\n remove: (path) =>\n commitSearchEdit({ ...search, query: removeAt(root, path) }),\n mapParam: (path, operand, name) => {\n const edit = bindParamOperand({ search, params, path, operand, name });\n commitMappingEdit(edit);\n },\n unmapParam: (path, name) => {\n const edit = removeParamMapping({ search, params, name, path });\n commitMappingEdit(edit);\n },\n };\n\n return (\n <div className={className ?? \"flex min-w-0 flex-col gap-3\"}>\n <EsQueryClauseGroup\n condition={root}\n path={[]}\n context={context}\n actions={actions}\n root\n />\n <div className=\"flex flex-wrap items-center gap-2\">\n <span className=\"text-xs text-muted-foreground\">Time field</span>\n <Combobox\n ariaLabel=\"Time field\"\n className=\"min-w-48\"\n value={search.timeField ?? \"\"}\n onChange={(next) => onChange(selectTimeField(search, fields, next))}\n options={timeFieldMappings(fields).map((field) => ({\n value: field.name,\n label: field.name,\n }))}\n placeholder=\"Timestamp field…\"\n allowCustomValue\n />\n {requiresTimeFieldFormat ? (\n <>\n <span className=\"text-xs text-muted-foreground\">Epoch unit</span>\n <Combobox\n ariaLabel=\"Time field format\"\n ariaRequired\n required\n invalid={!search.timeFieldFormat}\n className=\"min-w-40\"\n value={search.timeFieldFormat ?? \"\"}\n onChange={(next) =>\n onChange({\n ...search,\n timeFieldFormat: (next || undefined) as\n | EsTimeFieldFormat\n | undefined,\n })\n }\n options={(vocabulary.timeFieldFormats ?? []).map((format) => ({\n value: format,\n label: timeFieldFormatLabel(format),\n }))}\n placeholder=\"Select epoch unit…\"\n allowCustomValue={false}\n />\n </>\n ) : null}\n <span className=\"text-xs text-muted-foreground\">\n Where time-from and time-to parameters apply\n </span>\n </div>\n <EsQuerySortEditor\n sort={search.sort ?? []}\n fields={fields}\n orders={vocabulary.sortOrders}\n onChange={(sort) =>\n onChange({ ...search, sort: sort.length ? sort : undefined })\n }\n />\n <EsQueryOutputEditor\n search={search}\n onChange={(patch) => onChange({ ...search, ...patch })}\n />\n {compilation ? <EsQueryPreview compilation={compilation} /> : null}\n </div>\n );\n}\n\n/**\n * The builder as the profile form mounts it. The form knows the connection and\n * the index, so the field mappings and the compiled preview come from the same\n * browser endpoints the connection browser uses.\n */\nexport function EsQueryBuilderField({\n search,\n onChange,\n schema,\n rootValue,\n onRootChange,\n}: {\n search: EsSearch;\n onChange: (next: unknown) => void;\n schema: JsonSchemaProperty;\n rootValue: ProfileDraft;\n onRootChange?: ((next: Record<string, unknown>) => void) | undefined;\n}) {\n const connectionID = savedConnectionID(rootValue.provider?.connection);\n const baseUrl = connectionID ? browserBaseUrl(connectionID) : \"\";\n const target = String(rootValue.provider?.options?.index ?? \"\");\n const inspection = useInspection({\n cacheKey: \"es-query-builder\",\n id: connectionID ?? \"\",\n baseUrl,\n enabled: baseUrl !== \"\",\n database: \"\",\n target,\n });\n const roles = paramRoles(rootValue.params);\n const params = defaultParamValues(rootValue.params);\n const compilation = useCompiledSearch({\n baseUrl,\n index: target,\n search,\n params,\n roles,\n enabled: baseUrl !== \"\",\n });\n const values = makeFieldValueLookup({\n baseUrl,\n index: target,\n params,\n roles,\n });\n\n return (\n <EsQueryBuilder\n search={search}\n onChange={(next) => onChange(next)}\n fields={esQueryFields(inspection.completion)}\n vocabulary={esBuilderVocabulary({ properties: { search: schema } })}\n params={rootValue.params ?? []}\n onMappingChange={(edit) => {\n if (!onRootChange) {\n throw new Error(\n \"query parameter mappings require an atomic root form update\",\n );\n }\n onRootChange({\n ...rootValue,\n params: edit.params,\n provider: {\n ...rootValue.provider,\n options: {\n ...rootValue.provider?.options,\n search: edit.search,\n },\n },\n });\n }}\n {...(values ? { values } : {})}\n compilation={compilation}\n />\n );\n}\n\nfunction timeFieldFormatLabel(format: EsTimeFieldFormat): string {\n switch (format) {\n case \"epoch_second\":\n return \"Seconds\";\n case \"epoch_millis\":\n return \"Milliseconds\";\n case \"epoch_micros\":\n return \"Microseconds\";\n case \"epoch_nanos\":\n return \"Nanoseconds\";\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAsEA,SAAgB,eAAe,EAC7B,QACA,UACA,QACA,YACA,SAAS,CAAC,GACV,iBACA,QACA,aACA,aACsB;CACtB,MAAM,OAAO,OAAO,SAAS,WAAW;CACxC,MAAM,0BAA0B,wBAC9B,QACA,OAAO,SACT;CACA,MAAM,wBAAwB,SAC5B,KAAK,OAAO,MAAM,OAAO,UAAU,MAAM,UAAU,OAAO,MAAM,EAAE,KAAK;CACzE,MAAM,qBAAqB,SAA2B;EACpD,IAAI,iBAAiB;GACnB,gBAAgB,IAAI;GACpB;EACF;EACA,IAAI,qBAAqB,IAAI,GAC3B,MAAM,IAAI,MACR,kEACF;EAEF,SAAS,KAAK,MAAM;CACtB;CACA,MAAM,oBAAoB,eAAyB;EACjD,MAAM,OAAO,6BAA6B;GACxC,gBAAgB;GAChB;GACA;EACF,CAAC;EACD,IAAI,qBAAqB,IAAI,GAAG;GAC9B,kBAAkB,IAAI;GACtB;EACF;EACA,SAAS,UAAU;CACrB;CACA,MAAM,UAA0B;EAC9B;EACA;E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AM,QAAQ,WAAW,UAAU,MAAM;CACzC,MAAM,SAAS,mBAAmB,UAAU,MAAM;CAClD,MAAM,cAAc,kBAAkB;EACpC;EACA,OAAO;EACP;EACA;EACA;EACA,SAAS,YAAY;CACvB,CAAC;CACD,MAAM,SAAS,qBAAqB;EAClC;EACA,OAAO;EACP;EACA;CACF,CAAC;CAED,OACE,oBAAC,gBAAD;EACU;EACR,WAAW,SAAS,SAAS,IAAI;EACjC,QAAQ,cAAc,WAAW,UAAU;EAC3C,YAAY,oBAAoB,EAAE,YAAY,EAAE,QAAQ,OAAO,EAAE,CAAC;EAClE,QAAQ,UAAU,UAAU,CAAC;EAC7B,kBAAkB,SAAS;GACzB,IAAI,CAAC,cACH,MAAM,IAAI,MACR,6DACF;GAEF,aAAa;IACX,GAAG;IACH,QAAQ,KAAK;IACb,UAAU;KACR,GAAG,UAAU;KACb,SAAS;MACP,GAAG,UAAU,UAAU;MACvB,QAAQ,KAAK;KACf;IACF;GACF,CAAC;EACH;EACA,GAAK,SAAS,EAAE,OAAO,IAAI,CAAC;EACf;CACd,CAAA;AAEL;AAEA,SAAS,qBAAqB,QAAmC;CAC/D,QAAQ,QAAR;EACE,KAAK,gBACH,OAAO;EACT,KAAK,gBACH,OAAO;EACT,KAAK,gBACH,OAAO;EACT,KAAK,eACH,OAAO;CACX;AACF"}
|
|
1
|
+
{"version":3,"file":"esQueryBuilder.js","names":["_Fragment"],"sources":["../../../src/profiles/elasticsearch/esQueryBuilder.tsx"],"sourcesContent":["/**\n * The query builder panel and the form extension that mounts it. The panel is\n * pure: it takes a specification and the vocabulary the schema described, and\n * reports edits. Everything that needs a connection — field mappings and the\n * compiled preview — is wired by the host that has one.\n */\n\nimport { Combobox } from \"../../components/Combobox\";\nimport type { JsonSchemaProperty } from \"../../components/json-schema-form-types\";\nimport {\n browserBaseUrl,\n savedConnectionID,\n} from \"../connections/connectionBrowserModel\";\nimport { useInspection } from \"../connections/useInspection\";\nimport {\n conditionAt,\n emptyGroup,\n insertAt,\n removeAt,\n updateAt,\n type EsSearch,\n type EsTimeFieldFormat,\n} from \"./esQueryBuilderModel\";\nimport {\n makeFieldValueLookup,\n valueLookupField,\n type FieldValuesSource,\n} from \"./esFieldValues\";\nimport { EsQueryClauseGroup } from \"./esQueryClauseGroup\";\nimport type { EsQueryContext, EsQueryTreeActions } from \"./esQueryConditionRow\";\nimport {\n esBuilderVocabulary,\n type EsBuilderVocabulary,\n type EsFieldMapping,\n} from \"./esQueryOperators\";\nimport { EsQueryOutputEditor } from \"./esQueryOutputEditor\";\nimport { EsQueryPreview } from \"./esQueryPreview\";\nimport { EsQuerySortEditor } from \"./esQuerySortEditor\";\nimport type { ProfileDraft } from \"../editor/profileBuilderWorkspace\";\nimport type { ParamDraft } from \"../wizard/profileWizardModel\";\nimport {\n bindParamOperand,\n reconcileSearchParamMappings,\n removeParamMapping,\n type ParamMappingEdit,\n} from \"./esParamMappingModel\";\nimport {\n defaultParamValues,\n esQueryFields,\n paramRoles,\n selectTimeField,\n timeFieldFormatRequired,\n timeFieldMappings,\n timeFieldUnitReadout,\n} from \"./esQueryBuilderForm\";\nimport { useCompiledSearch, type EsCompilation } from \"./esQueryCompile\";\n\nexport type EsQueryBuilderProps = {\n search: EsSearch;\n onChange: (search: EsSearch) => void;\n fields: EsFieldMapping[];\n vocabulary: EsBuilderVocabulary;\n /** Declared profile parameters an operand can bind to. */\n params?: ParamDraft[];\n onMappingChange?: (edit: ParamMappingEdit) => void;\n /** Where a field's own values come from; absent without a connection. */\n values?: FieldValuesSource;\n compilation?: EsCompilation;\n className?: string;\n};\n\nexport function EsQueryBuilder({\n search,\n onChange,\n fields,\n vocabulary,\n params = [],\n onMappingChange,\n values,\n compilation,\n className,\n}: EsQueryBuilderProps) {\n const root = search.query ?? emptyGroup();\n const requiresTimeFieldFormat = timeFieldFormatRequired(\n fields,\n search.timeField,\n );\n const dateField =\n search.timeField && !requiresTimeFieldFormat\n ? fields.find((field) => field.name === search.timeField)\n : undefined;\n const mappingFieldsChanged = (edit: ParamMappingEdit) =>\n edit.params.some((param, index) => param.field !== params[index]?.field);\n const commitMappingEdit = (edit: ParamMappingEdit) => {\n if (onMappingChange) {\n onMappingChange(edit);\n return;\n }\n if (mappingFieldsChanged(edit)) {\n throw new Error(\n \"list parameter mappings require an atomic mapping change handler\",\n );\n }\n onChange(edit.search);\n };\n const commitSearchEdit = (nextSearch: EsSearch) => {\n const edit = reconcileSearchParamMappings({\n previousSearch: search,\n nextSearch,\n params,\n });\n if (mappingFieldsChanged(edit)) {\n commitMappingEdit(edit);\n return;\n }\n onChange(nextSearch);\n };\n const context: EsQueryContext = {\n fields,\n vocabulary,\n params,\n // The builder owns the tree, so it — not the host — decides what a lookup is\n // scoped by: the query without the row being edited. Leaving that row in\n // would filter the suggestions by the half-typed value they are meant to\n // complete.\n ...(values\n ? {\n values: ({ path, field }) => {\n const target = valueLookupField(fields, field);\n if (!target) return undefined;\n return values({\n field: target,\n search: { ...search, query: removeAt(root, path) },\n });\n },\n }\n : {}),\n };\n const actions: EsQueryTreeActions = {\n update: (path, update) =>\n commitSearchEdit({ ...search, query: updateAt(root, path, update) }),\n insert: (groupPath, condition) =>\n commitSearchEdit({\n ...search,\n query: insertAt(\n root,\n groupPath,\n conditionAt(root, groupPath)?.conditions?.length ?? 0,\n condition,\n ),\n }),\n remove: (path) =>\n commitSearchEdit({ ...search, query: removeAt(root, path) }),\n mapParam: (path, operand, name) => {\n const edit = bindParamOperand({ search, params, path, operand, name });\n commitMappingEdit(edit);\n },\n unmapParam: (path, name) => {\n const edit = removeParamMapping({ search, params, name, path });\n commitMappingEdit(edit);\n },\n };\n\n return (\n <div className={className ?? \"flex min-w-0 flex-col gap-3\"}>\n <EsQueryClauseGroup\n condition={root}\n path={[]}\n context={context}\n actions={actions}\n root\n />\n <div className=\"flex flex-wrap items-center gap-2\">\n <span className=\"text-xs text-muted-foreground\">Time field</span>\n <Combobox\n ariaLabel=\"Time field\"\n className=\"min-w-48\"\n value={search.timeField ?? \"\"}\n onChange={(next) => onChange(selectTimeField(search, fields, next))}\n options={timeFieldMappings(fields).map((field) => ({\n value: field.name,\n label: field.name,\n }))}\n placeholder=\"Timestamp field…\"\n allowCustomValue\n />\n {requiresTimeFieldFormat ? (\n <>\n <span className=\"text-xs text-muted-foreground\">Epoch unit</span>\n <Combobox\n ariaLabel=\"Time field format\"\n ariaRequired\n required\n invalid={!search.timeFieldFormat}\n className=\"min-w-40\"\n value={search.timeFieldFormat ?? \"\"}\n onChange={(next) =>\n onChange({\n ...search,\n timeFieldFormat: (next || undefined) as\n | EsTimeFieldFormat\n | undefined,\n })\n }\n options={(vocabulary.timeFieldFormats ?? []).map((format) => ({\n value: format,\n label: timeFieldFormatLabel(format),\n }))}\n placeholder=\"Select epoch unit…\"\n allowCustomValue={false}\n />\n </>\n ) : dateField ? (\n <TimeFieldUnitReadout field={dateField} />\n ) : null}\n <span className=\"text-xs text-muted-foreground\">\n Where time-from and time-to parameters apply\n </span>\n </div>\n <EsQuerySortEditor\n sort={search.sort ?? []}\n fields={fields}\n orders={vocabulary.sortOrders}\n onChange={(sort) =>\n onChange({ ...search, sort: sort.length ? sort : undefined })\n }\n />\n <EsQueryOutputEditor\n search={search}\n onChange={(patch) => onChange({ ...search, ...patch })}\n />\n {compilation ? <EsQueryPreview compilation={compilation} /> : null}\n </div>\n );\n}\n\n/**\n * The builder as the profile form mounts it. The form knows the connection and\n * the index, so the field mappings and the compiled preview come from the same\n * browser endpoints the connection browser uses.\n */\nexport function EsQueryBuilderField({\n search,\n onChange,\n schema,\n rootValue,\n onRootChange,\n}: {\n search: EsSearch;\n onChange: (next: unknown) => void;\n schema: JsonSchemaProperty;\n rootValue: ProfileDraft;\n onRootChange?: ((next: Record<string, unknown>) => void) | undefined;\n}) {\n const connectionID = savedConnectionID(rootValue.provider?.connection);\n const baseUrl = connectionID ? browserBaseUrl(connectionID) : \"\";\n const target = String(rootValue.provider?.options?.index ?? \"\");\n const inspection = useInspection({\n cacheKey: \"es-query-builder\",\n id: connectionID ?? \"\",\n baseUrl,\n enabled: baseUrl !== \"\",\n database: \"\",\n target,\n });\n const roles = paramRoles(rootValue.params);\n const params = defaultParamValues(rootValue.params);\n const compilation = useCompiledSearch({\n baseUrl,\n index: target,\n search,\n params,\n roles,\n enabled: baseUrl !== \"\",\n });\n const values = makeFieldValueLookup({\n baseUrl,\n index: target,\n params,\n roles,\n });\n\n return (\n <EsQueryBuilder\n search={search}\n onChange={(next) => onChange(next)}\n fields={esQueryFields(inspection.completion)}\n vocabulary={esBuilderVocabulary({ properties: { search: schema } })}\n params={rootValue.params ?? []}\n onMappingChange={(edit) => {\n if (!onRootChange) {\n throw new Error(\n \"query parameter mappings require an atomic root form update\",\n );\n }\n onRootChange({\n ...rootValue,\n params: edit.params,\n provider: {\n ...rootValue.provider,\n options: {\n ...rootValue.provider?.options,\n search: edit.search,\n },\n },\n });\n }}\n {...(values ? { values } : {})}\n compilation={compilation}\n />\n );\n}\n\nfunction TimeFieldUnitReadout({ field }: { field: EsFieldMapping }) {\n const { state, text } = timeFieldUnitReadout(field);\n return (\n <span\n data-es-time-unit={state}\n className={\n state === \"conflicting\"\n ? \"text-xs text-destructive\"\n : \"text-xs text-foreground\"\n }\n >\n {text}\n </span>\n );\n}\n\nfunction timeFieldFormatLabel(format: EsTimeFieldFormat): string {\n switch (format) {\n case \"epoch_second\":\n return \"Seconds\";\n case \"epoch_millis\":\n return \"Milliseconds\";\n case \"epoch_micros\":\n return \"Microseconds\";\n case \"epoch_nanos\":\n return \"Nanoseconds\";\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAuEA,SAAgB,eAAe,EAC7B,QACA,UACA,QACA,YACA,SAAS,CAAC,GACV,iBACA,QACA,aACA,aACsB;CACtB,MAAM,OAAO,OAAO,SAAS,WAAW;CACxC,MAAM,0BAA0B,wBAC9B,QACA,OAAO,SACT;CACA,MAAM,YACJ,OAAO,aAAa,CAAC,0BACjB,OAAO,MAAM,UAAU,MAAM,SAAS,OA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qB,EAAE,SAAoC;CAClE,MAAM,EAAE,OAAO,SAAS,qBAAqB,KAAK;CAClD,OACE,oBAAC,QAAD;EACE,qBAAmB;EACnB,WACE,UAAU,gBACN,6BACA;EAGL,UAAA;CACG,CAAA;AAEV;AAEA,SAAS,qBAAqB,QAAmC;CAC/D,QAAQ,QAAR;EACE,KAAK,gBACH,OAAO;EACT,KAAK,gBACH,OAAO;EACT,KAAK,gBACH,OAAO;EACT,KAAK,eACH,OAAO;CACX;AACF"}
|
|
@@ -47,6 +47,42 @@ function timeFieldFormatRequired(fields, name) {
|
|
|
47
47
|
const field = fields.find((entry) => entry.name === name);
|
|
48
48
|
return !field || field.conflicting === true || require_esQueryOperators.fieldFamily(field) !== "date";
|
|
49
49
|
}
|
|
50
|
+
var dateFormatLabels = {
|
|
51
|
+
strict_date_optional_time: "ISO 8601",
|
|
52
|
+
date_optional_time: "ISO 8601",
|
|
53
|
+
strict_date_optional_time_nanos: "ISO 8601",
|
|
54
|
+
date_optional_time_nanos: "ISO 8601",
|
|
55
|
+
epoch_second: "epoch seconds",
|
|
56
|
+
epoch_millis: "epoch milliseconds"
|
|
57
|
+
};
|
|
58
|
+
/**
|
|
59
|
+
* dateMappingFormatLabel reads an OpenSearch date format, which may chain
|
|
60
|
+
* several with "||", as a phrase. A format with no friendlier name is shown as
|
|
61
|
+
* written rather than guessed at.
|
|
62
|
+
*/
|
|
63
|
+
function dateMappingFormatLabel(format) {
|
|
64
|
+
return format.split("||").map((part) => dateFormatLabels[part.trim()] ?? part.trim()).join(" or ");
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* timeFieldUnitReadout is what the time-field row says about a native date
|
|
68
|
+
* mapping's unit. A date field takes no epoch unit of its own (the backend
|
|
69
|
+
* rejects one), so the row reports what the mapping stores rather than asking.
|
|
70
|
+
* Callers pass a field that does not need an explicit unit.
|
|
71
|
+
*/
|
|
72
|
+
function timeFieldUnitReadout(field) {
|
|
73
|
+
if (field.formatConflicting) return {
|
|
74
|
+
state: "conflicting",
|
|
75
|
+
text: "Date formats differ between indices"
|
|
76
|
+
};
|
|
77
|
+
if (!field.format) return {
|
|
78
|
+
state: "unreported",
|
|
79
|
+
text: "Date mapping, format not reported"
|
|
80
|
+
};
|
|
81
|
+
return {
|
|
82
|
+
state: "mapped",
|
|
83
|
+
text: `Stored as ${dateMappingFormatLabel(field.format)}`
|
|
84
|
+
};
|
|
85
|
+
}
|
|
50
86
|
/** selectTimeField removes a numeric format when the next mapping is native. */
|
|
51
87
|
function selectTimeField(search, fields, name) {
|
|
52
88
|
const { timeField: _timeField, timeFieldFormat: _timeFieldFormat, ...rest } = search;
|
|
@@ -59,6 +95,7 @@ function selectTimeField(search, fields, name) {
|
|
|
59
95
|
timeField: name
|
|
60
96
|
};
|
|
61
97
|
}
|
|
98
|
+
exports.dateMappingFormatLabel = dateMappingFormatLabel;
|
|
62
99
|
exports.defaultParamValues = defaultParamValues;
|
|
63
100
|
exports.esQueryFields = esQueryFields;
|
|
64
101
|
exports.paramNames = paramNames;
|
|
@@ -66,5 +103,6 @@ exports.paramRoles = paramRoles;
|
|
|
66
103
|
exports.selectTimeField = selectTimeField;
|
|
67
104
|
exports.timeFieldFormatRequired = timeFieldFormatRequired;
|
|
68
105
|
exports.timeFieldMappings = timeFieldMappings;
|
|
106
|
+
exports.timeFieldUnitReadout = timeFieldUnitReadout;
|
|
69
107
|
|
|
70
108
|
//# sourceMappingURL=esQueryBuilderForm.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"esQueryBuilderForm.cjs","names":["fieldFamily"],"sources":["../../../src/profiles/elasticsearch/esQueryBuilderForm.ts"],"sourcesContent":["/**\n * The pure helpers behind the query builder: which parameters exist, what they\n * default to, and the field mappings a schema describes.\n *\n * Kept apart from esQueryBuilder.tsx so that module exports only components\n * (react/only-export-components).\n */\n\nimport type { EsFieldMapping } from \"./esQueryOperators\";\nimport { fieldFamily } from \"./esQueryOperators\";\nimport type { EsSearch } from \"./esQueryBuilderModel\";\nimport type { ParamDraft } from \"../wizard/profileWizardModel\";\n\nconst integralTimeFieldTypes = new Set([\n \"byte\",\n \"short\",\n \"integer\",\n \"long\",\n \"unsigned_long\",\n]);\n\n/** paramNames lists the parameters an operand may bind, in declared order. */\nexport function paramNames(params: ParamDraft[] | undefined): string[] {\n return (params ?? [])\n .map((param) => param.name ?? \"\")\n .filter((name) => name !== \"\");\n}\n\n/** paramRoles is the name-to-role table the compiler folds roles from. */\nexport function paramRoles(\n params: ParamDraft[] | undefined,\n): Record<string, string> {\n const roles: Record<string, string> = {};\n for (const param of params ?? []) {\n if (param.name && param.role) roles[param.name] = param.role;\n }\n return roles;\n}\n\n/**\n * defaultParamValues is what the declared parameters resolve to before anyone\n * filters. The compiler needs them to bind a {param:…} operand and to\n * interpolate a {{.params.…}} one, so the preview shows the DSL a run produces.\n */\nexport function defaultParamValues(\n params: ParamDraft[] | undefined,\n): Record<string, unknown> {\n return Object.fromEntries(\n (params ?? [])\n .filter((param) => param.name && param.default !== undefined)\n .map((param) => [param.name as string, param.default]),\n );\n}\n\n/**\n * esQueryFields reads the field mappings off a browser inspection. Only an\n * OpenSearch target carries them, so anything else builds against free text.\n */\nexport function esQueryFields(completion: unknown): EsFieldMapping[] {\n const typed = completion as { kind?: string; fields?: EsFieldMapping[] };\n return typed?.kind === \"json-fields\" ? (typed.fields ?? []) : [];\n}\n\n/** timeFieldMappings lists mappings that can store an instant unambiguously. */\nexport function timeFieldMappings(fields: EsFieldMapping[]): EsFieldMapping[] {\n return fields.filter((field) => {\n if (field.conflicting) return false;\n const mapped = field.dataType ?? field.types?.[0] ?? \"\";\n return fieldFamily(field) === \"date\" || integralTimeFieldTypes.has(mapped);\n });\n}\n\n/** Numeric and custom time fields need an explicit epoch unit. */\nexport function timeFieldFormatRequired(\n fields: EsFieldMapping[],\n name: string | undefined,\n): boolean {\n if (!name) return false;\n const field = fields.find((entry) => entry.name === name);\n return !field || field.conflicting === true || fieldFamily(field) !== \"date\";\n}\n\n/** selectTimeField removes a numeric format when the next mapping is native. */\nexport function selectTimeField(\n search: EsSearch,\n fields: EsFieldMapping[],\n name: string,\n): EsSearch {\n const {\n timeField: _timeField,\n timeFieldFormat: _timeFieldFormat,\n ...rest\n } = search;\n if (!name) return rest;\n return timeFieldFormatRequired(fields, name)\n ? { ...search, timeField: name }\n : { ...rest, timeField: name };\n}\n"],"mappings":";;AAaA,IAAM,yCAAyB,IAAI,IAAI;CACrC;CACA;CACA;CACA;CACA;AACF,CAAC;;AAGD,SAAgB,WAAW,QAA4C;CACrE,QAAQ,UAAU,CAAC,EAAA,CAChB,KAAK,UAAU,MAAM,QAAQ,EAAE,CAAC,CAChC,QAAQ,SAAS,SAAS,EAAE;AACjC;;AAGA,SAAgB,WACd,QACwB;CACxB,MAAM,QAAgC,CAAC;CACvC,KAAK,MAAM,SAAS,UAAU,CAAC,GAC7B,IAAI,MAAM,QAAQ,MAAM,MAAM,MAAM,MAAM,QAAQ,MAAM;CAE1D,OAAO;AACT;;;;;;AAOA,SAAgB,mBACd,QACyB;CACzB,OAAO,OAAO,aACX,UAAU,CAAC,EAAA,CACT,QAAQ,UAAU,MAAM,QAAQ,MAAM,YAAY,KAAA,CAAS,CAAC,CAC5D,KAAK,UAAU,CAAC,MAAM,MAAgB,MAAM,OAAO,CAAC,CACzD;AACF;;;;;AAMA,SAAgB,cAAc,YAAuC;CACnE,MAAM,QAAQ;CACd,OAAO,OAAO,SAAS,gBAAiB,MAAM,UAAU,CAAC,IAAK,CAAC;AACjE;;AAGA,SAAgB,kBAAkB,QAA4C;CAC5E,OAAO,OAAO,QAAQ,UAAU;EAC9B,IAAI,MAAM,aAAa,OAAO;EAC9B,MAAM,SAAS,MAAM,YAAY,MAAM,QAAQ,MAAM;EACrD,OAAOA,yBAAAA,YAAY,KAAK,MAAM,UAAU,uBAAuB,IAAI,MAAM;CAC3E,CAAC;AACH;;AAGA,SAAgB,wBACd,QACA,MACS;CACT,IAAI,CAAC,MAAM,OAAO;CAClB,MAAM,QAAQ,OAAO,MAAM,UAAU,MAAM,SAAS,IAAI;CACxD,OAAO,CAAC,SAAS,MAAM,gBAAgB,QAAQA,yBAAAA,YAAY,KAAK,MAAM;AACxE;;AAGA,SAAgB,gBACd,QACA,QACA,MACU;CACV,MAAM,EACJ,WAAW,YACX,iBAAiB,kBACjB,GAAG,SACD;CACJ,IAAI,CAAC,MAAM,OAAO;CAClB,OAAO,wBAAwB,QAAQ,IAAI,IACvC;EAAE,GAAG;EAAQ,WAAW;CAAK,IAC7B;EAAE,GAAG;EAAM,WAAW;CAAK;AACjC"}
|
|
1
|
+
{"version":3,"file":"esQueryBuilderForm.cjs","names":["fieldFamily"],"sources":["../../../src/profiles/elasticsearch/esQueryBuilderForm.ts"],"sourcesContent":["/**\n * The pure helpers behind the query builder: which parameters exist, what they\n * default to, and the field mappings a schema describes.\n *\n * Kept apart from esQueryBuilder.tsx so that module exports only components\n * (react/only-export-components).\n */\n\nimport type { EsFieldMapping } from \"./esQueryOperators\";\nimport { fieldFamily } from \"./esQueryOperators\";\nimport type { EsSearch } from \"./esQueryBuilderModel\";\nimport type { ParamDraft } from \"../wizard/profileWizardModel\";\n\nconst integralTimeFieldTypes = new Set([\n \"byte\",\n \"short\",\n \"integer\",\n \"long\",\n \"unsigned_long\",\n]);\n\n/** paramNames lists the parameters an operand may bind, in declared order. */\nexport function paramNames(params: ParamDraft[] | undefined): string[] {\n return (params ?? [])\n .map((param) => param.name ?? \"\")\n .filter((name) => name !== \"\");\n}\n\n/** paramRoles is the name-to-role table the compiler folds roles from. */\nexport function paramRoles(\n params: ParamDraft[] | undefined,\n): Record<string, string> {\n const roles: Record<string, string> = {};\n for (const param of params ?? []) {\n if (param.name && param.role) roles[param.name] = param.role;\n }\n return roles;\n}\n\n/**\n * defaultParamValues is what the declared parameters resolve to before anyone\n * filters. The compiler needs them to bind a {param:…} operand and to\n * interpolate a {{.params.…}} one, so the preview shows the DSL a run produces.\n */\nexport function defaultParamValues(\n params: ParamDraft[] | undefined,\n): Record<string, unknown> {\n return Object.fromEntries(\n (params ?? [])\n .filter((param) => param.name && param.default !== undefined)\n .map((param) => [param.name as string, param.default]),\n );\n}\n\n/**\n * esQueryFields reads the field mappings off a browser inspection. Only an\n * OpenSearch target carries them, so anything else builds against free text.\n */\nexport function esQueryFields(completion: unknown): EsFieldMapping[] {\n const typed = completion as { kind?: string; fields?: EsFieldMapping[] };\n return typed?.kind === \"json-fields\" ? (typed.fields ?? []) : [];\n}\n\n/** timeFieldMappings lists mappings that can store an instant unambiguously. */\nexport function timeFieldMappings(fields: EsFieldMapping[]): EsFieldMapping[] {\n return fields.filter((field) => {\n if (field.conflicting) return false;\n const mapped = field.dataType ?? field.types?.[0] ?? \"\";\n return fieldFamily(field) === \"date\" || integralTimeFieldTypes.has(mapped);\n });\n}\n\n/** Numeric and custom time fields need an explicit epoch unit. */\nexport function timeFieldFormatRequired(\n fields: EsFieldMapping[],\n name: string | undefined,\n): boolean {\n if (!name) return false;\n const field = fields.find((entry) => entry.name === name);\n return !field || field.conflicting === true || fieldFamily(field) !== \"date\";\n}\n\nconst dateFormatLabels: Record<string, string> = {\n strict_date_optional_time: \"ISO 8601\",\n date_optional_time: \"ISO 8601\",\n strict_date_optional_time_nanos: \"ISO 8601\",\n date_optional_time_nanos: \"ISO 8601\",\n epoch_second: \"epoch seconds\",\n epoch_millis: \"epoch milliseconds\",\n};\n\n/**\n * dateMappingFormatLabel reads an OpenSearch date format, which may chain\n * several with \"||\", as a phrase. A format with no friendlier name is shown as\n * written rather than guessed at.\n */\nexport function dateMappingFormatLabel(format: string): string {\n return format\n .split(\"||\")\n .map((part) => dateFormatLabels[part.trim()] ?? part.trim())\n .join(\" or \");\n}\n\nexport type TimeFieldUnitReadout = {\n state: \"mapped\" | \"unreported\" | \"conflicting\";\n text: string;\n};\n\n/**\n * timeFieldUnitReadout is what the time-field row says about a native date\n * mapping's unit. A date field takes no epoch unit of its own (the backend\n * rejects one), so the row reports what the mapping stores rather than asking.\n * Callers pass a field that does not need an explicit unit.\n */\nexport function timeFieldUnitReadout(\n field: EsFieldMapping,\n): TimeFieldUnitReadout {\n if (field.formatConflicting) {\n return { state: \"conflicting\", text: \"Date formats differ between indices\" };\n }\n if (!field.format) {\n return { state: \"unreported\", text: \"Date mapping, format not reported\" };\n }\n return {\n state: \"mapped\",\n text: `Stored as ${dateMappingFormatLabel(field.format)}`,\n };\n}\n\n/** selectTimeField removes a numeric format when the next mapping is native. */\nexport function selectTimeField(\n search: EsSearch,\n fields: EsFieldMapping[],\n name: string,\n): EsSearch {\n const {\n timeField: _timeField,\n timeFieldFormat: _timeFieldFormat,\n ...rest\n } = search;\n if (!name) return rest;\n return timeFieldFormatRequired(fields, name)\n ? { ...search, timeField: name }\n : { ...rest, timeField: name };\n}\n"],"mappings":";;AAaA,IAAM,yCAAyB,IAAI,IAAI;CACrC;CACA;CACA;CACA;CACA;AACF,CAAC;;AAGD,SAAgB,WAAW,QAA4C;CACrE,QAAQ,UAAU,CAAC,EAAA,CAChB,KAAK,UAAU,MAAM,QAAQ,EAAE,CAAC,CAChC,QAAQ,SAAS,SAAS,EAAE;AACjC;;AAGA,SAAgB,WACd,QACwB;CACxB,MAAM,QAAgC,CAAC;CACvC,KAAK,MAAM,SAAS,UAAU,CAAC,GAC7B,IAAI,MAAM,QAAQ,MAAM,MAAM,MAAM,MAAM,QAAQ,MAAM;CAE1D,OAAO;AACT;;;;;;AAOA,SAAgB,mBACd,QACyB;CACzB,OAAO,OAAO,aACX,UAAU,CAAC,EAAA,CACT,QAAQ,UAAU,MAAM,QAAQ,MAAM,YAAY,KAAA,CAAS,CAAC,CAC5D,KAAK,UAAU,CAAC,MAAM,MAAgB,MAAM,OAAO,CAAC,CACzD;AACF;;;;;AAMA,SAAgB,cAAc,YAAuC;CACnE,MAAM,QAAQ;CACd,OAAO,OAAO,SAAS,gBAAiB,MAAM,UAAU,CAAC,IAAK,CAAC;AACjE;;AAGA,SAAgB,kBAAkB,QAA4C;CAC5E,OAAO,OAAO,QAAQ,UAAU;EAC9B,IAAI,MAAM,aAAa,OAAO;EAC9B,MAAM,SAAS,MAAM,YAAY,MAAM,QAAQ,MAAM;EACrD,OAAOA,yBAAAA,YAAY,KAAK,MAAM,UAAU,uBAAuB,IAAI,MAAM;CAC3E,CAAC;AACH;;AAGA,SAAgB,wBACd,QACA,MACS;CACT,IAAI,CAAC,MAAM,OAAO;CAClB,MAAM,QAAQ,OAAO,MAAM,UAAU,MAAM,SAAS,IAAI;CACxD,OAAO,CAAC,SAAS,MAAM,gBAAgB,QAAQA,yBAAAA,YAAY,KAAK,MAAM;AACxE;AAEA,IAAM,mBAA2C;CAC/C,2BAA2B;CAC3B,oBAAoB;CACpB,iCAAiC;CACjC,0BAA0B;CAC1B,cAAc;CACd,cAAc;AAChB;;;;;;AAOA,SAAgB,uBAAuB,QAAwB;CAC7D,OAAO,OACJ,MAAM,IAAI,CAAC,CACX,KAAK,SAAS,iBAAiB,KAAK,KAAK,MAAM,KAAK,KAAK,CAAC,CAAC,CAC3D,KAAK,MAAM;AAChB;;;;;;;AAaA,SAAgB,qBACd,OACsB;CACtB,IAAI,MAAM,mBACR,OAAO;EAAE,OAAO;EAAe,MAAM;CAAsC;CAE7E,IAAI,CAAC,MAAM,QACT,OAAO;EAAE,OAAO;EAAc,MAAM;CAAoC;CAE1E,OAAO;EACL,OAAO;EACP,MAAM,aAAa,uBAAuB,MAAM,MAAM;CACxD;AACF;;AAGA,SAAgB,gBACd,QACA,QACA,MACU;CACV,MAAM,EACJ,WAAW,YACX,iBAAiB,kBACjB,GAAG,SACD;CACJ,IAAI,CAAC,MAAM,OAAO;CAClB,OAAO,wBAAwB,QAAQ,IAAI,IACvC;EAAE,GAAG;EAAQ,WAAW;CAAK,IAC7B;EAAE,GAAG;EAAM,WAAW;CAAK;AACjC"}
|
|
@@ -20,6 +20,23 @@ export declare function esQueryFields(completion: unknown): EsFieldMapping[];
|
|
|
20
20
|
export declare function timeFieldMappings(fields: EsFieldMapping[]): EsFieldMapping[];
|
|
21
21
|
/** Numeric and custom time fields need an explicit epoch unit. */
|
|
22
22
|
export declare function timeFieldFormatRequired(fields: EsFieldMapping[], name: string | undefined): boolean;
|
|
23
|
+
/**
|
|
24
|
+
* dateMappingFormatLabel reads an OpenSearch date format, which may chain
|
|
25
|
+
* several with "||", as a phrase. A format with no friendlier name is shown as
|
|
26
|
+
* written rather than guessed at.
|
|
27
|
+
*/
|
|
28
|
+
export declare function dateMappingFormatLabel(format: string): string;
|
|
29
|
+
export type TimeFieldUnitReadout = {
|
|
30
|
+
state: "mapped" | "unreported" | "conflicting";
|
|
31
|
+
text: string;
|
|
32
|
+
};
|
|
33
|
+
/**
|
|
34
|
+
* timeFieldUnitReadout is what the time-field row says about a native date
|
|
35
|
+
* mapping's unit. A date field takes no epoch unit of its own (the backend
|
|
36
|
+
* rejects one), so the row reports what the mapping stores rather than asking.
|
|
37
|
+
* Callers pass a field that does not need an explicit unit.
|
|
38
|
+
*/
|
|
39
|
+
export declare function timeFieldUnitReadout(field: EsFieldMapping): TimeFieldUnitReadout;
|
|
23
40
|
/** selectTimeField removes a numeric format when the next mapping is native. */
|
|
24
41
|
export declare function selectTimeField(search: EsSearch, fields: EsFieldMapping[], name: string): EsSearch;
|
|
25
42
|
//# sourceMappingURL=esQueryBuilderForm.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"esQueryBuilderForm.d.ts","sourceRoot":"","sources":["../../../src/profiles/elasticsearch/esQueryBuilderForm.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAEzD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AACtD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,8BAA8B,CAAC;AAU/D,8EAA8E;AAC9E,wBAAgB,UAAU,CAAC,MAAM,EAAE,UAAU,EAAE,GAAG,SAAS,GAAG,MAAM,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