@flanksource/clicky-ui 0.3.18 → 0.3.20
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/ComboboxMenu.cjs +5 -1
- package/dist/components/ComboboxMenu.cjs.map +1 -1
- package/dist/components/ComboboxMenu.d.ts.map +1 -1
- package/dist/components/ComboboxMenu.js +5 -1
- package/dist/components/ComboboxMenu.js.map +1 -1
- package/dist/components/EndpointSelector.model.cjs +96 -0
- package/dist/components/EndpointSelector.model.cjs.map +1 -0
- package/dist/components/EndpointSelector.model.d.ts +2 -0
- package/dist/components/EndpointSelector.model.d.ts.map +1 -1
- package/dist/components/EndpointSelector.model.js +96 -0
- package/dist/components/EndpointSelector.model.js.map +1 -0
- package/dist/components/ErrorWrapper.cjs +1 -1
- package/dist/components/ErrorWrapper.cjs.map +1 -1
- package/dist/components/ErrorWrapper.js +1 -1
- package/dist/components/ErrorWrapper.js.map +1 -1
- package/dist/components/FilterBar.cjs +52 -2
- package/dist/components/FilterBar.cjs.map +1 -1
- package/dist/components/FilterBar.d.ts +20 -2
- package/dist/components/FilterBar.d.ts.map +1 -1
- package/dist/components/FilterBar.js +52 -2
- package/dist/components/FilterBar.js.map +1 -1
- package/dist/components/JSONPathField.cjs +87 -66
- package/dist/components/JSONPathField.cjs.map +1 -1
- package/dist/components/JSONPathField.d.ts +26 -9
- package/dist/components/JSONPathField.d.ts.map +1 -1
- package/dist/components/JSONPathField.js +88 -67
- package/dist/components/JSONPathField.js.map +1 -1
- package/dist/components/JSONPathPlayground.cjs +225 -0
- package/dist/components/JSONPathPlayground.cjs.map +1 -0
- package/dist/components/JSONPathPlayground.d.ts +59 -0
- package/dist/components/JSONPathPlayground.d.ts.map +1 -0
- package/dist/components/JSONPathPlayground.js +225 -0
- package/dist/components/JSONPathPlayground.js.map +1 -0
- package/dist/components/OnePasswordSelector.cjs +178 -0
- package/dist/components/OnePasswordSelector.cjs.map +1 -0
- package/dist/components/OnePasswordSelector.d.ts +8 -0
- package/dist/components/OnePasswordSelector.d.ts.map +1 -0
- package/dist/components/OnePasswordSelector.js +178 -0
- package/dist/components/OnePasswordSelector.js.map +1 -0
- package/dist/components/OnePasswordSelector.model.cjs +31 -0
- package/dist/components/OnePasswordSelector.model.cjs.map +1 -0
- package/dist/components/OnePasswordSelector.model.d.ts +27 -0
- package/dist/components/OnePasswordSelector.model.d.ts.map +1 -0
- package/dist/components/OnePasswordSelector.model.js +31 -0
- package/dist/components/OnePasswordSelector.model.js.map +1 -0
- package/dist/components/SecretFormField.cjs +142 -0
- package/dist/components/SecretFormField.cjs.map +1 -0
- package/dist/components/SecretFormField.d.ts +9 -0
- package/dist/components/SecretFormField.d.ts.map +1 -0
- package/dist/components/SecretFormField.js +142 -0
- package/dist/components/SecretFormField.js.map +1 -0
- package/dist/components/SecretKeySelector.cjs +20 -14
- package/dist/components/SecretKeySelector.cjs.map +1 -1
- package/dist/components/SecretKeySelector.d.ts +4 -1
- package/dist/components/SecretKeySelector.d.ts.map +1 -1
- package/dist/components/SecretKeySelector.js +20 -14
- package/dist/components/SecretKeySelector.js.map +1 -1
- package/dist/components/TreePickerField.cjs +55 -29
- package/dist/components/TreePickerField.cjs.map +1 -1
- package/dist/components/TreePickerField.d.ts +10 -1
- package/dist/components/TreePickerField.d.ts.map +1 -1
- package/dist/components/TreePickerField.js +56 -30
- package/dist/components/TreePickerField.js.map +1 -1
- package/dist/components/UnitStepControls.cjs +55 -0
- package/dist/components/UnitStepControls.cjs.map +1 -0
- package/dist/components/UnitStepControls.d.ts +10 -0
- package/dist/components/UnitStepControls.d.ts.map +1 -0
- package/dist/components/UnitStepControls.js +55 -0
- package/dist/components/UnitStepControls.js.map +1 -0
- package/dist/components/combobox-types.d.ts +9 -0
- package/dist/components/combobox-types.d.ts.map +1 -1
- package/dist/components/filter-bar-utils.cjs +7 -0
- package/dist/components/filter-bar-utils.cjs.map +1 -1
- package/dist/components/filter-bar-utils.d.ts.map +1 -1
- package/dist/components/filter-bar-utils.js +7 -0
- package/dist/components/filter-bar-utils.js.map +1 -1
- package/dist/components/jotai-bindings-core.cjs.map +1 -1
- package/dist/components/jotai-bindings-core.d.ts +4 -1
- package/dist/components/jotai-bindings-core.d.ts.map +1 -1
- package/dist/components/jotai-bindings-core.js.map +1 -1
- package/dist/components/json-schema-form-accordion-array.cjs +5 -73
- 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 +3 -71
- package/dist/components/json-schema-form-accordion-array.js.map +1 -1
- package/dist/components/json-schema-form-array.cjs +6 -1
- package/dist/components/json-schema-form-array.cjs.map +1 -1
- package/dist/components/json-schema-form-array.d.ts.map +1 -1
- package/dist/components/json-schema-form-array.js +6 -1
- package/dist/components/json-schema-form-array.js.map +1 -1
- package/dist/components/json-schema-form-cards-array.cjs +96 -0
- package/dist/components/json-schema-form-cards-array.cjs.map +1 -0
- package/dist/components/json-schema-form-cards-array.d.ts +7 -0
- package/dist/components/json-schema-form-cards-array.d.ts.map +1 -0
- package/dist/components/json-schema-form-cards-array.js +96 -0
- package/dist/components/json-schema-form-cards-array.js.map +1 -0
- package/dist/components/json-schema-form-item-row.cjs +81 -0
- package/dist/components/json-schema-form-item-row.cjs.map +1 -0
- package/dist/components/json-schema-form-item-row.d.ts +19 -0
- package/dist/components/json-schema-form-item-row.d.ts.map +1 -0
- package/dist/components/json-schema-form-item-row.js +81 -0
- package/dist/components/json-schema-form-item-row.js.map +1 -0
- package/dist/components/json-schema-form-render.cjs +4 -3
- 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 +4 -3
- package/dist/components/json-schema-form-render.js.map +1 -1
- package/dist/components/json-schema-form-resolve.cjs +1 -1
- package/dist/components/json-schema-form-resolve.cjs.map +1 -1
- package/dist/components/json-schema-form-resolve.js +1 -1
- package/dist/components/json-schema-form-resolve.js.map +1 -1
- package/dist/components/json-schema-form-tone.cjs +12 -0
- package/dist/components/json-schema-form-tone.cjs.map +1 -1
- package/dist/components/json-schema-form-tone.js +12 -0
- package/dist/components/json-schema-form-tone.js.map +1 -1
- package/dist/components/json-schema-form-types.d.ts +10 -1
- package/dist/components/json-schema-form-types.d.ts.map +1 -1
- package/dist/components/jsonPathTree.cjs +189 -0
- package/dist/components/jsonPathTree.cjs.map +1 -0
- package/dist/components/jsonPathTree.d.ts +92 -0
- package/dist/components/jsonPathTree.d.ts.map +1 -0
- package/dist/components/jsonPathTree.js +189 -0
- package/dist/components/jsonPathTree.js.map +1 -0
- package/dist/components/secret-form-extension.cjs +30 -0
- package/dist/components/secret-form-extension.cjs.map +1 -0
- package/dist/components/secret-form-extension.d.ts +23 -0
- package/dist/components/secret-form-extension.d.ts.map +1 -0
- package/dist/components/secret-form-extension.js +30 -0
- package/dist/components/secret-form-extension.js.map +1 -0
- package/dist/components/unit-form-extension.cjs +126 -0
- package/dist/components/unit-form-extension.cjs.map +1 -0
- package/dist/components/unit-form-extension.d.ts +8 -0
- package/dist/components/unit-form-extension.d.ts.map +1 -0
- package/dist/components/unit-form-extension.js +126 -0
- package/dist/components/unit-form-extension.js.map +1 -0
- package/dist/components.cjs +20 -0
- package/dist/components.cjs.map +1 -1
- package/dist/components.d.ts +7 -0
- package/dist/components.d.ts.map +1 -1
- package/dist/components.js +20 -0
- package/dist/components.js.map +1 -1
- package/dist/data/TaskExecDetails.cjs +40 -0
- package/dist/data/TaskExecDetails.cjs.map +1 -0
- package/dist/data/TaskExecDetails.d.ts +5 -0
- package/dist/data/TaskExecDetails.d.ts.map +1 -0
- package/dist/data/TaskExecDetails.js +40 -0
- package/dist/data/TaskExecDetails.js.map +1 -0
- package/dist/data/TaskProgress.cjs +9 -3
- package/dist/data/TaskProgress.cjs.map +1 -1
- package/dist/data/TaskProgress.d.ts.map +1 -1
- package/dist/data/TaskProgress.js +9 -3
- package/dist/data/TaskProgress.js.map +1 -1
- package/dist/data/TaskSnapshot.cjs.map +1 -1
- package/dist/data/TaskSnapshot.d.ts +12 -1
- package/dist/data/TaskSnapshot.d.ts.map +1 -1
- package/dist/data/TaskSnapshot.js.map +1 -1
- package/dist/data/TreeNode.cjs +3 -0
- package/dist/data/TreeNode.cjs.map +1 -1
- package/dist/data/TreeNode.d.ts.map +1 -1
- package/dist/data/TreeNode.js +3 -0
- package/dist/data/TreeNode.js.map +1 -1
- package/dist/data/data-table-filter-values.cjs +20 -0
- package/dist/data/data-table-filter-values.cjs.map +1 -1
- package/dist/data/data-table-filter-values.d.ts +16 -0
- package/dist/data/data-table-filter-values.d.ts.map +1 -1
- package/dist/data/data-table-filter-values.js +20 -0
- package/dist/data/data-table-filter-values.js.map +1 -1
- package/dist/data/data-table-server-filters.cjs +23 -29
- package/dist/data/data-table-server-filters.cjs.map +1 -1
- package/dist/data/data-table-server-filters.d.ts.map +1 -1
- package/dist/data/data-table-server-filters.js +21 -27
- package/dist/data/data-table-server-filters.js.map +1 -1
- package/dist/data/diagnostics/ErrorDetails.cjs +61 -8
- package/dist/data/diagnostics/ErrorDetails.cjs.map +1 -1
- package/dist/data/diagnostics/ErrorDetails.d.ts.map +1 -1
- package/dist/data/diagnostics/ErrorDetails.js +61 -8
- package/dist/data/diagnostics/ErrorDetails.js.map +1 -1
- package/dist/data/diagnostics/error-diagnostics.cjs +10 -4
- package/dist/data/diagnostics/error-diagnostics.cjs.map +1 -1
- package/dist/data/diagnostics/error-diagnostics.d.ts.map +1 -1
- package/dist/data/diagnostics/error-diagnostics.js +10 -4
- package/dist/data/diagnostics/error-diagnostics.js.map +1 -1
- package/dist/data/query-browser/QueryBrowser.cjs +139 -161
- package/dist/data/query-browser/QueryBrowser.cjs.map +1 -1
- package/dist/data/query-browser/QueryBrowser.d.ts +1 -71
- package/dist/data/query-browser/QueryBrowser.d.ts.map +1 -1
- package/dist/data/query-browser/QueryBrowser.editor.cjs +88 -0
- package/dist/data/query-browser/QueryBrowser.editor.cjs.map +1 -0
- package/dist/data/query-browser/QueryBrowser.editor.d.ts +12 -0
- package/dist/data/query-browser/QueryBrowser.editor.d.ts.map +1 -0
- package/dist/data/query-browser/QueryBrowser.editor.js +88 -0
- package/dist/data/query-browser/QueryBrowser.editor.js.map +1 -0
- package/dist/data/query-browser/QueryBrowser.js +140 -162
- package/dist/data/query-browser/QueryBrowser.js.map +1 -1
- package/dist/data/query-browser/QueryBrowser.types.cjs +12 -0
- package/dist/data/query-browser/QueryBrowser.types.cjs.map +1 -0
- package/dist/data/query-browser/QueryBrowser.types.d.ts +94 -0
- package/dist/data/query-browser/QueryBrowser.types.d.ts.map +1 -0
- package/dist/data/query-browser/QueryBrowser.types.js +12 -0
- package/dist/data/query-browser/QueryBrowser.types.js.map +1 -0
- package/dist/data/query-browser/QueryBrowserDiagnosticsPanel.cjs +56 -0
- package/dist/data/query-browser/QueryBrowserDiagnosticsPanel.cjs.map +1 -0
- package/dist/data/query-browser/QueryBrowserDiagnosticsPanel.d.ts +5 -0
- package/dist/data/query-browser/QueryBrowserDiagnosticsPanel.d.ts.map +1 -0
- package/dist/data/query-browser/QueryBrowserDiagnosticsPanel.js +56 -0
- package/dist/data/query-browser/QueryBrowserDiagnosticsPanel.js.map +1 -0
- package/dist/data/query-browser/QueryBrowserResults.cjs +80 -0
- package/dist/data/query-browser/QueryBrowserResults.cjs.map +1 -0
- package/dist/data/query-browser/QueryBrowserResults.d.ts +16 -0
- package/dist/data/query-browser/QueryBrowserResults.d.ts.map +1 -0
- package/dist/data/query-browser/QueryBrowserResults.js +80 -0
- package/dist/data/query-browser/QueryBrowserResults.js.map +1 -0
- package/dist/data/query-browser/index.d.ts +2 -1
- package/dist/data/query-browser/index.d.ts.map +1 -1
- package/dist/data/task-exec-details.cjs +9 -0
- package/dist/data/task-exec-details.cjs.map +1 -0
- package/dist/data/task-exec-details.d.ts +3 -0
- package/dist/data/task-exec-details.d.ts.map +1 -0
- package/dist/data/task-exec-details.js +9 -0
- package/dist/data/task-exec-details.js.map +1 -0
- package/dist/data/version-info.cjs +3 -3
- package/dist/data/version-info.js +3 -3
- package/dist/data.cjs +2 -0
- package/dist/data.cjs.map +1 -1
- package/dist/data.d.ts +1 -1
- package/dist/data.d.ts.map +1 -1
- package/dist/data.js +2 -0
- package/dist/data.js.map +1 -1
- package/dist/index.cjs +22 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +22 -0
- package/dist/index.js.map +1 -1
- package/dist/lib/string.cjs +8 -0
- package/dist/lib/string.cjs.map +1 -1
- package/dist/lib/string.d.ts +1 -0
- package/dist/lib/string.d.ts.map +1 -1
- package/dist/lib/string.js +8 -0
- package/dist/lib/string.js.map +1 -1
- package/dist/profiles/catalogTree.cjs +133 -0
- package/dist/profiles/catalogTree.cjs.map +1 -0
- package/dist/profiles/catalogTree.d.ts +11 -0
- package/dist/profiles/catalogTree.d.ts.map +1 -0
- package/dist/profiles/catalogTree.js +133 -0
- package/dist/profiles/catalogTree.js.map +1 -0
- package/dist/profiles/connectionBrowserModel.cjs +185 -0
- package/dist/profiles/connectionBrowserModel.cjs.map +1 -0
- package/dist/profiles/connectionBrowserModel.d.ts +169 -0
- package/dist/profiles/connectionBrowserModel.d.ts.map +1 -0
- package/dist/profiles/connectionBrowserModel.js +185 -0
- package/dist/profiles/connectionBrowserModel.js.map +1 -0
- package/dist/profiles/connectionQueryWorkspace.cjs +185 -0
- package/dist/profiles/connectionQueryWorkspace.cjs.map +1 -0
- package/dist/profiles/connectionQueryWorkspace.d.ts +63 -0
- package/dist/profiles/connectionQueryWorkspace.d.ts.map +1 -0
- package/dist/profiles/connectionQueryWorkspace.js +185 -0
- package/dist/profiles/connectionQueryWorkspace.js.map +1 -0
- package/dist/profiles/connectionQueryWorkspaceModel.cjs +28 -0
- package/dist/profiles/connectionQueryWorkspaceModel.cjs.map +1 -0
- package/dist/profiles/connectionQueryWorkspaceModel.d.ts +38 -0
- package/dist/profiles/connectionQueryWorkspaceModel.d.ts.map +1 -0
- package/dist/profiles/connectionQueryWorkspaceModel.js +28 -0
- package/dist/profiles/connectionQueryWorkspaceModel.js.map +1 -0
- package/dist/profiles/esFieldValues.cjs +64 -0
- package/dist/profiles/esFieldValues.cjs.map +1 -0
- package/dist/profiles/esFieldValues.d.ts +48 -0
- package/dist/profiles/esFieldValues.d.ts.map +1 -0
- package/dist/profiles/esFieldValues.js +64 -0
- package/dist/profiles/esFieldValues.js.map +1 -0
- package/dist/profiles/esParamMappingModel.cjs +301 -0
- package/dist/profiles/esParamMappingModel.cjs.map +1 -0
- package/dist/profiles/esParamMappingModel.d.ts +37 -0
- package/dist/profiles/esParamMappingModel.d.ts.map +1 -0
- package/dist/profiles/esParamMappingModel.js +301 -0
- package/dist/profiles/esParamMappingModel.js.map +1 -0
- package/dist/profiles/esParamMappingPill.cjs +24 -0
- package/dist/profiles/esParamMappingPill.cjs.map +1 -0
- package/dist/profiles/esParamMappingPill.d.ts +13 -0
- package/dist/profiles/esParamMappingPill.d.ts.map +1 -0
- package/dist/profiles/esParamMappingPill.js +24 -0
- package/dist/profiles/esParamMappingPill.js.map +1 -0
- package/dist/profiles/esParamOperandExtension.cjs +75 -0
- package/dist/profiles/esParamOperandExtension.cjs.map +1 -0
- package/dist/profiles/esParamOperandExtension.d.ts +11 -0
- package/dist/profiles/esParamOperandExtension.d.ts.map +1 -0
- package/dist/profiles/esParamOperandExtension.js +75 -0
- package/dist/profiles/esParamOperandExtension.js.map +1 -0
- package/dist/profiles/esQueryBuilder.cjs +205 -0
- package/dist/profiles/esQueryBuilder.cjs.map +1 -0
- package/dist/profiles/esQueryBuilder.d.ts +35 -0
- package/dist/profiles/esQueryBuilder.d.ts.map +1 -0
- package/dist/profiles/esQueryBuilder.js +205 -0
- package/dist/profiles/esQueryBuilder.js.map +1 -0
- package/dist/profiles/esQueryBuilderExtension.cjs +23 -0
- package/dist/profiles/esQueryBuilderExtension.cjs.map +1 -0
- package/dist/profiles/esQueryBuilderExtension.d.ts +5 -0
- package/dist/profiles/esQueryBuilderExtension.d.ts.map +1 -0
- package/dist/profiles/esQueryBuilderExtension.js +23 -0
- package/dist/profiles/esQueryBuilderExtension.js.map +1 -0
- package/dist/profiles/esQueryBuilderForm.cjs +26 -0
- package/dist/profiles/esQueryBuilderForm.cjs.map +1 -0
- package/dist/profiles/esQueryBuilderForm.d.ts +18 -0
- package/dist/profiles/esQueryBuilderForm.d.ts.map +1 -0
- package/dist/profiles/esQueryBuilderForm.js +26 -0
- package/dist/profiles/esQueryBuilderForm.js.map +1 -0
- package/dist/profiles/esQueryBuilderModel.cjs +131 -0
- package/dist/profiles/esQueryBuilderModel.cjs.map +1 -0
- package/dist/profiles/esQueryBuilderModel.d.ts +108 -0
- package/dist/profiles/esQueryBuilderModel.d.ts.map +1 -0
- package/dist/profiles/esQueryBuilderModel.js +131 -0
- package/dist/profiles/esQueryBuilderModel.js.map +1 -0
- package/dist/profiles/esQueryClauseGroup.cjs +144 -0
- package/dist/profiles/esQueryClauseGroup.cjs.map +1 -0
- package/dist/profiles/esQueryClauseGroup.d.ts +10 -0
- package/dist/profiles/esQueryClauseGroup.d.ts.map +1 -0
- package/dist/profiles/esQueryClauseGroup.js +144 -0
- package/dist/profiles/esQueryClauseGroup.js.map +1 -0
- package/dist/profiles/esQueryCompile.cjs +47 -0
- package/dist/profiles/esQueryCompile.cjs.map +1 -0
- package/dist/profiles/esQueryCompile.d.ts +39 -0
- package/dist/profiles/esQueryCompile.d.ts.map +1 -0
- package/dist/profiles/esQueryCompile.js +47 -0
- package/dist/profiles/esQueryCompile.js.map +1 -0
- package/dist/profiles/esQueryConditionRow.cjs +168 -0
- package/dist/profiles/esQueryConditionRow.cjs.map +1 -0
- package/dist/profiles/esQueryConditionRow.d.ts +37 -0
- package/dist/profiles/esQueryConditionRow.d.ts.map +1 -0
- package/dist/profiles/esQueryConditionRow.js +168 -0
- package/dist/profiles/esQueryConditionRow.js.map +1 -0
- package/dist/profiles/esQueryGroupModel.cjs +12 -0
- package/dist/profiles/esQueryGroupModel.cjs.map +1 -0
- package/dist/profiles/esQueryGroupModel.d.ts +9 -0
- package/dist/profiles/esQueryGroupModel.d.ts.map +1 -0
- package/dist/profiles/esQueryGroupModel.js +12 -0
- package/dist/profiles/esQueryGroupModel.js.map +1 -0
- package/dist/profiles/esQueryOccur.cjs +16 -0
- package/dist/profiles/esQueryOccur.cjs.map +1 -0
- package/dist/profiles/esQueryOccur.d.ts +11 -0
- package/dist/profiles/esQueryOccur.d.ts.map +1 -0
- package/dist/profiles/esQueryOccur.js +16 -0
- package/dist/profiles/esQueryOccur.js.map +1 -0
- package/dist/profiles/esQueryOperandEditors.cjs +279 -0
- package/dist/profiles/esQueryOperandEditors.cjs.map +1 -0
- package/dist/profiles/esQueryOperandEditors.d.ts +24 -0
- package/dist/profiles/esQueryOperandEditors.d.ts.map +1 -0
- package/dist/profiles/esQueryOperandEditors.js +279 -0
- package/dist/profiles/esQueryOperandEditors.js.map +1 -0
- package/dist/profiles/esQueryOperandModel.cjs +28 -0
- package/dist/profiles/esQueryOperandModel.cjs.map +1 -0
- package/dist/profiles/esQueryOperandModel.d.ts +17 -0
- package/dist/profiles/esQueryOperandModel.d.ts.map +1 -0
- package/dist/profiles/esQueryOperandModel.js +28 -0
- package/dist/profiles/esQueryOperandModel.js.map +1 -0
- package/dist/profiles/esQueryOperators.cjs +165 -0
- package/dist/profiles/esQueryOperators.cjs.map +1 -0
- package/dist/profiles/esQueryOperators.d.ts +83 -0
- package/dist/profiles/esQueryOperators.d.ts.map +1 -0
- package/dist/profiles/esQueryOperators.js +165 -0
- package/dist/profiles/esQueryOperators.js.map +1 -0
- package/dist/profiles/esQueryOutputEditor.cjs +138 -0
- package/dist/profiles/esQueryOutputEditor.cjs.map +1 -0
- package/dist/profiles/esQueryOutputEditor.d.ts +7 -0
- package/dist/profiles/esQueryOutputEditor.d.ts.map +1 -0
- package/dist/profiles/esQueryOutputEditor.js +138 -0
- package/dist/profiles/esQueryOutputEditor.js.map +1 -0
- package/dist/profiles/esQueryOutputModel.cjs +16 -0
- package/dist/profiles/esQueryOutputModel.cjs.map +1 -0
- package/dist/profiles/esQueryOutputModel.d.ts +14 -0
- package/dist/profiles/esQueryOutputModel.d.ts.map +1 -0
- package/dist/profiles/esQueryOutputModel.js +16 -0
- package/dist/profiles/esQueryOutputModel.js.map +1 -0
- package/dist/profiles/esQueryPreview.cjs +30 -0
- package/dist/profiles/esQueryPreview.cjs.map +1 -0
- package/dist/profiles/esQueryPreview.d.ts +6 -0
- package/dist/profiles/esQueryPreview.d.ts.map +1 -0
- package/dist/profiles/esQueryPreview.js +30 -0
- package/dist/profiles/esQueryPreview.js.map +1 -0
- package/dist/profiles/esQuerySortEditor.cjs +143 -0
- package/dist/profiles/esQuerySortEditor.cjs.map +1 -0
- package/dist/profiles/esQuerySortEditor.d.ts +9 -0
- package/dist/profiles/esQuerySortEditor.d.ts.map +1 -0
- package/dist/profiles/esQuerySortEditor.js +143 -0
- package/dist/profiles/esQuerySortEditor.js.map +1 -0
- package/dist/profiles/esQuerySortModel.cjs +13 -0
- package/dist/profiles/esQuerySortModel.cjs.map +1 -0
- package/dist/profiles/esQuerySortModel.d.ts +4 -0
- package/dist/profiles/esQuerySortModel.d.ts.map +1 -0
- package/dist/profiles/esQuerySortModel.js +13 -0
- package/dist/profiles/esQuerySortModel.js.map +1 -0
- package/dist/profiles/esValueCombobox.cjs +86 -0
- package/dist/profiles/esValueCombobox.cjs.map +1 -0
- package/dist/profiles/esValueCombobox.d.ts +15 -0
- package/dist/profiles/esValueCombobox.d.ts.map +1 -0
- package/dist/profiles/esValueCombobox.js +86 -0
- package/dist/profiles/esValueCombobox.js.map +1 -0
- package/dist/profiles/jsonPathSample.cjs +75 -0
- package/dist/profiles/jsonPathSample.cjs.map +1 -0
- package/dist/profiles/jsonPathSample.d.ts +27 -0
- package/dist/profiles/jsonPathSample.d.ts.map +1 -0
- package/dist/profiles/jsonPathSample.js +75 -0
- package/dist/profiles/jsonPathSample.js.map +1 -0
- package/dist/profiles/jsonPathSampleRow.cjs +14 -0
- package/dist/profiles/jsonPathSampleRow.cjs.map +1 -0
- package/dist/profiles/jsonPathSampleRow.d.ts +6 -0
- package/dist/profiles/jsonPathSampleRow.d.ts.map +1 -0
- package/dist/profiles/jsonPathSampleRow.js +14 -0
- package/dist/profiles/jsonPathSampleRow.js.map +1 -0
- package/dist/profiles/profileApi.cjs +37 -0
- package/dist/profiles/profileApi.cjs.map +1 -0
- package/dist/profiles/profileApi.d.ts +32 -0
- package/dist/profiles/profileApi.d.ts.map +1 -0
- package/dist/profiles/profileApi.js +37 -0
- package/dist/profiles/profileApi.js.map +1 -0
- package/dist/profiles/profileBuilder.cjs +65 -0
- package/dist/profiles/profileBuilder.cjs.map +1 -0
- package/dist/profiles/profileBuilder.d.ts +11 -0
- package/dist/profiles/profileBuilder.d.ts.map +1 -0
- package/dist/profiles/profileBuilder.js +65 -0
- package/dist/profiles/profileBuilder.js.map +1 -0
- package/dist/profiles/profileBuilderExtension.cjs +25 -0
- package/dist/profiles/profileBuilderExtension.cjs.map +1 -0
- package/dist/profiles/profileBuilderExtension.d.ts +5 -0
- package/dist/profiles/profileBuilderExtension.d.ts.map +1 -0
- package/dist/profiles/profileBuilderExtension.js +25 -0
- package/dist/profiles/profileBuilderExtension.js.map +1 -0
- package/dist/profiles/profileBuilderWorkspace.cjs +368 -0
- package/dist/profiles/profileBuilderWorkspace.cjs.map +1 -0
- package/dist/profiles/profileBuilderWorkspace.d.ts +21 -0
- package/dist/profiles/profileBuilderWorkspace.d.ts.map +1 -0
- package/dist/profiles/profileBuilderWorkspace.js +368 -0
- package/dist/profiles/profileBuilderWorkspace.js.map +1 -0
- package/dist/profiles/profileColumnModel.cjs +23 -0
- package/dist/profiles/profileColumnModel.cjs.map +1 -0
- package/dist/profiles/profileColumnModel.d.ts +8 -0
- package/dist/profiles/profileColumnModel.d.ts.map +1 -0
- package/dist/profiles/profileColumnModel.js +23 -0
- package/dist/profiles/profileColumnModel.js.map +1 -0
- package/dist/profiles/profileColumnPicker.cjs +68 -0
- package/dist/profiles/profileColumnPicker.cjs.map +1 -0
- package/dist/profiles/profileColumnPicker.d.ts +11 -0
- package/dist/profiles/profileColumnPicker.d.ts.map +1 -0
- package/dist/profiles/profileColumnPicker.js +68 -0
- package/dist/profiles/profileColumnPicker.js.map +1 -0
- package/dist/profiles/profileEditor.cjs +386 -0
- package/dist/profiles/profileEditor.cjs.map +1 -0
- package/dist/profiles/profileEditor.d.ts +19 -0
- package/dist/profiles/profileEditor.d.ts.map +1 -0
- package/dist/profiles/profileEditor.js +386 -0
- package/dist/profiles/profileEditor.js.map +1 -0
- package/dist/profiles/profileEditorModel.cjs +181 -0
- package/dist/profiles/profileEditorModel.cjs.map +1 -0
- package/dist/profiles/profileEditorModel.d.ts +74 -0
- package/dist/profiles/profileEditorModel.d.ts.map +1 -0
- package/dist/profiles/profileEditorModel.js +181 -0
- package/dist/profiles/profileEditorModel.js.map +1 -0
- package/dist/profiles/profileEditorPreview.cjs +38 -0
- package/dist/profiles/profileEditorPreview.cjs.map +1 -0
- package/dist/profiles/profileEditorPreview.d.ts +12 -0
- package/dist/profiles/profileEditorPreview.d.ts.map +1 -0
- package/dist/profiles/profileEditorPreview.js +38 -0
- package/dist/profiles/profileEditorPreview.js.map +1 -0
- package/dist/profiles/profileEditorRail.cjs +46 -0
- package/dist/profiles/profileEditorRail.cjs.map +1 -0
- package/dist/profiles/profileEditorRail.d.ts +8 -0
- package/dist/profiles/profileEditorRail.d.ts.map +1 -0
- package/dist/profiles/profileEditorRail.js +46 -0
- package/dist/profiles/profileEditorRail.js.map +1 -0
- package/dist/profiles/profileEditorRaw.cjs +118 -0
- package/dist/profiles/profileEditorRaw.cjs.map +1 -0
- package/dist/profiles/profileEditorRaw.d.ts +7 -0
- package/dist/profiles/profileEditorRaw.d.ts.map +1 -0
- package/dist/profiles/profileEditorRaw.js +118 -0
- package/dist/profiles/profileEditorRaw.js.map +1 -0
- package/dist/profiles/profileEditorRoutes.cjs +7 -0
- package/dist/profiles/profileEditorRoutes.cjs.map +1 -0
- package/dist/profiles/profileEditorRoutes.d.ts +2 -0
- package/dist/profiles/profileEditorRoutes.d.ts.map +1 -0
- package/dist/profiles/profileEditorRoutes.js +7 -0
- package/dist/profiles/profileEditorRoutes.js.map +1 -0
- package/dist/profiles/profileEditorSections.cjs +213 -0
- package/dist/profiles/profileEditorSections.cjs.map +1 -0
- package/dist/profiles/profileEditorSections.d.ts +23 -0
- package/dist/profiles/profileEditorSections.d.ts.map +1 -0
- package/dist/profiles/profileEditorSections.js +213 -0
- package/dist/profiles/profileEditorSections.js.map +1 -0
- package/dist/profiles/profileFieldEditor.cjs +200 -0
- package/dist/profiles/profileFieldEditor.cjs.map +1 -0
- package/dist/profiles/profileFieldEditor.d.ts +34 -0
- package/dist/profiles/profileFieldEditor.d.ts.map +1 -0
- package/dist/profiles/profileFieldEditor.js +200 -0
- package/dist/profiles/profileFieldEditor.js.map +1 -0
- package/dist/profiles/profileFieldGrid.cjs +250 -0
- package/dist/profiles/profileFieldGrid.cjs.map +1 -0
- package/dist/profiles/profileFieldGrid.d.ts +20 -0
- package/dist/profiles/profileFieldGrid.d.ts.map +1 -0
- package/dist/profiles/profileFieldGrid.js +250 -0
- package/dist/profiles/profileFieldGrid.js.map +1 -0
- package/dist/profiles/profileFieldManager.cjs +103 -0
- package/dist/profiles/profileFieldManager.cjs.map +1 -0
- package/dist/profiles/profileFieldManager.d.ts +9 -0
- package/dist/profiles/profileFieldManager.d.ts.map +1 -0
- package/dist/profiles/profileFieldManager.js +103 -0
- package/dist/profiles/profileFieldManager.js.map +1 -0
- package/dist/profiles/profileFieldState.cjs +136 -0
- package/dist/profiles/profileFieldState.cjs.map +1 -0
- package/dist/profiles/profileFieldState.d.ts +41 -0
- package/dist/profiles/profileFieldState.d.ts.map +1 -0
- package/dist/profiles/profileFieldState.js +136 -0
- package/dist/profiles/profileFieldState.js.map +1 -0
- package/dist/profiles/profileFieldTypes.cjs +17 -0
- package/dist/profiles/profileFieldTypes.cjs.map +1 -0
- package/dist/profiles/profileFieldTypes.d.ts +8 -0
- package/dist/profiles/profileFieldTypes.d.ts.map +1 -0
- package/dist/profiles/profileFieldTypes.js +17 -0
- package/dist/profiles/profileFieldTypes.js.map +1 -0
- package/dist/profiles/profileParamModel.cjs +78 -0
- package/dist/profiles/profileParamModel.cjs.map +1 -0
- package/dist/profiles/profileParamModel.d.ts +3 -0
- package/dist/profiles/profileParamModel.d.ts.map +1 -0
- package/dist/profiles/profileParamModel.js +78 -0
- package/dist/profiles/profileParamModel.js.map +1 -0
- package/dist/profiles/profileSamplePayload.cjs +15 -0
- package/dist/profiles/profileSamplePayload.cjs.map +1 -0
- package/dist/profiles/profileSamplePayload.d.ts +13 -0
- package/dist/profiles/profileSamplePayload.d.ts.map +1 -0
- package/dist/profiles/profileSamplePayload.js +15 -0
- package/dist/profiles/profileSamplePayload.js.map +1 -0
- package/dist/profiles/profileWizard.cjs +257 -0
- package/dist/profiles/profileWizard.cjs.map +1 -0
- package/dist/profiles/profileWizard.d.ts +12 -0
- package/dist/profiles/profileWizard.d.ts.map +1 -0
- package/dist/profiles/profileWizard.js +257 -0
- package/dist/profiles/profileWizard.js.map +1 -0
- package/dist/profiles/profileWizardHelp.cjs +10 -0
- package/dist/profiles/profileWizardHelp.cjs.map +1 -0
- package/dist/profiles/profileWizardHelp.d.ts +13 -0
- package/dist/profiles/profileWizardHelp.d.ts.map +1 -0
- package/dist/profiles/profileWizardHelp.js +10 -0
- package/dist/profiles/profileWizardHelp.js.map +1 -0
- package/dist/profiles/profileWizardModel.cjs +198 -0
- package/dist/profiles/profileWizardModel.cjs.map +1 -0
- package/dist/profiles/profileWizardModel.d.ts +255 -0
- package/dist/profiles/profileWizardModel.d.ts.map +1 -0
- package/dist/profiles/profileWizardModel.js +198 -0
- package/dist/profiles/profileWizardModel.js.map +1 -0
- package/dist/profiles/profileWizardQueryStep.cjs +215 -0
- package/dist/profiles/profileWizardQueryStep.cjs.map +1 -0
- package/dist/profiles/profileWizardQueryStep.d.ts +18 -0
- package/dist/profiles/profileWizardQueryStep.d.ts.map +1 -0
- package/dist/profiles/profileWizardQueryStep.js +215 -0
- package/dist/profiles/profileWizardQueryStep.js.map +1 -0
- package/dist/profiles/profileWizardSteps.cjs +214 -0
- package/dist/profiles/profileWizardSteps.cjs.map +1 -0
- package/dist/profiles/profileWizardSteps.d.ts +35 -0
- package/dist/profiles/profileWizardSteps.d.ts.map +1 -0
- package/dist/profiles/profileWizardSteps.js +214 -0
- package/dist/profiles/profileWizardSteps.js.map +1 -0
- package/dist/profiles/profileYaml.cjs +19 -0
- package/dist/profiles/profileYaml.cjs.map +1 -0
- package/dist/profiles/profileYaml.d.ts +4 -0
- package/dist/profiles/profileYaml.d.ts.map +1 -0
- package/dist/profiles/profileYaml.js +19 -0
- package/dist/profiles/profileYaml.js.map +1 -0
- package/dist/profiles/prometheusResults.cjs +60 -0
- package/dist/profiles/prometheusResults.cjs.map +1 -0
- package/dist/profiles/prometheusResults.d.ts +7 -0
- package/dist/profiles/prometheusResults.d.ts.map +1 -0
- package/dist/profiles/prometheusResults.js +60 -0
- package/dist/profiles/prometheusResults.js.map +1 -0
- package/dist/profiles/queryRowLimits.cjs +82 -0
- package/dist/profiles/queryRowLimits.cjs.map +1 -0
- package/dist/profiles/queryRowLimits.d.ts +9 -0
- package/dist/profiles/queryRowLimits.d.ts.map +1 -0
- package/dist/profiles/queryRowLimits.js +82 -0
- package/dist/profiles/queryRowLimits.js.map +1 -0
- package/dist/profiles/queryRowLimitsModel.cjs +10 -0
- package/dist/profiles/queryRowLimitsModel.cjs.map +1 -0
- package/dist/profiles/queryRowLimitsModel.d.ts +9 -0
- package/dist/profiles/queryRowLimitsModel.d.ts.map +1 -0
- package/dist/profiles/queryRowLimitsModel.js +10 -0
- package/dist/profiles/queryRowLimitsModel.js.map +1 -0
- package/dist/profiles/queryTargetPicker.cjs +42 -0
- package/dist/profiles/queryTargetPicker.cjs.map +1 -0
- package/dist/profiles/queryTargetPicker.d.ts +8 -0
- package/dist/profiles/queryTargetPicker.d.ts.map +1 -0
- package/dist/profiles/queryTargetPicker.js +42 -0
- package/dist/profiles/queryTargetPicker.js.map +1 -0
- package/dist/profiles/testSchema.d.ts +3 -0
- package/dist/profiles/testSchema.d.ts.map +1 -0
- package/dist/profiles.cjs +223 -0
- package/dist/profiles.cjs.map +1 -0
- package/dist/profiles.d.ts +68 -0
- package/dist/profiles.d.ts.map +1 -0
- package/dist/profiles.js +223 -0
- package/dist/profiles.js.map +1 -0
- package/dist/rpc/FilterForm.cjs +20 -0
- package/dist/rpc/FilterForm.cjs.map +1 -1
- package/dist/rpc/FilterForm.js +20 -0
- package/dist/rpc/FilterForm.js.map +1 -1
- package/dist/rpc/formMetadata.cjs +34 -0
- package/dist/rpc/formMetadata.cjs.map +1 -1
- package/dist/rpc/formMetadata.d.ts.map +1 -1
- package/dist/rpc/formMetadata.js +35 -1
- package/dist/rpc/formMetadata.js.map +1 -1
- package/dist/rpc/types.cjs.map +1 -1
- package/dist/rpc/types.d.ts +9 -1
- package/dist/rpc/types.d.ts.map +1 -1
- package/dist/rpc/types.js.map +1 -1
- package/dist/styles.css +1 -1
- package/package.json +6 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"error-diagnostics.cjs","sources":["../../../src/data/diagnostics/error-diagnostics.ts"],"sourcesContent":["// Normalize ad-hoc error payloads (oops JSON, plain strings, nested objects)\n// into the shape ErrorDetails consumes. Mirrors what `samber/oops` emits\n// from `OopsError.MarshalJSON()` on the Go side.\n\nexport type ErrorDiagnostics = {\n message: string;\n trace?: string;\n time?: string;\n stacktrace?: string;\n context: Array<[string, string]>;\n raw?: unknown;\n};\n\nexport type ParsedErrorStackTrace = {\n headline?: string;\n frames: ErrorStackFrame[];\n unparsed: string[];\n raw: string;\n};\n\nexport type ErrorStackFrame = {\n raw: string;\n file: string;\n line: number;\n functionName?: string;\n};\n\nexport function normalizeErrorDiagnostics(\n value: unknown,\n fallback?: string | null,\n): ErrorDiagnostics | null {\n if (!value) return null;\n if (typeof value === \"string\") {\n return value.trim() ? { message: value, context: [] } : null;\n }\n const record = objectRecord(value);\n if (!record) return null;\n const nested = objectRecord(record.error) ?? objectRecord(record.diagnostics);\n if (nested && nested !== record) {\n return normalizeErrorDiagnostics(nested, fallback);\n }\n const message =\n firstString(record, [\"error\", \"message\", \"msg\", \"reason\", \"detail\", \"details\"]) ?? fallback;\n const trace = firstString(record, [\"trace\", \"trace_id\", \"traceId\", \"traceID\"]);\n const stacktrace = firstString(record, [\"stacktrace\", \"stack_trace\", \"stackTrace\", \"stack\"]);\n const time = firstString(record, [\"time\", \"timestamp\", \"created_at\"]);\n const context = contextEntries(record.context);\n if (!message && !trace && !stacktrace && context.length === 0) return null;\n return {\n message: message ?? \"Action failed\",\n context,\n raw: value,\n ...(trace !== undefined ? { trace } : {}),\n ...(time !== undefined ? { time } : {}),\n ...(stacktrace !== undefined ? { stacktrace } : {}),\n };\n}\n\nexport function parseDiagnosticsStackTrace(stacktrace: string): ParsedErrorStackTrace {\n const lines = stacktrace\n .split(/\\r?\\n/)\n .map((line) => line.trim())\n .filter(Boolean);\n const frames: ErrorStackFrame[] = [];\n const unparsed: string[] = [];\n let headline: string | undefined;\n\n for (const line of lines) {\n const frame = parseStackTraceFrame(line);\n if (frame) {\n frames.push(frame);\n continue;\n }\n if (!headline && !line.startsWith(\"--- at \")) {\n headline = line;\n continue;\n }\n unparsed.push(line);\n }\n\n return {\n frames,\n unparsed,\n raw: stacktrace,\n ...(headline !== undefined ? { headline } : {}),\n };\n}\n\nexport function parseInlineJsonContextValue(value: string): unknown | null {\n const trimmed = value.trim();\n if (!trimmed || !/^[{[]/.test(trimmed)) return null;\n try {\n return JSON.parse(trimmed);\n } catch {\n return null;\n }\n}\n\nexport function compactStackPath(file: string) {\n return file\n .replace(/^github\\.com\\/flanksource\\/incident-commander\\//, \"\")\n .replace(/^github\\.com\\/flanksource\\//, \"flanksource/\")\n .replace(/^.*\\/go\\/pkg\\/mod\\//, \"pkg/mod/\")\n .replace(/^.*\\/incident-commander\\//, \"\");\n}\n\nexport function isApplicationStackFrame(file: string) {\n return (\n file.includes(\"github.com/flanksource/incident-commander/\") ||\n file.includes(\"/incident-commander/\")\n );\n}\n\nfunction parseStackTraceFrame(line: string): ErrorStackFrame | null {\n const prefix = \"--- at \";\n if (!line.startsWith(prefix)) return null;\n\n const value = line.slice(prefix.length);\n let fileEnd = -1;\n let lineStart = -1;\n let lineEnd = -1;\n let functionStart = -1;\n\n for (let index = 0; index < value.length; index++) {\n if (value[index] !== \":\" || !isDecimalDigit(value[index + 1])) continue;\n\n let end = index + 1;\n while (isDecimalDigit(value[end])) end++;\n if (end === value.length) {\n fileEnd = index;\n lineStart = index + 1;\n lineEnd = end;\n functionStart = -1;\n continue;\n }\n if (!isWhitespace(value[end])) continue;\n\n let start = end;\n while (isWhitespace(value[start])) start++;\n if (start === value.length && start - end < 2) continue;\n fileEnd = index;\n lineStart = index + 1;\n lineEnd = end;\n functionStart = start;\n }\n\n if (fileEnd <= 0 || lineStart < 0 || lineEnd < 0) return null;\n const functionName = functionStart >= 0 ? value.slice(functionStart).trim() : \"\";\n return {\n raw: line,\n file: value.slice(0, fileEnd),\n line: Number(value.slice(lineStart, lineEnd)),\n ...(functionName ? { functionName } : {}),\n };\n}\n\nfunction isDecimalDigit(value: string | undefined): boolean {\n return value !== undefined && value >= \"0\" && value <= \"9\";\n}\n\nfunction isWhitespace(value: string | undefined): boolean {\n return value !== undefined && value.trim() === \"\";\n}\n\nfunction objectRecord(value: unknown): Record<string, unknown> | null {\n if (!value || typeof value !== \"object\" || Array.isArray(value)) return null;\n return value as Record<string, unknown>;\n}\n\nfunction firstString(record: Record<string, unknown>, keys: string[]): string | undefined {\n for (const key of keys) {\n const value = record[key];\n if (typeof value === \"string\" && value.trim()) return value;\n }\n return undefined;\n}\n\nfunction contextEntries(value: unknown): Array<[string, string]> {\n const record = objectRecord(value);\n if (!record) return [];\n return Object.entries(record)\n .filter(\n ([, entryValue]) => entryValue !== undefined && entryValue !== null && entryValue !== \"\",\n )\n .map(([key, entryValue]) => [key, stringifyValue(entryValue)]);\n}\n\nfunction stringifyValue(value: unknown): string {\n if (value === null || value === undefined || value === \"\") return \"-\";\n if (typeof value === \"string\") return value;\n if (typeof value === \"number\" || typeof value === \"boolean\") return String(value);\n return JSON.stringify(value);\n}\n"],"names":[],"mappings":";;AA2BO,SAAS,0BACd,OACA,UACyB;AACzB,MAAI,CAAC,MAAO,QAAO;AACnB,MAAI,OAAO,UAAU,UAAU;AAC7B,WAAO,MAAM,SAAS,EAAE,SAAS,OAAO,SAAS,CAAA,EAAC,IAAM;AAAA,EAC1D;AACA,QAAM,SAAS,aAAa,KAAK;AACjC,MAAI,CAAC,OAAQ,QAAO;AACpB,QAAM,SAAS,aAAa,OAAO,KAAK,KAAK,aAAa,OAAO,WAAW;AAC5E,MAAI,UAAU,WAAW,QAAQ;AAC/B,WAAO,0BAA0B,QAAQ,QAAQ;AAAA,EACnD;AACA,QAAM,UACJ,YAAY,QAAQ,CAAC,SAAS,WAAW,OAAO,UAAU,UAAU,SAAS,CAAC,KAAK;AACrF,QAAM,QAAQ,YAAY,QAAQ,CAAC,SAAS,YAAY,WAAW,SAAS,CAAC;AAC7E,QAAM,aAAa,YAAY,QAAQ,CAAC,cAAc,eAAe,cAAc,OAAO,CAAC;AAC3F,QAAM,OAAO,YAAY,QAAQ,CAAC,QAAQ,aAAa,YAAY,CAAC;AACpE,QAAM,UAAU,eAAe,OAAO,OAAO;AAC7C,MAAI,CAAC,WAAW,CAAC,SAAS,CAAC,cAAc,QAAQ,WAAW,EAAG,QAAO;AACtE,SAAO;AAAA,IACL,SAAS,WAAW;AAAA,IACpB;AAAA,IACA,KAAK;AAAA,IACL,GAAI,UAAU,SAAY,EAAE,MAAA,IAAU,CAAA;AAAA,IACtC,GAAI,SAAS,SAAY,EAAE,KAAA,IAAS,CAAA;AAAA,IACpC,GAAI,eAAe,SAAY,EAAE,eAAe,C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AA,EAAQ,QAAO;AAAA,EACxD;AACA,SAAO;AACT;AAEA,SAAS,eAAe,OAAyC;AAC/D,QAAM,SAAS,aAAa,KAAK;AACjC,MAAI,CAAC,OAAQ,QAAO,CAAA;AACpB,SAAO,OAAO,QAAQ,MAAM,EACzB;AAAA,IACC,CAAC,CAAA,EAAG,UAAU,MAAM,eAAe,UAAa,eAAe,QAAQ,eAAe;AAAA,EAAA,EAEvF,IAAI,CAAC,CAAC,KAAK,UAAU,MAAM,CAAC,KAAK,eAAe,UAAU,CAAC,CAAC;AACjE;AAEA,SAAS,eAAe,OAAwB;AAC9C,MAAI,UAAU,QAAQ,UAAU,UAAa,UAAU,GAAI,QAAO;AAClE,MAAI,OAAO,UAAU,SAAU,QAAO;AACtC,MAAI,OAAO,UAAU,YAAY,OAAO,UAAU,UAAW,QAAO,OAAO,KAAK;AAChF,SAAO,KAAK,UAAU,KAAK;AAC7B;;;;;;"}
|
|
1
|
+
{"version":3,"file":"error-diagnostics.cjs","sources":["../../../src/data/diagnostics/error-diagnostics.ts"],"sourcesContent":["// Normalize ad-hoc error payloads (oops JSON, plain strings, nested objects)\n// into the shape ErrorDetails consumes. Mirrors what `samber/oops` emits\n// from `OopsError.MarshalJSON()` on the Go side.\n\nexport type ErrorDiagnostics = {\n message: string;\n trace?: string;\n time?: string;\n stacktrace?: string;\n context: Array<[string, string]>;\n raw?: unknown;\n};\n\nexport type ParsedErrorStackTrace = {\n headline?: string;\n frames: ErrorStackFrame[];\n unparsed: string[];\n raw: string;\n};\n\nexport type ErrorStackFrame = {\n raw: string;\n file: string;\n line: number;\n functionName?: string;\n};\n\nexport function normalizeErrorDiagnostics(\n value: unknown,\n fallback?: string | null,\n): ErrorDiagnostics | null {\n if (!value) return null;\n if (typeof value === \"string\") {\n return value.trim() ? { message: value, context: [] } : null;\n }\n const record = objectRecord(value);\n if (!record) return null;\n const nestedError = objectRecord(record.error);\n if (nestedError && nestedError !== record) {\n return normalizeErrorDiagnostics(nestedError, fallback);\n }\n const message =\n firstString(record, [\"error\", \"message\", \"msg\", \"reason\", \"detail\", \"details\"]) ?? fallback;\n const trace = firstString(record, [\"trace\", \"trace_id\", \"traceId\", \"traceID\"]);\n const stacktrace = firstString(record, [\"stacktrace\", \"stack_trace\", \"stackTrace\", \"stack\"]);\n const time = firstString(record, [\"time\", \"timestamp\", \"created_at\"]);\n const context = contextEntries(record.context);\n if (!message && !trace && !stacktrace && !time && context.length === 0) {\n const nestedDiagnostics = objectRecord(record.diagnostics);\n if (nestedDiagnostics && nestedDiagnostics !== record) {\n return normalizeErrorDiagnostics(nestedDiagnostics, fallback);\n }\n }\n if (!message && !trace && !stacktrace && !time && context.length === 0) return null;\n return {\n message: message ?? \"Action failed\",\n context,\n raw: value,\n ...(trace !== undefined ? { trace } : {}),\n ...(time !== undefined ? { time } : {}),\n ...(stacktrace !== undefined ? { stacktrace } : {}),\n };\n}\n\nexport function parseDiagnosticsStackTrace(stacktrace: string): ParsedErrorStackTrace {\n const lines = stacktrace\n .split(/\\r?\\n/)\n .map((line) => line.trim())\n .filter(Boolean);\n const frames: ErrorStackFrame[] = [];\n const unparsed: string[] = [];\n let headline: string | undefined;\n\n for (const line of lines) {\n const frame = parseStackTraceFrame(line);\n if (frame) {\n frames.push(frame);\n continue;\n }\n if (!headline && !line.startsWith(\"--- at \")) {\n headline = line;\n continue;\n }\n unparsed.push(line);\n }\n\n return {\n frames,\n unparsed,\n raw: stacktrace,\n ...(headline !== undefined ? { headline } : {}),\n };\n}\n\nexport function parseInlineJsonContextValue(value: string): unknown | null {\n const trimmed = value.trim();\n if (!trimmed || !/^[{[]/.test(trimmed)) return null;\n try {\n return JSON.parse(trimmed);\n } catch {\n return null;\n }\n}\n\nexport function compactStackPath(file: string) {\n return file\n .replace(/^github\\.com\\/flanksource\\/incident-commander\\//, \"\")\n .replace(/^github\\.com\\/flanksource\\//, \"flanksource/\")\n .replace(/^.*\\/go\\/pkg\\/mod\\//, \"pkg/mod/\")\n .replace(/^.*\\/incident-commander\\//, \"\");\n}\n\nexport function isApplicationStackFrame(file: string) {\n return (\n file.includes(\"github.com/flanksource/incident-commander/\") ||\n file.includes(\"/incident-commander/\")\n );\n}\n\nfunction parseStackTraceFrame(line: string): ErrorStackFrame | null {\n const prefix = \"--- at \";\n if (!line.startsWith(prefix)) return null;\n\n const value = line.slice(prefix.length);\n let fileEnd = -1;\n let lineStart = -1;\n let lineEnd = -1;\n let functionStart = -1;\n\n for (let index = 0; index < value.length; index++) {\n if (value[index] !== \":\" || !isDecimalDigit(value[index + 1])) continue;\n\n let end = index + 1;\n while (isDecimalDigit(value[end])) end++;\n if (end === value.length) {\n fileEnd = index;\n lineStart = index + 1;\n lineEnd = end;\n functionStart = -1;\n continue;\n }\n if (!isWhitespace(value[end])) continue;\n\n let start = end;\n while (isWhitespace(value[start])) start++;\n if (start === value.length && start - end < 2) continue;\n fileEnd = index;\n lineStart = index + 1;\n lineEnd = end;\n functionStart = start;\n }\n\n if (fileEnd <= 0 || lineStart < 0 || lineEnd < 0) return null;\n const functionName = functionStart >= 0 ? value.slice(functionStart).trim() : \"\";\n return {\n raw: line,\n file: value.slice(0, fileEnd),\n line: Number(value.slice(lineStart, lineEnd)),\n ...(functionName ? { functionName } : {}),\n };\n}\n\nfunction isDecimalDigit(value: string | undefined): boolean {\n return value !== undefined && value >= \"0\" && value <= \"9\";\n}\n\nfunction isWhitespace(value: string | undefined): boolean {\n return value !== undefined && value.trim() === \"\";\n}\n\nfunction objectRecord(value: unknown): Record<string, unknown> | null {\n if (!value || typeof value !== \"object\" || Array.isArray(value)) return null;\n return value as Record<string, unknown>;\n}\n\nfunction firstString(record: Record<string, unknown>, keys: string[]): string | undefined {\n for (const key of keys) {\n const value = record[key];\n if (typeof value === \"string\" && value.trim()) return value;\n }\n return undefined;\n}\n\nfunction contextEntries(value: unknown): Array<[string, string]> {\n const record = objectRecord(value);\n if (!record) return [];\n return Object.entries(record)\n .filter(\n ([, entryValue]) => entryValue !== undefined && entryValue !== null && entryValue !== \"\",\n )\n .map(([key, entryValue]) => [key, stringifyValue(entryValue)]);\n}\n\nfunction stringifyValue(value: unknown): string {\n if (value === null || value === undefined || value === \"\") return \"-\";\n if (typeof value === \"string\") return value;\n if (typeof value === \"number\" || typeof value === \"boolean\") return String(value);\n return JSON.stringify(value);\n}\n"],"names":[],"mappings":";;AA2BO,SAAS,0BACd,OACA,UACyB;AACzB,MAAI,CAAC,MAAO,QAAO;AACnB,MAAI,OAAO,UAAU,UAAU;AAC7B,WAAO,MAAM,SAAS,EAAE,SAAS,OAAO,SAAS,CAAA,EAAC,IAAM;AAAA,EAC1D;AACA,QAAM,SAAS,aAAa,KAAK;AACjC,MAAI,CAAC,OAAQ,QAAO;AACpB,QAAM,cAAc,aAAa,OAAO,KAAK;AAC7C,MAAI,eAAe,gBAAgB,QAAQ;AACzC,WAAO,0BAA0B,aAAa,QAAQ;AAAA,EACxD;AACA,QAAM,UACJ,YAAY,QAAQ,CAAC,SAAS,WAAW,OAAO,UAAU,UAAU,SAAS,CAAC,KAAK;AACrF,QAAM,QAAQ,YAAY,QAAQ,CAAC,SAAS,YAAY,WAAW,SAAS,CAAC;AAC7E,QAAM,aAAa,YAAY,QAAQ,CAAC,cAAc,eAAe,cAAc,OAAO,CAAC;AAC3F,QAAM,OAAO,YAAY,QAAQ,CAAC,QAAQ,aAAa,YAAY,CAAC;AACpE,QAAM,UAAU,eAAe,OAAO,OAAO;AAC7C,MAAI,CAAC,WAAW,CAAC,SAAS,CAAC,cAAc,CAAC,QAAQ,QAAQ,WAAW,GAAG;AACtE,UAAM,oBAAoB,aAAa,OAAO,WAAW;AACzD,QAAI,qBAAqB,sBAAsB,QAAQ;AACrD,aAAO,0BAA0B,mBAAmB,QAAQ;AAAA,IAC9D;AAAA,EACF;AACA,MAAI,CAAC,WAAW,CAAC,SAAS,CAAC,cAAc,CAAC,QAAQ,QAAQ,WAAW,EAAG,QAAO;AAC/E,SAAO;AAAA,IACL,SAAS,WAAW;AAAA,IACpB;AAAA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G,IAAI,CAgCzB;AAED,wBAAgB,0BAA0B,CAAC,UAAU,EAAE,MAAM,GAAG,qBAAqB,CA4BpF;AAED,wBAAgB,2BAA2B,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,GAAG,IAAI,CAQzE;AAED,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,MAAM,UAM5C;AAED,wBAAgB,uBAAuB,CAAC,IAAI,EAAE,MAAM,WAKnD"}
|
|
@@ -5,16 +5,22 @@ function normalizeErrorDiagnostics(value, fallback) {
|
|
|
5
5
|
}
|
|
6
6
|
const record = objectRecord(value);
|
|
7
7
|
if (!record) return null;
|
|
8
|
-
const
|
|
9
|
-
if (
|
|
10
|
-
return normalizeErrorDiagnostics(
|
|
8
|
+
const nestedError = objectRecord(record.error);
|
|
9
|
+
if (nestedError && nestedError !== record) {
|
|
10
|
+
return normalizeErrorDiagnostics(nestedError, fallback);
|
|
11
11
|
}
|
|
12
12
|
const message = firstString(record, ["error", "message", "msg", "reason", "detail", "details"]) ?? fallback;
|
|
13
13
|
const trace = firstString(record, ["trace", "trace_id", "traceId", "traceID"]);
|
|
14
14
|
const stacktrace = firstString(record, ["stacktrace", "stack_trace", "stackTrace", "stack"]);
|
|
15
15
|
const time = firstString(record, ["time", "timestamp", "created_at"]);
|
|
16
16
|
const context = contextEntries(record.context);
|
|
17
|
-
if (!message && !trace && !stacktrace && context.length === 0)
|
|
17
|
+
if (!message && !trace && !stacktrace && !time && context.length === 0) {
|
|
18
|
+
const nestedDiagnostics = objectRecord(record.diagnostics);
|
|
19
|
+
if (nestedDiagnostics && nestedDiagnostics !== record) {
|
|
20
|
+
return normalizeErrorDiagnostics(nestedDiagnostics, fallback);
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
if (!message && !trace && !stacktrace && !time && context.length === 0) return null;
|
|
18
24
|
return {
|
|
19
25
|
message: message ?? "Action failed",
|
|
20
26
|
context,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"error-diagnostics.js","sources":["../../../src/data/diagnostics/error-diagnostics.ts"],"sourcesContent":["// Normalize ad-hoc error payloads (oops JSON, plain strings, nested objects)\n// into the shape ErrorDetails consumes. Mirrors what `samber/oops` emits\n// from `OopsError.MarshalJSON()` on the Go side.\n\nexport type ErrorDiagnostics = {\n message: string;\n trace?: string;\n time?: string;\n stacktrace?: string;\n context: Array<[string, string]>;\n raw?: unknown;\n};\n\nexport type ParsedErrorStackTrace = {\n headline?: string;\n frames: ErrorStackFrame[];\n unparsed: string[];\n raw: string;\n};\n\nexport type ErrorStackFrame = {\n raw: string;\n file: string;\n line: number;\n functionName?: string;\n};\n\nexport function normalizeErrorDiagnostics(\n value: unknown,\n fallback?: string | null,\n): ErrorDiagnostics | null {\n if (!value) return null;\n if (typeof value === \"string\") {\n return value.trim() ? { message: value, context: [] } : null;\n }\n const record = objectRecord(value);\n if (!record) return null;\n const nested = objectRecord(record.error) ?? objectRecord(record.diagnostics);\n if (nested && nested !== record) {\n return normalizeErrorDiagnostics(nested, fallback);\n }\n const message =\n firstString(record, [\"error\", \"message\", \"msg\", \"reason\", \"detail\", \"details\"]) ?? fallback;\n const trace = firstString(record, [\"trace\", \"trace_id\", \"traceId\", \"traceID\"]);\n const stacktrace = firstString(record, [\"stacktrace\", \"stack_trace\", \"stackTrace\", \"stack\"]);\n const time = firstString(record, [\"time\", \"timestamp\", \"created_at\"]);\n const context = contextEntries(record.context);\n if (!message && !trace && !stacktrace && context.length === 0) return null;\n return {\n message: message ?? \"Action failed\",\n context,\n raw: value,\n ...(trace !== undefined ? { trace } : {}),\n ...(time !== undefined ? { time } : {}),\n ...(stacktrace !== undefined ? { stacktrace } : {}),\n };\n}\n\nexport function parseDiagnosticsStackTrace(stacktrace: string): ParsedErrorStackTrace {\n const lines = stacktrace\n .split(/\\r?\\n/)\n .map((line) => line.trim())\n .filter(Boolean);\n const frames: ErrorStackFrame[] = [];\n const unparsed: string[] = [];\n let headline: string | undefined;\n\n for (const line of lines) {\n const frame = parseStackTraceFrame(line);\n if (frame) {\n frames.push(frame);\n continue;\n }\n if (!headline && !line.startsWith(\"--- at \")) {\n headline = line;\n continue;\n }\n unparsed.push(line);\n }\n\n return {\n frames,\n unparsed,\n raw: stacktrace,\n ...(headline !== undefined ? { headline } : {}),\n };\n}\n\nexport function parseInlineJsonContextValue(value: string): unknown | null {\n const trimmed = value.trim();\n if (!trimmed || !/^[{[]/.test(trimmed)) return null;\n try {\n return JSON.parse(trimmed);\n } catch {\n return null;\n }\n}\n\nexport function compactStackPath(file: string) {\n return file\n .replace(/^github\\.com\\/flanksource\\/incident-commander\\//, \"\")\n .replace(/^github\\.com\\/flanksource\\//, \"flanksource/\")\n .replace(/^.*\\/go\\/pkg\\/mod\\//, \"pkg/mod/\")\n .replace(/^.*\\/incident-commander\\//, \"\");\n}\n\nexport function isApplicationStackFrame(file: string) {\n return (\n file.includes(\"github.com/flanksource/incident-commander/\") ||\n file.includes(\"/incident-commander/\")\n );\n}\n\nfunction parseStackTraceFrame(line: string): ErrorStackFrame | null {\n const prefix = \"--- at \";\n if (!line.startsWith(prefix)) return null;\n\n const value = line.slice(prefix.length);\n let fileEnd = -1;\n let lineStart = -1;\n let lineEnd = -1;\n let functionStart = -1;\n\n for (let index = 0; index < value.length; index++) {\n if (value[index] !== \":\" || !isDecimalDigit(value[index + 1])) continue;\n\n let end = index + 1;\n while (isDecimalDigit(value[end])) end++;\n if (end === value.length) {\n fileEnd = index;\n lineStart = index + 1;\n lineEnd = end;\n functionStart = -1;\n continue;\n }\n if (!isWhitespace(value[end])) continue;\n\n let start = end;\n while (isWhitespace(value[start])) start++;\n if (start === value.length && start - end < 2) continue;\n fileEnd = index;\n lineStart = index + 1;\n lineEnd = end;\n functionStart = start;\n }\n\n if (fileEnd <= 0 || lineStart < 0 || lineEnd < 0) return null;\n const functionName = functionStart >= 0 ? value.slice(functionStart).trim() : \"\";\n return {\n raw: line,\n file: value.slice(0, fileEnd),\n line: Number(value.slice(lineStart, lineEnd)),\n ...(functionName ? { functionName } : {}),\n };\n}\n\nfunction isDecimalDigit(value: string | undefined): boolean {\n return value !== undefined && value >= \"0\" && value <= \"9\";\n}\n\nfunction isWhitespace(value: string | undefined): boolean {\n return value !== undefined && value.trim() === \"\";\n}\n\nfunction objectRecord(value: unknown): Record<string, unknown> | null {\n if (!value || typeof value !== \"object\" || Array.isArray(value)) return null;\n return value as Record<string, unknown>;\n}\n\nfunction firstString(record: Record<string, unknown>, keys: string[]): string | undefined {\n for (const key of keys) {\n const value = record[key];\n if (typeof value === \"string\" && value.trim()) return value;\n }\n return undefined;\n}\n\nfunction contextEntries(value: unknown): Array<[string, string]> {\n const record = objectRecord(value);\n if (!record) return [];\n return Object.entries(record)\n .filter(\n ([, entryValue]) => entryValue !== undefined && entryValue !== null && entryValue !== \"\",\n )\n .map(([key, entryValue]) => [key, stringifyValue(entryValue)]);\n}\n\nfunction stringifyValue(value: unknown): string {\n if (value === null || value === undefined || value === \"\") return \"-\";\n if (typeof value === \"string\") return value;\n if (typeof value === \"number\" || typeof value === \"boolean\") return String(value);\n return JSON.stringify(value);\n}\n"],"names":[],"mappings":"AA2BO,SAAS,0BACd,OACA,UACyB;AACzB,MAAI,CAAC,MAAO,QAAO;AACnB,MAAI,OAAO,UAAU,UAAU;AAC7B,WAAO,MAAM,SAAS,EAAE,SAAS,OAAO,SAAS,CAAA,EAAC,IAAM;AAAA,EAC1D;AACA,QAAM,SAAS,aAAa,KAAK;AACjC,MAAI,CAAC,OAAQ,QAAO;AACpB,QAAM,SAAS,aAAa,OAAO,KAAK,KAAK,aAAa,OAAO,WAAW;AAC5E,MAAI,UAAU,WAAW,QAAQ;AAC/B,WAAO,0BAA0B,QAAQ,QAAQ;AAAA,EACnD;AACA,QAAM,UACJ,YAAY,QAAQ,CAAC,SAAS,WAAW,OAAO,UAAU,UAAU,SAAS,CAAC,KAAK;AACrF,QAAM,QAAQ,YAAY,QAAQ,CAAC,SAAS,YAAY,WAAW,SAAS,CAAC;AAC7E,QAAM,aA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GAAI,eAAe,EAAE,iBAAiB,CAAA;AAAA,EAAC;AAE3C;AAEA,SAAS,eAAe,OAAoC;AAC1D,SAAO,UAAU,UAAa,SAAS,OAAO,SAAS;AACzD;AAEA,SAAS,aAAa,OAAoC;AACxD,SAAO,UAAU,UAAa,MAAM,KAAA,MAAW;AACjD;AAEA,SAAS,aAAa,OAAgD;AACpE,MAAI,CAAC,SAAS,OAAO,UAAU,YAAY,MAAM,QAAQ,KAAK,EAAG,QAAO;AACxE,SAAO;AACT;AAEA,SAAS,YAAY,QAAiC,MAAoC;AACxF,aAAW,OAAO,MAAM;AACtB,UAAM,QAAQ,OAAO,GAAG;AACxB,QAAI,OAAO,UAAU,YAAY,MAAM,KAAA,EAAQ,QAAO;AAAA,EACxD;AACA,SAAO;AACT;AAEA,SAAS,eAAe,OAAyC;AAC/D,QAAM,SAAS,aAAa,KAAK;AACjC,MAAI,CAAC,OAAQ,QAAO,CAAA;AACpB,SAAO,OAAO,QAAQ,MAAM,EACzB;AAAA,IACC,CAAC,CAAA,EAAG,UAAU,MAAM,eAAe,UAAa,eAAe,QAAQ,eAAe;AAAA,EAAA,EAEvF,IAAI,CAAC,CAAC,KAAK,UAAU,MAAM,CAAC,KAAK,eAAe,UAAU,CAAC,CAAC;AACjE;AAEA,SAAS,eAAe,OAAwB;AAC9C,MAAI,UAAU,QAAQ,UAAU,UAAa,UAAU,GAAI,QAAO;AAClE,MAAI,OAAO,UAAU,SAAU,QAAO;AACtC,MAAI,OAAO,UAAU,YAAY,OAAO,UAAU,UAAW,QAAO,OAAO,KAAK;AAChF,SAAO,KAAK,UAAU,KAAK;AAC7B;"}
|
|
1
|
+
{"version":3,"file":"error-diagnostics.js","sources":["../../../src/data/diagnostics/error-diagnostics.ts"],"sourcesContent":["// Normalize ad-hoc error payloads (oops JSON, plain strings, nested objects)\n// into the shape ErrorDetails consumes. Mirrors what `samber/oops` emits\n// from `OopsError.MarshalJSON()` on the Go side.\n\nexport type ErrorDiagnostics = {\n message: string;\n trace?: string;\n time?: string;\n stacktrace?: string;\n context: Array<[string, string]>;\n raw?: unknown;\n};\n\nexport type ParsedErrorStackTrace = {\n headline?: string;\n frames: ErrorStackFrame[];\n unparsed: string[];\n raw: string;\n};\n\nexport type ErrorStackFrame = {\n raw: string;\n file: string;\n line: number;\n functionName?: string;\n};\n\nexport function normalizeErrorDiagnostics(\n value: unknown,\n fallback?: string | null,\n): ErrorDiagnostics | null {\n if (!value) return null;\n if (typeof value === \"string\") {\n return value.trim() ? { message: value, context: [] } : null;\n }\n const record = objectRecord(value);\n if (!record) return null;\n const nestedError = objectRecord(record.error);\n if (nestedError && nestedError !== record) {\n return normalizeErrorDiagnostics(nestedError, fallback);\n }\n const message =\n firstString(record, [\"error\", \"message\", \"msg\", \"reason\", \"detail\", \"details\"]) ?? fallback;\n const trace = firstString(record, [\"trace\", \"trace_id\", \"traceId\", \"traceID\"]);\n const stacktrace = firstString(record, [\"stacktrace\", \"stack_trace\", \"stackTrace\", \"stack\"]);\n const time = firstString(record, [\"time\", \"timestamp\", \"created_at\"]);\n const context = contextEntries(record.context);\n if (!message && !trace && !stacktrace && !time && context.length === 0) {\n const nestedDiagnostics = objectRecord(record.diagnostics);\n if (nestedDiagnostics && nestedDiagnostics !== record) {\n return normalizeErrorDiagnostics(nestedDiagnostics, fallback);\n }\n }\n if (!message && !trace && !stacktrace && !time && context.length === 0) return null;\n return {\n message: message ?? \"Action failed\",\n context,\n raw: value,\n ...(trace !== undefined ? { trace } : {}),\n ...(time !== undefined ? { time } : {}),\n ...(stacktrace !== undefined ? { stacktrace } : {}),\n };\n}\n\nexport function parseDiagnosticsStackTrace(stacktrace: string): ParsedErrorStackTrace {\n const lines = stacktrace\n .split(/\\r?\\n/)\n .map((line) => line.trim())\n .filter(Boolean);\n const frames: ErrorStackFrame[] = [];\n const unparsed: string[] = [];\n let headline: string | undefined;\n\n for (const line of lines) {\n const frame = parseStackTraceFrame(line);\n if (frame) {\n frames.push(frame);\n continue;\n }\n if (!headline && !line.startsWith(\"--- at \")) {\n headline = line;\n continue;\n }\n unparsed.push(line);\n }\n\n return {\n frames,\n unparsed,\n raw: stacktrace,\n ...(headline !== undefined ? { headline } : {}),\n };\n}\n\nexport function parseInlineJsonContextValue(value: string): unknown | null {\n const trimmed = value.trim();\n if (!trimmed || !/^[{[]/.test(trimmed)) return null;\n try {\n return JSON.parse(trimmed);\n } catch {\n return null;\n }\n}\n\nexport function compactStackPath(file: string) {\n return file\n .replace(/^github\\.com\\/flanksource\\/incident-commander\\//, \"\")\n .replace(/^github\\.com\\/flanksource\\//, \"flanksource/\")\n .replace(/^.*\\/go\\/pkg\\/mod\\//, \"pkg/mod/\")\n .replace(/^.*\\/incident-commander\\//, \"\");\n}\n\nexport function isApplicationStackFrame(file: string) {\n return (\n file.includes(\"github.com/flanksource/incident-commander/\") ||\n file.includes(\"/incident-commander/\")\n );\n}\n\nfunction parseStackTraceFrame(line: string): ErrorStackFrame | null {\n const prefix = \"--- at \";\n if (!line.startsWith(prefix)) return null;\n\n const value = line.slice(prefix.length);\n let fileEnd = -1;\n let lineStart = -1;\n let lineEnd = -1;\n let functionStart = -1;\n\n for (let index = 0; index < value.length; index++) {\n if (value[index] !== \":\" || !isDecimalDigit(value[index + 1])) continue;\n\n let end = index + 1;\n while (isDecimalDigit(value[end])) end++;\n if (end === value.length) {\n fileEnd = index;\n lineStart = index + 1;\n lineEnd = end;\n functionStart = -1;\n continue;\n }\n if (!isWhitespace(value[end])) continue;\n\n let start = end;\n while (isWhitespace(value[start])) start++;\n if (start === value.length && start - end < 2) continue;\n fileEnd = index;\n lineStart = index + 1;\n lineEnd = end;\n functionStart = start;\n }\n\n if (fileEnd <= 0 || lineStart < 0 || lineEnd < 0) return null;\n const functionName = functionStart >= 0 ? value.slice(functionStart).trim() : \"\";\n return {\n raw: line,\n file: value.slice(0, fileEnd),\n line: Number(value.slice(lineStart, lineEnd)),\n ...(functionName ? { functionName } : {}),\n };\n}\n\nfunction isDecimalDigit(value: string | undefined): boolean {\n return value !== undefined && value >= \"0\" && value <= \"9\";\n}\n\nfunction isWhitespace(value: string | undefined): boolean {\n return value !== undefined && value.trim() === \"\";\n}\n\nfunction objectRecord(value: unknown): Record<string, unknown> | null {\n if (!value || typeof value !== \"object\" || Array.isArray(value)) return null;\n return value as Record<string, unknown>;\n}\n\nfunction firstString(record: Record<string, unknown>, keys: string[]): string | undefined {\n for (const key of keys) {\n const value = record[key];\n if (typeof value === \"string\" && value.trim()) return value;\n }\n return undefined;\n}\n\nfunction contextEntries(value: unknown): Array<[string, string]> {\n const record = objectRecord(value);\n if (!record) return [];\n return Object.entries(record)\n .filter(\n ([, entryValue]) => entryValue !== undefined && entryValue !== null && entryValue !== \"\",\n )\n .map(([key, entryValue]) => [key, stringifyValue(entryValue)]);\n}\n\nfunction stringifyValue(value: unknown): string {\n if (value === null || value === undefined || value === \"\") return \"-\";\n if (typeof value === \"string\") return value;\n if (typeof value === \"number\" || typeof value === \"boolean\") return String(value);\n return JSON.stringify(value);\n}\n"],"names":[],"mappings":"AA2BO,SAAS,0BACd,OACA,UACyB;AACzB,MAAI,CAAC,MAAO,QAAO;AACnB,MAAI,OAAO,UAAU,UAAU;AAC7B,WAAO,MAAM,SAAS,EAAE,SAAS,OAAO,SAAS,CAAA,EAAC,IAAM;AAAA,EAC1D;AACA,QAAM,SAAS,aAAa,KAAK;AACjC,MAAI,CAAC,OAAQ,QAAO;AACpB,QAAM,cAAc,aAAa,OAAO,KAAK;AAC7C,MAAI,eAAe,gBAAgB,QAAQ;AACzC,WAAO,0BAA0B,aAAa,QAAQ;AAAA,EACxD;AACA,QAAM,UACJ,YAAY,QAAQ,CAAC,SAAS,WAAW,OAAO,UAAU,UAAU,SAAS,CAAC,KAAK;AACrF,QAAM,QAAQ,YAAY,QAAQ,CAAC,SAAS,YAAY,WAAW,SAAS,CAAC;AAC7E,QAAM,aAAa,YAAY,QAAQ,CAAC,cAAc,eAAe,cAAc,OAAO,CAAC;AAC3F,QAAM,OAAO,YAA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(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
3
|
const jsxRuntime = require("react/jsx-runtime");
|
|
4
|
-
const commands = require("@codemirror/commands");
|
|
5
|
-
const autocomplete = require("@codemirror/autocomplete");
|
|
6
|
-
const langJson = require("@codemirror/lang-json");
|
|
7
|
-
const langSql = require("@codemirror/lang-sql");
|
|
8
4
|
const state = require("@codemirror/state");
|
|
9
5
|
const view = require("@codemirror/view");
|
|
10
6
|
const react = require("react");
|
|
@@ -13,86 +9,15 @@ const JsonSchemaForm = require("../../components/JsonSchemaForm.cjs");
|
|
|
13
9
|
const utils = require("../../lib/utils.cjs");
|
|
14
10
|
const SplitPane = require("../../layout/SplitPane.cjs");
|
|
15
11
|
const Icon = require("../Icon.cjs");
|
|
16
|
-
const DataTable = require("../DataTable.cjs");
|
|
17
12
|
const dataTableUtils = require("../data-table-utils.cjs");
|
|
18
13
|
const dataTableServerFilters = require("../data-table-server-filters.cjs");
|
|
19
14
|
const ErrorDetails = require("../diagnostics/ErrorDetails.cjs");
|
|
20
|
-
const
|
|
21
|
-
const
|
|
15
|
+
const QueryBrowser_editor = require("./QueryBrowser.editor.cjs");
|
|
16
|
+
const QueryBrowserDiagnosticsPanel = require("./QueryBrowserDiagnosticsPanel.cjs");
|
|
17
|
+
const QueryBrowserResults = require("./QueryBrowserResults.cjs");
|
|
18
|
+
const QueryBrowser_types = require("./QueryBrowser.types.cjs");
|
|
19
|
+
const UiDebug = require("../../icons/components/UiDebug.cjs");
|
|
22
20
|
const UiPlay = require("../../icons/components/UiPlay.cjs");
|
|
23
|
-
const MAX_HISTORY = 50;
|
|
24
|
-
function historyKey(id) {
|
|
25
|
-
return `clicky-ui:query-browser:${id}:history`;
|
|
26
|
-
}
|
|
27
|
-
function readHistory(id) {
|
|
28
|
-
if (typeof window === "undefined") return [];
|
|
29
|
-
try {
|
|
30
|
-
const value = JSON.parse(
|
|
31
|
-
window.localStorage.getItem(historyKey(id)) ?? "[]"
|
|
32
|
-
);
|
|
33
|
-
return Array.isArray(value) ? value.slice(0, MAX_HISTORY) : [];
|
|
34
|
-
} catch {
|
|
35
|
-
return [];
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
function rememberQuery(id, query) {
|
|
39
|
-
const entries = readHistory(id).filter((entry) => entry.query !== query);
|
|
40
|
-
const next = [{ query, at: Date.now() }, ...entries].slice(0, MAX_HISTORY);
|
|
41
|
-
if (typeof window !== "undefined") {
|
|
42
|
-
window.localStorage.setItem(historyKey(id), JSON.stringify(next));
|
|
43
|
-
}
|
|
44
|
-
return next;
|
|
45
|
-
}
|
|
46
|
-
function editorExtensions(execute, onQueryChange, languageExtension2) {
|
|
47
|
-
return [
|
|
48
|
-
commands.history(),
|
|
49
|
-
view.keymap.of([
|
|
50
|
-
{
|
|
51
|
-
key: "Mod-Enter",
|
|
52
|
-
run: () => {
|
|
53
|
-
execute();
|
|
54
|
-
return true;
|
|
55
|
-
}
|
|
56
|
-
},
|
|
57
|
-
...commands.historyKeymap
|
|
58
|
-
]),
|
|
59
|
-
view.EditorView.lineWrapping,
|
|
60
|
-
view.EditorView.updateListener.of((update) => {
|
|
61
|
-
if (update.docChanged) onQueryChange(update.state.doc.toString());
|
|
62
|
-
}),
|
|
63
|
-
view.EditorView.theme({
|
|
64
|
-
"&": { height: "100%", fontSize: "13px", background: "transparent" },
|
|
65
|
-
".cm-scroller": {
|
|
66
|
-
fontFamily: "ui-monospace, SFMono-Regular, Menlo, monospace"
|
|
67
|
-
},
|
|
68
|
-
".cm-content": { padding: "12px 0" },
|
|
69
|
-
".cm-gutters": { background: "transparent", border: "none" },
|
|
70
|
-
"&.cm-focused": { outline: "none" }
|
|
71
|
-
}),
|
|
72
|
-
languageExtension2
|
|
73
|
-
];
|
|
74
|
-
}
|
|
75
|
-
function languageExtension(language, completion) {
|
|
76
|
-
if (language === "sql") {
|
|
77
|
-
if ((completion == null ? void 0 : completion.kind) !== "sql") return langSql.sql();
|
|
78
|
-
return langSql.sql({
|
|
79
|
-
dialect: QueryBrowser_completion.dialectFor(completion.dialect),
|
|
80
|
-
schema: QueryBrowser_completion.sqlCompletionNamespace(completion.schemas),
|
|
81
|
-
upperCaseKeywords: true,
|
|
82
|
-
...completion.defaultSchema ? { defaultSchema: completion.defaultSchema } : {}
|
|
83
|
-
});
|
|
84
|
-
}
|
|
85
|
-
if (language === "json") {
|
|
86
|
-
if ((completion == null ? void 0 : completion.kind) !== "json-fields") return langJson.json();
|
|
87
|
-
return [
|
|
88
|
-
langJson.json(),
|
|
89
|
-
autocomplete.autocompletion({
|
|
90
|
-
override: [QueryBrowser_completion.openSearchJSONCompletionSource(completion.fields)]
|
|
91
|
-
})
|
|
92
|
-
];
|
|
93
|
-
}
|
|
94
|
-
return [];
|
|
95
|
-
}
|
|
96
21
|
function QueryBrowser({
|
|
97
22
|
id,
|
|
98
23
|
title,
|
|
@@ -110,6 +35,7 @@ function QueryBrowser({
|
|
|
110
35
|
renderResults,
|
|
111
36
|
className
|
|
112
37
|
}) {
|
|
38
|
+
var _a;
|
|
113
39
|
const editorHost = react.useRef(null);
|
|
114
40
|
const editor = react.useRef(null);
|
|
115
41
|
const languageConfig = react.useRef(new state.Compartment());
|
|
@@ -121,7 +47,10 @@ function QueryBrowser({
|
|
|
121
47
|
const [result, setResult] = react.useState(null);
|
|
122
48
|
const [error, setError] = react.useState(null);
|
|
123
49
|
const [pending, setPending] = react.useState(false);
|
|
124
|
-
const [
|
|
50
|
+
const [debug, setDebug] = react.useState(false);
|
|
51
|
+
const [entries, setEntries] = react.useState(
|
|
52
|
+
() => QueryBrowser_editor.readQueryBrowserHistory(id)
|
|
53
|
+
);
|
|
125
54
|
const [filters, setFilters] = react.useState({});
|
|
126
55
|
const lastRun = react.useRef(null);
|
|
127
56
|
const executedFilters = react.useRef({});
|
|
@@ -139,10 +68,16 @@ function QueryBrowser({
|
|
|
139
68
|
lastRun.current = {
|
|
140
69
|
query: request.query,
|
|
141
70
|
options: request.options,
|
|
71
|
+
...request.filters ? { filters: request.filters } : {},
|
|
142
72
|
...next.columns ? { columns: next.columns } : {}
|
|
143
73
|
};
|
|
144
74
|
} catch (err) {
|
|
145
|
-
setError(
|
|
75
|
+
setError({
|
|
76
|
+
message: err instanceof Error ? err.message : String(err),
|
|
77
|
+
query: request.query,
|
|
78
|
+
...err instanceof QueryBrowser_types.QueryBrowserExecutionError && err.diagnostics ? { diagnostics: err.diagnostics } : {},
|
|
79
|
+
...err instanceof QueryBrowser_types.QueryBrowserExecutionError && err.errorDetails ? { errorDetails: err.errorDetails } : {}
|
|
80
|
+
});
|
|
146
81
|
} finally {
|
|
147
82
|
setPending(false);
|
|
148
83
|
}
|
|
@@ -158,11 +93,11 @@ function QueryBrowser({
|
|
|
158
93
|
return view2.state.doc.toString();
|
|
159
94
|
}, [initialQuery]);
|
|
160
95
|
const run = react.useCallback(async () => {
|
|
161
|
-
var
|
|
96
|
+
var _a2;
|
|
162
97
|
const query = currentQuery().trim();
|
|
163
98
|
if (!query || pending) return;
|
|
164
|
-
setEntries(
|
|
165
|
-
const repeat = ((
|
|
99
|
+
setEntries(QueryBrowser_editor.rememberQueryBrowserQuery(id, query));
|
|
100
|
+
const repeat = ((_a2 = lastRun.current) == null ? void 0 : _a2.query) === query ? lastRun.current : null;
|
|
166
101
|
const carried = repeat ? filters : {};
|
|
167
102
|
if (carried !== filters) setFilters(carried);
|
|
168
103
|
lastRun.current = { query, options };
|
|
@@ -171,18 +106,42 @@ function QueryBrowser({
|
|
|
171
106
|
query,
|
|
172
107
|
options,
|
|
173
108
|
...Object.keys(carried).length > 0 ? { filters: carried } : {},
|
|
174
|
-
...(repeat == null ? void 0 : repeat.columns) ? { columns: repeat.columns } : {}
|
|
109
|
+
...(repeat == null ? void 0 : repeat.columns) ? { columns: repeat.columns } : {},
|
|
110
|
+
...debug ? { debug: true } : {}
|
|
175
111
|
});
|
|
176
|
-
}, [currentQuery, filters, id, options, pending, runRequest]);
|
|
112
|
+
}, [currentQuery, debug, filters, id, options, pending, runRequest]);
|
|
177
113
|
const rerunWithFilters = react.useCallback(
|
|
178
114
|
async (selection) => {
|
|
179
115
|
const previous = lastRun.current;
|
|
180
116
|
if (!previous) {
|
|
181
|
-
throw new Error(
|
|
117
|
+
throw new Error(
|
|
118
|
+
"QueryBrowser: a filter changed before any query had run"
|
|
119
|
+
);
|
|
120
|
+
}
|
|
121
|
+
await runRequest({
|
|
122
|
+
...previous,
|
|
123
|
+
filters: selection,
|
|
124
|
+
...(result == null ? void 0 : result.pagination) ? { pagination: { limit: result.pagination.limit } } : {},
|
|
125
|
+
...debug ? { debug: true } : {}
|
|
126
|
+
});
|
|
127
|
+
},
|
|
128
|
+
[debug, result == null ? void 0 : result.pagination, runRequest]
|
|
129
|
+
);
|
|
130
|
+
const rerunAt = react.useCallback(
|
|
131
|
+
async (pagination) => {
|
|
132
|
+
const previous = lastRun.current;
|
|
133
|
+
if (!previous) {
|
|
134
|
+
throw new Error(
|
|
135
|
+
"QueryBrowser: pagination changed before any query had run"
|
|
136
|
+
);
|
|
182
137
|
}
|
|
183
|
-
await runRequest({
|
|
138
|
+
await runRequest({
|
|
139
|
+
...previous,
|
|
140
|
+
pagination,
|
|
141
|
+
...debug ? { debug: true } : {}
|
|
142
|
+
});
|
|
184
143
|
},
|
|
185
|
-
[runRequest]
|
|
144
|
+
[debug, runRequest]
|
|
186
145
|
);
|
|
187
146
|
react.useEffect(() => {
|
|
188
147
|
if (!lastRun.current) return;
|
|
@@ -198,13 +157,15 @@ function QueryBrowser({
|
|
|
198
157
|
parent: editorHost.current,
|
|
199
158
|
state: state.EditorState.create({
|
|
200
159
|
doc: initialQuery,
|
|
201
|
-
extensions:
|
|
160
|
+
extensions: QueryBrowser_editor.queryBrowserEditorExtensions(
|
|
202
161
|
() => executeRef.current(),
|
|
203
162
|
(query) => {
|
|
204
|
-
var
|
|
205
|
-
return (
|
|
163
|
+
var _a2;
|
|
164
|
+
return (_a2 = onQueryChangeRef.current) == null ? void 0 : _a2.call(onQueryChangeRef, query);
|
|
206
165
|
},
|
|
207
|
-
languageConfig.current.of(
|
|
166
|
+
languageConfig.current.of(
|
|
167
|
+
QueryBrowser_editor.queryBrowserLanguageExtension(language, completion)
|
|
168
|
+
)
|
|
208
169
|
)
|
|
209
170
|
})
|
|
210
171
|
});
|
|
@@ -219,7 +180,7 @@ function QueryBrowser({
|
|
|
219
180
|
if (!view2) return;
|
|
220
181
|
view2.dispatch({
|
|
221
182
|
effects: languageConfig.current.reconfigure(
|
|
222
|
-
|
|
183
|
+
QueryBrowser_editor.queryBrowserLanguageExtension(language, completion)
|
|
223
184
|
)
|
|
224
185
|
});
|
|
225
186
|
}, [completion, language]);
|
|
@@ -241,10 +202,11 @@ function QueryBrowser({
|
|
|
241
202
|
[onOptionsChange]
|
|
242
203
|
);
|
|
243
204
|
react.useEffect(() => {
|
|
244
|
-
setEntries(
|
|
205
|
+
setEntries(QueryBrowser_editor.readQueryBrowserHistory(id));
|
|
245
206
|
setResult(null);
|
|
246
207
|
setError(null);
|
|
247
208
|
setFilters({});
|
|
209
|
+
setDebug(false);
|
|
248
210
|
lastRun.current = null;
|
|
249
211
|
executedFilters.current = {};
|
|
250
212
|
}, [id]);
|
|
@@ -259,7 +221,9 @@ function QueryBrowser({
|
|
|
259
221
|
return (request) => {
|
|
260
222
|
const previous = lastRun.current;
|
|
261
223
|
if (!previous) {
|
|
262
|
-
throw new Error(
|
|
224
|
+
throw new Error(
|
|
225
|
+
"QueryBrowser: a filter lookup ran before any query had"
|
|
226
|
+
);
|
|
263
227
|
}
|
|
264
228
|
return lookupFilterValues({ ...request, ...previous, filters });
|
|
265
229
|
};
|
|
@@ -274,59 +238,53 @@ function QueryBrowser({
|
|
|
274
238
|
[described, filters, lookupValues]
|
|
275
239
|
);
|
|
276
240
|
const serverFiltered = filterConfig.filters.length > 0 || filterConfig.timeRange !== void 0;
|
|
277
|
-
const
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
}
|
|
325
|
-
),
|
|
326
|
-
className: "min-h-0 flex-1"
|
|
327
|
-
}
|
|
328
|
-
) : /* @__PURE__ */ jsxRuntime.jsx("div", { className: "rounded-md border border-dashed p-6 text-sm text-muted-foreground", children: result.message ?? "Statement completed with no rows." })
|
|
329
|
-
] }) : /* @__PURE__ */ jsxRuntime.jsx("div", { className: "grid min-h-40 place-items-center text-sm text-muted-foreground", children: "Run a query to see results." });
|
|
241
|
+
const tablePagination = react.useMemo(() => {
|
|
242
|
+
const pagination = result == null ? void 0 : result.pagination;
|
|
243
|
+
if (!pagination) return void 0;
|
|
244
|
+
const shared = {
|
|
245
|
+
pageSize: pagination.limit,
|
|
246
|
+
...pagination.total !== void 0 ? { total: pagination.total } : {},
|
|
247
|
+
...pagination.totalRelation === "eq" || pagination.totalRelation === "gte" ? { totalRelation: pagination.totalRelation } : {},
|
|
248
|
+
hasMore: pagination.hasMore,
|
|
249
|
+
onPageSizeChange: (limit) => void rerunAt({ limit })
|
|
250
|
+
};
|
|
251
|
+
if (pagination.mode === "cursor") {
|
|
252
|
+
return {
|
|
253
|
+
...shared,
|
|
254
|
+
page: 0,
|
|
255
|
+
cursor: {
|
|
256
|
+
...pagination.cursor ? { current: pagination.cursor } : {},
|
|
257
|
+
...pagination.nextCursor ? { next: pagination.nextCursor } : {},
|
|
258
|
+
onCursorChange: (cursor) => void rerunAt({
|
|
259
|
+
limit: pagination.limit,
|
|
260
|
+
...cursor ? { cursor } : {}
|
|
261
|
+
})
|
|
262
|
+
}
|
|
263
|
+
};
|
|
264
|
+
}
|
|
265
|
+
const page = Math.floor((pagination.offset ?? 0) / pagination.limit);
|
|
266
|
+
return {
|
|
267
|
+
...shared,
|
|
268
|
+
page,
|
|
269
|
+
onPageChange: (nextPage) => void rerunAt({
|
|
270
|
+
limit: pagination.limit,
|
|
271
|
+
offset: nextPage * pagination.limit
|
|
272
|
+
})
|
|
273
|
+
};
|
|
274
|
+
}, [rerunAt, result == null ? void 0 : result.pagination]);
|
|
275
|
+
const defaultResults = /* @__PURE__ */ jsxRuntime.jsx(
|
|
276
|
+
QueryBrowserResults.QueryBrowserResults,
|
|
277
|
+
{
|
|
278
|
+
result,
|
|
279
|
+
pending,
|
|
280
|
+
...title ? { title } : {},
|
|
281
|
+
queryLabel,
|
|
282
|
+
columns,
|
|
283
|
+
filterConfig,
|
|
284
|
+
serverFiltered,
|
|
285
|
+
...tablePagination ? { pagination: tablePagination } : {}
|
|
286
|
+
}
|
|
287
|
+
);
|
|
330
288
|
const workspace = /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex h-full min-h-0 flex-col overflow-hidden rounded-xl border bg-card", children: [
|
|
331
289
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-wrap items-center gap-2 border-b px-3 py-2", children: [
|
|
332
290
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "min-w-0 flex-1", children: [
|
|
@@ -354,6 +312,19 @@ function QueryBrowser({
|
|
|
354
312
|
]
|
|
355
313
|
}
|
|
356
314
|
),
|
|
315
|
+
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
316
|
+
button.Button,
|
|
317
|
+
{
|
|
318
|
+
size: "sm",
|
|
319
|
+
variant: debug ? "secondary" : "outline",
|
|
320
|
+
"aria-pressed": debug,
|
|
321
|
+
onClick: () => setDebug((enabled) => !enabled),
|
|
322
|
+
children: [
|
|
323
|
+
/* @__PURE__ */ jsxRuntime.jsx(Icon.Icon, { icon: UiDebug.UiDebug, className: "size-4" }),
|
|
324
|
+
"Debug"
|
|
325
|
+
]
|
|
326
|
+
}
|
|
327
|
+
),
|
|
357
328
|
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
358
329
|
button.Button,
|
|
359
330
|
{
|
|
@@ -381,18 +352,25 @@ function QueryBrowser({
|
|
|
381
352
|
}
|
|
382
353
|
) }),
|
|
383
354
|
/* @__PURE__ */ jsxRuntime.jsx("div", { ref: editorHost, className: "h-[34%] min-h-44 border-b" }),
|
|
384
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex min-h-0 flex-1 flex-col overflow-auto p-3", children: error ? /* @__PURE__ */ jsxRuntime.
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
355
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex min-h-0 flex-1 flex-col overflow-auto p-3", children: error ? /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-3", children: [
|
|
356
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
357
|
+
ErrorDetails.ErrorDetails,
|
|
358
|
+
{
|
|
359
|
+
diagnostics: {
|
|
360
|
+
...error.errorDetails ?? {
|
|
361
|
+
message: error.message,
|
|
362
|
+
context: []
|
|
363
|
+
},
|
|
364
|
+
context: [
|
|
365
|
+
...((_a = error.errorDetails) == null ? void 0 : _a.context) ?? [],
|
|
366
|
+
["Query", error.query],
|
|
367
|
+
["Language", language]
|
|
368
|
+
]
|
|
369
|
+
}
|
|
393
370
|
}
|
|
394
|
-
|
|
395
|
-
|
|
371
|
+
),
|
|
372
|
+
error.diagnostics && /* @__PURE__ */ jsxRuntime.jsx(QueryBrowserDiagnosticsPanel.QueryBrowserDiagnosticsPanel, { diagnostics: error.diagnostics })
|
|
373
|
+
] }) : result && renderResults ? renderResults({ result, defaultView: defaultResults }) : defaultResults })
|
|
396
374
|
] });
|
|
397
375
|
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: utils.cn("h-[calc(100vh-15rem)] min-h-[32rem]", className), children: navigator ? /* @__PURE__ */ jsxRuntime.jsx(SplitPane.SplitPane, { defaultSplit: 28, left: navigator, right: workspace }) : workspace });
|
|
398
376
|
}
|