@flanksource/clicky-ui 0.3.19 → 0.3.21
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/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/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/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 +2 -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 +2 -2
- 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 +1 -1
- package/dist/components/json-schema-form-types.d.ts.map +1 -1
- 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 +4 -0
- package/dist/components.cjs.map +1 -1
- package/dist/components.d.ts +1 -0
- package/dist/components.d.ts.map +1 -1
- package/dist/components.js +4 -0
- package/dist/components.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 +12 -6
- package/dist/data/query-browser/QueryBrowser.cjs.map +1 -1
- package/dist/data/query-browser/QueryBrowser.d.ts.map +1 -1
- package/dist/data/query-browser/QueryBrowser.js +12 -6
- package/dist/data/query-browser/QueryBrowser.js.map +1 -1
- package/dist/data/query-browser/QueryBrowser.types.cjs +2 -1
- package/dist/data/query-browser/QueryBrowser.types.cjs.map +1 -1
- package/dist/data/query-browser/QueryBrowser.types.d.ts +16 -14
- package/dist/data/query-browser/QueryBrowser.types.d.ts.map +1 -1
- package/dist/data/query-browser/QueryBrowser.types.js +2 -1
- package/dist/data/query-browser/QueryBrowser.types.js.map +1 -1
- package/dist/data/version-info.cjs +3 -3
- package/dist/data/version-info.js +3 -3
- package/dist/index.cjs +4 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +4 -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/styles.css +1 -1
- package/package.json +6 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"profileWizardHelp.cjs","sources":["../../src/profiles/profileWizardHelp.ts"],"sourcesContent":["/**\n * What each wizard step asks the author to do.\n *\n * Kept apart from profileWizardSteps.tsx so that module exports only components\n * (react/only-export-components).\n */\n\nexport const stepHelp = {\n source: \"Start with a saved connection. We will tailor the query workspace to its provider.\",\n query: \"Browse the catalog, write a query, and run a safe sample to discover fields.\",\n fields: \"Name the profile, choose the fields to expose, and tune how each field is displayed.\",\n review: \"Check the source, query, and field shape before creating the profile.\",\n};\n"],"names":[],"mappings":";;AAOO,MAAM,WAAW;AAAA,EACtB,QAAQ;AAAA,EACR,OAAO;AAAA,EACP,QAAQ;AAAA,EACR,QAAQ;AACV;;"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* What each wizard step asks the author to do.
|
|
3
|
+
*
|
|
4
|
+
* Kept apart from profileWizardSteps.tsx so that module exports only components
|
|
5
|
+
* (react/only-export-components).
|
|
6
|
+
*/
|
|
7
|
+
export declare const stepHelp: {
|
|
8
|
+
source: string;
|
|
9
|
+
query: string;
|
|
10
|
+
fields: string;
|
|
11
|
+
review: string;
|
|
12
|
+
};
|
|
13
|
+
//# sourceMappingURL=profileWizardHelp.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"profileWizardHelp.d.ts","sourceRoot":"","sources":["../../src/profiles/profileWizardHelp.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,eAAO,MAAM,QAAQ;;;;;CAKpB,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
const stepHelp = {
|
|
2
|
+
source: "Start with a saved connection. We will tailor the query workspace to its provider.",
|
|
3
|
+
query: "Browse the catalog, write a query, and run a safe sample to discover fields.",
|
|
4
|
+
fields: "Name the profile, choose the fields to expose, and tune how each field is displayed.",
|
|
5
|
+
review: "Check the source, query, and field shape before creating the profile."
|
|
6
|
+
};
|
|
7
|
+
export {
|
|
8
|
+
stepHelp
|
|
9
|
+
};
|
|
10
|
+
//# sourceMappingURL=profileWizardHelp.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"profileWizardHelp.js","sources":["../../src/profiles/profileWizardHelp.ts"],"sourcesContent":["/**\n * What each wizard step asks the author to do.\n *\n * Kept apart from profileWizardSteps.tsx so that module exports only components\n * (react/only-export-components).\n */\n\nexport const stepHelp = {\n source: \"Start with a saved connection. We will tailor the query workspace to its provider.\",\n query: \"Browse the catalog, write a query, and run a safe sample to discover fields.\",\n fields: \"Name the profile, choose the fields to expose, and tune how each field is displayed.\",\n review: \"Check the source, query, and field shape before creating the profile.\",\n};\n"],"names":[],"mappings":"AAOO,MAAM,WAAW;AAAA,EACtB,QAAQ;AAAA,EACR,OAAO;AAAA,EACP,QAAQ;AAAA,EACR,QAAQ;AACV;"}
|
|
@@ -0,0 +1,198 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
function applyPatch(value, patch) {
|
|
4
|
+
const next = { ...value };
|
|
5
|
+
for (const [key, entry] of Object.entries(patch)) {
|
|
6
|
+
if (entry === void 0) delete next[key];
|
|
7
|
+
else next[key] = entry;
|
|
8
|
+
}
|
|
9
|
+
return next;
|
|
10
|
+
}
|
|
11
|
+
const PARAM_TYPES_WITH_OPTIONS = ["enum", "list"];
|
|
12
|
+
function paramHasOptions(param) {
|
|
13
|
+
return param.type !== void 0 && PARAM_TYPES_WITH_OPTIONS.includes(param.type);
|
|
14
|
+
}
|
|
15
|
+
function withProfileLimits(draft, limits) {
|
|
16
|
+
const next = { ...draft };
|
|
17
|
+
if (limits) next.limits = limits;
|
|
18
|
+
else delete next.limits;
|
|
19
|
+
return next;
|
|
20
|
+
}
|
|
21
|
+
const PROFILE_COLUMN_FORMAT_OPTIONS = [
|
|
22
|
+
{ value: "date", label: "Date/time" },
|
|
23
|
+
{ value: "float", label: "Number" },
|
|
24
|
+
{ value: "duration", label: "Duration" },
|
|
25
|
+
{ value: "bytes", label: "Bytes" },
|
|
26
|
+
{ value: "currency", label: "Currency" }
|
|
27
|
+
];
|
|
28
|
+
const PROFILE_COLUMN_UNIT_OPTIONS = [
|
|
29
|
+
{ value: "none", label: "Compact count" },
|
|
30
|
+
{ value: "short", label: "Short number" },
|
|
31
|
+
{ value: "percent", label: "Percent (0-100)" },
|
|
32
|
+
{ value: "percentunit", label: "Percent (0-1)" },
|
|
33
|
+
{ value: "bytes", label: "Bytes (IEC)" },
|
|
34
|
+
{ value: "decbytes", label: "Bytes (SI)" },
|
|
35
|
+
{ value: "Bps", label: "Bytes/sec" },
|
|
36
|
+
{ value: "binBps", label: "Binary bytes/sec" },
|
|
37
|
+
{ value: "ms", label: "Milliseconds" },
|
|
38
|
+
{ value: "s", label: "Seconds" }
|
|
39
|
+
];
|
|
40
|
+
const profileWizardSteps = [
|
|
41
|
+
{ id: "source", label: "Choose source", description: "Connection" },
|
|
42
|
+
{ id: "query", label: "Explore & sample", description: "Query" },
|
|
43
|
+
{ id: "fields", label: "Name & shape", description: "Fields" },
|
|
44
|
+
{ id: "review", label: "Review", description: "Save" }
|
|
45
|
+
];
|
|
46
|
+
function filterProfileFields(fields, selectedNames, filter) {
|
|
47
|
+
const query = filter.query.trim().toLowerCase();
|
|
48
|
+
return fields.filter((field) => {
|
|
49
|
+
const selected = selectedNames.has(field.name);
|
|
50
|
+
if (filter.selection === "selected" && !selected) return false;
|
|
51
|
+
if (filter.selection === "unselected" && selected) return false;
|
|
52
|
+
if (filter.type && field.type !== filter.type) return false;
|
|
53
|
+
if (!query) return true;
|
|
54
|
+
return `${field.name} ${field.label ?? ""}`.toLowerCase().includes(query);
|
|
55
|
+
});
|
|
56
|
+
}
|
|
57
|
+
function availableProfileFields(discovered, configured) {
|
|
58
|
+
const configuredByName = new Map(
|
|
59
|
+
configured.map((field) => [field.name, field])
|
|
60
|
+
);
|
|
61
|
+
const configuredBySource = new Map(
|
|
62
|
+
configured.filter((field) => field.source).map((field) => [field.source, field])
|
|
63
|
+
);
|
|
64
|
+
const ordered = [...configured];
|
|
65
|
+
let anchor = 0;
|
|
66
|
+
for (const field of discovered) {
|
|
67
|
+
const match = configuredByName.get(field.name) ?? configuredBySource.get(field.name);
|
|
68
|
+
if (match) {
|
|
69
|
+
anchor = ordered.indexOf(match) + 1;
|
|
70
|
+
continue;
|
|
71
|
+
}
|
|
72
|
+
ordered.splice(anchor, 0, field);
|
|
73
|
+
anchor += 1;
|
|
74
|
+
}
|
|
75
|
+
return ordered;
|
|
76
|
+
}
|
|
77
|
+
function reorderProfileColumns(columns, sourceName, targetName) {
|
|
78
|
+
const from = columns.findIndex((column) => column.name === sourceName);
|
|
79
|
+
const to = columns.findIndex((column) => column.name === targetName);
|
|
80
|
+
if (from < 0 || to < 0 || from === to) return columns;
|
|
81
|
+
const next = [...columns];
|
|
82
|
+
next.splice(to, 0, ...next.splice(from, 1));
|
|
83
|
+
return next;
|
|
84
|
+
}
|
|
85
|
+
function applyVisibleFieldSelection(discovered, configured, visibleNames, selected) {
|
|
86
|
+
const selectedNames = new Set(configured.map((field) => field.name));
|
|
87
|
+
for (const name of visibleNames) {
|
|
88
|
+
if (selected) selectedNames.add(name);
|
|
89
|
+
else selectedNames.delete(name);
|
|
90
|
+
}
|
|
91
|
+
return availableProfileFields(discovered, configured).filter(
|
|
92
|
+
(field) => selectedNames.has(field.name)
|
|
93
|
+
);
|
|
94
|
+
}
|
|
95
|
+
const PROFILE_FILTER_KIND_OPTIONS = [
|
|
96
|
+
{ value: "terms", label: "Value selection" },
|
|
97
|
+
{ value: "range", label: "Numeric range" },
|
|
98
|
+
{ value: "time", label: "Time range" },
|
|
99
|
+
{ value: "boolean", label: "Yes/no" },
|
|
100
|
+
{ value: "text", label: "Substring" },
|
|
101
|
+
{ value: "none", label: "Not filterable" }
|
|
102
|
+
];
|
|
103
|
+
const PROFILE_FILTER_DEFAULT_LIMIT = 50;
|
|
104
|
+
const PROFILE_FILTER_MAX_LIMIT = 200;
|
|
105
|
+
function patchColumnFilter(filter, patch) {
|
|
106
|
+
const merged = Object.fromEntries(
|
|
107
|
+
Object.entries({ ...filter, ...patch }).filter(([, value]) => value !== void 0)
|
|
108
|
+
);
|
|
109
|
+
return Object.keys(merged).length ? merged : void 0;
|
|
110
|
+
}
|
|
111
|
+
function inferredFilterKind(column) {
|
|
112
|
+
switch (column.type) {
|
|
113
|
+
case "number":
|
|
114
|
+
case "duration":
|
|
115
|
+
case "bytes":
|
|
116
|
+
return "range";
|
|
117
|
+
case "datetime":
|
|
118
|
+
return "time";
|
|
119
|
+
case "boolean":
|
|
120
|
+
return "boolean";
|
|
121
|
+
case "key_value":
|
|
122
|
+
case "key_values":
|
|
123
|
+
case "json":
|
|
124
|
+
return "none";
|
|
125
|
+
default:
|
|
126
|
+
return "terms";
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
function patchProfileField(field, patch) {
|
|
130
|
+
return Object.fromEntries(
|
|
131
|
+
Object.entries({ ...field, ...patch }).filter(
|
|
132
|
+
([, value]) => value !== void 0
|
|
133
|
+
)
|
|
134
|
+
);
|
|
135
|
+
}
|
|
136
|
+
function renameProfileField(field, name) {
|
|
137
|
+
const source = field.source ?? (field.cel ? void 0 : field.name);
|
|
138
|
+
return patchProfileField(field, {
|
|
139
|
+
name,
|
|
140
|
+
source: source === name ? void 0 : source
|
|
141
|
+
});
|
|
142
|
+
}
|
|
143
|
+
function providerTypeFromConnectionLabel(label) {
|
|
144
|
+
var _a;
|
|
145
|
+
const match = label.match(/\(([^()]+)\)\s*$/);
|
|
146
|
+
return ((_a = match == null ? void 0 : match[1]) == null ? void 0 : _a.trim()) || null;
|
|
147
|
+
}
|
|
148
|
+
function profileConnectionID(value) {
|
|
149
|
+
const prefix = "connection://";
|
|
150
|
+
if (!value.startsWith(prefix)) return null;
|
|
151
|
+
return value.slice(prefix.length).trim() || null;
|
|
152
|
+
}
|
|
153
|
+
function profileWizardErrorMessage(error, fallback) {
|
|
154
|
+
return error instanceof Error && error.message.trim() ? error.message.trim() : fallback;
|
|
155
|
+
}
|
|
156
|
+
function profileWizardHasQuery(draft) {
|
|
157
|
+
var _a, _b, _c;
|
|
158
|
+
return Boolean(
|
|
159
|
+
((_a = draft.query) == null ? void 0 : _a.trim()) || ((_c = (_b = draft.provider) == null ? void 0 : _b.options) == null ? void 0 : _c.search) !== void 0
|
|
160
|
+
);
|
|
161
|
+
}
|
|
162
|
+
function profileWizardStepReady(step, draft, discovered) {
|
|
163
|
+
var _a, _b, _c, _d, _e;
|
|
164
|
+
if (step === "source") {
|
|
165
|
+
return Boolean(((_a = draft.provider) == null ? void 0 : _a.connection) && draft.provider.type);
|
|
166
|
+
}
|
|
167
|
+
if (step === "query") {
|
|
168
|
+
return Boolean(profileWizardHasQuery(draft) && discovered.length > 0);
|
|
169
|
+
}
|
|
170
|
+
if (step === "fields") {
|
|
171
|
+
return Boolean(((_b = draft.profile) == null ? void 0 : _b.trim()) && ((_c = draft.columns) == null ? void 0 : _c.length));
|
|
172
|
+
}
|
|
173
|
+
return Boolean(((_d = draft.profile) == null ? void 0 : _d.trim()) && ((_e = draft.provider) == null ? void 0 : _e.connection)) && discovered.length > 0;
|
|
174
|
+
}
|
|
175
|
+
exports.PARAM_TYPES_WITH_OPTIONS = PARAM_TYPES_WITH_OPTIONS;
|
|
176
|
+
exports.PROFILE_COLUMN_FORMAT_OPTIONS = PROFILE_COLUMN_FORMAT_OPTIONS;
|
|
177
|
+
exports.PROFILE_COLUMN_UNIT_OPTIONS = PROFILE_COLUMN_UNIT_OPTIONS;
|
|
178
|
+
exports.PROFILE_FILTER_DEFAULT_LIMIT = PROFILE_FILTER_DEFAULT_LIMIT;
|
|
179
|
+
exports.PROFILE_FILTER_KIND_OPTIONS = PROFILE_FILTER_KIND_OPTIONS;
|
|
180
|
+
exports.PROFILE_FILTER_MAX_LIMIT = PROFILE_FILTER_MAX_LIMIT;
|
|
181
|
+
exports.applyPatch = applyPatch;
|
|
182
|
+
exports.applyVisibleFieldSelection = applyVisibleFieldSelection;
|
|
183
|
+
exports.availableProfileFields = availableProfileFields;
|
|
184
|
+
exports.filterProfileFields = filterProfileFields;
|
|
185
|
+
exports.inferredFilterKind = inferredFilterKind;
|
|
186
|
+
exports.paramHasOptions = paramHasOptions;
|
|
187
|
+
exports.patchColumnFilter = patchColumnFilter;
|
|
188
|
+
exports.patchProfileField = patchProfileField;
|
|
189
|
+
exports.profileConnectionID = profileConnectionID;
|
|
190
|
+
exports.profileWizardErrorMessage = profileWizardErrorMessage;
|
|
191
|
+
exports.profileWizardHasQuery = profileWizardHasQuery;
|
|
192
|
+
exports.profileWizardStepReady = profileWizardStepReady;
|
|
193
|
+
exports.profileWizardSteps = profileWizardSteps;
|
|
194
|
+
exports.providerTypeFromConnectionLabel = providerTypeFromConnectionLabel;
|
|
195
|
+
exports.renameProfileField = renameProfileField;
|
|
196
|
+
exports.reorderProfileColumns = reorderProfileColumns;
|
|
197
|
+
exports.withProfileLimits = withProfileLimits;
|
|
198
|
+
//# sourceMappingURL=profileWizardModel.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"profileWizardModel.cjs","sources":["../../src/profiles/profileWizardModel.ts"],"sourcesContent":["import type { ProfileRowLimits } from \"./connectionBrowserModel\";\n\n/** How a column is filtered at the backend; every field overrides an inference\n * the server would otherwise make from the column itself. */\nexport type ProfileColumnFilter = {\n /** Backend field the selection applies to; blank infers it from the column. */\n field?: string;\n /** terms, range, time, boolean, text or none; blank infers it from the type. */\n kind?: string;\n /** Enumerated values, replacing the backend lookup. */\n options?: string[];\n /** Ask the backend for this field's distinct values. */\n lookup?: boolean;\n /** How many of those values the control offers before the rest are typed for. */\n limit?: number;\n /** Allow several values at once. */\n multi?: boolean;\n /** Offer no filter while keeping the column rendered. */\n disabled?: boolean;\n};\n\n/**\n * A patch of T: every key optional, and explicitly settable to `undefined` to\n * clear it.\n *\n * Not Partial<T>. Under `exactOptionalPropertyTypes` an optional key may be\n * absent but not present-and-undefined, and \"clear this field\" — which is what\n * every editor control sends when its input goes empty — is precisely a present\n * `undefined`. The patch appliers drop those keys; the type has to permit them.\n */\nexport type Patch<T> = { [K in keyof T]?: T[K] | undefined };\n\n/**\n * Applies a patch, removing the keys it clears instead of leaving them present\n * and undefined.\n *\n * Spreading a patch would keep them, and these objects are serialized to the\n * server, where a present `field: undefined` is a key to interpret rather than\n * an absent one.\n */\nexport function applyPatch<T extends object>(value: T, patch: Patch<T>): T {\n const next = { ...value };\n for (const [key, entry] of Object.entries(patch)) {\n if (entry === undefined) delete next[key as keyof T];\n else next[key as keyof T] = entry as T[keyof T];\n }\n return next;\n}\n\nexport type ProfileColumn = {\n name: string;\n source?: string;\n label?: string;\n type?: string;\n kind?: string;\n format?: string;\n unit?: string;\n width?: number;\n cel?: string;\n /** Path computing the value, rooted at the row or at `source` when set. */\n jsonpath?: string;\n hidden?: boolean;\n filter?: ProfileColumnFilter;\n [key: string]: unknown;\n};\n\nexport type ProfileProvider = {\n type?: string;\n connection?: string;\n options?: Record<string, unknown>;\n [key: string]: unknown;\n};\n\n/** The parameter types the profile schema accepts. */\nexport type ParamDraftType = \"string\" | \"number\" | \"boolean\" | \"date\" | \"enum\" | \"list\";\n\n/** filter, limit, offset, time-from or time-to; empty behaves as filter. */\nexport type ParamDraftRole = \"filter\" | \"limit\" | \"offset\" | \"time-from\" | \"time-to\";\n\nexport type ParamDraft = {\n name?: string | undefined;\n label?: string | undefined;\n type?: ParamDraftType | undefined;\n role?: ParamDraftRole | undefined;\n default?: unknown | undefined;\n options?: string[] | undefined;\n required?: boolean | undefined;\n description?: string | undefined;\n /** Value rewrite; {value} is the supplied value. */\n template?: string | undefined;\n /** Backend field a list parameter filters on. Setting it lets a value be\n * excluded as well as included; it requires an OpenSearch-backed provider. */\n field?: string | undefined;\n};\n\n/** PARAM_TYPES_WITH_OPTIONS are the types whose values come from a fixed set, so\n * the editor offers an options picker for them. */\nexport const PARAM_TYPES_WITH_OPTIONS: ParamDraftType[] = [\"enum\", \"list\"];\n\nexport function paramHasOptions(param: ParamDraft): boolean {\n return param.type !== undefined && PARAM_TYPES_WITH_OPTIONS.includes(param.type);\n}\n\nexport type ProfileWizardDraft = Record<string, unknown> & {\n namespace?: string | undefined;\n profile?: string | undefined;\n /** Overrides the sidebar/picker glyph the provider type would otherwise give. */\n icon?: string | undefined;\n provider?: ProfileProvider | undefined;\n query?: string | undefined;\n columns?: ProfileColumn[] | undefined;\n /** The inputs a run binds — by name in the query, the provider options or the\n * connection. The query workspace previews against their defaults. */\n params?: ParamDraft[] | undefined;\n /** The row caps this profile sets for itself; unset ones take their default. */\n limits?: ProfileRowLimits | undefined;\n};\n\n/**\n * A profile that caps nothing carries no block at all, so the defaults are what\n * it inherits rather than what it froze at the moment it was edited. Both draft\n * hosts write the caps through this, so neither can leave an empty map behind.\n */\nexport function withProfileLimits<T extends ProfileWizardDraft>(\n draft: T,\n limits: ProfileRowLimits | undefined,\n): T {\n const next = { ...draft };\n if (limits) next.limits = limits;\n else delete next.limits;\n return next;\n}\n\nexport type ProfileFieldFilter = {\n query: string;\n type: string;\n selection: \"all\" | \"selected\" | \"unselected\";\n};\n\nexport const PROFILE_COLUMN_FORMAT_OPTIONS = [\n { value: \"date\", label: \"Date/time\" },\n { value: \"float\", label: \"Number\" },\n { value: \"duration\", label: \"Duration\" },\n { value: \"bytes\", label: \"Bytes\" },\n { value: \"currency\", label: \"Currency\" },\n] as const;\n\nexport const PROFILE_COLUMN_UNIT_OPTIONS = [\n { value: \"none\", label: \"Compact count\" },\n { value: \"short\", label: \"Short number\" },\n { value: \"percent\", label: \"Percent (0-100)\" },\n { value: \"percentunit\", label: \"Percent (0-1)\" },\n { value: \"bytes\", label: \"Bytes (IEC)\" },\n { value: \"decbytes\", label: \"Bytes (SI)\" },\n { value: \"Bps\", label: \"Bytes/sec\" },\n { value: \"binBps\", label: \"Binary bytes/sec\" },\n { value: \"ms\", label: \"Milliseconds\" },\n { value: \"s\", label: \"Seconds\" },\n] as const;\n\nexport const profileWizardSteps = [\n { id: \"source\", label: \"Choose source\", description: \"Connection\" },\n { id: \"query\", label: \"Explore & sample\", description: \"Query\" },\n { id: \"fields\", label: \"Name & shape\", description: \"Fields\" },\n { id: \"review\", label: \"Review\", description: \"Save\" },\n] as const;\n\nexport function filterProfileFields(\n fields: ProfileColumn[],\n selectedNames: Set<string>,\n filter: ProfileFieldFilter,\n): ProfileColumn[] {\n const query = filter.query.trim().toLowerCase();\n return fields.filter((field) => {\n const selected = selectedNames.has(field.name);\n if (filter.selection === \"selected\" && !selected) return false;\n if (filter.selection === \"unselected\" && selected) return false;\n if (filter.type && field.type !== filter.type) return false;\n if (!query) return true;\n return `${field.name} ${field.label ?? \"\"}`.toLowerCase().includes(query);\n });\n}\n\n/**\n * Every field the editors can show, each in its configured form. A discovered\n * field is a snapshot of what the source reported — the configured one carries\n * the user's edits, so it is the only version safe to render into a control or\n * to patch on top of.\n *\n * The configuration owns the order, because it is the order the profile renders\n * its columns in and the one the user drags rows into. A discovered field that\n * was never configured (not selected, or dropped from the profile) has no place\n * of its own, so it keeps the one it had: it is anchored just after whichever\n * configured field preceded it in the sample.\n */\nexport function availableProfileFields(\n discovered: ProfileColumn[],\n configured: ProfileColumn[],\n): ProfileColumn[] {\n const configuredByName = new Map(\n configured.map((field) => [field.name, field]),\n );\n const configuredBySource = new Map(\n configured\n .filter((field) => field.source)\n .map((field) => [field.source as string, field]),\n );\n const ordered = [...configured];\n let anchor = 0;\n for (const field of discovered) {\n const match =\n configuredByName.get(field.name) ?? configuredBySource.get(field.name);\n if (match) {\n anchor = ordered.indexOf(match) + 1;\n continue;\n }\n ordered.splice(anchor, 0, field);\n anchor += 1;\n }\n return ordered;\n}\n\n/**\n * Moves the named column onto the target's position, shifting the columns\n * between them — the drop semantics the field grid's row drag needs. Columns\n * are addressed by name because a drag only ever carries the row's identity.\n * A name that is not configured has no position, so the order is returned\n * unchanged rather than guessed at.\n */\nexport function reorderProfileColumns(\n columns: ProfileColumn[],\n sourceName: string,\n targetName: string,\n): ProfileColumn[] {\n const from = columns.findIndex((column) => column.name === sourceName);\n const to = columns.findIndex((column) => column.name === targetName);\n if (from < 0 || to < 0 || from === to) return columns;\n const next = [...columns];\n next.splice(to, 0, ...next.splice(from, 1));\n return next;\n}\n\n/**\n * Selects or deselects the named fields, keeping the configured order intact —\n * a re-selected field returns to where the grid already showed it rather than\n * to the back of the list or to its position in the sample.\n */\nexport function applyVisibleFieldSelection(\n discovered: ProfileColumn[],\n configured: ProfileColumn[],\n visibleNames: Set<string>,\n selected: boolean,\n): ProfileColumn[] {\n const selectedNames = new Set(configured.map((field) => field.name));\n for (const name of visibleNames) {\n if (selected) selectedNames.add(name);\n else selectedNames.delete(name);\n }\n return availableProfileFields(discovered, configured).filter((field) =>\n selectedNames.has(field.name),\n );\n}\n\n/** The control kinds a column filter can render as, with the server's own\n * wording. Mirrors query.ColumnFilterKindValues() and the x-enum-labels the\n * profile schema carries for them. */\nexport const PROFILE_FILTER_KIND_OPTIONS = [\n { value: \"terms\", label: \"Value selection\" },\n { value: \"range\", label: \"Numeric range\" },\n { value: \"time\", label: \"Time range\" },\n { value: \"boolean\", label: \"Yes/no\" },\n { value: \"text\", label: \"Substring\" },\n { value: \"none\", label: \"Not filterable\" },\n] as const;\n\n/** The server's own default, so an unset limit can be shown for what it does.\n * Mirrors query.DefaultFilterLookupLimit. */\nexport const PROFILE_FILTER_DEFAULT_LIMIT = 50;\n\n/** Mirrors query.MaxFilterLookupLimit — the largest head a lookup will serve. */\nexport const PROFILE_FILTER_MAX_LIMIT = 200;\n\n/**\n * Merges one filter knob into a column's filter block, dropping the block once\n * nothing is left in it.\n *\n * The distinction matters on save: `filter: {}` is a declaration that declares\n * nothing, and the server reads a present-but-empty block differently from an\n * absent one — unchecking the last box has to mean \"infer this again\", not\n * \"override it with silence\".\n */\nexport function patchColumnFilter(\n filter: ProfileColumnFilter | undefined,\n patch: Patch<ProfileColumnFilter>,\n): ProfileColumnFilter | undefined {\n const merged = Object.fromEntries(\n Object.entries({ ...filter, ...patch }).filter(([, value]) => value !== undefined),\n ) as ProfileColumnFilter;\n return Object.keys(merged).length ? merged : undefined;\n}\n\n/** What the server picks for a column that declares no filter kind. Mirrors\n * columnFilterKindFor; text is absent there on purpose, so it is here too. */\nexport function inferredFilterKind(column: ProfileColumn): string {\n switch (column.type) {\n case \"number\":\n case \"duration\":\n case \"bytes\":\n return \"range\";\n case \"datetime\":\n return \"time\";\n case \"boolean\":\n return \"boolean\";\n case \"key_value\":\n case \"key_values\":\n case \"json\":\n return \"none\";\n default:\n return \"terms\";\n }\n}\n\nexport function patchProfileField(\n field: ProfileColumn,\n patch: Patch<ProfileColumn>,\n): ProfileColumn {\n return Object.fromEntries(\n Object.entries({ ...field, ...patch }).filter(\n ([, value]) => value !== undefined,\n ),\n ) as ProfileColumn;\n}\n\nexport function renameProfileField(\n field: ProfileColumn,\n name: string,\n): ProfileColumn {\n const source = field.source ?? (field.cel ? undefined : field.name);\n return patchProfileField(field, {\n name,\n source: source === name ? undefined : source,\n });\n}\n\nexport function providerTypeFromConnectionLabel(label: string): string | null {\n const match = label.match(/\\(([^()]+)\\)\\s*$/);\n return match?.[1]?.trim() || null;\n}\n\nexport function profileConnectionID(value: string): string | null {\n const prefix = \"connection://\";\n if (!value.startsWith(prefix)) return null;\n return value.slice(prefix.length).trim() || null;\n}\n\nexport function profileWizardErrorMessage(\n error: unknown,\n fallback: string,\n): string {\n return error instanceof Error && error.message.trim()\n ? error.message.trim()\n : fallback;\n}\n\n/**\n * A profile says what to fetch either as a raw query or as a structured search\n * specification — never both, which is why this is an either/or rather than a\n * check on `query` alone.\n */\nexport function profileWizardHasQuery(draft: ProfileWizardDraft): boolean {\n return Boolean(\n draft.query?.trim() || draft.provider?.options?.search !== undefined,\n );\n}\n\nexport function profileWizardStepReady(\n step: (typeof profileWizardSteps)[number][\"id\"],\n draft: ProfileWizardDraft,\n discovered: ProfileColumn[],\n): boolean {\n if (step === \"source\") {\n return Boolean(draft.provider?.connection && draft.provider.type);\n }\n if (step === \"query\") {\n return Boolean(profileWizardHasQuery(draft) && discovered.length > 0);\n }\n if (step === \"fields\") {\n return Boolean(draft.profile?.trim() && draft.columns?.length);\n }\n return (\n Boolean(draft.profile?.trim() && draft.provider?.connection) &&\n discovered.length > 0\n );\n}\n"],"names":[],"mappings":";;AAwCO,SAAS,WAA6B,OAAU,OAAoB;AACzE,QAAM,OAAO,EAAE,GAAG,MAAA;AAClB,aAAW,CAAC,KAAK,KAAK,KAAK,OAAO,QAAQ,KAAK,GAAG;AAChD,QAAI,UAAU,OAAW,QAAO,KAAK,GAAc;AAAA,QAC9C,MAAK,GAAc,IAAI;AAAA,EAC9B;AACA,SAAO;AACT;AAkDO,MAAM,2BAA6C,CAAC,QAAQ,MAAM;AAElE,SAAS,gBAAgB,OAA4B;AAC1D,SAAO,MAAM,SAAS,UAAa,yBAAyB,SAAS,MAAM,IAAI;AACjF;AAsBO,SAAS,kBACd,OACA,QACG;AACH,QAAM,OAAO,EAAE,GAAG,MAAA;AAClB,M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rowserModel';
|
|
2
|
+
/** How a column is filtered at the backend; every field overrides an inference
|
|
3
|
+
* the server would otherwise make from the column itself. */
|
|
4
|
+
export type ProfileColumnFilter = {
|
|
5
|
+
/** Backend field the selection applies to; blank infers it from the column. */
|
|
6
|
+
field?: string;
|
|
7
|
+
/** terms, range, time, boolean, text or none; blank infers it from the type. */
|
|
8
|
+
kind?: string;
|
|
9
|
+
/** Enumerated values, replacing the backend lookup. */
|
|
10
|
+
options?: string[];
|
|
11
|
+
/** Ask the backend for this field's distinct values. */
|
|
12
|
+
lookup?: boolean;
|
|
13
|
+
/** How many of those values the control offers before the rest are typed for. */
|
|
14
|
+
limit?: number;
|
|
15
|
+
/** Allow several values at once. */
|
|
16
|
+
multi?: boolean;
|
|
17
|
+
/** Offer no filter while keeping the column rendered. */
|
|
18
|
+
disabled?: boolean;
|
|
19
|
+
};
|
|
20
|
+
/**
|
|
21
|
+
* A patch of T: every key optional, and explicitly settable to `undefined` to
|
|
22
|
+
* clear it.
|
|
23
|
+
*
|
|
24
|
+
* Not Partial<T>. Under `exactOptionalPropertyTypes` an optional key may be
|
|
25
|
+
* absent but not present-and-undefined, and "clear this field" — which is what
|
|
26
|
+
* every editor control sends when its input goes empty — is precisely a present
|
|
27
|
+
* `undefined`. The patch appliers drop those keys; the type has to permit them.
|
|
28
|
+
*/
|
|
29
|
+
export type Patch<T> = {
|
|
30
|
+
[K in keyof T]?: T[K] | undefined;
|
|
31
|
+
};
|
|
32
|
+
/**
|
|
33
|
+
* Applies a patch, removing the keys it clears instead of leaving them present
|
|
34
|
+
* and undefined.
|
|
35
|
+
*
|
|
36
|
+
* Spreading a patch would keep them, and these objects are serialized to the
|
|
37
|
+
* server, where a present `field: undefined` is a key to interpret rather than
|
|
38
|
+
* an absent one.
|
|
39
|
+
*/
|
|
40
|
+
export declare function applyPatch<T extends object>(value: T, patch: Patch<T>): T;
|
|
41
|
+
export type ProfileColumn = {
|
|
42
|
+
name: string;
|
|
43
|
+
source?: string;
|
|
44
|
+
label?: string;
|
|
45
|
+
type?: string;
|
|
46
|
+
kind?: string;
|
|
47
|
+
format?: string;
|
|
48
|
+
unit?: string;
|
|
49
|
+
width?: number;
|
|
50
|
+
cel?: string;
|
|
51
|
+
/** Path computing the value, rooted at the row or at `source` when set. */
|
|
52
|
+
jsonpath?: string;
|
|
53
|
+
hidden?: boolean;
|
|
54
|
+
filter?: ProfileColumnFilter;
|
|
55
|
+
[key: string]: unknown;
|
|
56
|
+
};
|
|
57
|
+
export type ProfileProvider = {
|
|
58
|
+
type?: string;
|
|
59
|
+
connection?: string;
|
|
60
|
+
options?: Record<string, unknown>;
|
|
61
|
+
[key: string]: unknown;
|
|
62
|
+
};
|
|
63
|
+
/** The parameter types the profile schema accepts. */
|
|
64
|
+
export type ParamDraftType = "string" | "number" | "boolean" | "date" | "enum" | "list";
|
|
65
|
+
/** filter, limit, offset, time-from or time-to; empty behaves as filter. */
|
|
66
|
+
export type ParamDraftRole = "filter" | "limit" | "offset" | "time-from" | "time-to";
|
|
67
|
+
export type ParamDraft = {
|
|
68
|
+
name?: string | undefined;
|
|
69
|
+
label?: string | undefined;
|
|
70
|
+
type?: ParamDraftType | undefined;
|
|
71
|
+
role?: ParamDraftRole | undefined;
|
|
72
|
+
default?: unknown | undefined;
|
|
73
|
+
options?: string[] | undefined;
|
|
74
|
+
required?: boolean | undefined;
|
|
75
|
+
description?: string | undefined;
|
|
76
|
+
/** Value rewrite; {value} is the supplied value. */
|
|
77
|
+
template?: string | undefined;
|
|
78
|
+
/** Backend field a list parameter filters on. Setting it lets a value be
|
|
79
|
+
* excluded as well as included; it requires an OpenSearch-backed provider. */
|
|
80
|
+
field?: string | undefined;
|
|
81
|
+
};
|
|
82
|
+
/** PARAM_TYPES_WITH_OPTIONS are the types whose values come from a fixed set, so
|
|
83
|
+
* the editor offers an options picker for them. */
|
|
84
|
+
export declare const PARAM_TYPES_WITH_OPTIONS: ParamDraftType[];
|
|
85
|
+
export declare function paramHasOptions(param: ParamDraft): boolean;
|
|
86
|
+
export type ProfileWizardDraft = Record<string, unknown> & {
|
|
87
|
+
namespace?: string | undefined;
|
|
88
|
+
profile?: string | undefined;
|
|
89
|
+
/** Overrides the sidebar/picker glyph the provider type would otherwise give. */
|
|
90
|
+
icon?: string | undefined;
|
|
91
|
+
provider?: ProfileProvider | undefined;
|
|
92
|
+
query?: string | undefined;
|
|
93
|
+
columns?: ProfileColumn[] | undefined;
|
|
94
|
+
/** The inputs a run binds — by name in the query, the provider options or the
|
|
95
|
+
* connection. The query workspace previews against their defaults. */
|
|
96
|
+
params?: ParamDraft[] | undefined;
|
|
97
|
+
/** The row caps this profile sets for itself; unset ones take their default. */
|
|
98
|
+
limits?: ProfileRowLimits | undefined;
|
|
99
|
+
};
|
|
100
|
+
/**
|
|
101
|
+
* A profile that caps nothing carries no block at all, so the defaults are what
|
|
102
|
+
* it inherits rather than what it froze at the moment it was edited. Both draft
|
|
103
|
+
* hosts write the caps through this, so neither can leave an empty map behind.
|
|
104
|
+
*/
|
|
105
|
+
export declare function withProfileLimits<T extends ProfileWizardDraft>(draft: T, limits: ProfileRowLimits | undefined): T;
|
|
106
|
+
export type ProfileFieldFilter = {
|
|
107
|
+
query: string;
|
|
108
|
+
type: string;
|
|
109
|
+
selection: "all" | "selected" | "unselected";
|
|
110
|
+
};
|
|
111
|
+
export declare const PROFILE_COLUMN_FORMAT_OPTIONS: readonly [{
|
|
112
|
+
readonly value: "date";
|
|
113
|
+
readonly label: "Date/time";
|
|
114
|
+
}, {
|
|
115
|
+
readonly value: "float";
|
|
116
|
+
readonly label: "Number";
|
|
117
|
+
}, {
|
|
118
|
+
readonly value: "duration";
|
|
119
|
+
readonly label: "Duration";
|
|
120
|
+
}, {
|
|
121
|
+
readonly value: "bytes";
|
|
122
|
+
readonly label: "Bytes";
|
|
123
|
+
}, {
|
|
124
|
+
readonly value: "currency";
|
|
125
|
+
readonly label: "Currency";
|
|
126
|
+
}];
|
|
127
|
+
export declare const PROFILE_COLUMN_UNIT_OPTIONS: readonly [{
|
|
128
|
+
readonly value: "none";
|
|
129
|
+
readonly label: "Compact count";
|
|
130
|
+
}, {
|
|
131
|
+
readonly value: "short";
|
|
132
|
+
readonly label: "Short number";
|
|
133
|
+
}, {
|
|
134
|
+
readonly value: "percent";
|
|
135
|
+
readonly label: "Percent (0-100)";
|
|
136
|
+
}, {
|
|
137
|
+
readonly value: "percentunit";
|
|
138
|
+
readonly label: "Percent (0-1)";
|
|
139
|
+
}, {
|
|
140
|
+
readonly value: "bytes";
|
|
141
|
+
readonly label: "Bytes (IEC)";
|
|
142
|
+
}, {
|
|
143
|
+
readonly value: "decbytes";
|
|
144
|
+
readonly label: "Bytes (SI)";
|
|
145
|
+
}, {
|
|
146
|
+
readonly value: "Bps";
|
|
147
|
+
readonly label: "Bytes/sec";
|
|
148
|
+
}, {
|
|
149
|
+
readonly value: "binBps";
|
|
150
|
+
readonly label: "Binary bytes/sec";
|
|
151
|
+
}, {
|
|
152
|
+
readonly value: "ms";
|
|
153
|
+
readonly label: "Milliseconds";
|
|
154
|
+
}, {
|
|
155
|
+
readonly value: "s";
|
|
156
|
+
readonly label: "Seconds";
|
|
157
|
+
}];
|
|
158
|
+
export declare const profileWizardSteps: readonly [{
|
|
159
|
+
readonly id: "source";
|
|
160
|
+
readonly label: "Choose source";
|
|
161
|
+
readonly description: "Connection";
|
|
162
|
+
}, {
|
|
163
|
+
readonly id: "query";
|
|
164
|
+
readonly label: "Explore & sample";
|
|
165
|
+
readonly description: "Query";
|
|
166
|
+
}, {
|
|
167
|
+
readonly id: "fields";
|
|
168
|
+
readonly label: "Name & shape";
|
|
169
|
+
readonly description: "Fields";
|
|
170
|
+
}, {
|
|
171
|
+
readonly id: "review";
|
|
172
|
+
readonly label: "Review";
|
|
173
|
+
readonly description: "Save";
|
|
174
|
+
}];
|
|
175
|
+
export declare function filterProfileFields(fields: ProfileColumn[], selectedNames: Set<string>, filter: ProfileFieldFilter): ProfileColumn[];
|
|
176
|
+
/**
|
|
177
|
+
* Every field the editors can show, each in its configured form. A discovered
|
|
178
|
+
* field is a snapshot of what the source reported — the configured one carries
|
|
179
|
+
* the user's edits, so it is the only version safe to render into a control or
|
|
180
|
+
* to patch on top of.
|
|
181
|
+
*
|
|
182
|
+
* The configuration owns the order, because it is the order the profile renders
|
|
183
|
+
* its columns in and the one the user drags rows into. A discovered field that
|
|
184
|
+
* was never configured (not selected, or dropped from the profile) has no place
|
|
185
|
+
* of its own, so it keeps the one it had: it is anchored just after whichever
|
|
186
|
+
* configured field preceded it in the sample.
|
|
187
|
+
*/
|
|
188
|
+
export declare function availableProfileFields(discovered: ProfileColumn[], configured: ProfileColumn[]): ProfileColumn[];
|
|
189
|
+
/**
|
|
190
|
+
* Moves the named column onto the target's position, shifting the columns
|
|
191
|
+
* between them — the drop semantics the field grid's row drag needs. Columns
|
|
192
|
+
* are addressed by name because a drag only ever carries the row's identity.
|
|
193
|
+
* A name that is not configured has no position, so the order is returned
|
|
194
|
+
* unchanged rather than guessed at.
|
|
195
|
+
*/
|
|
196
|
+
export declare function reorderProfileColumns(columns: ProfileColumn[], sourceName: string, targetName: string): ProfileColumn[];
|
|
197
|
+
/**
|
|
198
|
+
* Selects or deselects the named fields, keeping the configured order intact —
|
|
199
|
+
* a re-selected field returns to where the grid already showed it rather than
|
|
200
|
+
* to the back of the list or to its position in the sample.
|
|
201
|
+
*/
|
|
202
|
+
export declare function applyVisibleFieldSelection(discovered: ProfileColumn[], configured: ProfileColumn[], visibleNames: Set<string>, selected: boolean): ProfileColumn[];
|
|
203
|
+
/** The control kinds a column filter can render as, with the server's own
|
|
204
|
+
* wording. Mirrors query.ColumnFilterKindValues() and the x-enum-labels the
|
|
205
|
+
* profile schema carries for them. */
|
|
206
|
+
export declare const PROFILE_FILTER_KIND_OPTIONS: readonly [{
|
|
207
|
+
readonly value: "terms";
|
|
208
|
+
readonly label: "Value selection";
|
|
209
|
+
}, {
|
|
210
|
+
readonly value: "range";
|
|
211
|
+
readonly label: "Numeric range";
|
|
212
|
+
}, {
|
|
213
|
+
readonly value: "time";
|
|
214
|
+
readonly label: "Time range";
|
|
215
|
+
}, {
|
|
216
|
+
readonly value: "boolean";
|
|
217
|
+
readonly label: "Yes/no";
|
|
218
|
+
}, {
|
|
219
|
+
readonly value: "text";
|
|
220
|
+
readonly label: "Substring";
|
|
221
|
+
}, {
|
|
222
|
+
readonly value: "none";
|
|
223
|
+
readonly label: "Not filterable";
|
|
224
|
+
}];
|
|
225
|
+
/** The server's own default, so an unset limit can be shown for what it does.
|
|
226
|
+
* Mirrors query.DefaultFilterLookupLimit. */
|
|
227
|
+
export declare const PROFILE_FILTER_DEFAULT_LIMIT = 50;
|
|
228
|
+
/** Mirrors query.MaxFilterLookupLimit — the largest head a lookup will serve. */
|
|
229
|
+
export declare const PROFILE_FILTER_MAX_LIMIT = 200;
|
|
230
|
+
/**
|
|
231
|
+
* Merges one filter knob into a column's filter block, dropping the block once
|
|
232
|
+
* nothing is left in it.
|
|
233
|
+
*
|
|
234
|
+
* The distinction matters on save: `filter: {}` is a declaration that declares
|
|
235
|
+
* nothing, and the server reads a present-but-empty block differently from an
|
|
236
|
+
* absent one — unchecking the last box has to mean "infer this again", not
|
|
237
|
+
* "override it with silence".
|
|
238
|
+
*/
|
|
239
|
+
export declare function patchColumnFilter(filter: ProfileColumnFilter | undefined, patch: Patch<ProfileColumnFilter>): ProfileColumnFilter | undefined;
|
|
240
|
+
/** What the server picks for a column that declares no filter kind. Mirrors
|
|
241
|
+
* columnFilterKindFor; text is absent there on purpose, so it is here too. */
|
|
242
|
+
export declare function inferredFilterKind(column: ProfileColumn): string;
|
|
243
|
+
export declare function patchProfileField(field: ProfileColumn, patch: Patch<ProfileColumn>): ProfileColumn;
|
|
244
|
+
export declare function renameProfileField(field: ProfileColumn, name: string): ProfileColumn;
|
|
245
|
+
export declare function providerTypeFromConnectionLabel(label: string): string | null;
|
|
246
|
+
export declare function profileConnectionID(value: string): string | null;
|
|
247
|
+
export declare function profileWizardErrorMessage(error: unknown, fallback: string): string;
|
|
248
|
+
/**
|
|
249
|
+
* A profile says what to fetch either as a raw query or as a structured search
|
|
250
|
+
* specification — never both, which is why this is an either/or rather than a
|
|
251
|
+
* check on `query` alone.
|
|
252
|
+
*/
|
|
253
|
+
export declare function profileWizardHasQuery(draft: ProfileWizardDraft): boolean;
|
|
254
|
+
export declare function profileWizardStepReady(step: (typeof profileWizardSteps)[number]["id"], draft: ProfileWizardDraft, discovered: ProfileColumn[]): boolean;
|
|
255
|
+
//# sourceMappingURL=profileWizardModel.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"profileWizardModel.d.ts","sourceRoot":"","sources":["../../src/profiles/profileWizardModel.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAEjE;8DAC8D;AAC9D,MAAM,MAAM,mBAAmB,GAAG;IAChC,+EAA+E;IAC/E,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,gFAAgF;IAChF,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,uDAAuD;IACvD,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;IACnB,wDAAwD;IACxD,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,iFAAiF;IACjF,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,oCAAoC;IACpC,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,yDAAyD;IACzD,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB,CAAC;AAEF;;;;;;;;GAQG;AACH,MAAM,MAAM,KAAK,CAAC,CAAC,IAAI;KAAG,CAAC,IAAI,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,GAAG,SAAS;CAAE,CAAC;AAE7D;;;;;;;GAOG;AACH,wBAAgB,UAAU,CAAC,CAAC,SAAS,MAAM,EAAE,KAAK,EAAE,CAAC,EAAE,KAAK,EAAE,KAAK,CAAC,CAAC,CAAC,GAAG,C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